From 95411e59648b529a7fff3db11b7ee4adf535d81c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 18:37:53 +0000 Subject: [PATCH 001/358] feat(api): api update (#2356) --- .stats.yml | 2 +- .../types/zero_trust/gateway/rule_setting.py | 32 ++++++++++++++++--- .../zero_trust/gateway/rule_setting_param.py | 32 ++++++++++++++++--- .../zero_trust/gateway/test_rules.py | 16 ++++++++++ 4 files changed, 71 insertions(+), 11 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0858e86c2f0..f0ec020f40a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1493 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3d78f855257b55bbb80884f99c3802cae877968d140eed3557fcb2cdd5f937b3.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-56f3021fb085763371fa342d21f231ef420fbfdddf6599c584bc84e609c421fa.yml diff --git a/src/cloudflare/types/zero_trust/gateway/rule_setting.py b/src/cloudflare/types/zero_trust/gateway/rule_setting.py index 60b6eff04c4..3d73a0b442c 100644 --- a/src/cloudflare/types/zero_trust/gateway/rule_setting.py +++ b/src/cloudflare/types/zero_trust/gateway/rule_setting.py @@ -18,6 +18,7 @@ "NotificationSettings", "PayloadLog", "Quarantine", + "ResolveDNSInternally", "UntrustedCERT", ] @@ -107,6 +108,18 @@ class Quarantine(BaseModel): """Types of files to sandbox.""" +class ResolveDNSInternally(BaseModel): + fallback: Optional[Literal["none", "public_dns"]] = None + """ + The fallback behavior to apply when the internal DNS response code is different + from 'NOERROR' or when the response data only contains CNAME records for 'A' or + 'AAAA' queries. + """ + + view_id: Optional[str] = None + """The internal DNS view identifier that's passed to the internal DNS service.""" + + class UntrustedCERT(BaseModel): action: Optional[Literal["pass_through", "block", "error"]] = None """The action performed when an untrusted certificate is seen. @@ -149,9 +162,9 @@ class RuleSetting(BaseModel): dns_resolvers: Optional[DNSResolvers] = None """Add your own custom resolvers to route queries that match the resolver policy. - Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will - route to the address closest to their origin. Only valid when a rule's action is - set to 'resolve'. + Cannot be used when 'resolve_dns_through_cloudflare' or 'resolve_dns_internally' + are set. DNS queries will route to the address closest to their origin. Only + valid when a rule's action is set to 'resolve'. """ egress: Optional[Egress] = None @@ -204,11 +217,20 @@ class RuleSetting(BaseModel): quarantine: Optional[Quarantine] = None """Settings that apply to quarantine rules""" + resolve_dns_internally: Optional[ResolveDNSInternally] = None + """ + Configure to forward the query to the internal DNS service, passing the + specified 'view_id' as input. Cannot be set when 'dns_resolvers' are specified + or 'resolve_dns_through_cloudflare' is set. Only valid when a rule's action is + set to 'resolve'. + """ + resolve_dns_through_cloudflare: Optional[bool] = None """ Enable to send queries that match the policy to Cloudflare's default 1.1.1.1 DNS - resolver. Cannot be set when dns_resolvers are specified. Only valid when a - rule's action is set to 'resolve'. + resolver. Cannot be set when 'dns_resolvers' are specified or + 'resolve_dns_internally' is set. Only valid when a rule's action is set to + 'resolve'. """ untrusted_cert: Optional[UntrustedCERT] = None diff --git a/src/cloudflare/types/zero_trust/gateway/rule_setting_param.py b/src/cloudflare/types/zero_trust/gateway/rule_setting_param.py index 11da19fb61f..6f3884920e2 100644 --- a/src/cloudflare/types/zero_trust/gateway/rule_setting_param.py +++ b/src/cloudflare/types/zero_trust/gateway/rule_setting_param.py @@ -19,6 +19,7 @@ "NotificationSettings", "PayloadLog", "Quarantine", + "ResolveDNSInternally", "UntrustedCERT", ] @@ -108,6 +109,18 @@ class Quarantine(TypedDict, total=False): """Types of files to sandbox.""" +class ResolveDNSInternally(TypedDict, total=False): + fallback: Literal["none", "public_dns"] + """ + The fallback behavior to apply when the internal DNS response code is different + from 'NOERROR' or when the response data only contains CNAME records for 'A' or + 'AAAA' queries. + """ + + view_id: str + """The internal DNS view identifier that's passed to the internal DNS service.""" + + class UntrustedCERT(TypedDict, total=False): action: Literal["pass_through", "block", "error"] """The action performed when an untrusted certificate is seen. @@ -150,9 +163,9 @@ class RuleSettingParam(TypedDict, total=False): dns_resolvers: DNSResolvers """Add your own custom resolvers to route queries that match the resolver policy. - Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will - route to the address closest to their origin. Only valid when a rule's action is - set to 'resolve'. + Cannot be used when 'resolve_dns_through_cloudflare' or 'resolve_dns_internally' + are set. DNS queries will route to the address closest to their origin. Only + valid when a rule's action is set to 'resolve'. """ egress: Egress @@ -205,11 +218,20 @@ class RuleSettingParam(TypedDict, total=False): quarantine: Quarantine """Settings that apply to quarantine rules""" + resolve_dns_internally: ResolveDNSInternally + """ + Configure to forward the query to the internal DNS service, passing the + specified 'view_id' as input. Cannot be set when 'dns_resolvers' are specified + or 'resolve_dns_through_cloudflare' is set. Only valid when a rule's action is + set to 'resolve'. + """ + resolve_dns_through_cloudflare: bool """ Enable to send queries that match the policy to Cloudflare's default 1.1.1.1 DNS - resolver. Cannot be set when dns_resolvers are specified. Only valid when a - rule's action is set to 'resolve'. + resolver. Cannot be set when 'dns_resolvers' are specified or + 'resolve_dns_internally' is set. Only valid when a rule's action is set to + 'resolve'. """ untrusted_cert: UntrustedCERT diff --git a/tests/api_resources/zero_trust/gateway/test_rules.py b/tests/api_resources/zero_trust/gateway/test_rules.py index 8852212a8b5..e1ed5506b92 100644 --- a/tests/api_resources/zero_trust/gateway/test_rules.py +++ b/tests/api_resources/zero_trust/gateway/test_rules.py @@ -105,6 +105,10 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "override_ips": ["1.1.1.1", "2.2.2.2"], "payload_log": {"enabled": True}, "quarantine": {"file_types": ["exe"]}, + "resolve_dns_internally": { + "fallback": "none", + "view_id": "view_id", + }, "resolve_dns_through_cloudflare": True, "untrusted_cert": {"action": "pass_through"}, }, @@ -245,6 +249,10 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "override_ips": ["1.1.1.1", "2.2.2.2"], "payload_log": {"enabled": True}, "quarantine": {"file_types": ["exe"]}, + "resolve_dns_internally": { + "fallback": "none", + "view_id": "view_id", + }, "resolve_dns_through_cloudflare": True, "untrusted_cert": {"action": "pass_through"}, }, @@ -580,6 +588,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "override_ips": ["1.1.1.1", "2.2.2.2"], "payload_log": {"enabled": True}, "quarantine": {"file_types": ["exe"]}, + "resolve_dns_internally": { + "fallback": "none", + "view_id": "view_id", + }, "resolve_dns_through_cloudflare": True, "untrusted_cert": {"action": "pass_through"}, }, @@ -720,6 +732,10 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "override_ips": ["1.1.1.1", "2.2.2.2"], "payload_log": {"enabled": True}, "quarantine": {"file_types": ["exe"]}, + "resolve_dns_internally": { + "fallback": "none", + "view_id": "view_id", + }, "resolve_dns_through_cloudflare": True, "untrusted_cert": {"action": "pass_through"}, }, From 28eab5d101f9322ec2fea85aaae712d956ea2800 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 21:10:54 +0000 Subject: [PATCH 002/358] feat(api): api update (#2358) --- .stats.yml | 2 +- .../access/application_create_params.py | 123 ++++++-- .../access/application_create_response.py | 123 ++++++-- .../access/application_get_response.py | 123 ++++++-- .../access/application_list_response.py | 123 ++++++-- .../access/application_update_params.py | 123 ++++++-- .../access/application_update_response.py | 123 ++++++-- .../identity_provider_scim_config.py | 5 +- .../zero_trust/access/test_applications.py | 288 +++++++++++++----- 9 files changed, 851 insertions(+), 182 deletions(-) diff --git a/.stats.yml b/.stats.yml index f0ec020f40a..c370f57faf5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1493 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-56f3021fb085763371fa342d21f231ef420fbfdddf6599c584bc84e609c421fa.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aa37f1d5ad51f57618e40b780a4b8f2cc09463bbd9e3ac330ac1f1d2aa1742e5.yml diff --git a/src/cloudflare/types/zero_trust/access/application_create_params.py b/src/cloudflare/types/zero_trust/access/application_create_params.py index 54c921e854c..8f28b6ec26a 100644 --- a/src/cloudflare/types/zero_trust/access/application_create_params.py +++ b/src/cloudflare/types/zero_trust/access/application_create_params.py @@ -23,6 +23,8 @@ "ApplicationCreateParams", "SelfHostedApplication", "SelfHostedApplicationDestination", + "SelfHostedApplicationDestinationPublicDestination", + "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationPolicy", "SelfHostedApplicationPolicyAccessAppPolicyLink", "SelfHostedApplicationPolicyUnionMember2", @@ -43,6 +45,8 @@ "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", + "BrowserSSHApplicationDestinationPublicDestination", + "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationPolicyAccessAppPolicyLink", "BrowserSSHApplicationPolicyUnionMember2", @@ -53,6 +57,8 @@ "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", + "BrowserVNCApplicationDestinationPublicDestination", + "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationPolicyAccessAppPolicyLink", "BrowserVNCApplicationPolicyUnionMember2", @@ -257,20 +263,47 @@ class SelfHostedApplication(TypedDict, total=False): """ -class SelfHostedApplicationDestination(TypedDict, total=False): - type: Literal["public", "private"] +class SelfHostedApplicationDestinationPublicDestination(TypedDict, total=False): + type: Literal["public"] uri: str """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class SelfHostedApplicationDestinationPrivateDestination(TypedDict, total=False): + cidr: str + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: str + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Literal["tcp", "udp"] + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: str + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Literal["private"] + + vnet_id: str + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +SelfHostedApplicationDestination: TypeAlias = Union[ + SelfHostedApplicationDestinationPublicDestination, SelfHostedApplicationDestinationPrivateDestination +] + + class SelfHostedApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): id: str """The UUID of the policy""" @@ -764,20 +797,47 @@ class BrowserSSHApplication(TypedDict, total=False): """ -class BrowserSSHApplicationDestination(TypedDict, total=False): - type: Literal["public", "private"] +class BrowserSSHApplicationDestinationPublicDestination(TypedDict, total=False): + type: Literal["public"] uri: str """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserSSHApplicationDestinationPrivateDestination(TypedDict, total=False): + cidr: str + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: str + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Literal["tcp", "udp"] + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: str + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Literal["private"] + + vnet_id: str + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserSSHApplicationDestination: TypeAlias = Union[ + BrowserSSHApplicationDestinationPublicDestination, BrowserSSHApplicationDestinationPrivateDestination +] + + class BrowserSSHApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): id: str """The UUID of the policy""" @@ -1070,20 +1130,47 @@ class BrowserVNCApplication(TypedDict, total=False): """ -class BrowserVNCApplicationDestination(TypedDict, total=False): - type: Literal["public", "private"] +class BrowserVNCApplicationDestinationPublicDestination(TypedDict, total=False): + type: Literal["public"] uri: str """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserVNCApplicationDestinationPrivateDestination(TypedDict, total=False): + cidr: str + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: str + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Literal["tcp", "udp"] + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: str + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Literal["private"] + + vnet_id: str + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserVNCApplicationDestination: TypeAlias = Union[ + BrowserVNCApplicationDestinationPublicDestination, BrowserVNCApplicationDestinationPrivateDestination +] + + class BrowserVNCApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): id: str """The UUID of the policy""" diff --git a/src/cloudflare/types/zero_trust/access/application_create_response.py b/src/cloudflare/types/zero_trust/access/application_create_response.py index cc4872de0c6..1f3a5fdb214 100644 --- a/src/cloudflare/types/zero_trust/access/application_create_response.py +++ b/src/cloudflare/types/zero_trust/access/application_create_response.py @@ -23,6 +23,8 @@ "ApplicationCreateResponse", "SelfHostedApplication", "SelfHostedApplicationDestination", + "SelfHostedApplicationDestinationPublicDestination", + "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationPolicy", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", @@ -39,6 +41,8 @@ "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", + "BrowserSSHApplicationDestinationPublicDestination", + "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", @@ -47,6 +51,8 @@ "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", + "BrowserVNCApplicationDestinationPublicDestination", + "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", @@ -99,20 +105,47 @@ ] -class SelfHostedApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class SelfHostedApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class SelfHostedApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +SelfHostedApplicationDestination: TypeAlias = Union[ + SelfHostedApplicationDestinationPublicDestination, SelfHostedApplicationDestinationPrivateDestination +] + + class SelfHostedApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -507,20 +540,47 @@ class SaaSApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserSSHApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class BrowserSSHApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserSSHApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserSSHApplicationDestination: TypeAlias = Union[ + BrowserSSHApplicationDestinationPublicDestination, BrowserSSHApplicationDestinationPrivateDestination +] + + class BrowserSSHApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -762,20 +822,47 @@ class BrowserSSHApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserVNCApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class BrowserVNCApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserVNCApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserVNCApplicationDestination: TypeAlias = Union[ + BrowserVNCApplicationDestinationPublicDestination, BrowserVNCApplicationDestinationPrivateDestination +] + + class BrowserVNCApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. diff --git a/src/cloudflare/types/zero_trust/access/application_get_response.py b/src/cloudflare/types/zero_trust/access/application_get_response.py index 602389f778c..cffacb3a76a 100644 --- a/src/cloudflare/types/zero_trust/access/application_get_response.py +++ b/src/cloudflare/types/zero_trust/access/application_get_response.py @@ -23,6 +23,8 @@ "ApplicationGetResponse", "SelfHostedApplication", "SelfHostedApplicationDestination", + "SelfHostedApplicationDestinationPublicDestination", + "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationPolicy", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", @@ -39,6 +41,8 @@ "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", + "BrowserSSHApplicationDestinationPublicDestination", + "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", @@ -47,6 +51,8 @@ "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", + "BrowserVNCApplicationDestinationPublicDestination", + "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", @@ -99,20 +105,47 @@ ] -class SelfHostedApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class SelfHostedApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class SelfHostedApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +SelfHostedApplicationDestination: TypeAlias = Union[ + SelfHostedApplicationDestinationPublicDestination, SelfHostedApplicationDestinationPrivateDestination +] + + class SelfHostedApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -507,20 +540,47 @@ class SaaSApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserSSHApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class BrowserSSHApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserSSHApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserSSHApplicationDestination: TypeAlias = Union[ + BrowserSSHApplicationDestinationPublicDestination, BrowserSSHApplicationDestinationPrivateDestination +] + + class BrowserSSHApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -762,20 +822,47 @@ class BrowserSSHApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserVNCApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class BrowserVNCApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserVNCApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserVNCApplicationDestination: TypeAlias = Union[ + BrowserVNCApplicationDestinationPublicDestination, BrowserVNCApplicationDestinationPrivateDestination +] + + class BrowserVNCApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. diff --git a/src/cloudflare/types/zero_trust/access/application_list_response.py b/src/cloudflare/types/zero_trust/access/application_list_response.py index b39efa41ff7..1a0257ad43c 100644 --- a/src/cloudflare/types/zero_trust/access/application_list_response.py +++ b/src/cloudflare/types/zero_trust/access/application_list_response.py @@ -23,6 +23,8 @@ "ApplicationListResponse", "SelfHostedApplication", "SelfHostedApplicationDestination", + "SelfHostedApplicationDestinationPublicDestination", + "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationPolicy", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", @@ -39,6 +41,8 @@ "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", + "BrowserSSHApplicationDestinationPublicDestination", + "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", @@ -47,6 +51,8 @@ "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", + "BrowserVNCApplicationDestinationPublicDestination", + "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", @@ -99,20 +105,47 @@ ] -class SelfHostedApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class SelfHostedApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class SelfHostedApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +SelfHostedApplicationDestination: TypeAlias = Union[ + SelfHostedApplicationDestinationPublicDestination, SelfHostedApplicationDestinationPrivateDestination +] + + class SelfHostedApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -507,20 +540,47 @@ class SaaSApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserSSHApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class BrowserSSHApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserSSHApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserSSHApplicationDestination: TypeAlias = Union[ + BrowserSSHApplicationDestinationPublicDestination, BrowserSSHApplicationDestinationPrivateDestination +] + + class BrowserSSHApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -762,20 +822,47 @@ class BrowserSSHApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserVNCApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class BrowserVNCApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserVNCApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserVNCApplicationDestination: TypeAlias = Union[ + BrowserVNCApplicationDestinationPublicDestination, BrowserVNCApplicationDestinationPrivateDestination +] + + class BrowserVNCApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. diff --git a/src/cloudflare/types/zero_trust/access/application_update_params.py b/src/cloudflare/types/zero_trust/access/application_update_params.py index a9bbaf36695..f96f295a24f 100644 --- a/src/cloudflare/types/zero_trust/access/application_update_params.py +++ b/src/cloudflare/types/zero_trust/access/application_update_params.py @@ -23,6 +23,8 @@ "ApplicationUpdateParams", "SelfHostedApplication", "SelfHostedApplicationDestination", + "SelfHostedApplicationDestinationPublicDestination", + "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationPolicy", "SelfHostedApplicationPolicyAccessAppPolicyLink", "SelfHostedApplicationPolicyUnionMember2", @@ -43,6 +45,8 @@ "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", + "BrowserSSHApplicationDestinationPublicDestination", + "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationPolicyAccessAppPolicyLink", "BrowserSSHApplicationPolicyUnionMember2", @@ -53,6 +57,8 @@ "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", + "BrowserVNCApplicationDestinationPublicDestination", + "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationPolicyAccessAppPolicyLink", "BrowserVNCApplicationPolicyUnionMember2", @@ -257,20 +263,47 @@ class SelfHostedApplication(TypedDict, total=False): """ -class SelfHostedApplicationDestination(TypedDict, total=False): - type: Literal["public", "private"] +class SelfHostedApplicationDestinationPublicDestination(TypedDict, total=False): + type: Literal["public"] uri: str """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class SelfHostedApplicationDestinationPrivateDestination(TypedDict, total=False): + cidr: str + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: str + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Literal["tcp", "udp"] + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: str + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Literal["private"] + + vnet_id: str + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +SelfHostedApplicationDestination: TypeAlias = Union[ + SelfHostedApplicationDestinationPublicDestination, SelfHostedApplicationDestinationPrivateDestination +] + + class SelfHostedApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): id: str """The UUID of the policy""" @@ -764,20 +797,47 @@ class BrowserSSHApplication(TypedDict, total=False): """ -class BrowserSSHApplicationDestination(TypedDict, total=False): - type: Literal["public", "private"] +class BrowserSSHApplicationDestinationPublicDestination(TypedDict, total=False): + type: Literal["public"] uri: str """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserSSHApplicationDestinationPrivateDestination(TypedDict, total=False): + cidr: str + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: str + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Literal["tcp", "udp"] + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: str + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Literal["private"] + + vnet_id: str + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserSSHApplicationDestination: TypeAlias = Union[ + BrowserSSHApplicationDestinationPublicDestination, BrowserSSHApplicationDestinationPrivateDestination +] + + class BrowserSSHApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): id: str """The UUID of the policy""" @@ -1070,20 +1130,47 @@ class BrowserVNCApplication(TypedDict, total=False): """ -class BrowserVNCApplicationDestination(TypedDict, total=False): - type: Literal["public", "private"] +class BrowserVNCApplicationDestinationPublicDestination(TypedDict, total=False): + type: Literal["public"] uri: str """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserVNCApplicationDestinationPrivateDestination(TypedDict, total=False): + cidr: str + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: str + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Literal["tcp", "udp"] + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: str + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Literal["private"] + + vnet_id: str + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserVNCApplicationDestination: TypeAlias = Union[ + BrowserVNCApplicationDestinationPublicDestination, BrowserVNCApplicationDestinationPrivateDestination +] + + class BrowserVNCApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): id: str """The UUID of the policy""" diff --git a/src/cloudflare/types/zero_trust/access/application_update_response.py b/src/cloudflare/types/zero_trust/access/application_update_response.py index f6b0efdd7fd..00ea299d5f3 100644 --- a/src/cloudflare/types/zero_trust/access/application_update_response.py +++ b/src/cloudflare/types/zero_trust/access/application_update_response.py @@ -23,6 +23,8 @@ "ApplicationUpdateResponse", "SelfHostedApplication", "SelfHostedApplicationDestination", + "SelfHostedApplicationDestinationPublicDestination", + "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationPolicy", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", @@ -39,6 +41,8 @@ "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", + "BrowserSSHApplicationDestinationPublicDestination", + "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", @@ -47,6 +51,8 @@ "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", + "BrowserVNCApplicationDestinationPublicDestination", + "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", @@ -99,20 +105,47 @@ ] -class SelfHostedApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class SelfHostedApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class SelfHostedApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +SelfHostedApplicationDestination: TypeAlias = Union[ + SelfHostedApplicationDestinationPublicDestination, SelfHostedApplicationDestinationPrivateDestination +] + + class SelfHostedApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -507,20 +540,47 @@ class SaaSApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserSSHApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class BrowserSSHApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserSSHApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserSSHApplicationDestination: TypeAlias = Union[ + BrowserSSHApplicationDestinationPublicDestination, BrowserSSHApplicationDestinationPrivateDestination +] + + class BrowserSSHApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -762,20 +822,47 @@ class BrowserSSHApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserVNCApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class BrowserVNCApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserVNCApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserVNCApplicationDestination: TypeAlias = Union[ + BrowserVNCApplicationDestinationPublicDestination, BrowserVNCApplicationDestinationPrivateDestination +] + + class BrowserVNCApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. diff --git a/src/cloudflare/types/zero_trust/identity_provider_scim_config.py b/src/cloudflare/types/zero_trust/identity_provider_scim_config.py index 3f664fe6216..aa4b9fecffe 100644 --- a/src/cloudflare/types/zero_trust/identity_provider_scim_config.py +++ b/src/cloudflare/types/zero_trust/identity_provider_scim_config.py @@ -23,6 +23,9 @@ class IdentityProviderSCIMConfig(BaseModel): updates in any way and users will not be prompted to reauthenticate. """ + scim_base_url: Optional[str] = None + """The base URL of Cloudflare's SCIM V2.0 API endpoint.""" + seat_deprovision: Optional[bool] = None """ A flag to remove a user's seat in Zero Trust when they have been deprovisioned @@ -34,7 +37,7 @@ class IdentityProviderSCIMConfig(BaseModel): """ A read-only token generated when the SCIM integration is enabled for the first time. It is redacted on subsequent requests. If you lose this you will need to - refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + refresh it at /access/identity_providers/:idpID/refresh_scim_secret. """ user_deprovision: Optional[bool] = None diff --git a/tests/api_resources/zero_trust/access/test_applications.py b/tests/api_resources/zero_trust/access/test_applications.py index 17ca2921b84..3b041b0653f 100644 --- a/tests/api_resources/zero_trust/access/test_applications.py +++ b/tests/api_resources/zero_trust/access/test_applications.py @@ -69,16 +69,28 @@ def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> N "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -340,16 +352,28 @@ def test_method_create_with_all_params_overload_3(self, client: Cloudflare) -> N "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -490,16 +514,28 @@ def test_method_create_with_all_params_overload_4(self, client: Cloudflare) -> N "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -1183,16 +1219,28 @@ def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> N "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -1480,16 +1528,28 @@ def test_method_update_with_all_params_overload_3(self, client: Cloudflare) -> N "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -1644,16 +1704,28 @@ def test_method_update_with_all_params_overload_4(self, client: Cloudflare) -> N "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -2682,16 +2754,28 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -2953,16 +3037,28 @@ async def test_method_create_with_all_params_overload_3(self, async_client: Asyn "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -3103,16 +3199,28 @@ async def test_method_create_with_all_params_overload_4(self, async_client: Asyn "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -3796,16 +3904,28 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -4093,16 +4213,28 @@ async def test_method_update_with_all_params_overload_3(self, async_client: Asyn "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -4257,16 +4389,28 @@ async def test_method_update_with_all_params_overload_4(self, async_client: Asyn "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, From 3179dc38489bb8149086caa1cdd7b26b9306f9a4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 21:13:59 +0000 Subject: [PATCH 003/358] feat(api): api update (#2360) --- .stats.yml | 2 +- .../access/application_create_params.py | 123 ++------ .../access/application_create_response.py | 123 ++------ .../access/application_get_response.py | 123 ++------ .../access/application_list_response.py | 123 ++------ .../access/application_update_params.py | 123 ++------ .../access/application_update_response.py | 123 ++------ .../identity_provider_scim_config.py | 5 +- .../zero_trust/access/test_applications.py | 288 +++++------------- 9 files changed, 182 insertions(+), 851 deletions(-) diff --git a/.stats.yml b/.stats.yml index c370f57faf5..f0ec020f40a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1493 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aa37f1d5ad51f57618e40b780a4b8f2cc09463bbd9e3ac330ac1f1d2aa1742e5.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-56f3021fb085763371fa342d21f231ef420fbfdddf6599c584bc84e609c421fa.yml diff --git a/src/cloudflare/types/zero_trust/access/application_create_params.py b/src/cloudflare/types/zero_trust/access/application_create_params.py index 8f28b6ec26a..54c921e854c 100644 --- a/src/cloudflare/types/zero_trust/access/application_create_params.py +++ b/src/cloudflare/types/zero_trust/access/application_create_params.py @@ -23,8 +23,6 @@ "ApplicationCreateParams", "SelfHostedApplication", "SelfHostedApplicationDestination", - "SelfHostedApplicationDestinationPublicDestination", - "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationPolicy", "SelfHostedApplicationPolicyAccessAppPolicyLink", "SelfHostedApplicationPolicyUnionMember2", @@ -45,8 +43,6 @@ "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", - "BrowserSSHApplicationDestinationPublicDestination", - "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationPolicyAccessAppPolicyLink", "BrowserSSHApplicationPolicyUnionMember2", @@ -57,8 +53,6 @@ "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", - "BrowserVNCApplicationDestinationPublicDestination", - "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationPolicyAccessAppPolicyLink", "BrowserVNCApplicationPolicyUnionMember2", @@ -263,47 +257,20 @@ class SelfHostedApplication(TypedDict, total=False): """ -class SelfHostedApplicationDestinationPublicDestination(TypedDict, total=False): - type: Literal["public"] +class SelfHostedApplicationDestination(TypedDict, total=False): + type: Literal["public", "private"] uri: str """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class SelfHostedApplicationDestinationPrivateDestination(TypedDict, total=False): - cidr: str - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: str - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Literal["tcp", "udp"] - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: str - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Literal["private"] - - vnet_id: str - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -SelfHostedApplicationDestination: TypeAlias = Union[ - SelfHostedApplicationDestinationPublicDestination, SelfHostedApplicationDestinationPrivateDestination -] - - class SelfHostedApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): id: str """The UUID of the policy""" @@ -797,47 +764,20 @@ class BrowserSSHApplication(TypedDict, total=False): """ -class BrowserSSHApplicationDestinationPublicDestination(TypedDict, total=False): - type: Literal["public"] +class BrowserSSHApplicationDestination(TypedDict, total=False): + type: Literal["public", "private"] uri: str """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class BrowserSSHApplicationDestinationPrivateDestination(TypedDict, total=False): - cidr: str - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: str - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Literal["tcp", "udp"] - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: str - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Literal["private"] - - vnet_id: str - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -BrowserSSHApplicationDestination: TypeAlias = Union[ - BrowserSSHApplicationDestinationPublicDestination, BrowserSSHApplicationDestinationPrivateDestination -] - - class BrowserSSHApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): id: str """The UUID of the policy""" @@ -1130,47 +1070,20 @@ class BrowserVNCApplication(TypedDict, total=False): """ -class BrowserVNCApplicationDestinationPublicDestination(TypedDict, total=False): - type: Literal["public"] +class BrowserVNCApplicationDestination(TypedDict, total=False): + type: Literal["public", "private"] uri: str """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class BrowserVNCApplicationDestinationPrivateDestination(TypedDict, total=False): - cidr: str - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: str - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Literal["tcp", "udp"] - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: str - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Literal["private"] - - vnet_id: str - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -BrowserVNCApplicationDestination: TypeAlias = Union[ - BrowserVNCApplicationDestinationPublicDestination, BrowserVNCApplicationDestinationPrivateDestination -] - - class BrowserVNCApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): id: str """The UUID of the policy""" diff --git a/src/cloudflare/types/zero_trust/access/application_create_response.py b/src/cloudflare/types/zero_trust/access/application_create_response.py index 1f3a5fdb214..cc4872de0c6 100644 --- a/src/cloudflare/types/zero_trust/access/application_create_response.py +++ b/src/cloudflare/types/zero_trust/access/application_create_response.py @@ -23,8 +23,6 @@ "ApplicationCreateResponse", "SelfHostedApplication", "SelfHostedApplicationDestination", - "SelfHostedApplicationDestinationPublicDestination", - "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationPolicy", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", @@ -41,8 +39,6 @@ "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", - "BrowserSSHApplicationDestinationPublicDestination", - "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", @@ -51,8 +47,6 @@ "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", - "BrowserVNCApplicationDestinationPublicDestination", - "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", @@ -105,47 +99,20 @@ ] -class SelfHostedApplicationDestinationPublicDestination(BaseModel): - type: Optional[Literal["public"]] = None +class SelfHostedApplicationDestination(BaseModel): + type: Optional[Literal["public", "private"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class SelfHostedApplicationDestinationPrivateDestination(BaseModel): - cidr: Optional[str] = None - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: Optional[str] = None - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Optional[Literal["tcp", "udp"]] = None - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: Optional[str] = None - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Optional[Literal["private"]] = None - - vnet_id: Optional[str] = None - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -SelfHostedApplicationDestination: TypeAlias = Union[ - SelfHostedApplicationDestinationPublicDestination, SelfHostedApplicationDestinationPrivateDestination -] - - class SelfHostedApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -540,47 +507,20 @@ class SaaSApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserSSHApplicationDestinationPublicDestination(BaseModel): - type: Optional[Literal["public"]] = None +class BrowserSSHApplicationDestination(BaseModel): + type: Optional[Literal["public", "private"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class BrowserSSHApplicationDestinationPrivateDestination(BaseModel): - cidr: Optional[str] = None - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: Optional[str] = None - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Optional[Literal["tcp", "udp"]] = None - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: Optional[str] = None - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Optional[Literal["private"]] = None - - vnet_id: Optional[str] = None - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -BrowserSSHApplicationDestination: TypeAlias = Union[ - BrowserSSHApplicationDestinationPublicDestination, BrowserSSHApplicationDestinationPrivateDestination -] - - class BrowserSSHApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -822,47 +762,20 @@ class BrowserSSHApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserVNCApplicationDestinationPublicDestination(BaseModel): - type: Optional[Literal["public"]] = None +class BrowserVNCApplicationDestination(BaseModel): + type: Optional[Literal["public", "private"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class BrowserVNCApplicationDestinationPrivateDestination(BaseModel): - cidr: Optional[str] = None - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: Optional[str] = None - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Optional[Literal["tcp", "udp"]] = None - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: Optional[str] = None - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Optional[Literal["private"]] = None - - vnet_id: Optional[str] = None - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -BrowserVNCApplicationDestination: TypeAlias = Union[ - BrowserVNCApplicationDestinationPublicDestination, BrowserVNCApplicationDestinationPrivateDestination -] - - class BrowserVNCApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. diff --git a/src/cloudflare/types/zero_trust/access/application_get_response.py b/src/cloudflare/types/zero_trust/access/application_get_response.py index cffacb3a76a..602389f778c 100644 --- a/src/cloudflare/types/zero_trust/access/application_get_response.py +++ b/src/cloudflare/types/zero_trust/access/application_get_response.py @@ -23,8 +23,6 @@ "ApplicationGetResponse", "SelfHostedApplication", "SelfHostedApplicationDestination", - "SelfHostedApplicationDestinationPublicDestination", - "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationPolicy", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", @@ -41,8 +39,6 @@ "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", - "BrowserSSHApplicationDestinationPublicDestination", - "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", @@ -51,8 +47,6 @@ "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", - "BrowserVNCApplicationDestinationPublicDestination", - "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", @@ -105,47 +99,20 @@ ] -class SelfHostedApplicationDestinationPublicDestination(BaseModel): - type: Optional[Literal["public"]] = None +class SelfHostedApplicationDestination(BaseModel): + type: Optional[Literal["public", "private"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class SelfHostedApplicationDestinationPrivateDestination(BaseModel): - cidr: Optional[str] = None - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: Optional[str] = None - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Optional[Literal["tcp", "udp"]] = None - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: Optional[str] = None - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Optional[Literal["private"]] = None - - vnet_id: Optional[str] = None - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -SelfHostedApplicationDestination: TypeAlias = Union[ - SelfHostedApplicationDestinationPublicDestination, SelfHostedApplicationDestinationPrivateDestination -] - - class SelfHostedApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -540,47 +507,20 @@ class SaaSApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserSSHApplicationDestinationPublicDestination(BaseModel): - type: Optional[Literal["public"]] = None +class BrowserSSHApplicationDestination(BaseModel): + type: Optional[Literal["public", "private"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class BrowserSSHApplicationDestinationPrivateDestination(BaseModel): - cidr: Optional[str] = None - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: Optional[str] = None - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Optional[Literal["tcp", "udp"]] = None - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: Optional[str] = None - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Optional[Literal["private"]] = None - - vnet_id: Optional[str] = None - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -BrowserSSHApplicationDestination: TypeAlias = Union[ - BrowserSSHApplicationDestinationPublicDestination, BrowserSSHApplicationDestinationPrivateDestination -] - - class BrowserSSHApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -822,47 +762,20 @@ class BrowserSSHApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserVNCApplicationDestinationPublicDestination(BaseModel): - type: Optional[Literal["public"]] = None +class BrowserVNCApplicationDestination(BaseModel): + type: Optional[Literal["public", "private"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class BrowserVNCApplicationDestinationPrivateDestination(BaseModel): - cidr: Optional[str] = None - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: Optional[str] = None - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Optional[Literal["tcp", "udp"]] = None - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: Optional[str] = None - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Optional[Literal["private"]] = None - - vnet_id: Optional[str] = None - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -BrowserVNCApplicationDestination: TypeAlias = Union[ - BrowserVNCApplicationDestinationPublicDestination, BrowserVNCApplicationDestinationPrivateDestination -] - - class BrowserVNCApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. diff --git a/src/cloudflare/types/zero_trust/access/application_list_response.py b/src/cloudflare/types/zero_trust/access/application_list_response.py index 1a0257ad43c..b39efa41ff7 100644 --- a/src/cloudflare/types/zero_trust/access/application_list_response.py +++ b/src/cloudflare/types/zero_trust/access/application_list_response.py @@ -23,8 +23,6 @@ "ApplicationListResponse", "SelfHostedApplication", "SelfHostedApplicationDestination", - "SelfHostedApplicationDestinationPublicDestination", - "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationPolicy", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", @@ -41,8 +39,6 @@ "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", - "BrowserSSHApplicationDestinationPublicDestination", - "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", @@ -51,8 +47,6 @@ "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", - "BrowserVNCApplicationDestinationPublicDestination", - "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", @@ -105,47 +99,20 @@ ] -class SelfHostedApplicationDestinationPublicDestination(BaseModel): - type: Optional[Literal["public"]] = None +class SelfHostedApplicationDestination(BaseModel): + type: Optional[Literal["public", "private"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class SelfHostedApplicationDestinationPrivateDestination(BaseModel): - cidr: Optional[str] = None - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: Optional[str] = None - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Optional[Literal["tcp", "udp"]] = None - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: Optional[str] = None - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Optional[Literal["private"]] = None - - vnet_id: Optional[str] = None - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -SelfHostedApplicationDestination: TypeAlias = Union[ - SelfHostedApplicationDestinationPublicDestination, SelfHostedApplicationDestinationPrivateDestination -] - - class SelfHostedApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -540,47 +507,20 @@ class SaaSApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserSSHApplicationDestinationPublicDestination(BaseModel): - type: Optional[Literal["public"]] = None +class BrowserSSHApplicationDestination(BaseModel): + type: Optional[Literal["public", "private"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class BrowserSSHApplicationDestinationPrivateDestination(BaseModel): - cidr: Optional[str] = None - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: Optional[str] = None - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Optional[Literal["tcp", "udp"]] = None - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: Optional[str] = None - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Optional[Literal["private"]] = None - - vnet_id: Optional[str] = None - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -BrowserSSHApplicationDestination: TypeAlias = Union[ - BrowserSSHApplicationDestinationPublicDestination, BrowserSSHApplicationDestinationPrivateDestination -] - - class BrowserSSHApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -822,47 +762,20 @@ class BrowserSSHApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserVNCApplicationDestinationPublicDestination(BaseModel): - type: Optional[Literal["public"]] = None +class BrowserVNCApplicationDestination(BaseModel): + type: Optional[Literal["public", "private"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class BrowserVNCApplicationDestinationPrivateDestination(BaseModel): - cidr: Optional[str] = None - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: Optional[str] = None - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Optional[Literal["tcp", "udp"]] = None - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: Optional[str] = None - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Optional[Literal["private"]] = None - - vnet_id: Optional[str] = None - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -BrowserVNCApplicationDestination: TypeAlias = Union[ - BrowserVNCApplicationDestinationPublicDestination, BrowserVNCApplicationDestinationPrivateDestination -] - - class BrowserVNCApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. diff --git a/src/cloudflare/types/zero_trust/access/application_update_params.py b/src/cloudflare/types/zero_trust/access/application_update_params.py index f96f295a24f..a9bbaf36695 100644 --- a/src/cloudflare/types/zero_trust/access/application_update_params.py +++ b/src/cloudflare/types/zero_trust/access/application_update_params.py @@ -23,8 +23,6 @@ "ApplicationUpdateParams", "SelfHostedApplication", "SelfHostedApplicationDestination", - "SelfHostedApplicationDestinationPublicDestination", - "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationPolicy", "SelfHostedApplicationPolicyAccessAppPolicyLink", "SelfHostedApplicationPolicyUnionMember2", @@ -45,8 +43,6 @@ "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", - "BrowserSSHApplicationDestinationPublicDestination", - "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationPolicyAccessAppPolicyLink", "BrowserSSHApplicationPolicyUnionMember2", @@ -57,8 +53,6 @@ "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", - "BrowserVNCApplicationDestinationPublicDestination", - "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationPolicyAccessAppPolicyLink", "BrowserVNCApplicationPolicyUnionMember2", @@ -263,47 +257,20 @@ class SelfHostedApplication(TypedDict, total=False): """ -class SelfHostedApplicationDestinationPublicDestination(TypedDict, total=False): - type: Literal["public"] +class SelfHostedApplicationDestination(TypedDict, total=False): + type: Literal["public", "private"] uri: str """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class SelfHostedApplicationDestinationPrivateDestination(TypedDict, total=False): - cidr: str - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: str - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Literal["tcp", "udp"] - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: str - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Literal["private"] - - vnet_id: str - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -SelfHostedApplicationDestination: TypeAlias = Union[ - SelfHostedApplicationDestinationPublicDestination, SelfHostedApplicationDestinationPrivateDestination -] - - class SelfHostedApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): id: str """The UUID of the policy""" @@ -797,47 +764,20 @@ class BrowserSSHApplication(TypedDict, total=False): """ -class BrowserSSHApplicationDestinationPublicDestination(TypedDict, total=False): - type: Literal["public"] +class BrowserSSHApplicationDestination(TypedDict, total=False): + type: Literal["public", "private"] uri: str """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class BrowserSSHApplicationDestinationPrivateDestination(TypedDict, total=False): - cidr: str - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: str - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Literal["tcp", "udp"] - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: str - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Literal["private"] - - vnet_id: str - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -BrowserSSHApplicationDestination: TypeAlias = Union[ - BrowserSSHApplicationDestinationPublicDestination, BrowserSSHApplicationDestinationPrivateDestination -] - - class BrowserSSHApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): id: str """The UUID of the policy""" @@ -1130,47 +1070,20 @@ class BrowserVNCApplication(TypedDict, total=False): """ -class BrowserVNCApplicationDestinationPublicDestination(TypedDict, total=False): - type: Literal["public"] +class BrowserVNCApplicationDestination(TypedDict, total=False): + type: Literal["public", "private"] uri: str """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class BrowserVNCApplicationDestinationPrivateDestination(TypedDict, total=False): - cidr: str - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: str - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Literal["tcp", "udp"] - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: str - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Literal["private"] - - vnet_id: str - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -BrowserVNCApplicationDestination: TypeAlias = Union[ - BrowserVNCApplicationDestinationPublicDestination, BrowserVNCApplicationDestinationPrivateDestination -] - - class BrowserVNCApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): id: str """The UUID of the policy""" diff --git a/src/cloudflare/types/zero_trust/access/application_update_response.py b/src/cloudflare/types/zero_trust/access/application_update_response.py index 00ea299d5f3..f6b0efdd7fd 100644 --- a/src/cloudflare/types/zero_trust/access/application_update_response.py +++ b/src/cloudflare/types/zero_trust/access/application_update_response.py @@ -23,8 +23,6 @@ "ApplicationUpdateResponse", "SelfHostedApplication", "SelfHostedApplicationDestination", - "SelfHostedApplicationDestinationPublicDestination", - "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationPolicy", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", @@ -41,8 +39,6 @@ "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", - "BrowserSSHApplicationDestinationPublicDestination", - "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", @@ -51,8 +47,6 @@ "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", - "BrowserVNCApplicationDestinationPublicDestination", - "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", @@ -105,47 +99,20 @@ ] -class SelfHostedApplicationDestinationPublicDestination(BaseModel): - type: Optional[Literal["public"]] = None +class SelfHostedApplicationDestination(BaseModel): + type: Optional[Literal["public", "private"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class SelfHostedApplicationDestinationPrivateDestination(BaseModel): - cidr: Optional[str] = None - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: Optional[str] = None - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Optional[Literal["tcp", "udp"]] = None - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: Optional[str] = None - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Optional[Literal["private"]] = None - - vnet_id: Optional[str] = None - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -SelfHostedApplicationDestination: TypeAlias = Union[ - SelfHostedApplicationDestinationPublicDestination, SelfHostedApplicationDestinationPrivateDestination -] - - class SelfHostedApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -540,47 +507,20 @@ class SaaSApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserSSHApplicationDestinationPublicDestination(BaseModel): - type: Optional[Literal["public"]] = None +class BrowserSSHApplicationDestination(BaseModel): + type: Optional[Literal["public", "private"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class BrowserSSHApplicationDestinationPrivateDestination(BaseModel): - cidr: Optional[str] = None - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: Optional[str] = None - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Optional[Literal["tcp", "udp"]] = None - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: Optional[str] = None - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Optional[Literal["private"]] = None - - vnet_id: Optional[str] = None - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -BrowserSSHApplicationDestination: TypeAlias = Union[ - BrowserSSHApplicationDestinationPublicDestination, BrowserSSHApplicationDestinationPrivateDestination -] - - class BrowserSSHApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -822,47 +762,20 @@ class BrowserSSHApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserVNCApplicationDestinationPublicDestination(BaseModel): - type: Optional[Literal["public"]] = None +class BrowserVNCApplicationDestination(BaseModel): + type: Optional[Literal["public", "private"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class BrowserVNCApplicationDestinationPrivateDestination(BaseModel): - cidr: Optional[str] = None - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: Optional[str] = None - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Optional[Literal["tcp", "udp"]] = None - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: Optional[str] = None - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Optional[Literal["private"]] = None - - vnet_id: Optional[str] = None - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -BrowserVNCApplicationDestination: TypeAlias = Union[ - BrowserVNCApplicationDestinationPublicDestination, BrowserVNCApplicationDestinationPrivateDestination -] - - class BrowserVNCApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. diff --git a/src/cloudflare/types/zero_trust/identity_provider_scim_config.py b/src/cloudflare/types/zero_trust/identity_provider_scim_config.py index aa4b9fecffe..3f664fe6216 100644 --- a/src/cloudflare/types/zero_trust/identity_provider_scim_config.py +++ b/src/cloudflare/types/zero_trust/identity_provider_scim_config.py @@ -23,9 +23,6 @@ class IdentityProviderSCIMConfig(BaseModel): updates in any way and users will not be prompted to reauthenticate. """ - scim_base_url: Optional[str] = None - """The base URL of Cloudflare's SCIM V2.0 API endpoint.""" - seat_deprovision: Optional[bool] = None """ A flag to remove a user's seat in Zero Trust when they have been deprovisioned @@ -37,7 +34,7 @@ class IdentityProviderSCIMConfig(BaseModel): """ A read-only token generated when the SCIM integration is enabled for the first time. It is redacted on subsequent requests. If you lose this you will need to - refresh it at /access/identity_providers/:idpID/refresh_scim_secret. + refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. """ user_deprovision: Optional[bool] = None diff --git a/tests/api_resources/zero_trust/access/test_applications.py b/tests/api_resources/zero_trust/access/test_applications.py index 3b041b0653f..17ca2921b84 100644 --- a/tests/api_resources/zero_trust/access/test_applications.py +++ b/tests/api_resources/zero_trust/access/test_applications.py @@ -69,28 +69,16 @@ def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> N "uri": "test.anotherexample.com/staff", }, { - "cidr": "10.5.0.0/24", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80-90", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.2", }, { - "cidr": "10.5.0.3/32", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.3/32:1234-4321", }, { - "cidr": "cidr", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "port_range", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "private-sni.example.com", }, ], enable_binding_cookie=True, @@ -352,28 +340,16 @@ def test_method_create_with_all_params_overload_3(self, client: Cloudflare) -> N "uri": "test.anotherexample.com/staff", }, { - "cidr": "10.5.0.0/24", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80-90", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.2", }, { - "cidr": "10.5.0.3/32", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.3/32:1234-4321", }, { - "cidr": "cidr", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "port_range", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "private-sni.example.com", }, ], enable_binding_cookie=True, @@ -514,28 +490,16 @@ def test_method_create_with_all_params_overload_4(self, client: Cloudflare) -> N "uri": "test.anotherexample.com/staff", }, { - "cidr": "10.5.0.0/24", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80-90", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.2", }, { - "cidr": "10.5.0.3/32", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.3/32:1234-4321", }, { - "cidr": "cidr", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "port_range", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "private-sni.example.com", }, ], enable_binding_cookie=True, @@ -1219,28 +1183,16 @@ def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> N "uri": "test.anotherexample.com/staff", }, { - "cidr": "10.5.0.0/24", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80-90", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.2", }, { - "cidr": "10.5.0.3/32", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.3/32:1234-4321", }, { - "cidr": "cidr", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "port_range", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "private-sni.example.com", }, ], enable_binding_cookie=True, @@ -1528,28 +1480,16 @@ def test_method_update_with_all_params_overload_3(self, client: Cloudflare) -> N "uri": "test.anotherexample.com/staff", }, { - "cidr": "10.5.0.0/24", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80-90", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.2", }, { - "cidr": "10.5.0.3/32", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.3/32:1234-4321", }, { - "cidr": "cidr", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "port_range", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "private-sni.example.com", }, ], enable_binding_cookie=True, @@ -1704,28 +1644,16 @@ def test_method_update_with_all_params_overload_4(self, client: Cloudflare) -> N "uri": "test.anotherexample.com/staff", }, { - "cidr": "10.5.0.0/24", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80-90", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.2", }, { - "cidr": "10.5.0.3/32", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.3/32:1234-4321", }, { - "cidr": "cidr", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "port_range", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "private-sni.example.com", }, ], enable_binding_cookie=True, @@ -2754,28 +2682,16 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn "uri": "test.anotherexample.com/staff", }, { - "cidr": "10.5.0.0/24", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80-90", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.2", }, { - "cidr": "10.5.0.3/32", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.3/32:1234-4321", }, { - "cidr": "cidr", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "port_range", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "private-sni.example.com", }, ], enable_binding_cookie=True, @@ -3037,28 +2953,16 @@ async def test_method_create_with_all_params_overload_3(self, async_client: Asyn "uri": "test.anotherexample.com/staff", }, { - "cidr": "10.5.0.0/24", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80-90", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.2", }, { - "cidr": "10.5.0.3/32", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.3/32:1234-4321", }, { - "cidr": "cidr", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "port_range", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "private-sni.example.com", }, ], enable_binding_cookie=True, @@ -3199,28 +3103,16 @@ async def test_method_create_with_all_params_overload_4(self, async_client: Asyn "uri": "test.anotherexample.com/staff", }, { - "cidr": "10.5.0.0/24", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80-90", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.2", }, { - "cidr": "10.5.0.3/32", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.3/32:1234-4321", }, { - "cidr": "cidr", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "port_range", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "private-sni.example.com", }, ], enable_binding_cookie=True, @@ -3904,28 +3796,16 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn "uri": "test.anotherexample.com/staff", }, { - "cidr": "10.5.0.0/24", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80-90", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.2", }, { - "cidr": "10.5.0.3/32", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.3/32:1234-4321", }, { - "cidr": "cidr", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "port_range", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "private-sni.example.com", }, ], enable_binding_cookie=True, @@ -4213,28 +4093,16 @@ async def test_method_update_with_all_params_overload_3(self, async_client: Asyn "uri": "test.anotherexample.com/staff", }, { - "cidr": "10.5.0.0/24", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80-90", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.2", }, { - "cidr": "10.5.0.3/32", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.3/32:1234-4321", }, { - "cidr": "cidr", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "port_range", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "private-sni.example.com", }, ], enable_binding_cookie=True, @@ -4389,28 +4257,16 @@ async def test_method_update_with_all_params_overload_4(self, async_client: Asyn "uri": "test.anotherexample.com/staff", }, { - "cidr": "10.5.0.0/24", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80-90", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.2", }, { - "cidr": "10.5.0.3/32", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.3/32:1234-4321", }, { - "cidr": "cidr", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "port_range", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "private-sni.example.com", }, ], enable_binding_cookie=True, From 7dc3d1d7fd97b3a919e01b3b3df4699ec947845a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 22:01:51 +0000 Subject: [PATCH 004/358] feat(api): api update (#2361) --- .stats.yml | 2 +- .../access/application_create_params.py | 123 ++++++-- .../access/application_create_response.py | 123 ++++++-- .../access/application_get_response.py | 123 ++++++-- .../access/application_list_response.py | 123 ++++++-- .../access/application_update_params.py | 123 ++++++-- .../access/application_update_response.py | 123 ++++++-- .../identity_provider_scim_config.py | 5 +- .../zero_trust/access/test_applications.py | 288 +++++++++++++----- 9 files changed, 851 insertions(+), 182 deletions(-) diff --git a/.stats.yml b/.stats.yml index f0ec020f40a..c370f57faf5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1493 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-56f3021fb085763371fa342d21f231ef420fbfdddf6599c584bc84e609c421fa.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aa37f1d5ad51f57618e40b780a4b8f2cc09463bbd9e3ac330ac1f1d2aa1742e5.yml diff --git a/src/cloudflare/types/zero_trust/access/application_create_params.py b/src/cloudflare/types/zero_trust/access/application_create_params.py index 54c921e854c..8f28b6ec26a 100644 --- a/src/cloudflare/types/zero_trust/access/application_create_params.py +++ b/src/cloudflare/types/zero_trust/access/application_create_params.py @@ -23,6 +23,8 @@ "ApplicationCreateParams", "SelfHostedApplication", "SelfHostedApplicationDestination", + "SelfHostedApplicationDestinationPublicDestination", + "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationPolicy", "SelfHostedApplicationPolicyAccessAppPolicyLink", "SelfHostedApplicationPolicyUnionMember2", @@ -43,6 +45,8 @@ "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", + "BrowserSSHApplicationDestinationPublicDestination", + "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationPolicyAccessAppPolicyLink", "BrowserSSHApplicationPolicyUnionMember2", @@ -53,6 +57,8 @@ "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", + "BrowserVNCApplicationDestinationPublicDestination", + "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationPolicyAccessAppPolicyLink", "BrowserVNCApplicationPolicyUnionMember2", @@ -257,20 +263,47 @@ class SelfHostedApplication(TypedDict, total=False): """ -class SelfHostedApplicationDestination(TypedDict, total=False): - type: Literal["public", "private"] +class SelfHostedApplicationDestinationPublicDestination(TypedDict, total=False): + type: Literal["public"] uri: str """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class SelfHostedApplicationDestinationPrivateDestination(TypedDict, total=False): + cidr: str + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: str + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Literal["tcp", "udp"] + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: str + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Literal["private"] + + vnet_id: str + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +SelfHostedApplicationDestination: TypeAlias = Union[ + SelfHostedApplicationDestinationPublicDestination, SelfHostedApplicationDestinationPrivateDestination +] + + class SelfHostedApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): id: str """The UUID of the policy""" @@ -764,20 +797,47 @@ class BrowserSSHApplication(TypedDict, total=False): """ -class BrowserSSHApplicationDestination(TypedDict, total=False): - type: Literal["public", "private"] +class BrowserSSHApplicationDestinationPublicDestination(TypedDict, total=False): + type: Literal["public"] uri: str """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserSSHApplicationDestinationPrivateDestination(TypedDict, total=False): + cidr: str + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: str + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Literal["tcp", "udp"] + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: str + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Literal["private"] + + vnet_id: str + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserSSHApplicationDestination: TypeAlias = Union[ + BrowserSSHApplicationDestinationPublicDestination, BrowserSSHApplicationDestinationPrivateDestination +] + + class BrowserSSHApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): id: str """The UUID of the policy""" @@ -1070,20 +1130,47 @@ class BrowserVNCApplication(TypedDict, total=False): """ -class BrowserVNCApplicationDestination(TypedDict, total=False): - type: Literal["public", "private"] +class BrowserVNCApplicationDestinationPublicDestination(TypedDict, total=False): + type: Literal["public"] uri: str """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserVNCApplicationDestinationPrivateDestination(TypedDict, total=False): + cidr: str + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: str + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Literal["tcp", "udp"] + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: str + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Literal["private"] + + vnet_id: str + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserVNCApplicationDestination: TypeAlias = Union[ + BrowserVNCApplicationDestinationPublicDestination, BrowserVNCApplicationDestinationPrivateDestination +] + + class BrowserVNCApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): id: str """The UUID of the policy""" diff --git a/src/cloudflare/types/zero_trust/access/application_create_response.py b/src/cloudflare/types/zero_trust/access/application_create_response.py index cc4872de0c6..1f3a5fdb214 100644 --- a/src/cloudflare/types/zero_trust/access/application_create_response.py +++ b/src/cloudflare/types/zero_trust/access/application_create_response.py @@ -23,6 +23,8 @@ "ApplicationCreateResponse", "SelfHostedApplication", "SelfHostedApplicationDestination", + "SelfHostedApplicationDestinationPublicDestination", + "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationPolicy", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", @@ -39,6 +41,8 @@ "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", + "BrowserSSHApplicationDestinationPublicDestination", + "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", @@ -47,6 +51,8 @@ "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", + "BrowserVNCApplicationDestinationPublicDestination", + "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", @@ -99,20 +105,47 @@ ] -class SelfHostedApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class SelfHostedApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class SelfHostedApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +SelfHostedApplicationDestination: TypeAlias = Union[ + SelfHostedApplicationDestinationPublicDestination, SelfHostedApplicationDestinationPrivateDestination +] + + class SelfHostedApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -507,20 +540,47 @@ class SaaSApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserSSHApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class BrowserSSHApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserSSHApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserSSHApplicationDestination: TypeAlias = Union[ + BrowserSSHApplicationDestinationPublicDestination, BrowserSSHApplicationDestinationPrivateDestination +] + + class BrowserSSHApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -762,20 +822,47 @@ class BrowserSSHApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserVNCApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class BrowserVNCApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserVNCApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserVNCApplicationDestination: TypeAlias = Union[ + BrowserVNCApplicationDestinationPublicDestination, BrowserVNCApplicationDestinationPrivateDestination +] + + class BrowserVNCApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. diff --git a/src/cloudflare/types/zero_trust/access/application_get_response.py b/src/cloudflare/types/zero_trust/access/application_get_response.py index 602389f778c..cffacb3a76a 100644 --- a/src/cloudflare/types/zero_trust/access/application_get_response.py +++ b/src/cloudflare/types/zero_trust/access/application_get_response.py @@ -23,6 +23,8 @@ "ApplicationGetResponse", "SelfHostedApplication", "SelfHostedApplicationDestination", + "SelfHostedApplicationDestinationPublicDestination", + "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationPolicy", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", @@ -39,6 +41,8 @@ "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", + "BrowserSSHApplicationDestinationPublicDestination", + "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", @@ -47,6 +51,8 @@ "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", + "BrowserVNCApplicationDestinationPublicDestination", + "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", @@ -99,20 +105,47 @@ ] -class SelfHostedApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class SelfHostedApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class SelfHostedApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +SelfHostedApplicationDestination: TypeAlias = Union[ + SelfHostedApplicationDestinationPublicDestination, SelfHostedApplicationDestinationPrivateDestination +] + + class SelfHostedApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -507,20 +540,47 @@ class SaaSApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserSSHApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class BrowserSSHApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserSSHApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserSSHApplicationDestination: TypeAlias = Union[ + BrowserSSHApplicationDestinationPublicDestination, BrowserSSHApplicationDestinationPrivateDestination +] + + class BrowserSSHApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -762,20 +822,47 @@ class BrowserSSHApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserVNCApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class BrowserVNCApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserVNCApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserVNCApplicationDestination: TypeAlias = Union[ + BrowserVNCApplicationDestinationPublicDestination, BrowserVNCApplicationDestinationPrivateDestination +] + + class BrowserVNCApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. diff --git a/src/cloudflare/types/zero_trust/access/application_list_response.py b/src/cloudflare/types/zero_trust/access/application_list_response.py index b39efa41ff7..1a0257ad43c 100644 --- a/src/cloudflare/types/zero_trust/access/application_list_response.py +++ b/src/cloudflare/types/zero_trust/access/application_list_response.py @@ -23,6 +23,8 @@ "ApplicationListResponse", "SelfHostedApplication", "SelfHostedApplicationDestination", + "SelfHostedApplicationDestinationPublicDestination", + "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationPolicy", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", @@ -39,6 +41,8 @@ "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", + "BrowserSSHApplicationDestinationPublicDestination", + "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", @@ -47,6 +51,8 @@ "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", + "BrowserVNCApplicationDestinationPublicDestination", + "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", @@ -99,20 +105,47 @@ ] -class SelfHostedApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class SelfHostedApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class SelfHostedApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +SelfHostedApplicationDestination: TypeAlias = Union[ + SelfHostedApplicationDestinationPublicDestination, SelfHostedApplicationDestinationPrivateDestination +] + + class SelfHostedApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -507,20 +540,47 @@ class SaaSApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserSSHApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class BrowserSSHApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserSSHApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserSSHApplicationDestination: TypeAlias = Union[ + BrowserSSHApplicationDestinationPublicDestination, BrowserSSHApplicationDestinationPrivateDestination +] + + class BrowserSSHApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -762,20 +822,47 @@ class BrowserSSHApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserVNCApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class BrowserVNCApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserVNCApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserVNCApplicationDestination: TypeAlias = Union[ + BrowserVNCApplicationDestinationPublicDestination, BrowserVNCApplicationDestinationPrivateDestination +] + + class BrowserVNCApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. diff --git a/src/cloudflare/types/zero_trust/access/application_update_params.py b/src/cloudflare/types/zero_trust/access/application_update_params.py index a9bbaf36695..f96f295a24f 100644 --- a/src/cloudflare/types/zero_trust/access/application_update_params.py +++ b/src/cloudflare/types/zero_trust/access/application_update_params.py @@ -23,6 +23,8 @@ "ApplicationUpdateParams", "SelfHostedApplication", "SelfHostedApplicationDestination", + "SelfHostedApplicationDestinationPublicDestination", + "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationPolicy", "SelfHostedApplicationPolicyAccessAppPolicyLink", "SelfHostedApplicationPolicyUnionMember2", @@ -43,6 +45,8 @@ "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", + "BrowserSSHApplicationDestinationPublicDestination", + "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationPolicyAccessAppPolicyLink", "BrowserSSHApplicationPolicyUnionMember2", @@ -53,6 +57,8 @@ "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", + "BrowserVNCApplicationDestinationPublicDestination", + "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationPolicyAccessAppPolicyLink", "BrowserVNCApplicationPolicyUnionMember2", @@ -257,20 +263,47 @@ class SelfHostedApplication(TypedDict, total=False): """ -class SelfHostedApplicationDestination(TypedDict, total=False): - type: Literal["public", "private"] +class SelfHostedApplicationDestinationPublicDestination(TypedDict, total=False): + type: Literal["public"] uri: str """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class SelfHostedApplicationDestinationPrivateDestination(TypedDict, total=False): + cidr: str + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: str + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Literal["tcp", "udp"] + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: str + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Literal["private"] + + vnet_id: str + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +SelfHostedApplicationDestination: TypeAlias = Union[ + SelfHostedApplicationDestinationPublicDestination, SelfHostedApplicationDestinationPrivateDestination +] + + class SelfHostedApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): id: str """The UUID of the policy""" @@ -764,20 +797,47 @@ class BrowserSSHApplication(TypedDict, total=False): """ -class BrowserSSHApplicationDestination(TypedDict, total=False): - type: Literal["public", "private"] +class BrowserSSHApplicationDestinationPublicDestination(TypedDict, total=False): + type: Literal["public"] uri: str """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserSSHApplicationDestinationPrivateDestination(TypedDict, total=False): + cidr: str + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: str + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Literal["tcp", "udp"] + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: str + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Literal["private"] + + vnet_id: str + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserSSHApplicationDestination: TypeAlias = Union[ + BrowserSSHApplicationDestinationPublicDestination, BrowserSSHApplicationDestinationPrivateDestination +] + + class BrowserSSHApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): id: str """The UUID of the policy""" @@ -1070,20 +1130,47 @@ class BrowserVNCApplication(TypedDict, total=False): """ -class BrowserVNCApplicationDestination(TypedDict, total=False): - type: Literal["public", "private"] +class BrowserVNCApplicationDestinationPublicDestination(TypedDict, total=False): + type: Literal["public"] uri: str """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserVNCApplicationDestinationPrivateDestination(TypedDict, total=False): + cidr: str + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: str + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Literal["tcp", "udp"] + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: str + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Literal["private"] + + vnet_id: str + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserVNCApplicationDestination: TypeAlias = Union[ + BrowserVNCApplicationDestinationPublicDestination, BrowserVNCApplicationDestinationPrivateDestination +] + + class BrowserVNCApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): id: str """The UUID of the policy""" diff --git a/src/cloudflare/types/zero_trust/access/application_update_response.py b/src/cloudflare/types/zero_trust/access/application_update_response.py index f6b0efdd7fd..00ea299d5f3 100644 --- a/src/cloudflare/types/zero_trust/access/application_update_response.py +++ b/src/cloudflare/types/zero_trust/access/application_update_response.py @@ -23,6 +23,8 @@ "ApplicationUpdateResponse", "SelfHostedApplication", "SelfHostedApplicationDestination", + "SelfHostedApplicationDestinationPublicDestination", + "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationPolicy", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", @@ -39,6 +41,8 @@ "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", + "BrowserSSHApplicationDestinationPublicDestination", + "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", @@ -47,6 +51,8 @@ "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", + "BrowserVNCApplicationDestinationPublicDestination", + "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", @@ -99,20 +105,47 @@ ] -class SelfHostedApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class SelfHostedApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class SelfHostedApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +SelfHostedApplicationDestination: TypeAlias = Union[ + SelfHostedApplicationDestinationPublicDestination, SelfHostedApplicationDestinationPrivateDestination +] + + class SelfHostedApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -507,20 +540,47 @@ class SaaSApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserSSHApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class BrowserSSHApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserSSHApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserSSHApplicationDestination: TypeAlias = Union[ + BrowserSSHApplicationDestinationPublicDestination, BrowserSSHApplicationDestinationPrivateDestination +] + + class BrowserSSHApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -762,20 +822,47 @@ class BrowserSSHApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserVNCApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class BrowserVNCApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserVNCApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserVNCApplicationDestination: TypeAlias = Union[ + BrowserVNCApplicationDestinationPublicDestination, BrowserVNCApplicationDestinationPrivateDestination +] + + class BrowserVNCApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. diff --git a/src/cloudflare/types/zero_trust/identity_provider_scim_config.py b/src/cloudflare/types/zero_trust/identity_provider_scim_config.py index 3f664fe6216..aa4b9fecffe 100644 --- a/src/cloudflare/types/zero_trust/identity_provider_scim_config.py +++ b/src/cloudflare/types/zero_trust/identity_provider_scim_config.py @@ -23,6 +23,9 @@ class IdentityProviderSCIMConfig(BaseModel): updates in any way and users will not be prompted to reauthenticate. """ + scim_base_url: Optional[str] = None + """The base URL of Cloudflare's SCIM V2.0 API endpoint.""" + seat_deprovision: Optional[bool] = None """ A flag to remove a user's seat in Zero Trust when they have been deprovisioned @@ -34,7 +37,7 @@ class IdentityProviderSCIMConfig(BaseModel): """ A read-only token generated when the SCIM integration is enabled for the first time. It is redacted on subsequent requests. If you lose this you will need to - refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + refresh it at /access/identity_providers/:idpID/refresh_scim_secret. """ user_deprovision: Optional[bool] = None diff --git a/tests/api_resources/zero_trust/access/test_applications.py b/tests/api_resources/zero_trust/access/test_applications.py index 17ca2921b84..3b041b0653f 100644 --- a/tests/api_resources/zero_trust/access/test_applications.py +++ b/tests/api_resources/zero_trust/access/test_applications.py @@ -69,16 +69,28 @@ def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> N "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -340,16 +352,28 @@ def test_method_create_with_all_params_overload_3(self, client: Cloudflare) -> N "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -490,16 +514,28 @@ def test_method_create_with_all_params_overload_4(self, client: Cloudflare) -> N "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -1183,16 +1219,28 @@ def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> N "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -1480,16 +1528,28 @@ def test_method_update_with_all_params_overload_3(self, client: Cloudflare) -> N "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -1644,16 +1704,28 @@ def test_method_update_with_all_params_overload_4(self, client: Cloudflare) -> N "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -2682,16 +2754,28 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -2953,16 +3037,28 @@ async def test_method_create_with_all_params_overload_3(self, async_client: Asyn "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -3103,16 +3199,28 @@ async def test_method_create_with_all_params_overload_4(self, async_client: Asyn "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -3796,16 +3904,28 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -4093,16 +4213,28 @@ async def test_method_update_with_all_params_overload_3(self, async_client: Asyn "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -4257,16 +4389,28 @@ async def test_method_update_with_all_params_overload_4(self, async_client: Asyn "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, From 9f81aabab0586d04c1e3d4d85e8ff15c04745fed Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 14 Jan 2025 00:49:38 +0000 Subject: [PATCH 005/358] chore(internal): codegen related update (#2362) --- .../resources/accounts/tokens/tokens.py | 44 ++--- .../resources/content_scanning/payloads.py | 4 +- .../resources/dns/settings/views.py | 8 +- .../resources/dns_firewall/dns_firewall.py | 24 +-- .../leaked_credential_checks/detections.py | 8 +- .../spectrum/analytics/events/bytimes.py | 12 -- .../spectrum/analytics/events/summaries.py | 12 -- src/cloudflare/resources/spectrum/apps.py | 72 ++++--- .../resources/user/tokens/tokens.py | 44 ++--- .../resources/zero_trust/devices/networks.py | 12 -- .../types/accounts/token_update_params.py | 18 +- .../types/dns/settings/view_create_params.py | 4 +- .../dns_firewall_create_params.py | 10 +- .../dns_firewall/reverse_dns_edit_response.py | 4 +- .../dns_firewall/reverse_dns_get_response.py | 4 +- .../analytics/events/bytime_get_params.py | 8 - .../analytics/events/summary_get_params.py | 8 - .../types/spectrum/app_create_params.py | 7 +- .../types/spectrum/app_create_response.py | 4 +- .../types/spectrum/app_get_response.py | 4 +- .../types/spectrum/app_list_params.py | 2 +- .../types/spectrum/app_list_response.py | 4 +- .../types/spectrum/app_update_params.py | 7 +- .../types/spectrum/app_update_response.py | 4 +- .../types/user/token_update_params.py | 20 +- .../devices/network_create_params.py | 4 - .../devices/network_update_params.py | 4 - .../zero_trust/devices/posture/integration.py | 2 +- tests/api_resources/accounts/test_tokens.py | 152 ++------------- .../content_scanning/test_payloads.py | 16 +- .../api_resources/dns/settings/test_views.py | 26 +-- .../test_detections.py | 36 ++-- .../api_resources/magic_transit/test_apps.py | 4 +- tests/api_resources/pages/test_projects.py | 28 +-- tests/api_resources/spectrum/test_apps.py | 22 +++ tests/api_resources/test_dns_firewall.py | 24 +-- tests/api_resources/test_page_rules.py | 180 ++---------------- tests/api_resources/user/test_tokens.py | 128 ++----------- .../zero_trust/devices/test_networks.py | 24 +-- tests/api_resources/zero_trust/test_seats.py | 12 +- 40 files changed, 300 insertions(+), 710 deletions(-) diff --git a/src/cloudflare/resources/accounts/tokens/tokens.py b/src/cloudflare/resources/accounts/tokens/tokens.py index b5eb2fbd996..1ab9da980d8 100644 --- a/src/cloudflare/resources/accounts/tokens/tokens.py +++ b/src/cloudflare/resources/accounts/tokens/tokens.py @@ -146,12 +146,12 @@ def update( token_id: str, *, account_id: str, - name: str, - policies: Iterable[TokenPolicy], - status: Literal["active", "disabled", "expired"], condition: token_update_params.Condition | NotGiven = NOT_GIVEN, expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, not_before: Union[str, datetime] | NotGiven = NOT_GIVEN, + policies: Iterable[TokenPolicy] | NotGiven = NOT_GIVEN, + status: Literal["active", "disabled", "expired"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -167,17 +167,17 @@ def update( token_id: Token identifier tag. + expires_on: The expiration time on or after which the JWT MUST NOT be accepted for + processing. + name: Token name. + not_before: The time before which the token MUST NOT be accepted for processing. + policies: List of access policies assigned to the token. status: Status of the token. - expires_on: The expiration time on or after which the JWT MUST NOT be accepted for - processing. - - not_before: The time before which the token MUST NOT be accepted for processing. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -194,12 +194,12 @@ def update( f"/accounts/{account_id}/tokens/{token_id}", body=maybe_transform( { - "name": name, - "policies": policies, - "status": status, "condition": condition, "expires_on": expires_on, + "name": name, "not_before": not_before, + "policies": policies, + "status": status, }, token_update_params.TokenUpdateParams, ), @@ -493,12 +493,12 @@ async def update( token_id: str, *, account_id: str, - name: str, - policies: Iterable[TokenPolicy], - status: Literal["active", "disabled", "expired"], condition: token_update_params.Condition | NotGiven = NOT_GIVEN, expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, not_before: Union[str, datetime] | NotGiven = NOT_GIVEN, + policies: Iterable[TokenPolicy] | NotGiven = NOT_GIVEN, + status: Literal["active", "disabled", "expired"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -514,17 +514,17 @@ async def update( token_id: Token identifier tag. + expires_on: The expiration time on or after which the JWT MUST NOT be accepted for + processing. + name: Token name. + not_before: The time before which the token MUST NOT be accepted for processing. + policies: List of access policies assigned to the token. status: Status of the token. - expires_on: The expiration time on or after which the JWT MUST NOT be accepted for - processing. - - not_before: The time before which the token MUST NOT be accepted for processing. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -541,12 +541,12 @@ async def update( f"/accounts/{account_id}/tokens/{token_id}", body=await async_maybe_transform( { - "name": name, - "policies": policies, - "status": status, "condition": condition, "expires_on": expires_on, + "name": name, "not_before": not_before, + "policies": policies, + "status": status, }, token_update_params.TokenUpdateParams, ), diff --git a/src/cloudflare/resources/content_scanning/payloads.py b/src/cloudflare/resources/content_scanning/payloads.py index 535cee923bc..f87c64ee1b9 100644 --- a/src/cloudflare/resources/content_scanning/payloads.py +++ b/src/cloudflare/resources/content_scanning/payloads.py @@ -145,7 +145,7 @@ def delete( Args: zone_id: Identifier - expression_id: The unique ID for this custom scan expression + expression_id: Identifier extra_headers: Send extra headers @@ -287,7 +287,7 @@ async def delete( Args: zone_id: Identifier - expression_id: The unique ID for this custom scan expression + expression_id: Identifier extra_headers: Send extra headers diff --git a/src/cloudflare/resources/dns/settings/views.py b/src/cloudflare/resources/dns/settings/views.py index 2597e25825f..7a2dc39ae70 100644 --- a/src/cloudflare/resources/dns/settings/views.py +++ b/src/cloudflare/resources/dns/settings/views.py @@ -57,8 +57,8 @@ def create( self, *, account_id: str, - name: str, - zones: List[str], + name: str | NotGiven = NOT_GIVEN, + zones: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -351,8 +351,8 @@ async def create( self, *, account_id: str, - name: str, - zones: List[str], + name: str | NotGiven = NOT_GIVEN, + zones: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/cloudflare/resources/dns_firewall/dns_firewall.py b/src/cloudflare/resources/dns_firewall/dns_firewall.py index 5261afa946f..b0c5819854c 100644 --- a/src/cloudflare/resources/dns_firewall/dns_firewall.py +++ b/src/cloudflare/resources/dns_firewall/dns_firewall.py @@ -86,16 +86,16 @@ def create( self, *, account_id: str, - name: str, - upstream_ips: List[UpstreamIPs], attack_mitigation: Optional[AttackMitigationParam] | NotGiven = NOT_GIVEN, deprecate_any_requests: bool | NotGiven = NOT_GIVEN, ecs_fallback: bool | NotGiven = NOT_GIVEN, maximum_cache_ttl: float | NotGiven = NOT_GIVEN, minimum_cache_ttl: float | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, negative_cache_ttl: Optional[float] | NotGiven = NOT_GIVEN, ratelimit: Optional[float] | NotGiven = NOT_GIVEN, retries: float | NotGiven = NOT_GIVEN, + upstream_ips: List[UpstreamIPs] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -109,8 +109,6 @@ def create( Args: account_id: Identifier - name: DNS Firewall cluster name - attack_mitigation: Attack mitigation settings deprecate_any_requests: Whether to refuse to answer queries for the ANY type @@ -125,6 +123,8 @@ def create( of caching between DNS Firewall and the upstream servers. Lower TTLs will be increased to the minimum defined here for caching purposes. + name: DNS Firewall cluster name + negative_cache_ttl: Negative DNS cache TTL This setting controls how long DNS Firewall should cache negative responses (e.g., NXDOMAIN) from the upstream servers. @@ -148,16 +148,16 @@ def create( f"/accounts/{account_id}/dns_firewall", body=maybe_transform( { - "name": name, - "upstream_ips": upstream_ips, "attack_mitigation": attack_mitigation, "deprecate_any_requests": deprecate_any_requests, "ecs_fallback": ecs_fallback, "maximum_cache_ttl": maximum_cache_ttl, "minimum_cache_ttl": minimum_cache_ttl, + "name": name, "negative_cache_ttl": negative_cache_ttl, "ratelimit": ratelimit, "retries": retries, + "upstream_ips": upstream_ips, }, dns_firewall_create_params.DNSFirewallCreateParams, ), @@ -438,16 +438,16 @@ async def create( self, *, account_id: str, - name: str, - upstream_ips: List[UpstreamIPs], attack_mitigation: Optional[AttackMitigationParam] | NotGiven = NOT_GIVEN, deprecate_any_requests: bool | NotGiven = NOT_GIVEN, ecs_fallback: bool | NotGiven = NOT_GIVEN, maximum_cache_ttl: float | NotGiven = NOT_GIVEN, minimum_cache_ttl: float | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, negative_cache_ttl: Optional[float] | NotGiven = NOT_GIVEN, ratelimit: Optional[float] | NotGiven = NOT_GIVEN, retries: float | NotGiven = NOT_GIVEN, + upstream_ips: List[UpstreamIPs] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -461,8 +461,6 @@ async def create( Args: account_id: Identifier - name: DNS Firewall cluster name - attack_mitigation: Attack mitigation settings deprecate_any_requests: Whether to refuse to answer queries for the ANY type @@ -477,6 +475,8 @@ async def create( of caching between DNS Firewall and the upstream servers. Lower TTLs will be increased to the minimum defined here for caching purposes. + name: DNS Firewall cluster name + negative_cache_ttl: Negative DNS cache TTL This setting controls how long DNS Firewall should cache negative responses (e.g., NXDOMAIN) from the upstream servers. @@ -500,16 +500,16 @@ async def create( f"/accounts/{account_id}/dns_firewall", body=await async_maybe_transform( { - "name": name, - "upstream_ips": upstream_ips, "attack_mitigation": attack_mitigation, "deprecate_any_requests": deprecate_any_requests, "ecs_fallback": ecs_fallback, "maximum_cache_ttl": maximum_cache_ttl, "minimum_cache_ttl": minimum_cache_ttl, + "name": name, "negative_cache_ttl": negative_cache_ttl, "ratelimit": ratelimit, "retries": retries, + "upstream_ips": upstream_ips, }, dns_firewall_create_params.DNSFirewallCreateParams, ), diff --git a/src/cloudflare/resources/leaked_credential_checks/detections.py b/src/cloudflare/resources/leaked_credential_checks/detections.py index 4b7705d4334..958c2a1905f 100644 --- a/src/cloudflare/resources/leaked_credential_checks/detections.py +++ b/src/cloudflare/resources/leaked_credential_checks/detections.py @@ -122,7 +122,7 @@ def update( Args: zone_id: Identifier - detection_id: The unique ID for this custom detection + detection_id: Identifier password: The ruleset expression to use in matching the password in a request @@ -213,7 +213,7 @@ def delete( Args: zone_id: Identifier - detection_id: The unique ID for this custom detection + detection_id: Identifier extra_headers: Send extra headers @@ -332,7 +332,7 @@ async def update( Args: zone_id: Identifier - detection_id: The unique ID for this custom detection + detection_id: Identifier password: The ruleset expression to use in matching the password in a request @@ -423,7 +423,7 @@ async def delete( Args: zone_id: Identifier - detection_id: The unique ID for this custom detection + detection_id: Identifier extra_headers: Send extra headers diff --git a/src/cloudflare/resources/spectrum/analytics/events/bytimes.py b/src/cloudflare/resources/spectrum/analytics/events/bytimes.py index c3ea96893a9..3b921f3cda1 100644 --- a/src/cloudflare/resources/spectrum/analytics/events/bytimes.py +++ b/src/cloudflare/resources/spectrum/analytics/events/bytimes.py @@ -120,15 +120,9 @@ def get( | duration90th | 90th percentile connection duration | 1.0 | Time in milliseconds | | duration99th | 99th percentile connection duration | 1.0 | Time in milliseconds. | - since: Start of time interval to query, defaults to `until` - 6 hours. Timestamp must - be in RFC3339 format and uses UTC unless otherwise specified. - sort: The sort order for the result set; sort fields must be included in `metrics` or `dimensions`. - until: End of time interval to query, defaults to current time. Timestamp must be in - RFC3339 format and uses UTC unless otherwise specified. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -254,15 +248,9 @@ async def get( | duration90th | 90th percentile connection duration | 1.0 | Time in milliseconds | | duration99th | 99th percentile connection duration | 1.0 | Time in milliseconds. | - since: Start of time interval to query, defaults to `until` - 6 hours. Timestamp must - be in RFC3339 format and uses UTC unless otherwise specified. - sort: The sort order for the result set; sort fields must be included in `metrics` or `dimensions`. - until: End of time interval to query, defaults to current time. Timestamp must be in - RFC3339 format and uses UTC unless otherwise specified. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request diff --git a/src/cloudflare/resources/spectrum/analytics/events/summaries.py b/src/cloudflare/resources/spectrum/analytics/events/summaries.py index e12fbdece83..bb09f3e15be 100644 --- a/src/cloudflare/resources/spectrum/analytics/events/summaries.py +++ b/src/cloudflare/resources/spectrum/analytics/events/summaries.py @@ -117,15 +117,9 @@ def get( | duration90th | 90th percentile connection duration | 1.0 | Time in milliseconds | | duration99th | 99th percentile connection duration | 1.0 | Time in milliseconds. | - since: Start of time interval to query, defaults to `until` - 6 hours. Timestamp must - be in RFC3339 format and uses UTC unless otherwise specified. - sort: The sort order for the result set; sort fields must be included in `metrics` or `dimensions`. - until: End of time interval to query, defaults to current time. Timestamp must be in - RFC3339 format and uses UTC unless otherwise specified. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -247,15 +241,9 @@ async def get( | duration90th | 90th percentile connection duration | 1.0 | Time in milliseconds | | duration99th | 99th percentile connection duration | 1.0 | Time in milliseconds. | - since: Start of time interval to query, defaults to `until` - 6 hours. Timestamp must - be in RFC3339 format and uses UTC unless otherwise specified. - sort: The sort order for the result set; sort fields must be included in `metrics` or `dimensions`. - until: End of time interval to query, defaults to current time. Timestamp must be in - RFC3339 format and uses UTC unless otherwise specified. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request diff --git a/src/cloudflare/resources/spectrum/apps.py b/src/cloudflare/resources/spectrum/apps.py index 77726b8d156..f725a4b7615 100644 --- a/src/cloudflare/resources/spectrum/apps.py +++ b/src/cloudflare/resources/spectrum/apps.py @@ -86,7 +86,7 @@ def create( origin. Args: - zone_id: Zone identifier. + zone_id: Identifier dns: The name and type of DNS record for the Spectrum application. @@ -140,6 +140,7 @@ def create( self, *, zone_id: str, + id: str, dns: DNSParam, protocol: str, origin_direct: List[str] | NotGiven = NOT_GIVEN, @@ -155,7 +156,9 @@ def create( origin. Args: - zone_id: Zone identifier. + zone_id: Identifier + + id: Identifier dns: The name and type of DNS record for the Spectrum application. @@ -177,7 +180,7 @@ def create( @required_args( ["zone_id", "dns", "ip_firewall", "protocol", "proxy_protocol", "tls", "traffic_type"], - ["zone_id", "dns", "protocol"], + ["zone_id", "id", "dns", "protocol"], ) def create( self, @@ -194,6 +197,7 @@ def create( origin_direct: List[str] | NotGiven = NOT_GIVEN, origin_dns: OriginDNSParam | NotGiven = NOT_GIVEN, origin_port: OriginPortParam | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -220,6 +224,7 @@ def create( "origin_direct": origin_direct, "origin_dns": origin_dns, "origin_port": origin_port, + "id": id, }, app_create_params.AppCreateParams, ), @@ -265,9 +270,9 @@ def update( the origin. Args: - zone_id: Zone identifier. + zone_id: Identifier - app_id: App identifier. + app_id: Identifier dns: The name and type of DNS record for the Spectrum application. @@ -322,6 +327,7 @@ def update( app_id: str, *, zone_id: str, + id: str, dns: DNSParam, protocol: str, origin_direct: List[str] | NotGiven = NOT_GIVEN, @@ -337,9 +343,11 @@ def update( the origin. Args: - zone_id: Zone identifier. + zone_id: Identifier + + app_id: Identifier - app_id: App identifier. + id: Identifier dns: The name and type of DNS record for the Spectrum application. @@ -361,7 +369,7 @@ def update( @required_args( ["zone_id", "dns", "ip_firewall", "protocol", "proxy_protocol", "tls", "traffic_type"], - ["zone_id", "dns", "protocol"], + ["zone_id", "id", "dns", "protocol"], ) def update( self, @@ -379,6 +387,7 @@ def update( origin_direct: List[str] | NotGiven = NOT_GIVEN, origin_dns: OriginDNSParam | NotGiven = NOT_GIVEN, origin_port: OriginPortParam | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -407,6 +416,7 @@ def update( "origin_direct": origin_direct, "origin_dns": origin_dns, "origin_port": origin_port, + "id": id, }, app_update_params.AppUpdateParams, ), @@ -442,7 +452,7 @@ def list( Retrieves a list of currently existing Spectrum applications inside a zone. Args: - zone_id: Zone identifier. + zone_id: Identifier direction: Sets the direction by which results are ordered. @@ -501,9 +511,9 @@ def delete( Deletes a previously existing application. Args: - zone_id: Zone identifier. + zone_id: Identifier - app_id: App identifier. + app_id: Identifier extra_headers: Send extra headers @@ -545,9 +555,9 @@ def get( Gets the application configuration of a specific application inside a zone. Args: - zone_id: Zone identifier. + zone_id: Identifier - app_id: App identifier. + app_id: Identifier extra_headers: Send extra headers @@ -627,7 +637,7 @@ async def create( origin. Args: - zone_id: Zone identifier. + zone_id: Identifier dns: The name and type of DNS record for the Spectrum application. @@ -681,6 +691,7 @@ async def create( self, *, zone_id: str, + id: str, dns: DNSParam, protocol: str, origin_direct: List[str] | NotGiven = NOT_GIVEN, @@ -696,7 +707,9 @@ async def create( origin. Args: - zone_id: Zone identifier. + zone_id: Identifier + + id: Identifier dns: The name and type of DNS record for the Spectrum application. @@ -718,7 +731,7 @@ async def create( @required_args( ["zone_id", "dns", "ip_firewall", "protocol", "proxy_protocol", "tls", "traffic_type"], - ["zone_id", "dns", "protocol"], + ["zone_id", "id", "dns", "protocol"], ) async def create( self, @@ -735,6 +748,7 @@ async def create( origin_direct: List[str] | NotGiven = NOT_GIVEN, origin_dns: OriginDNSParam | NotGiven = NOT_GIVEN, origin_port: OriginPortParam | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -761,6 +775,7 @@ async def create( "origin_direct": origin_direct, "origin_dns": origin_dns, "origin_port": origin_port, + "id": id, }, app_create_params.AppCreateParams, ), @@ -806,9 +821,9 @@ async def update( the origin. Args: - zone_id: Zone identifier. + zone_id: Identifier - app_id: App identifier. + app_id: Identifier dns: The name and type of DNS record for the Spectrum application. @@ -863,6 +878,7 @@ async def update( app_id: str, *, zone_id: str, + id: str, dns: DNSParam, protocol: str, origin_direct: List[str] | NotGiven = NOT_GIVEN, @@ -878,9 +894,11 @@ async def update( the origin. Args: - zone_id: Zone identifier. + zone_id: Identifier + + app_id: Identifier - app_id: App identifier. + id: Identifier dns: The name and type of DNS record for the Spectrum application. @@ -902,7 +920,7 @@ async def update( @required_args( ["zone_id", "dns", "ip_firewall", "protocol", "proxy_protocol", "tls", "traffic_type"], - ["zone_id", "dns", "protocol"], + ["zone_id", "id", "dns", "protocol"], ) async def update( self, @@ -920,6 +938,7 @@ async def update( origin_direct: List[str] | NotGiven = NOT_GIVEN, origin_dns: OriginDNSParam | NotGiven = NOT_GIVEN, origin_port: OriginPortParam | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -948,6 +967,7 @@ async def update( "origin_direct": origin_direct, "origin_dns": origin_dns, "origin_port": origin_port, + "id": id, }, app_update_params.AppUpdateParams, ), @@ -983,7 +1003,7 @@ def list( Retrieves a list of currently existing Spectrum applications inside a zone. Args: - zone_id: Zone identifier. + zone_id: Identifier direction: Sets the direction by which results are ordered. @@ -1042,9 +1062,9 @@ async def delete( Deletes a previously existing application. Args: - zone_id: Zone identifier. + zone_id: Identifier - app_id: App identifier. + app_id: Identifier extra_headers: Send extra headers @@ -1086,9 +1106,9 @@ async def get( Gets the application configuration of a specific application inside a zone. Args: - zone_id: Zone identifier. + zone_id: Identifier - app_id: App identifier. + app_id: Identifier extra_headers: Send extra headers diff --git a/src/cloudflare/resources/user/tokens/tokens.py b/src/cloudflare/resources/user/tokens/tokens.py index 15d0a3ea6d9..f289d00eecb 100644 --- a/src/cloudflare/resources/user/tokens/tokens.py +++ b/src/cloudflare/resources/user/tokens/tokens.py @@ -140,12 +140,12 @@ def update( self, token_id: str, *, - name: str, - policies: Iterable[TokenPolicy], - status: Literal["active", "disabled", "expired"], condition: token_update_params.Condition | NotGiven = NOT_GIVEN, expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, not_before: Union[str, datetime] | NotGiven = NOT_GIVEN, + policies: Iterable[TokenPolicy] | NotGiven = NOT_GIVEN, + status: Literal["active", "disabled", "expired"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -159,17 +159,17 @@ def update( Args: token_id: Token identifier tag. + expires_on: The expiration time on or after which the JWT MUST NOT be accepted for + processing. + name: Token name. + not_before: The time before which the token MUST NOT be accepted for processing. + policies: List of access policies assigned to the token. status: Status of the token. - expires_on: The expiration time on or after which the JWT MUST NOT be accepted for - processing. - - not_before: The time before which the token MUST NOT be accepted for processing. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -184,12 +184,12 @@ def update( f"/user/tokens/{token_id}", body=maybe_transform( { - "name": name, - "policies": policies, - "status": status, "condition": condition, "expires_on": expires_on, + "name": name, "not_before": not_before, + "policies": policies, + "status": status, }, token_update_params.TokenUpdateParams, ), @@ -446,12 +446,12 @@ async def update( self, token_id: str, *, - name: str, - policies: Iterable[TokenPolicy], - status: Literal["active", "disabled", "expired"], condition: token_update_params.Condition | NotGiven = NOT_GIVEN, expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, not_before: Union[str, datetime] | NotGiven = NOT_GIVEN, + policies: Iterable[TokenPolicy] | NotGiven = NOT_GIVEN, + status: Literal["active", "disabled", "expired"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -465,17 +465,17 @@ async def update( Args: token_id: Token identifier tag. + expires_on: The expiration time on or after which the JWT MUST NOT be accepted for + processing. + name: Token name. + not_before: The time before which the token MUST NOT be accepted for processing. + policies: List of access policies assigned to the token. status: Status of the token. - expires_on: The expiration time on or after which the JWT MUST NOT be accepted for - processing. - - not_before: The time before which the token MUST NOT be accepted for processing. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -490,12 +490,12 @@ async def update( f"/user/tokens/{token_id}", body=await async_maybe_transform( { - "name": name, - "policies": policies, - "status": status, "condition": condition, "expires_on": expires_on, + "name": name, "not_before": not_before, + "policies": policies, + "status": status, }, token_update_params.TokenUpdateParams, ), diff --git a/src/cloudflare/resources/zero_trust/devices/networks.py b/src/cloudflare/resources/zero_trust/devices/networks.py index f9e2b7b083a..b3058631bac 100644 --- a/src/cloudflare/resources/zero_trust/devices/networks.py +++ b/src/cloudflare/resources/zero_trust/devices/networks.py @@ -68,9 +68,6 @@ def create( Creates a new device managed network. Args: - config: The configuration object containing information for the WARP client to detect - the managed network. - name: The name of the device managed network. This name must be unique. type: The type of device managed network. @@ -126,9 +123,6 @@ def update( Args: network_id: API UUID. - config: The configuration object containing information for the WARP client to detect - the managed network. - name: The name of the device managed network. This name must be unique. type: The type of device managed network. @@ -323,9 +317,6 @@ async def create( Creates a new device managed network. Args: - config: The configuration object containing information for the WARP client to detect - the managed network. - name: The name of the device managed network. This name must be unique. type: The type of device managed network. @@ -381,9 +372,6 @@ async def update( Args: network_id: API UUID. - config: The configuration object containing information for the WARP client to detect - the managed network. - name: The name of the device managed network. This name must be unique. type: The type of device managed network. diff --git a/src/cloudflare/types/accounts/token_update_params.py b/src/cloudflare/types/accounts/token_update_params.py index fe7ed0cf440..bec89b38118 100644 --- a/src/cloudflare/types/accounts/token_update_params.py +++ b/src/cloudflare/types/accounts/token_update_params.py @@ -17,15 +17,6 @@ class TokenUpdateParams(TypedDict, total=False): account_id: Required[str] """Account identifier tag.""" - name: Required[str] - """Token name.""" - - policies: Required[Iterable[TokenPolicy]] - """List of access policies assigned to the token.""" - - status: Required[Literal["active", "disabled", "expired"]] - """Status of the token.""" - condition: Condition expires_on: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] @@ -34,9 +25,18 @@ class TokenUpdateParams(TypedDict, total=False): processing. """ + name: str + """Token name.""" + not_before: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] """The time before which the token MUST NOT be accepted for processing.""" + policies: Iterable[TokenPolicy] + """List of access policies assigned to the token.""" + + status: Literal["active", "disabled", "expired"] + """Status of the token.""" + _ConditionRequestIPReservedKeywords = TypedDict( "_ConditionRequestIPReservedKeywords", diff --git a/src/cloudflare/types/dns/settings/view_create_params.py b/src/cloudflare/types/dns/settings/view_create_params.py index cd8bc0500c0..4bf2b58d049 100644 --- a/src/cloudflare/types/dns/settings/view_create_params.py +++ b/src/cloudflare/types/dns/settings/view_create_params.py @@ -12,8 +12,8 @@ class ViewCreateParams(TypedDict, total=False): account_id: Required[str] """Identifier""" - name: Required[str] + name: str """The name of the view.""" - zones: Required[List[str]] + zones: List[str] """The list of zones linked to this view.""" diff --git a/src/cloudflare/types/dns_firewall/dns_firewall_create_params.py b/src/cloudflare/types/dns_firewall/dns_firewall_create_params.py index 8a8c22bfc46..4ce7d450a69 100644 --- a/src/cloudflare/types/dns_firewall/dns_firewall_create_params.py +++ b/src/cloudflare/types/dns_firewall/dns_firewall_create_params.py @@ -15,11 +15,6 @@ class DNSFirewallCreateParams(TypedDict, total=False): account_id: Required[str] """Identifier""" - name: Required[str] - """DNS Firewall cluster name""" - - upstream_ips: Required[List[UpstreamIPs]] - attack_mitigation: Optional[AttackMitigationParam] """Attack mitigation settings""" @@ -43,6 +38,9 @@ class DNSFirewallCreateParams(TypedDict, total=False): increased to the minimum defined here for caching purposes. """ + name: str + """DNS Firewall cluster name""" + negative_cache_ttl: Optional[float] """ Negative DNS cache TTL This setting controls how long DNS Firewall should cache @@ -60,3 +58,5 @@ class DNSFirewallCreateParams(TypedDict, total=False): Number of retries for fetching DNS responses from upstream nameservers (not counting the initial attempt) """ + + upstream_ips: List[UpstreamIPs] diff --git a/src/cloudflare/types/dns_firewall/reverse_dns_edit_response.py b/src/cloudflare/types/dns_firewall/reverse_dns_edit_response.py index 2d62ac9f0dd..089fc523ef0 100644 --- a/src/cloudflare/types/dns_firewall/reverse_dns_edit_response.py +++ b/src/cloudflare/types/dns_firewall/reverse_dns_edit_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict +from typing import Dict, Optional from ..._models import BaseModel @@ -8,5 +8,5 @@ class ReverseDNSEditResponse(BaseModel): - ptr: Dict[str, str] + ptr: Optional[Dict[str, str]] = None """Map of cluster IP addresses to PTR record contents""" diff --git a/src/cloudflare/types/dns_firewall/reverse_dns_get_response.py b/src/cloudflare/types/dns_firewall/reverse_dns_get_response.py index 21478156b97..cd35a30bf00 100644 --- a/src/cloudflare/types/dns_firewall/reverse_dns_get_response.py +++ b/src/cloudflare/types/dns_firewall/reverse_dns_get_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict +from typing import Dict, Optional from ..._models import BaseModel @@ -8,5 +8,5 @@ class ReverseDNSGetResponse(BaseModel): - ptr: Dict[str, str] + ptr: Optional[Dict[str, str]] = None """Map of cluster IP addresses to PTR record contents""" diff --git a/src/cloudflare/types/spectrum/analytics/events/bytime_get_params.py b/src/cloudflare/types/spectrum/analytics/events/bytime_get_params.py index 2a998b647d8..6509fec8899 100644 --- a/src/cloudflare/types/spectrum/analytics/events/bytime_get_params.py +++ b/src/cloudflare/types/spectrum/analytics/events/bytime_get_params.py @@ -67,10 +67,6 @@ class BytimeGetParams(TypedDict, total=False): """ since: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] - """Start of time interval to query, defaults to `until` - 6 hours. - - Timestamp must be in RFC3339 format and uses UTC unless otherwise specified. - """ sort: List[str] """ @@ -79,7 +75,3 @@ class BytimeGetParams(TypedDict, total=False): """ until: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] - """End of time interval to query, defaults to current time. - - Timestamp must be in RFC3339 format and uses UTC unless otherwise specified. - """ diff --git a/src/cloudflare/types/spectrum/analytics/events/summary_get_params.py b/src/cloudflare/types/spectrum/analytics/events/summary_get_params.py index cd0ece71f19..71d9e69de87 100644 --- a/src/cloudflare/types/spectrum/analytics/events/summary_get_params.py +++ b/src/cloudflare/types/spectrum/analytics/events/summary_get_params.py @@ -64,10 +64,6 @@ class SummaryGetParams(TypedDict, total=False): """ since: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] - """Start of time interval to query, defaults to `until` - 6 hours. - - Timestamp must be in RFC3339 format and uses UTC unless otherwise specified. - """ sort: List[str] """ @@ -76,7 +72,3 @@ class SummaryGetParams(TypedDict, total=False): """ until: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] - """End of time interval to query, defaults to current time. - - Timestamp must be in RFC3339 format and uses UTC unless otherwise specified. - """ diff --git a/src/cloudflare/types/spectrum/app_create_params.py b/src/cloudflare/types/spectrum/app_create_params.py index 321ca9d6d93..fc47e6b2141 100644 --- a/src/cloudflare/types/spectrum/app_create_params.py +++ b/src/cloudflare/types/spectrum/app_create_params.py @@ -15,7 +15,7 @@ class SpectrumConfigAppConfig(TypedDict, total=False): zone_id: Required[str] - """Zone identifier.""" + """Identifier""" dns: Required[DNSParam] """The name and type of DNS record for the Spectrum application.""" @@ -85,7 +85,10 @@ class SpectrumConfigAppConfig(TypedDict, total=False): class SpectrumConfigPaygoAppConfig(TypedDict, total=False): zone_id: Required[str] - """Zone identifier.""" + """Identifier""" + + id: Required[str] + """Identifier""" dns: Required[DNSParam] """The name and type of DNS record for the Spectrum application.""" diff --git a/src/cloudflare/types/spectrum/app_create_response.py b/src/cloudflare/types/spectrum/app_create_response.py index d6a8d9d9947..a1517db4c4c 100644 --- a/src/cloudflare/types/spectrum/app_create_response.py +++ b/src/cloudflare/types/spectrum/app_create_response.py @@ -91,16 +91,14 @@ class SpectrumConfigAppConfig(BaseModel): class SpectrumConfigPaygoAppConfig(BaseModel): id: str - """App identifier.""" + """Identifier""" created_on: datetime - """When the Application was created.""" dns: DNS """The name and type of DNS record for the Spectrum application.""" modified_on: datetime - """When the Application was last modified.""" protocol: str """The port configuration at Cloudflare's edge. diff --git a/src/cloudflare/types/spectrum/app_get_response.py b/src/cloudflare/types/spectrum/app_get_response.py index de88107be2b..0042b85955a 100644 --- a/src/cloudflare/types/spectrum/app_get_response.py +++ b/src/cloudflare/types/spectrum/app_get_response.py @@ -91,16 +91,14 @@ class SpectrumConfigAppConfig(BaseModel): class SpectrumConfigPaygoAppConfig(BaseModel): id: str - """App identifier.""" + """Identifier""" created_on: datetime - """When the Application was created.""" dns: DNS """The name and type of DNS record for the Spectrum application.""" modified_on: datetime - """When the Application was last modified.""" protocol: str """The port configuration at Cloudflare's edge. diff --git a/src/cloudflare/types/spectrum/app_list_params.py b/src/cloudflare/types/spectrum/app_list_params.py index 84e5876649c..fb9b5f9aa05 100644 --- a/src/cloudflare/types/spectrum/app_list_params.py +++ b/src/cloudflare/types/spectrum/app_list_params.py @@ -9,7 +9,7 @@ class AppListParams(TypedDict, total=False): zone_id: Required[str] - """Zone identifier.""" + """Identifier""" direction: Literal["asc", "desc"] """Sets the direction by which results are ordered.""" diff --git a/src/cloudflare/types/spectrum/app_list_response.py b/src/cloudflare/types/spectrum/app_list_response.py index b985557d36f..2d4dcaa2c89 100644 --- a/src/cloudflare/types/spectrum/app_list_response.py +++ b/src/cloudflare/types/spectrum/app_list_response.py @@ -91,16 +91,14 @@ class UnionMember0(BaseModel): class UnionMember1(BaseModel): id: str - """App identifier.""" + """Identifier""" created_on: datetime - """When the Application was created.""" dns: DNS """The name and type of DNS record for the Spectrum application.""" modified_on: datetime - """When the Application was last modified.""" protocol: str """The port configuration at Cloudflare's edge. diff --git a/src/cloudflare/types/spectrum/app_update_params.py b/src/cloudflare/types/spectrum/app_update_params.py index 90905475eac..e5b22ea30ad 100644 --- a/src/cloudflare/types/spectrum/app_update_params.py +++ b/src/cloudflare/types/spectrum/app_update_params.py @@ -15,7 +15,7 @@ class SpectrumConfigAppConfig(TypedDict, total=False): zone_id: Required[str] - """Zone identifier.""" + """Identifier""" dns: Required[DNSParam] """The name and type of DNS record for the Spectrum application.""" @@ -85,7 +85,10 @@ class SpectrumConfigAppConfig(TypedDict, total=False): class SpectrumConfigPaygoAppConfig(TypedDict, total=False): zone_id: Required[str] - """Zone identifier.""" + """Identifier""" + + id: Required[str] + """Identifier""" dns: Required[DNSParam] """The name and type of DNS record for the Spectrum application.""" diff --git a/src/cloudflare/types/spectrum/app_update_response.py b/src/cloudflare/types/spectrum/app_update_response.py index 8ee0649beea..d440aa156d6 100644 --- a/src/cloudflare/types/spectrum/app_update_response.py +++ b/src/cloudflare/types/spectrum/app_update_response.py @@ -91,16 +91,14 @@ class SpectrumConfigAppConfig(BaseModel): class SpectrumConfigPaygoAppConfig(BaseModel): id: str - """App identifier.""" + """Identifier""" created_on: datetime - """When the Application was created.""" dns: DNS """The name and type of DNS record for the Spectrum application.""" modified_on: datetime - """When the Application was last modified.""" protocol: str """The port configuration at Cloudflare's edge. diff --git a/src/cloudflare/types/user/token_update_params.py b/src/cloudflare/types/user/token_update_params.py index 6df123fcec8..b48ae15215b 100644 --- a/src/cloudflare/types/user/token_update_params.py +++ b/src/cloudflare/types/user/token_update_params.py @@ -4,7 +4,7 @@ from typing import List, Union, Iterable from datetime import datetime -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Literal, Annotated, TypedDict from ..._utils import PropertyInfo from ..shared_params.token_policy import TokenPolicy @@ -14,15 +14,6 @@ class TokenUpdateParams(TypedDict, total=False): - name: Required[str] - """Token name.""" - - policies: Required[Iterable[TokenPolicy]] - """List of access policies assigned to the token.""" - - status: Required[Literal["active", "disabled", "expired"]] - """Status of the token.""" - condition: Condition expires_on: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] @@ -31,9 +22,18 @@ class TokenUpdateParams(TypedDict, total=False): processing. """ + name: str + """Token name.""" + not_before: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] """The time before which the token MUST NOT be accepted for processing.""" + policies: Iterable[TokenPolicy] + """List of access policies assigned to the token.""" + + status: Literal["active", "disabled", "expired"] + """Status of the token.""" + _ConditionRequestIPReservedKeywords = TypedDict( "_ConditionRequestIPReservedKeywords", diff --git a/src/cloudflare/types/zero_trust/devices/network_create_params.py b/src/cloudflare/types/zero_trust/devices/network_create_params.py index 66c61f32f1b..25154e42853 100644 --- a/src/cloudflare/types/zero_trust/devices/network_create_params.py +++ b/src/cloudflare/types/zero_trust/devices/network_create_params.py @@ -11,10 +11,6 @@ class NetworkCreateParams(TypedDict, total=False): account_id: Required[str] config: Required[Config] - """ - The configuration object containing information for the WARP client to detect - the managed network. - """ name: Required[str] """The name of the device managed network. This name must be unique.""" diff --git a/src/cloudflare/types/zero_trust/devices/network_update_params.py b/src/cloudflare/types/zero_trust/devices/network_update_params.py index ff00a95df86..5ead0f603f3 100644 --- a/src/cloudflare/types/zero_trust/devices/network_update_params.py +++ b/src/cloudflare/types/zero_trust/devices/network_update_params.py @@ -11,10 +11,6 @@ class NetworkUpdateParams(TypedDict, total=False): account_id: Required[str] config: Config - """ - The configuration object containing information for the WARP client to detect - the managed network. - """ name: str """The name of the device managed network. This name must be unique.""" diff --git a/src/cloudflare/types/zero_trust/devices/posture/integration.py b/src/cloudflare/types/zero_trust/devices/posture/integration.py index b517b4a7e70..7dcc3bb7c74 100644 --- a/src/cloudflare/types/zero_trust/devices/posture/integration.py +++ b/src/cloudflare/types/zero_trust/devices/posture/integration.py @@ -24,7 +24,7 @@ class Integration(BaseModel): """API UUID.""" config: Optional[Config] = None - """The configuration object containing third-party integration information.""" + """The Workspace One Config Response.""" interval: Optional[str] = None """The interval between each posture check with the third-party API. diff --git a/tests/api_resources/accounts/test_tokens.py b/tests/api_resources/accounts/test_tokens.py index 8aabf18fb93..dc10d79e1de 100644 --- a/tests/api_resources/accounts/test_tokens.py +++ b/tests/api_resources/accounts/test_tokens.py @@ -156,18 +156,6 @@ def test_method_update(self, client: Cloudflare) -> None: token = client.accounts.tokens.update( token_id="ed17574386854bf78a67040be0a770b0", account_id="eb78d65290b24279ba6f44721b3ea3c4", - name="readonly token", - policies=[ - { - "effect": "allow", - "permission_groups": [{}, {}], - "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }, - } - ], - status="active", ) assert_matches_type(Optional[Token], token, path=["response"]) @@ -177,7 +165,15 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: token = client.accounts.tokens.update( token_id="ed17574386854bf78a67040be0a770b0", account_id="eb78d65290b24279ba6f44721b3ea3c4", + condition={ + "request_ip": { + "in": ["123.123.123.0/24", "2606:4700::/32"], + "not_in": ["123.123.123.100/24", "2606:4700:4700::/48"], + } + }, + expires_on=parse_datetime("2020-01-01T00:00:00Z"), name="readonly token", + not_before=parse_datetime("2018-07-01T05:20:00Z"), policies=[ { "effect": "allow", @@ -202,14 +198,6 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: } ], status="active", - condition={ - "request_ip": { - "in": ["123.123.123.0/24", "2606:4700::/32"], - "not_in": ["123.123.123.100/24", "2606:4700:4700::/48"], - } - }, - expires_on=parse_datetime("2020-01-01T00:00:00Z"), - not_before=parse_datetime("2018-07-01T05:20:00Z"), ) assert_matches_type(Optional[Token], token, path=["response"]) @@ -219,18 +207,6 @@ def test_raw_response_update(self, client: Cloudflare) -> None: response = client.accounts.tokens.with_raw_response.update( token_id="ed17574386854bf78a67040be0a770b0", account_id="eb78d65290b24279ba6f44721b3ea3c4", - name="readonly token", - policies=[ - { - "effect": "allow", - "permission_groups": [{}, {}], - "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }, - } - ], - status="active", ) assert response.is_closed is True @@ -244,18 +220,6 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: with client.accounts.tokens.with_streaming_response.update( token_id="ed17574386854bf78a67040be0a770b0", account_id="eb78d65290b24279ba6f44721b3ea3c4", - name="readonly token", - policies=[ - { - "effect": "allow", - "permission_groups": [{}, {}], - "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }, - } - ], - status="active", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -272,36 +236,12 @@ def test_path_params_update(self, client: Cloudflare) -> None: client.accounts.tokens.with_raw_response.update( token_id="ed17574386854bf78a67040be0a770b0", account_id="", - name="readonly token", - policies=[ - { - "effect": "allow", - "permission_groups": [{}, {}], - "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }, - } - ], - status="active", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `token_id` but received ''"): client.accounts.tokens.with_raw_response.update( token_id="", account_id="eb78d65290b24279ba6f44721b3ea3c4", - name="readonly token", - policies=[ - { - "effect": "allow", - "permission_groups": [{}, {}], - "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }, - } - ], - status="active", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -639,18 +579,6 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: token = await async_client.accounts.tokens.update( token_id="ed17574386854bf78a67040be0a770b0", account_id="eb78d65290b24279ba6f44721b3ea3c4", - name="readonly token", - policies=[ - { - "effect": "allow", - "permission_groups": [{}, {}], - "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }, - } - ], - status="active", ) assert_matches_type(Optional[Token], token, path=["response"]) @@ -660,7 +588,15 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare token = await async_client.accounts.tokens.update( token_id="ed17574386854bf78a67040be0a770b0", account_id="eb78d65290b24279ba6f44721b3ea3c4", + condition={ + "request_ip": { + "in": ["123.123.123.0/24", "2606:4700::/32"], + "not_in": ["123.123.123.100/24", "2606:4700:4700::/48"], + } + }, + expires_on=parse_datetime("2020-01-01T00:00:00Z"), name="readonly token", + not_before=parse_datetime("2018-07-01T05:20:00Z"), policies=[ { "effect": "allow", @@ -685,14 +621,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare } ], status="active", - condition={ - "request_ip": { - "in": ["123.123.123.0/24", "2606:4700::/32"], - "not_in": ["123.123.123.100/24", "2606:4700:4700::/48"], - } - }, - expires_on=parse_datetime("2020-01-01T00:00:00Z"), - not_before=parse_datetime("2018-07-01T05:20:00Z"), ) assert_matches_type(Optional[Token], token, path=["response"]) @@ -702,18 +630,6 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.accounts.tokens.with_raw_response.update( token_id="ed17574386854bf78a67040be0a770b0", account_id="eb78d65290b24279ba6f44721b3ea3c4", - name="readonly token", - policies=[ - { - "effect": "allow", - "permission_groups": [{}, {}], - "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }, - } - ], - status="active", ) assert response.is_closed is True @@ -727,18 +643,6 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> async with async_client.accounts.tokens.with_streaming_response.update( token_id="ed17574386854bf78a67040be0a770b0", account_id="eb78d65290b24279ba6f44721b3ea3c4", - name="readonly token", - policies=[ - { - "effect": "allow", - "permission_groups": [{}, {}], - "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }, - } - ], - status="active", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -755,36 +659,12 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: await async_client.accounts.tokens.with_raw_response.update( token_id="ed17574386854bf78a67040be0a770b0", account_id="", - name="readonly token", - policies=[ - { - "effect": "allow", - "permission_groups": [{}, {}], - "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }, - } - ], - status="active", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `token_id` but received ''"): await async_client.accounts.tokens.with_raw_response.update( token_id="", account_id="eb78d65290b24279ba6f44721b3ea3c4", - name="readonly token", - policies=[ - { - "effect": "allow", - "permission_groups": [{}, {}], - "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }, - } - ], - status="active", ) @pytest.mark.skip(reason="TODO: investigate broken test") diff --git a/tests/api_resources/content_scanning/test_payloads.py b/tests/api_resources/content_scanning/test_payloads.py index 5dc0673978c..cf00ee67253 100644 --- a/tests/api_resources/content_scanning/test_payloads.py +++ b/tests/api_resources/content_scanning/test_payloads.py @@ -105,7 +105,7 @@ def test_path_params_list(self, client: Cloudflare) -> None: @parametrize def test_method_delete(self, client: Cloudflare) -> None: payload = client.content_scanning.payloads.delete( - expression_id="a350a054caa840c9becd89c3b4f0195b", + expression_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[PayloadDeleteResponse], payload, path=["response"]) @@ -113,7 +113,7 @@ def test_method_delete(self, client: Cloudflare) -> None: @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: response = client.content_scanning.payloads.with_raw_response.delete( - expression_id="a350a054caa840c9becd89c3b4f0195b", + expression_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -125,7 +125,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: with client.content_scanning.payloads.with_streaming_response.delete( - expression_id="a350a054caa840c9becd89c3b4f0195b", + expression_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed @@ -140,7 +140,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: def test_path_params_delete(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.content_scanning.payloads.with_raw_response.delete( - expression_id="a350a054caa840c9becd89c3b4f0195b", + expression_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", ) @@ -237,7 +237,7 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_delete(self, async_client: AsyncCloudflare) -> None: payload = await async_client.content_scanning.payloads.delete( - expression_id="a350a054caa840c9becd89c3b4f0195b", + expression_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[PayloadDeleteResponse], payload, path=["response"]) @@ -245,7 +245,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: response = await async_client.content_scanning.payloads.with_raw_response.delete( - expression_id="a350a054caa840c9becd89c3b4f0195b", + expression_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -257,7 +257,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: async with async_client.content_scanning.payloads.with_streaming_response.delete( - expression_id="a350a054caa840c9becd89c3b4f0195b", + expression_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed @@ -272,7 +272,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.content_scanning.payloads.with_raw_response.delete( - expression_id="a350a054caa840c9becd89c3b4f0195b", + expression_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", ) diff --git a/tests/api_resources/dns/settings/test_views.py b/tests/api_resources/dns/settings/test_views.py index 3187e65af01..63b070ea910 100644 --- a/tests/api_resources/dns/settings/test_views.py +++ b/tests/api_resources/dns/settings/test_views.py @@ -26,6 +26,13 @@ class TestViews: @parametrize def test_method_create(self, client: Cloudflare) -> None: + view = client.dns.settings.views.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[ViewCreateResponse], view, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Cloudflare) -> None: view = client.dns.settings.views.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", name="my view", @@ -37,8 +44,6 @@ def test_method_create(self, client: Cloudflare) -> None: def test_raw_response_create(self, client: Cloudflare) -> None: response = client.dns.settings.views.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - name="my view", - zones=["372e67954025e0ba6aaa6d586b9e0b59"], ) assert response.is_closed is True @@ -50,8 +55,6 @@ def test_raw_response_create(self, client: Cloudflare) -> None: def test_streaming_response_create(self, client: Cloudflare) -> None: with client.dns.settings.views.with_streaming_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - name="my view", - zones=["372e67954025e0ba6aaa6d586b9e0b59"], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -66,8 +69,6 @@ def test_path_params_create(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.dns.settings.views.with_raw_response.create( account_id="", - name="my view", - zones=["372e67954025e0ba6aaa6d586b9e0b59"], ) @parametrize @@ -288,6 +289,13 @@ class TestAsyncViews: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: + view = await async_client.dns.settings.views.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[ViewCreateResponse], view, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: view = await async_client.dns.settings.views.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", name="my view", @@ -299,8 +307,6 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns.settings.views.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - name="my view", - zones=["372e67954025e0ba6aaa6d586b9e0b59"], ) assert response.is_closed is True @@ -312,8 +318,6 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.dns.settings.views.with_streaming_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - name="my view", - zones=["372e67954025e0ba6aaa6d586b9e0b59"], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -328,8 +332,6 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.dns.settings.views.with_raw_response.create( account_id="", - name="my view", - zones=["372e67954025e0ba6aaa6d586b9e0b59"], ) @parametrize diff --git a/tests/api_resources/leaked_credential_checks/test_detections.py b/tests/api_resources/leaked_credential_checks/test_detections.py index c74c2b245cc..94a84b84e7f 100644 --- a/tests/api_resources/leaked_credential_checks/test_detections.py +++ b/tests/api_resources/leaked_credential_checks/test_detections.py @@ -72,7 +72,7 @@ def test_path_params_create(self, client: Cloudflare) -> None: @parametrize def test_method_update(self, client: Cloudflare) -> None: detection = client.leaked_credential_checks.detections.update( - detection_id="18a14bafaa8eb1df04ce683ec18c765e", + detection_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(DetectionUpdateResponse, detection, path=["response"]) @@ -80,7 +80,7 @@ def test_method_update(self, client: Cloudflare) -> None: @parametrize def test_method_update_with_all_params(self, client: Cloudflare) -> None: detection = client.leaked_credential_checks.detections.update( - detection_id="18a14bafaa8eb1df04ce683ec18c765e", + detection_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", password='lookup_json_string(http.request.body.raw, "secret")', username='lookup_json_string(http.request.body.raw, "user")', @@ -90,7 +90,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: response = client.leaked_credential_checks.detections.with_raw_response.update( - detection_id="18a14bafaa8eb1df04ce683ec18c765e", + detection_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -102,7 +102,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: with client.leaked_credential_checks.detections.with_streaming_response.update( - detection_id="18a14bafaa8eb1df04ce683ec18c765e", + detection_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed @@ -117,7 +117,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.leaked_credential_checks.detections.with_raw_response.update( - detection_id="18a14bafaa8eb1df04ce683ec18c765e", + detection_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", ) @@ -168,7 +168,7 @@ def test_path_params_list(self, client: Cloudflare) -> None: @parametrize def test_method_delete(self, client: Cloudflare) -> None: detection = client.leaked_credential_checks.detections.delete( - detection_id="18a14bafaa8eb1df04ce683ec18c765e", + detection_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(object, detection, path=["response"]) @@ -176,7 +176,7 @@ def test_method_delete(self, client: Cloudflare) -> None: @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: response = client.leaked_credential_checks.detections.with_raw_response.delete( - detection_id="18a14bafaa8eb1df04ce683ec18c765e", + detection_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -188,7 +188,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: with client.leaked_credential_checks.detections.with_streaming_response.delete( - detection_id="18a14bafaa8eb1df04ce683ec18c765e", + detection_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed @@ -203,7 +203,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: def test_path_params_delete(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.leaked_credential_checks.detections.with_raw_response.delete( - detection_id="18a14bafaa8eb1df04ce683ec18c765e", + detection_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", ) @@ -267,7 +267,7 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_update(self, async_client: AsyncCloudflare) -> None: detection = await async_client.leaked_credential_checks.detections.update( - detection_id="18a14bafaa8eb1df04ce683ec18c765e", + detection_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(DetectionUpdateResponse, detection, path=["response"]) @@ -275,7 +275,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: detection = await async_client.leaked_credential_checks.detections.update( - detection_id="18a14bafaa8eb1df04ce683ec18c765e", + detection_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", password='lookup_json_string(http.request.body.raw, "secret")', username='lookup_json_string(http.request.body.raw, "user")', @@ -285,7 +285,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.leaked_credential_checks.detections.with_raw_response.update( - detection_id="18a14bafaa8eb1df04ce683ec18c765e", + detection_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -297,7 +297,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.leaked_credential_checks.detections.with_streaming_response.update( - detection_id="18a14bafaa8eb1df04ce683ec18c765e", + detection_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed @@ -312,7 +312,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.leaked_credential_checks.detections.with_raw_response.update( - detection_id="18a14bafaa8eb1df04ce683ec18c765e", + detection_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", ) @@ -363,7 +363,7 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_delete(self, async_client: AsyncCloudflare) -> None: detection = await async_client.leaked_credential_checks.detections.delete( - detection_id="18a14bafaa8eb1df04ce683ec18c765e", + detection_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(object, detection, path=["response"]) @@ -371,7 +371,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: response = await async_client.leaked_credential_checks.detections.with_raw_response.delete( - detection_id="18a14bafaa8eb1df04ce683ec18c765e", + detection_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -383,7 +383,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: async with async_client.leaked_credential_checks.detections.with_streaming_response.delete( - detection_id="18a14bafaa8eb1df04ce683ec18c765e", + detection_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed @@ -398,7 +398,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.leaked_credential_checks.detections.with_raw_response.delete( - detection_id="18a14bafaa8eb1df04ce683ec18c765e", + detection_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", ) diff --git a/tests/api_resources/magic_transit/test_apps.py b/tests/api_resources/magic_transit/test_apps.py index 47dcbbf87ac..e9db6556ebb 100644 --- a/tests/api_resources/magic_transit/test_apps.py +++ b/tests/api_resources/magic_transit/test_apps.py @@ -45,7 +45,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: name="Cloudflare Dashboard", type="Development", hostnames=["auth.cloudflare.com"], - ip_subnets=["1.1.1.1/32"], + ip_subnets=["192.0.2.0/24"], ) assert_matches_type(Optional[AppCreateResponse], app, path=["response"]) @@ -294,7 +294,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare name="Cloudflare Dashboard", type="Development", hostnames=["auth.cloudflare.com"], - ip_subnets=["1.1.1.1/32"], + ip_subnets=["192.0.2.0/24"], ) assert_matches_type(Optional[AppCreateResponse], app, path=["response"]) diff --git a/tests/api_resources/pages/test_projects.py b/tests/api_resources/pages/test_projects.py index 5d079787554..a6aef5f74c7 100644 --- a/tests/api_resources/pages/test_projects.py +++ b/tests/api_resources/pages/test_projects.py @@ -294,18 +294,10 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: "d1_databases": {"D1_BINDING": {"id": "445e2955-951a-43f8-a35b-a4d0c8138f63"}}, "durable_object_namespaces": {"DO_BINDING": {"namespace_id": "5eb63bbbe01eeed093cb22bb8f5acdc3"}}, "env_vars": { - "BUILD_VERSION": { - "value": "3.3", - "type": "plain_text", - }, - "delete_this_env_var": { - "value": "value", - "type": "plain_text", - }, - "secret_var": { - "value": "A_CMS_API_TOKEN", + "foo": { + "value": "hello world", "type": "plain_text", - }, + } }, "hyperdrive_bindings": {"HYPERDRIVE": {"id": "a76a99bc342644deb02c38d66082262a"}}, "kv_namespaces": {"KV_BINDING": {"namespace_id": "5eb63bbbe01eeed093cb22bb8f5acdc3"}}, @@ -749,18 +741,10 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) "d1_databases": {"D1_BINDING": {"id": "445e2955-951a-43f8-a35b-a4d0c8138f63"}}, "durable_object_namespaces": {"DO_BINDING": {"namespace_id": "5eb63bbbe01eeed093cb22bb8f5acdc3"}}, "env_vars": { - "BUILD_VERSION": { - "value": "3.3", - "type": "plain_text", - }, - "delete_this_env_var": { - "value": "value", - "type": "plain_text", - }, - "secret_var": { - "value": "A_CMS_API_TOKEN", + "foo": { + "value": "hello world", "type": "plain_text", - }, + } }, "hyperdrive_bindings": {"HYPERDRIVE": {"id": "a76a99bc342644deb02c38d66082262a"}}, "kv_namespaces": {"KV_BINDING": {"namespace_id": "5eb63bbbe01eeed093cb22bb8f5acdc3"}}, diff --git a/tests/api_resources/spectrum/test_apps.py b/tests/api_resources/spectrum/test_apps.py index 4cd829fd660..406363c48d8 100644 --- a/tests/api_resources/spectrum/test_apps.py +++ b/tests/api_resources/spectrum/test_apps.py @@ -124,6 +124,7 @@ def test_path_params_create_overload_1(self, client: Cloudflare) -> None: def test_method_create_overload_2(self, client: Cloudflare) -> None: app = client.spectrum.apps.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) @@ -134,6 +135,7 @@ def test_method_create_overload_2(self, client: Cloudflare) -> None: def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> None: app = client.spectrum.apps.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", dns={ "name": "ssh.example.com", "type": "CNAME", @@ -148,6 +150,7 @@ def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> N def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: response = client.spectrum.apps.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) @@ -162,6 +165,7 @@ def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: with client.spectrum.apps.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) as response: @@ -179,6 +183,7 @@ def test_path_params_create_overload_2(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.spectrum.apps.with_raw_response.create( zone_id="", + id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) @@ -301,6 +306,7 @@ def test_method_update_overload_2(self, client: Cloudflare) -> None: app = client.spectrum.apps.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) @@ -312,6 +318,7 @@ def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> N app = client.spectrum.apps.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", dns={ "name": "ssh.example.com", "type": "CNAME", @@ -327,6 +334,7 @@ def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: response = client.spectrum.apps.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) @@ -342,6 +350,7 @@ def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: with client.spectrum.apps.with_streaming_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) as response: @@ -360,6 +369,7 @@ def test_path_params_update_overload_2(self, client: Cloudflare) -> None: client.spectrum.apps.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) @@ -368,6 +378,7 @@ def test_path_params_update_overload_2(self, client: Cloudflare) -> None: client.spectrum.apps.with_raw_response.update( app_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) @@ -626,6 +637,7 @@ async def test_path_params_create_overload_1(self, async_client: AsyncCloudflare async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> None: app = await async_client.spectrum.apps.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) @@ -636,6 +648,7 @@ async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> async def test_method_create_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: app = await async_client.spectrum.apps.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", dns={ "name": "ssh.example.com", "type": "CNAME", @@ -650,6 +663,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: response = await async_client.spectrum.apps.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) @@ -664,6 +678,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflar async def test_streaming_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: async with async_client.spectrum.apps.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) as response: @@ -681,6 +696,7 @@ async def test_path_params_create_overload_2(self, async_client: AsyncCloudflare with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.spectrum.apps.with_raw_response.create( zone_id="", + id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) @@ -803,6 +819,7 @@ async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> app = await async_client.spectrum.apps.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) @@ -814,6 +831,7 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn app = await async_client.spectrum.apps.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", dns={ "name": "ssh.example.com", "type": "CNAME", @@ -829,6 +847,7 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflar response = await async_client.spectrum.apps.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) @@ -844,6 +863,7 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncClo async with async_client.spectrum.apps.with_streaming_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) as response: @@ -862,6 +882,7 @@ async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare await async_client.spectrum.apps.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) @@ -870,6 +891,7 @@ async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare await async_client.spectrum.apps.with_raw_response.update( app_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) diff --git a/tests/api_resources/test_dns_firewall.py b/tests/api_resources/test_dns_firewall.py index 3098bfe5f2d..2ad3347bb0c 100644 --- a/tests/api_resources/test_dns_firewall.py +++ b/tests/api_resources/test_dns_firewall.py @@ -29,8 +29,6 @@ class TestDNSFirewall: def test_method_create(self, client: Cloudflare) -> None: dns_firewall = client.dns_firewall.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - name="My Awesome DNS Firewall cluster", - upstream_ips=["192.0.2.1", "198.51.100.1", "string"], ) assert_matches_type(Optional[DNSFirewallCreateResponse], dns_firewall, path=["response"]) @@ -39,8 +37,6 @@ def test_method_create(self, client: Cloudflare) -> None: def test_method_create_with_all_params(self, client: Cloudflare) -> None: dns_firewall = client.dns_firewall.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - name="My Awesome DNS Firewall cluster", - upstream_ips=["192.0.2.1", "198.51.100.1", "string"], attack_mitigation={ "enabled": True, "only_when_upstream_unhealthy": False, @@ -49,9 +45,11 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: ecs_fallback=False, maximum_cache_ttl=900, minimum_cache_ttl=60, + name="My Awesome DNS Firewall cluster", negative_cache_ttl=900, ratelimit=600, retries=2, + upstream_ips=["192.0.2.1", "198.51.100.1", "string"], ) assert_matches_type(Optional[DNSFirewallCreateResponse], dns_firewall, path=["response"]) @@ -60,8 +58,6 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_create(self, client: Cloudflare) -> None: response = client.dns_firewall.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - name="My Awesome DNS Firewall cluster", - upstream_ips=["192.0.2.1", "198.51.100.1", "string"], ) assert response.is_closed is True @@ -74,8 +70,6 @@ def test_raw_response_create(self, client: Cloudflare) -> None: def test_streaming_response_create(self, client: Cloudflare) -> None: with client.dns_firewall.with_streaming_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - name="My Awesome DNS Firewall cluster", - upstream_ips=["192.0.2.1", "198.51.100.1", "string"], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -91,8 +85,6 @@ def test_path_params_create(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.dns_firewall.with_raw_response.create( account_id="", - name="My Awesome DNS Firewall cluster", - upstream_ips=["192.0.2.1", "198.51.100.1", "string"], ) @parametrize @@ -321,8 +313,6 @@ class TestAsyncDNSFirewall: async def test_method_create(self, async_client: AsyncCloudflare) -> None: dns_firewall = await async_client.dns_firewall.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - name="My Awesome DNS Firewall cluster", - upstream_ips=["192.0.2.1", "198.51.100.1", "string"], ) assert_matches_type(Optional[DNSFirewallCreateResponse], dns_firewall, path=["response"]) @@ -331,8 +321,6 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: dns_firewall = await async_client.dns_firewall.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - name="My Awesome DNS Firewall cluster", - upstream_ips=["192.0.2.1", "198.51.100.1", "string"], attack_mitigation={ "enabled": True, "only_when_upstream_unhealthy": False, @@ -341,9 +329,11 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare ecs_fallback=False, maximum_cache_ttl=900, minimum_cache_ttl=60, + name="My Awesome DNS Firewall cluster", negative_cache_ttl=900, ratelimit=600, retries=2, + upstream_ips=["192.0.2.1", "198.51.100.1", "string"], ) assert_matches_type(Optional[DNSFirewallCreateResponse], dns_firewall, path=["response"]) @@ -352,8 +342,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns_firewall.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - name="My Awesome DNS Firewall cluster", - upstream_ips=["192.0.2.1", "198.51.100.1", "string"], ) assert response.is_closed is True @@ -366,8 +354,6 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.dns_firewall.with_streaming_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - name="My Awesome DNS Firewall cluster", - upstream_ips=["192.0.2.1", "198.51.100.1", "string"], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -383,8 +369,6 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.dns_firewall.with_raw_response.create( account_id="", - name="My Awesome DNS Firewall cluster", - upstream_ips=["192.0.2.1", "198.51.100.1", "string"], ) @parametrize diff --git a/tests/api_resources/test_page_rules.py b/tests/api_resources/test_page_rules.py index 8e39d596f5f..e75aa9d97ac 100644 --- a/tests/api_resources/test_page_rules.py +++ b/tests/api_resources/test_page_rules.py @@ -26,15 +26,7 @@ def test_method_create(self, client: Cloudflare) -> None: page_rule = client.page_rules.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", actions=[{}], - targets=[ - { - "constraint": { - "operator": "matches", - "value": "*example.com/images/*", - }, - "target": "url", - } - ], + targets=[{}], ) assert_matches_type(Optional[PageRule], page_rule, path=["response"]) @@ -67,15 +59,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: response = client.page_rules.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", actions=[{}], - targets=[ - { - "constraint": { - "operator": "matches", - "value": "*example.com/images/*", - }, - "target": "url", - } - ], + targets=[{}], ) assert response.is_closed is True @@ -88,15 +72,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: with client.page_rules.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", actions=[{}], - targets=[ - { - "constraint": { - "operator": "matches", - "value": "*example.com/images/*", - }, - "target": "url", - } - ], + targets=[{}], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -112,15 +88,7 @@ def test_path_params_create(self, client: Cloudflare) -> None: client.page_rules.with_raw_response.create( zone_id="", actions=[{}], - targets=[ - { - "constraint": { - "operator": "matches", - "value": "*example.com/images/*", - }, - "target": "url", - } - ], + targets=[{}], ) @parametrize @@ -129,15 +97,7 @@ def test_method_update(self, client: Cloudflare) -> None: pagerule_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", actions=[{}], - targets=[ - { - "constraint": { - "operator": "matches", - "value": "*example.com/images/*", - }, - "target": "url", - } - ], + targets=[{}], ) assert_matches_type(Optional[PageRule], page_rule, path=["response"]) @@ -172,15 +132,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: pagerule_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", actions=[{}], - targets=[ - { - "constraint": { - "operator": "matches", - "value": "*example.com/images/*", - }, - "target": "url", - } - ], + targets=[{}], ) assert response.is_closed is True @@ -194,15 +146,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: pagerule_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", actions=[{}], - targets=[ - { - "constraint": { - "operator": "matches", - "value": "*example.com/images/*", - }, - "target": "url", - } - ], + targets=[{}], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -219,15 +163,7 @@ def test_path_params_update(self, client: Cloudflare) -> None: pagerule_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", actions=[{}], - targets=[ - { - "constraint": { - "operator": "matches", - "value": "*example.com/images/*", - }, - "target": "url", - } - ], + targets=[{}], ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `pagerule_id` but received ''"): @@ -235,15 +171,7 @@ def test_path_params_update(self, client: Cloudflare) -> None: pagerule_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", actions=[{}], - targets=[ - { - "constraint": { - "operator": "matches", - "value": "*example.com/images/*", - }, - "target": "url", - } - ], + targets=[{}], ) @parametrize @@ -473,15 +401,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: page_rule = await async_client.page_rules.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", actions=[{}], - targets=[ - { - "constraint": { - "operator": "matches", - "value": "*example.com/images/*", - }, - "target": "url", - } - ], + targets=[{}], ) assert_matches_type(Optional[PageRule], page_rule, path=["response"]) @@ -514,15 +434,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.page_rules.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", actions=[{}], - targets=[ - { - "constraint": { - "operator": "matches", - "value": "*example.com/images/*", - }, - "target": "url", - } - ], + targets=[{}], ) assert response.is_closed is True @@ -535,15 +447,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> async with async_client.page_rules.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", actions=[{}], - targets=[ - { - "constraint": { - "operator": "matches", - "value": "*example.com/images/*", - }, - "target": "url", - } - ], + targets=[{}], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -559,15 +463,7 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: await async_client.page_rules.with_raw_response.create( zone_id="", actions=[{}], - targets=[ - { - "constraint": { - "operator": "matches", - "value": "*example.com/images/*", - }, - "target": "url", - } - ], + targets=[{}], ) @parametrize @@ -576,15 +472,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: pagerule_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", actions=[{}], - targets=[ - { - "constraint": { - "operator": "matches", - "value": "*example.com/images/*", - }, - "target": "url", - } - ], + targets=[{}], ) assert_matches_type(Optional[PageRule], page_rule, path=["response"]) @@ -619,15 +507,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: pagerule_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", actions=[{}], - targets=[ - { - "constraint": { - "operator": "matches", - "value": "*example.com/images/*", - }, - "target": "url", - } - ], + targets=[{}], ) assert response.is_closed is True @@ -641,15 +521,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> pagerule_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", actions=[{}], - targets=[ - { - "constraint": { - "operator": "matches", - "value": "*example.com/images/*", - }, - "target": "url", - } - ], + targets=[{}], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -666,15 +538,7 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: pagerule_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", actions=[{}], - targets=[ - { - "constraint": { - "operator": "matches", - "value": "*example.com/images/*", - }, - "target": "url", - } - ], + targets=[{}], ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `pagerule_id` but received ''"): @@ -682,15 +546,7 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: pagerule_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", actions=[{}], - targets=[ - { - "constraint": { - "operator": "matches", - "value": "*example.com/images/*", - }, - "target": "url", - } - ], + targets=[{}], ) @parametrize diff --git a/tests/api_resources/user/test_tokens.py b/tests/api_resources/user/test_tokens.py index 627cab2e845..3ad7952d607 100644 --- a/tests/api_resources/user/test_tokens.py +++ b/tests/api_resources/user/test_tokens.py @@ -132,18 +132,6 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: def test_method_update(self, client: Cloudflare) -> None: token = client.user.tokens.update( token_id="ed17574386854bf78a67040be0a770b0", - name="readonly token", - policies=[ - { - "effect": "allow", - "permission_groups": [{}, {}], - "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }, - } - ], - status="active", ) assert_matches_type(Optional[Token], token, path=["response"]) @@ -152,7 +140,15 @@ def test_method_update(self, client: Cloudflare) -> None: def test_method_update_with_all_params(self, client: Cloudflare) -> None: token = client.user.tokens.update( token_id="ed17574386854bf78a67040be0a770b0", + condition={ + "request_ip": { + "in": ["123.123.123.0/24", "2606:4700::/32"], + "not_in": ["123.123.123.100/24", "2606:4700:4700::/48"], + } + }, + expires_on=parse_datetime("2020-01-01T00:00:00Z"), name="readonly token", + not_before=parse_datetime("2018-07-01T05:20:00Z"), policies=[ { "effect": "allow", @@ -177,14 +173,6 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: } ], status="active", - condition={ - "request_ip": { - "in": ["123.123.123.0/24", "2606:4700::/32"], - "not_in": ["123.123.123.100/24", "2606:4700:4700::/48"], - } - }, - expires_on=parse_datetime("2020-01-01T00:00:00Z"), - not_before=parse_datetime("2018-07-01T05:20:00Z"), ) assert_matches_type(Optional[Token], token, path=["response"]) @@ -193,18 +181,6 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_update(self, client: Cloudflare) -> None: response = client.user.tokens.with_raw_response.update( token_id="ed17574386854bf78a67040be0a770b0", - name="readonly token", - policies=[ - { - "effect": "allow", - "permission_groups": [{}, {}], - "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }, - } - ], - status="active", ) assert response.is_closed is True @@ -217,18 +193,6 @@ def test_raw_response_update(self, client: Cloudflare) -> None: def test_streaming_response_update(self, client: Cloudflare) -> None: with client.user.tokens.with_streaming_response.update( token_id="ed17574386854bf78a67040be0a770b0", - name="readonly token", - policies=[ - { - "effect": "allow", - "permission_groups": [{}, {}], - "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }, - } - ], - status="active", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -244,18 +208,6 @@ def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `token_id` but received ''"): client.user.tokens.with_raw_response.update( token_id="", - name="readonly token", - policies=[ - { - "effect": "allow", - "permission_groups": [{}, {}], - "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }, - } - ], - status="active", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -520,18 +472,6 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> async def test_method_update(self, async_client: AsyncCloudflare) -> None: token = await async_client.user.tokens.update( token_id="ed17574386854bf78a67040be0a770b0", - name="readonly token", - policies=[ - { - "effect": "allow", - "permission_groups": [{}, {}], - "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }, - } - ], - status="active", ) assert_matches_type(Optional[Token], token, path=["response"]) @@ -540,7 +480,15 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: token = await async_client.user.tokens.update( token_id="ed17574386854bf78a67040be0a770b0", + condition={ + "request_ip": { + "in": ["123.123.123.0/24", "2606:4700::/32"], + "not_in": ["123.123.123.100/24", "2606:4700:4700::/48"], + } + }, + expires_on=parse_datetime("2020-01-01T00:00:00Z"), name="readonly token", + not_before=parse_datetime("2018-07-01T05:20:00Z"), policies=[ { "effect": "allow", @@ -565,14 +513,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare } ], status="active", - condition={ - "request_ip": { - "in": ["123.123.123.0/24", "2606:4700::/32"], - "not_in": ["123.123.123.100/24", "2606:4700:4700::/48"], - } - }, - expires_on=parse_datetime("2020-01-01T00:00:00Z"), - not_before=parse_datetime("2018-07-01T05:20:00Z"), ) assert_matches_type(Optional[Token], token, path=["response"]) @@ -581,18 +521,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.user.tokens.with_raw_response.update( token_id="ed17574386854bf78a67040be0a770b0", - name="readonly token", - policies=[ - { - "effect": "allow", - "permission_groups": [{}, {}], - "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }, - } - ], - status="active", ) assert response.is_closed is True @@ -605,18 +533,6 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.user.tokens.with_streaming_response.update( token_id="ed17574386854bf78a67040be0a770b0", - name="readonly token", - policies=[ - { - "effect": "allow", - "permission_groups": [{}, {}], - "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }, - } - ], - status="active", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -632,18 +548,6 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `token_id` but received ''"): await async_client.user.tokens.with_raw_response.update( token_id="", - name="readonly token", - policies=[ - { - "effect": "allow", - "permission_groups": [{}, {}], - "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }, - } - ], - status="active", ) @pytest.mark.skip(reason="TODO: investigate broken test") diff --git a/tests/api_resources/zero_trust/devices/test_networks.py b/tests/api_resources/zero_trust/devices/test_networks.py index 254e1b9e833..669480b6bae 100644 --- a/tests/api_resources/zero_trust/devices/test_networks.py +++ b/tests/api_resources/zero_trust/devices/test_networks.py @@ -25,7 +25,7 @@ class TestNetworks: def test_method_create(self, client: Cloudflare) -> None: network = client.zero_trust.devices.networks.create( account_id="699d98642c564d2e855e9661899b7252", - config={"tls_sockaddr": "foo.bar:1234"}, + config={"tls_sockaddr": "foobar:1234"}, name="managed-network-1", type="tls", ) @@ -36,7 +36,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: network = client.zero_trust.devices.networks.create( account_id="699d98642c564d2e855e9661899b7252", config={ - "tls_sockaddr": "foo.bar:1234", + "tls_sockaddr": "foobar:1234", "sha256": "b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c", }, name="managed-network-1", @@ -48,7 +48,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_create(self, client: Cloudflare) -> None: response = client.zero_trust.devices.networks.with_raw_response.create( account_id="699d98642c564d2e855e9661899b7252", - config={"tls_sockaddr": "foo.bar:1234"}, + config={"tls_sockaddr": "foobar:1234"}, name="managed-network-1", type="tls", ) @@ -62,7 +62,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: def test_streaming_response_create(self, client: Cloudflare) -> None: with client.zero_trust.devices.networks.with_streaming_response.create( account_id="699d98642c564d2e855e9661899b7252", - config={"tls_sockaddr": "foo.bar:1234"}, + config={"tls_sockaddr": "foobar:1234"}, name="managed-network-1", type="tls", ) as response: @@ -79,7 +79,7 @@ def test_path_params_create(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.zero_trust.devices.networks.with_raw_response.create( account_id="", - config={"tls_sockaddr": "foo.bar:1234"}, + config={"tls_sockaddr": "foobar:1234"}, name="managed-network-1", type="tls", ) @@ -98,7 +98,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: network_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", config={ - "tls_sockaddr": "foo.bar:1234", + "tls_sockaddr": "foobar:1234", "sha256": "b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c", }, name="managed-network-1", @@ -288,7 +288,7 @@ class TestAsyncNetworks: async def test_method_create(self, async_client: AsyncCloudflare) -> None: network = await async_client.zero_trust.devices.networks.create( account_id="699d98642c564d2e855e9661899b7252", - config={"tls_sockaddr": "foo.bar:1234"}, + config={"tls_sockaddr": "foobar:1234"}, name="managed-network-1", type="tls", ) @@ -299,7 +299,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare network = await async_client.zero_trust.devices.networks.create( account_id="699d98642c564d2e855e9661899b7252", config={ - "tls_sockaddr": "foo.bar:1234", + "tls_sockaddr": "foobar:1234", "sha256": "b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c", }, name="managed-network-1", @@ -311,7 +311,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.devices.networks.with_raw_response.create( account_id="699d98642c564d2e855e9661899b7252", - config={"tls_sockaddr": "foo.bar:1234"}, + config={"tls_sockaddr": "foobar:1234"}, name="managed-network-1", type="tls", ) @@ -325,7 +325,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.devices.networks.with_streaming_response.create( account_id="699d98642c564d2e855e9661899b7252", - config={"tls_sockaddr": "foo.bar:1234"}, + config={"tls_sockaddr": "foobar:1234"}, name="managed-network-1", type="tls", ) as response: @@ -342,7 +342,7 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.zero_trust.devices.networks.with_raw_response.create( account_id="", - config={"tls_sockaddr": "foo.bar:1234"}, + config={"tls_sockaddr": "foobar:1234"}, name="managed-network-1", type="tls", ) @@ -361,7 +361,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare network_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", config={ - "tls_sockaddr": "foo.bar:1234", + "tls_sockaddr": "foobar:1234", "sha256": "b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c", }, name="managed-network-1", diff --git a/tests/api_resources/zero_trust/test_seats.py b/tests/api_resources/zero_trust/test_seats.py index 02de0328cdf..06a8ee177e6 100644 --- a/tests/api_resources/zero_trust/test_seats.py +++ b/tests/api_resources/zero_trust/test_seats.py @@ -21,7 +21,7 @@ class TestSeats: @parametrize def test_method_edit(self, client: Cloudflare) -> None: seat = client.zero_trust.seats.edit( - account_id="699d98642c564d2e855e9661899b7252", + account_id="023e105f4ecef8ad9ca31a8372d0c353", body=[ { "access_seat": False, @@ -36,7 +36,7 @@ def test_method_edit(self, client: Cloudflare) -> None: @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: response = client.zero_trust.seats.with_raw_response.edit( - account_id="699d98642c564d2e855e9661899b7252", + account_id="023e105f4ecef8ad9ca31a8372d0c353", body=[ { "access_seat": False, @@ -55,7 +55,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: with client.zero_trust.seats.with_streaming_response.edit( - account_id="699d98642c564d2e855e9661899b7252", + account_id="023e105f4ecef8ad9ca31a8372d0c353", body=[ { "access_seat": False, @@ -95,7 +95,7 @@ class TestAsyncSeats: @parametrize async def test_method_edit(self, async_client: AsyncCloudflare) -> None: seat = await async_client.zero_trust.seats.edit( - account_id="699d98642c564d2e855e9661899b7252", + account_id="023e105f4ecef8ad9ca31a8372d0c353", body=[ { "access_seat": False, @@ -110,7 +110,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.seats.with_raw_response.edit( - account_id="699d98642c564d2e855e9661899b7252", + account_id="023e105f4ecef8ad9ca31a8372d0c353", body=[ { "access_seat": False, @@ -129,7 +129,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.seats.with_streaming_response.edit( - account_id="699d98642c564d2e855e9661899b7252", + account_id="023e105f4ecef8ad9ca31a8372d0c353", body=[ { "access_seat": False, From 8c9d91e3a144d3bd21a4d60045759a092b5723ba Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 14 Jan 2025 11:50:18 +0000 Subject: [PATCH 006/358] chore(internal): update deps (#2363) --- mypy.ini | 2 +- requirements-dev.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mypy.ini b/mypy.ini index 4511df962f0..e929ff8caa2 100644 --- a/mypy.ini +++ b/mypy.ini @@ -41,7 +41,7 @@ cache_fine_grained = True # ``` # Changing this codegen to make mypy happy would increase complexity # and would not be worth it. -disable_error_code = func-returns-value +disable_error_code = func-returns-value,overload-cannot-match # https://github.com/python/mypy/issues/12162 [mypy.overrides] diff --git a/requirements-dev.lock b/requirements-dev.lock index 83265a0ae6f..56871377eec 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -48,7 +48,7 @@ markdown-it-py==3.0.0 # via rich mdurl==0.1.2 # via markdown-it-py -mypy==1.13.0 +mypy==1.14.1 mypy-extensions==1.0.0 # via mypy nodeenv==1.8.0 @@ -67,7 +67,7 @@ pydantic-core==2.27.1 # via pydantic pygments==2.18.0 # via rich -pyright==1.1.390 +pyright==1.1.391 pytest==8.3.3 # via pytest-asyncio pytest-asyncio==0.24.0 From f8b1b9486efe17df780530972e2d0bd5c1d73d21 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 14 Jan 2025 11:57:58 +0000 Subject: [PATCH 007/358] feat(api): api update (#2364) --- .stats.yml | 2 +- .../types/rulesets/rule_create_params.py | 85 +++++++++++++------ .../types/rulesets/rule_edit_params.py | 85 +++++++++++++------ .../types/rulesets/set_cache_settings_rule.py | 85 ++++++++++++------- .../rulesets/set_cache_settings_rule_param.py | 85 ++++++++++++------- tests/api_resources/rulesets/test_rules.py | 44 +--------- 6 files changed, 233 insertions(+), 153 deletions(-) diff --git a/.stats.yml b/.stats.yml index c370f57faf5..e8e51bfa087 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1493 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aa37f1d5ad51f57618e40b780a4b8f2cc09463bbd9e3ac330ac1f1d2aa1742e5.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-292d86018649794a0921751cee7162cb618358a55576fe9e18995601ad7484cc.yml diff --git a/src/cloudflare/types/rulesets/rule_create_params.py b/src/cloudflare/types/rulesets/rule_create_params.py index efc9c72846f..bb8fb83441d 100644 --- a/src/cloudflare/types/rulesets/rule_create_params.py +++ b/src/cloudflare/types/rulesets/rule_create_params.py @@ -147,8 +147,14 @@ "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeader", "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHost", "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString", - "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude", - "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters", "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser", "SetCacheSettingsRuleActionParametersCacheReserve", "SetCacheSettingsRuleActionParametersEdgeTTL", @@ -2276,40 +2282,68 @@ class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHost(TypedDict, total """ -class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude(TypedDict, total=False): +class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters( + TypedDict, total=False +): + list: List[str] + + +class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters( + TypedDict, total=False +): all: bool - """Exclude all query string parameters from use in building the cache key.""" + """Determines whether to include all query string parameters in the cache key.""" - list: List[str] - """A list of query string parameters NOT used to build the cache key. - All parameters present in the request but missing in this list will be used to - build the cache key. - """ +SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude: TypeAlias = Union[ + SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters, + SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters, +] -class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude(TypedDict, total=False): - all: bool - """Use all query string parameters in the cache key.""" +class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters( + TypedDict, total=False +): + include: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude + """A list of query string parameters used to build the cache key.""" + +class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters( + TypedDict, total=False +): list: List[str] - """A list of query string parameters used to build the cache key.""" -class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString(TypedDict, total=False): - exclude: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude - """ - build the cache key using all query string parameters EXCECPT these excluded - parameters - """ +class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters( + TypedDict, total=False +): + all: bool + """Determines whether to exclude all query string parameters from the cache key.""" - include: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude - """ - build the cache key using a list of query string parameters that ARE in the - request. + +SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude: TypeAlias = Union[ + SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters, + SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters, +] + + +class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters( + TypedDict, total=False +): + exclude: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude + """A list of query string parameters NOT used to build the cache key. + + All parameters present in the request but missing in this list will be used to + build the cache key. """ +SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString: TypeAlias = Union[ + SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters, + SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters, +] + + class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser(TypedDict, total=False): device_type: bool """Use the user agent's device type in the cache key.""" @@ -2332,10 +2366,7 @@ class SetCacheSettingsRuleActionParametersCacheKeyCustomKey(TypedDict, total=Fal """Whether to use the original host or the resolved host in the cache key.""" query_string: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString - """ - Use the presence or absence of parameters in the query string to build the cache - key. - """ + """Use the presence of parameters in the query string to build the cache key.""" user: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser """Characteristics of the request user agent used in building the cache key.""" diff --git a/src/cloudflare/types/rulesets/rule_edit_params.py b/src/cloudflare/types/rulesets/rule_edit_params.py index 201bf84f5b3..396a92a4459 100644 --- a/src/cloudflare/types/rulesets/rule_edit_params.py +++ b/src/cloudflare/types/rulesets/rule_edit_params.py @@ -147,8 +147,14 @@ "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeader", "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHost", "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString", - "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude", - "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters", "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser", "SetCacheSettingsRuleActionParametersCacheReserve", "SetCacheSettingsRuleActionParametersEdgeTTL", @@ -2321,40 +2327,68 @@ class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHost(TypedDict, total """ -class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude(TypedDict, total=False): +class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters( + TypedDict, total=False +): + list: List[str] + + +class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters( + TypedDict, total=False +): all: bool - """Exclude all query string parameters from use in building the cache key.""" + """Determines whether to include all query string parameters in the cache key.""" - list: List[str] - """A list of query string parameters NOT used to build the cache key. - All parameters present in the request but missing in this list will be used to - build the cache key. - """ +SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude: TypeAlias = Union[ + SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters, + SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters, +] -class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude(TypedDict, total=False): - all: bool - """Use all query string parameters in the cache key.""" +class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters( + TypedDict, total=False +): + include: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude + """A list of query string parameters used to build the cache key.""" + +class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters( + TypedDict, total=False +): list: List[str] - """A list of query string parameters used to build the cache key.""" -class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString(TypedDict, total=False): - exclude: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude - """ - build the cache key using all query string parameters EXCECPT these excluded - parameters - """ +class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters( + TypedDict, total=False +): + all: bool + """Determines whether to exclude all query string parameters from the cache key.""" - include: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude - """ - build the cache key using a list of query string parameters that ARE in the - request. + +SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude: TypeAlias = Union[ + SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters, + SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters, +] + + +class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters( + TypedDict, total=False +): + exclude: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude + """A list of query string parameters NOT used to build the cache key. + + All parameters present in the request but missing in this list will be used to + build the cache key. """ +SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString: TypeAlias = Union[ + SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters, + SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters, +] + + class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser(TypedDict, total=False): device_type: bool """Use the user agent's device type in the cache key.""" @@ -2377,10 +2411,7 @@ class SetCacheSettingsRuleActionParametersCacheKeyCustomKey(TypedDict, total=Fal """Whether to use the original host or the resolved host in the cache key.""" query_string: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString - """ - Use the presence or absence of parameters in the query string to build the cache - key. - """ + """Use the presence of parameters in the query string to build the cache key.""" user: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser """Characteristics of the request user agent used in building the cache key.""" diff --git a/src/cloudflare/types/rulesets/set_cache_settings_rule.py b/src/cloudflare/types/rulesets/set_cache_settings_rule.py index 2b35f718029..e88114d9f66 100644 --- a/src/cloudflare/types/rulesets/set_cache_settings_rule.py +++ b/src/cloudflare/types/rulesets/set_cache_settings_rule.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Optional +from typing import Dict, List, Union, Optional from datetime import datetime -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from pydantic import Field as FieldInfo @@ -19,8 +19,14 @@ "ActionParametersCacheKeyCustomKeyHeader", "ActionParametersCacheKeyCustomKeyHost", "ActionParametersCacheKeyCustomKeyQueryString", - "ActionParametersCacheKeyCustomKeyQueryStringExclude", - "ActionParametersCacheKeyCustomKeyQueryStringInclude", + "ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters", + "ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude", + "ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters", + "ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters", + "ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters", + "ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude", + "ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters", + "ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters", "ActionParametersCacheKeyCustomKeyUser", "ActionParametersCacheReserve", "ActionParametersEdgeTTL", @@ -85,40 +91,64 @@ class ActionParametersCacheKeyCustomKeyHost(BaseModel): """ -class ActionParametersCacheKeyCustomKeyQueryStringExclude(BaseModel): +class ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters( + BaseModel +): + rule_list: Optional[List[str]] = FieldInfo(alias="list", default=None) + + +class ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters( + BaseModel +): all: Optional[bool] = None - """Exclude all query string parameters from use in building the cache key.""" + """Determines whether to include all query string parameters in the cache key.""" - rule_list: Optional[List[str]] = FieldInfo(alias="list", default=None) - """A list of query string parameters NOT used to build the cache key. - All parameters present in the request but missing in this list will be used to - build the cache key. - """ +ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude: TypeAlias = Union[ + ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters, + ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters, +] -class ActionParametersCacheKeyCustomKeyQueryStringInclude(BaseModel): - all: Optional[bool] = None - """Use all query string parameters in the cache key.""" +class ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters(BaseModel): + include: Optional[ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude] = None + """A list of query string parameters used to build the cache key.""" + +class ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters( + BaseModel +): rule_list: Optional[List[str]] = FieldInfo(alias="list", default=None) - """A list of query string parameters used to build the cache key.""" -class ActionParametersCacheKeyCustomKeyQueryString(BaseModel): - exclude: Optional[ActionParametersCacheKeyCustomKeyQueryStringExclude] = None - """ - build the cache key using all query string parameters EXCECPT these excluded - parameters - """ +class ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters( + BaseModel +): + all: Optional[bool] = None + """Determines whether to exclude all query string parameters from the cache key.""" - include: Optional[ActionParametersCacheKeyCustomKeyQueryStringInclude] = None - """ - build the cache key using a list of query string parameters that ARE in the - request. + +ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude: TypeAlias = Union[ + ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters, + ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters, +] + + +class ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters(BaseModel): + exclude: Optional[ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude] = None + """A list of query string parameters NOT used to build the cache key. + + All parameters present in the request but missing in this list will be used to + build the cache key. """ +ActionParametersCacheKeyCustomKeyQueryString: TypeAlias = Union[ + ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters, + ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters, +] + + class ActionParametersCacheKeyCustomKeyUser(BaseModel): device_type: Optional[bool] = None """Use the user agent's device type in the cache key.""" @@ -141,10 +171,7 @@ class ActionParametersCacheKeyCustomKey(BaseModel): """Whether to use the original host or the resolved host in the cache key.""" query_string: Optional[ActionParametersCacheKeyCustomKeyQueryString] = None - """ - Use the presence or absence of parameters in the query string to build the cache - key. - """ + """Use the presence of parameters in the query string to build the cache key.""" user: Optional[ActionParametersCacheKeyCustomKeyUser] = None """Characteristics of the request user agent used in building the cache key.""" diff --git a/src/cloudflare/types/rulesets/set_cache_settings_rule_param.py b/src/cloudflare/types/rulesets/set_cache_settings_rule_param.py index ff8c9861e22..ed6d9f5818e 100644 --- a/src/cloudflare/types/rulesets/set_cache_settings_rule_param.py +++ b/src/cloudflare/types/rulesets/set_cache_settings_rule_param.py @@ -2,8 +2,8 @@ from __future__ import annotations -from typing import Dict, List, Iterable -from typing_extensions import Literal, Required, TypedDict +from typing import Dict, List, Union, Iterable +from typing_extensions import Literal, Required, TypeAlias, TypedDict from .logging_param import LoggingParam @@ -17,8 +17,14 @@ "ActionParametersCacheKeyCustomKeyHeader", "ActionParametersCacheKeyCustomKeyHost", "ActionParametersCacheKeyCustomKeyQueryString", - "ActionParametersCacheKeyCustomKeyQueryStringExclude", - "ActionParametersCacheKeyCustomKeyQueryStringInclude", + "ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters", + "ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude", + "ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters", + "ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters", + "ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters", + "ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude", + "ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters", + "ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters", "ActionParametersCacheKeyCustomKeyUser", "ActionParametersCacheReserve", "ActionParametersEdgeTTL", @@ -83,40 +89,64 @@ class ActionParametersCacheKeyCustomKeyHost(TypedDict, total=False): """ -class ActionParametersCacheKeyCustomKeyQueryStringExclude(TypedDict, total=False): +class ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters( + TypedDict, total=False +): + list: List[str] + + +class ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters( + TypedDict, total=False +): all: bool - """Exclude all query string parameters from use in building the cache key.""" + """Determines whether to include all query string parameters in the cache key.""" - list: List[str] - """A list of query string parameters NOT used to build the cache key. - All parameters present in the request but missing in this list will be used to - build the cache key. - """ +ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude: TypeAlias = Union[ + ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters, + ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters, +] -class ActionParametersCacheKeyCustomKeyQueryStringInclude(TypedDict, total=False): - all: bool - """Use all query string parameters in the cache key.""" +class ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters(TypedDict, total=False): + include: ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude + """A list of query string parameters used to build the cache key.""" + +class ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters( + TypedDict, total=False +): list: List[str] - """A list of query string parameters used to build the cache key.""" -class ActionParametersCacheKeyCustomKeyQueryString(TypedDict, total=False): - exclude: ActionParametersCacheKeyCustomKeyQueryStringExclude - """ - build the cache key using all query string parameters EXCECPT these excluded - parameters - """ +class ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters( + TypedDict, total=False +): + all: bool + """Determines whether to exclude all query string parameters from the cache key.""" - include: ActionParametersCacheKeyCustomKeyQueryStringInclude - """ - build the cache key using a list of query string parameters that ARE in the - request. + +ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude: TypeAlias = Union[ + ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters, + ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters, +] + + +class ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters(TypedDict, total=False): + exclude: ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude + """A list of query string parameters NOT used to build the cache key. + + All parameters present in the request but missing in this list will be used to + build the cache key. """ +ActionParametersCacheKeyCustomKeyQueryString: TypeAlias = Union[ + ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters, + ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters, +] + + class ActionParametersCacheKeyCustomKeyUser(TypedDict, total=False): device_type: bool """Use the user agent's device type in the cache key.""" @@ -139,10 +169,7 @@ class ActionParametersCacheKeyCustomKey(TypedDict, total=False): """Whether to use the original host or the resolved host in the cache key.""" query_string: ActionParametersCacheKeyCustomKeyQueryString - """ - Use the presence or absence of parameters in the query string to build the cache - key. - """ + """Use the presence of parameters in the query string to build the cache key.""" user: ActionParametersCacheKeyCustomKeyUser """Characteristics of the request user agent used in building the cache key.""" diff --git a/tests/api_resources/rulesets/test_rules.py b/tests/api_resources/rulesets/test_rules.py index 117eee8c295..d57aa588aa2 100644 --- a/tests/api_resources/rulesets/test_rules.py +++ b/tests/api_resources/rulesets/test_rules.py @@ -1411,16 +1411,7 @@ def test_method_create_with_all_params_overload_15(self, client: Cloudflare) -> "include": ["string"], }, "host": {"resolved": True}, - "query_string": { - "exclude": { - "all": True, - "list": ["string"], - }, - "include": { - "all": True, - "list": ["string"], - }, - }, + "query_string": {"include": {"list": ["foo", "bar"]}}, "user": { "device_type": True, "geo": True, @@ -3468,16 +3459,7 @@ def test_method_edit_with_all_params_overload_15(self, client: Cloudflare) -> No "include": ["string"], }, "host": {"resolved": True}, - "query_string": { - "exclude": { - "all": True, - "list": ["string"], - }, - "include": { - "all": True, - "list": ["string"], - }, - }, + "query_string": {"include": {"list": ["foo", "bar"]}}, "user": { "device_type": True, "geo": True, @@ -5304,16 +5286,7 @@ async def test_method_create_with_all_params_overload_15(self, async_client: Asy "include": ["string"], }, "host": {"resolved": True}, - "query_string": { - "exclude": { - "all": True, - "list": ["string"], - }, - "include": { - "all": True, - "list": ["string"], - }, - }, + "query_string": {"include": {"list": ["foo", "bar"]}}, "user": { "device_type": True, "geo": True, @@ -7361,16 +7334,7 @@ async def test_method_edit_with_all_params_overload_15(self, async_client: Async "include": ["string"], }, "host": {"resolved": True}, - "query_string": { - "exclude": { - "all": True, - "list": ["string"], - }, - "include": { - "all": True, - "list": ["string"], - }, - }, + "query_string": {"include": {"list": ["foo", "bar"]}}, "user": { "device_type": True, "geo": True, From 11a10b241dfb8afa123a0484f48066137b03b6e6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 14 Jan 2025 19:39:05 +0000 Subject: [PATCH 008/358] feat(api): api update (#2365) --- .stats.yml | 2 +- .../resources/magic_transit/sites/acls.py | 36 +++++++++++++++++++ .../types/magic_transit/sites/acl.py | 8 +++++ .../magic_transit/sites/acl_create_params.py | 8 +++++ .../magic_transit/sites/acl_edit_params.py | 8 +++++ .../magic_transit/sites/acl_update_params.py | 8 +++++ .../magic_transit/sites/test_acls.py | 6 ++++ 7 files changed, 75 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index e8e51bfa087..7b79ec4630f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1493 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-292d86018649794a0921751cee7162cb618358a55576fe9e18995601ad7484cc.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-817b1412335b2bc367169247bf8a10b29dbadb82b77df71df5ef5f3470fc974b.yml diff --git a/src/cloudflare/resources/magic_transit/sites/acls.py b/src/cloudflare/resources/magic_transit/sites/acls.py index c8edeccd631..a823a5bc933 100644 --- a/src/cloudflare/resources/magic_transit/sites/acls.py +++ b/src/cloudflare/resources/magic_transit/sites/acls.py @@ -61,6 +61,7 @@ def create( description: str | NotGiven = NOT_GIVEN, forward_locally: bool | NotGiven = NOT_GIVEN, protocols: List[AllowedProtocol] | NotGiven = NOT_GIVEN, + unidirectional: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -85,6 +86,10 @@ def create( traffic locally on the Magic Connector. If not included in request, will default to false. + unidirectional: The desired traffic direction for this ACL policy. If set to "false", the policy + will allow bidirectional traffic. If set to "true", the policy will only allow + traffic in one direction. If not included in request, will default to false. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -107,6 +112,7 @@ def create( "description": description, "forward_locally": forward_locally, "protocols": protocols, + "unidirectional": unidirectional, }, acl_create_params.ACLCreateParams, ), @@ -132,6 +138,7 @@ def update( lan_2: ACLConfigurationParam | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, protocols: List[AllowedProtocol] | NotGiven = NOT_GIVEN, + unidirectional: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -158,6 +165,10 @@ def update( name: The name of the ACL. + unidirectional: The desired traffic direction for this ACL policy. If set to "false", the policy + will allow bidirectional traffic. If set to "true", the policy will only allow + traffic in one direction. If not included in request, will default to false. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -182,6 +193,7 @@ def update( "lan_2": lan_2, "name": name, "protocols": protocols, + "unidirectional": unidirectional, }, acl_update_params.ACLUpdateParams, ), @@ -297,6 +309,7 @@ def edit( lan_2: ACLConfigurationParam | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, protocols: List[AllowedProtocol] | NotGiven = NOT_GIVEN, + unidirectional: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -323,6 +336,10 @@ def edit( name: The name of the ACL. + unidirectional: The desired traffic direction for this ACL policy. If set to "false", the policy + will allow bidirectional traffic. If set to "true", the policy will only allow + traffic in one direction. If not included in request, will default to false. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -347,6 +364,7 @@ def edit( "lan_2": lan_2, "name": name, "protocols": protocols, + "unidirectional": unidirectional, }, acl_edit_params.ACLEditParams, ), @@ -441,6 +459,7 @@ async def create( description: str | NotGiven = NOT_GIVEN, forward_locally: bool | NotGiven = NOT_GIVEN, protocols: List[AllowedProtocol] | NotGiven = NOT_GIVEN, + unidirectional: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -465,6 +484,10 @@ async def create( traffic locally on the Magic Connector. If not included in request, will default to false. + unidirectional: The desired traffic direction for this ACL policy. If set to "false", the policy + will allow bidirectional traffic. If set to "true", the policy will only allow + traffic in one direction. If not included in request, will default to false. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -487,6 +510,7 @@ async def create( "description": description, "forward_locally": forward_locally, "protocols": protocols, + "unidirectional": unidirectional, }, acl_create_params.ACLCreateParams, ), @@ -512,6 +536,7 @@ async def update( lan_2: ACLConfigurationParam | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, protocols: List[AllowedProtocol] | NotGiven = NOT_GIVEN, + unidirectional: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -538,6 +563,10 @@ async def update( name: The name of the ACL. + unidirectional: The desired traffic direction for this ACL policy. If set to "false", the policy + will allow bidirectional traffic. If set to "true", the policy will only allow + traffic in one direction. If not included in request, will default to false. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -562,6 +591,7 @@ async def update( "lan_2": lan_2, "name": name, "protocols": protocols, + "unidirectional": unidirectional, }, acl_update_params.ACLUpdateParams, ), @@ -677,6 +707,7 @@ async def edit( lan_2: ACLConfigurationParam | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, protocols: List[AllowedProtocol] | NotGiven = NOT_GIVEN, + unidirectional: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -703,6 +734,10 @@ async def edit( name: The name of the ACL. + unidirectional: The desired traffic direction for this ACL policy. If set to "false", the policy + will allow bidirectional traffic. If set to "true", the policy will only allow + traffic in one direction. If not included in request, will default to false. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -727,6 +762,7 @@ async def edit( "lan_2": lan_2, "name": name, "protocols": protocols, + "unidirectional": unidirectional, }, acl_edit_params.ACLEditParams, ), diff --git a/src/cloudflare/types/magic_transit/sites/acl.py b/src/cloudflare/types/magic_transit/sites/acl.py index 5565fc0f5c9..41429544d0f 100644 --- a/src/cloudflare/types/magic_transit/sites/acl.py +++ b/src/cloudflare/types/magic_transit/sites/acl.py @@ -32,3 +32,11 @@ class ACL(BaseModel): """The name of the ACL.""" protocols: Optional[List[AllowedProtocol]] = None + + unidirectional: Optional[bool] = None + """The desired traffic direction for this ACL policy. + + If set to "false", the policy will allow bidirectional traffic. If set to + "true", the policy will only allow traffic in one direction. If not included in + request, will default to false. + """ diff --git a/src/cloudflare/types/magic_transit/sites/acl_create_params.py b/src/cloudflare/types/magic_transit/sites/acl_create_params.py index 48b2d5f517b..c193c6d556c 100644 --- a/src/cloudflare/types/magic_transit/sites/acl_create_params.py +++ b/src/cloudflare/types/magic_transit/sites/acl_create_params.py @@ -34,3 +34,11 @@ class ACLCreateParams(TypedDict, total=False): """ protocols: List[AllowedProtocol] + + unidirectional: bool + """The desired traffic direction for this ACL policy. + + If set to "false", the policy will allow bidirectional traffic. If set to + "true", the policy will only allow traffic in one direction. If not included in + request, will default to false. + """ diff --git a/src/cloudflare/types/magic_transit/sites/acl_edit_params.py b/src/cloudflare/types/magic_transit/sites/acl_edit_params.py index 8a6c7b0f5c6..3280bbe53b2 100644 --- a/src/cloudflare/types/magic_transit/sites/acl_edit_params.py +++ b/src/cloudflare/types/magic_transit/sites/acl_edit_params.py @@ -37,3 +37,11 @@ class ACLEditParams(TypedDict, total=False): """The name of the ACL.""" protocols: List[AllowedProtocol] + + unidirectional: bool + """The desired traffic direction for this ACL policy. + + If set to "false", the policy will allow bidirectional traffic. If set to + "true", the policy will only allow traffic in one direction. If not included in + request, will default to false. + """ diff --git a/src/cloudflare/types/magic_transit/sites/acl_update_params.py b/src/cloudflare/types/magic_transit/sites/acl_update_params.py index 5abc70c2329..250ed85c126 100644 --- a/src/cloudflare/types/magic_transit/sites/acl_update_params.py +++ b/src/cloudflare/types/magic_transit/sites/acl_update_params.py @@ -37,3 +37,11 @@ class ACLUpdateParams(TypedDict, total=False): """The name of the ACL.""" protocols: List[AllowedProtocol] + + unidirectional: bool + """The desired traffic direction for this ACL policy. + + If set to "false", the policy will allow bidirectional traffic. If set to + "true", the policy will only allow traffic in one direction. If not included in + request, will default to false. + """ diff --git a/tests/api_resources/magic_transit/sites/test_acls.py b/tests/api_resources/magic_transit/sites/test_acls.py index e14f6ccb449..151e289d692 100644 --- a/tests/api_resources/magic_transit/sites/test_acls.py +++ b/tests/api_resources/magic_transit/sites/test_acls.py @@ -52,6 +52,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: description="Allows local traffic between PIN pads and cash register.", forward_locally=True, protocols=["tcp"], + unidirectional=True, ) assert_matches_type(ACL, acl, path=["response"]) @@ -138,6 +139,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: }, name="PIN Pad - Cash Register", protocols=["tcp"], + unidirectional=True, ) assert_matches_type(ACL, acl, path=["response"]) @@ -331,6 +333,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: }, name="PIN Pad - Cash Register", protocols=["tcp"], + unidirectional=True, ) assert_matches_type(ACL, acl, path=["response"]) @@ -481,6 +484,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare description="Allows local traffic between PIN pads and cash register.", forward_locally=True, protocols=["tcp"], + unidirectional=True, ) assert_matches_type(ACL, acl, path=["response"]) @@ -567,6 +571,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare }, name="PIN Pad - Cash Register", protocols=["tcp"], + unidirectional=True, ) assert_matches_type(ACL, acl, path=["response"]) @@ -760,6 +765,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) }, name="PIN Pad - Cash Register", protocols=["tcp"], + unidirectional=True, ) assert_matches_type(ACL, acl, path=["response"]) From 2224969a0548b2147c87641e11225726f2eedda7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 16 Jan 2025 20:03:12 +0000 Subject: [PATCH 009/358] chore(api): remove empty policies.subresources (#2366) --- .stats.yml | 4 +- api.md | 425 +-- src/cloudflare/_client.py | 76 - src/cloudflare/resources/abuse_reports.py | 492 ---- src/cloudflare/resources/accounts/__init__.py | 14 - src/cloudflare/resources/accounts/accounts.py | 32 - .../resources/accounts/logs/__init__.py | 33 - .../resources/accounts/logs/audit.py | 426 --- .../resources/accounts/logs/logs.py | 102 - .../addressing/address_maps/accounts.py | 16 +- .../addressing/address_maps/address_maps.py | 32 +- .../resources/addressing/address_maps/ips.py | 16 +- .../addressing/address_maps/zones.py | 24 +- .../resources/addressing/addressing.py | 16 +- .../addressing/loa_documents/__init__.py | 33 + .../addressing/loa_documents/downloads.py | 188 ++ .../{ => loa_documents}/loa_documents.py | 160 +- .../resources/addressing/prefixes/__init__.py | 56 +- .../prefixes/advertisement_status.py | 324 --- .../addressing/prefixes/bgp/__init__.py | 61 + .../resources/addressing/prefixes/bgp/bgp.py | 166 ++ .../{service_bindings.py => bgp/bindings.py} | 158 +- .../{bgp_prefixes.py => bgp/prefixes.py} | 242 +- .../prefixes/bgp/statuses.py} | 168 +- .../addressing/prefixes/delegations.py | 28 +- .../resources/addressing/prefixes/prefixes.py | 136 +- .../resources/addressing/services.py | 4 +- src/cloudflare/resources/ai/__init__.py | 75 - src/cloudflare/resources/ai/authors.py | 165 -- .../resources/ai/finetunes/__init__.py | 47 - .../resources/ai/finetunes/assets.py | 217 -- .../resources/ai/finetunes/finetunes.py | 356 --- .../resources/ai/finetunes/public.py | 208 -- src/cloudflare/resources/ai/models/models.py | 263 -- src/cloudflare/resources/ai/tasks.py | 165 -- .../resources/ai_gateway/ai_gateway.py | 16 + .../resources/ai_gateway/datasets.py | 17 + .../resources/ai_gateway/evaluations.py | 17 + .../api_gateway/operations/operations.py | 184 +- .../resources/argo/tiered_caching.py | 74 +- .../resources/cache/cache_reserve.py | 50 +- .../resources/cache/regional_tiered_cache.py | 30 +- .../resources/cache/smart_tiered_cache.py | 80 +- src/cloudflare/resources/cache/variants.py | 40 +- .../resources/cloud_connector/rules.py | 12 +- src/cloudflare/resources/dns/records.py | 748 ++---- .../email_security/settings/block_senders.py | 199 +- .../settings/impersonation_registry.py | 181 +- src/cloudflare/resources/logpush/jobs.py | 12 - .../resources/magic_transit/sites/acls.py | 36 - .../resources/managed_transforms.py | 142 +- .../origin_post_quantum_encryption.py | 128 +- .../resources/r2/buckets/buckets.py | 64 +- src/cloudflare/resources/r2/buckets/cors.py | 48 +- .../resources/r2/buckets/domains/custom.py | 80 +- .../resources/r2/buckets/domains/managed.py | 32 +- .../configuration/configuration.py | 16 +- .../configuration/queues.py | 32 +- .../resources/r2/buckets/lifecycle.py | 32 +- src/cloudflare/resources/r2/buckets/sippy.py | 60 +- .../resources/radar/ai/bots/summary.py | 10 - .../resources/radar/as112/summary.py | 20 - .../radar/as112/timeseries_groups.py | 20 - .../resources/radar/attacks/layer3/summary.py | 10 - .../resources/radar/attacks/layer7/summary.py | 30 - .../radar/attacks/layer7/timeseries_groups.py | 30 - .../resources/radar/http/timeseries_groups.py | 10 - .../resources/radar/ranking/domain.py | 15 +- .../resources/radar/ranking/ranking.py | 6 +- src/cloudflare/resources/rules/lists/items.py | 52 +- src/cloudflare/resources/url_normalization.py | 142 +- .../resources/url_scanner/responses.py | 4 +- src/cloudflare/resources/url_scanner/scans.py | 56 +- .../resources/vectorize/indexes/indexes.py | 12 +- .../resources/waiting_rooms/waiting_rooms.py | 102 - src/cloudflare/resources/workers/__init__.py | 28 +- .../resources/workers/ai/__init__.py | 33 + .../resources/{ => workers}/ai/ai.py | 114 +- .../{ => workers}/ai/models/__init__.py | 0 .../resources/workers/ai/models/models.py | 102 + .../{ => workers}/ai/models/schema.py | 16 +- .../resources/workers/assets/upload.py | 14 +- src/cloudflare/resources/workers/routes.py | 600 ----- .../workers/scripts/assets/upload.py | 14 +- .../resources/workers/scripts/content.py | 46 +- .../resources/workers/scripts/scripts.py | 214 +- .../resources/workers/scripts/versions.py | 40 +- src/cloudflare/resources/workers/workers.py | 38 +- .../dispatch/namespaces/scripts/__init__.py | 14 - .../namespaces/scripts/asset_upload.py | 223 -- .../dispatch/namespaces/scripts/content.py | 46 +- .../dispatch/namespaces/scripts/scripts.py | 196 +- .../resources/zero_trust/access/__init__.py | 14 - .../resources/zero_trust/access/access.py | 32 - .../resources/zero_trust/access/gateway_ca.py | 365 --- .../access/infrastructure/targets.py | 67 +- .../resources/zero_trust/devices/devices.py | 52 +- .../zero_trust/devices/fleet_status.py | 4 +- .../devices/policies/default/certificates.py | 26 +- .../devices/posture/integrations.py | 12 +- .../resources/zero_trust/devices/revoke.py | 14 +- .../resources/zero_trust/devices/unrevoke.py | 14 +- .../zero_trust/dex/commands/__init__.py | 28 - .../zero_trust/dex/commands/commands.py | 72 +- .../zero_trust/dex/commands/devices.py | 212 -- .../zero_trust/dex/commands/downloads.py | 4 +- .../zero_trust/dex/commands/quota.py | 4 +- .../zero_trust/dex/commands/users.py | 189 -- .../resources/zero_trust/dlp/__init__.py | 14 - .../resources/zero_trust/dlp/dlp.py | 32 - .../zero_trust/dlp/email/__init__.py | 47 - .../resources/zero_trust/dlp/email/email.py | 134 - .../resources/zero_trust/dlp/email/rules.py | 701 ----- .../gateway/configurations/configurations.py | 8 +- .../zero_trust/gateway/lists/lists.py | 20 +- .../resources/zero_trust/organizations/doh.py | 12 +- src/cloudflare/resources/zones/holds.py | 148 +- .../types/abuse_reports/__init__.py | 6 - .../abuse_report_create_params.py | 140 - .../abuse_report_create_response.py | 7 - .../types/accounts/logs/__init__.py | 6 - .../types/accounts/logs/audit_list_params.py | 115 - .../accounts/logs/audit_list_response.py | 124 - .../types/accounts/token_create_params.py | 2 +- .../types/accounts/token_create_response.py | 2 +- .../types/accounts/token_update_params.py | 2 +- .../types/addressing/address_map.py | 2 +- .../addressing/address_map_create_params.py | 2 +- .../addressing/address_map_create_response.py | 2 +- .../addressing/address_map_edit_params.py | 2 +- .../addressing/address_map_get_response.py | 2 +- .../address_maps/account_update_params.py | 2 +- .../address_maps/ip_update_params.py | 4 +- .../address_maps/zone_update_params.py | 4 +- .../addressing/loa_document_create_params.py | 2 +- .../loa_document_create_response.py | 2 +- .../addressing/loa_documents}/__init__.py | 2 + src/cloudflare/types/addressing/prefix.py | 4 +- .../types/addressing/prefix_create_params.py | 2 +- .../types/addressing/prefix_edit_params.py | 2 +- .../types/addressing/prefixes/__init__.py | 9 - .../advertisement_status_edit_params.py | 19 - .../types/addressing/prefixes/bgp/__init__.py | 12 + .../prefixes/{ => bgp}/bgp_prefix.py | 4 +- .../binding_create_params.py} | 9 +- .../prefixes/bgp/binding_delete_response.py} | 8 +- .../prefix_edit_params.py} | 8 +- .../prefixes/{ => bgp}/service_binding.py | 9 +- .../prefixes/bgp/status_edit_params.py} | 12 +- .../status_edit_response.py} | 12 +- .../status_get_response.py} | 12 +- .../prefixes/delegation_create_params.py | 2 +- .../prefixes/delegation_delete_response.py | 2 +- .../types/addressing/prefixes/delegations.py | 4 +- .../prefixes/service_binding_create_params.py | 21 - .../service_binding_delete_response.py | 18 - .../types/addressing/service_list_response.py | 5 +- src/cloudflare/types/ai/__init__.py | 10 - .../types/ai/finetune_create_params.py | 19 - .../types/ai/finetune_create_response.py | 24 - .../types/ai/finetune_list_response.py | 22 - src/cloudflare/types/ai/finetunes/__init__.py | 8 - .../ai/finetunes/asset_create_response.py | 21 - .../types/ai/finetunes/public_list_params.py | 22 - .../ai/finetunes/public_list_response.py | 24 - src/cloudflare/types/ai/model_list_params.py | 30 - .../ai_gateway/ai_gateway_create_response.py | 6 - .../ai_gateway/ai_gateway_delete_response.py | 6 - .../ai_gateway/ai_gateway_get_response.py | 6 - .../ai_gateway/ai_gateway_list_params.py | 8 +- .../ai_gateway/ai_gateway_list_response.py | 6 - .../ai_gateway/ai_gateway_update_response.py | 6 - .../ai_gateway/dataset_create_response.py | 4 - .../ai_gateway/dataset_delete_response.py | 4 - .../types/ai_gateway/dataset_get_response.py | 4 - .../types/ai_gateway/dataset_list_params.py | 8 +- .../types/ai_gateway/dataset_list_response.py | 4 - .../ai_gateway/dataset_update_response.py | 4 - .../ai_gateway/evaluation_create_response.py | 8 - .../ai_gateway/evaluation_delete_response.py | 8 - .../ai_gateway/evaluation_get_response.py | 8 - .../ai_gateway/evaluation_list_params.py | 8 +- .../ai_gateway/evaluation_list_response.py | 8 - .../types/ai_gateway/log_delete_params.py | 7 - .../types/ai_gateway/log_list_params.py | 7 - src/cloudflare/types/api_gateway/__init__.py | 3 +- .../types/api_gateway/api_shield.py | 227 ++ .../operation_bulk_create_params.py | 31 - .../operation_bulk_create_response.py | 239 -- .../api_gateway/operation_create_params.py | 7 +- .../api_gateway/operation_create_response.py | 227 +- .../user_schemas/operation_list_response.py | 232 +- .../argo/tiered_caching_edit_response.py | 13 +- .../types/argo/tiered_caching_get_response.py | 13 +- src/cloudflare/types/cache/__init__.py | 2 +- .../cache/cache_reserve_clear_response.py | 6 +- .../cache/cache_reserve_edit_response.py | 9 +- .../types/cache/cache_reserve_get_response.py | 9 +- .../cache/cache_reserve_status_response.py | 6 +- ...nt_delete_response.py => cache_variant.py} | 9 +- .../regional_tiered_cache_edit_response.py | 24 +- .../regional_tiered_cache_get_response.py | 24 +- .../smart_tiered_cache_delete_response.py | 12 +- .../cache/smart_tiered_cache_edit_response.py | 13 +- .../cache/smart_tiered_cache_get_response.py | 13 +- .../types/cache/variant_edit_response.py | 83 +- .../types/cache/variant_get_response.py | 83 +- .../cloud_connector/rule_update_params.py | 10 +- src/cloudflare/types/dns/__init__.py | 9 +- src/cloudflare/types/dns/a_record.py | 23 +- src/cloudflare/types/dns/a_record_param.py | 23 +- src/cloudflare/types/dns/aaaa_record.py | 23 +- src/cloudflare/types/dns/aaaa_record_param.py | 23 +- src/cloudflare/types/dns/batch_patch_param.py | 237 -- src/cloudflare/types/dns/batch_put_param.py | 237 -- src/cloudflare/types/dns/caa_record.py | 23 +- src/cloudflare/types/dns/caa_record_param.py | 23 +- src/cloudflare/types/dns/cert_record.py | 23 +- src/cloudflare/types/dns/cert_record_param.py | 23 +- src/cloudflare/types/dns/cname_record.py | 19 +- .../types/dns/cname_record_param.py | 19 +- src/cloudflare/types/dns/dnskey_record.py | 23 +- .../types/dns/dnskey_record_param.py | 23 +- src/cloudflare/types/dns/ds_record.py | 23 +- src/cloudflare/types/dns/ds_record_param.py | 23 +- src/cloudflare/types/dns/https_record.py | 23 +- .../types/dns/https_record_param.py | 23 +- src/cloudflare/types/dns/loc_record.py | 23 +- src/cloudflare/types/dns/loc_record_param.py | 23 +- src/cloudflare/types/dns/mx_record.py | 23 +- src/cloudflare/types/dns/mx_record_param.py | 23 +- src/cloudflare/types/dns/naptr_record.py | 23 +- .../types/dns/naptr_record_param.py | 23 +- src/cloudflare/types/dns/ns_record.py | 23 +- src/cloudflare/types/dns/ns_record_param.py | 23 +- src/cloudflare/types/dns/ptr_record.py | 23 +- src/cloudflare/types/dns/ptr_record_param.py | 23 +- .../types/dns/record_batch_params.py | 403 ++- .../types/dns/record_batch_response.py | 2283 ++++++++++++++++- .../types/dns/record_create_params.py | 459 +--- ..._response.py => record_create_response.py} | 32 +- .../types/dns/record_edit_params.py | 459 +--- .../types/dns/record_edit_response.py | 595 +++++ .../types/dns/record_get_response.py | 595 +++++ .../types/dns/record_list_response.py | 595 +++++ src/cloudflare/types/dns/record_param.py | 27 +- .../types/dns/record_process_timing.py | 19 + .../types/dns/record_update_params.py | 459 +--- .../types/dns/record_update_response.py | 595 +++++ src/cloudflare/types/dns/smimea_record.py | 23 +- .../types/dns/smimea_record_param.py | 23 +- src/cloudflare/types/dns/srv_record.py | 23 +- src/cloudflare/types/dns/srv_record_param.py | 23 +- src/cloudflare/types/dns/sshfp_record.py | 23 +- .../types/dns/sshfp_record_param.py | 23 +- src/cloudflare/types/dns/svcb_record.py | 23 +- src/cloudflare/types/dns/svcb_record_param.py | 23 +- src/cloudflare/types/dns/tlsa_record.py | 23 +- src/cloudflare/types/dns/tlsa_record_param.py | 23 +- src/cloudflare/types/dns/txt_record.py | 23 +- src/cloudflare/types/dns/txt_record_param.py | 23 +- src/cloudflare/types/dns/uri_record.py | 23 +- src/cloudflare/types/dns/uri_record_param.py | 23 +- .../investigate/preview_create_response.py | 4 +- .../settings/block_sender_create_params.py | 28 +- .../settings/block_sender_create_response.py | 28 +- .../settings/block_sender_delete_response.py | 1 - .../settings/block_sender_edit_response.py | 1 - .../settings/block_sender_get_response.py | 1 - .../settings/block_sender_list_response.py | 1 - .../impersonation_registry_create_params.py | 25 +- .../impersonation_registry_create_response.py | 36 +- .../impersonation_registry_edit_response.py | 4 +- .../impersonation_registry_get_response.py | 4 +- .../impersonation_registry_list_response.py | 4 +- .../images/v1/variant_delete_response.py | 4 +- .../types/images/v1_delete_response.py | 4 +- .../types/logpush/job_update_params.py | 7 - .../types/magic_transit/sites/acl.py | 8 - .../magic_transit/sites/acl_create_params.py | 8 - .../magic_transit/sites/acl_edit_params.py | 8 - .../magic_transit/sites/acl_update_params.py | 8 - .../types/magic_transit/sites/wan.py | 7 - .../types/managed_transforms/__init__.py | 2 + .../managed_transform_edit_params.py | 28 +- .../managed_transform_edit_response.py | 42 +- .../managed_transform_list_response.py | 43 +- .../types/managed_transforms/request_model.py | 15 + .../managed_transforms/request_model_param.py | 15 + ...in_post_quantum_encryption_get_response.py | 21 +- ...post_quantum_encryption_update_response.py | 21 +- src/cloudflare/types/page_rules/page_rule.py | 78 +- .../page_rules/page_rule_create_params.py | 78 +- .../types/page_rules/page_rule_edit_params.py | 78 +- .../page_rules/page_rule_update_params.py | 78 +- .../types/r2/bucket_create_params.py | 2 +- src/cloudflare/types/r2/bucket_list_params.py | 2 +- .../types/r2/buckets/cors_update_params.py | 2 +- .../buckets/domains/custom_create_params.py | 2 +- .../buckets/domains/custom_update_params.py | 2 +- .../buckets/domains/managed_update_params.py | 2 +- .../configuration/queue_update_params.py | 2 +- .../r2/buckets/lifecycle_update_params.py | 2 +- .../types/r2/buckets/sippy_update_params.py | 4 +- .../ai/bots/summary_user_agent_params.py | 6 - .../ai/bots/summary_user_agent_response.py | 2 +- .../radar/as112/summary_query_type_params.py | 6 - .../as112/summary_query_type_response.py | 25 +- .../as112/summary_response_codes_params.py | 6 - .../as112/summary_response_codes_response.py | 11 +- .../timeseries_group_query_type_params.py | 6 - .../timeseries_group_response_codes_params.py | 6 - .../attacks/layer3/summary_vector_params.py | 6 - .../attacks/layer3/summary_vector_response.py | 2 +- .../layer7/summary_http_method_params.py | 6 - .../layer7/summary_http_method_response.py | 19 +- .../layer7/summary_managed_rules_params.py | 6 - .../layer7/summary_managed_rules_response.py | 2 +- .../summary_mitigation_product_params.py | 6 - .../summary_mitigation_product_response.py | 11 +- .../timeseries_group_http_method_params.py | 6 - .../timeseries_group_http_method_response.py | 12 +- .../timeseries_group_http_version_response.py | 4 - .../timeseries_group_managed_rules_params.py | 6 - ...eseries_group_mitigation_product_params.py | 6 - ...eries_group_mitigation_product_response.py | 12 +- .../timeseries_group_browser_family_params.py | 6 - .../types/radar/ranking/domain_get_params.py | 8 +- .../types/radar/ranking_top_params.py | 5 +- ...sets_timeout_timeseries_groups_response.py | 17 + .../types/rules/lists/item_get_response.py | 51 +- .../types/rules/lists/item_list_response.py | 51 +- .../types/rulesets/rule_create_params.py | 85 +- .../types/rulesets/rule_edit_params.py | 85 +- .../types/rulesets/set_cache_settings_rule.py | 85 +- .../rulesets/set_cache_settings_rule_param.py | 85 +- src/cloudflare/types/shared/token.py | 2 +- src/cloudflare/types/shared/token_policy.py | 12 +- .../types/shared_params/token_policy.py | 12 +- .../url_normalization_get_response.py | 6 +- .../url_normalization_update_params.py | 8 +- .../url_normalization_update_response.py | 6 +- .../url_scanner/scan_bulk_create_params.py | 3 - .../types/url_scanner/scan_create_params.py | 3 - .../types/url_scanner/scan_list_params.py | 5 +- .../url_scanner/scan_screenshot_params.py | 8 +- .../types/user/token_create_params.py | 2 +- .../types/user/token_create_response.py | 2 +- .../types/user/token_update_params.py | 2 +- .../types/vectorize/index_delete_response.py | 4 +- .../types/waiting_rooms/waiting_room.py | 19 - .../waiting_room_create_params.py | 19 - .../waiting_rooms/waiting_room_edit_params.py | 19 - .../waiting_room_update_params.py | 19 - src/cloudflare/types/workers/__init__.py | 30 +- src/cloudflare/types/workers/ai/__init__.py | 3 + .../types/{ => workers}/ai/models/__init__.py | 0 .../ai/models/schema_get_params.py | 0 .../types/{ai => workers}/ai_run_params.py | 0 .../types/{ai => workers}/ai_run_response.py | 0 src/cloudflare/types/workers/binding.py | 47 + src/cloudflare/types/workers/binding_param.py | 42 + src/cloudflare/types/workers/d1_binding.py | 21 + .../types/workers/d1_binding_param.py | 18 + .../workers/dispatch_namespace_binding.py | 41 + .../dispatch_namespace_binding_param.py | 38 + .../types/workers/durable_object_binding.py | 30 + .../workers/durable_object_binding_param.py | 23 + .../types/workers/kv_namespace_binding.py | 18 + .../workers/kv_namespace_binding_param.py | 12 + .../types/workers/mtls_cert_binding.py | 18 + .../types/workers/mtls_cert_binding_param.py | 15 + .../types/workers/placement_configuration.py | 17 + .../workers/placement_configuration_param.py | 16 + src/cloudflare/types/workers/r2_binding.py | 18 + .../types/workers/r2_binding_param.py | 15 + .../types/workers/route_create_params.py | 17 - .../types/workers/route_delete_response.py | 18 - .../types/workers/route_get_response.py | 16 - .../types/workers/route_list_response.py | 16 - .../types/workers/route_update_params.py | 17 - .../types/workers/route_update_response.py | 16 - src/cloudflare/types/workers/script.py | 40 +- .../types/workers/script_get_response.py | 7 - .../types/workers/script_update_params.py | 420 +-- .../types/workers/script_update_response.py | 40 +- .../workers/scripts/content_update_params.py | 15 +- .../workers/scripts/version_create_params.py | 335 +-- .../types/workers/service_binding.py | 21 + .../types/workers/service_binding_param.py | 18 + .../types/workers/stepped_migration.py | 22 + .../types/workers/stepped_migration_param.py | 24 + .../namespaces/script_update_params.py | 407 +-- .../namespaces/script_update_response.py | 40 +- .../dispatch/namespaces/scripts/__init__.py | 2 - .../scripts/asset_upload_create_params.py | 30 - .../scripts/asset_upload_create_response.py | 15 - .../scripts/binding_get_response.py | 309 +-- .../scripts/content_update_params.py | 15 +- .../namespaces/scripts/setting_edit_params.py | 364 +-- .../scripts/setting_edit_response.py | 366 +-- .../scripts/setting_get_response.py | 366 +-- .../types/zero_trust/access/__init__.py | 3 - .../access/application_create_params.py | 528 +--- .../access/application_create_response.py | 596 +---- .../access/application_get_response.py | 596 +---- .../access/application_list_response.py | 596 +---- .../access/application_update_params.py | 528 +--- .../access/application_update_response.py | 596 +---- .../access/gateway_ca_create_response.py | 15 - .../access/gateway_ca_delete_response.py | 12 - .../access/gateway_ca_list_response.py | 15 - .../infrastructure/target_list_params.py | 26 +- .../types/zero_trust/device_get_response.py | 83 +- .../default/certificate_edit_response.py | 4 +- .../default/certificate_get_response.py | 4 +- .../posture/integration_delete_response.py | 4 +- .../devices/revoke_create_response.py | 4 +- .../devices/unrevoke_create_response.py | 4 +- .../types/zero_trust/dex/commands/__init__.py | 4 - .../dex/commands/device_list_params.py | 20 - .../dex/commands/device_list_response.py | 37 - .../dex/commands/user_list_params.py | 14 - .../dex/commands/user_list_response.py | 14 - .../types/zero_trust/dlp/dataset.py | 4 - .../types/zero_trust/dlp/email/__init__.py | 16 - .../email/account_mapping_create_params.py | 27 - .../email/account_mapping_create_response.py | 27 - .../dlp/email/account_mapping_get_response.py | 27 - .../dlp/email/rule_bulk_edit_params.py | 14 - .../dlp/email/rule_bulk_edit_response.py | 44 - .../dlp/email/rule_create_params.py | 37 - .../dlp/email/rule_create_response.py | 44 - .../dlp/email/rule_delete_response.py | 44 - .../zero_trust/dlp/email/rule_get_response.py | 44 - .../dlp/email/rule_list_response.py | 44 - .../dlp/email/rule_update_params.py | 37 - .../dlp/email/rule_update_response.py | 44 - .../gateway/configuration_edit_params.py | 2 +- .../gateway/configuration_edit_response.py | 2 +- .../gateway/configuration_get_response.py | 2 +- .../gateway/configuration_update_params.py | 2 +- .../gateway/configuration_update_response.py | 2 +- .../types/zero_trust/gateway/gateway_rule.py | 3 - .../zero_trust/gateway/list_update_params.py | 6 - .../types/zero_trust/gateway/location.py | 7 - .../types/zero_trust/gateway/rule_setting.py | 32 +- .../zero_trust/gateway/rule_setting_param.py | 32 +- .../identity_provider_scim_config.py | 5 +- .../organizations/doh_get_response.py | 16 +- .../organizations/doh_update_params.py | 2 +- .../organizations/doh_update_response.py | 16 +- src/cloudflare/types/zones/__init__.py | 2 +- .../types/zones/hold_edit_params.py | 29 - .../types/zones/origin_max_http_version.py | 7 + .../api_resources/accounts/logs/test_audit.py | 192 -- tests/api_resources/accounts/test_tokens.py | 56 +- .../addressing/address_maps/test_accounts.py | 64 +- .../addressing/address_maps/test_ips.py | 80 +- .../addressing/address_maps/test_zones.py | 120 +- .../loa_documents}/__init__.py | 0 .../loa_documents/test_downloads.py | 184 ++ .../prefixes/bgp}/__init__.py | 0 .../addressing/prefixes/bgp/test_bindings.py | 475 ++++ .../addressing/prefixes/bgp/test_prefixes.py | 379 +++ .../addressing/prefixes/bgp/test_statuses.py | 224 ++ .../prefixes/test_advertisement_status.py | 227 -- .../addressing/prefixes/test_bgp_prefixes.py | 493 ---- .../addressing/prefixes/test_delegations.py | 104 +- .../prefixes/test_service_bindings.py | 478 ---- .../addressing/test_address_maps.py | 132 +- .../addressing/test_loa_documents.py | 176 +- .../api_resources/addressing/test_prefixes.py | 120 +- .../api_resources/addressing/test_services.py | 12 +- .../api_resources/ai/finetunes/test_assets.py | 138 - .../api_resources/ai/finetunes/test_public.py | 119 - tests/api_resources/ai/test_authors.py | 98 - tests/api_resources/ai/test_finetunes.py | 212 -- tests/api_resources/ai/test_models.py | 126 - tests/api_resources/ai/test_tasks.py | 98 - .../api_resources/ai_gateway/test_datasets.py | 4 + .../ai_gateway/test_evaluations.py | 4 + tests/api_resources/ai_gateway/test_logs.py | 8 +- .../api_gateway/test_operations.py | 213 +- .../api_resources/argo/test_tiered_caching.py | 26 +- .../api_resources/cache/test_cache_reserve.py | 50 +- .../cache/test_regional_tiered_cache.py | 26 +- .../cache/test_smart_tiered_cache.py | 38 +- tests/api_resources/cache/test_variants.py | 62 +- .../cloud_connector/test_rules.py | 16 +- tests/api_resources/dns/test_records.py | 1600 ++++-------- .../settings/test_block_senders.py | 152 +- .../settings/test_impersonation_registry.py | 148 +- .../settings/test_trusted_domains.py | 18 - tests/api_resources/logpush/test_jobs.py | 2 - .../magic_transit/sites/test_acls.py | 6 - .../r2/buckets/domains/test_custom.py | 20 +- .../r2/buckets/domains/test_managed.py | 8 +- .../configuration/test_queues.py | 8 +- .../event_notifications/test_configuration.py | 4 +- tests/api_resources/r2/buckets/test_cors.py | 12 +- .../r2/buckets/test_lifecycle.py | 8 +- tests/api_resources/r2/buckets/test_sippy.py | 16 +- tests/api_resources/r2/test_buckets.py | 16 +- .../radar/ai/bots/test_summary.py | 2 - .../radar/ai/test_timeseries_groups.py | 4 +- .../api_resources/radar/as112/test_summary.py | 4 - .../radar/as112/test_timeseries_groups.py | 4 - .../radar/attacks/layer3/test_summary.py | 2 - .../attacks/layer3/test_timeseries_groups.py | 12 +- .../radar/attacks/layer7/test_summary.py | 6 - .../attacks/layer7/test_timeseries_groups.py | 14 +- .../radar/http/test_timeseries_groups.py | 6 +- .../radar/ranking/test_domain.py | 7 +- tests/api_resources/radar/test_ranking.py | 6 +- tests/api_resources/rulesets/test_rules.py | 44 +- tests/api_resources/spectrum/test_apps.py | 10 - tests/api_resources/test_abuse_reports.py | 243 -- tests/api_resources/test_ai_gateway.py | 4 + tests/api_resources/test_filters.py | 8 - .../api_resources/test_managed_transforms.py | 236 +- .../test_origin_post_quantum_encryption.py | 34 +- tests/api_resources/test_url_normalization.py | 150 +- tests/api_resources/test_waiting_rooms.py | 12 - .../url_scanner/test_responses.py | 32 +- tests/api_resources/url_scanner/test_scans.py | 136 +- tests/api_resources/user/test_tokens.py | 46 +- tests/api_resources/vectorize/test_indexes.py | 12 +- .../{ai/finetunes => workers/ai}/__init__.py | 0 .../{ => workers}/ai/models/__init__.py | 0 .../{ => workers}/ai/models/test_schema.py | 16 +- .../workers/scripts/test_content.py | 12 +- .../workers/scripts/test_versions.py | 26 +- tests/api_resources/{ => workers}/test_ai.py | 278 +- tests/api_resources/workers/test_routes.py | 525 ---- tests/api_resources/workers/test_scripts.py | 283 +- .../namespaces/scripts/test_asset_upload.py | 176 -- .../namespaces/scripts/test_content.py | 14 +- .../namespaces/scripts/test_settings.py | 26 +- .../dispatch/namespaces/test_scripts.py | 198 +- .../access/infrastructure/test_targets.py | 10 - .../zero_trust/access/test_applications.py | 288 +-- .../zero_trust/access/test_gateway_ca.py | 271 -- .../policies/default/test_certificates.py | 26 +- .../devices/posture/test_integrations.py | 12 +- .../zero_trust/devices/test_revoke.py | 14 +- .../zero_trust/devices/test_unrevoke.py | 14 +- .../zero_trust/dex/commands/test_devices.py | 135 - .../zero_trust/dex/commands/test_downloads.py | 12 +- .../zero_trust/dex/commands/test_users.py | 114 - .../zero_trust/dlp/datasets/test_versions.py | 8 - .../dlp/email/test_account_mapping.py | 225 -- .../zero_trust/dlp/email/test_rules.py | 820 ------ .../zero_trust/dlp/test_entries.py | 30 - .../zero_trust/gateway/test_lists.py | 12 - .../zero_trust/gateway/test_rules.py | 16 - .../zero_trust/organizations/test_doh.py | 4 +- .../api_resources/zero_trust/test_devices.py | 14 +- tests/api_resources/zones/test_holds.py | 112 +- 559 files changed, 13597 insertions(+), 28967 deletions(-) delete mode 100644 src/cloudflare/resources/abuse_reports.py delete mode 100644 src/cloudflare/resources/accounts/logs/__init__.py delete mode 100644 src/cloudflare/resources/accounts/logs/audit.py delete mode 100644 src/cloudflare/resources/accounts/logs/logs.py create mode 100644 src/cloudflare/resources/addressing/loa_documents/__init__.py create mode 100644 src/cloudflare/resources/addressing/loa_documents/downloads.py rename src/cloudflare/resources/addressing/{ => loa_documents}/loa_documents.py (60%) delete mode 100644 src/cloudflare/resources/addressing/prefixes/advertisement_status.py create mode 100644 src/cloudflare/resources/addressing/prefixes/bgp/__init__.py create mode 100644 src/cloudflare/resources/addressing/prefixes/bgp/bgp.py rename src/cloudflare/resources/addressing/prefixes/{service_bindings.py => bgp/bindings.py} (80%) rename src/cloudflare/resources/addressing/prefixes/{bgp_prefixes.py => bgp/prefixes.py} (62%) rename src/cloudflare/resources/{zero_trust/dlp/email/account_mapping.py => addressing/prefixes/bgp/statuses.py} (59%) delete mode 100644 src/cloudflare/resources/ai/__init__.py delete mode 100644 src/cloudflare/resources/ai/authors.py delete mode 100644 src/cloudflare/resources/ai/finetunes/__init__.py delete mode 100644 src/cloudflare/resources/ai/finetunes/assets.py delete mode 100644 src/cloudflare/resources/ai/finetunes/finetunes.py delete mode 100644 src/cloudflare/resources/ai/finetunes/public.py delete mode 100644 src/cloudflare/resources/ai/models/models.py delete mode 100644 src/cloudflare/resources/ai/tasks.py create mode 100644 src/cloudflare/resources/workers/ai/__init__.py rename src/cloudflare/resources/{ => workers}/ai/ai.py (94%) rename src/cloudflare/resources/{ => workers}/ai/models/__init__.py (100%) create mode 100644 src/cloudflare/resources/workers/ai/models/models.py rename src/cloudflare/resources/{ => workers}/ai/models/schema.py (94%) delete mode 100644 src/cloudflare/resources/workers/routes.py delete mode 100644 src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/asset_upload.py delete mode 100644 src/cloudflare/resources/zero_trust/access/gateway_ca.py delete mode 100644 src/cloudflare/resources/zero_trust/dex/commands/devices.py delete mode 100644 src/cloudflare/resources/zero_trust/dex/commands/users.py delete mode 100644 src/cloudflare/resources/zero_trust/dlp/email/__init__.py delete mode 100644 src/cloudflare/resources/zero_trust/dlp/email/email.py delete mode 100644 src/cloudflare/resources/zero_trust/dlp/email/rules.py delete mode 100644 src/cloudflare/types/abuse_reports/__init__.py delete mode 100644 src/cloudflare/types/abuse_reports/abuse_report_create_params.py delete mode 100644 src/cloudflare/types/abuse_reports/abuse_report_create_response.py delete mode 100644 src/cloudflare/types/accounts/logs/__init__.py delete mode 100644 src/cloudflare/types/accounts/logs/audit_list_params.py delete mode 100644 src/cloudflare/types/accounts/logs/audit_list_response.py rename {tests/api_resources/zero_trust/dlp/email => src/cloudflare/types/addressing/loa_documents}/__init__.py (70%) delete mode 100644 src/cloudflare/types/addressing/prefixes/advertisement_status_edit_params.py create mode 100644 src/cloudflare/types/addressing/prefixes/bgp/__init__.py rename src/cloudflare/types/addressing/prefixes/{ => bgp}/bgp_prefix.py (96%) rename src/cloudflare/types/addressing/prefixes/{bgp_prefix_create_params.py => bgp/binding_create_params.py} (65%) rename src/cloudflare/types/{workers/route_create_response.py => addressing/prefixes/bgp/binding_delete_response.py} (64%) rename src/cloudflare/types/addressing/prefixes/{bgp_prefix_edit_params.py => bgp/prefix_edit_params.py} (64%) rename src/cloudflare/types/addressing/prefixes/{ => bgp}/service_binding.py (79%) rename src/cloudflare/types/{ai/finetunes/asset_create_params.py => addressing/prefixes/bgp/status_edit_params.py} (51%) rename src/cloudflare/types/addressing/prefixes/{advertisement_status_get_response.py => bgp/status_edit_response.py} (54%) rename src/cloudflare/types/addressing/prefixes/{advertisement_status_edit_response.py => bgp/status_get_response.py} (54%) delete mode 100644 src/cloudflare/types/addressing/prefixes/service_binding_create_params.py delete mode 100644 src/cloudflare/types/addressing/prefixes/service_binding_delete_response.py delete mode 100644 src/cloudflare/types/ai/__init__.py delete mode 100644 src/cloudflare/types/ai/finetune_create_params.py delete mode 100644 src/cloudflare/types/ai/finetune_create_response.py delete mode 100644 src/cloudflare/types/ai/finetune_list_response.py delete mode 100644 src/cloudflare/types/ai/finetunes/__init__.py delete mode 100644 src/cloudflare/types/ai/finetunes/asset_create_response.py delete mode 100644 src/cloudflare/types/ai/finetunes/public_list_params.py delete mode 100644 src/cloudflare/types/ai/finetunes/public_list_response.py delete mode 100644 src/cloudflare/types/ai/model_list_params.py create mode 100644 src/cloudflare/types/api_gateway/api_shield.py delete mode 100644 src/cloudflare/types/api_gateway/operation_bulk_create_params.py delete mode 100644 src/cloudflare/types/api_gateway/operation_bulk_create_response.py rename src/cloudflare/types/cache/{variant_delete_response.py => cache_variant.py} (63%) delete mode 100644 src/cloudflare/types/dns/batch_patch_param.py delete mode 100644 src/cloudflare/types/dns/batch_put_param.py rename src/cloudflare/types/dns/{record_response.py => record_create_response.py} (94%) create mode 100644 src/cloudflare/types/dns/record_edit_response.py create mode 100644 src/cloudflare/types/dns/record_get_response.py create mode 100644 src/cloudflare/types/dns/record_list_response.py create mode 100644 src/cloudflare/types/dns/record_process_timing.py create mode 100644 src/cloudflare/types/dns/record_update_response.py create mode 100644 src/cloudflare/types/managed_transforms/request_model.py create mode 100644 src/cloudflare/types/managed_transforms/request_model_param.py create mode 100644 src/cloudflare/types/workers/ai/__init__.py rename src/cloudflare/types/{ => workers}/ai/models/__init__.py (100%) rename src/cloudflare/types/{ => workers}/ai/models/schema_get_params.py (100%) rename src/cloudflare/types/{ai => workers}/ai_run_params.py (100%) rename src/cloudflare/types/{ai => workers}/ai_run_response.py (100%) create mode 100644 src/cloudflare/types/workers/binding.py create mode 100644 src/cloudflare/types/workers/binding_param.py create mode 100644 src/cloudflare/types/workers/d1_binding.py create mode 100644 src/cloudflare/types/workers/d1_binding_param.py create mode 100644 src/cloudflare/types/workers/dispatch_namespace_binding.py create mode 100644 src/cloudflare/types/workers/dispatch_namespace_binding_param.py create mode 100644 src/cloudflare/types/workers/durable_object_binding.py create mode 100644 src/cloudflare/types/workers/durable_object_binding_param.py create mode 100644 src/cloudflare/types/workers/kv_namespace_binding.py create mode 100644 src/cloudflare/types/workers/kv_namespace_binding_param.py create mode 100644 src/cloudflare/types/workers/mtls_cert_binding.py create mode 100644 src/cloudflare/types/workers/mtls_cert_binding_param.py create mode 100644 src/cloudflare/types/workers/placement_configuration.py create mode 100644 src/cloudflare/types/workers/placement_configuration_param.py create mode 100644 src/cloudflare/types/workers/r2_binding.py create mode 100644 src/cloudflare/types/workers/r2_binding_param.py delete mode 100644 src/cloudflare/types/workers/route_create_params.py delete mode 100644 src/cloudflare/types/workers/route_delete_response.py delete mode 100644 src/cloudflare/types/workers/route_get_response.py delete mode 100644 src/cloudflare/types/workers/route_list_response.py delete mode 100644 src/cloudflare/types/workers/route_update_params.py delete mode 100644 src/cloudflare/types/workers/route_update_response.py delete mode 100644 src/cloudflare/types/workers/script_get_response.py create mode 100644 src/cloudflare/types/workers/service_binding.py create mode 100644 src/cloudflare/types/workers/service_binding_param.py create mode 100644 src/cloudflare/types/workers/stepped_migration.py create mode 100644 src/cloudflare/types/workers/stepped_migration_param.py delete mode 100644 src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/asset_upload_create_params.py delete mode 100644 src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/asset_upload_create_response.py delete mode 100644 src/cloudflare/types/zero_trust/access/gateway_ca_create_response.py delete mode 100644 src/cloudflare/types/zero_trust/access/gateway_ca_delete_response.py delete mode 100644 src/cloudflare/types/zero_trust/access/gateway_ca_list_response.py delete mode 100644 src/cloudflare/types/zero_trust/dex/commands/device_list_params.py delete mode 100644 src/cloudflare/types/zero_trust/dex/commands/device_list_response.py delete mode 100644 src/cloudflare/types/zero_trust/dex/commands/user_list_params.py delete mode 100644 src/cloudflare/types/zero_trust/dex/commands/user_list_response.py delete mode 100644 src/cloudflare/types/zero_trust/dlp/email/__init__.py delete mode 100644 src/cloudflare/types/zero_trust/dlp/email/account_mapping_create_params.py delete mode 100644 src/cloudflare/types/zero_trust/dlp/email/account_mapping_create_response.py delete mode 100644 src/cloudflare/types/zero_trust/dlp/email/account_mapping_get_response.py delete mode 100644 src/cloudflare/types/zero_trust/dlp/email/rule_bulk_edit_params.py delete mode 100644 src/cloudflare/types/zero_trust/dlp/email/rule_bulk_edit_response.py delete mode 100644 src/cloudflare/types/zero_trust/dlp/email/rule_create_params.py delete mode 100644 src/cloudflare/types/zero_trust/dlp/email/rule_create_response.py delete mode 100644 src/cloudflare/types/zero_trust/dlp/email/rule_delete_response.py delete mode 100644 src/cloudflare/types/zero_trust/dlp/email/rule_get_response.py delete mode 100644 src/cloudflare/types/zero_trust/dlp/email/rule_list_response.py delete mode 100644 src/cloudflare/types/zero_trust/dlp/email/rule_update_params.py delete mode 100644 src/cloudflare/types/zero_trust/dlp/email/rule_update_response.py delete mode 100644 src/cloudflare/types/zones/hold_edit_params.py create mode 100644 src/cloudflare/types/zones/origin_max_http_version.py delete mode 100644 tests/api_resources/accounts/logs/test_audit.py rename tests/api_resources/{accounts/logs => addressing/loa_documents}/__init__.py (100%) create mode 100644 tests/api_resources/addressing/loa_documents/test_downloads.py rename tests/api_resources/{ai => addressing/prefixes/bgp}/__init__.py (100%) create mode 100644 tests/api_resources/addressing/prefixes/bgp/test_bindings.py create mode 100644 tests/api_resources/addressing/prefixes/bgp/test_prefixes.py create mode 100644 tests/api_resources/addressing/prefixes/bgp/test_statuses.py delete mode 100644 tests/api_resources/addressing/prefixes/test_advertisement_status.py delete mode 100644 tests/api_resources/addressing/prefixes/test_bgp_prefixes.py delete mode 100644 tests/api_resources/addressing/prefixes/test_service_bindings.py delete mode 100644 tests/api_resources/ai/finetunes/test_assets.py delete mode 100644 tests/api_resources/ai/finetunes/test_public.py delete mode 100644 tests/api_resources/ai/test_authors.py delete mode 100644 tests/api_resources/ai/test_finetunes.py delete mode 100644 tests/api_resources/ai/test_models.py delete mode 100644 tests/api_resources/ai/test_tasks.py delete mode 100644 tests/api_resources/test_abuse_reports.py rename tests/api_resources/{ai/finetunes => workers/ai}/__init__.py (100%) rename tests/api_resources/{ => workers}/ai/models/__init__.py (100%) rename tests/api_resources/{ => workers}/ai/models/test_schema.py (85%) rename tests/api_resources/{ => workers}/test_ai.py (87%) delete mode 100644 tests/api_resources/workers/test_routes.py delete mode 100644 tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_asset_upload.py delete mode 100644 tests/api_resources/zero_trust/access/test_gateway_ca.py delete mode 100644 tests/api_resources/zero_trust/dex/commands/test_devices.py delete mode 100644 tests/api_resources/zero_trust/dex/commands/test_users.py delete mode 100644 tests/api_resources/zero_trust/dlp/email/test_account_mapping.py delete mode 100644 tests/api_resources/zero_trust/dlp/email/test_rules.py diff --git a/.stats.yml b/.stats.yml index 7b79ec4630f..9709f00a3ac 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 1493 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-817b1412335b2bc367169247bf8a10b29dbadb82b77df71df5ef5f3470fc974b.yml +configured_endpoints: 1460 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6bb90de90ae3ffcac71bd91b9ad7338325a7ca45b28c334b686b427877b4d849.yml diff --git a/api.md b/api.md index 05082cde748..018bdbfda7a 100644 --- a/api.md +++ b/api.md @@ -123,20 +123,6 @@ Methods: - client.accounts.tokens.value.update(token_id, \*, account_id, \*\*params) -> str -## Logs - -### Audit - -Types: - -```python -from cloudflare.types.accounts.logs import AuditListResponse -``` - -Methods: - -- client.accounts.logs.audit.list(\*, account_id, \*\*params) -> SyncCursorLimitPagination[AuditListResponse] - # OriginCACertificates Types: @@ -348,7 +334,6 @@ Types: ```python from cloudflare.types.zones import ( AdvancedDDoS, - Aegis, AlwaysOnline, AlwaysUseHTTPS, AutomaticHTTPSRewrites, @@ -431,8 +416,7 @@ from cloudflare.types.zones import ZoneHold Methods: - client.zones.holds.create(\*, zone_id, \*\*params) -> ZoneHold -- client.zones.holds.delete(\*, zone_id, \*\*params) -> ZoneHold -- client.zones.holds.edit(\*, zone_id, \*\*params) -> ZoneHold +- client.zones.holds.delete(\*, zone_id, \*\*params) -> Optional[ZoneHold] - client.zones.holds.get(\*, zone_id) -> ZoneHold ## Subscriptions @@ -665,10 +649,10 @@ from cloudflare.types.cache import ( Methods: -- client.cache.cache_reserve.clear(\*, zone_id, \*\*params) -> Optional[CacheReserveClearResponse] -- client.cache.cache_reserve.edit(\*, zone_id, \*\*params) -> Optional[CacheReserveEditResponse] -- client.cache.cache_reserve.get(\*, zone_id) -> Optional[CacheReserveGetResponse] -- client.cache.cache_reserve.status(\*, zone_id) -> Optional[CacheReserveStatusResponse] +- client.cache.cache_reserve.clear(\*, zone_id, \*\*params) -> CacheReserveClearResponse +- client.cache.cache_reserve.edit(\*, zone_id, \*\*params) -> CacheReserveEditResponse +- client.cache.cache_reserve.get(\*, zone_id) -> CacheReserveGetResponse +- client.cache.cache_reserve.status(\*, zone_id) -> CacheReserveStatusResponse ## SmartTieredCache @@ -684,28 +668,23 @@ from cloudflare.types.cache import ( Methods: -- client.cache.smart_tiered_cache.delete(\*, zone_id) -> Optional[SmartTieredCacheDeleteResponse] -- client.cache.smart_tiered_cache.edit(\*, zone_id, \*\*params) -> Optional[SmartTieredCacheEditResponse] -- client.cache.smart_tiered_cache.get(\*, zone_id) -> Optional[SmartTieredCacheGetResponse] +- client.cache.smart_tiered_cache.delete(\*, zone_id) -> SmartTieredCacheDeleteResponse +- client.cache.smart_tiered_cache.edit(\*, zone_id, \*\*params) -> SmartTieredCacheEditResponse +- client.cache.smart_tiered_cache.get(\*, zone_id) -> SmartTieredCacheGetResponse ## Variants Types: ```python -from cloudflare.types.cache import ( - CacheVariant, - VariantDeleteResponse, - VariantEditResponse, - VariantGetResponse, -) +from cloudflare.types.cache import CacheVariant, VariantEditResponse, VariantGetResponse ``` Methods: -- client.cache.variants.delete(\*, zone_id) -> Optional[VariantDeleteResponse] -- client.cache.variants.edit(\*, zone_id, \*\*params) -> Optional[VariantEditResponse] -- client.cache.variants.get(\*, zone_id) -> Optional[VariantGetResponse] +- client.cache.variants.delete(\*, zone_id) -> CacheVariant +- client.cache.variants.edit(\*, zone_id, \*\*params) -> VariantEditResponse +- client.cache.variants.get(\*, zone_id) -> VariantGetResponse ## RegionalTieredCache @@ -721,8 +700,8 @@ from cloudflare.types.cache import ( Methods: -- client.cache.regional_tiered_cache.edit(\*, zone_id, \*\*params) -> Optional[RegionalTieredCacheEditResponse] -- client.cache.regional_tiered_cache.get(\*, zone_id) -> Optional[RegionalTieredCacheGetResponse] +- client.cache.regional_tiered_cache.edit(\*, zone_id, \*\*params) -> RegionalTieredCacheEditResponse +- client.cache.regional_tiered_cache.get(\*, zone_id) -> RegionalTieredCacheGetResponse # SSL @@ -856,8 +835,8 @@ from cloudflare.types.argo import TieredCachingEditResponse, TieredCachingGetRes Methods: -- client.argo.tiered_caching.edit(\*, zone_id, \*\*params) -> Optional[TieredCachingEditResponse] -- client.argo.tiered_caching.get(\*, zone_id) -> Optional[TieredCachingGetResponse] +- client.argo.tiered_caching.edit(\*, zone_id, \*\*params) -> TieredCachingEditResponse +- client.argo.tiered_caching.get(\*, zone_id) -> TieredCachingGetResponse # CertificateAuthorities @@ -1074,8 +1053,6 @@ Types: from cloudflare.types.dns import ( ARecord, AAAARecord, - BatchPatch, - BatchPut, CAARecord, CERTRecord, CNAMERecord, @@ -1088,7 +1065,7 @@ from cloudflare.types.dns import ( NSRecord, PTRRecord, Record, - RecordResponse, + RecordProcessTiming, RecordTags, SMIMEARecord, SRVRecord, @@ -1098,9 +1075,14 @@ from cloudflare.types.dns import ( TTL, TXTRecord, URIRecord, + RecordCreateResponse, + RecordUpdateResponse, + RecordListResponse, RecordDeleteResponse, RecordBatchResponse, + RecordEditResponse, RecordExportResponse, + RecordGetResponse, RecordImportResponse, RecordScanResponse, ) @@ -1108,14 +1090,14 @@ from cloudflare.types.dns import ( Methods: -- client.dns.records.create(\*, zone_id, \*\*params) -> Optional[RecordResponse] -- client.dns.records.update(dns_record_id, \*, zone_id, \*\*params) -> Optional[RecordResponse] -- client.dns.records.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[RecordResponse] +- client.dns.records.create(\*, zone_id, \*\*params) -> Optional[RecordCreateResponse] +- client.dns.records.update(dns_record_id, \*, zone_id, \*\*params) -> Optional[RecordUpdateResponse] +- client.dns.records.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[RecordListResponse] - client.dns.records.delete(dns_record_id, \*, zone_id) -> Optional[RecordDeleteResponse] - client.dns.records.batch(\*, zone_id, \*\*params) -> Optional[RecordBatchResponse] -- client.dns.records.edit(dns_record_id, \*, zone_id, \*\*params) -> Optional[RecordResponse] +- client.dns.records.edit(dns_record_id, \*, zone_id, \*\*params) -> Optional[RecordEditResponse] - client.dns.records.export(\*, zone_id) -> str -- client.dns.records.get(dns_record_id, \*, zone_id) -> Optional[RecordResponse] +- client.dns.records.get(dns_record_id, \*, zone_id) -> Optional[RecordGetResponse] - client.dns.records.import\_(\*, zone_id, \*\*params) -> Optional[RecordImportResponse] - client.dns.records.scan(\*, zone_id, \*\*params) -> Optional[RecordScanResponse] @@ -2291,30 +2273,48 @@ Methods: Types: ```python -from cloudflare.types.workers import MigrationStep, SingleStepMigration, WorkerMetadata +from cloudflare.types.workers import ( + Binding, + D1Binding, + DispatchNamespaceBinding, + DurableObjectBinding, + KVNamespaceBinding, + MigrationStep, + MTLSCERTBinding, + PlacementConfiguration, + R2Binding, + ServiceBinding, + SingleStepMigration, + SteppedMigration, + WorkerMetadata, +) ``` -## Routes +## AI Types: ```python -from cloudflare.types.workers import ( - RouteCreateResponse, - RouteUpdateResponse, - RouteListResponse, - RouteDeleteResponse, - RouteGetResponse, -) +from cloudflare.types.workers import AIRunResponse +``` + +Methods: + +- client.workers.ai.run(model_name, \*, account_id, \*\*params) -> Optional[AIRunResponse] + +### Models + +#### Schema + +Types: + +```python +from cloudflare.types.workers.ai.models import SchemaGetResponse ``` Methods: -- client.workers.routes.create(\*, zone_id, \*\*params) -> RouteCreateResponse -- client.workers.routes.update(route_id, \*, zone_id, \*\*params) -> Optional[RouteUpdateResponse] -- client.workers.routes.list(\*, zone_id) -> SyncSinglePage[RouteListResponse] -- client.workers.routes.delete(route_id, \*, zone_id) -> RouteDeleteResponse -- client.workers.routes.get(route_id, \*, zone_id) -> Optional[RouteGetResponse] +- client.workers.ai.models.schema.get(\*, account_id, \*\*params) -> object ## Assets @@ -2335,7 +2335,7 @@ Methods: Types: ```python -from cloudflare.types.workers import Script, ScriptSetting, ScriptUpdateResponse, ScriptGetResponse +from cloudflare.types.workers import Script, ScriptSetting, ScriptUpdateResponse ``` Methods: @@ -2343,7 +2343,7 @@ Methods: - client.workers.scripts.update(script_name, \*, account_id, \*\*params) -> Optional[ScriptUpdateResponse] - client.workers.scripts.list(\*, account_id) -> SyncSinglePage[Script] - client.workers.scripts.delete(script_name, \*, account_id, \*\*params) -> None -- client.workers.scripts.get(script_name, \*, account_id) -> str +- client.workers.scripts.get(script_name, \*, account_id) -> BinaryAPIResponse ### Assets @@ -2692,7 +2692,6 @@ from cloudflare.types.api_gateway import ( OperationCreateResponse, OperationListResponse, OperationDeleteResponse, - OperationBulkCreateResponse, OperationBulkDeleteResponse, OperationGetResponse, ) @@ -2700,10 +2699,9 @@ from cloudflare.types.api_gateway import ( Methods: -- client.api_gateway.operations.create(\*, zone_id, \*\*params) -> OperationCreateResponse +- client.api_gateway.operations.create(\*, zone_id, \*\*params) -> OperationCreateResponse - client.api_gateway.operations.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[OperationListResponse] - client.api_gateway.operations.delete(operation_id, \*, zone_id) -> OperationDeleteResponse -- client.api_gateway.operations.bulk_create(\*, zone_id, \*\*params) -> OperationBulkCreateResponse - client.api_gateway.operations.bulk_delete(\*, zone_id) -> OperationBulkDeleteResponse - client.api_gateway.operations.get(operation_id, \*, zone_id, \*\*params) -> OperationGetResponse @@ -2818,6 +2816,7 @@ Types: ```python from cloudflare.types.managed_transforms import ( + RequestModel, ManagedTransformListResponse, ManagedTransformEditResponse, ) @@ -2826,7 +2825,6 @@ from cloudflare.types.managed_transforms import ( Methods: - client.managed_transforms.list(\*, zone_id) -> ManagedTransformListResponse -- client.managed_transforms.delete(\*, zone_id) -> None - client.managed_transforms.edit(\*, zone_id, \*\*params) -> ManagedTransformEditResponse # PageShield @@ -3018,7 +3016,6 @@ from cloudflare.types.url_normalization import ( Methods: - client.url_normalization.update(\*, zone_id, \*\*params) -> URLNormalizationUpdateResponse -- client.url_normalization.delete(\*, zone_id) -> None - client.url_normalization.get(\*, zone_id) -> URLNormalizationGetResponse # Spectrum @@ -3218,8 +3215,13 @@ from cloudflare.types.addressing import LOADocumentCreateResponse Methods: -- client.addressing.loa_documents.create(\*, account_id, \*\*params) -> Optional[LOADocumentCreateResponse] -- client.addressing.loa_documents.get(loa_document_id, \*, account_id) -> BinaryAPIResponse +- client.addressing.loa_documents.create(\*, account_id, \*\*params) -> Optional[LOADocumentCreateResponse] + +### Downloads + +Methods: + +- client.addressing.loa_documents.downloads.get(loa_document_id, \*, account_id) -> BinaryAPIResponse ## Prefixes @@ -3237,51 +3239,49 @@ Methods: - client.addressing.prefixes.edit(prefix_id, \*, account_id, \*\*params) -> Optional[Prefix] - client.addressing.prefixes.get(prefix_id, \*, account_id) -> Optional[Prefix] -### ServiceBindings +### BGP + +#### Bindings Types: ```python -from cloudflare.types.addressing.prefixes import ServiceBinding, ServiceBindingDeleteResponse +from cloudflare.types.addressing.prefixes.bgp import ServiceBinding, BindingDeleteResponse ``` Methods: -- client.addressing.prefixes.service_bindings.create(prefix_id, \*, account_id, \*\*params) -> Optional[ServiceBinding] -- client.addressing.prefixes.service_bindings.list(prefix_id, \*, account_id) -> SyncSinglePage[ServiceBinding] -- client.addressing.prefixes.service_bindings.delete(binding_id, \*, account_id, prefix_id) -> ServiceBindingDeleteResponse -- client.addressing.prefixes.service_bindings.get(binding_id, \*, account_id, prefix_id) -> Optional[ServiceBinding] +- client.addressing.prefixes.bgp.bindings.create(prefix_id, \*, account_id, \*\*params) -> Optional[ServiceBinding] +- client.addressing.prefixes.bgp.bindings.list(prefix_id, \*, account_id) -> SyncSinglePage[ServiceBinding] +- client.addressing.prefixes.bgp.bindings.delete(binding_id, \*, account_id, prefix_id) -> BindingDeleteResponse +- client.addressing.prefixes.bgp.bindings.get(binding_id, \*, account_id, prefix_id) -> Optional[ServiceBinding] -### BGPPrefixes +#### Prefixes Types: ```python -from cloudflare.types.addressing.prefixes import BGPPrefix +from cloudflare.types.addressing.prefixes.bgp import BGPPrefix ``` Methods: -- client.addressing.prefixes.bgp_prefixes.create(prefix_id, \*, account_id, \*\*params) -> Optional[BGPPrefix] -- client.addressing.prefixes.bgp_prefixes.list(prefix_id, \*, account_id) -> SyncSinglePage[BGPPrefix] -- client.addressing.prefixes.bgp_prefixes.edit(bgp_prefix_id, \*, account_id, prefix_id, \*\*params) -> Optional[BGPPrefix] -- client.addressing.prefixes.bgp_prefixes.get(bgp_prefix_id, \*, account_id, prefix_id) -> Optional[BGPPrefix] +- client.addressing.prefixes.bgp.prefixes.list(prefix_id, \*, account_id) -> SyncSinglePage[BGPPrefix] +- client.addressing.prefixes.bgp.prefixes.edit(bgp_prefix_id, \*, account_id, prefix_id, \*\*params) -> Optional[BGPPrefix] +- client.addressing.prefixes.bgp.prefixes.get(bgp_prefix_id, \*, account_id, prefix_id) -> Optional[BGPPrefix] -### AdvertisementStatus +#### Statuses Types: ```python -from cloudflare.types.addressing.prefixes import ( - AdvertisementStatusEditResponse, - AdvertisementStatusGetResponse, -) +from cloudflare.types.addressing.prefixes.bgp import StatusEditResponse, StatusGetResponse ``` Methods: -- client.addressing.prefixes.advertisement_status.edit(prefix_id, \*, account_id, \*\*params) -> Optional[AdvertisementStatusEditResponse] -- client.addressing.prefixes.advertisement_status.get(prefix_id, \*, account_id) -> Optional[AdvertisementStatusGetResponse] +- client.addressing.prefixes.bgp.statuses.edit(prefix_id, \*, account_id, \*\*params) -> Optional[StatusEditResponse] +- client.addressing.prefixes.bgp.statuses.get(prefix_id, \*, account_id) -> Optional[StatusGetResponse] ### Delegations @@ -4724,20 +4724,6 @@ Methods: - client.workers_for_platforms.dispatch.namespaces.scripts.delete(script_name, \*, account_id, dispatch_namespace, \*\*params) -> None - client.workers_for_platforms.dispatch.namespaces.scripts.get(script_name, \*, account_id, dispatch_namespace) -> Optional[Script] -##### AssetUpload - -Types: - -```python -from cloudflare.types.workers_for_platforms.dispatch.namespaces.scripts import ( - AssetUploadCreateResponse, -) -``` - -Methods: - -- client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.create(script_name, \*, account_id, dispatch_namespace, \*\*params) -> Optional[AssetUploadCreateResponse] - ##### Content Methods: @@ -4823,7 +4809,7 @@ from cloudflare.types.zero_trust import Device, DeviceGetResponse Methods: - client.zero_trust.devices.list(\*, account_id) -> SyncSinglePage[Device] -- client.zero_trust.devices.get(device_id, \*, account_id) -> Optional[DeviceGetResponse] +- client.zero_trust.devices.get(device_id, \*, account_id) -> DeviceGetResponse ### DEXTests @@ -4872,7 +4858,7 @@ from cloudflare.types.zero_trust.devices import FleetStatusGetResponse Methods: -- client.zero_trust.devices.fleet_status.get(device_id, \*, account_id, \*\*params) -> FleetStatusGetResponse +- client.zero_trust.devices.fleet_status.get(device_id, \*, account_id, \*\*params) -> FleetStatusGetResponse ### Policies @@ -4963,8 +4949,8 @@ from cloudflare.types.zero_trust.devices.policies.default import ( Methods: -- client.zero_trust.devices.policies.default.certificates.edit(\*, zone_id, \*\*params) -> Optional[CertificateEditResponse] -- client.zero_trust.devices.policies.default.certificates.get(\*, zone_id) -> Optional[CertificateGetResponse] +- client.zero_trust.devices.policies.default.certificates.edit(\*, zone_id, \*\*params) -> CertificateEditResponse +- client.zero_trust.devices.policies.default.certificates.get(\*, zone_id) -> CertificateGetResponse #### Custom @@ -5078,7 +5064,7 @@ Methods: - client.zero_trust.devices.posture.integrations.create(\*, account_id, \*\*params) -> Optional[Integration] - client.zero_trust.devices.posture.integrations.list(\*, account_id) -> SyncSinglePage[Integration] -- client.zero_trust.devices.posture.integrations.delete(integration_id, \*, account_id) -> Optional[IntegrationDeleteResponse] +- client.zero_trust.devices.posture.integrations.delete(integration_id, \*, account_id) -> IntegrationDeleteResponse - client.zero_trust.devices.posture.integrations.edit(integration_id, \*, account_id, \*\*params) -> Optional[Integration] - client.zero_trust.devices.posture.integrations.get(integration_id, \*, account_id) -> Optional[Integration] @@ -5092,7 +5078,7 @@ from cloudflare.types.zero_trust.devices import RevokeCreateResponse Methods: -- client.zero_trust.devices.revoke.create(\*, account_id, \*\*params) -> Optional[RevokeCreateResponse] +- client.zero_trust.devices.revoke.create(\*, account_id, \*\*params) -> RevokeCreateResponse ### Settings @@ -5118,7 +5104,7 @@ from cloudflare.types.zero_trust.devices import UnrevokeCreateResponse Methods: -- client.zero_trust.devices.unrevoke.create(\*, account_id, \*\*params) -> Optional[UnrevokeCreateResponse] +- client.zero_trust.devices.unrevoke.create(\*, account_id, \*\*params) -> UnrevokeCreateResponse ### OverrideCodes @@ -5225,24 +5211,6 @@ from cloudflare.types.zero_trust import ( ) ``` -### GatewayCA - -Types: - -```python -from cloudflare.types.zero_trust.access import ( - GatewayCACreateResponse, - GatewayCAListResponse, - GatewayCADeleteResponse, -) -``` - -Methods: - -- client.zero_trust.access.gateway_ca.create(\*, account_id) -> Optional[GatewayCACreateResponse] -- client.zero_trust.access.gateway_ca.list(\*, account_id) -> SyncSinglePage[GatewayCAListResponse] -- client.zero_trust.access.gateway_ca.delete(certificate_id, \*, account_id) -> Optional[GatewayCADeleteResponse] - ### Infrastructure #### Targets @@ -5646,38 +5614,14 @@ from cloudflare.types.zero_trust.dex import CommandCreateResponse, CommandListRe Methods: -- client.zero_trust.dex.commands.create(\*, account_id, \*\*params) -> Optional[CommandCreateResponse] -- client.zero_trust.dex.commands.list(\*, account_id, \*\*params) -> SyncV4PagePagination[Optional[CommandListResponse]] - -#### Users - -Types: - -```python -from cloudflare.types.zero_trust.dex.commands import UserListResponse -``` - -Methods: - -- client.zero_trust.dex.commands.users.list(\*, account_id, \*\*params) -> Optional[UserListResponse] - -#### Devices - -Types: - -```python -from cloudflare.types.zero_trust.dex.commands import DeviceListResponse -``` - -Methods: - -- client.zero_trust.dex.commands.devices.list(\*, account_id, \*\*params) -> SyncV4PagePagination[Optional[DeviceListResponse]] +- client.zero_trust.dex.commands.create(\*, account_id, \*\*params) -> Optional[CommandCreateResponse] +- client.zero_trust.dex.commands.list(\*, account_id, \*\*params) -> SyncV4PagePagination[Optional[CommandListResponse]] #### Downloads Methods: -- client.zero_trust.dex.commands.downloads.get(filename, \*, account_id, command_id) -> BinaryAPIResponse +- client.zero_trust.dex.commands.downloads.get(filename, \*, account_id, command_id) -> BinaryAPIResponse #### Quota @@ -5689,7 +5633,7 @@ from cloudflare.types.zero_trust.dex.commands import QuotaGetResponse Methods: -- client.zero_trust.dex.commands.quota.get(\*, account_id) -> Optional[QuotaGetResponse] +- client.zero_trust.dex.commands.quota.get(\*, account_id) -> Optional[QuotaGetResponse] ### Colos @@ -6010,48 +5954,6 @@ Methods: - client.zero_trust.dlp.payload_logs.update(\*, account_id, \*\*params) -> Optional[PayloadLogUpdateResponse] - client.zero_trust.dlp.payload_logs.get(\*, account_id) -> Optional[PayloadLogGetResponse] -### Email - -#### AccountMapping - -Types: - -```python -from cloudflare.types.zero_trust.dlp.email import ( - AccountMappingCreateResponse, - AccountMappingGetResponse, -) -``` - -Methods: - -- client.zero_trust.dlp.email.account_mapping.create(\*, account_id, \*\*params) -> Optional[AccountMappingCreateResponse] -- client.zero_trust.dlp.email.account_mapping.get(\*, account_id) -> Optional[AccountMappingGetResponse] - -#### Rules - -Types: - -```python -from cloudflare.types.zero_trust.dlp.email import ( - RuleCreateResponse, - RuleUpdateResponse, - RuleListResponse, - RuleDeleteResponse, - RuleBulkEditResponse, - RuleGetResponse, -) -``` - -Methods: - -- client.zero_trust.dlp.email.rules.create(\*, account_id, \*\*params) -> Optional[RuleCreateResponse] -- client.zero_trust.dlp.email.rules.update(rule_id, \*, account_id, \*\*params) -> Optional[RuleUpdateResponse] -- client.zero_trust.dlp.email.rules.list(\*, account_id) -> SyncSinglePage[RuleListResponse] -- client.zero_trust.dlp.email.rules.delete(rule_id, \*, account_id) -> Optional[RuleDeleteResponse] -- client.zero_trust.dlp.email.rules.bulk_edit(\*, account_id, \*\*params) -> Optional[RuleBulkEditResponse] -- client.zero_trust.dlp.email.rules.get(rule_id, \*, account_id) -> Optional[RuleGetResponse] - ### Profiles Types: @@ -6593,7 +6495,7 @@ Methods: - client.vectorize.indexes.create(\*, account_id, \*\*params) -> Optional[CreateIndex] - client.vectorize.indexes.list(\*, account_id) -> SyncSinglePage[CreateIndex] -- client.vectorize.indexes.delete(index_name, \*, account_id) -> Optional[IndexDeleteResponse] +- client.vectorize.indexes.delete(index_name, \*, account_id) -> IndexDeleteResponse - client.vectorize.indexes.delete_by_ids(index_name, \*, account_id, \*\*params) -> Optional[IndexDeleteByIDsResponse] - client.vectorize.indexes.get(index_name, \*, account_id) -> Optional[CreateIndex] - client.vectorize.indexes.get_by_ids(index_name, \*, account_id, \*\*params) -> object @@ -6638,7 +6540,7 @@ from cloudflare.types.url_scanner import ResponseGetResponse Methods: -- client.url_scanner.responses.get(response_id, \*, account_id) -> str +- client.url_scanner.responses.get(response_id, \*, account_id) -> str ## Scans @@ -6657,13 +6559,13 @@ from cloudflare.types.url_scanner import ( Methods: -- client.url_scanner.scans.create(\*, account_id, \*\*params) -> str -- client.url_scanner.scans.list(\*, account_id, \*\*params) -> ScanListResponse -- client.url_scanner.scans.bulk_create(\*, account_id, \*\*params) -> ScanBulkCreateResponse -- client.url_scanner.scans.dom(scan_id, \*, account_id) -> str -- client.url_scanner.scans.get(scan_id, \*, account_id) -> ScanGetResponse -- client.url_scanner.scans.har(scan_id, \*, account_id) -> ScanHARResponse -- client.url_scanner.scans.screenshot(scan_id, \*, account_id, \*\*params) -> BinaryAPIResponse +- client.url_scanner.scans.create(account_id, \*\*params) -> str +- client.url_scanner.scans.list(account_id, \*\*params) -> ScanListResponse +- client.url_scanner.scans.bulk_create(account_id, \*\*params) -> ScanBulkCreateResponse +- client.url_scanner.scans.dom(scan_id, \*, account_id) -> str +- client.url_scanner.scans.get(scan_id, \*, account_id) -> ScanGetResponse +- client.url_scanner.scans.har(scan_id, \*, account_id) -> ScanHARResponse +- client.url_scanner.scans.screenshot(scan_id, \*, account_id, \*\*params) -> BinaryAPIResponse # Radar @@ -7838,8 +7740,8 @@ from cloudflare.types.origin_post_quantum_encryption import ( Methods: -- client.origin_post_quantum_encryption.update(\*, zone_id, \*\*params) -> Optional[OriginPostQuantumEncryptionUpdateResponse] -- client.origin_post_quantum_encryption.get(\*, zone_id) -> Optional[OriginPostQuantumEncryptionGetResponse] +- client.origin_post_quantum_encryption.update(\*, zone_id, \*\*params) -> OriginPostQuantumEncryptionUpdateResponse +- client.origin_post_quantum_encryption.get(\*, zone_id) -> OriginPostQuantumEncryptionGetResponse # Speed @@ -8513,112 +8415,3 @@ from cloudflare.types.content_scanning import SettingGetResponse Methods: - client.content_scanning.settings.get(\*, zone_id) -> SettingGetResponse - -# AbuseReports - -Types: - -```python -from cloudflare.types.abuse_reports import AbuseReportCreateResponse -``` - -Methods: - -- client.abuse_reports.create(report_type, \*, account_id, \*\*params) -> str - -# AI - -Types: - -```python -from cloudflare.types.ai import AIRunResponse -``` - -Methods: - -- client.ai.run(model_name, \*, account_id, \*\*params) -> Optional[AIRunResponse] - -## Finetunes - -Types: - -```python -from cloudflare.types.ai import FinetuneCreateResponse, FinetuneListResponse -``` - -Methods: - -- client.ai.finetunes.create(\*, account_id, \*\*params) -> FinetuneCreateResponse -- client.ai.finetunes.list(\*, account_id) -> FinetuneListResponse - -### Assets - -Types: - -```python -from cloudflare.types.ai.finetunes import AssetCreateResponse -``` - -Methods: - -- client.ai.finetunes.assets.create(finetune_id, \*, account_id, \*\*params) -> AssetCreateResponse - -### Public - -Types: - -```python -from cloudflare.types.ai.finetunes import PublicListResponse -``` - -Methods: - -- client.ai.finetunes.public.list(\*, account_id, \*\*params) -> SyncSinglePage[PublicListResponse] - -## Authors - -Types: - -```python -from cloudflare.types.ai import AuthorListResponse -``` - -Methods: - -- client.ai.authors.list(\*, account_id) -> SyncSinglePage[object] - -## Tasks - -Types: - -```python -from cloudflare.types.ai import TaskListResponse -``` - -Methods: - -- client.ai.tasks.list(\*, account_id) -> SyncSinglePage[object] - -## Models - -Types: - -```python -from cloudflare.types.ai import ModelListResponse -``` - -Methods: - -- client.ai.models.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[object] - -### Schema - -Types: - -```python -from cloudflare.types.ai.models import SchemaGetResponse -``` - -Methods: - -- client.ai.models.schema.get(\*, account_id, \*\*params) -> object diff --git a/src/cloudflare/_client.py b/src/cloudflare/_client.py index f48b5ae2359..c3804a44877 100644 --- a/src/cloudflare/_client.py +++ b/src/cloudflare/_client.py @@ -36,7 +36,6 @@ if TYPE_CHECKING: from .resources import ( - ai, d1, kv, r2, @@ -92,7 +91,6 @@ dns_firewall, healthchecks, security_txt, - abuse_reports, email_routing, magic_transit, waiting_rooms, @@ -124,7 +122,6 @@ origin_post_quantum_encryption, ) from .resources.ips import IPsResource, AsyncIPsResource - from .resources.ai.ai import AIResource, AsyncAIResource from .resources.d1.d1 import D1Resource, AsyncD1Resource from .resources.kv.kv import KVResource, AsyncKVResource from .resources.r2.r2 import R2Resource, AsyncR2Resource @@ -151,7 +148,6 @@ from .resources.speed.speed import SpeedResource, AsyncSpeedResource from .resources.zones.zones import ZonesResource, AsyncZonesResource from .resources.security_txt import SecurityTXTResource, AsyncSecurityTXTResource - from .resources.abuse_reports import AbuseReportsResource, AsyncAbuseReportsResource from .resources.images.images import ImagesResource, AsyncImagesResource from .resources.queues.queues import QueuesResource, AsyncQueuesResource from .resources.stream.stream import StreamResource, AsyncStreamResource @@ -820,18 +816,6 @@ def content_scanning(self) -> ContentScanningResource: return ContentScanningResource(self) - @cached_property - def abuse_reports(self) -> AbuseReportsResource: - from .resources.abuse_reports import AbuseReportsResource - - return AbuseReportsResource(self) - - @cached_property - def ai(self) -> AIResource: - from .resources.ai import AIResource - - return AIResource(self) - @cached_property def with_raw_response(self) -> CloudflareWithRawResponse: return CloudflareWithRawResponse(self) @@ -1591,18 +1575,6 @@ def content_scanning(self) -> AsyncContentScanningResource: return AsyncContentScanningResource(self) - @cached_property - def abuse_reports(self) -> AsyncAbuseReportsResource: - from .resources.abuse_reports import AsyncAbuseReportsResource - - return AsyncAbuseReportsResource(self) - - @cached_property - def ai(self) -> AsyncAIResource: - from .resources.ai import AsyncAIResource - - return AsyncAIResource(self) - @cached_property def with_raw_response(self) -> AsyncCloudflareWithRawResponse: return AsyncCloudflareWithRawResponse(self) @@ -2297,18 +2269,6 @@ def content_scanning(self) -> content_scanning.ContentScanningResourceWithRawRes return ContentScanningResourceWithRawResponse(self._client.content_scanning) - @cached_property - def abuse_reports(self) -> abuse_reports.AbuseReportsResourceWithRawResponse: - from .resources.abuse_reports import AbuseReportsResourceWithRawResponse - - return AbuseReportsResourceWithRawResponse(self._client.abuse_reports) - - @cached_property - def ai(self) -> ai.AIResourceWithRawResponse: - from .resources.ai import AIResourceWithRawResponse - - return AIResourceWithRawResponse(self._client.ai) - class AsyncCloudflareWithRawResponse: _client: AsyncCloudflare @@ -2822,18 +2782,6 @@ def content_scanning(self) -> content_scanning.AsyncContentScanningResourceWithR return AsyncContentScanningResourceWithRawResponse(self._client.content_scanning) - @cached_property - def abuse_reports(self) -> abuse_reports.AsyncAbuseReportsResourceWithRawResponse: - from .resources.abuse_reports import AsyncAbuseReportsResourceWithRawResponse - - return AsyncAbuseReportsResourceWithRawResponse(self._client.abuse_reports) - - @cached_property - def ai(self) -> ai.AsyncAIResourceWithRawResponse: - from .resources.ai import AsyncAIResourceWithRawResponse - - return AsyncAIResourceWithRawResponse(self._client.ai) - class CloudflareWithStreamedResponse: _client: Cloudflare @@ -3347,18 +3295,6 @@ def content_scanning(self) -> content_scanning.ContentScanningResourceWithStream return ContentScanningResourceWithStreamingResponse(self._client.content_scanning) - @cached_property - def abuse_reports(self) -> abuse_reports.AbuseReportsResourceWithStreamingResponse: - from .resources.abuse_reports import AbuseReportsResourceWithStreamingResponse - - return AbuseReportsResourceWithStreamingResponse(self._client.abuse_reports) - - @cached_property - def ai(self) -> ai.AIResourceWithStreamingResponse: - from .resources.ai import AIResourceWithStreamingResponse - - return AIResourceWithStreamingResponse(self._client.ai) - class AsyncCloudflareWithStreamedResponse: _client: AsyncCloudflare @@ -3882,18 +3818,6 @@ def content_scanning(self) -> content_scanning.AsyncContentScanningResourceWithS return AsyncContentScanningResourceWithStreamingResponse(self._client.content_scanning) - @cached_property - def abuse_reports(self) -> abuse_reports.AsyncAbuseReportsResourceWithStreamingResponse: - from .resources.abuse_reports import AsyncAbuseReportsResourceWithStreamingResponse - - return AsyncAbuseReportsResourceWithStreamingResponse(self._client.abuse_reports) - - @cached_property - def ai(self) -> ai.AsyncAIResourceWithStreamingResponse: - from .resources.ai import AsyncAIResourceWithStreamingResponse - - return AsyncAIResourceWithStreamingResponse(self._client.ai) - Client = Cloudflare diff --git a/src/cloudflare/resources/abuse_reports.py b/src/cloudflare/resources/abuse_reports.py deleted file mode 100644 index a81ce3c43a6..00000000000 --- a/src/cloudflare/resources/abuse_reports.py +++ /dev/null @@ -1,492 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Type, cast -from typing_extensions import Literal - -import httpx - -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( - maybe_transform, - async_maybe_transform, -) -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from .._wrappers import ResultWrapper -from .._base_client import make_request_options -from ..types.abuse_reports import abuse_report_create_params -from ..types.abuse_reports.abuse_report_create_response import AbuseReportCreateResponse - -__all__ = ["AbuseReportsResource", "AsyncAbuseReportsResource"] - - -class AbuseReportsResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> AbuseReportsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AbuseReportsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AbuseReportsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AbuseReportsResourceWithStreamingResponse(self) - - def create( - self, - report_type: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], - *, - account_id: str, - act: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], - email: str, - email2: str, - host_notification: Literal["send", "send-anon", "none"], - ncmec_notification: Literal["send", "send-anon", "none"], - owner_notification: Literal["send", "send-anon", "none"], - urls: str, - address1: str | NotGiven = NOT_GIVEN, - agent_name: str | NotGiven = NOT_GIVEN, - agree: Literal[0, 1] | NotGiven = NOT_GIVEN, - city: str | NotGiven = NOT_GIVEN, - comments: str | NotGiven = NOT_GIVEN, - company: str | NotGiven = NOT_GIVEN, - country: str | NotGiven = NOT_GIVEN, - destination_ips: str | NotGiven = NOT_GIVEN, - justification: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - ncsei_subject_representation: bool | NotGiven = NOT_GIVEN, - original_work: str | NotGiven = NOT_GIVEN, - ports_protocols: str | NotGiven = NOT_GIVEN, - signature: str | NotGiven = NOT_GIVEN, - source_ips: str | NotGiven = NOT_GIVEN, - state: str | NotGiven = NOT_GIVEN, - tele: str | NotGiven = NOT_GIVEN, - title: str | NotGiven = NOT_GIVEN, - trademark_number: str | NotGiven = NOT_GIVEN, - trademark_office: str | NotGiven = NOT_GIVEN, - trademark_symbol: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Submit the Abuse Report of a particular type - - Args: - report_type: The abuse report type - - act: The abuse report type - - email: A valid email of the abuse reporter - - email2: Should match the value provided in `email` - - host_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - ncmec_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - owner_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - urls: A list of valid URLs separated by ‘ ’ (new line character). The list of the URLs - should not exceed 250 URLs. All URLs should have the same hostname. Each URL - should be unique - - address1: Text not exceeding 100 characters - - agent_name: The name of the copyright holder. Text not exceeding 60 characters. - - agree: Can be 0 or 1 - - city: Text not exceeding 255 characters - - comments: Any additional comments about the infringement not exceeding 2000 characters - - company: Text not exceeding 100 characters - - country: Text not exceeding 255 characters - - destination_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of - destination IPs should not exceed 30 IP addresses. Each one of the IP addresses - ought to be unique - - justification: A detailed description of the infringement, including any necessary access - details and the exact steps needed to view the content, not exceeding 5000 - characters - - name: Text not exceeding 255 characters - - ncsei_subject_representation: If the submitter is the target of NCSEI in the URLs of the abuse report - - original_work: Text not exceeding 255 characters - - ports_protocols: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. The total - size of the field should not exceed 2000 characters. Each individual - port/protocol should not exceed 100 characters. The list should not have more - than 30 unique ports and protocols. - - signature: Required for DMCA reports, should be same as Name. An affirmation that all - information in the report is true and accurate while agreeing to the policies of - Cloudflare's abuse reports - - source_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of source - IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be - unique - - state: Text not exceeding 255 characters - - tele: Text not exceeding 20 characters - - title: Text not exceeding 255 characters - - trademark_number: Text not exceeding 1000 characters - - trademark_office: Text not exceeding 1000 characters - - trademark_symbol: Text not exceeding 1000 characters - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not report_type: - raise ValueError(f"Expected a non-empty value for `report_type` but received {report_type!r}") - return self._post( - f"/accounts/{account_id}/abuse-reports/{report_type}", - body=maybe_transform( - { - "act": act, - "email": email, - "email2": email2, - "host_notification": host_notification, - "ncmec_notification": ncmec_notification, - "owner_notification": owner_notification, - "urls": urls, - "address1": address1, - "agent_name": agent_name, - "agree": agree, - "city": city, - "comments": comments, - "company": company, - "country": country, - "destination_ips": destination_ips, - "justification": justification, - "name": name, - "ncsei_subject_representation": ncsei_subject_representation, - "original_work": original_work, - "ports_protocols": ports_protocols, - "signature": signature, - "source_ips": source_ips, - "state": state, - "tele": tele, - "title": title, - "trademark_number": trademark_number, - "trademark_office": trademark_office, - "trademark_symbol": trademark_symbol, - }, - abuse_report_create_params.AbuseReportCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[AbuseReportCreateResponse]._unwrapper, - ), - cast_to=cast(Type[str], ResultWrapper[str]), - ) - - -class AsyncAbuseReportsResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncAbuseReportsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncAbuseReportsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncAbuseReportsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncAbuseReportsResourceWithStreamingResponse(self) - - async def create( - self, - report_type: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], - *, - account_id: str, - act: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], - email: str, - email2: str, - host_notification: Literal["send", "send-anon", "none"], - ncmec_notification: Literal["send", "send-anon", "none"], - owner_notification: Literal["send", "send-anon", "none"], - urls: str, - address1: str | NotGiven = NOT_GIVEN, - agent_name: str | NotGiven = NOT_GIVEN, - agree: Literal[0, 1] | NotGiven = NOT_GIVEN, - city: str | NotGiven = NOT_GIVEN, - comments: str | NotGiven = NOT_GIVEN, - company: str | NotGiven = NOT_GIVEN, - country: str | NotGiven = NOT_GIVEN, - destination_ips: str | NotGiven = NOT_GIVEN, - justification: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - ncsei_subject_representation: bool | NotGiven = NOT_GIVEN, - original_work: str | NotGiven = NOT_GIVEN, - ports_protocols: str | NotGiven = NOT_GIVEN, - signature: str | NotGiven = NOT_GIVEN, - source_ips: str | NotGiven = NOT_GIVEN, - state: str | NotGiven = NOT_GIVEN, - tele: str | NotGiven = NOT_GIVEN, - title: str | NotGiven = NOT_GIVEN, - trademark_number: str | NotGiven = NOT_GIVEN, - trademark_office: str | NotGiven = NOT_GIVEN, - trademark_symbol: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Submit the Abuse Report of a particular type - - Args: - report_type: The abuse report type - - act: The abuse report type - - email: A valid email of the abuse reporter - - email2: Should match the value provided in `email` - - host_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - ncmec_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - owner_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - urls: A list of valid URLs separated by ‘ ’ (new line character). The list of the URLs - should not exceed 250 URLs. All URLs should have the same hostname. Each URL - should be unique - - address1: Text not exceeding 100 characters - - agent_name: The name of the copyright holder. Text not exceeding 60 characters. - - agree: Can be 0 or 1 - - city: Text not exceeding 255 characters - - comments: Any additional comments about the infringement not exceeding 2000 characters - - company: Text not exceeding 100 characters - - country: Text not exceeding 255 characters - - destination_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of - destination IPs should not exceed 30 IP addresses. Each one of the IP addresses - ought to be unique - - justification: A detailed description of the infringement, including any necessary access - details and the exact steps needed to view the content, not exceeding 5000 - characters - - name: Text not exceeding 255 characters - - ncsei_subject_representation: If the submitter is the target of NCSEI in the URLs of the abuse report - - original_work: Text not exceeding 255 characters - - ports_protocols: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. The total - size of the field should not exceed 2000 characters. Each individual - port/protocol should not exceed 100 characters. The list should not have more - than 30 unique ports and protocols. - - signature: Required for DMCA reports, should be same as Name. An affirmation that all - information in the report is true and accurate while agreeing to the policies of - Cloudflare's abuse reports - - source_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of source - IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be - unique - - state: Text not exceeding 255 characters - - tele: Text not exceeding 20 characters - - title: Text not exceeding 255 characters - - trademark_number: Text not exceeding 1000 characters - - trademark_office: Text not exceeding 1000 characters - - trademark_symbol: Text not exceeding 1000 characters - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not report_type: - raise ValueError(f"Expected a non-empty value for `report_type` but received {report_type!r}") - return await self._post( - f"/accounts/{account_id}/abuse-reports/{report_type}", - body=await async_maybe_transform( - { - "act": act, - "email": email, - "email2": email2, - "host_notification": host_notification, - "ncmec_notification": ncmec_notification, - "owner_notification": owner_notification, - "urls": urls, - "address1": address1, - "agent_name": agent_name, - "agree": agree, - "city": city, - "comments": comments, - "company": company, - "country": country, - "destination_ips": destination_ips, - "justification": justification, - "name": name, - "ncsei_subject_representation": ncsei_subject_representation, - "original_work": original_work, - "ports_protocols": ports_protocols, - "signature": signature, - "source_ips": source_ips, - "state": state, - "tele": tele, - "title": title, - "trademark_number": trademark_number, - "trademark_office": trademark_office, - "trademark_symbol": trademark_symbol, - }, - abuse_report_create_params.AbuseReportCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[AbuseReportCreateResponse]._unwrapper, - ), - cast_to=cast(Type[str], ResultWrapper[str]), - ) - - -class AbuseReportsResourceWithRawResponse: - def __init__(self, abuse_reports: AbuseReportsResource) -> None: - self._abuse_reports = abuse_reports - - self.create = to_raw_response_wrapper( - abuse_reports.create, - ) - - -class AsyncAbuseReportsResourceWithRawResponse: - def __init__(self, abuse_reports: AsyncAbuseReportsResource) -> None: - self._abuse_reports = abuse_reports - - self.create = async_to_raw_response_wrapper( - abuse_reports.create, - ) - - -class AbuseReportsResourceWithStreamingResponse: - def __init__(self, abuse_reports: AbuseReportsResource) -> None: - self._abuse_reports = abuse_reports - - self.create = to_streamed_response_wrapper( - abuse_reports.create, - ) - - -class AsyncAbuseReportsResourceWithStreamingResponse: - def __init__(self, abuse_reports: AsyncAbuseReportsResource) -> None: - self._abuse_reports = abuse_reports - - self.create = async_to_streamed_response_wrapper( - abuse_reports.create, - ) diff --git a/src/cloudflare/resources/accounts/__init__.py b/src/cloudflare/resources/accounts/__init__.py index f136ec47000..f91d884a2b2 100644 --- a/src/cloudflare/resources/accounts/__init__.py +++ b/src/cloudflare/resources/accounts/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .logs import ( - LogsResource, - AsyncLogsResource, - LogsResourceWithRawResponse, - AsyncLogsResourceWithRawResponse, - LogsResourceWithStreamingResponse, - AsyncLogsResourceWithStreamingResponse, -) from .roles import ( RolesResource, AsyncRolesResource, @@ -74,12 +66,6 @@ "AsyncTokensResourceWithRawResponse", "TokensResourceWithStreamingResponse", "AsyncTokensResourceWithStreamingResponse", - "LogsResource", - "AsyncLogsResource", - "LogsResourceWithRawResponse", - "AsyncLogsResourceWithRawResponse", - "LogsResourceWithStreamingResponse", - "AsyncLogsResourceWithStreamingResponse", "AccountsResource", "AsyncAccountsResource", "AccountsResourceWithRawResponse", diff --git a/src/cloudflare/resources/accounts/accounts.py b/src/cloudflare/resources/accounts/accounts.py index eba792cbcc5..e6e9d0721a4 100644 --- a/src/cloudflare/resources/accounts/accounts.py +++ b/src/cloudflare/resources/accounts/accounts.py @@ -29,14 +29,6 @@ async_maybe_transform, ) from ..._compat import cached_property -from .logs.logs import ( - LogsResource, - AsyncLogsResource, - LogsResourceWithRawResponse, - AsyncLogsResourceWithRawResponse, - LogsResourceWithStreamingResponse, - AsyncLogsResourceWithStreamingResponse, -) from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( to_raw_response_wrapper, @@ -87,10 +79,6 @@ def subscriptions(self) -> SubscriptionsResource: def tokens(self) -> TokensResource: return TokensResource(self._client) - @cached_property - def logs(self) -> LogsResource: - return LogsResource(self._client) - @cached_property def with_raw_response(self) -> AccountsResourceWithRawResponse: """ @@ -370,10 +358,6 @@ def subscriptions(self) -> AsyncSubscriptionsResource: def tokens(self) -> AsyncTokensResource: return AsyncTokensResource(self._client) - @cached_property - def logs(self) -> AsyncLogsResource: - return AsyncLogsResource(self._client) - @cached_property def with_raw_response(self) -> AsyncAccountsResourceWithRawResponse: """ @@ -672,10 +656,6 @@ def subscriptions(self) -> SubscriptionsResourceWithRawResponse: def tokens(self) -> TokensResourceWithRawResponse: return TokensResourceWithRawResponse(self._accounts.tokens) - @cached_property - def logs(self) -> LogsResourceWithRawResponse: - return LogsResourceWithRawResponse(self._accounts.logs) - class AsyncAccountsResourceWithRawResponse: def __init__(self, accounts: AsyncAccountsResource) -> None: @@ -713,10 +693,6 @@ def subscriptions(self) -> AsyncSubscriptionsResourceWithRawResponse: def tokens(self) -> AsyncTokensResourceWithRawResponse: return AsyncTokensResourceWithRawResponse(self._accounts.tokens) - @cached_property - def logs(self) -> AsyncLogsResourceWithRawResponse: - return AsyncLogsResourceWithRawResponse(self._accounts.logs) - class AccountsResourceWithStreamingResponse: def __init__(self, accounts: AccountsResource) -> None: @@ -754,10 +730,6 @@ def subscriptions(self) -> SubscriptionsResourceWithStreamingResponse: def tokens(self) -> TokensResourceWithStreamingResponse: return TokensResourceWithStreamingResponse(self._accounts.tokens) - @cached_property - def logs(self) -> LogsResourceWithStreamingResponse: - return LogsResourceWithStreamingResponse(self._accounts.logs) - class AsyncAccountsResourceWithStreamingResponse: def __init__(self, accounts: AsyncAccountsResource) -> None: @@ -794,7 +766,3 @@ def subscriptions(self) -> AsyncSubscriptionsResourceWithStreamingResponse: @cached_property def tokens(self) -> AsyncTokensResourceWithStreamingResponse: return AsyncTokensResourceWithStreamingResponse(self._accounts.tokens) - - @cached_property - def logs(self) -> AsyncLogsResourceWithStreamingResponse: - return AsyncLogsResourceWithStreamingResponse(self._accounts.logs) diff --git a/src/cloudflare/resources/accounts/logs/__init__.py b/src/cloudflare/resources/accounts/logs/__init__.py deleted file mode 100644 index 5d5ddcdb7e2..00000000000 --- a/src/cloudflare/resources/accounts/logs/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from .logs import ( - LogsResource, - AsyncLogsResource, - LogsResourceWithRawResponse, - AsyncLogsResourceWithRawResponse, - LogsResourceWithStreamingResponse, - AsyncLogsResourceWithStreamingResponse, -) -from .audit import ( - AuditResource, - AsyncAuditResource, - AuditResourceWithRawResponse, - AsyncAuditResourceWithRawResponse, - AuditResourceWithStreamingResponse, - AsyncAuditResourceWithStreamingResponse, -) - -__all__ = [ - "AuditResource", - "AsyncAuditResource", - "AuditResourceWithRawResponse", - "AsyncAuditResourceWithRawResponse", - "AuditResourceWithStreamingResponse", - "AsyncAuditResourceWithStreamingResponse", - "LogsResource", - "AsyncLogsResource", - "LogsResourceWithRawResponse", - "AsyncLogsResourceWithRawResponse", - "LogsResourceWithStreamingResponse", - "AsyncLogsResourceWithStreamingResponse", -] diff --git a/src/cloudflare/resources/accounts/logs/audit.py b/src/cloudflare/resources/accounts/logs/audit.py deleted file mode 100644 index 7375f4199ec..00000000000 --- a/src/cloudflare/resources/accounts/logs/audit.py +++ /dev/null @@ -1,426 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from datetime import date -from typing_extensions import Literal - -import httpx - -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import maybe_transform -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ....pagination import SyncCursorLimitPagination, AsyncCursorLimitPagination -from ...._base_client import AsyncPaginator, make_request_options -from ....types.accounts.logs import audit_list_params -from ....types.accounts.logs.audit_list_response import AuditListResponse - -__all__ = ["AuditResource", "AsyncAuditResource"] - - -class AuditResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> AuditResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AuditResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AuditResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AuditResourceWithStreamingResponse(self) - - def list( - self, - *, - account_id: str, - before: Union[str, date], - since: Union[str, date], - account_name: str | NotGiven = NOT_GIVEN, - action_result: Literal["success", "failure"] | NotGiven = NOT_GIVEN, - action_type: Literal["create", "delete", "view", "update"] | NotGiven = NOT_GIVEN, - actor_context: Literal["api_key", "api_token", "dash", "oauth", "origin_ca_key"] | NotGiven = NOT_GIVEN, - actor_email: str | NotGiven = NOT_GIVEN, - actor_id: str | NotGiven = NOT_GIVEN, - actor_ip_address: str | NotGiven = NOT_GIVEN, - actor_token_id: str | NotGiven = NOT_GIVEN, - actor_token_name: str | NotGiven = NOT_GIVEN, - actor_type: Literal["cloudflare_admin", "account", "user"] | NotGiven = NOT_GIVEN, - audit_log_id: str | NotGiven = NOT_GIVEN, - cursor: str | NotGiven = NOT_GIVEN, - direction: Literal["desc", "asc"] | NotGiven = NOT_GIVEN, - limit: float | NotGiven = NOT_GIVEN, - raw_cf_rayid: str | NotGiven = NOT_GIVEN, - raw_method: str | NotGiven = NOT_GIVEN, - raw_status_code: int | NotGiven = NOT_GIVEN, - raw_uri: str | NotGiven = NOT_GIVEN, - resource_id: str | NotGiven = NOT_GIVEN, - resource_product: str | NotGiven = NOT_GIVEN, - resource_scope: Literal["accounts", "user", "zones"] | NotGiven = NOT_GIVEN, - resource_type: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - zone_name: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncCursorLimitPagination[AuditListResponse]: - """Gets a list of audit logs for an account. - -

This is the beta release - of Audit Logs Version 2. Since this is a beta version, there may be gaps or - missing entries in the available audit logs. Be aware of the following - limitations.
- - Args: - account_id: The unique id that identifies the account. - - before: Filters actions based on a given timestamp in the format yyyy-mm-dd, returning - only logs that occurred on and before the specified date. - - since: Filters actions based on a given timestamp in the format yyyy-mm-dd, returning - only logs that occurred on and after the specified date. - - account_name: Filters by the account name. - - action_result: Whether the action was successful or not. - - action_type: Filters by the action type. - - actor_context: Filters by the actor context. - - actor_email: Filters by the actor's email address. - - actor_id: Filters by the actor ID. This can be either the Account ID or User ID. - - actor_ip_address: The IP address where the action was initiated. - - actor_token_id: Filters by the API token ID when the actor context is an api_token or oauth. - - actor_token_name: Filters by the API token name when the actor context is an api_token or oauth. - - actor_type: Filters by the actor type. - - audit_log_id: Finds a specific log by its ID. - - cursor: The cursor is an opaque token used to paginate through large sets of records. It - indicates the position from which to continue when requesting the next set of - records. A valid cursor value can be obtained from the cursor object in the - result_info structure of a previous response. - - direction: Sets sorting order. - - limit: The number limits the objects to return. The cursor attribute may be used to - iterate over the next batch of objects if there are more than the limit. - - raw_cf_rayid: Filters by the response CF Ray ID. - - raw_method: The HTTP method for the API call. - - raw_status_code: The response status code that was returned. - - raw_uri: Filters by the request URI. - - resource_id: Filters by the resource ID. - - resource_product: Filters audit logs by the Cloudflare product associated with the changed - resource. - - resource_scope: Filters by the resource scope, specifying whether the resource is associated - with an user, an account, or a zone. - - resource_type: Filters audit logs based on the unique type of resource changed by the action. - - zone_id: Filters by the zone ID. - - zone_name: Filters by the zone name associated with the change. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get_api_list( - f"/accounts/{account_id}/logs/audit", - page=SyncCursorLimitPagination[AuditListResponse], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "before": before, - "since": since, - "account_name": account_name, - "action_result": action_result, - "action_type": action_type, - "actor_context": actor_context, - "actor_email": actor_email, - "actor_id": actor_id, - "actor_ip_address": actor_ip_address, - "actor_token_id": actor_token_id, - "actor_token_name": actor_token_name, - "actor_type": actor_type, - "audit_log_id": audit_log_id, - "cursor": cursor, - "direction": direction, - "limit": limit, - "raw_cf_rayid": raw_cf_rayid, - "raw_method": raw_method, - "raw_status_code": raw_status_code, - "raw_uri": raw_uri, - "resource_id": resource_id, - "resource_product": resource_product, - "resource_scope": resource_scope, - "resource_type": resource_type, - "zone_id": zone_id, - "zone_name": zone_name, - }, - audit_list_params.AuditListParams, - ), - ), - model=AuditListResponse, - ) - - -class AsyncAuditResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncAuditResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncAuditResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncAuditResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncAuditResourceWithStreamingResponse(self) - - def list( - self, - *, - account_id: str, - before: Union[str, date], - since: Union[str, date], - account_name: str | NotGiven = NOT_GIVEN, - action_result: Literal["success", "failure"] | NotGiven = NOT_GIVEN, - action_type: Literal["create", "delete", "view", "update"] | NotGiven = NOT_GIVEN, - actor_context: Literal["api_key", "api_token", "dash", "oauth", "origin_ca_key"] | NotGiven = NOT_GIVEN, - actor_email: str | NotGiven = NOT_GIVEN, - actor_id: str | NotGiven = NOT_GIVEN, - actor_ip_address: str | NotGiven = NOT_GIVEN, - actor_token_id: str | NotGiven = NOT_GIVEN, - actor_token_name: str | NotGiven = NOT_GIVEN, - actor_type: Literal["cloudflare_admin", "account", "user"] | NotGiven = NOT_GIVEN, - audit_log_id: str | NotGiven = NOT_GIVEN, - cursor: str | NotGiven = NOT_GIVEN, - direction: Literal["desc", "asc"] | NotGiven = NOT_GIVEN, - limit: float | NotGiven = NOT_GIVEN, - raw_cf_rayid: str | NotGiven = NOT_GIVEN, - raw_method: str | NotGiven = NOT_GIVEN, - raw_status_code: int | NotGiven = NOT_GIVEN, - raw_uri: str | NotGiven = NOT_GIVEN, - resource_id: str | NotGiven = NOT_GIVEN, - resource_product: str | NotGiven = NOT_GIVEN, - resource_scope: Literal["accounts", "user", "zones"] | NotGiven = NOT_GIVEN, - resource_type: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - zone_name: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[AuditListResponse, AsyncCursorLimitPagination[AuditListResponse]]: - """Gets a list of audit logs for an account. - -

This is the beta release - of Audit Logs Version 2. Since this is a beta version, there may be gaps or - missing entries in the available audit logs. Be aware of the following - limitations.
- - Args: - account_id: The unique id that identifies the account. - - before: Filters actions based on a given timestamp in the format yyyy-mm-dd, returning - only logs that occurred on and before the specified date. - - since: Filters actions based on a given timestamp in the format yyyy-mm-dd, returning - only logs that occurred on and after the specified date. - - account_name: Filters by the account name. - - action_result: Whether the action was successful or not. - - action_type: Filters by the action type. - - actor_context: Filters by the actor context. - - actor_email: Filters by the actor's email address. - - actor_id: Filters by the actor ID. This can be either the Account ID or User ID. - - actor_ip_address: The IP address where the action was initiated. - - actor_token_id: Filters by the API token ID when the actor context is an api_token or oauth. - - actor_token_name: Filters by the API token name when the actor context is an api_token or oauth. - - actor_type: Filters by the actor type. - - audit_log_id: Finds a specific log by its ID. - - cursor: The cursor is an opaque token used to paginate through large sets of records. It - indicates the position from which to continue when requesting the next set of - records. A valid cursor value can be obtained from the cursor object in the - result_info structure of a previous response. - - direction: Sets sorting order. - - limit: The number limits the objects to return. The cursor attribute may be used to - iterate over the next batch of objects if there are more than the limit. - - raw_cf_rayid: Filters by the response CF Ray ID. - - raw_method: The HTTP method for the API call. - - raw_status_code: The response status code that was returned. - - raw_uri: Filters by the request URI. - - resource_id: Filters by the resource ID. - - resource_product: Filters audit logs by the Cloudflare product associated with the changed - resource. - - resource_scope: Filters by the resource scope, specifying whether the resource is associated - with an user, an account, or a zone. - - resource_type: Filters audit logs based on the unique type of resource changed by the action. - - zone_id: Filters by the zone ID. - - zone_name: Filters by the zone name associated with the change. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get_api_list( - f"/accounts/{account_id}/logs/audit", - page=AsyncCursorLimitPagination[AuditListResponse], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "before": before, - "since": since, - "account_name": account_name, - "action_result": action_result, - "action_type": action_type, - "actor_context": actor_context, - "actor_email": actor_email, - "actor_id": actor_id, - "actor_ip_address": actor_ip_address, - "actor_token_id": actor_token_id, - "actor_token_name": actor_token_name, - "actor_type": actor_type, - "audit_log_id": audit_log_id, - "cursor": cursor, - "direction": direction, - "limit": limit, - "raw_cf_rayid": raw_cf_rayid, - "raw_method": raw_method, - "raw_status_code": raw_status_code, - "raw_uri": raw_uri, - "resource_id": resource_id, - "resource_product": resource_product, - "resource_scope": resource_scope, - "resource_type": resource_type, - "zone_id": zone_id, - "zone_name": zone_name, - }, - audit_list_params.AuditListParams, - ), - ), - model=AuditListResponse, - ) - - -class AuditResourceWithRawResponse: - def __init__(self, audit: AuditResource) -> None: - self._audit = audit - - self.list = to_raw_response_wrapper( - audit.list, - ) - - -class AsyncAuditResourceWithRawResponse: - def __init__(self, audit: AsyncAuditResource) -> None: - self._audit = audit - - self.list = async_to_raw_response_wrapper( - audit.list, - ) - - -class AuditResourceWithStreamingResponse: - def __init__(self, audit: AuditResource) -> None: - self._audit = audit - - self.list = to_streamed_response_wrapper( - audit.list, - ) - - -class AsyncAuditResourceWithStreamingResponse: - def __init__(self, audit: AsyncAuditResource) -> None: - self._audit = audit - - self.list = async_to_streamed_response_wrapper( - audit.list, - ) diff --git a/src/cloudflare/resources/accounts/logs/logs.py b/src/cloudflare/resources/accounts/logs/logs.py deleted file mode 100644 index 475921543aa..00000000000 --- a/src/cloudflare/resources/accounts/logs/logs.py +++ /dev/null @@ -1,102 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from .audit import ( - AuditResource, - AsyncAuditResource, - AuditResourceWithRawResponse, - AsyncAuditResourceWithRawResponse, - AuditResourceWithStreamingResponse, - AsyncAuditResourceWithStreamingResponse, -) -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource - -__all__ = ["LogsResource", "AsyncLogsResource"] - - -class LogsResource(SyncAPIResource): - @cached_property - def audit(self) -> AuditResource: - return AuditResource(self._client) - - @cached_property - def with_raw_response(self) -> LogsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return LogsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LogsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return LogsResourceWithStreamingResponse(self) - - -class AsyncLogsResource(AsyncAPIResource): - @cached_property - def audit(self) -> AsyncAuditResource: - return AsyncAuditResource(self._client) - - @cached_property - def with_raw_response(self) -> AsyncLogsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncLogsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLogsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncLogsResourceWithStreamingResponse(self) - - -class LogsResourceWithRawResponse: - def __init__(self, logs: LogsResource) -> None: - self._logs = logs - - @cached_property - def audit(self) -> AuditResourceWithRawResponse: - return AuditResourceWithRawResponse(self._logs.audit) - - -class AsyncLogsResourceWithRawResponse: - def __init__(self, logs: AsyncLogsResource) -> None: - self._logs = logs - - @cached_property - def audit(self) -> AsyncAuditResourceWithRawResponse: - return AsyncAuditResourceWithRawResponse(self._logs.audit) - - -class LogsResourceWithStreamingResponse: - def __init__(self, logs: LogsResource) -> None: - self._logs = logs - - @cached_property - def audit(self) -> AuditResourceWithStreamingResponse: - return AuditResourceWithStreamingResponse(self._logs.audit) - - -class AsyncLogsResourceWithStreamingResponse: - def __init__(self, logs: AsyncLogsResource) -> None: - self._logs = logs - - @cached_property - def audit(self) -> AsyncAuditResourceWithStreamingResponse: - return AsyncAuditResourceWithStreamingResponse(self._logs.audit) diff --git a/src/cloudflare/resources/addressing/address_maps/accounts.py b/src/cloudflare/resources/addressing/address_maps/accounts.py index a5279ff240c..38533ca9ce1 100644 --- a/src/cloudflare/resources/addressing/address_maps/accounts.py +++ b/src/cloudflare/resources/addressing/address_maps/accounts.py @@ -62,9 +62,9 @@ def update( Add an account as a member of a particular address map. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - address_map_id: Identifier of an Address Map. + address_map_id: Identifier extra_headers: Send extra headers @@ -103,9 +103,9 @@ def delete( Remove an account as a member of a particular address map. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - address_map_id: Identifier of an Address Map. + address_map_id: Identifier extra_headers: Send extra headers @@ -165,9 +165,9 @@ async def update( Add an account as a member of a particular address map. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - address_map_id: Identifier of an Address Map. + address_map_id: Identifier extra_headers: Send extra headers @@ -206,9 +206,9 @@ async def delete( Remove an account as a member of a particular address map. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - address_map_id: Identifier of an Address Map. + address_map_id: Identifier extra_headers: Send extra headers diff --git a/src/cloudflare/resources/addressing/address_maps/address_maps.py b/src/cloudflare/resources/addressing/address_maps/address_maps.py index b3a6fda77c9..34106c3241e 100644 --- a/src/cloudflare/resources/addressing/address_maps/address_maps.py +++ b/src/cloudflare/resources/addressing/address_maps/address_maps.py @@ -106,7 +106,7 @@ def create( Create a new address map under the account. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier description: An optional description field which may be used to describe the types of IPs or zones on the map. @@ -163,7 +163,7 @@ def list( List all address maps owned by the account. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier extra_headers: Send extra headers @@ -202,9 +202,9 @@ def delete( disabled before it can be deleted. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - address_map_id: Identifier of an Address Map. + address_map_id: Identifier extra_headers: Send extra headers @@ -245,9 +245,9 @@ def edit( Modify properties of an address map owned by the account. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - address_map_id: Identifier of an Address Map. + address_map_id: Identifier default_sni: If you have legacy TLS clients which do not send the TLS server name indicator, then you can specify one default SNI on the map. If Cloudflare receives a TLS @@ -309,9 +309,9 @@ def get( Show a particular address map owned by the account. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - address_map_id: Identifier of an Address Map. + address_map_id: Identifier extra_headers: Send extra headers @@ -389,7 +389,7 @@ async def create( Create a new address map under the account. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier description: An optional description field which may be used to describe the types of IPs or zones on the map. @@ -446,7 +446,7 @@ def list( List all address maps owned by the account. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier extra_headers: Send extra headers @@ -485,9 +485,9 @@ async def delete( disabled before it can be deleted. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - address_map_id: Identifier of an Address Map. + address_map_id: Identifier extra_headers: Send extra headers @@ -528,9 +528,9 @@ async def edit( Modify properties of an address map owned by the account. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - address_map_id: Identifier of an Address Map. + address_map_id: Identifier default_sni: If you have legacy TLS clients which do not send the TLS server name indicator, then you can specify one default SNI on the map. If Cloudflare receives a TLS @@ -592,9 +592,9 @@ async def get( Show a particular address map owned by the account. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - address_map_id: Identifier of an Address Map. + address_map_id: Identifier extra_headers: Send extra headers diff --git a/src/cloudflare/resources/addressing/address_maps/ips.py b/src/cloudflare/resources/addressing/address_maps/ips.py index 15c999ab654..77e0d36e133 100644 --- a/src/cloudflare/resources/addressing/address_maps/ips.py +++ b/src/cloudflare/resources/addressing/address_maps/ips.py @@ -63,9 +63,9 @@ def update( Add an IP from a prefix owned by the account to a particular address map. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - address_map_id: Identifier of an Address Map. + address_map_id: Identifier ip_address: An IPv4 or IPv6 address. @@ -109,9 +109,9 @@ def delete( Remove an IP from a particular address map. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - address_map_id: Identifier of an Address Map. + address_map_id: Identifier ip_address: An IPv4 or IPv6 address. @@ -176,9 +176,9 @@ async def update( Add an IP from a prefix owned by the account to a particular address map. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - address_map_id: Identifier of an Address Map. + address_map_id: Identifier ip_address: An IPv4 or IPv6 address. @@ -222,9 +222,9 @@ async def delete( Remove an IP from a particular address map. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - address_map_id: Identifier of an Address Map. + address_map_id: Identifier ip_address: An IPv4 or IPv6 address. diff --git a/src/cloudflare/resources/addressing/address_maps/zones.py b/src/cloudflare/resources/addressing/address_maps/zones.py index d7f859f2617..f2a68645e31 100644 --- a/src/cloudflare/resources/addressing/address_maps/zones.py +++ b/src/cloudflare/resources/addressing/address_maps/zones.py @@ -63,11 +63,11 @@ def update( Add a zone as a member of a particular address map. Args: - zone_id: Identifier of a zone. + zone_id: Identifier - account_id: Identifier of a Cloudflare account. + account_id: Identifier - address_map_id: Identifier of an Address Map. + address_map_id: Identifier extra_headers: Send extra headers @@ -109,11 +109,11 @@ def delete( Remove a zone as a member of a particular address map. Args: - zone_id: Identifier of a zone. + zone_id: Identifier - account_id: Identifier of a Cloudflare account. + account_id: Identifier - address_map_id: Identifier of an Address Map. + address_map_id: Identifier extra_headers: Send extra headers @@ -176,11 +176,11 @@ async def update( Add a zone as a member of a particular address map. Args: - zone_id: Identifier of a zone. + zone_id: Identifier - account_id: Identifier of a Cloudflare account. + account_id: Identifier - address_map_id: Identifier of an Address Map. + address_map_id: Identifier extra_headers: Send extra headers @@ -222,11 +222,11 @@ async def delete( Remove a zone as a member of a particular address map. Args: - zone_id: Identifier of a zone. + zone_id: Identifier - account_id: Identifier of a Cloudflare account. + account_id: Identifier - address_map_id: Identifier of an Address Map. + address_map_id: Identifier extra_headers: Send extra headers diff --git a/src/cloudflare/resources/addressing/addressing.py b/src/cloudflare/resources/addressing/addressing.py index 65ac3b59c70..e5ce952404e 100644 --- a/src/cloudflare/resources/addressing/addressing.py +++ b/src/cloudflare/resources/addressing/addressing.py @@ -12,14 +12,6 @@ ) from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource -from .loa_documents import ( - LOADocumentsResource, - AsyncLOADocumentsResource, - LOADocumentsResourceWithRawResponse, - AsyncLOADocumentsResourceWithRawResponse, - LOADocumentsResourceWithStreamingResponse, - AsyncLOADocumentsResourceWithStreamingResponse, -) from .prefixes.prefixes import ( PrefixesResource, AsyncPrefixesResource, @@ -36,6 +28,14 @@ AddressMapsResourceWithStreamingResponse, AsyncAddressMapsResourceWithStreamingResponse, ) +from .loa_documents.loa_documents import ( + LOADocumentsResource, + AsyncLOADocumentsResource, + LOADocumentsResourceWithRawResponse, + AsyncLOADocumentsResourceWithRawResponse, + LOADocumentsResourceWithStreamingResponse, + AsyncLOADocumentsResourceWithStreamingResponse, +) from .regional_hostnames.regional_hostnames import ( RegionalHostnamesResource, AsyncRegionalHostnamesResource, diff --git a/src/cloudflare/resources/addressing/loa_documents/__init__.py b/src/cloudflare/resources/addressing/loa_documents/__init__.py new file mode 100644 index 00000000000..72f6dbba90c --- /dev/null +++ b/src/cloudflare/resources/addressing/loa_documents/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .downloads import ( + DownloadsResource, + AsyncDownloadsResource, + DownloadsResourceWithRawResponse, + AsyncDownloadsResourceWithRawResponse, + DownloadsResourceWithStreamingResponse, + AsyncDownloadsResourceWithStreamingResponse, +) +from .loa_documents import ( + LOADocumentsResource, + AsyncLOADocumentsResource, + LOADocumentsResourceWithRawResponse, + AsyncLOADocumentsResourceWithRawResponse, + LOADocumentsResourceWithStreamingResponse, + AsyncLOADocumentsResourceWithStreamingResponse, +) + +__all__ = [ + "DownloadsResource", + "AsyncDownloadsResource", + "DownloadsResourceWithRawResponse", + "AsyncDownloadsResourceWithRawResponse", + "DownloadsResourceWithStreamingResponse", + "AsyncDownloadsResourceWithStreamingResponse", + "LOADocumentsResource", + "AsyncLOADocumentsResource", + "LOADocumentsResourceWithRawResponse", + "AsyncLOADocumentsResourceWithRawResponse", + "LOADocumentsResourceWithStreamingResponse", + "AsyncLOADocumentsResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/addressing/loa_documents/downloads.py b/src/cloudflare/resources/addressing/loa_documents/downloads.py new file mode 100644 index 00000000000..9c21fa752b2 --- /dev/null +++ b/src/cloudflare/resources/addressing/loa_documents/downloads.py @@ -0,0 +1,188 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional + +import httpx + +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + BinaryAPIResponse, + AsyncBinaryAPIResponse, + StreamedBinaryAPIResponse, + AsyncStreamedBinaryAPIResponse, + to_custom_raw_response_wrapper, + to_custom_streamed_response_wrapper, + async_to_custom_raw_response_wrapper, + async_to_custom_streamed_response_wrapper, +) +from ...._base_client import make_request_options + +__all__ = ["DownloadsResource", "AsyncDownloadsResource"] + + +class DownloadsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> DownloadsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return DownloadsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> DownloadsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return DownloadsResourceWithStreamingResponse(self) + + def get( + self, + loa_document_id: Optional[str], + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BinaryAPIResponse: + """ + Download specified LOA document under the account. + + Args: + account_id: Identifier + + loa_document_id: Identifier for the uploaded LOA document. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not loa_document_id: + raise ValueError(f"Expected a non-empty value for `loa_document_id` but received {loa_document_id!r}") + extra_headers = {"Accept": "application/pdf", **(extra_headers or {})} + return self._get( + f"/accounts/{account_id}/addressing/loa_documents/{loa_document_id}/download", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=BinaryAPIResponse, + ) + + +class AsyncDownloadsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncDownloadsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncDownloadsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncDownloadsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncDownloadsResourceWithStreamingResponse(self) + + async def get( + self, + loa_document_id: Optional[str], + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncBinaryAPIResponse: + """ + Download specified LOA document under the account. + + Args: + account_id: Identifier + + loa_document_id: Identifier for the uploaded LOA document. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not loa_document_id: + raise ValueError(f"Expected a non-empty value for `loa_document_id` but received {loa_document_id!r}") + extra_headers = {"Accept": "application/pdf", **(extra_headers or {})} + return await self._get( + f"/accounts/{account_id}/addressing/loa_documents/{loa_document_id}/download", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AsyncBinaryAPIResponse, + ) + + +class DownloadsResourceWithRawResponse: + def __init__(self, downloads: DownloadsResource) -> None: + self._downloads = downloads + + self.get = to_custom_raw_response_wrapper( + downloads.get, + BinaryAPIResponse, + ) + + +class AsyncDownloadsResourceWithRawResponse: + def __init__(self, downloads: AsyncDownloadsResource) -> None: + self._downloads = downloads + + self.get = async_to_custom_raw_response_wrapper( + downloads.get, + AsyncBinaryAPIResponse, + ) + + +class DownloadsResourceWithStreamingResponse: + def __init__(self, downloads: DownloadsResource) -> None: + self._downloads = downloads + + self.get = to_custom_streamed_response_wrapper( + downloads.get, + StreamedBinaryAPIResponse, + ) + + +class AsyncDownloadsResourceWithStreamingResponse: + def __init__(self, downloads: AsyncDownloadsResource) -> None: + self._downloads = downloads + + self.get = async_to_custom_streamed_response_wrapper( + downloads.get, + AsyncStreamedBinaryAPIResponse, + ) diff --git a/src/cloudflare/resources/addressing/loa_documents.py b/src/cloudflare/resources/addressing/loa_documents/loa_documents.py similarity index 60% rename from src/cloudflare/resources/addressing/loa_documents.py rename to src/cloudflare/resources/addressing/loa_documents/loa_documents.py index c4db454b8c2..8e2b78160fa 100644 --- a/src/cloudflare/resources/addressing/loa_documents.py +++ b/src/cloudflare/resources/addressing/loa_documents/loa_documents.py @@ -6,36 +6,40 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( maybe_transform, async_maybe_transform, ) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - BinaryAPIResponse, - AsyncBinaryAPIResponse, - StreamedBinaryAPIResponse, - AsyncStreamedBinaryAPIResponse, +from .downloads import ( + DownloadsResource, + AsyncDownloadsResource, + DownloadsResourceWithRawResponse, + AsyncDownloadsResourceWithRawResponse, + DownloadsResourceWithStreamingResponse, + AsyncDownloadsResourceWithStreamingResponse, +) +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, - to_custom_raw_response_wrapper, async_to_streamed_response_wrapper, - to_custom_streamed_response_wrapper, - async_to_custom_raw_response_wrapper, - async_to_custom_streamed_response_wrapper, ) -from ..._wrappers import ResultWrapper -from ..._base_client import make_request_options -from ...types.addressing import loa_document_create_params -from ...types.addressing.loa_document_create_response import LOADocumentCreateResponse +from ...._wrappers import ResultWrapper +from ...._base_client import make_request_options +from ....types.addressing import loa_document_create_params +from ....types.addressing.loa_document_create_response import LOADocumentCreateResponse __all__ = ["LOADocumentsResource", "AsyncLOADocumentsResource"] class LOADocumentsResource(SyncAPIResource): + @cached_property + def downloads(self) -> DownloadsResource: + return DownloadsResource(self._client) + @cached_property def with_raw_response(self) -> LOADocumentsResourceWithRawResponse: """ @@ -71,7 +75,7 @@ def create( Submit LOA document (pdf format) under the account. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier loa_document: LOA document to upload. @@ -102,49 +106,12 @@ def create( cast_to=cast(Type[Optional[LOADocumentCreateResponse]], ResultWrapper[LOADocumentCreateResponse]), ) - def get( - self, - loa_document_id: Optional[str], - *, - account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BinaryAPIResponse: - """ - Download specified LOA document under the account. - - Args: - account_id: Identifier of a Cloudflare account. - - loa_document_id: Identifier for the uploaded LOA document. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not loa_document_id: - raise ValueError(f"Expected a non-empty value for `loa_document_id` but received {loa_document_id!r}") - extra_headers = {"Accept": "application/pdf", **(extra_headers or {})} - return self._get( - f"/accounts/{account_id}/addressing/loa_documents/{loa_document_id}/download", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=BinaryAPIResponse, - ) - class AsyncLOADocumentsResource(AsyncAPIResource): + @cached_property + def downloads(self) -> AsyncDownloadsResource: + return AsyncDownloadsResource(self._client) + @cached_property def with_raw_response(self) -> AsyncLOADocumentsResourceWithRawResponse: """ @@ -180,7 +147,7 @@ async def create( Submit LOA document (pdf format) under the account. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier loa_document: LOA document to upload. @@ -213,47 +180,6 @@ async def create( cast_to=cast(Type[Optional[LOADocumentCreateResponse]], ResultWrapper[LOADocumentCreateResponse]), ) - async def get( - self, - loa_document_id: Optional[str], - *, - account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncBinaryAPIResponse: - """ - Download specified LOA document under the account. - - Args: - account_id: Identifier of a Cloudflare account. - - loa_document_id: Identifier for the uploaded LOA document. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not loa_document_id: - raise ValueError(f"Expected a non-empty value for `loa_document_id` but received {loa_document_id!r}") - extra_headers = {"Accept": "application/pdf", **(extra_headers or {})} - return await self._get( - f"/accounts/{account_id}/addressing/loa_documents/{loa_document_id}/download", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=AsyncBinaryAPIResponse, - ) - class LOADocumentsResourceWithRawResponse: def __init__(self, loa_documents: LOADocumentsResource) -> None: @@ -262,10 +188,10 @@ def __init__(self, loa_documents: LOADocumentsResource) -> None: self.create = to_raw_response_wrapper( loa_documents.create, ) - self.get = to_custom_raw_response_wrapper( - loa_documents.get, - BinaryAPIResponse, - ) + + @cached_property + def downloads(self) -> DownloadsResourceWithRawResponse: + return DownloadsResourceWithRawResponse(self._loa_documents.downloads) class AsyncLOADocumentsResourceWithRawResponse: @@ -275,10 +201,10 @@ def __init__(self, loa_documents: AsyncLOADocumentsResource) -> None: self.create = async_to_raw_response_wrapper( loa_documents.create, ) - self.get = async_to_custom_raw_response_wrapper( - loa_documents.get, - AsyncBinaryAPIResponse, - ) + + @cached_property + def downloads(self) -> AsyncDownloadsResourceWithRawResponse: + return AsyncDownloadsResourceWithRawResponse(self._loa_documents.downloads) class LOADocumentsResourceWithStreamingResponse: @@ -288,10 +214,10 @@ def __init__(self, loa_documents: LOADocumentsResource) -> None: self.create = to_streamed_response_wrapper( loa_documents.create, ) - self.get = to_custom_streamed_response_wrapper( - loa_documents.get, - StreamedBinaryAPIResponse, - ) + + @cached_property + def downloads(self) -> DownloadsResourceWithStreamingResponse: + return DownloadsResourceWithStreamingResponse(self._loa_documents.downloads) class AsyncLOADocumentsResourceWithStreamingResponse: @@ -301,7 +227,7 @@ def __init__(self, loa_documents: AsyncLOADocumentsResource) -> None: self.create = async_to_streamed_response_wrapper( loa_documents.create, ) - self.get = async_to_custom_streamed_response_wrapper( - loa_documents.get, - AsyncStreamedBinaryAPIResponse, - ) + + @cached_property + def downloads(self) -> AsyncDownloadsResourceWithStreamingResponse: + return AsyncDownloadsResourceWithStreamingResponse(self._loa_documents.downloads) diff --git a/src/cloudflare/resources/addressing/prefixes/__init__.py b/src/cloudflare/resources/addressing/prefixes/__init__.py index 89ce6e1fa39..baf5dcefd16 100644 --- a/src/cloudflare/resources/addressing/prefixes/__init__.py +++ b/src/cloudflare/resources/addressing/prefixes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .bgp import ( + BGPResource, + AsyncBGPResource, + BGPResourceWithRawResponse, + AsyncBGPResourceWithRawResponse, + BGPResourceWithStreamingResponse, + AsyncBGPResourceWithStreamingResponse, +) from .prefixes import ( PrefixesResource, AsyncPrefixesResource, @@ -16,50 +24,14 @@ DelegationsResourceWithStreamingResponse, AsyncDelegationsResourceWithStreamingResponse, ) -from .bgp_prefixes import ( - BGPPrefixesResource, - AsyncBGPPrefixesResource, - BGPPrefixesResourceWithRawResponse, - AsyncBGPPrefixesResourceWithRawResponse, - BGPPrefixesResourceWithStreamingResponse, - AsyncBGPPrefixesResourceWithStreamingResponse, -) -from .service_bindings import ( - ServiceBindingsResource, - AsyncServiceBindingsResource, - ServiceBindingsResourceWithRawResponse, - AsyncServiceBindingsResourceWithRawResponse, - ServiceBindingsResourceWithStreamingResponse, - AsyncServiceBindingsResourceWithStreamingResponse, -) -from .advertisement_status import ( - AdvertisementStatusResource, - AsyncAdvertisementStatusResource, - AdvertisementStatusResourceWithRawResponse, - AsyncAdvertisementStatusResourceWithRawResponse, - AdvertisementStatusResourceWithStreamingResponse, - AsyncAdvertisementStatusResourceWithStreamingResponse, -) __all__ = [ - "ServiceBindingsResource", - "AsyncServiceBindingsResource", - "ServiceBindingsResourceWithRawResponse", - "AsyncServiceBindingsResourceWithRawResponse", - "ServiceBindingsResourceWithStreamingResponse", - "AsyncServiceBindingsResourceWithStreamingResponse", - "BGPPrefixesResource", - "AsyncBGPPrefixesResource", - "BGPPrefixesResourceWithRawResponse", - "AsyncBGPPrefixesResourceWithRawResponse", - "BGPPrefixesResourceWithStreamingResponse", - "AsyncBGPPrefixesResourceWithStreamingResponse", - "AdvertisementStatusResource", - "AsyncAdvertisementStatusResource", - "AdvertisementStatusResourceWithRawResponse", - "AsyncAdvertisementStatusResourceWithRawResponse", - "AdvertisementStatusResourceWithStreamingResponse", - "AsyncAdvertisementStatusResourceWithStreamingResponse", + "BGPResource", + "AsyncBGPResource", + "BGPResourceWithRawResponse", + "AsyncBGPResourceWithRawResponse", + "BGPResourceWithStreamingResponse", + "AsyncBGPResourceWithStreamingResponse", "DelegationsResource", "AsyncDelegationsResource", "DelegationsResourceWithRawResponse", diff --git a/src/cloudflare/resources/addressing/prefixes/advertisement_status.py b/src/cloudflare/resources/addressing/prefixes/advertisement_status.py deleted file mode 100644 index 4ca0b677f15..00000000000 --- a/src/cloudflare/resources/addressing/prefixes/advertisement_status.py +++ /dev/null @@ -1,324 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Type, Optional, cast - -import httpx - -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import ( - maybe_transform, - async_maybe_transform, -) -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ...._wrappers import ResultWrapper -from ...._base_client import make_request_options -from ....types.addressing.prefixes import advertisement_status_edit_params -from ....types.addressing.prefixes.advertisement_status_get_response import AdvertisementStatusGetResponse -from ....types.addressing.prefixes.advertisement_status_edit_response import AdvertisementStatusEditResponse - -__all__ = ["AdvertisementStatusResource", "AsyncAdvertisementStatusResource"] - - -class AdvertisementStatusResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> AdvertisementStatusResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AdvertisementStatusResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AdvertisementStatusResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AdvertisementStatusResourceWithStreamingResponse(self) - - def edit( - self, - prefix_id: str, - *, - account_id: str, - advertised: bool, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AdvertisementStatusEditResponse]: - """ - Advertise or withdraw the BGP route for a prefix. - - **Deprecated:** Prefer the BGP Prefixes endpoints, which additionally allow for - advertising and withdrawing subnets of an IP prefix. - - Args: - account_id: Identifier of a Cloudflare account. - - prefix_id: Identifier of an IP Prefix. - - advertised: Advertisement status of the prefix. If `true`, the BGP route for the prefix is - advertised to the Internet. If `false`, the BGP route is withdrawn. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not prefix_id: - raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}") - return self._patch( - f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status", - body=maybe_transform( - {"advertised": advertised}, advertisement_status_edit_params.AdvertisementStatusEditParams - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[AdvertisementStatusEditResponse]]._unwrapper, - ), - cast_to=cast( - Type[Optional[AdvertisementStatusEditResponse]], ResultWrapper[AdvertisementStatusEditResponse] - ), - ) - - def get( - self, - prefix_id: str, - *, - account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AdvertisementStatusGetResponse]: - """ - View the current advertisement state for a prefix. - - **Deprecated:** Prefer the BGP Prefixes endpoints, which additionally allow for - advertising and withdrawing subnets of an IP prefix. - - Args: - account_id: Identifier of a Cloudflare account. - - prefix_id: Identifier of an IP Prefix. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not prefix_id: - raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}") - return self._get( - f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[AdvertisementStatusGetResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[AdvertisementStatusGetResponse]], ResultWrapper[AdvertisementStatusGetResponse]), - ) - - -class AsyncAdvertisementStatusResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncAdvertisementStatusResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncAdvertisementStatusResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncAdvertisementStatusResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncAdvertisementStatusResourceWithStreamingResponse(self) - - async def edit( - self, - prefix_id: str, - *, - account_id: str, - advertised: bool, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AdvertisementStatusEditResponse]: - """ - Advertise or withdraw the BGP route for a prefix. - - **Deprecated:** Prefer the BGP Prefixes endpoints, which additionally allow for - advertising and withdrawing subnets of an IP prefix. - - Args: - account_id: Identifier of a Cloudflare account. - - prefix_id: Identifier of an IP Prefix. - - advertised: Advertisement status of the prefix. If `true`, the BGP route for the prefix is - advertised to the Internet. If `false`, the BGP route is withdrawn. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not prefix_id: - raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}") - return await self._patch( - f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status", - body=await async_maybe_transform( - {"advertised": advertised}, advertisement_status_edit_params.AdvertisementStatusEditParams - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[AdvertisementStatusEditResponse]]._unwrapper, - ), - cast_to=cast( - Type[Optional[AdvertisementStatusEditResponse]], ResultWrapper[AdvertisementStatusEditResponse] - ), - ) - - async def get( - self, - prefix_id: str, - *, - account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AdvertisementStatusGetResponse]: - """ - View the current advertisement state for a prefix. - - **Deprecated:** Prefer the BGP Prefixes endpoints, which additionally allow for - advertising and withdrawing subnets of an IP prefix. - - Args: - account_id: Identifier of a Cloudflare account. - - prefix_id: Identifier of an IP Prefix. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not prefix_id: - raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}") - return await self._get( - f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[AdvertisementStatusGetResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[AdvertisementStatusGetResponse]], ResultWrapper[AdvertisementStatusGetResponse]), - ) - - -class AdvertisementStatusResourceWithRawResponse: - def __init__(self, advertisement_status: AdvertisementStatusResource) -> None: - self._advertisement_status = advertisement_status - - self.edit = to_raw_response_wrapper( - advertisement_status.edit, - ) - self.get = to_raw_response_wrapper( - advertisement_status.get, - ) - - -class AsyncAdvertisementStatusResourceWithRawResponse: - def __init__(self, advertisement_status: AsyncAdvertisementStatusResource) -> None: - self._advertisement_status = advertisement_status - - self.edit = async_to_raw_response_wrapper( - advertisement_status.edit, - ) - self.get = async_to_raw_response_wrapper( - advertisement_status.get, - ) - - -class AdvertisementStatusResourceWithStreamingResponse: - def __init__(self, advertisement_status: AdvertisementStatusResource) -> None: - self._advertisement_status = advertisement_status - - self.edit = to_streamed_response_wrapper( - advertisement_status.edit, - ) - self.get = to_streamed_response_wrapper( - advertisement_status.get, - ) - - -class AsyncAdvertisementStatusResourceWithStreamingResponse: - def __init__(self, advertisement_status: AsyncAdvertisementStatusResource) -> None: - self._advertisement_status = advertisement_status - - self.edit = async_to_streamed_response_wrapper( - advertisement_status.edit, - ) - self.get = async_to_streamed_response_wrapper( - advertisement_status.get, - ) diff --git a/src/cloudflare/resources/addressing/prefixes/bgp/__init__.py b/src/cloudflare/resources/addressing/prefixes/bgp/__init__.py new file mode 100644 index 00000000000..8c3709d72cc --- /dev/null +++ b/src/cloudflare/resources/addressing/prefixes/bgp/__init__.py @@ -0,0 +1,61 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .bgp import ( + BGPResource, + AsyncBGPResource, + BGPResourceWithRawResponse, + AsyncBGPResourceWithRawResponse, + BGPResourceWithStreamingResponse, + AsyncBGPResourceWithStreamingResponse, +) +from .bindings import ( + BindingsResource, + AsyncBindingsResource, + BindingsResourceWithRawResponse, + AsyncBindingsResourceWithRawResponse, + BindingsResourceWithStreamingResponse, + AsyncBindingsResourceWithStreamingResponse, +) +from .prefixes import ( + PrefixesResource, + AsyncPrefixesResource, + PrefixesResourceWithRawResponse, + AsyncPrefixesResourceWithRawResponse, + PrefixesResourceWithStreamingResponse, + AsyncPrefixesResourceWithStreamingResponse, +) +from .statuses import ( + StatusesResource, + AsyncStatusesResource, + StatusesResourceWithRawResponse, + AsyncStatusesResourceWithRawResponse, + StatusesResourceWithStreamingResponse, + AsyncStatusesResourceWithStreamingResponse, +) + +__all__ = [ + "BindingsResource", + "AsyncBindingsResource", + "BindingsResourceWithRawResponse", + "AsyncBindingsResourceWithRawResponse", + "BindingsResourceWithStreamingResponse", + "AsyncBindingsResourceWithStreamingResponse", + "PrefixesResource", + "AsyncPrefixesResource", + "PrefixesResourceWithRawResponse", + "AsyncPrefixesResourceWithRawResponse", + "PrefixesResourceWithStreamingResponse", + "AsyncPrefixesResourceWithStreamingResponse", + "StatusesResource", + "AsyncStatusesResource", + "StatusesResourceWithRawResponse", + "AsyncStatusesResourceWithRawResponse", + "StatusesResourceWithStreamingResponse", + "AsyncStatusesResourceWithStreamingResponse", + "BGPResource", + "AsyncBGPResource", + "BGPResourceWithRawResponse", + "AsyncBGPResourceWithRawResponse", + "BGPResourceWithStreamingResponse", + "AsyncBGPResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/addressing/prefixes/bgp/bgp.py b/src/cloudflare/resources/addressing/prefixes/bgp/bgp.py new file mode 100644 index 00000000000..0aaf8300bf8 --- /dev/null +++ b/src/cloudflare/resources/addressing/prefixes/bgp/bgp.py @@ -0,0 +1,166 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .bindings import ( + BindingsResource, + AsyncBindingsResource, + BindingsResourceWithRawResponse, + AsyncBindingsResourceWithRawResponse, + BindingsResourceWithStreamingResponse, + AsyncBindingsResourceWithStreamingResponse, +) +from .prefixes import ( + PrefixesResource, + AsyncPrefixesResource, + PrefixesResourceWithRawResponse, + AsyncPrefixesResourceWithRawResponse, + PrefixesResourceWithStreamingResponse, + AsyncPrefixesResourceWithStreamingResponse, +) +from .statuses import ( + StatusesResource, + AsyncStatusesResource, + StatusesResourceWithRawResponse, + AsyncStatusesResourceWithRawResponse, + StatusesResourceWithStreamingResponse, + AsyncStatusesResourceWithStreamingResponse, +) +from ....._compat import cached_property +from ....._resource import SyncAPIResource, AsyncAPIResource + +__all__ = ["BGPResource", "AsyncBGPResource"] + + +class BGPResource(SyncAPIResource): + @cached_property + def bindings(self) -> BindingsResource: + return BindingsResource(self._client) + + @cached_property + def prefixes(self) -> PrefixesResource: + return PrefixesResource(self._client) + + @cached_property + def statuses(self) -> StatusesResource: + return StatusesResource(self._client) + + @cached_property + def with_raw_response(self) -> BGPResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return BGPResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> BGPResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return BGPResourceWithStreamingResponse(self) + + +class AsyncBGPResource(AsyncAPIResource): + @cached_property + def bindings(self) -> AsyncBindingsResource: + return AsyncBindingsResource(self._client) + + @cached_property + def prefixes(self) -> AsyncPrefixesResource: + return AsyncPrefixesResource(self._client) + + @cached_property + def statuses(self) -> AsyncStatusesResource: + return AsyncStatusesResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncBGPResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncBGPResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncBGPResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncBGPResourceWithStreamingResponse(self) + + +class BGPResourceWithRawResponse: + def __init__(self, bgp: BGPResource) -> None: + self._bgp = bgp + + @cached_property + def bindings(self) -> BindingsResourceWithRawResponse: + return BindingsResourceWithRawResponse(self._bgp.bindings) + + @cached_property + def prefixes(self) -> PrefixesResourceWithRawResponse: + return PrefixesResourceWithRawResponse(self._bgp.prefixes) + + @cached_property + def statuses(self) -> StatusesResourceWithRawResponse: + return StatusesResourceWithRawResponse(self._bgp.statuses) + + +class AsyncBGPResourceWithRawResponse: + def __init__(self, bgp: AsyncBGPResource) -> None: + self._bgp = bgp + + @cached_property + def bindings(self) -> AsyncBindingsResourceWithRawResponse: + return AsyncBindingsResourceWithRawResponse(self._bgp.bindings) + + @cached_property + def prefixes(self) -> AsyncPrefixesResourceWithRawResponse: + return AsyncPrefixesResourceWithRawResponse(self._bgp.prefixes) + + @cached_property + def statuses(self) -> AsyncStatusesResourceWithRawResponse: + return AsyncStatusesResourceWithRawResponse(self._bgp.statuses) + + +class BGPResourceWithStreamingResponse: + def __init__(self, bgp: BGPResource) -> None: + self._bgp = bgp + + @cached_property + def bindings(self) -> BindingsResourceWithStreamingResponse: + return BindingsResourceWithStreamingResponse(self._bgp.bindings) + + @cached_property + def prefixes(self) -> PrefixesResourceWithStreamingResponse: + return PrefixesResourceWithStreamingResponse(self._bgp.prefixes) + + @cached_property + def statuses(self) -> StatusesResourceWithStreamingResponse: + return StatusesResourceWithStreamingResponse(self._bgp.statuses) + + +class AsyncBGPResourceWithStreamingResponse: + def __init__(self, bgp: AsyncBGPResource) -> None: + self._bgp = bgp + + @cached_property + def bindings(self) -> AsyncBindingsResourceWithStreamingResponse: + return AsyncBindingsResourceWithStreamingResponse(self._bgp.bindings) + + @cached_property + def prefixes(self) -> AsyncPrefixesResourceWithStreamingResponse: + return AsyncPrefixesResourceWithStreamingResponse(self._bgp.prefixes) + + @cached_property + def statuses(self) -> AsyncStatusesResourceWithStreamingResponse: + return AsyncStatusesResourceWithStreamingResponse(self._bgp.statuses) diff --git a/src/cloudflare/resources/addressing/prefixes/service_bindings.py b/src/cloudflare/resources/addressing/prefixes/bgp/bindings.py similarity index 80% rename from src/cloudflare/resources/addressing/prefixes/service_bindings.py rename to src/cloudflare/resources/addressing/prefixes/bgp/bindings.py index c5be5b730ca..32a3c303168 100644 --- a/src/cloudflare/resources/addressing/prefixes/service_bindings.py +++ b/src/cloudflare/resources/addressing/prefixes/bgp/bindings.py @@ -6,48 +6,48 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import ( +from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._utils import ( maybe_transform, async_maybe_transform, ) -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( +from ....._compat import cached_property +from ....._resource import SyncAPIResource, AsyncAPIResource +from ....._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...._wrappers import ResultWrapper -from ....pagination import SyncSinglePage, AsyncSinglePage -from ...._base_client import AsyncPaginator, make_request_options -from ....types.addressing.prefixes import service_binding_create_params -from ....types.addressing.prefixes.service_binding import ServiceBinding -from ....types.addressing.prefixes.service_binding_delete_response import ServiceBindingDeleteResponse +from ....._wrappers import ResultWrapper +from .....pagination import SyncSinglePage, AsyncSinglePage +from ....._base_client import AsyncPaginator, make_request_options +from .....types.addressing.prefixes.bgp import binding_create_params +from .....types.addressing.prefixes.bgp.service_binding import ServiceBinding +from .....types.addressing.prefixes.bgp.binding_delete_response import BindingDeleteResponse -__all__ = ["ServiceBindingsResource", "AsyncServiceBindingsResource"] +__all__ = ["BindingsResource", "AsyncBindingsResource"] -class ServiceBindingsResource(SyncAPIResource): +class BindingsResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> ServiceBindingsResourceWithRawResponse: + def with_raw_response(self) -> BindingsResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers """ - return ServiceBindingsResourceWithRawResponse(self) + return BindingsResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> ServiceBindingsResourceWithStreamingResponse: + def with_streaming_response(self) -> BindingsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response """ - return ServiceBindingsResourceWithStreamingResponse(self) + return BindingsResourceWithStreamingResponse(self) def create( self, @@ -70,14 +70,13 @@ def create( allows creating service bindings for the Cloudflare CDN or Cloudflare Spectrum. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - prefix_id: Identifier of an IP Prefix. + prefix_id: Identifier cidr: IP Prefix in Classless Inter-Domain Routing format. - service_id: Identifier of a Service on the Cloudflare network. Available services and their - IDs may be found in the **List Services** endpoint. + service_id: Identifier extra_headers: Send extra headers @@ -98,7 +97,7 @@ def create( "cidr": cidr, "service_id": service_id, }, - service_binding_create_params.ServiceBindingCreateParams, + binding_create_params.BindingCreateParams, ), options=make_request_options( extra_headers=extra_headers, @@ -132,9 +131,9 @@ def list( IPs in the prefix to Cloudflare Magic Transit. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - prefix_id: Identifier of an IP Prefix. + prefix_id: Identifier extra_headers: Send extra headers @@ -169,16 +168,16 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ServiceBindingDeleteResponse: + ) -> BindingDeleteResponse: """ Delete a Service Binding Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - prefix_id: Identifier of an IP Prefix. + prefix_id: Identifier - binding_id: Identifier of a Service Binding. + binding_id: Identifier extra_headers: Send extra headers @@ -199,7 +198,7 @@ def delete( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=ServiceBindingDeleteResponse, + cast_to=BindingDeleteResponse, ) def get( @@ -219,11 +218,11 @@ def get( Fetch a single Service Binding Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - prefix_id: Identifier of an IP Prefix. + prefix_id: Identifier - binding_id: Identifier of a Service Binding. + binding_id: Identifier extra_headers: Send extra headers @@ -252,25 +251,25 @@ def get( ) -class AsyncServiceBindingsResource(AsyncAPIResource): +class AsyncBindingsResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncServiceBindingsResourceWithRawResponse: + def with_raw_response(self) -> AsyncBindingsResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers """ - return AsyncServiceBindingsResourceWithRawResponse(self) + return AsyncBindingsResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncServiceBindingsResourceWithStreamingResponse: + def with_streaming_response(self) -> AsyncBindingsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response """ - return AsyncServiceBindingsResourceWithStreamingResponse(self) + return AsyncBindingsResourceWithStreamingResponse(self) async def create( self, @@ -293,14 +292,13 @@ async def create( allows creating service bindings for the Cloudflare CDN or Cloudflare Spectrum. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - prefix_id: Identifier of an IP Prefix. + prefix_id: Identifier cidr: IP Prefix in Classless Inter-Domain Routing format. - service_id: Identifier of a Service on the Cloudflare network. Available services and their - IDs may be found in the **List Services** endpoint. + service_id: Identifier extra_headers: Send extra headers @@ -321,7 +319,7 @@ async def create( "cidr": cidr, "service_id": service_id, }, - service_binding_create_params.ServiceBindingCreateParams, + binding_create_params.BindingCreateParams, ), options=make_request_options( extra_headers=extra_headers, @@ -355,9 +353,9 @@ def list( IPs in the prefix to Cloudflare Magic Transit. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - prefix_id: Identifier of an IP Prefix. + prefix_id: Identifier extra_headers: Send extra headers @@ -392,16 +390,16 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ServiceBindingDeleteResponse: + ) -> BindingDeleteResponse: """ Delete a Service Binding Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - prefix_id: Identifier of an IP Prefix. + prefix_id: Identifier - binding_id: Identifier of a Service Binding. + binding_id: Identifier extra_headers: Send extra headers @@ -422,7 +420,7 @@ async def delete( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=ServiceBindingDeleteResponse, + cast_to=BindingDeleteResponse, ) async def get( @@ -442,11 +440,11 @@ async def get( Fetch a single Service Binding Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - prefix_id: Identifier of an IP Prefix. + prefix_id: Identifier - binding_id: Identifier of a Service Binding. + binding_id: Identifier extra_headers: Send extra headers @@ -475,73 +473,73 @@ async def get( ) -class ServiceBindingsResourceWithRawResponse: - def __init__(self, service_bindings: ServiceBindingsResource) -> None: - self._service_bindings = service_bindings +class BindingsResourceWithRawResponse: + def __init__(self, bindings: BindingsResource) -> None: + self._bindings = bindings self.create = to_raw_response_wrapper( - service_bindings.create, + bindings.create, ) self.list = to_raw_response_wrapper( - service_bindings.list, + bindings.list, ) self.delete = to_raw_response_wrapper( - service_bindings.delete, + bindings.delete, ) self.get = to_raw_response_wrapper( - service_bindings.get, + bindings.get, ) -class AsyncServiceBindingsResourceWithRawResponse: - def __init__(self, service_bindings: AsyncServiceBindingsResource) -> None: - self._service_bindings = service_bindings +class AsyncBindingsResourceWithRawResponse: + def __init__(self, bindings: AsyncBindingsResource) -> None: + self._bindings = bindings self.create = async_to_raw_response_wrapper( - service_bindings.create, + bindings.create, ) self.list = async_to_raw_response_wrapper( - service_bindings.list, + bindings.list, ) self.delete = async_to_raw_response_wrapper( - service_bindings.delete, + bindings.delete, ) self.get = async_to_raw_response_wrapper( - service_bindings.get, + bindings.get, ) -class ServiceBindingsResourceWithStreamingResponse: - def __init__(self, service_bindings: ServiceBindingsResource) -> None: - self._service_bindings = service_bindings +class BindingsResourceWithStreamingResponse: + def __init__(self, bindings: BindingsResource) -> None: + self._bindings = bindings self.create = to_streamed_response_wrapper( - service_bindings.create, + bindings.create, ) self.list = to_streamed_response_wrapper( - service_bindings.list, + bindings.list, ) self.delete = to_streamed_response_wrapper( - service_bindings.delete, + bindings.delete, ) self.get = to_streamed_response_wrapper( - service_bindings.get, + bindings.get, ) -class AsyncServiceBindingsResourceWithStreamingResponse: - def __init__(self, service_bindings: AsyncServiceBindingsResource) -> None: - self._service_bindings = service_bindings +class AsyncBindingsResourceWithStreamingResponse: + def __init__(self, bindings: AsyncBindingsResource) -> None: + self._bindings = bindings self.create = async_to_streamed_response_wrapper( - service_bindings.create, + bindings.create, ) self.list = async_to_streamed_response_wrapper( - service_bindings.list, + bindings.list, ) self.delete = async_to_streamed_response_wrapper( - service_bindings.delete, + bindings.delete, ) self.get = async_to_streamed_response_wrapper( - service_bindings.get, + bindings.get, ) diff --git a/src/cloudflare/resources/addressing/prefixes/bgp_prefixes.py b/src/cloudflare/resources/addressing/prefixes/bgp/prefixes.py similarity index 62% rename from src/cloudflare/resources/addressing/prefixes/bgp_prefixes.py rename to src/cloudflare/resources/addressing/prefixes/bgp/prefixes.py index 3f65acd83ad..c99139e7d70 100644 --- a/src/cloudflare/resources/addressing/prefixes/bgp_prefixes.py +++ b/src/cloudflare/resources/addressing/prefixes/bgp/prefixes.py @@ -6,97 +6,47 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import ( +from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._utils import ( maybe_transform, async_maybe_transform, ) -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( +from ....._compat import cached_property +from ....._resource import SyncAPIResource, AsyncAPIResource +from ....._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...._wrappers import ResultWrapper -from ....pagination import SyncSinglePage, AsyncSinglePage -from ...._base_client import AsyncPaginator, make_request_options -from ....types.addressing.prefixes import bgp_prefix_edit_params, bgp_prefix_create_params -from ....types.addressing.prefixes.bgp_prefix import BGPPrefix +from ....._wrappers import ResultWrapper +from .....pagination import SyncSinglePage, AsyncSinglePage +from ....._base_client import AsyncPaginator, make_request_options +from .....types.addressing.prefixes.bgp import prefix_edit_params +from .....types.addressing.prefixes.bgp.bgp_prefix import BGPPrefix -__all__ = ["BGPPrefixesResource", "AsyncBGPPrefixesResource"] +__all__ = ["PrefixesResource", "AsyncPrefixesResource"] -class BGPPrefixesResource(SyncAPIResource): +class PrefixesResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> BGPPrefixesResourceWithRawResponse: + def with_raw_response(self) -> PrefixesResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers """ - return BGPPrefixesResourceWithRawResponse(self) + return PrefixesResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> BGPPrefixesResourceWithStreamingResponse: + def with_streaming_response(self) -> PrefixesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response """ - return BGPPrefixesResourceWithStreamingResponse(self) - - def create( - self, - prefix_id: str, - *, - account_id: str, - cidr: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[BGPPrefix]: - """ - Create a BGP prefix, controlling the BGP advertisement status of a specific - subnet. When created, BGP prefixes are initially withdrawn, and can be - advertised with the Update BGP Prefix API. - - Args: - account_id: Identifier of a Cloudflare account. - - prefix_id: Identifier of an IP Prefix. - - cidr: IP Prefix in Classless Inter-Domain Routing format. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not prefix_id: - raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}") - return self._post( - f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes", - body=maybe_transform({"cidr": cidr}, bgp_prefix_create_params.BGPPrefixCreateParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[BGPPrefix]]._unwrapper, - ), - cast_to=cast(Type[Optional[BGPPrefix]], ResultWrapper[BGPPrefix]), - ) + return PrefixesResourceWithStreamingResponse(self) def list( self, @@ -118,9 +68,9 @@ def list( Prefixes. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - prefix_id: Identifier of an IP Prefix. + prefix_id: Identifier extra_headers: Send extra headers @@ -149,7 +99,7 @@ def edit( *, account_id: str, prefix_id: str, - on_demand: bgp_prefix_edit_params.OnDemand | NotGiven = NOT_GIVEN, + on_demand: prefix_edit_params.OnDemand | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -162,11 +112,11 @@ def edit( status (advertised or withdrawn). Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - prefix_id: Identifier of an IP Prefix. + prefix_id: Identifier - bgp_prefix_id: Identifier of BGP Prefix. + bgp_prefix_id: Identifier extra_headers: Send extra headers @@ -184,7 +134,7 @@ def edit( raise ValueError(f"Expected a non-empty value for `bgp_prefix_id` but received {bgp_prefix_id!r}") return self._patch( f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes/{bgp_prefix_id}", - body=maybe_transform({"on_demand": on_demand}, bgp_prefix_edit_params.BGPPrefixEditParams), + body=maybe_transform({"on_demand": on_demand}, prefix_edit_params.PrefixEditParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -212,11 +162,11 @@ def get( Retrieve a single BGP Prefix according to its identifier Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - prefix_id: Identifier of an IP Prefix. + prefix_id: Identifier - bgp_prefix_id: Identifier of BGP Prefix. + bgp_prefix_id: Identifier extra_headers: Send extra headers @@ -245,75 +195,25 @@ def get( ) -class AsyncBGPPrefixesResource(AsyncAPIResource): +class AsyncPrefixesResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncBGPPrefixesResourceWithRawResponse: + def with_raw_response(self) -> AsyncPrefixesResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers """ - return AsyncBGPPrefixesResourceWithRawResponse(self) + return AsyncPrefixesResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncBGPPrefixesResourceWithStreamingResponse: + def with_streaming_response(self) -> AsyncPrefixesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response """ - return AsyncBGPPrefixesResourceWithStreamingResponse(self) - - async def create( - self, - prefix_id: str, - *, - account_id: str, - cidr: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[BGPPrefix]: - """ - Create a BGP prefix, controlling the BGP advertisement status of a specific - subnet. When created, BGP prefixes are initially withdrawn, and can be - advertised with the Update BGP Prefix API. - - Args: - account_id: Identifier of a Cloudflare account. - - prefix_id: Identifier of an IP Prefix. - - cidr: IP Prefix in Classless Inter-Domain Routing format. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not prefix_id: - raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}") - return await self._post( - f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes", - body=await async_maybe_transform({"cidr": cidr}, bgp_prefix_create_params.BGPPrefixCreateParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[BGPPrefix]]._unwrapper, - ), - cast_to=cast(Type[Optional[BGPPrefix]], ResultWrapper[BGPPrefix]), - ) + return AsyncPrefixesResourceWithStreamingResponse(self) def list( self, @@ -335,9 +235,9 @@ def list( Prefixes. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - prefix_id: Identifier of an IP Prefix. + prefix_id: Identifier extra_headers: Send extra headers @@ -366,7 +266,7 @@ async def edit( *, account_id: str, prefix_id: str, - on_demand: bgp_prefix_edit_params.OnDemand | NotGiven = NOT_GIVEN, + on_demand: prefix_edit_params.OnDemand | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -379,11 +279,11 @@ async def edit( status (advertised or withdrawn). Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - prefix_id: Identifier of an IP Prefix. + prefix_id: Identifier - bgp_prefix_id: Identifier of BGP Prefix. + bgp_prefix_id: Identifier extra_headers: Send extra headers @@ -401,7 +301,7 @@ async def edit( raise ValueError(f"Expected a non-empty value for `bgp_prefix_id` but received {bgp_prefix_id!r}") return await self._patch( f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes/{bgp_prefix_id}", - body=await async_maybe_transform({"on_demand": on_demand}, bgp_prefix_edit_params.BGPPrefixEditParams), + body=await async_maybe_transform({"on_demand": on_demand}, prefix_edit_params.PrefixEditParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -429,11 +329,11 @@ async def get( Retrieve a single BGP Prefix according to its identifier Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - prefix_id: Identifier of an IP Prefix. + prefix_id: Identifier - bgp_prefix_id: Identifier of BGP Prefix. + bgp_prefix_id: Identifier extra_headers: Send extra headers @@ -462,73 +362,61 @@ async def get( ) -class BGPPrefixesResourceWithRawResponse: - def __init__(self, bgp_prefixes: BGPPrefixesResource) -> None: - self._bgp_prefixes = bgp_prefixes +class PrefixesResourceWithRawResponse: + def __init__(self, prefixes: PrefixesResource) -> None: + self._prefixes = prefixes - self.create = to_raw_response_wrapper( - bgp_prefixes.create, - ) self.list = to_raw_response_wrapper( - bgp_prefixes.list, + prefixes.list, ) self.edit = to_raw_response_wrapper( - bgp_prefixes.edit, + prefixes.edit, ) self.get = to_raw_response_wrapper( - bgp_prefixes.get, + prefixes.get, ) -class AsyncBGPPrefixesResourceWithRawResponse: - def __init__(self, bgp_prefixes: AsyncBGPPrefixesResource) -> None: - self._bgp_prefixes = bgp_prefixes +class AsyncPrefixesResourceWithRawResponse: + def __init__(self, prefixes: AsyncPrefixesResource) -> None: + self._prefixes = prefixes - self.create = async_to_raw_response_wrapper( - bgp_prefixes.create, - ) self.list = async_to_raw_response_wrapper( - bgp_prefixes.list, + prefixes.list, ) self.edit = async_to_raw_response_wrapper( - bgp_prefixes.edit, + prefixes.edit, ) self.get = async_to_raw_response_wrapper( - bgp_prefixes.get, + prefixes.get, ) -class BGPPrefixesResourceWithStreamingResponse: - def __init__(self, bgp_prefixes: BGPPrefixesResource) -> None: - self._bgp_prefixes = bgp_prefixes +class PrefixesResourceWithStreamingResponse: + def __init__(self, prefixes: PrefixesResource) -> None: + self._prefixes = prefixes - self.create = to_streamed_response_wrapper( - bgp_prefixes.create, - ) self.list = to_streamed_response_wrapper( - bgp_prefixes.list, + prefixes.list, ) self.edit = to_streamed_response_wrapper( - bgp_prefixes.edit, + prefixes.edit, ) self.get = to_streamed_response_wrapper( - bgp_prefixes.get, + prefixes.get, ) -class AsyncBGPPrefixesResourceWithStreamingResponse: - def __init__(self, bgp_prefixes: AsyncBGPPrefixesResource) -> None: - self._bgp_prefixes = bgp_prefixes +class AsyncPrefixesResourceWithStreamingResponse: + def __init__(self, prefixes: AsyncPrefixesResource) -> None: + self._prefixes = prefixes - self.create = async_to_streamed_response_wrapper( - bgp_prefixes.create, - ) self.list = async_to_streamed_response_wrapper( - bgp_prefixes.list, + prefixes.list, ) self.edit = async_to_streamed_response_wrapper( - bgp_prefixes.edit, + prefixes.edit, ) self.get = async_to_streamed_response_wrapper( - bgp_prefixes.get, + prefixes.get, ) diff --git a/src/cloudflare/resources/zero_trust/dlp/email/account_mapping.py b/src/cloudflare/resources/addressing/prefixes/bgp/statuses.py similarity index 59% rename from src/cloudflare/resources/zero_trust/dlp/email/account_mapping.py rename to src/cloudflare/resources/addressing/prefixes/bgp/statuses.py index d9c04a979d4..adab1b6a231 100644 --- a/src/cloudflare/resources/zero_trust/dlp/email/account_mapping.py +++ b/src/cloudflare/resources/addressing/prefixes/bgp/statuses.py @@ -21,49 +21,56 @@ ) from ....._wrappers import ResultWrapper from ....._base_client import make_request_options -from .....types.zero_trust.dlp.email import account_mapping_create_params -from .....types.zero_trust.dlp.email.account_mapping_get_response import AccountMappingGetResponse -from .....types.zero_trust.dlp.email.account_mapping_create_response import AccountMappingCreateResponse +from .....types.addressing.prefixes.bgp import status_edit_params +from .....types.addressing.prefixes.bgp.status_get_response import StatusGetResponse +from .....types.addressing.prefixes.bgp.status_edit_response import StatusEditResponse -__all__ = ["AccountMappingResource", "AsyncAccountMappingResource"] +__all__ = ["StatusesResource", "AsyncStatusesResource"] -class AccountMappingResource(SyncAPIResource): +class StatusesResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> AccountMappingResourceWithRawResponse: + def with_raw_response(self) -> StatusesResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers """ - return AccountMappingResourceWithRawResponse(self) + return StatusesResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AccountMappingResourceWithStreamingResponse: + def with_streaming_response(self) -> StatusesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response """ - return AccountMappingResourceWithStreamingResponse(self) + return StatusesResourceWithStreamingResponse(self) - def create( + def edit( self, + prefix_id: str, *, account_id: str, - auth_requirements: account_mapping_create_params.AuthRequirements, + advertised: bool, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AccountMappingCreateResponse]: + ) -> Optional[StatusEditResponse]: """ - Create mapping + Advertise or withdraw BGP route for a prefix. Args: + account_id: Identifier + + prefix_id: Identifier + + advertised: Enablement of prefix advertisement to the Internet. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -74,23 +81,24 @@ def create( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._post( - f"/accounts/{account_id}/dlp/email/account_mapping", - body=maybe_transform( - {"auth_requirements": auth_requirements}, account_mapping_create_params.AccountMappingCreateParams - ), + if not prefix_id: + raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}") + return self._patch( + f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status", + body=maybe_transform({"advertised": advertised}, status_edit_params.StatusEditParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[AccountMappingCreateResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[StatusEditResponse]]._unwrapper, ), - cast_to=cast(Type[Optional[AccountMappingCreateResponse]], ResultWrapper[AccountMappingCreateResponse]), + cast_to=cast(Type[Optional[StatusEditResponse]], ResultWrapper[StatusEditResponse]), ) def get( self, + prefix_id: str, *, account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -99,11 +107,15 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AccountMappingGetResponse]: + ) -> Optional[StatusGetResponse]: """ - Get mapping + List the current advertisement state for a prefix. Args: + account_id: Identifier + + prefix_id: Identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -114,55 +126,64 @@ def get( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not prefix_id: + raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}") return self._get( - f"/accounts/{account_id}/dlp/email/account_mapping", + f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[AccountMappingGetResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[StatusGetResponse]]._unwrapper, ), - cast_to=cast(Type[Optional[AccountMappingGetResponse]], ResultWrapper[AccountMappingGetResponse]), + cast_to=cast(Type[Optional[StatusGetResponse]], ResultWrapper[StatusGetResponse]), ) -class AsyncAccountMappingResource(AsyncAPIResource): +class AsyncStatusesResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncAccountMappingResourceWithRawResponse: + def with_raw_response(self) -> AsyncStatusesResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers """ - return AsyncAccountMappingResourceWithRawResponse(self) + return AsyncStatusesResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncAccountMappingResourceWithStreamingResponse: + def with_streaming_response(self) -> AsyncStatusesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response """ - return AsyncAccountMappingResourceWithStreamingResponse(self) + return AsyncStatusesResourceWithStreamingResponse(self) - async def create( + async def edit( self, + prefix_id: str, *, account_id: str, - auth_requirements: account_mapping_create_params.AuthRequirements, + advertised: bool, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AccountMappingCreateResponse]: + ) -> Optional[StatusEditResponse]: """ - Create mapping + Advertise or withdraw BGP route for a prefix. Args: + account_id: Identifier + + prefix_id: Identifier + + advertised: Enablement of prefix advertisement to the Internet. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -173,23 +194,24 @@ async def create( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._post( - f"/accounts/{account_id}/dlp/email/account_mapping", - body=await async_maybe_transform( - {"auth_requirements": auth_requirements}, account_mapping_create_params.AccountMappingCreateParams - ), + if not prefix_id: + raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}") + return await self._patch( + f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status", + body=await async_maybe_transform({"advertised": advertised}, status_edit_params.StatusEditParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[AccountMappingCreateResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[StatusEditResponse]]._unwrapper, ), - cast_to=cast(Type[Optional[AccountMappingCreateResponse]], ResultWrapper[AccountMappingCreateResponse]), + cast_to=cast(Type[Optional[StatusEditResponse]], ResultWrapper[StatusEditResponse]), ) async def get( self, + prefix_id: str, *, account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -198,11 +220,15 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AccountMappingGetResponse]: + ) -> Optional[StatusGetResponse]: """ - Get mapping + List the current advertisement state for a prefix. Args: + account_id: Identifier + + prefix_id: Identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -213,62 +239,64 @@ async def get( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not prefix_id: + raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}") return await self._get( - f"/accounts/{account_id}/dlp/email/account_mapping", + f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[AccountMappingGetResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[StatusGetResponse]]._unwrapper, ), - cast_to=cast(Type[Optional[AccountMappingGetResponse]], ResultWrapper[AccountMappingGetResponse]), + cast_to=cast(Type[Optional[StatusGetResponse]], ResultWrapper[StatusGetResponse]), ) -class AccountMappingResourceWithRawResponse: - def __init__(self, account_mapping: AccountMappingResource) -> None: - self._account_mapping = account_mapping +class StatusesResourceWithRawResponse: + def __init__(self, statuses: StatusesResource) -> None: + self._statuses = statuses - self.create = to_raw_response_wrapper( - account_mapping.create, + self.edit = to_raw_response_wrapper( + statuses.edit, ) self.get = to_raw_response_wrapper( - account_mapping.get, + statuses.get, ) -class AsyncAccountMappingResourceWithRawResponse: - def __init__(self, account_mapping: AsyncAccountMappingResource) -> None: - self._account_mapping = account_mapping +class AsyncStatusesResourceWithRawResponse: + def __init__(self, statuses: AsyncStatusesResource) -> None: + self._statuses = statuses - self.create = async_to_raw_response_wrapper( - account_mapping.create, + self.edit = async_to_raw_response_wrapper( + statuses.edit, ) self.get = async_to_raw_response_wrapper( - account_mapping.get, + statuses.get, ) -class AccountMappingResourceWithStreamingResponse: - def __init__(self, account_mapping: AccountMappingResource) -> None: - self._account_mapping = account_mapping +class StatusesResourceWithStreamingResponse: + def __init__(self, statuses: StatusesResource) -> None: + self._statuses = statuses - self.create = to_streamed_response_wrapper( - account_mapping.create, + self.edit = to_streamed_response_wrapper( + statuses.edit, ) self.get = to_streamed_response_wrapper( - account_mapping.get, + statuses.get, ) -class AsyncAccountMappingResourceWithStreamingResponse: - def __init__(self, account_mapping: AsyncAccountMappingResource) -> None: - self._account_mapping = account_mapping +class AsyncStatusesResourceWithStreamingResponse: + def __init__(self, statuses: AsyncStatusesResource) -> None: + self._statuses = statuses - self.create = async_to_streamed_response_wrapper( - account_mapping.create, + self.edit = async_to_streamed_response_wrapper( + statuses.edit, ) self.get = async_to_streamed_response_wrapper( - account_mapping.get, + statuses.get, ) diff --git a/src/cloudflare/resources/addressing/prefixes/delegations.py b/src/cloudflare/resources/addressing/prefixes/delegations.py index 93870db9319..b35f31a2893 100644 --- a/src/cloudflare/resources/addressing/prefixes/delegations.py +++ b/src/cloudflare/resources/addressing/prefixes/delegations.py @@ -67,9 +67,9 @@ def create( Create a new account delegation for a given IP prefix. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - prefix_id: Identifier of an IP Prefix. + prefix_id: Identifier cidr: IP Prefix in Classless Inter-Domain Routing format. @@ -122,9 +122,9 @@ def list( List all delegations for a given account IP prefix. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - prefix_id: Identifier of an IP Prefix. + prefix_id: Identifier extra_headers: Send extra headers @@ -164,11 +164,11 @@ def delete( Delete an account delegation for a given IP prefix. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - prefix_id: Identifier of an IP Prefix. + prefix_id: Identifier - delegation_id: Identifier of a Delegation. + delegation_id: Delegation identifier tag. extra_headers: Send extra headers @@ -235,9 +235,9 @@ async def create( Create a new account delegation for a given IP prefix. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - prefix_id: Identifier of an IP Prefix. + prefix_id: Identifier cidr: IP Prefix in Classless Inter-Domain Routing format. @@ -290,9 +290,9 @@ def list( List all delegations for a given account IP prefix. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - prefix_id: Identifier of an IP Prefix. + prefix_id: Identifier extra_headers: Send extra headers @@ -332,11 +332,11 @@ async def delete( Delete an account delegation for a given IP prefix. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - prefix_id: Identifier of an IP Prefix. + prefix_id: Identifier - delegation_id: Identifier of a Delegation. + delegation_id: Delegation identifier tag. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/addressing/prefixes/prefixes.py b/src/cloudflare/resources/addressing/prefixes/prefixes.py index b9620460953..f22011802f1 100644 --- a/src/cloudflare/resources/addressing/prefixes/prefixes.py +++ b/src/cloudflare/resources/addressing/prefixes/prefixes.py @@ -6,6 +6,14 @@ import httpx +from .bgp.bgp import ( + BGPResource, + AsyncBGPResource, + BGPResourceWithRawResponse, + AsyncBGPResourceWithRawResponse, + BGPResourceWithStreamingResponse, + AsyncBGPResourceWithStreamingResponse, +) from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( maybe_transform, @@ -28,33 +36,9 @@ async_to_streamed_response_wrapper, ) from ...._wrappers import ResultWrapper -from .bgp_prefixes import ( - BGPPrefixesResource, - AsyncBGPPrefixesResource, - BGPPrefixesResourceWithRawResponse, - AsyncBGPPrefixesResourceWithRawResponse, - BGPPrefixesResourceWithStreamingResponse, - AsyncBGPPrefixesResourceWithStreamingResponse, -) from ....pagination import SyncSinglePage, AsyncSinglePage from ...._base_client import AsyncPaginator, make_request_options -from .service_bindings import ( - ServiceBindingsResource, - AsyncServiceBindingsResource, - ServiceBindingsResourceWithRawResponse, - AsyncServiceBindingsResourceWithRawResponse, - ServiceBindingsResourceWithStreamingResponse, - AsyncServiceBindingsResourceWithStreamingResponse, -) from ....types.addressing import prefix_edit_params, prefix_create_params -from .advertisement_status import ( - AdvertisementStatusResource, - AsyncAdvertisementStatusResource, - AdvertisementStatusResourceWithRawResponse, - AsyncAdvertisementStatusResourceWithRawResponse, - AdvertisementStatusResourceWithStreamingResponse, - AsyncAdvertisementStatusResourceWithStreamingResponse, -) from ....types.addressing.prefix import Prefix from ....types.addressing.prefix_delete_response import PrefixDeleteResponse @@ -63,16 +47,8 @@ class PrefixesResource(SyncAPIResource): @cached_property - def service_bindings(self) -> ServiceBindingsResource: - return ServiceBindingsResource(self._client) - - @cached_property - def bgp_prefixes(self) -> BGPPrefixesResource: - return BGPPrefixesResource(self._client) - - @cached_property - def advertisement_status(self) -> AdvertisementStatusResource: - return AdvertisementStatusResource(self._client) + def bgp(self) -> BGPResource: + return BGPResource(self._client) @cached_property def delegations(self) -> DelegationsResource: @@ -115,7 +91,7 @@ def create( Add a new prefix under the account. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier asn: Autonomous System Number (ASN) the prefix will be advertised under. @@ -168,7 +144,7 @@ def list( List all prefixes owned by the account. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier extra_headers: Send extra headers @@ -205,9 +181,9 @@ def delete( Delete an unapproved prefix owned by the account. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - prefix_id: Identifier of an IP Prefix. + prefix_id: Identifier extra_headers: Send extra headers @@ -246,9 +222,9 @@ def edit( Modify the description for a prefix owned by the account. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - prefix_id: Identifier of an IP Prefix. + prefix_id: Identifier description: Description of the prefix. @@ -293,9 +269,9 @@ def get( List a particular prefix owned by the account. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - prefix_id: Identifier of an IP Prefix. + prefix_id: Identifier extra_headers: Send extra headers @@ -324,16 +300,8 @@ def get( class AsyncPrefixesResource(AsyncAPIResource): @cached_property - def service_bindings(self) -> AsyncServiceBindingsResource: - return AsyncServiceBindingsResource(self._client) - - @cached_property - def bgp_prefixes(self) -> AsyncBGPPrefixesResource: - return AsyncBGPPrefixesResource(self._client) - - @cached_property - def advertisement_status(self) -> AsyncAdvertisementStatusResource: - return AsyncAdvertisementStatusResource(self._client) + def bgp(self) -> AsyncBGPResource: + return AsyncBGPResource(self._client) @cached_property def delegations(self) -> AsyncDelegationsResource: @@ -376,7 +344,7 @@ async def create( Add a new prefix under the account. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier asn: Autonomous System Number (ASN) the prefix will be advertised under. @@ -429,7 +397,7 @@ def list( List all prefixes owned by the account. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier extra_headers: Send extra headers @@ -466,9 +434,9 @@ async def delete( Delete an unapproved prefix owned by the account. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - prefix_id: Identifier of an IP Prefix. + prefix_id: Identifier extra_headers: Send extra headers @@ -507,9 +475,9 @@ async def edit( Modify the description for a prefix owned by the account. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - prefix_id: Identifier of an IP Prefix. + prefix_id: Identifier description: Description of the prefix. @@ -554,9 +522,9 @@ async def get( List a particular prefix owned by the account. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier - prefix_id: Identifier of an IP Prefix. + prefix_id: Identifier extra_headers: Send extra headers @@ -604,16 +572,8 @@ def __init__(self, prefixes: PrefixesResource) -> None: ) @cached_property - def service_bindings(self) -> ServiceBindingsResourceWithRawResponse: - return ServiceBindingsResourceWithRawResponse(self._prefixes.service_bindings) - - @cached_property - def bgp_prefixes(self) -> BGPPrefixesResourceWithRawResponse: - return BGPPrefixesResourceWithRawResponse(self._prefixes.bgp_prefixes) - - @cached_property - def advertisement_status(self) -> AdvertisementStatusResourceWithRawResponse: - return AdvertisementStatusResourceWithRawResponse(self._prefixes.advertisement_status) + def bgp(self) -> BGPResourceWithRawResponse: + return BGPResourceWithRawResponse(self._prefixes.bgp) @cached_property def delegations(self) -> DelegationsResourceWithRawResponse: @@ -641,16 +601,8 @@ def __init__(self, prefixes: AsyncPrefixesResource) -> None: ) @cached_property - def service_bindings(self) -> AsyncServiceBindingsResourceWithRawResponse: - return AsyncServiceBindingsResourceWithRawResponse(self._prefixes.service_bindings) - - @cached_property - def bgp_prefixes(self) -> AsyncBGPPrefixesResourceWithRawResponse: - return AsyncBGPPrefixesResourceWithRawResponse(self._prefixes.bgp_prefixes) - - @cached_property - def advertisement_status(self) -> AsyncAdvertisementStatusResourceWithRawResponse: - return AsyncAdvertisementStatusResourceWithRawResponse(self._prefixes.advertisement_status) + def bgp(self) -> AsyncBGPResourceWithRawResponse: + return AsyncBGPResourceWithRawResponse(self._prefixes.bgp) @cached_property def delegations(self) -> AsyncDelegationsResourceWithRawResponse: @@ -678,16 +630,8 @@ def __init__(self, prefixes: PrefixesResource) -> None: ) @cached_property - def service_bindings(self) -> ServiceBindingsResourceWithStreamingResponse: - return ServiceBindingsResourceWithStreamingResponse(self._prefixes.service_bindings) - - @cached_property - def bgp_prefixes(self) -> BGPPrefixesResourceWithStreamingResponse: - return BGPPrefixesResourceWithStreamingResponse(self._prefixes.bgp_prefixes) - - @cached_property - def advertisement_status(self) -> AdvertisementStatusResourceWithStreamingResponse: - return AdvertisementStatusResourceWithStreamingResponse(self._prefixes.advertisement_status) + def bgp(self) -> BGPResourceWithStreamingResponse: + return BGPResourceWithStreamingResponse(self._prefixes.bgp) @cached_property def delegations(self) -> DelegationsResourceWithStreamingResponse: @@ -715,16 +659,8 @@ def __init__(self, prefixes: AsyncPrefixesResource) -> None: ) @cached_property - def service_bindings(self) -> AsyncServiceBindingsResourceWithStreamingResponse: - return AsyncServiceBindingsResourceWithStreamingResponse(self._prefixes.service_bindings) - - @cached_property - def bgp_prefixes(self) -> AsyncBGPPrefixesResourceWithStreamingResponse: - return AsyncBGPPrefixesResourceWithStreamingResponse(self._prefixes.bgp_prefixes) - - @cached_property - def advertisement_status(self) -> AsyncAdvertisementStatusResourceWithStreamingResponse: - return AsyncAdvertisementStatusResourceWithStreamingResponse(self._prefixes.advertisement_status) + def bgp(self) -> AsyncBGPResourceWithStreamingResponse: + return AsyncBGPResourceWithStreamingResponse(self._prefixes.bgp) @cached_property def delegations(self) -> AsyncDelegationsResourceWithStreamingResponse: diff --git a/src/cloudflare/resources/addressing/services.py b/src/cloudflare/resources/addressing/services.py index e73f0c62298..56fe70d70b9 100644 --- a/src/cloudflare/resources/addressing/services.py +++ b/src/cloudflare/resources/addressing/services.py @@ -58,7 +58,7 @@ def list( the Cloudflare network, and their service IDs. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier extra_headers: Send extra headers @@ -118,7 +118,7 @@ def list( the Cloudflare network, and their service IDs. Args: - account_id: Identifier of a Cloudflare account. + account_id: Identifier extra_headers: Send extra headers diff --git a/src/cloudflare/resources/ai/__init__.py b/src/cloudflare/resources/ai/__init__.py deleted file mode 100644 index 26c6c71d160..00000000000 --- a/src/cloudflare/resources/ai/__init__.py +++ /dev/null @@ -1,75 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from .ai import ( - AIResource, - AsyncAIResource, - AIResourceWithRawResponse, - AsyncAIResourceWithRawResponse, - AIResourceWithStreamingResponse, - AsyncAIResourceWithStreamingResponse, -) -from .tasks import ( - TasksResource, - AsyncTasksResource, - TasksResourceWithRawResponse, - AsyncTasksResourceWithRawResponse, - TasksResourceWithStreamingResponse, - AsyncTasksResourceWithStreamingResponse, -) -from .models import ( - ModelsResource, - AsyncModelsResource, - ModelsResourceWithRawResponse, - AsyncModelsResourceWithRawResponse, - ModelsResourceWithStreamingResponse, - AsyncModelsResourceWithStreamingResponse, -) -from .authors import ( - AuthorsResource, - AsyncAuthorsResource, - AuthorsResourceWithRawResponse, - AsyncAuthorsResourceWithRawResponse, - AuthorsResourceWithStreamingResponse, - AsyncAuthorsResourceWithStreamingResponse, -) -from .finetunes import ( - FinetunesResource, - AsyncFinetunesResource, - FinetunesResourceWithRawResponse, - AsyncFinetunesResourceWithRawResponse, - FinetunesResourceWithStreamingResponse, - AsyncFinetunesResourceWithStreamingResponse, -) - -__all__ = [ - "FinetunesResource", - "AsyncFinetunesResource", - "FinetunesResourceWithRawResponse", - "AsyncFinetunesResourceWithRawResponse", - "FinetunesResourceWithStreamingResponse", - "AsyncFinetunesResourceWithStreamingResponse", - "AuthorsResource", - "AsyncAuthorsResource", - "AuthorsResourceWithRawResponse", - "AsyncAuthorsResourceWithRawResponse", - "AuthorsResourceWithStreamingResponse", - "AsyncAuthorsResourceWithStreamingResponse", - "TasksResource", - "AsyncTasksResource", - "TasksResourceWithRawResponse", - "AsyncTasksResourceWithRawResponse", - "TasksResourceWithStreamingResponse", - "AsyncTasksResourceWithStreamingResponse", - "ModelsResource", - "AsyncModelsResource", - "ModelsResourceWithRawResponse", - "AsyncModelsResourceWithRawResponse", - "ModelsResourceWithStreamingResponse", - "AsyncModelsResourceWithStreamingResponse", - "AIResource", - "AsyncAIResource", - "AIResourceWithRawResponse", - "AsyncAIResourceWithRawResponse", - "AIResourceWithStreamingResponse", - "AsyncAIResourceWithStreamingResponse", -] diff --git a/src/cloudflare/resources/ai/authors.py b/src/cloudflare/resources/ai/authors.py deleted file mode 100644 index ecf213ff048..00000000000 --- a/src/cloudflare/resources/ai/authors.py +++ /dev/null @@ -1,165 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ...pagination import SyncSinglePage, AsyncSinglePage -from ..._base_client import AsyncPaginator, make_request_options - -__all__ = ["AuthorsResource", "AsyncAuthorsResource"] - - -class AuthorsResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> AuthorsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AuthorsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AuthorsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AuthorsResourceWithStreamingResponse(self) - - def list( - self, - *, - account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[object]: - """ - Author Search - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get_api_list( - f"/accounts/{account_id}/ai/authors/search", - page=SyncSinglePage[object], - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - model=object, - ) - - -class AsyncAuthorsResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncAuthorsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncAuthorsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncAuthorsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncAuthorsResourceWithStreamingResponse(self) - - def list( - self, - *, - account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[object, AsyncSinglePage[object]]: - """ - Author Search - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get_api_list( - f"/accounts/{account_id}/ai/authors/search", - page=AsyncSinglePage[object], - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - model=object, - ) - - -class AuthorsResourceWithRawResponse: - def __init__(self, authors: AuthorsResource) -> None: - self._authors = authors - - self.list = to_raw_response_wrapper( - authors.list, - ) - - -class AsyncAuthorsResourceWithRawResponse: - def __init__(self, authors: AsyncAuthorsResource) -> None: - self._authors = authors - - self.list = async_to_raw_response_wrapper( - authors.list, - ) - - -class AuthorsResourceWithStreamingResponse: - def __init__(self, authors: AuthorsResource) -> None: - self._authors = authors - - self.list = to_streamed_response_wrapper( - authors.list, - ) - - -class AsyncAuthorsResourceWithStreamingResponse: - def __init__(self, authors: AsyncAuthorsResource) -> None: - self._authors = authors - - self.list = async_to_streamed_response_wrapper( - authors.list, - ) diff --git a/src/cloudflare/resources/ai/finetunes/__init__.py b/src/cloudflare/resources/ai/finetunes/__init__.py deleted file mode 100644 index 57d977a86f3..00000000000 --- a/src/cloudflare/resources/ai/finetunes/__init__.py +++ /dev/null @@ -1,47 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from .assets import ( - AssetsResource, - AsyncAssetsResource, - AssetsResourceWithRawResponse, - AsyncAssetsResourceWithRawResponse, - AssetsResourceWithStreamingResponse, - AsyncAssetsResourceWithStreamingResponse, -) -from .public import ( - PublicResource, - AsyncPublicResource, - PublicResourceWithRawResponse, - AsyncPublicResourceWithRawResponse, - PublicResourceWithStreamingResponse, - AsyncPublicResourceWithStreamingResponse, -) -from .finetunes import ( - FinetunesResource, - AsyncFinetunesResource, - FinetunesResourceWithRawResponse, - AsyncFinetunesResourceWithRawResponse, - FinetunesResourceWithStreamingResponse, - AsyncFinetunesResourceWithStreamingResponse, -) - -__all__ = [ - "AssetsResource", - "AsyncAssetsResource", - "AssetsResourceWithRawResponse", - "AsyncAssetsResourceWithRawResponse", - "AssetsResourceWithStreamingResponse", - "AsyncAssetsResourceWithStreamingResponse", - "PublicResource", - "AsyncPublicResource", - "PublicResourceWithRawResponse", - "AsyncPublicResourceWithRawResponse", - "PublicResourceWithStreamingResponse", - "AsyncPublicResourceWithStreamingResponse", - "FinetunesResource", - "AsyncFinetunesResource", - "FinetunesResourceWithRawResponse", - "AsyncFinetunesResourceWithRawResponse", - "FinetunesResourceWithStreamingResponse", - "AsyncFinetunesResourceWithStreamingResponse", -] diff --git a/src/cloudflare/resources/ai/finetunes/assets.py b/src/cloudflare/resources/ai/finetunes/assets.py deleted file mode 100644 index dfeb072ae01..00000000000 --- a/src/cloudflare/resources/ai/finetunes/assets.py +++ /dev/null @@ -1,217 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Type, Mapping, cast - -import httpx - -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes -from ...._utils import ( - extract_files, - maybe_transform, - deepcopy_minimal, - async_maybe_transform, -) -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ...._wrappers import ResultWrapper -from ...._base_client import make_request_options -from ....types.ai.finetunes import asset_create_params -from ....types.ai.finetunes.asset_create_response import AssetCreateResponse - -__all__ = ["AssetsResource", "AsyncAssetsResource"] - - -class AssetsResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> AssetsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AssetsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AssetsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AssetsResourceWithStreamingResponse(self) - - def create( - self, - finetune_id: str, - *, - account_id: str, - file: FileTypes | NotGiven = NOT_GIVEN, - file_name: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AssetCreateResponse: - """ - Upload a Finetune Asset - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not finetune_id: - raise ValueError(f"Expected a non-empty value for `finetune_id` but received {finetune_id!r}") - body = deepcopy_minimal( - { - "file": file, - "file_name": file_name, - } - ) - files = extract_files(cast(Mapping[str, object], body), paths=[["file"]]) - # It should be noted that the actual Content-Type header that will be - # sent to the server will contain a `boundary` parameter, e.g. - # multipart/form-data; boundary=---abc-- - extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} - return self._post( - f"/accounts/{account_id}/ai/finetunes/{finetune_id}/finetune-assets", - body=maybe_transform(body, asset_create_params.AssetCreateParams), - files=files, - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[AssetCreateResponse]._unwrapper, - ), - cast_to=cast(Type[AssetCreateResponse], ResultWrapper[AssetCreateResponse]), - ) - - -class AsyncAssetsResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncAssetsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncAssetsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncAssetsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncAssetsResourceWithStreamingResponse(self) - - async def create( - self, - finetune_id: str, - *, - account_id: str, - file: FileTypes | NotGiven = NOT_GIVEN, - file_name: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AssetCreateResponse: - """ - Upload a Finetune Asset - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not finetune_id: - raise ValueError(f"Expected a non-empty value for `finetune_id` but received {finetune_id!r}") - body = deepcopy_minimal( - { - "file": file, - "file_name": file_name, - } - ) - files = extract_files(cast(Mapping[str, object], body), paths=[["file"]]) - # It should be noted that the actual Content-Type header that will be - # sent to the server will contain a `boundary` parameter, e.g. - # multipart/form-data; boundary=---abc-- - extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} - return await self._post( - f"/accounts/{account_id}/ai/finetunes/{finetune_id}/finetune-assets", - body=await async_maybe_transform(body, asset_create_params.AssetCreateParams), - files=files, - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[AssetCreateResponse]._unwrapper, - ), - cast_to=cast(Type[AssetCreateResponse], ResultWrapper[AssetCreateResponse]), - ) - - -class AssetsResourceWithRawResponse: - def __init__(self, assets: AssetsResource) -> None: - self._assets = assets - - self.create = to_raw_response_wrapper( - assets.create, - ) - - -class AsyncAssetsResourceWithRawResponse: - def __init__(self, assets: AsyncAssetsResource) -> None: - self._assets = assets - - self.create = async_to_raw_response_wrapper( - assets.create, - ) - - -class AssetsResourceWithStreamingResponse: - def __init__(self, assets: AssetsResource) -> None: - self._assets = assets - - self.create = to_streamed_response_wrapper( - assets.create, - ) - - -class AsyncAssetsResourceWithStreamingResponse: - def __init__(self, assets: AsyncAssetsResource) -> None: - self._assets = assets - - self.create = async_to_streamed_response_wrapper( - assets.create, - ) diff --git a/src/cloudflare/resources/ai/finetunes/finetunes.py b/src/cloudflare/resources/ai/finetunes/finetunes.py deleted file mode 100644 index 1cdef4efc51..00000000000 --- a/src/cloudflare/resources/ai/finetunes/finetunes.py +++ /dev/null @@ -1,356 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Type, cast - -import httpx - -from .assets import ( - AssetsResource, - AsyncAssetsResource, - AssetsResourceWithRawResponse, - AsyncAssetsResourceWithRawResponse, - AssetsResourceWithStreamingResponse, - AsyncAssetsResourceWithStreamingResponse, -) -from .public import ( - PublicResource, - AsyncPublicResource, - PublicResourceWithRawResponse, - AsyncPublicResourceWithRawResponse, - PublicResourceWithStreamingResponse, - AsyncPublicResourceWithStreamingResponse, -) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import ( - maybe_transform, - async_maybe_transform, -) -from ...._compat import cached_property -from ....types.ai import finetune_create_params -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ...._wrappers import ResultWrapper -from ...._base_client import make_request_options -from ....types.ai.finetune_list_response import FinetuneListResponse -from ....types.ai.finetune_create_response import FinetuneCreateResponse - -__all__ = ["FinetunesResource", "AsyncFinetunesResource"] - - -class FinetunesResource(SyncAPIResource): - @cached_property - def assets(self) -> AssetsResource: - return AssetsResource(self._client) - - @cached_property - def public(self) -> PublicResource: - return PublicResource(self._client) - - @cached_property - def with_raw_response(self) -> FinetunesResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return FinetunesResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> FinetunesResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return FinetunesResourceWithStreamingResponse(self) - - def create( - self, - *, - account_id: str, - model: str, - name: str, - description: str | NotGiven = NOT_GIVEN, - public: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FinetuneCreateResponse: - """ - Create a new Finetune - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._post( - f"/accounts/{account_id}/ai/finetunes", - body=maybe_transform( - { - "model": model, - "name": name, - "description": description, - "public": public, - }, - finetune_create_params.FinetuneCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[FinetuneCreateResponse]._unwrapper, - ), - cast_to=cast(Type[FinetuneCreateResponse], ResultWrapper[FinetuneCreateResponse]), - ) - - def list( - self, - *, - account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FinetuneListResponse: - """ - List Finetunes - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get( - f"/accounts/{account_id}/ai/finetunes", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[FinetuneListResponse]._unwrapper, - ), - cast_to=cast(Type[FinetuneListResponse], ResultWrapper[FinetuneListResponse]), - ) - - -class AsyncFinetunesResource(AsyncAPIResource): - @cached_property - def assets(self) -> AsyncAssetsResource: - return AsyncAssetsResource(self._client) - - @cached_property - def public(self) -> AsyncPublicResource: - return AsyncPublicResource(self._client) - - @cached_property - def with_raw_response(self) -> AsyncFinetunesResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncFinetunesResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncFinetunesResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncFinetunesResourceWithStreamingResponse(self) - - async def create( - self, - *, - account_id: str, - model: str, - name: str, - description: str | NotGiven = NOT_GIVEN, - public: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FinetuneCreateResponse: - """ - Create a new Finetune - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._post( - f"/accounts/{account_id}/ai/finetunes", - body=await async_maybe_transform( - { - "model": model, - "name": name, - "description": description, - "public": public, - }, - finetune_create_params.FinetuneCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[FinetuneCreateResponse]._unwrapper, - ), - cast_to=cast(Type[FinetuneCreateResponse], ResultWrapper[FinetuneCreateResponse]), - ) - - async def list( - self, - *, - account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FinetuneListResponse: - """ - List Finetunes - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._get( - f"/accounts/{account_id}/ai/finetunes", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[FinetuneListResponse]._unwrapper, - ), - cast_to=cast(Type[FinetuneListResponse], ResultWrapper[FinetuneListResponse]), - ) - - -class FinetunesResourceWithRawResponse: - def __init__(self, finetunes: FinetunesResource) -> None: - self._finetunes = finetunes - - self.create = to_raw_response_wrapper( - finetunes.create, - ) - self.list = to_raw_response_wrapper( - finetunes.list, - ) - - @cached_property - def assets(self) -> AssetsResourceWithRawResponse: - return AssetsResourceWithRawResponse(self._finetunes.assets) - - @cached_property - def public(self) -> PublicResourceWithRawResponse: - return PublicResourceWithRawResponse(self._finetunes.public) - - -class AsyncFinetunesResourceWithRawResponse: - def __init__(self, finetunes: AsyncFinetunesResource) -> None: - self._finetunes = finetunes - - self.create = async_to_raw_response_wrapper( - finetunes.create, - ) - self.list = async_to_raw_response_wrapper( - finetunes.list, - ) - - @cached_property - def assets(self) -> AsyncAssetsResourceWithRawResponse: - return AsyncAssetsResourceWithRawResponse(self._finetunes.assets) - - @cached_property - def public(self) -> AsyncPublicResourceWithRawResponse: - return AsyncPublicResourceWithRawResponse(self._finetunes.public) - - -class FinetunesResourceWithStreamingResponse: - def __init__(self, finetunes: FinetunesResource) -> None: - self._finetunes = finetunes - - self.create = to_streamed_response_wrapper( - finetunes.create, - ) - self.list = to_streamed_response_wrapper( - finetunes.list, - ) - - @cached_property - def assets(self) -> AssetsResourceWithStreamingResponse: - return AssetsResourceWithStreamingResponse(self._finetunes.assets) - - @cached_property - def public(self) -> PublicResourceWithStreamingResponse: - return PublicResourceWithStreamingResponse(self._finetunes.public) - - -class AsyncFinetunesResourceWithStreamingResponse: - def __init__(self, finetunes: AsyncFinetunesResource) -> None: - self._finetunes = finetunes - - self.create = async_to_streamed_response_wrapper( - finetunes.create, - ) - self.list = async_to_streamed_response_wrapper( - finetunes.list, - ) - - @cached_property - def assets(self) -> AsyncAssetsResourceWithStreamingResponse: - return AsyncAssetsResourceWithStreamingResponse(self._finetunes.assets) - - @cached_property - def public(self) -> AsyncPublicResourceWithStreamingResponse: - return AsyncPublicResourceWithStreamingResponse(self._finetunes.public) diff --git a/src/cloudflare/resources/ai/finetunes/public.py b/src/cloudflare/resources/ai/finetunes/public.py deleted file mode 100644 index 74c49e747fa..00000000000 --- a/src/cloudflare/resources/ai/finetunes/public.py +++ /dev/null @@ -1,208 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import maybe_transform -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ....pagination import SyncSinglePage, AsyncSinglePage -from ...._base_client import AsyncPaginator, make_request_options -from ....types.ai.finetunes import public_list_params -from ....types.ai.finetunes.public_list_response import PublicListResponse - -__all__ = ["PublicResource", "AsyncPublicResource"] - - -class PublicResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> PublicResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return PublicResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> PublicResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return PublicResourceWithStreamingResponse(self) - - def list( - self, - *, - account_id: str, - limit: float | NotGiven = NOT_GIVEN, - offset: float | NotGiven = NOT_GIVEN, - order_by: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[PublicListResponse]: - """ - List Public Finetunes - - Args: - limit: Pagination Limit - - offset: Pagination Offset - - order_by: Order By Column Name - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get_api_list( - f"/accounts/{account_id}/ai/finetunes/public", - page=SyncSinglePage[PublicListResponse], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "limit": limit, - "offset": offset, - "order_by": order_by, - }, - public_list_params.PublicListParams, - ), - ), - model=PublicListResponse, - ) - - -class AsyncPublicResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncPublicResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncPublicResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncPublicResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncPublicResourceWithStreamingResponse(self) - - def list( - self, - *, - account_id: str, - limit: float | NotGiven = NOT_GIVEN, - offset: float | NotGiven = NOT_GIVEN, - order_by: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[PublicListResponse, AsyncSinglePage[PublicListResponse]]: - """ - List Public Finetunes - - Args: - limit: Pagination Limit - - offset: Pagination Offset - - order_by: Order By Column Name - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get_api_list( - f"/accounts/{account_id}/ai/finetunes/public", - page=AsyncSinglePage[PublicListResponse], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "limit": limit, - "offset": offset, - "order_by": order_by, - }, - public_list_params.PublicListParams, - ), - ), - model=PublicListResponse, - ) - - -class PublicResourceWithRawResponse: - def __init__(self, public: PublicResource) -> None: - self._public = public - - self.list = to_raw_response_wrapper( - public.list, - ) - - -class AsyncPublicResourceWithRawResponse: - def __init__(self, public: AsyncPublicResource) -> None: - self._public = public - - self.list = async_to_raw_response_wrapper( - public.list, - ) - - -class PublicResourceWithStreamingResponse: - def __init__(self, public: PublicResource) -> None: - self._public = public - - self.list = to_streamed_response_wrapper( - public.list, - ) - - -class AsyncPublicResourceWithStreamingResponse: - def __init__(self, public: AsyncPublicResource) -> None: - self._public = public - - self.list = async_to_streamed_response_wrapper( - public.list, - ) diff --git a/src/cloudflare/resources/ai/models/models.py b/src/cloudflare/resources/ai/models/models.py deleted file mode 100644 index 66a2394f641..00000000000 --- a/src/cloudflare/resources/ai/models/models.py +++ /dev/null @@ -1,263 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from .schema import ( - SchemaResource, - AsyncSchemaResource, - SchemaResourceWithRawResponse, - AsyncSchemaResourceWithRawResponse, - SchemaResourceWithStreamingResponse, - AsyncSchemaResourceWithStreamingResponse, -) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import maybe_transform -from ...._compat import cached_property -from ....types.ai import model_list_params -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray -from ...._base_client import AsyncPaginator, make_request_options - -__all__ = ["ModelsResource", "AsyncModelsResource"] - - -class ModelsResource(SyncAPIResource): - @cached_property - def schema(self) -> SchemaResource: - return SchemaResource(self._client) - - @cached_property - def with_raw_response(self) -> ModelsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return ModelsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> ModelsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return ModelsResourceWithStreamingResponse(self) - - def list( - self, - *, - account_id: str, - author: str | NotGiven = NOT_GIVEN, - hide_experimental: bool | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, - source: float | NotGiven = NOT_GIVEN, - task: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncV4PagePaginationArray[object]: - """ - Model Search - - Args: - author: Filter by Author - - hide_experimental: Filter to hide experimental models - - search: Search - - source: Filter by Source Id - - task: Filter by Task Name - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get_api_list( - f"/accounts/{account_id}/ai/models/search", - page=SyncV4PagePaginationArray[object], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "author": author, - "hide_experimental": hide_experimental, - "page": page, - "per_page": per_page, - "search": search, - "source": source, - "task": task, - }, - model_list_params.ModelListParams, - ), - ), - model=object, - ) - - -class AsyncModelsResource(AsyncAPIResource): - @cached_property - def schema(self) -> AsyncSchemaResource: - return AsyncSchemaResource(self._client) - - @cached_property - def with_raw_response(self) -> AsyncModelsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncModelsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncModelsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncModelsResourceWithStreamingResponse(self) - - def list( - self, - *, - account_id: str, - author: str | NotGiven = NOT_GIVEN, - hide_experimental: bool | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, - source: float | NotGiven = NOT_GIVEN, - task: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[object, AsyncV4PagePaginationArray[object]]: - """ - Model Search - - Args: - author: Filter by Author - - hide_experimental: Filter to hide experimental models - - search: Search - - source: Filter by Source Id - - task: Filter by Task Name - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get_api_list( - f"/accounts/{account_id}/ai/models/search", - page=AsyncV4PagePaginationArray[object], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "author": author, - "hide_experimental": hide_experimental, - "page": page, - "per_page": per_page, - "search": search, - "source": source, - "task": task, - }, - model_list_params.ModelListParams, - ), - ), - model=object, - ) - - -class ModelsResourceWithRawResponse: - def __init__(self, models: ModelsResource) -> None: - self._models = models - - self.list = to_raw_response_wrapper( - models.list, - ) - - @cached_property - def schema(self) -> SchemaResourceWithRawResponse: - return SchemaResourceWithRawResponse(self._models.schema) - - -class AsyncModelsResourceWithRawResponse: - def __init__(self, models: AsyncModelsResource) -> None: - self._models = models - - self.list = async_to_raw_response_wrapper( - models.list, - ) - - @cached_property - def schema(self) -> AsyncSchemaResourceWithRawResponse: - return AsyncSchemaResourceWithRawResponse(self._models.schema) - - -class ModelsResourceWithStreamingResponse: - def __init__(self, models: ModelsResource) -> None: - self._models = models - - self.list = to_streamed_response_wrapper( - models.list, - ) - - @cached_property - def schema(self) -> SchemaResourceWithStreamingResponse: - return SchemaResourceWithStreamingResponse(self._models.schema) - - -class AsyncModelsResourceWithStreamingResponse: - def __init__(self, models: AsyncModelsResource) -> None: - self._models = models - - self.list = async_to_streamed_response_wrapper( - models.list, - ) - - @cached_property - def schema(self) -> AsyncSchemaResourceWithStreamingResponse: - return AsyncSchemaResourceWithStreamingResponse(self._models.schema) diff --git a/src/cloudflare/resources/ai/tasks.py b/src/cloudflare/resources/ai/tasks.py deleted file mode 100644 index c2b6cae396a..00000000000 --- a/src/cloudflare/resources/ai/tasks.py +++ /dev/null @@ -1,165 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ...pagination import SyncSinglePage, AsyncSinglePage -from ..._base_client import AsyncPaginator, make_request_options - -__all__ = ["TasksResource", "AsyncTasksResource"] - - -class TasksResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> TasksResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return TasksResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> TasksResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return TasksResourceWithStreamingResponse(self) - - def list( - self, - *, - account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[object]: - """ - Task Search - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get_api_list( - f"/accounts/{account_id}/ai/tasks/search", - page=SyncSinglePage[object], - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - model=object, - ) - - -class AsyncTasksResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncTasksResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncTasksResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncTasksResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncTasksResourceWithStreamingResponse(self) - - def list( - self, - *, - account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[object, AsyncSinglePage[object]]: - """ - Task Search - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get_api_list( - f"/accounts/{account_id}/ai/tasks/search", - page=AsyncSinglePage[object], - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - model=object, - ) - - -class TasksResourceWithRawResponse: - def __init__(self, tasks: TasksResource) -> None: - self._tasks = tasks - - self.list = to_raw_response_wrapper( - tasks.list, - ) - - -class AsyncTasksResourceWithRawResponse: - def __init__(self, tasks: AsyncTasksResource) -> None: - self._tasks = tasks - - self.list = async_to_raw_response_wrapper( - tasks.list, - ) - - -class TasksResourceWithStreamingResponse: - def __init__(self, tasks: TasksResource) -> None: - self._tasks = tasks - - self.list = to_streamed_response_wrapper( - tasks.list, - ) - - -class AsyncTasksResourceWithStreamingResponse: - def __init__(self, tasks: AsyncTasksResource) -> None: - self._tasks = tasks - - self.list = async_to_streamed_response_wrapper( - tasks.list, - ) diff --git a/src/cloudflare/resources/ai_gateway/ai_gateway.py b/src/cloudflare/resources/ai_gateway/ai_gateway.py index ebbaa17ba8b..c10d86e5d9c 100644 --- a/src/cloudflare/resources/ai_gateway/ai_gateway.py +++ b/src/cloudflare/resources/ai_gateway/ai_gateway.py @@ -230,6 +230,8 @@ def list( self, *, account_id: str, + order_by: str | NotGiven = NOT_GIVEN, + order_by_direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, page: int | NotGiven = NOT_GIVEN, per_page: int | NotGiven = NOT_GIVEN, search: str | NotGiven = NOT_GIVEN, @@ -244,6 +246,10 @@ def list( List Gateways Args: + order_by: Order By Column Name + + order_by_direction: Order By Direction + search: Search by id extra_headers: Send extra headers @@ -266,6 +272,8 @@ def list( timeout=timeout, query=maybe_transform( { + "order_by": order_by, + "order_by_direction": order_by_direction, "page": page, "per_page": per_page, "search": search, @@ -526,6 +534,8 @@ def list( self, *, account_id: str, + order_by: str | NotGiven = NOT_GIVEN, + order_by_direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, page: int | NotGiven = NOT_GIVEN, per_page: int | NotGiven = NOT_GIVEN, search: str | NotGiven = NOT_GIVEN, @@ -540,6 +550,10 @@ def list( List Gateways Args: + order_by: Order By Column Name + + order_by_direction: Order By Direction + search: Search by id extra_headers: Send extra headers @@ -562,6 +576,8 @@ def list( timeout=timeout, query=maybe_transform( { + "order_by": order_by, + "order_by_direction": order_by_direction, "page": page, "per_page": per_page, "search": search, diff --git a/src/cloudflare/resources/ai_gateway/datasets.py b/src/cloudflare/resources/ai_gateway/datasets.py index 3d58ec297b4..855cad685de 100644 --- a/src/cloudflare/resources/ai_gateway/datasets.py +++ b/src/cloudflare/resources/ai_gateway/datasets.py @@ -3,6 +3,7 @@ from __future__ import annotations from typing import Type, Iterable, cast +from typing_extensions import Literal import httpx @@ -168,6 +169,8 @@ def list( account_id: str, enable: bool | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, + order_by: str | NotGiven = NOT_GIVEN, + order_by_direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, page: int | NotGiven = NOT_GIVEN, per_page: int | NotGiven = NOT_GIVEN, search: str | NotGiven = NOT_GIVEN, @@ -184,6 +187,10 @@ def list( Args: gateway_id: gateway id + order_by: Order By Column Name + + order_by_direction: Order By Direction + search: Search by id, name, filters extra_headers: Send extra headers @@ -210,6 +217,8 @@ def list( { "enable": enable, "name": name, + "order_by": order_by, + "order_by_direction": order_by_direction, "page": page, "per_page": per_page, "search": search, @@ -447,6 +456,8 @@ def list( account_id: str, enable: bool | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, + order_by: str | NotGiven = NOT_GIVEN, + order_by_direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, page: int | NotGiven = NOT_GIVEN, per_page: int | NotGiven = NOT_GIVEN, search: str | NotGiven = NOT_GIVEN, @@ -463,6 +474,10 @@ def list( Args: gateway_id: gateway id + order_by: Order By Column Name + + order_by_direction: Order By Direction + search: Search by id, name, filters extra_headers: Send extra headers @@ -489,6 +504,8 @@ def list( { "enable": enable, "name": name, + "order_by": order_by, + "order_by_direction": order_by_direction, "page": page, "per_page": per_page, "search": search, diff --git a/src/cloudflare/resources/ai_gateway/evaluations.py b/src/cloudflare/resources/ai_gateway/evaluations.py index 5dbccd8f358..d0a00012074 100644 --- a/src/cloudflare/resources/ai_gateway/evaluations.py +++ b/src/cloudflare/resources/ai_gateway/evaluations.py @@ -3,6 +3,7 @@ from __future__ import annotations from typing import List, Type, cast +from typing_extensions import Literal import httpx @@ -110,6 +111,8 @@ def list( *, account_id: str, name: str | NotGiven = NOT_GIVEN, + order_by: str | NotGiven = NOT_GIVEN, + order_by_direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, page: int | NotGiven = NOT_GIVEN, per_page: int | NotGiven = NOT_GIVEN, processed: bool | NotGiven = NOT_GIVEN, @@ -127,6 +130,10 @@ def list( Args: gateway_id: gateway id + order_by: Order By Column Name + + order_by_direction: Order By Direction + search: Search by id, name extra_headers: Send extra headers @@ -152,6 +159,8 @@ def list( query=maybe_transform( { "name": name, + "order_by": order_by, + "order_by_direction": order_by_direction, "page": page, "per_page": per_page, "processed": processed, @@ -333,6 +342,8 @@ def list( *, account_id: str, name: str | NotGiven = NOT_GIVEN, + order_by: str | NotGiven = NOT_GIVEN, + order_by_direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, page: int | NotGiven = NOT_GIVEN, per_page: int | NotGiven = NOT_GIVEN, processed: bool | NotGiven = NOT_GIVEN, @@ -350,6 +361,10 @@ def list( Args: gateway_id: gateway id + order_by: Order By Column Name + + order_by_direction: Order By Direction + search: Search by id, name extra_headers: Send extra headers @@ -375,6 +390,8 @@ def list( query=maybe_transform( { "name": name, + "order_by": order_by, + "order_by_direction": order_by_direction, "page": page, "per_page": per_page, "processed": processed, diff --git a/src/cloudflare/resources/api_gateway/operations/operations.py b/src/cloudflare/resources/api_gateway/operations/operations.py index 2681b95f944..4e2c044805e 100644 --- a/src/cloudflare/resources/api_gateway/operations/operations.py +++ b/src/cloudflare/resources/api_gateway/operations/operations.py @@ -31,17 +31,11 @@ SchemaValidationResourceWithStreamingResponse, AsyncSchemaValidationResourceWithStreamingResponse, ) -from ....types.api_gateway import ( - operation_get_params, - operation_list_params, - operation_create_params, - operation_bulk_create_params, -) +from ....types.api_gateway import operation_get_params, operation_list_params, operation_create_params from ....types.api_gateway.operation_get_response import OperationGetResponse from ....types.api_gateway.operation_list_response import OperationListResponse from ....types.api_gateway.operation_create_response import OperationCreateResponse from ....types.api_gateway.operation_delete_response import OperationDeleteResponse -from ....types.api_gateway.operation_bulk_create_response import OperationBulkCreateResponse from ....types.api_gateway.operation_bulk_delete_response import OperationBulkDeleteResponse __all__ = ["OperationsResource", "AsyncOperationsResource"] @@ -75,9 +69,7 @@ def create( self, *, zone_id: str, - endpoint: str, - host: str, - method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"], + body: Iterable[operation_create_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -85,26 +77,17 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> OperationCreateResponse: - """Add one operation to a zone. + """Add one or more operations to a zone. - Endpoints can contain path variables. Host, method, - endpoint will be normalized to a canoncial form when creating an operation and - must be unique on the zone. Inserting an operation that matches an existing one - will return the record of the already existing operation and update its - last_updated date. + Endpoints can contain path variables. + Host, method, endpoint will be normalized to a canoncial form when creating an + operation and must be unique on the zone. Inserting an operation that matches an + existing one will return the record of the already existing operation and update + its last_updated date. Args: zone_id: Identifier - endpoint: The endpoint which can contain path parameter templates in curly braces, each - will be replaced from left to right with {varN}, starting with {var1}, during - insertion. This will further be Cloudflare-normalized upon insertion. See: - https://developers.cloudflare.com/rules/normalization/how-it-works/. - - host: RFC3986-compliant host. - - method: The HTTP method used to access the endpoint. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -116,15 +99,8 @@ def create( if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( - f"/zones/{zone_id}/api_gateway/operations/item", - body=maybe_transform( - { - "endpoint": endpoint, - "host": host, - "method": method, - }, - operation_create_params.OperationCreateParams, - ), + f"/zones/{zone_id}/api_gateway/operations", + body=maybe_transform(body, Iterable[operation_create_params.Body]), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -254,52 +230,6 @@ def delete( cast_to=OperationDeleteResponse, ) - def bulk_create( - self, - *, - zone_id: str, - body: Iterable[operation_bulk_create_params.Body], - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OperationBulkCreateResponse: - """Add one or more operations to a zone. - - Endpoints can contain path variables. - Host, method, endpoint will be normalized to a canoncial form when creating an - operation and must be unique on the zone. Inserting an operation that matches an - existing one will return the record of the already existing operation and update - its last_updated date. - - Args: - zone_id: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._post( - f"/zones/{zone_id}/api_gateway/operations", - body=maybe_transform(body, Iterable[operation_bulk_create_params.Body]), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[OperationBulkCreateResponse]._unwrapper, - ), - cast_to=cast(Type[OperationBulkCreateResponse], ResultWrapper[OperationBulkCreateResponse]), - ) - def bulk_delete( self, *, @@ -414,9 +344,7 @@ async def create( self, *, zone_id: str, - endpoint: str, - host: str, - method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"], + body: Iterable[operation_create_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -424,26 +352,17 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> OperationCreateResponse: - """Add one operation to a zone. + """Add one or more operations to a zone. - Endpoints can contain path variables. Host, method, - endpoint will be normalized to a canoncial form when creating an operation and - must be unique on the zone. Inserting an operation that matches an existing one - will return the record of the already existing operation and update its - last_updated date. + Endpoints can contain path variables. + Host, method, endpoint will be normalized to a canoncial form when creating an + operation and must be unique on the zone. Inserting an operation that matches an + existing one will return the record of the already existing operation and update + its last_updated date. Args: zone_id: Identifier - endpoint: The endpoint which can contain path parameter templates in curly braces, each - will be replaced from left to right with {varN}, starting with {var1}, during - insertion. This will further be Cloudflare-normalized upon insertion. See: - https://developers.cloudflare.com/rules/normalization/how-it-works/. - - host: RFC3986-compliant host. - - method: The HTTP method used to access the endpoint. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -455,15 +374,8 @@ async def create( if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( - f"/zones/{zone_id}/api_gateway/operations/item", - body=await async_maybe_transform( - { - "endpoint": endpoint, - "host": host, - "method": method, - }, - operation_create_params.OperationCreateParams, - ), + f"/zones/{zone_id}/api_gateway/operations", + body=await async_maybe_transform(body, Iterable[operation_create_params.Body]), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -593,52 +505,6 @@ async def delete( cast_to=OperationDeleteResponse, ) - async def bulk_create( - self, - *, - zone_id: str, - body: Iterable[operation_bulk_create_params.Body], - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OperationBulkCreateResponse: - """Add one or more operations to a zone. - - Endpoints can contain path variables. - Host, method, endpoint will be normalized to a canoncial form when creating an - operation and must be unique on the zone. Inserting an operation that matches an - existing one will return the record of the already existing operation and update - its last_updated date. - - Args: - zone_id: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._post( - f"/zones/{zone_id}/api_gateway/operations", - body=await async_maybe_transform(body, Iterable[operation_bulk_create_params.Body]), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[OperationBulkCreateResponse]._unwrapper, - ), - cast_to=cast(Type[OperationBulkCreateResponse], ResultWrapper[OperationBulkCreateResponse]), - ) - async def bulk_delete( self, *, @@ -738,9 +604,6 @@ def __init__(self, operations: OperationsResource) -> None: self.delete = to_raw_response_wrapper( operations.delete, ) - self.bulk_create = to_raw_response_wrapper( - operations.bulk_create, - ) self.bulk_delete = to_raw_response_wrapper( operations.bulk_delete, ) @@ -766,9 +629,6 @@ def __init__(self, operations: AsyncOperationsResource) -> None: self.delete = async_to_raw_response_wrapper( operations.delete, ) - self.bulk_create = async_to_raw_response_wrapper( - operations.bulk_create, - ) self.bulk_delete = async_to_raw_response_wrapper( operations.bulk_delete, ) @@ -794,9 +654,6 @@ def __init__(self, operations: OperationsResource) -> None: self.delete = to_streamed_response_wrapper( operations.delete, ) - self.bulk_create = to_streamed_response_wrapper( - operations.bulk_create, - ) self.bulk_delete = to_streamed_response_wrapper( operations.bulk_delete, ) @@ -822,9 +679,6 @@ def __init__(self, operations: AsyncOperationsResource) -> None: self.delete = async_to_streamed_response_wrapper( operations.delete, ) - self.bulk_create = async_to_streamed_response_wrapper( - operations.bulk_create, - ) self.bulk_delete = async_to_streamed_response_wrapper( operations.bulk_delete, ) diff --git a/src/cloudflare/resources/argo/tiered_caching.py b/src/cloudflare/resources/argo/tiered_caching.py index 066b5a75b53..46fb96c1e31 100644 --- a/src/cloudflare/resources/argo/tiered_caching.py +++ b/src/cloudflare/resources/argo/tiered_caching.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, Optional, cast +from typing import Type, cast from typing_extensions import Literal import httpx @@ -60,19 +60,9 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[TieredCachingEditResponse]: + ) -> TieredCachingEditResponse: """ - Tiered Cache works by dividing Cloudflare's data centers into a hierarchy of - lower-tiers and upper-tiers. If content is not cached in lower-tier data centers - (generally the ones closest to a visitor), the lower-tier must ask an upper-tier - to see if it has the content. If the upper-tier does not have the content, only - the upper-tier can ask the origin for content. This practice improves bandwidth - efficiency by limiting the number of data centers that can ask the origin for - content, which reduces origin load and makes websites more cost-effective to - operate. Additionally, Tiered Cache concentrates connections to origin servers - so they come from a small number of data centers rather than the full set of - network locations. This results in fewer open connections using server - resources. + Updates enablement of Tiered Caching Args: zone_id: Identifier @@ -97,9 +87,9 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[TieredCachingEditResponse]]._unwrapper, + post_parser=ResultWrapper[TieredCachingEditResponse]._unwrapper, ), - cast_to=cast(Type[Optional[TieredCachingEditResponse]], ResultWrapper[TieredCachingEditResponse]), + cast_to=cast(Type[TieredCachingEditResponse], ResultWrapper[TieredCachingEditResponse]), ) def get( @@ -112,19 +102,9 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[TieredCachingGetResponse]: + ) -> TieredCachingGetResponse: """ - Tiered Cache works by dividing Cloudflare's data centers into a hierarchy of - lower-tiers and upper-tiers. If content is not cached in lower-tier data centers - (generally the ones closest to a visitor), the lower-tier must ask an upper-tier - to see if it has the content. If the upper-tier does not have the content, only - the upper-tier can ask the origin for content. This practice improves bandwidth - efficiency by limiting the number of data centers that can ask the origin for - content, which reduces origin load and makes websites more cost-effective to - operate. Additionally, Tiered Cache concentrates connections to origin servers - so they come from a small number of data centers rather than the full set of - network locations. This results in fewer open connections using server - resources. + Get Tiered Caching setting Args: zone_id: Identifier @@ -146,9 +126,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[TieredCachingGetResponse]]._unwrapper, + post_parser=ResultWrapper[TieredCachingGetResponse]._unwrapper, ), - cast_to=cast(Type[Optional[TieredCachingGetResponse]], ResultWrapper[TieredCachingGetResponse]), + cast_to=cast(Type[TieredCachingGetResponse], ResultWrapper[TieredCachingGetResponse]), ) @@ -183,19 +163,9 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[TieredCachingEditResponse]: + ) -> TieredCachingEditResponse: """ - Tiered Cache works by dividing Cloudflare's data centers into a hierarchy of - lower-tiers and upper-tiers. If content is not cached in lower-tier data centers - (generally the ones closest to a visitor), the lower-tier must ask an upper-tier - to see if it has the content. If the upper-tier does not have the content, only - the upper-tier can ask the origin for content. This practice improves bandwidth - efficiency by limiting the number of data centers that can ask the origin for - content, which reduces origin load and makes websites more cost-effective to - operate. Additionally, Tiered Cache concentrates connections to origin servers - so they come from a small number of data centers rather than the full set of - network locations. This results in fewer open connections using server - resources. + Updates enablement of Tiered Caching Args: zone_id: Identifier @@ -220,9 +190,9 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[TieredCachingEditResponse]]._unwrapper, + post_parser=ResultWrapper[TieredCachingEditResponse]._unwrapper, ), - cast_to=cast(Type[Optional[TieredCachingEditResponse]], ResultWrapper[TieredCachingEditResponse]), + cast_to=cast(Type[TieredCachingEditResponse], ResultWrapper[TieredCachingEditResponse]), ) async def get( @@ -235,19 +205,9 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[TieredCachingGetResponse]: + ) -> TieredCachingGetResponse: """ - Tiered Cache works by dividing Cloudflare's data centers into a hierarchy of - lower-tiers and upper-tiers. If content is not cached in lower-tier data centers - (generally the ones closest to a visitor), the lower-tier must ask an upper-tier - to see if it has the content. If the upper-tier does not have the content, only - the upper-tier can ask the origin for content. This practice improves bandwidth - efficiency by limiting the number of data centers that can ask the origin for - content, which reduces origin load and makes websites more cost-effective to - operate. Additionally, Tiered Cache concentrates connections to origin servers - so they come from a small number of data centers rather than the full set of - network locations. This results in fewer open connections using server - resources. + Get Tiered Caching setting Args: zone_id: Identifier @@ -269,9 +229,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[TieredCachingGetResponse]]._unwrapper, + post_parser=ResultWrapper[TieredCachingGetResponse]._unwrapper, ), - cast_to=cast(Type[Optional[TieredCachingGetResponse]], ResultWrapper[TieredCachingGetResponse]), + cast_to=cast(Type[TieredCachingGetResponse], ResultWrapper[TieredCachingGetResponse]), ) diff --git a/src/cloudflare/resources/cache/cache_reserve.py b/src/cloudflare/resources/cache/cache_reserve.py index df5c9f28ccf..9116ecc0307 100644 --- a/src/cloudflare/resources/cache/cache_reserve.py +++ b/src/cloudflare/resources/cache/cache_reserve.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, Optional, cast +from typing import Type, cast from typing_extensions import Literal import httpx @@ -62,7 +62,7 @@ def clear( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CacheReserveClearResponse]: + ) -> CacheReserveClearResponse: """ You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. @@ -90,9 +90,9 @@ def clear( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CacheReserveClearResponse]]._unwrapper, + post_parser=ResultWrapper[CacheReserveClearResponse]._unwrapper, ), - cast_to=cast(Type[Optional[CacheReserveClearResponse]], ResultWrapper[CacheReserveClearResponse]), + cast_to=cast(Type[CacheReserveClearResponse], ResultWrapper[CacheReserveClearResponse]), ) def edit( @@ -106,7 +106,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CacheReserveEditResponse]: + ) -> CacheReserveEditResponse: """ Increase cache lifetimes by automatically storing all cacheable files into Cloudflare's persistent object storage buckets. Requires Cache Reserve @@ -138,9 +138,9 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CacheReserveEditResponse]]._unwrapper, + post_parser=ResultWrapper[CacheReserveEditResponse]._unwrapper, ), - cast_to=cast(Type[Optional[CacheReserveEditResponse]], ResultWrapper[CacheReserveEditResponse]), + cast_to=cast(Type[CacheReserveEditResponse], ResultWrapper[CacheReserveEditResponse]), ) def get( @@ -153,7 +153,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CacheReserveGetResponse]: + ) -> CacheReserveGetResponse: """ Increase cache lifetimes by automatically storing all cacheable files into Cloudflare's persistent object storage buckets. Requires Cache Reserve @@ -182,9 +182,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CacheReserveGetResponse]]._unwrapper, + post_parser=ResultWrapper[CacheReserveGetResponse]._unwrapper, ), - cast_to=cast(Type[Optional[CacheReserveGetResponse]], ResultWrapper[CacheReserveGetResponse]), + cast_to=cast(Type[CacheReserveGetResponse], ResultWrapper[CacheReserveGetResponse]), ) def status( @@ -197,7 +197,7 @@ def status( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CacheReserveStatusResponse]: + ) -> CacheReserveStatusResponse: """ You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. @@ -224,9 +224,9 @@ def status( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CacheReserveStatusResponse]]._unwrapper, + post_parser=ResultWrapper[CacheReserveStatusResponse]._unwrapper, ), - cast_to=cast(Type[Optional[CacheReserveStatusResponse]], ResultWrapper[CacheReserveStatusResponse]), + cast_to=cast(Type[CacheReserveStatusResponse], ResultWrapper[CacheReserveStatusResponse]), ) @@ -261,7 +261,7 @@ async def clear( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CacheReserveClearResponse]: + ) -> CacheReserveClearResponse: """ You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. @@ -289,9 +289,9 @@ async def clear( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CacheReserveClearResponse]]._unwrapper, + post_parser=ResultWrapper[CacheReserveClearResponse]._unwrapper, ), - cast_to=cast(Type[Optional[CacheReserveClearResponse]], ResultWrapper[CacheReserveClearResponse]), + cast_to=cast(Type[CacheReserveClearResponse], ResultWrapper[CacheReserveClearResponse]), ) async def edit( @@ -305,7 +305,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CacheReserveEditResponse]: + ) -> CacheReserveEditResponse: """ Increase cache lifetimes by automatically storing all cacheable files into Cloudflare's persistent object storage buckets. Requires Cache Reserve @@ -337,9 +337,9 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CacheReserveEditResponse]]._unwrapper, + post_parser=ResultWrapper[CacheReserveEditResponse]._unwrapper, ), - cast_to=cast(Type[Optional[CacheReserveEditResponse]], ResultWrapper[CacheReserveEditResponse]), + cast_to=cast(Type[CacheReserveEditResponse], ResultWrapper[CacheReserveEditResponse]), ) async def get( @@ -352,7 +352,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CacheReserveGetResponse]: + ) -> CacheReserveGetResponse: """ Increase cache lifetimes by automatically storing all cacheable files into Cloudflare's persistent object storage buckets. Requires Cache Reserve @@ -381,9 +381,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CacheReserveGetResponse]]._unwrapper, + post_parser=ResultWrapper[CacheReserveGetResponse]._unwrapper, ), - cast_to=cast(Type[Optional[CacheReserveGetResponse]], ResultWrapper[CacheReserveGetResponse]), + cast_to=cast(Type[CacheReserveGetResponse], ResultWrapper[CacheReserveGetResponse]), ) async def status( @@ -396,7 +396,7 @@ async def status( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CacheReserveStatusResponse]: + ) -> CacheReserveStatusResponse: """ You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. @@ -423,9 +423,9 @@ async def status( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CacheReserveStatusResponse]]._unwrapper, + post_parser=ResultWrapper[CacheReserveStatusResponse]._unwrapper, ), - cast_to=cast(Type[Optional[CacheReserveStatusResponse]], ResultWrapper[CacheReserveStatusResponse]), + cast_to=cast(Type[CacheReserveStatusResponse], ResultWrapper[CacheReserveStatusResponse]), ) diff --git a/src/cloudflare/resources/cache/regional_tiered_cache.py b/src/cloudflare/resources/cache/regional_tiered_cache.py index 69889f46644..e2d101b0154 100644 --- a/src/cloudflare/resources/cache/regional_tiered_cache.py +++ b/src/cloudflare/resources/cache/regional_tiered_cache.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, Optional, cast +from typing import Type, cast from typing_extensions import Literal import httpx @@ -60,7 +60,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RegionalTieredCacheEditResponse]: + ) -> RegionalTieredCacheEditResponse: """ Instructs Cloudflare to check a regional hub data center on the way to your upper tier. This can help improve performance for smart and custom tiered cache @@ -89,11 +89,9 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RegionalTieredCacheEditResponse]]._unwrapper, - ), - cast_to=cast( - Type[Optional[RegionalTieredCacheEditResponse]], ResultWrapper[RegionalTieredCacheEditResponse] + post_parser=ResultWrapper[RegionalTieredCacheEditResponse]._unwrapper, ), + cast_to=cast(Type[RegionalTieredCacheEditResponse], ResultWrapper[RegionalTieredCacheEditResponse]), ) def get( @@ -106,7 +104,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RegionalTieredCacheGetResponse]: + ) -> RegionalTieredCacheGetResponse: """ Instructs Cloudflare to check a regional hub data center on the way to your upper tier. This can help improve performance for smart and custom tiered cache @@ -132,9 +130,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RegionalTieredCacheGetResponse]]._unwrapper, + post_parser=ResultWrapper[RegionalTieredCacheGetResponse]._unwrapper, ), - cast_to=cast(Type[Optional[RegionalTieredCacheGetResponse]], ResultWrapper[RegionalTieredCacheGetResponse]), + cast_to=cast(Type[RegionalTieredCacheGetResponse], ResultWrapper[RegionalTieredCacheGetResponse]), ) @@ -169,7 +167,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RegionalTieredCacheEditResponse]: + ) -> RegionalTieredCacheEditResponse: """ Instructs Cloudflare to check a regional hub data center on the way to your upper tier. This can help improve performance for smart and custom tiered cache @@ -200,11 +198,9 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RegionalTieredCacheEditResponse]]._unwrapper, - ), - cast_to=cast( - Type[Optional[RegionalTieredCacheEditResponse]], ResultWrapper[RegionalTieredCacheEditResponse] + post_parser=ResultWrapper[RegionalTieredCacheEditResponse]._unwrapper, ), + cast_to=cast(Type[RegionalTieredCacheEditResponse], ResultWrapper[RegionalTieredCacheEditResponse]), ) async def get( @@ -217,7 +213,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RegionalTieredCacheGetResponse]: + ) -> RegionalTieredCacheGetResponse: """ Instructs Cloudflare to check a regional hub data center on the way to your upper tier. This can help improve performance for smart and custom tiered cache @@ -243,9 +239,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RegionalTieredCacheGetResponse]]._unwrapper, + post_parser=ResultWrapper[RegionalTieredCacheGetResponse]._unwrapper, ), - cast_to=cast(Type[Optional[RegionalTieredCacheGetResponse]], ResultWrapper[RegionalTieredCacheGetResponse]), + cast_to=cast(Type[RegionalTieredCacheGetResponse], ResultWrapper[RegionalTieredCacheGetResponse]), ) diff --git a/src/cloudflare/resources/cache/smart_tiered_cache.py b/src/cloudflare/resources/cache/smart_tiered_cache.py index 93a2f3510cf..abd3127ed38 100644 --- a/src/cloudflare/resources/cache/smart_tiered_cache.py +++ b/src/cloudflare/resources/cache/smart_tiered_cache.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, Optional, cast +from typing import Type, cast from typing_extensions import Literal import httpx @@ -60,14 +60,9 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[SmartTieredCacheDeleteResponse]: + ) -> SmartTieredCacheDeleteResponse: """ - Smart Tiered Cache dynamically selects the single closest upper tier for each of - your website’s origins with no configuration required, using our in-house - performance and routing data. Cloudflare collects latency data for each request - to an origin, and uses the latency data to determine how well any upper-tier - data center is connected with an origin. As a result, Cloudflare can select the - data center with the lowest latency to be the upper-tier for an origin. + Remvoves enablement of Smart Tiered Cache Args: zone_id: Identifier @@ -89,9 +84,9 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[SmartTieredCacheDeleteResponse]]._unwrapper, + post_parser=ResultWrapper[SmartTieredCacheDeleteResponse]._unwrapper, ), - cast_to=cast(Type[Optional[SmartTieredCacheDeleteResponse]], ResultWrapper[SmartTieredCacheDeleteResponse]), + cast_to=cast(Type[SmartTieredCacheDeleteResponse], ResultWrapper[SmartTieredCacheDeleteResponse]), ) def edit( @@ -105,14 +100,9 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[SmartTieredCacheEditResponse]: + ) -> SmartTieredCacheEditResponse: """ - Smart Tiered Cache dynamically selects the single closest upper tier for each of - your website’s origins with no configuration required, using our in-house - performance and routing data. Cloudflare collects latency data for each request - to an origin, and uses the latency data to determine how well any upper-tier - data center is connected with an origin. As a result, Cloudflare can select the - data center with the lowest latency to be the upper-tier for an origin. + Updates enablement of Tiered Cache Args: zone_id: Identifier @@ -137,9 +127,9 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[SmartTieredCacheEditResponse]]._unwrapper, + post_parser=ResultWrapper[SmartTieredCacheEditResponse]._unwrapper, ), - cast_to=cast(Type[Optional[SmartTieredCacheEditResponse]], ResultWrapper[SmartTieredCacheEditResponse]), + cast_to=cast(Type[SmartTieredCacheEditResponse], ResultWrapper[SmartTieredCacheEditResponse]), ) def get( @@ -152,14 +142,9 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[SmartTieredCacheGetResponse]: + ) -> SmartTieredCacheGetResponse: """ - Smart Tiered Cache dynamically selects the single closest upper tier for each of - your website’s origins with no configuration required, using our in-house - performance and routing data. Cloudflare collects latency data for each request - to an origin, and uses the latency data to determine how well any upper-tier - data center is connected with an origin. As a result, Cloudflare can select the - data center with the lowest latency to be the upper-tier for an origin. + Get Smart Tiered Cache setting Args: zone_id: Identifier @@ -181,9 +166,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[SmartTieredCacheGetResponse]]._unwrapper, + post_parser=ResultWrapper[SmartTieredCacheGetResponse]._unwrapper, ), - cast_to=cast(Type[Optional[SmartTieredCacheGetResponse]], ResultWrapper[SmartTieredCacheGetResponse]), + cast_to=cast(Type[SmartTieredCacheGetResponse], ResultWrapper[SmartTieredCacheGetResponse]), ) @@ -217,14 +202,9 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[SmartTieredCacheDeleteResponse]: + ) -> SmartTieredCacheDeleteResponse: """ - Smart Tiered Cache dynamically selects the single closest upper tier for each of - your website’s origins with no configuration required, using our in-house - performance and routing data. Cloudflare collects latency data for each request - to an origin, and uses the latency data to determine how well any upper-tier - data center is connected with an origin. As a result, Cloudflare can select the - data center with the lowest latency to be the upper-tier for an origin. + Remvoves enablement of Smart Tiered Cache Args: zone_id: Identifier @@ -246,9 +226,9 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[SmartTieredCacheDeleteResponse]]._unwrapper, + post_parser=ResultWrapper[SmartTieredCacheDeleteResponse]._unwrapper, ), - cast_to=cast(Type[Optional[SmartTieredCacheDeleteResponse]], ResultWrapper[SmartTieredCacheDeleteResponse]), + cast_to=cast(Type[SmartTieredCacheDeleteResponse], ResultWrapper[SmartTieredCacheDeleteResponse]), ) async def edit( @@ -262,14 +242,9 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[SmartTieredCacheEditResponse]: + ) -> SmartTieredCacheEditResponse: """ - Smart Tiered Cache dynamically selects the single closest upper tier for each of - your website’s origins with no configuration required, using our in-house - performance and routing data. Cloudflare collects latency data for each request - to an origin, and uses the latency data to determine how well any upper-tier - data center is connected with an origin. As a result, Cloudflare can select the - data center with the lowest latency to be the upper-tier for an origin. + Updates enablement of Tiered Cache Args: zone_id: Identifier @@ -296,9 +271,9 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[SmartTieredCacheEditResponse]]._unwrapper, + post_parser=ResultWrapper[SmartTieredCacheEditResponse]._unwrapper, ), - cast_to=cast(Type[Optional[SmartTieredCacheEditResponse]], ResultWrapper[SmartTieredCacheEditResponse]), + cast_to=cast(Type[SmartTieredCacheEditResponse], ResultWrapper[SmartTieredCacheEditResponse]), ) async def get( @@ -311,14 +286,9 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[SmartTieredCacheGetResponse]: + ) -> SmartTieredCacheGetResponse: """ - Smart Tiered Cache dynamically selects the single closest upper tier for each of - your website’s origins with no configuration required, using our in-house - performance and routing data. Cloudflare collects latency data for each request - to an origin, and uses the latency data to determine how well any upper-tier - data center is connected with an origin. As a result, Cloudflare can select the - data center with the lowest latency to be the upper-tier for an origin. + Get Smart Tiered Cache setting Args: zone_id: Identifier @@ -340,9 +310,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[SmartTieredCacheGetResponse]]._unwrapper, + post_parser=ResultWrapper[SmartTieredCacheGetResponse]._unwrapper, ), - cast_to=cast(Type[Optional[SmartTieredCacheGetResponse]], ResultWrapper[SmartTieredCacheGetResponse]), + cast_to=cast(Type[SmartTieredCacheGetResponse], ResultWrapper[SmartTieredCacheGetResponse]), ) diff --git a/src/cloudflare/resources/cache/variants.py b/src/cloudflare/resources/cache/variants.py index 04b84159e3b..254dbf3eb20 100644 --- a/src/cloudflare/resources/cache/variants.py +++ b/src/cloudflare/resources/cache/variants.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, Optional, cast +from typing import Type, cast import httpx @@ -22,9 +22,9 @@ from ..._wrappers import ResultWrapper from ...types.cache import variant_edit_params from ..._base_client import make_request_options +from ...types.cache.cache_variant import CacheVariant from ...types.cache.variant_get_response import VariantGetResponse from ...types.cache.variant_edit_response import VariantEditResponse -from ...types.cache.variant_delete_response import VariantDeleteResponse __all__ = ["VariantsResource", "AsyncVariantsResource"] @@ -59,7 +59,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[VariantDeleteResponse]: + ) -> CacheVariant: """ Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the @@ -87,9 +87,9 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[VariantDeleteResponse]]._unwrapper, + post_parser=ResultWrapper[CacheVariant]._unwrapper, ), - cast_to=cast(Type[Optional[VariantDeleteResponse]], ResultWrapper[VariantDeleteResponse]), + cast_to=cast(Type[CacheVariant], ResultWrapper[CacheVariant]), ) def edit( @@ -103,7 +103,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[VariantEditResponse]: + ) -> VariantEditResponse: """ Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the @@ -134,9 +134,9 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[VariantEditResponse]]._unwrapper, + post_parser=ResultWrapper[VariantEditResponse]._unwrapper, ), - cast_to=cast(Type[Optional[VariantEditResponse]], ResultWrapper[VariantEditResponse]), + cast_to=cast(Type[VariantEditResponse], ResultWrapper[VariantEditResponse]), ) def get( @@ -149,7 +149,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[VariantGetResponse]: + ) -> VariantGetResponse: """ Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the @@ -177,9 +177,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[VariantGetResponse]]._unwrapper, + post_parser=ResultWrapper[VariantGetResponse]._unwrapper, ), - cast_to=cast(Type[Optional[VariantGetResponse]], ResultWrapper[VariantGetResponse]), + cast_to=cast(Type[VariantGetResponse], ResultWrapper[VariantGetResponse]), ) @@ -213,7 +213,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[VariantDeleteResponse]: + ) -> CacheVariant: """ Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the @@ -241,9 +241,9 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[VariantDeleteResponse]]._unwrapper, + post_parser=ResultWrapper[CacheVariant]._unwrapper, ), - cast_to=cast(Type[Optional[VariantDeleteResponse]], ResultWrapper[VariantDeleteResponse]), + cast_to=cast(Type[CacheVariant], ResultWrapper[CacheVariant]), ) async def edit( @@ -257,7 +257,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[VariantEditResponse]: + ) -> VariantEditResponse: """ Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the @@ -288,9 +288,9 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[VariantEditResponse]]._unwrapper, + post_parser=ResultWrapper[VariantEditResponse]._unwrapper, ), - cast_to=cast(Type[Optional[VariantEditResponse]], ResultWrapper[VariantEditResponse]), + cast_to=cast(Type[VariantEditResponse], ResultWrapper[VariantEditResponse]), ) async def get( @@ -303,7 +303,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[VariantGetResponse]: + ) -> VariantGetResponse: """ Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the @@ -331,9 +331,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[VariantGetResponse]]._unwrapper, + post_parser=ResultWrapper[VariantGetResponse]._unwrapper, ), - cast_to=cast(Type[Optional[VariantGetResponse]], ResultWrapper[VariantGetResponse]), + cast_to=cast(Type[VariantGetResponse], ResultWrapper[VariantGetResponse]), ) diff --git a/src/cloudflare/resources/cloud_connector/rules.py b/src/cloudflare/resources/cloud_connector/rules.py index d067255d0ee..2a80d122319 100644 --- a/src/cloudflare/resources/cloud_connector/rules.py +++ b/src/cloudflare/resources/cloud_connector/rules.py @@ -53,7 +53,7 @@ def update( self, *, zone_id: str, - rules: Iterable[rule_update_params.Rule], + body: Iterable[rule_update_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -67,7 +67,7 @@ def update( Args: zone_id: Identifier - rules: List of Cloud Connector rules + body: List of Cloud Connector rules extra_headers: Send extra headers @@ -81,7 +81,7 @@ def update( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._put( f"/zones/{zone_id}/cloud_connector/rules", - body=maybe_transform(rules, Iterable[rule_update_params.Rule]), + body=maybe_transform(body, Iterable[rule_update_params.Body]), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -153,7 +153,7 @@ async def update( self, *, zone_id: str, - rules: Iterable[rule_update_params.Rule], + body: Iterable[rule_update_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -167,7 +167,7 @@ async def update( Args: zone_id: Identifier - rules: List of Cloud Connector rules + body: List of Cloud Connector rules extra_headers: Send extra headers @@ -181,7 +181,7 @@ async def update( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._put( f"/zones/{zone_id}/cloud_connector/rules", - body=await async_maybe_transform(rules, Iterable[rule_update_params.Rule]), + body=await async_maybe_transform(body, Iterable[rule_update_params.Body]), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/cloudflare/resources/dns/records.py b/src/cloudflare/resources/dns/records.py index 61a0e3e043d..9ef6762d58f 100644 --- a/src/cloudflare/resources/dns/records.py +++ b/src/cloudflare/resources/dns/records.py @@ -36,14 +36,16 @@ from ...types.dns.ttl_param import TTLParam from ...types.dns.record_tags import RecordTags from ...types.dns.record_param import RecordParam -from ...types.dns.batch_put_param import BatchPutParam -from ...types.dns.record_response import RecordResponse -from ...types.dns.batch_patch_param import BatchPatchParam from ...types.shared.sort_direction import SortDirection +from ...types.dns.record_get_response import RecordGetResponse +from ...types.dns.record_edit_response import RecordEditResponse +from ...types.dns.record_list_response import RecordListResponse from ...types.dns.record_scan_response import RecordScanResponse from ...types.dns.record_batch_response import RecordBatchResponse +from ...types.dns.record_create_response import RecordCreateResponse from ...types.dns.record_delete_response import RecordDeleteResponse from ...types.dns.record_import_response import RecordImportResponse +from ...types.dns.record_update_response import RecordUpdateResponse __all__ = ["RecordsResource", "AsyncRecordsResource"] @@ -77,7 +79,6 @@ def create( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.ARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["A"] | NotGiven = NOT_GIVEN, @@ -87,7 +88,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -111,8 +112,6 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -140,7 +139,6 @@ def create( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.AAAARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["AAAA"] | NotGiven = NOT_GIVEN, @@ -150,7 +148,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -174,8 +172,6 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -203,7 +199,6 @@ def create( data: record_create_params.CAARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.CAARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["CAA"] | NotGiven = NOT_GIVEN, @@ -213,7 +208,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -237,8 +232,6 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -266,7 +259,6 @@ def create( data: record_create_params.CERTRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.CERTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["CERT"] | NotGiven = NOT_GIVEN, @@ -276,7 +268,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -300,8 +292,6 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -339,7 +329,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -363,8 +353,6 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -392,7 +380,6 @@ def create( data: record_create_params.DNSKEYRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.DNSKEYRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["DNSKEY"] | NotGiven = NOT_GIVEN, @@ -402,7 +389,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -426,8 +413,6 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -455,7 +440,6 @@ def create( data: record_create_params.DSRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.DSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["DS"] | NotGiven = NOT_GIVEN, @@ -465,7 +449,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -489,8 +473,6 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -518,7 +500,6 @@ def create( data: record_create_params.HTTPSRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.HTTPSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["HTTPS"] | NotGiven = NOT_GIVEN, @@ -528,7 +509,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -552,8 +533,6 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -581,7 +560,6 @@ def create( data: record_create_params.LOCRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.LOCRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["LOC"] | NotGiven = NOT_GIVEN, @@ -591,7 +569,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -615,8 +593,6 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -645,7 +621,6 @@ def create( name: str | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.MXRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["MX"] | NotGiven = NOT_GIVEN, @@ -655,7 +630,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -682,8 +657,6 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -711,7 +684,6 @@ def create( data: record_create_params.NAPTRRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.NAPTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["NAPTR"] | NotGiven = NOT_GIVEN, @@ -721,7 +693,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -745,8 +717,6 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -774,7 +744,6 @@ def create( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.NSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["NS"] | NotGiven = NOT_GIVEN, @@ -784,7 +753,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -808,8 +777,6 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -837,7 +804,6 @@ def create( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.DNSRecordsOpenpgpkeyRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["OPENPGPKEY"] | NotGiven = NOT_GIVEN, @@ -847,7 +813,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -871,8 +837,6 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -900,7 +864,6 @@ def create( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.PTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["PTR"] | NotGiven = NOT_GIVEN, @@ -910,7 +873,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -934,8 +897,6 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -963,7 +924,6 @@ def create( data: record_create_params.SMIMEARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.SMIMEARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SMIMEA"] | NotGiven = NOT_GIVEN, @@ -973,7 +933,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -997,8 +957,6 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -1026,7 +984,6 @@ def create( data: record_create_params.SRVRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.SRVRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SRV"] | NotGiven = NOT_GIVEN, @@ -1036,7 +993,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -1060,8 +1017,6 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -1089,7 +1044,6 @@ def create( data: record_create_params.SSHFPRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.SSHFPRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SSHFP"] | NotGiven = NOT_GIVEN, @@ -1099,7 +1053,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -1123,8 +1077,6 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -1152,7 +1104,6 @@ def create( data: record_create_params.SVCBRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.SVCBRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SVCB"] | NotGiven = NOT_GIVEN, @@ -1162,7 +1113,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -1186,8 +1137,6 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -1215,7 +1164,6 @@ def create( data: record_create_params.TLSARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.TLSARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["TLSA"] | NotGiven = NOT_GIVEN, @@ -1225,7 +1173,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -1249,8 +1197,6 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -1278,7 +1224,6 @@ def create( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.TXTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["TXT"] | NotGiven = NOT_GIVEN, @@ -1288,7 +1233,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -1317,8 +1262,6 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -1347,7 +1290,6 @@ def create( name: str | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.URIRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["URI"] | NotGiven = NOT_GIVEN, @@ -1357,7 +1299,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -1384,8 +1326,6 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -1413,9 +1353,6 @@ def create( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.ARecordSettings - | record_create_params.CNAMERecordSettings - | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["A"] @@ -1452,6 +1389,7 @@ def create( | record_create_params.SSHFPRecordData | record_create_params.URIRecordData | NotGiven = NOT_GIVEN, + settings: record_create_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1459,11 +1397,11 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( - Optional[RecordResponse], + Optional[RecordCreateResponse], self._post( f"/zones/{zone_id}/dns_records", body=maybe_transform( @@ -1472,11 +1410,11 @@ def create( "content": content, "name": name, "proxied": proxied, - "settings": settings, "tags": tags, "ttl": ttl, "type": type, "data": data, + "settings": settings, "priority": priority, }, record_create_params.RecordCreateParams, @@ -1486,10 +1424,10 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RecordResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[RecordCreateResponse]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[RecordResponse] + Any, ResultWrapper[RecordCreateResponse] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -1504,7 +1442,6 @@ def update( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.ARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["A"] | NotGiven = NOT_GIVEN, @@ -1514,7 +1451,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -1540,8 +1477,6 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -1570,7 +1505,6 @@ def update( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.AAAARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["AAAA"] | NotGiven = NOT_GIVEN, @@ -1580,7 +1514,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -1606,8 +1540,6 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -1636,7 +1568,6 @@ def update( data: record_update_params.CAARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.CAARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["CAA"] | NotGiven = NOT_GIVEN, @@ -1646,7 +1577,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -1672,8 +1603,6 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -1702,7 +1631,6 @@ def update( data: record_update_params.CERTRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.CERTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["CERT"] | NotGiven = NOT_GIVEN, @@ -1712,7 +1640,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -1738,8 +1666,6 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -1778,7 +1704,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -1804,8 +1730,6 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -1834,7 +1758,6 @@ def update( data: record_update_params.DNSKEYRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.DNSKEYRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["DNSKEY"] | NotGiven = NOT_GIVEN, @@ -1844,7 +1767,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -1870,8 +1793,6 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -1900,7 +1821,6 @@ def update( data: record_update_params.DSRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.DSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["DS"] | NotGiven = NOT_GIVEN, @@ -1910,7 +1830,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -1936,8 +1856,6 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -1966,7 +1884,6 @@ def update( data: record_update_params.HTTPSRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.HTTPSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["HTTPS"] | NotGiven = NOT_GIVEN, @@ -1976,7 +1893,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -2002,8 +1919,6 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -2032,7 +1947,6 @@ def update( data: record_update_params.LOCRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.LOCRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["LOC"] | NotGiven = NOT_GIVEN, @@ -2042,7 +1956,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -2068,8 +1982,6 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -2099,7 +2011,6 @@ def update( name: str | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.MXRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["MX"] | NotGiven = NOT_GIVEN, @@ -2109,7 +2020,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -2138,8 +2049,6 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -2168,7 +2077,6 @@ def update( data: record_update_params.NAPTRRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.NAPTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["NAPTR"] | NotGiven = NOT_GIVEN, @@ -2178,7 +2086,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -2204,8 +2112,6 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -2234,7 +2140,6 @@ def update( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.NSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["NS"] | NotGiven = NOT_GIVEN, @@ -2244,7 +2149,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -2270,8 +2175,6 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -2300,7 +2203,6 @@ def update( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.DNSRecordsOpenpgpkeyRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["OPENPGPKEY"] | NotGiven = NOT_GIVEN, @@ -2310,7 +2212,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -2336,8 +2238,6 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -2366,7 +2266,6 @@ def update( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.PTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["PTR"] | NotGiven = NOT_GIVEN, @@ -2376,7 +2275,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -2402,8 +2301,6 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -2432,7 +2329,6 @@ def update( data: record_update_params.SMIMEARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.SMIMEARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SMIMEA"] | NotGiven = NOT_GIVEN, @@ -2442,7 +2338,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -2468,8 +2364,6 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -2498,7 +2392,6 @@ def update( data: record_update_params.SRVRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.SRVRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SRV"] | NotGiven = NOT_GIVEN, @@ -2508,7 +2401,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -2534,8 +2427,6 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -2564,7 +2455,6 @@ def update( data: record_update_params.SSHFPRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.SSHFPRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SSHFP"] | NotGiven = NOT_GIVEN, @@ -2574,7 +2464,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -2600,8 +2490,6 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -2630,7 +2518,6 @@ def update( data: record_update_params.SVCBRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.SVCBRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SVCB"] | NotGiven = NOT_GIVEN, @@ -2640,7 +2527,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -2666,8 +2553,6 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -2696,7 +2581,6 @@ def update( data: record_update_params.TLSARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.TLSARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["TLSA"] | NotGiven = NOT_GIVEN, @@ -2706,7 +2590,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -2732,8 +2616,6 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -2762,7 +2644,6 @@ def update( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.TXTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["TXT"] | NotGiven = NOT_GIVEN, @@ -2772,7 +2653,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -2803,8 +2684,6 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -2834,7 +2713,6 @@ def update( name: str | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.URIRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["URI"] | NotGiven = NOT_GIVEN, @@ -2844,7 +2722,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -2873,8 +2751,6 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -2903,9 +2779,6 @@ def update( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.ARecordSettings - | record_update_params.CNAMERecordSettings - | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["A"] @@ -2942,6 +2815,7 @@ def update( | record_update_params.SSHFPRecordData | record_update_params.URIRecordData | NotGiven = NOT_GIVEN, + settings: record_update_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2949,13 +2823,13 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not dns_record_id: raise ValueError(f"Expected a non-empty value for `dns_record_id` but received {dns_record_id!r}") return cast( - Optional[RecordResponse], + Optional[RecordUpdateResponse], self._put( f"/zones/{zone_id}/dns_records/{dns_record_id}", body=maybe_transform( @@ -2964,11 +2838,11 @@ def update( "content": content, "name": name, "proxied": proxied, - "settings": settings, "tags": tags, "ttl": ttl, "type": type, "data": data, + "settings": settings, "priority": priority, }, record_update_params.RecordUpdateParams, @@ -2978,10 +2852,10 @@ def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RecordResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[RecordUpdateResponse]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[RecordResponse] + Any, ResultWrapper[RecordUpdateResponse] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -3032,7 +2906,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncV4PagePaginationArray[RecordResponse]: + ) -> SyncV4PagePaginationArray[RecordListResponse]: """ List, search, sort, and filter a zones' DNS records. @@ -3080,7 +2954,7 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/dns_records", - page=SyncV4PagePaginationArray[RecordResponse], + page=SyncV4PagePaginationArray[RecordListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -3105,7 +2979,7 @@ def list( record_list_params.RecordListParams, ), ), - model=cast(Any, RecordResponse), # Union types cannot be passed in as arguments in the type system + model=cast(Any, RecordListResponse), # Union types cannot be passed in as arguments in the type system ) def delete( @@ -3157,9 +3031,9 @@ def batch( *, zone_id: str, deletes: Iterable[record_batch_params.Delete] | NotGiven = NOT_GIVEN, - patches: Iterable[BatchPatchParam] | NotGiven = NOT_GIVEN, + patches: Iterable[record_batch_params.Patch] | NotGiven = NOT_GIVEN, posts: Iterable[RecordParam] | NotGiven = NOT_GIVEN, - puts: Iterable[BatchPutParam] | NotGiven = NOT_GIVEN, + puts: Iterable[record_batch_params.Put] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -3230,7 +3104,6 @@ def edit( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.ARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["A"] | NotGiven = NOT_GIVEN, @@ -3240,7 +3113,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -3266,8 +3139,6 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -3296,7 +3167,6 @@ def edit( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.AAAARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["AAAA"] | NotGiven = NOT_GIVEN, @@ -3306,7 +3176,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -3332,8 +3202,6 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -3362,7 +3230,6 @@ def edit( data: record_edit_params.CAARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.CAARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["CAA"] | NotGiven = NOT_GIVEN, @@ -3372,7 +3239,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -3398,8 +3265,6 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -3428,7 +3293,6 @@ def edit( data: record_edit_params.CERTRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.CERTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["CERT"] | NotGiven = NOT_GIVEN, @@ -3438,7 +3302,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -3464,8 +3328,6 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -3504,7 +3366,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -3530,8 +3392,6 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -3560,7 +3420,6 @@ def edit( data: record_edit_params.DNSKEYRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.DNSKEYRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["DNSKEY"] | NotGiven = NOT_GIVEN, @@ -3570,7 +3429,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -3596,8 +3455,6 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -3626,7 +3483,6 @@ def edit( data: record_edit_params.DSRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.DSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["DS"] | NotGiven = NOT_GIVEN, @@ -3636,7 +3492,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -3662,8 +3518,6 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -3692,7 +3546,6 @@ def edit( data: record_edit_params.HTTPSRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.HTTPSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["HTTPS"] | NotGiven = NOT_GIVEN, @@ -3702,7 +3555,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -3728,8 +3581,6 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -3758,7 +3609,6 @@ def edit( data: record_edit_params.LOCRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.LOCRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["LOC"] | NotGiven = NOT_GIVEN, @@ -3768,7 +3618,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -3794,8 +3644,6 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -3825,7 +3673,6 @@ def edit( name: str | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.MXRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["MX"] | NotGiven = NOT_GIVEN, @@ -3835,7 +3682,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -3864,8 +3711,6 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -3894,7 +3739,6 @@ def edit( data: record_edit_params.NAPTRRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.NAPTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["NAPTR"] | NotGiven = NOT_GIVEN, @@ -3904,7 +3748,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -3930,8 +3774,6 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -3960,7 +3802,6 @@ def edit( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.NSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["NS"] | NotGiven = NOT_GIVEN, @@ -3970,7 +3811,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -3996,8 +3837,6 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -4026,7 +3865,6 @@ def edit( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.DNSRecordsOpenpgpkeyRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["OPENPGPKEY"] | NotGiven = NOT_GIVEN, @@ -4036,7 +3874,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -4062,8 +3900,6 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -4092,7 +3928,6 @@ def edit( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.PTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["PTR"] | NotGiven = NOT_GIVEN, @@ -4102,7 +3937,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -4128,8 +3963,6 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -4158,7 +3991,6 @@ def edit( data: record_edit_params.SMIMEARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.SMIMEARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SMIMEA"] | NotGiven = NOT_GIVEN, @@ -4168,7 +4000,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -4194,8 +4026,6 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -4224,7 +4054,6 @@ def edit( data: record_edit_params.SRVRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.SRVRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SRV"] | NotGiven = NOT_GIVEN, @@ -4234,7 +4063,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -4260,8 +4089,6 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -4290,7 +4117,6 @@ def edit( data: record_edit_params.SSHFPRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.SSHFPRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SSHFP"] | NotGiven = NOT_GIVEN, @@ -4300,7 +4126,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -4326,8 +4152,6 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -4356,7 +4180,6 @@ def edit( data: record_edit_params.SVCBRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.SVCBRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SVCB"] | NotGiven = NOT_GIVEN, @@ -4366,7 +4189,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -4392,8 +4215,6 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -4422,7 +4243,6 @@ def edit( data: record_edit_params.TLSARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.TLSARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["TLSA"] | NotGiven = NOT_GIVEN, @@ -4432,7 +4252,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -4458,8 +4278,6 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -4488,7 +4306,6 @@ def edit( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.TXTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["TXT"] | NotGiven = NOT_GIVEN, @@ -4498,7 +4315,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -4529,8 +4346,6 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -4560,7 +4375,6 @@ def edit( name: str | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.URIRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["URI"] | NotGiven = NOT_GIVEN, @@ -4570,7 +4384,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -4599,8 +4413,6 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -4629,7 +4441,6 @@ def edit( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.ARecordSettings | record_edit_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["A"] @@ -4666,6 +4477,7 @@ def edit( | record_edit_params.SSHFPRecordData | record_edit_params.URIRecordData | NotGiven = NOT_GIVEN, + settings: record_edit_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4673,13 +4485,13 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not dns_record_id: raise ValueError(f"Expected a non-empty value for `dns_record_id` but received {dns_record_id!r}") return cast( - Optional[RecordResponse], + Optional[RecordEditResponse], self._patch( f"/zones/{zone_id}/dns_records/{dns_record_id}", body=maybe_transform( @@ -4688,11 +4500,11 @@ def edit( "content": content, "name": name, "proxied": proxied, - "settings": settings, "tags": tags, "ttl": ttl, "type": type, "data": data, + "settings": settings, "priority": priority, }, record_edit_params.RecordEditParams, @@ -4702,10 +4514,10 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RecordResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[RecordEditResponse]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[RecordResponse] + Any, ResultWrapper[RecordEditResponse] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -4763,7 +4575,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordGetResponse]: """ DNS Record Details @@ -4785,7 +4597,7 @@ def get( if not dns_record_id: raise ValueError(f"Expected a non-empty value for `dns_record_id` but received {dns_record_id!r}") return cast( - Optional[RecordResponse], + Optional[RecordGetResponse], self._get( f"/zones/{zone_id}/dns_records/{dns_record_id}", options=make_request_options( @@ -4793,10 +4605,10 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RecordResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[RecordGetResponse]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[RecordResponse] + Any, ResultWrapper[RecordGetResponse] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -4942,7 +4754,6 @@ async def create( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.ARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["A"] | NotGiven = NOT_GIVEN, @@ -4952,7 +4763,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -4976,8 +4787,6 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5005,7 +4814,6 @@ async def create( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.AAAARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["AAAA"] | NotGiven = NOT_GIVEN, @@ -5015,7 +4823,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -5039,8 +4847,6 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5068,7 +4874,6 @@ async def create( data: record_create_params.CAARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.CAARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["CAA"] | NotGiven = NOT_GIVEN, @@ -5078,7 +4883,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -5102,8 +4907,6 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5131,7 +4934,6 @@ async def create( data: record_create_params.CERTRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.CERTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["CERT"] | NotGiven = NOT_GIVEN, @@ -5141,7 +4943,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -5165,8 +4967,6 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5204,7 +5004,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -5228,8 +5028,6 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5257,7 +5055,6 @@ async def create( data: record_create_params.DNSKEYRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.DNSKEYRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["DNSKEY"] | NotGiven = NOT_GIVEN, @@ -5267,7 +5064,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -5291,8 +5088,6 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5320,7 +5115,6 @@ async def create( data: record_create_params.DSRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.DSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["DS"] | NotGiven = NOT_GIVEN, @@ -5330,7 +5124,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -5354,8 +5148,6 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5383,7 +5175,6 @@ async def create( data: record_create_params.HTTPSRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.HTTPSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["HTTPS"] | NotGiven = NOT_GIVEN, @@ -5393,7 +5184,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -5417,8 +5208,6 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5446,7 +5235,6 @@ async def create( data: record_create_params.LOCRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.LOCRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["LOC"] | NotGiven = NOT_GIVEN, @@ -5456,7 +5244,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -5480,8 +5268,6 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5510,7 +5296,6 @@ async def create( name: str | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.MXRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["MX"] | NotGiven = NOT_GIVEN, @@ -5520,7 +5305,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -5547,8 +5332,6 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5576,7 +5359,6 @@ async def create( data: record_create_params.NAPTRRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.NAPTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["NAPTR"] | NotGiven = NOT_GIVEN, @@ -5586,7 +5368,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -5610,8 +5392,6 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5639,7 +5419,6 @@ async def create( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.NSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["NS"] | NotGiven = NOT_GIVEN, @@ -5649,7 +5428,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -5673,8 +5452,6 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5702,7 +5479,6 @@ async def create( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.DNSRecordsOpenpgpkeyRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["OPENPGPKEY"] | NotGiven = NOT_GIVEN, @@ -5712,7 +5488,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -5736,8 +5512,6 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5765,7 +5539,6 @@ async def create( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.PTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["PTR"] | NotGiven = NOT_GIVEN, @@ -5775,7 +5548,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -5799,8 +5572,6 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5828,7 +5599,6 @@ async def create( data: record_create_params.SMIMEARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.SMIMEARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SMIMEA"] | NotGiven = NOT_GIVEN, @@ -5838,7 +5608,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -5862,8 +5632,6 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5891,7 +5659,6 @@ async def create( data: record_create_params.SRVRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.SRVRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SRV"] | NotGiven = NOT_GIVEN, @@ -5901,7 +5668,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -5925,8 +5692,6 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5954,7 +5719,6 @@ async def create( data: record_create_params.SSHFPRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.SSHFPRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SSHFP"] | NotGiven = NOT_GIVEN, @@ -5964,7 +5728,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -5988,8 +5752,6 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -6017,7 +5779,6 @@ async def create( data: record_create_params.SVCBRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.SVCBRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SVCB"] | NotGiven = NOT_GIVEN, @@ -6027,7 +5788,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -6051,8 +5812,6 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -6080,7 +5839,6 @@ async def create( data: record_create_params.TLSARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.TLSARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["TLSA"] | NotGiven = NOT_GIVEN, @@ -6090,7 +5848,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -6114,8 +5872,6 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -6143,7 +5899,6 @@ async def create( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.TXTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["TXT"] | NotGiven = NOT_GIVEN, @@ -6153,7 +5908,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -6182,8 +5937,6 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -6212,7 +5965,6 @@ async def create( name: str | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.URIRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["URI"] | NotGiven = NOT_GIVEN, @@ -6222,7 +5974,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: """ Create a new DNS record for a zone. @@ -6249,8 +6001,6 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -6278,9 +6028,6 @@ async def create( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.ARecordSettings - | record_create_params.CNAMERecordSettings - | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["A"] @@ -6317,6 +6064,7 @@ async def create( | record_create_params.SSHFPRecordData | record_create_params.URIRecordData | NotGiven = NOT_GIVEN, + settings: record_create_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -6324,11 +6072,11 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordCreateResponse]: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( - Optional[RecordResponse], + Optional[RecordCreateResponse], await self._post( f"/zones/{zone_id}/dns_records", body=await async_maybe_transform( @@ -6337,11 +6085,11 @@ async def create( "content": content, "name": name, "proxied": proxied, - "settings": settings, "tags": tags, "ttl": ttl, "type": type, "data": data, + "settings": settings, "priority": priority, }, record_create_params.RecordCreateParams, @@ -6351,10 +6099,10 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RecordResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[RecordCreateResponse]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[RecordResponse] + Any, ResultWrapper[RecordCreateResponse] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -6369,7 +6117,6 @@ async def update( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.ARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["A"] | NotGiven = NOT_GIVEN, @@ -6379,7 +6126,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -6405,8 +6152,6 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -6435,7 +6180,6 @@ async def update( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.AAAARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["AAAA"] | NotGiven = NOT_GIVEN, @@ -6445,7 +6189,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -6471,8 +6215,6 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -6501,7 +6243,6 @@ async def update( data: record_update_params.CAARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.CAARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["CAA"] | NotGiven = NOT_GIVEN, @@ -6511,7 +6252,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -6537,8 +6278,6 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -6567,7 +6306,6 @@ async def update( data: record_update_params.CERTRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.CERTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["CERT"] | NotGiven = NOT_GIVEN, @@ -6577,7 +6315,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -6603,8 +6341,6 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -6643,7 +6379,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -6669,8 +6405,6 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -6699,7 +6433,6 @@ async def update( data: record_update_params.DNSKEYRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.DNSKEYRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["DNSKEY"] | NotGiven = NOT_GIVEN, @@ -6709,7 +6442,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -6735,8 +6468,6 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -6765,7 +6496,6 @@ async def update( data: record_update_params.DSRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.DSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["DS"] | NotGiven = NOT_GIVEN, @@ -6775,7 +6505,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -6801,8 +6531,6 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -6831,7 +6559,6 @@ async def update( data: record_update_params.HTTPSRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.HTTPSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["HTTPS"] | NotGiven = NOT_GIVEN, @@ -6841,7 +6568,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -6867,8 +6594,6 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -6897,7 +6622,6 @@ async def update( data: record_update_params.LOCRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.LOCRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["LOC"] | NotGiven = NOT_GIVEN, @@ -6907,7 +6631,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -6933,8 +6657,6 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -6964,7 +6686,6 @@ async def update( name: str | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.MXRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["MX"] | NotGiven = NOT_GIVEN, @@ -6974,7 +6695,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -7003,8 +6724,6 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -7033,7 +6752,6 @@ async def update( data: record_update_params.NAPTRRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.NAPTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["NAPTR"] | NotGiven = NOT_GIVEN, @@ -7043,7 +6761,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -7069,8 +6787,6 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -7099,7 +6815,6 @@ async def update( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.NSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["NS"] | NotGiven = NOT_GIVEN, @@ -7109,7 +6824,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -7135,8 +6850,6 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -7165,7 +6878,6 @@ async def update( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.DNSRecordsOpenpgpkeyRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["OPENPGPKEY"] | NotGiven = NOT_GIVEN, @@ -7175,7 +6887,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -7201,8 +6913,6 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -7231,7 +6941,6 @@ async def update( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.PTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["PTR"] | NotGiven = NOT_GIVEN, @@ -7241,7 +6950,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -7267,8 +6976,6 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -7297,7 +7004,6 @@ async def update( data: record_update_params.SMIMEARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.SMIMEARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SMIMEA"] | NotGiven = NOT_GIVEN, @@ -7307,7 +7013,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -7333,8 +7039,6 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -7363,7 +7067,6 @@ async def update( data: record_update_params.SRVRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.SRVRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SRV"] | NotGiven = NOT_GIVEN, @@ -7373,7 +7076,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -7399,8 +7102,6 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -7429,7 +7130,6 @@ async def update( data: record_update_params.SSHFPRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.SSHFPRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SSHFP"] | NotGiven = NOT_GIVEN, @@ -7439,7 +7139,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -7465,8 +7165,6 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -7495,7 +7193,6 @@ async def update( data: record_update_params.SVCBRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.SVCBRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SVCB"] | NotGiven = NOT_GIVEN, @@ -7505,7 +7202,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -7531,8 +7228,6 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -7561,7 +7256,6 @@ async def update( data: record_update_params.TLSARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.TLSARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["TLSA"] | NotGiven = NOT_GIVEN, @@ -7571,7 +7265,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -7597,8 +7291,6 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -7627,7 +7319,6 @@ async def update( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.TXTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["TXT"] | NotGiven = NOT_GIVEN, @@ -7637,7 +7328,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -7668,8 +7359,6 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -7699,7 +7388,6 @@ async def update( name: str | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.URIRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["URI"] | NotGiven = NOT_GIVEN, @@ -7709,7 +7397,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: """ Overwrite an existing DNS record. @@ -7738,8 +7426,6 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -7768,9 +7454,6 @@ async def update( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.ARecordSettings - | record_update_params.CNAMERecordSettings - | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["A"] @@ -7807,6 +7490,7 @@ async def update( | record_update_params.SSHFPRecordData | record_update_params.URIRecordData | NotGiven = NOT_GIVEN, + settings: record_update_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -7814,13 +7498,13 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordUpdateResponse]: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not dns_record_id: raise ValueError(f"Expected a non-empty value for `dns_record_id` but received {dns_record_id!r}") return cast( - Optional[RecordResponse], + Optional[RecordUpdateResponse], await self._put( f"/zones/{zone_id}/dns_records/{dns_record_id}", body=await async_maybe_transform( @@ -7829,11 +7513,11 @@ async def update( "content": content, "name": name, "proxied": proxied, - "settings": settings, "tags": tags, "ttl": ttl, "type": type, "data": data, + "settings": settings, "priority": priority, }, record_update_params.RecordUpdateParams, @@ -7843,10 +7527,10 @@ async def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RecordResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[RecordUpdateResponse]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[RecordResponse] + Any, ResultWrapper[RecordUpdateResponse] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -7897,7 +7581,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[RecordResponse, AsyncV4PagePaginationArray[RecordResponse]]: + ) -> AsyncPaginator[RecordListResponse, AsyncV4PagePaginationArray[RecordListResponse]]: """ List, search, sort, and filter a zones' DNS records. @@ -7945,7 +7629,7 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/dns_records", - page=AsyncV4PagePaginationArray[RecordResponse], + page=AsyncV4PagePaginationArray[RecordListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -7970,7 +7654,7 @@ def list( record_list_params.RecordListParams, ), ), - model=cast(Any, RecordResponse), # Union types cannot be passed in as arguments in the type system + model=cast(Any, RecordListResponse), # Union types cannot be passed in as arguments in the type system ) async def delete( @@ -8022,9 +7706,9 @@ async def batch( *, zone_id: str, deletes: Iterable[record_batch_params.Delete] | NotGiven = NOT_GIVEN, - patches: Iterable[BatchPatchParam] | NotGiven = NOT_GIVEN, + patches: Iterable[record_batch_params.Patch] | NotGiven = NOT_GIVEN, posts: Iterable[RecordParam] | NotGiven = NOT_GIVEN, - puts: Iterable[BatchPutParam] | NotGiven = NOT_GIVEN, + puts: Iterable[record_batch_params.Put] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -8095,7 +7779,6 @@ async def edit( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.ARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["A"] | NotGiven = NOT_GIVEN, @@ -8105,7 +7788,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -8131,8 +7814,6 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -8161,7 +7842,6 @@ async def edit( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.AAAARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["AAAA"] | NotGiven = NOT_GIVEN, @@ -8171,7 +7851,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -8197,8 +7877,6 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -8227,7 +7905,6 @@ async def edit( data: record_edit_params.CAARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.CAARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["CAA"] | NotGiven = NOT_GIVEN, @@ -8237,7 +7914,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -8263,8 +7940,6 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -8293,7 +7968,6 @@ async def edit( data: record_edit_params.CERTRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.CERTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["CERT"] | NotGiven = NOT_GIVEN, @@ -8303,7 +7977,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -8329,8 +8003,6 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -8369,7 +8041,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -8395,8 +8067,6 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -8425,7 +8095,6 @@ async def edit( data: record_edit_params.DNSKEYRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.DNSKEYRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["DNSKEY"] | NotGiven = NOT_GIVEN, @@ -8435,7 +8104,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -8461,8 +8130,6 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -8491,7 +8158,6 @@ async def edit( data: record_edit_params.DSRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.DSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["DS"] | NotGiven = NOT_GIVEN, @@ -8501,7 +8167,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -8527,8 +8193,6 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -8557,7 +8221,6 @@ async def edit( data: record_edit_params.HTTPSRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.HTTPSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["HTTPS"] | NotGiven = NOT_GIVEN, @@ -8567,7 +8230,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -8593,8 +8256,6 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -8623,7 +8284,6 @@ async def edit( data: record_edit_params.LOCRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.LOCRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["LOC"] | NotGiven = NOT_GIVEN, @@ -8633,7 +8293,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -8659,8 +8319,6 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -8690,7 +8348,6 @@ async def edit( name: str | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.MXRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["MX"] | NotGiven = NOT_GIVEN, @@ -8700,7 +8357,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -8729,8 +8386,6 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -8759,7 +8414,6 @@ async def edit( data: record_edit_params.NAPTRRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.NAPTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["NAPTR"] | NotGiven = NOT_GIVEN, @@ -8769,7 +8423,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -8795,8 +8449,6 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -8825,7 +8477,6 @@ async def edit( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.NSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["NS"] | NotGiven = NOT_GIVEN, @@ -8835,7 +8486,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -8861,8 +8512,6 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -8891,7 +8540,6 @@ async def edit( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.DNSRecordsOpenpgpkeyRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["OPENPGPKEY"] | NotGiven = NOT_GIVEN, @@ -8901,7 +8549,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -8927,8 +8575,6 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -8957,7 +8603,6 @@ async def edit( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.PTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["PTR"] | NotGiven = NOT_GIVEN, @@ -8967,7 +8612,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -8993,8 +8638,6 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -9023,7 +8666,6 @@ async def edit( data: record_edit_params.SMIMEARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.SMIMEARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SMIMEA"] | NotGiven = NOT_GIVEN, @@ -9033,7 +8675,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -9059,8 +8701,6 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -9089,7 +8729,6 @@ async def edit( data: record_edit_params.SRVRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.SRVRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SRV"] | NotGiven = NOT_GIVEN, @@ -9099,7 +8738,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -9125,8 +8764,6 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -9155,7 +8792,6 @@ async def edit( data: record_edit_params.SSHFPRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.SSHFPRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SSHFP"] | NotGiven = NOT_GIVEN, @@ -9165,7 +8801,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -9191,8 +8827,6 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -9221,7 +8855,6 @@ async def edit( data: record_edit_params.SVCBRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.SVCBRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SVCB"] | NotGiven = NOT_GIVEN, @@ -9231,7 +8864,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -9257,8 +8890,6 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -9287,7 +8918,6 @@ async def edit( data: record_edit_params.TLSARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.TLSARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["TLSA"] | NotGiven = NOT_GIVEN, @@ -9297,7 +8927,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -9323,8 +8953,6 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -9353,7 +8981,6 @@ async def edit( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.TXTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["TXT"] | NotGiven = NOT_GIVEN, @@ -9363,7 +8990,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -9394,8 +9021,6 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -9425,7 +9050,6 @@ async def edit( name: str | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.URIRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["URI"] | NotGiven = NOT_GIVEN, @@ -9435,7 +9059,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: """ Update an existing DNS record. @@ -9464,8 +9088,6 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -9494,7 +9116,6 @@ async def edit( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.ARecordSettings | record_edit_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["A"] @@ -9531,6 +9152,7 @@ async def edit( | record_edit_params.SSHFPRecordData | record_edit_params.URIRecordData | NotGiven = NOT_GIVEN, + settings: record_edit_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -9538,13 +9160,13 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordEditResponse]: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not dns_record_id: raise ValueError(f"Expected a non-empty value for `dns_record_id` but received {dns_record_id!r}") return cast( - Optional[RecordResponse], + Optional[RecordEditResponse], await self._patch( f"/zones/{zone_id}/dns_records/{dns_record_id}", body=await async_maybe_transform( @@ -9553,11 +9175,11 @@ async def edit( "content": content, "name": name, "proxied": proxied, - "settings": settings, "tags": tags, "ttl": ttl, "type": type, "data": data, + "settings": settings, "priority": priority, }, record_edit_params.RecordEditParams, @@ -9567,10 +9189,10 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RecordResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[RecordEditResponse]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[RecordResponse] + Any, ResultWrapper[RecordEditResponse] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -9628,7 +9250,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordResponse]: + ) -> Optional[RecordGetResponse]: """ DNS Record Details @@ -9650,7 +9272,7 @@ async def get( if not dns_record_id: raise ValueError(f"Expected a non-empty value for `dns_record_id` but received {dns_record_id!r}") return cast( - Optional[RecordResponse], + Optional[RecordGetResponse], await self._get( f"/zones/{zone_id}/dns_records/{dns_record_id}", options=make_request_options( @@ -9658,10 +9280,10 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RecordResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[RecordGetResponse]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[RecordResponse] + Any, ResultWrapper[RecordGetResponse] ), # Union types cannot be passed in as arguments in the type system ), ) diff --git a/src/cloudflare/resources/email_security/settings/block_senders.py b/src/cloudflare/resources/email_security/settings/block_senders.py index d540e200fce..41d3e4cfd67 100644 --- a/src/cloudflare/resources/email_security/settings/block_senders.py +++ b/src/cloudflare/resources/email_security/settings/block_senders.py @@ -2,13 +2,14 @@ from __future__ import annotations -from typing import Type, Optional, cast -from typing_extensions import Literal +from typing import Any, Type, Iterable, Optional, cast +from typing_extensions import Literal, overload import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( + required_args, maybe_transform, async_maybe_transform, ) @@ -57,6 +58,7 @@ def with_streaming_response(self) -> BlockSendersResourceWithStreamingResponse: """ return BlockSendersResourceWithStreamingResponse(self) + @overload def create( self, *, @@ -86,27 +88,81 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + def create( + self, + *, + account_id: str, + body: Iterable[block_sender_create_params.Variant1Body], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BlockSenderCreateResponse: + """ + Create a blocked email sender + + Args: + account_id: Account Identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["account_id", "is_regex", "pattern", "pattern_type"], ["account_id", "body"]) + def create( + self, + *, + account_id: str, + is_regex: bool | NotGiven = NOT_GIVEN, + pattern: str | NotGiven = NOT_GIVEN, + pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"] | NotGiven = NOT_GIVEN, + comments: Optional[str] | NotGiven = NOT_GIVEN, + body: Iterable[block_sender_create_params.Variant1Body] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BlockSenderCreateResponse: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._post( - f"/accounts/{account_id}/email-security/settings/block_senders", - body=maybe_transform( - { - "is_regex": is_regex, - "pattern": pattern, - "pattern_type": pattern_type, - "comments": comments, - }, - block_sender_create_params.BlockSenderCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[BlockSenderCreateResponse]._unwrapper, + return cast( + BlockSenderCreateResponse, + self._post( + f"/accounts/{account_id}/email-security/settings/block_senders", + body=maybe_transform( + { + "is_regex": is_regex, + "pattern": pattern, + "pattern_type": pattern_type, + "comments": comments, + "body": body, + }, + block_sender_create_params.BlockSenderCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[BlockSenderCreateResponse]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[BlockSenderCreateResponse] + ), # Union types cannot be passed in as arguments in the type system ), - cast_to=cast(Type[BlockSenderCreateResponse], ResultWrapper[BlockSenderCreateResponse]), ) def list( @@ -195,8 +251,6 @@ def delete( Args: account_id: Account Identifier - pattern_id: The unique identifier for the allow policy. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -241,8 +295,6 @@ def edit( Args: account_id: Account Identifier - pattern_id: The unique identifier for the allow policy. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -292,8 +344,6 @@ def get( Args: account_id: Account Identifier - pattern_id: The unique identifier for the allow policy. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -337,6 +387,7 @@ def with_streaming_response(self) -> AsyncBlockSendersResourceWithStreamingRespo """ return AsyncBlockSendersResourceWithStreamingResponse(self) + @overload async def create( self, *, @@ -366,27 +417,81 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + async def create( + self, + *, + account_id: str, + body: Iterable[block_sender_create_params.Variant1Body], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BlockSenderCreateResponse: + """ + Create a blocked email sender + + Args: + account_id: Account Identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["account_id", "is_regex", "pattern", "pattern_type"], ["account_id", "body"]) + async def create( + self, + *, + account_id: str, + is_regex: bool | NotGiven = NOT_GIVEN, + pattern: str | NotGiven = NOT_GIVEN, + pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"] | NotGiven = NOT_GIVEN, + comments: Optional[str] | NotGiven = NOT_GIVEN, + body: Iterable[block_sender_create_params.Variant1Body] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BlockSenderCreateResponse: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._post( - f"/accounts/{account_id}/email-security/settings/block_senders", - body=await async_maybe_transform( - { - "is_regex": is_regex, - "pattern": pattern, - "pattern_type": pattern_type, - "comments": comments, - }, - block_sender_create_params.BlockSenderCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[BlockSenderCreateResponse]._unwrapper, + return cast( + BlockSenderCreateResponse, + await self._post( + f"/accounts/{account_id}/email-security/settings/block_senders", + body=await async_maybe_transform( + { + "is_regex": is_regex, + "pattern": pattern, + "pattern_type": pattern_type, + "comments": comments, + "body": body, + }, + block_sender_create_params.BlockSenderCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[BlockSenderCreateResponse]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[BlockSenderCreateResponse] + ), # Union types cannot be passed in as arguments in the type system ), - cast_to=cast(Type[BlockSenderCreateResponse], ResultWrapper[BlockSenderCreateResponse]), ) def list( @@ -475,8 +580,6 @@ async def delete( Args: account_id: Account Identifier - pattern_id: The unique identifier for the allow policy. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -521,8 +624,6 @@ async def edit( Args: account_id: Account Identifier - pattern_id: The unique identifier for the allow policy. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -572,8 +673,6 @@ async def get( Args: account_id: Account Identifier - pattern_id: The unique identifier for the allow policy. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request diff --git a/src/cloudflare/resources/email_security/settings/impersonation_registry.py b/src/cloudflare/resources/email_security/settings/impersonation_registry.py index 29b5532a411..bb67428ecff 100644 --- a/src/cloudflare/resources/email_security/settings/impersonation_registry.py +++ b/src/cloudflare/resources/email_security/settings/impersonation_registry.py @@ -2,13 +2,14 @@ from __future__ import annotations -from typing import Type, Optional, cast -from typing_extensions import Literal +from typing import Any, Type, Iterable, Optional, cast +from typing_extensions import Literal, overload import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( + required_args, maybe_transform, async_maybe_transform, ) @@ -57,6 +58,7 @@ def with_streaming_response(self) -> ImpersonationRegistryResourceWithStreamingR """ return ImpersonationRegistryResourceWithStreamingResponse(self) + @overload def create( self, *, @@ -85,26 +87,79 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + def create( + self, + *, + account_id: str, + body: Iterable[impersonation_registry_create_params.Variant1Body], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ImpersonationRegistryCreateResponse: + """ + Create an entry in impersonation registry + + Args: + account_id: Account Identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["account_id", "email", "is_email_regex", "name"], ["account_id", "body"]) + def create( + self, + *, + account_id: str, + email: str | NotGiven = NOT_GIVEN, + is_email_regex: bool | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + body: Iterable[impersonation_registry_create_params.Variant1Body] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ImpersonationRegistryCreateResponse: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._post( - f"/accounts/{account_id}/email-security/settings/impersonation_registry", - body=maybe_transform( - { - "email": email, - "is_email_regex": is_email_regex, - "name": name, - }, - impersonation_registry_create_params.ImpersonationRegistryCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ImpersonationRegistryCreateResponse]._unwrapper, + return cast( + ImpersonationRegistryCreateResponse, + self._post( + f"/accounts/{account_id}/email-security/settings/impersonation_registry", + body=maybe_transform( + { + "email": email, + "is_email_regex": is_email_regex, + "name": name, + "body": body, + }, + impersonation_registry_create_params.ImpersonationRegistryCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ImpersonationRegistryCreateResponse]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[ImpersonationRegistryCreateResponse] + ), # Union types cannot be passed in as arguments in the type system ), - cast_to=cast(Type[ImpersonationRegistryCreateResponse], ResultWrapper[ImpersonationRegistryCreateResponse]), ) def list( @@ -328,6 +383,7 @@ def with_streaming_response(self) -> AsyncImpersonationRegistryResourceWithStrea """ return AsyncImpersonationRegistryResourceWithStreamingResponse(self) + @overload async def create( self, *, @@ -356,26 +412,79 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + async def create( + self, + *, + account_id: str, + body: Iterable[impersonation_registry_create_params.Variant1Body], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ImpersonationRegistryCreateResponse: + """ + Create an entry in impersonation registry + + Args: + account_id: Account Identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["account_id", "email", "is_email_regex", "name"], ["account_id", "body"]) + async def create( + self, + *, + account_id: str, + email: str | NotGiven = NOT_GIVEN, + is_email_regex: bool | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + body: Iterable[impersonation_registry_create_params.Variant1Body] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ImpersonationRegistryCreateResponse: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._post( - f"/accounts/{account_id}/email-security/settings/impersonation_registry", - body=await async_maybe_transform( - { - "email": email, - "is_email_regex": is_email_regex, - "name": name, - }, - impersonation_registry_create_params.ImpersonationRegistryCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ImpersonationRegistryCreateResponse]._unwrapper, + return cast( + ImpersonationRegistryCreateResponse, + await self._post( + f"/accounts/{account_id}/email-security/settings/impersonation_registry", + body=await async_maybe_transform( + { + "email": email, + "is_email_regex": is_email_regex, + "name": name, + "body": body, + }, + impersonation_registry_create_params.ImpersonationRegistryCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ImpersonationRegistryCreateResponse]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[ImpersonationRegistryCreateResponse] + ), # Union types cannot be passed in as arguments in the type system ), - cast_to=cast(Type[ImpersonationRegistryCreateResponse], ResultWrapper[ImpersonationRegistryCreateResponse]), ) def list( diff --git a/src/cloudflare/resources/logpush/jobs.py b/src/cloudflare/resources/logpush/jobs.py index 76ed1b79c19..59007334df7 100644 --- a/src/cloudflare/resources/logpush/jobs.py +++ b/src/cloudflare/resources/logpush/jobs.py @@ -196,7 +196,6 @@ def update( max_upload_bytes: Optional[int] | NotGiven = NOT_GIVEN, max_upload_interval_seconds: Optional[int] | NotGiven = NOT_GIVEN, max_upload_records: Optional[int] | NotGiven = NOT_GIVEN, - name: Optional[str] | NotGiven = NOT_GIVEN, output_options: Optional[OutputOptionsParam] | NotGiven = NOT_GIVEN, ownership_challenge: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -254,10 +253,6 @@ def update( lines than this. This parameter is not available for jobs with `edge` as its kind. - name: Optional human readable job name. Not unique. Cloudflare suggests that you set - this to a meaningful string, like the domain name, to make it easier to identify - your job. - output_options: The structured replacement for `logpull_options`. When including this field, the `logpull_option` field will be ignored. @@ -295,7 +290,6 @@ def update( "max_upload_bytes": max_upload_bytes, "max_upload_interval_seconds": max_upload_interval_seconds, "max_upload_records": max_upload_records, - "name": name, "output_options": output_options, "ownership_challenge": ownership_challenge, }, @@ -636,7 +630,6 @@ async def update( max_upload_bytes: Optional[int] | NotGiven = NOT_GIVEN, max_upload_interval_seconds: Optional[int] | NotGiven = NOT_GIVEN, max_upload_records: Optional[int] | NotGiven = NOT_GIVEN, - name: Optional[str] | NotGiven = NOT_GIVEN, output_options: Optional[OutputOptionsParam] | NotGiven = NOT_GIVEN, ownership_challenge: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -694,10 +687,6 @@ async def update( lines than this. This parameter is not available for jobs with `edge` as its kind. - name: Optional human readable job name. Not unique. Cloudflare suggests that you set - this to a meaningful string, like the domain name, to make it easier to identify - your job. - output_options: The structured replacement for `logpull_options`. When including this field, the `logpull_option` field will be ignored. @@ -735,7 +724,6 @@ async def update( "max_upload_bytes": max_upload_bytes, "max_upload_interval_seconds": max_upload_interval_seconds, "max_upload_records": max_upload_records, - "name": name, "output_options": output_options, "ownership_challenge": ownership_challenge, }, diff --git a/src/cloudflare/resources/magic_transit/sites/acls.py b/src/cloudflare/resources/magic_transit/sites/acls.py index a823a5bc933..c8edeccd631 100644 --- a/src/cloudflare/resources/magic_transit/sites/acls.py +++ b/src/cloudflare/resources/magic_transit/sites/acls.py @@ -61,7 +61,6 @@ def create( description: str | NotGiven = NOT_GIVEN, forward_locally: bool | NotGiven = NOT_GIVEN, protocols: List[AllowedProtocol] | NotGiven = NOT_GIVEN, - unidirectional: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -86,10 +85,6 @@ def create( traffic locally on the Magic Connector. If not included in request, will default to false. - unidirectional: The desired traffic direction for this ACL policy. If set to "false", the policy - will allow bidirectional traffic. If set to "true", the policy will only allow - traffic in one direction. If not included in request, will default to false. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -112,7 +107,6 @@ def create( "description": description, "forward_locally": forward_locally, "protocols": protocols, - "unidirectional": unidirectional, }, acl_create_params.ACLCreateParams, ), @@ -138,7 +132,6 @@ def update( lan_2: ACLConfigurationParam | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, protocols: List[AllowedProtocol] | NotGiven = NOT_GIVEN, - unidirectional: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -165,10 +158,6 @@ def update( name: The name of the ACL. - unidirectional: The desired traffic direction for this ACL policy. If set to "false", the policy - will allow bidirectional traffic. If set to "true", the policy will only allow - traffic in one direction. If not included in request, will default to false. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -193,7 +182,6 @@ def update( "lan_2": lan_2, "name": name, "protocols": protocols, - "unidirectional": unidirectional, }, acl_update_params.ACLUpdateParams, ), @@ -309,7 +297,6 @@ def edit( lan_2: ACLConfigurationParam | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, protocols: List[AllowedProtocol] | NotGiven = NOT_GIVEN, - unidirectional: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -336,10 +323,6 @@ def edit( name: The name of the ACL. - unidirectional: The desired traffic direction for this ACL policy. If set to "false", the policy - will allow bidirectional traffic. If set to "true", the policy will only allow - traffic in one direction. If not included in request, will default to false. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -364,7 +347,6 @@ def edit( "lan_2": lan_2, "name": name, "protocols": protocols, - "unidirectional": unidirectional, }, acl_edit_params.ACLEditParams, ), @@ -459,7 +441,6 @@ async def create( description: str | NotGiven = NOT_GIVEN, forward_locally: bool | NotGiven = NOT_GIVEN, protocols: List[AllowedProtocol] | NotGiven = NOT_GIVEN, - unidirectional: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -484,10 +465,6 @@ async def create( traffic locally on the Magic Connector. If not included in request, will default to false. - unidirectional: The desired traffic direction for this ACL policy. If set to "false", the policy - will allow bidirectional traffic. If set to "true", the policy will only allow - traffic in one direction. If not included in request, will default to false. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -510,7 +487,6 @@ async def create( "description": description, "forward_locally": forward_locally, "protocols": protocols, - "unidirectional": unidirectional, }, acl_create_params.ACLCreateParams, ), @@ -536,7 +512,6 @@ async def update( lan_2: ACLConfigurationParam | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, protocols: List[AllowedProtocol] | NotGiven = NOT_GIVEN, - unidirectional: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -563,10 +538,6 @@ async def update( name: The name of the ACL. - unidirectional: The desired traffic direction for this ACL policy. If set to "false", the policy - will allow bidirectional traffic. If set to "true", the policy will only allow - traffic in one direction. If not included in request, will default to false. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -591,7 +562,6 @@ async def update( "lan_2": lan_2, "name": name, "protocols": protocols, - "unidirectional": unidirectional, }, acl_update_params.ACLUpdateParams, ), @@ -707,7 +677,6 @@ async def edit( lan_2: ACLConfigurationParam | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, protocols: List[AllowedProtocol] | NotGiven = NOT_GIVEN, - unidirectional: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -734,10 +703,6 @@ async def edit( name: The name of the ACL. - unidirectional: The desired traffic direction for this ACL policy. If set to "false", the policy - will allow bidirectional traffic. If set to "true", the policy will only allow - traffic in one direction. If not included in request, will default to false. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -762,7 +727,6 @@ async def edit( "lan_2": lan_2, "name": name, "protocols": protocols, - "unidirectional": unidirectional, }, acl_edit_params.ACLEditParams, ), diff --git a/src/cloudflare/resources/managed_transforms.py b/src/cloudflare/resources/managed_transforms.py index 50bfea9758a..9ac119e110b 100644 --- a/src/cloudflare/resources/managed_transforms.py +++ b/src/cloudflare/resources/managed_transforms.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing import Type, Iterable, cast +from typing import Iterable import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import ( maybe_transform, async_maybe_transform, @@ -19,9 +19,9 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from .._wrappers import ResultWrapper from .._base_client import make_request_options from ..types.managed_transforms import managed_transform_edit_params +from ..types.managed_transforms.request_model_param import RequestModelParam from ..types.managed_transforms.managed_transform_edit_response import ManagedTransformEditResponse from ..types.managed_transforms.managed_transform_list_response import ManagedTransformListResponse @@ -63,7 +63,7 @@ def list( Fetches a list of all Managed Transforms. Args: - zone_id: The unique ID of the zone. + zone_id: Identifier extra_headers: Send extra headers @@ -76,59 +76,19 @@ def list( if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( - f"/zones/{zone_id}/managed_headers", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ManagedTransformListResponse]._unwrapper, - ), - cast_to=cast(Type[ManagedTransformListResponse], ResultWrapper[ManagedTransformListResponse]), - ) - - def delete( - self, - *, - zone_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> None: - """ - Disables all Managed Transforms. - - Args: - zone_id: The unique ID of the zone. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - extra_headers = {"Accept": "*/*", **(extra_headers or {})} - return self._delete( f"/zones/{zone_id}/managed_headers", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=NoneType, + cast_to=ManagedTransformListResponse, ) def edit( self, *, zone_id: str, - managed_request_headers: Iterable[managed_transform_edit_params.ManagedRequestHeader], - managed_response_headers: Iterable[managed_transform_edit_params.ManagedResponseHeader], + managed_request_headers: Iterable[RequestModelParam], + managed_response_headers: Iterable[RequestModelParam], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -140,11 +100,7 @@ def edit( Updates the status of one or more Managed Transforms. Args: - zone_id: The unique ID of the zone. - - managed_request_headers: The list of Managed Request Transforms. - - managed_response_headers: The list of Managed Response Transforms. + zone_id: Identifier extra_headers: Send extra headers @@ -166,13 +122,9 @@ def edit( managed_transform_edit_params.ManagedTransformEditParams, ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ManagedTransformEditResponse]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[ManagedTransformEditResponse], ResultWrapper[ManagedTransformEditResponse]), + cast_to=ManagedTransformEditResponse, ) @@ -211,7 +163,7 @@ async def list( Fetches a list of all Managed Transforms. Args: - zone_id: The unique ID of the zone. + zone_id: Identifier extra_headers: Send extra headers @@ -224,59 +176,19 @@ async def list( if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( - f"/zones/{zone_id}/managed_headers", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ManagedTransformListResponse]._unwrapper, - ), - cast_to=cast(Type[ManagedTransformListResponse], ResultWrapper[ManagedTransformListResponse]), - ) - - async def delete( - self, - *, - zone_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> None: - """ - Disables all Managed Transforms. - - Args: - zone_id: The unique ID of the zone. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - extra_headers = {"Accept": "*/*", **(extra_headers or {})} - return await self._delete( f"/zones/{zone_id}/managed_headers", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=NoneType, + cast_to=ManagedTransformListResponse, ) async def edit( self, *, zone_id: str, - managed_request_headers: Iterable[managed_transform_edit_params.ManagedRequestHeader], - managed_response_headers: Iterable[managed_transform_edit_params.ManagedResponseHeader], + managed_request_headers: Iterable[RequestModelParam], + managed_response_headers: Iterable[RequestModelParam], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -288,11 +200,7 @@ async def edit( Updates the status of one or more Managed Transforms. Args: - zone_id: The unique ID of the zone. - - managed_request_headers: The list of Managed Request Transforms. - - managed_response_headers: The list of Managed Response Transforms. + zone_id: Identifier extra_headers: Send extra headers @@ -314,13 +222,9 @@ async def edit( managed_transform_edit_params.ManagedTransformEditParams, ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ManagedTransformEditResponse]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[ManagedTransformEditResponse], ResultWrapper[ManagedTransformEditResponse]), + cast_to=ManagedTransformEditResponse, ) @@ -331,9 +235,6 @@ def __init__(self, managed_transforms: ManagedTransformsResource) -> None: self.list = to_raw_response_wrapper( managed_transforms.list, ) - self.delete = to_raw_response_wrapper( - managed_transforms.delete, - ) self.edit = to_raw_response_wrapper( managed_transforms.edit, ) @@ -346,9 +247,6 @@ def __init__(self, managed_transforms: AsyncManagedTransformsResource) -> None: self.list = async_to_raw_response_wrapper( managed_transforms.list, ) - self.delete = async_to_raw_response_wrapper( - managed_transforms.delete, - ) self.edit = async_to_raw_response_wrapper( managed_transforms.edit, ) @@ -361,9 +259,6 @@ def __init__(self, managed_transforms: ManagedTransformsResource) -> None: self.list = to_streamed_response_wrapper( managed_transforms.list, ) - self.delete = to_streamed_response_wrapper( - managed_transforms.delete, - ) self.edit = to_streamed_response_wrapper( managed_transforms.edit, ) @@ -376,9 +271,6 @@ def __init__(self, managed_transforms: AsyncManagedTransformsResource) -> None: self.list = async_to_streamed_response_wrapper( managed_transforms.list, ) - self.delete = async_to_streamed_response_wrapper( - managed_transforms.delete, - ) self.edit = async_to_streamed_response_wrapper( managed_transforms.edit, ) diff --git a/src/cloudflare/resources/origin_post_quantum_encryption.py b/src/cloudflare/resources/origin_post_quantum_encryption.py index ff991b49d4c..bda025f507b 100644 --- a/src/cloudflare/resources/origin_post_quantum_encryption.py +++ b/src/cloudflare/resources/origin_post_quantum_encryption.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, Optional, cast +from typing import Any, cast from typing_extensions import Literal import httpx @@ -64,7 +64,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[OriginPostQuantumEncryptionUpdateResponse]: + ) -> OriginPostQuantumEncryptionUpdateResponse: """ Instructs Cloudflare to use Post-Quantum (PQ) key agreement algorithms when connecting to your origin. Preferred instructs Cloudflare to opportunistically @@ -88,21 +88,24 @@ def update( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._put( - f"/zones/{zone_id}/cache/origin_post_quantum_encryption", - body=maybe_transform( - {"value": value}, origin_post_quantum_encryption_update_params.OriginPostQuantumEncryptionUpdateParams - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[OriginPostQuantumEncryptionUpdateResponse]]._unwrapper, - ), - cast_to=cast( - Type[Optional[OriginPostQuantumEncryptionUpdateResponse]], - ResultWrapper[OriginPostQuantumEncryptionUpdateResponse], + return cast( + OriginPostQuantumEncryptionUpdateResponse, + self._put( + f"/zones/{zone_id}/cache/origin_post_quantum_encryption", + body=maybe_transform( + {"value": value}, + origin_post_quantum_encryption_update_params.OriginPostQuantumEncryptionUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[OriginPostQuantumEncryptionUpdateResponse]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[OriginPostQuantumEncryptionUpdateResponse] + ), # Union types cannot be passed in as arguments in the type system ), ) @@ -116,7 +119,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[OriginPostQuantumEncryptionGetResponse]: + ) -> OriginPostQuantumEncryptionGetResponse: """ Instructs Cloudflare to use Post-Quantum (PQ) key agreement algorithms when connecting to your origin. Preferred instructs Cloudflare to opportunistically @@ -138,18 +141,20 @@ def get( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._get( - f"/zones/{zone_id}/cache/origin_post_quantum_encryption", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[OriginPostQuantumEncryptionGetResponse]]._unwrapper, - ), - cast_to=cast( - Type[Optional[OriginPostQuantumEncryptionGetResponse]], - ResultWrapper[OriginPostQuantumEncryptionGetResponse], + return cast( + OriginPostQuantumEncryptionGetResponse, + self._get( + f"/zones/{zone_id}/cache/origin_post_quantum_encryption", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[OriginPostQuantumEncryptionGetResponse]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[OriginPostQuantumEncryptionGetResponse] + ), # Union types cannot be passed in as arguments in the type system ), ) @@ -185,7 +190,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[OriginPostQuantumEncryptionUpdateResponse]: + ) -> OriginPostQuantumEncryptionUpdateResponse: """ Instructs Cloudflare to use Post-Quantum (PQ) key agreement algorithms when connecting to your origin. Preferred instructs Cloudflare to opportunistically @@ -209,21 +214,24 @@ async def update( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._put( - f"/zones/{zone_id}/cache/origin_post_quantum_encryption", - body=await async_maybe_transform( - {"value": value}, origin_post_quantum_encryption_update_params.OriginPostQuantumEncryptionUpdateParams - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[OriginPostQuantumEncryptionUpdateResponse]]._unwrapper, - ), - cast_to=cast( - Type[Optional[OriginPostQuantumEncryptionUpdateResponse]], - ResultWrapper[OriginPostQuantumEncryptionUpdateResponse], + return cast( + OriginPostQuantumEncryptionUpdateResponse, + await self._put( + f"/zones/{zone_id}/cache/origin_post_quantum_encryption", + body=await async_maybe_transform( + {"value": value}, + origin_post_quantum_encryption_update_params.OriginPostQuantumEncryptionUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[OriginPostQuantumEncryptionUpdateResponse]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[OriginPostQuantumEncryptionUpdateResponse] + ), # Union types cannot be passed in as arguments in the type system ), ) @@ -237,7 +245,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[OriginPostQuantumEncryptionGetResponse]: + ) -> OriginPostQuantumEncryptionGetResponse: """ Instructs Cloudflare to use Post-Quantum (PQ) key agreement algorithms when connecting to your origin. Preferred instructs Cloudflare to opportunistically @@ -259,18 +267,20 @@ async def get( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._get( - f"/zones/{zone_id}/cache/origin_post_quantum_encryption", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[OriginPostQuantumEncryptionGetResponse]]._unwrapper, - ), - cast_to=cast( - Type[Optional[OriginPostQuantumEncryptionGetResponse]], - ResultWrapper[OriginPostQuantumEncryptionGetResponse], + return cast( + OriginPostQuantumEncryptionGetResponse, + await self._get( + f"/zones/{zone_id}/cache/origin_post_quantum_encryption", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[OriginPostQuantumEncryptionGetResponse]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[OriginPostQuantumEncryptionGetResponse] + ), # Union types cannot be passed in as arguments in the type system ), ) diff --git a/src/cloudflare/resources/r2/buckets/buckets.py b/src/cloudflare/resources/r2/buckets/buckets.py index 042d0b13c48..d1556b62dd5 100644 --- a/src/cloudflare/resources/r2/buckets/buckets.py +++ b/src/cloudflare/resources/r2/buckets/buckets.py @@ -118,7 +118,7 @@ def create( name: str, location_hint: Literal["apac", "eeur", "enam", "weur", "wnam"] | NotGiven = NOT_GIVEN, storage_class: Literal["Standard", "InfrequentAccess"] | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -138,7 +138,7 @@ def create( storage_class: Storage class for newly uploaded objects, unless specified otherwise. - jurisdiction: Creates the bucket in the provided jurisdiction + cf_r2_jurisdiction: Creates the bucket in the provided jurisdiction extra_headers: Send extra headers @@ -151,7 +151,9 @@ def create( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return self._post( @@ -184,7 +186,7 @@ def list( order: Literal["name"] | NotGiven = NOT_GIVEN, per_page: float | NotGiven = NOT_GIVEN, start_after: str | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -212,7 +214,7 @@ def list( start_after: Bucket name to start searching after. Buckets are ordered lexicographically. - jurisdiction: Lists buckets in the provided jurisdiction + cf_r2_jurisdiction: Lists buckets in the provided jurisdiction extra_headers: Send extra headers @@ -225,7 +227,9 @@ def list( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return self._get( @@ -256,7 +260,7 @@ def delete( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -272,7 +276,7 @@ def delete( bucket_name: Name of the bucket - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -287,7 +291,9 @@ def delete( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return self._delete( @@ -307,7 +313,7 @@ def get( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -323,7 +329,7 @@ def get( bucket_name: Name of the bucket - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -338,7 +344,9 @@ def get( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return self._get( @@ -401,7 +409,7 @@ async def create( name: str, location_hint: Literal["apac", "eeur", "enam", "weur", "wnam"] | NotGiven = NOT_GIVEN, storage_class: Literal["Standard", "InfrequentAccess"] | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -421,7 +429,7 @@ async def create( storage_class: Storage class for newly uploaded objects, unless specified otherwise. - jurisdiction: Creates the bucket in the provided jurisdiction + cf_r2_jurisdiction: Creates the bucket in the provided jurisdiction extra_headers: Send extra headers @@ -434,7 +442,9 @@ async def create( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return await self._post( @@ -467,7 +477,7 @@ async def list( order: Literal["name"] | NotGiven = NOT_GIVEN, per_page: float | NotGiven = NOT_GIVEN, start_after: str | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -495,7 +505,7 @@ async def list( start_after: Bucket name to start searching after. Buckets are ordered lexicographically. - jurisdiction: Lists buckets in the provided jurisdiction + cf_r2_jurisdiction: Lists buckets in the provided jurisdiction extra_headers: Send extra headers @@ -508,7 +518,9 @@ async def list( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return await self._get( @@ -539,7 +551,7 @@ async def delete( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -555,7 +567,7 @@ async def delete( bucket_name: Name of the bucket - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -570,7 +582,9 @@ async def delete( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return await self._delete( @@ -590,7 +604,7 @@ async def get( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -606,7 +620,7 @@ async def get( bucket_name: Name of the bucket - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -621,7 +635,9 @@ async def get( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return await self._get( diff --git a/src/cloudflare/resources/r2/buckets/cors.py b/src/cloudflare/resources/r2/buckets/cors.py index e56363fc759..b028f6feec6 100644 --- a/src/cloudflare/resources/r2/buckets/cors.py +++ b/src/cloudflare/resources/r2/buckets/cors.py @@ -56,7 +56,7 @@ def update( *, account_id: str, rules: Iterable[cors_update_params.Rule] | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -72,7 +72,7 @@ def update( bucket_name: Name of the bucket - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -87,7 +87,9 @@ def update( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return self._put( @@ -108,7 +110,7 @@ def delete( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -124,7 +126,7 @@ def delete( bucket_name: Name of the bucket - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -139,7 +141,9 @@ def delete( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return self._delete( @@ -159,7 +163,7 @@ def get( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -175,7 +179,7 @@ def get( bucket_name: Name of the bucket - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -190,7 +194,9 @@ def get( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return self._get( @@ -232,7 +238,7 @@ async def update( *, account_id: str, rules: Iterable[cors_update_params.Rule] | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -248,7 +254,7 @@ async def update( bucket_name: Name of the bucket - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -263,7 +269,9 @@ async def update( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return await self._put( @@ -284,7 +292,7 @@ async def delete( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -300,7 +308,7 @@ async def delete( bucket_name: Name of the bucket - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -315,7 +323,9 @@ async def delete( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return await self._delete( @@ -335,7 +345,7 @@ async def get( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -351,7 +361,7 @@ async def get( bucket_name: Name of the bucket - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -366,7 +376,9 @@ async def get( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return await self._get( diff --git a/src/cloudflare/resources/r2/buckets/domains/custom.py b/src/cloudflare/resources/r2/buckets/domains/custom.py index 9a0f624592e..34f2cac3387 100644 --- a/src/cloudflare/resources/r2/buckets/domains/custom.py +++ b/src/cloudflare/resources/r2/buckets/domains/custom.py @@ -63,7 +63,7 @@ def create( enabled: bool, zone_id: str, min_tls: Literal["1.0", "1.1", "1.2", "1.3"] | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -89,7 +89,7 @@ def create( min_tls: Minimum TLS Version the custom domain will accept for incoming connections. If not set, defaults to 1.0. - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -104,7 +104,9 @@ def create( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return self._post( @@ -136,7 +138,7 @@ def update( bucket_name: str, enabled: bool | NotGiven = NOT_GIVEN, min_tls: Literal["1.0", "1.1", "1.2", "1.3"] | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -159,7 +161,7 @@ def update( min_tls: Minimum TLS Version the custom domain will accept for incoming connections. If not set, defaults to previous value. - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -176,7 +178,9 @@ def update( if not domain_name: raise ValueError(f"Expected a non-empty value for `domain_name` but received {domain_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return self._put( @@ -203,7 +207,7 @@ def list( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -219,7 +223,7 @@ def list( bucket_name: Name of the bucket - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -234,7 +238,9 @@ def list( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return self._get( @@ -255,7 +261,7 @@ def delete( *, account_id: str, bucket_name: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -273,7 +279,7 @@ def delete( domain_name: Name of the custom domain - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -290,7 +296,9 @@ def delete( if not domain_name: raise ValueError(f"Expected a non-empty value for `domain_name` but received {domain_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return self._delete( @@ -311,7 +319,7 @@ def get( *, account_id: str, bucket_name: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -329,7 +337,7 @@ def get( domain_name: Name of the custom domain - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -346,7 +354,9 @@ def get( if not domain_name: raise ValueError(f"Expected a non-empty value for `domain_name` but received {domain_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return self._get( @@ -391,7 +401,7 @@ async def create( enabled: bool, zone_id: str, min_tls: Literal["1.0", "1.1", "1.2", "1.3"] | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -417,7 +427,7 @@ async def create( min_tls: Minimum TLS Version the custom domain will accept for incoming connections. If not set, defaults to 1.0. - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -432,7 +442,9 @@ async def create( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return await self._post( @@ -464,7 +476,7 @@ async def update( bucket_name: str, enabled: bool | NotGiven = NOT_GIVEN, min_tls: Literal["1.0", "1.1", "1.2", "1.3"] | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -487,7 +499,7 @@ async def update( min_tls: Minimum TLS Version the custom domain will accept for incoming connections. If not set, defaults to previous value. - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -504,7 +516,9 @@ async def update( if not domain_name: raise ValueError(f"Expected a non-empty value for `domain_name` but received {domain_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return await self._put( @@ -531,7 +545,7 @@ async def list( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -547,7 +561,7 @@ async def list( bucket_name: Name of the bucket - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -562,7 +576,9 @@ async def list( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return await self._get( @@ -583,7 +599,7 @@ async def delete( *, account_id: str, bucket_name: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -601,7 +617,7 @@ async def delete( domain_name: Name of the custom domain - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -618,7 +634,9 @@ async def delete( if not domain_name: raise ValueError(f"Expected a non-empty value for `domain_name` but received {domain_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return await self._delete( @@ -639,7 +657,7 @@ async def get( *, account_id: str, bucket_name: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -657,7 +675,7 @@ async def get( domain_name: Name of the custom domain - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -674,7 +692,9 @@ async def get( if not domain_name: raise ValueError(f"Expected a non-empty value for `domain_name` but received {domain_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return await self._get( diff --git a/src/cloudflare/resources/r2/buckets/domains/managed.py b/src/cloudflare/resources/r2/buckets/domains/managed.py index 132d316021b..2c0b2ee4fb3 100644 --- a/src/cloudflare/resources/r2/buckets/domains/managed.py +++ b/src/cloudflare/resources/r2/buckets/domains/managed.py @@ -57,7 +57,7 @@ def update( *, account_id: str, enabled: bool, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -75,7 +75,7 @@ def update( enabled: Whether to enable public bucket access at the r2.dev domain - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -90,7 +90,9 @@ def update( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return self._put( @@ -111,7 +113,7 @@ def list( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -127,7 +129,7 @@ def list( bucket_name: Name of the bucket - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -142,7 +144,9 @@ def list( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return self._get( @@ -184,7 +188,7 @@ async def update( *, account_id: str, enabled: bool, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -202,7 +206,7 @@ async def update( enabled: Whether to enable public bucket access at the r2.dev domain - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -217,7 +221,9 @@ async def update( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return await self._put( @@ -238,7 +244,7 @@ async def list( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -254,7 +260,7 @@ async def list( bucket_name: Name of the bucket - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -269,7 +275,9 @@ async def list( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return await self._get( diff --git a/src/cloudflare/resources/r2/buckets/event_notifications/configuration/configuration.py b/src/cloudflare/resources/r2/buckets/event_notifications/configuration/configuration.py index 400051aa1a9..8dbe0b4cb45 100644 --- a/src/cloudflare/resources/r2/buckets/event_notifications/configuration/configuration.py +++ b/src/cloudflare/resources/r2/buckets/event_notifications/configuration/configuration.py @@ -61,7 +61,7 @@ def get( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -77,7 +77,7 @@ def get( bucket_name: Name of the bucket - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -92,7 +92,9 @@ def get( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return self._get( @@ -137,7 +139,7 @@ async def get( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -153,7 +155,7 @@ async def get( bucket_name: Name of the bucket - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -168,7 +170,9 @@ async def get( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return await self._get( diff --git a/src/cloudflare/resources/r2/buckets/event_notifications/configuration/queues.py b/src/cloudflare/resources/r2/buckets/event_notifications/configuration/queues.py index 3b58ade89b8..49728508268 100644 --- a/src/cloudflare/resources/r2/buckets/event_notifications/configuration/queues.py +++ b/src/cloudflare/resources/r2/buckets/event_notifications/configuration/queues.py @@ -56,7 +56,7 @@ def update( account_id: str, bucket_name: str, rules: Iterable[queue_update_params.Rule] | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -76,7 +76,7 @@ def update( rules: Array of rules to drive notifications - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -93,7 +93,9 @@ def update( if not queue_id: raise ValueError(f"Expected a non-empty value for `queue_id` but received {queue_id!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return self._put( @@ -115,7 +117,7 @@ def delete( *, account_id: str, bucket_name: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -135,7 +137,7 @@ def delete( queue_id: Queue ID - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -152,7 +154,9 @@ def delete( if not queue_id: raise ValueError(f"Expected a non-empty value for `queue_id` but received {queue_id!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return self._delete( @@ -195,7 +199,7 @@ async def update( account_id: str, bucket_name: str, rules: Iterable[queue_update_params.Rule] | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -215,7 +219,7 @@ async def update( rules: Array of rules to drive notifications - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -232,7 +236,9 @@ async def update( if not queue_id: raise ValueError(f"Expected a non-empty value for `queue_id` but received {queue_id!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return await self._put( @@ -254,7 +260,7 @@ async def delete( *, account_id: str, bucket_name: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -274,7 +280,7 @@ async def delete( queue_id: Queue ID - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -291,7 +297,9 @@ async def delete( if not queue_id: raise ValueError(f"Expected a non-empty value for `queue_id` but received {queue_id!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return await self._delete( diff --git a/src/cloudflare/resources/r2/buckets/lifecycle.py b/src/cloudflare/resources/r2/buckets/lifecycle.py index 96385460faf..67fe0d0acad 100644 --- a/src/cloudflare/resources/r2/buckets/lifecycle.py +++ b/src/cloudflare/resources/r2/buckets/lifecycle.py @@ -56,7 +56,7 @@ def update( *, account_id: str, rules: Iterable[lifecycle_update_params.Rule] | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -72,7 +72,7 @@ def update( bucket_name: Name of the bucket - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -87,7 +87,9 @@ def update( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return self._put( @@ -108,7 +110,7 @@ def get( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -124,7 +126,7 @@ def get( bucket_name: Name of the bucket - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -139,7 +141,9 @@ def get( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return self._get( @@ -181,7 +185,7 @@ async def update( *, account_id: str, rules: Iterable[lifecycle_update_params.Rule] | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -197,7 +201,7 @@ async def update( bucket_name: Name of the bucket - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -212,7 +216,9 @@ async def update( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return await self._put( @@ -233,7 +239,7 @@ async def get( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -249,7 +255,7 @@ async def get( bucket_name: Name of the bucket - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -264,7 +270,9 @@ async def get( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return await self._get( diff --git a/src/cloudflare/resources/r2/buckets/sippy.py b/src/cloudflare/resources/r2/buckets/sippy.py index ef325b0ef87..a8a434f7fdd 100644 --- a/src/cloudflare/resources/r2/buckets/sippy.py +++ b/src/cloudflare/resources/r2/buckets/sippy.py @@ -60,7 +60,7 @@ def update( account_id: str, destination: sippy_update_params.R2EnableSippyAwsDestination | NotGiven = NOT_GIVEN, source: sippy_update_params.R2EnableSippyAwsSource | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -80,7 +80,7 @@ def update( source: AWS S3 bucket to copy objects from - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -100,7 +100,7 @@ def update( account_id: str, destination: sippy_update_params.R2EnableSippyGcsDestination | NotGiven = NOT_GIVEN, source: sippy_update_params.R2EnableSippyGcsSource | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -120,7 +120,7 @@ def update( source: GCS bucket to copy objects from - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -142,7 +142,7 @@ def update( source: sippy_update_params.R2EnableSippyAwsSource | sippy_update_params.R2EnableSippyGcsSource | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -155,7 +155,9 @@ def update( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return self._put( @@ -182,7 +184,7 @@ def delete( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -198,7 +200,7 @@ def delete( bucket_name: Name of the bucket - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -213,7 +215,9 @@ def delete( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return self._delete( @@ -233,7 +237,7 @@ def get( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -249,7 +253,7 @@ def get( bucket_name: Name of the bucket - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -264,7 +268,9 @@ def get( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return self._get( @@ -308,7 +314,7 @@ async def update( account_id: str, destination: sippy_update_params.R2EnableSippyAwsDestination | NotGiven = NOT_GIVEN, source: sippy_update_params.R2EnableSippyAwsSource | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -328,7 +334,7 @@ async def update( source: AWS S3 bucket to copy objects from - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -348,7 +354,7 @@ async def update( account_id: str, destination: sippy_update_params.R2EnableSippyGcsDestination | NotGiven = NOT_GIVEN, source: sippy_update_params.R2EnableSippyGcsSource | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -368,7 +374,7 @@ async def update( source: GCS bucket to copy objects from - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -390,7 +396,7 @@ async def update( source: sippy_update_params.R2EnableSippyAwsSource | sippy_update_params.R2EnableSippyGcsSource | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -403,7 +409,9 @@ async def update( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return await self._put( @@ -430,7 +438,7 @@ async def delete( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -446,7 +454,7 @@ async def delete( bucket_name: Name of the bucket - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -461,7 +469,9 @@ async def delete( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return await self._delete( @@ -481,7 +491,7 @@ async def get( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -497,7 +507,7 @@ async def get( bucket_name: Name of the bucket - jurisdiction: The bucket jurisdiction + cf_r2_jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -512,7 +522,9 @@ async def get( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given( + {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} + ), **(extra_headers or {}), } return await self._get( diff --git a/src/cloudflare/resources/radar/ai/bots/summary.py b/src/cloudflare/resources/radar/ai/bots/summary.py index e8a1c0a005a..f1cf1315778 100644 --- a/src/cloudflare/resources/radar/ai/bots/summary.py +++ b/src/cloudflare/resources/radar/ai/bots/summary.py @@ -58,7 +58,6 @@ def user_agent( date_range: List[str] | NotGiven = NOT_GIVEN, date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -91,9 +90,6 @@ def user_agent( format: Format results are returned in. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -123,7 +119,6 @@ def user_agent( "date_range": date_range, "date_start": date_start, "format": format, - "limit_per_group": limit_per_group, "location": location, "name": name, }, @@ -164,7 +159,6 @@ async def user_agent( date_range: List[str] | NotGiven = NOT_GIVEN, date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -197,9 +191,6 @@ async def user_agent( format: Format results are returned in. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -229,7 +220,6 @@ async def user_agent( "date_range": date_range, "date_start": date_start, "format": format, - "limit_per_group": limit_per_group, "location": location, "name": name, }, diff --git a/src/cloudflare/resources/radar/as112/summary.py b/src/cloudflare/resources/radar/as112/summary.py index 64f1fa64f29..34d4b1676a6 100644 --- a/src/cloudflare/resources/radar/as112/summary.py +++ b/src/cloudflare/resources/radar/as112/summary.py @@ -386,7 +386,6 @@ def query_type( date_range: List[str] | NotGiven = NOT_GIVEN, date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -418,9 +417,6 @@ def query_type( format: Format results are returned in. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -450,7 +446,6 @@ def query_type( "date_range": date_range, "date_start": date_start, "format": format, - "limit_per_group": limit_per_group, "location": location, "name": name, }, @@ -470,7 +465,6 @@ def response_codes( date_range: List[str] | NotGiven = NOT_GIVEN, date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -502,9 +496,6 @@ def response_codes( format: Format results are returned in. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -534,7 +525,6 @@ def response_codes( "date_range": date_range, "date_start": date_start, "format": format, - "limit_per_group": limit_per_group, "location": location, "name": name, }, @@ -891,7 +881,6 @@ async def query_type( date_range: List[str] | NotGiven = NOT_GIVEN, date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -923,9 +912,6 @@ async def query_type( format: Format results are returned in. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -955,7 +941,6 @@ async def query_type( "date_range": date_range, "date_start": date_start, "format": format, - "limit_per_group": limit_per_group, "location": location, "name": name, }, @@ -975,7 +960,6 @@ async def response_codes( date_range: List[str] | NotGiven = NOT_GIVEN, date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1007,9 +991,6 @@ async def response_codes( format: Format results are returned in. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -1039,7 +1020,6 @@ async def response_codes( "date_range": date_range, "date_start": date_start, "format": format, - "limit_per_group": limit_per_group, "location": location, "name": name, }, diff --git a/src/cloudflare/resources/radar/as112/timeseries_groups.py b/src/cloudflare/resources/radar/as112/timeseries_groups.py index 4571879b766..00695c14157 100644 --- a/src/cloudflare/resources/radar/as112/timeseries_groups.py +++ b/src/cloudflare/resources/radar/as112/timeseries_groups.py @@ -411,7 +411,6 @@ def query_type( date_range: List[str] | NotGiven = NOT_GIVEN, date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -447,9 +446,6 @@ def query_type( format: Format results are returned in. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -480,7 +476,6 @@ def query_type( "date_range": date_range, "date_start": date_start, "format": format, - "limit_per_group": limit_per_group, "location": location, "name": name, }, @@ -501,7 +496,6 @@ def response_codes( date_range: List[str] | NotGiven = NOT_GIVEN, date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -538,9 +532,6 @@ def response_codes( format: Format results are returned in. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -571,7 +562,6 @@ def response_codes( "date_range": date_range, "date_start": date_start, "format": format, - "limit_per_group": limit_per_group, "location": location, "name": name, }, @@ -955,7 +945,6 @@ async def query_type( date_range: List[str] | NotGiven = NOT_GIVEN, date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -991,9 +980,6 @@ async def query_type( format: Format results are returned in. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -1024,7 +1010,6 @@ async def query_type( "date_range": date_range, "date_start": date_start, "format": format, - "limit_per_group": limit_per_group, "location": location, "name": name, }, @@ -1045,7 +1030,6 @@ async def response_codes( date_range: List[str] | NotGiven = NOT_GIVEN, date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1082,9 +1066,6 @@ async def response_codes( format: Format results are returned in. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -1115,7 +1096,6 @@ async def response_codes( "date_range": date_range, "date_start": date_start, "format": format, - "limit_per_group": limit_per_group, "location": location, "name": name, }, diff --git a/src/cloudflare/resources/radar/attacks/layer3/summary.py b/src/cloudflare/resources/radar/attacks/layer3/summary.py index b4f5c7853cc..0e6843b6167 100644 --- a/src/cloudflare/resources/radar/attacks/layer3/summary.py +++ b/src/cloudflare/resources/radar/attacks/layer3/summary.py @@ -487,7 +487,6 @@ def vector( direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, @@ -521,9 +520,6 @@ def vector( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -556,7 +552,6 @@ def vector( "direction": direction, "format": format, "ip_version": ip_version, - "limit_per_group": limit_per_group, "location": location, "name": name, "protocol": protocol, @@ -1015,7 +1010,6 @@ async def vector( direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, @@ -1049,9 +1043,6 @@ async def vector( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -1084,7 +1075,6 @@ async def vector( "direction": direction, "format": format, "ip_version": ip_version, - "limit_per_group": limit_per_group, "location": location, "name": name, "protocol": protocol, diff --git a/src/cloudflare/resources/radar/attacks/layer7/summary.py b/src/cloudflare/resources/radar/attacks/layer7/summary.py index 69a23e0ced4..2dd6c303e25 100644 --- a/src/cloudflare/resources/radar/attacks/layer7/summary.py +++ b/src/cloudflare/resources/radar/attacks/layer7/summary.py @@ -151,7 +151,6 @@ def http_method( format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, mitigation_product: List[ Literal[ @@ -193,9 +192,6 @@ def http_method( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -229,7 +225,6 @@ def http_method( "format": format, "http_version": http_version, "ip_version": ip_version, - "limit_per_group": limit_per_group, "location": location, "mitigation_product": mitigation_product, "name": name, @@ -595,7 +590,6 @@ def managed_rules( | NotGiven = NOT_GIVEN, http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, mitigation_product: List[ Literal[ @@ -639,9 +633,6 @@ def managed_rules( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -676,7 +667,6 @@ def managed_rules( "http_method": http_method, "http_version": http_version, "ip_version": ip_version, - "limit_per_group": limit_per_group, "location": location, "mitigation_product": mitigation_product, "name": name, @@ -750,7 +740,6 @@ def mitigation_product( | NotGiven = NOT_GIVEN, http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -788,9 +777,6 @@ def mitigation_product( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -823,7 +809,6 @@ def mitigation_product( "http_method": http_method, "http_version": http_version, "ip_version": ip_version, - "limit_per_group": limit_per_group, "location": location, "name": name, }, @@ -945,7 +930,6 @@ async def http_method( format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, mitigation_product: List[ Literal[ @@ -987,9 +971,6 @@ async def http_method( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -1023,7 +1004,6 @@ async def http_method( "format": format, "http_version": http_version, "ip_version": ip_version, - "limit_per_group": limit_per_group, "location": location, "mitigation_product": mitigation_product, "name": name, @@ -1389,7 +1369,6 @@ async def managed_rules( | NotGiven = NOT_GIVEN, http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, mitigation_product: List[ Literal[ @@ -1433,9 +1412,6 @@ async def managed_rules( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -1470,7 +1446,6 @@ async def managed_rules( "http_method": http_method, "http_version": http_version, "ip_version": ip_version, - "limit_per_group": limit_per_group, "location": location, "mitigation_product": mitigation_product, "name": name, @@ -1544,7 +1519,6 @@ async def mitigation_product( | NotGiven = NOT_GIVEN, http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1582,9 +1556,6 @@ async def mitigation_product( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -1617,7 +1588,6 @@ async def mitigation_product( "http_method": http_method, "http_version": http_version, "ip_version": ip_version, - "limit_per_group": limit_per_group, "location": location, "name": name, }, diff --git a/src/cloudflare/resources/radar/attacks/layer7/timeseries_groups.py b/src/cloudflare/resources/radar/attacks/layer7/timeseries_groups.py index e57361ae51c..864e7659cde 100644 --- a/src/cloudflare/resources/radar/attacks/layer7/timeseries_groups.py +++ b/src/cloudflare/resources/radar/attacks/layer7/timeseries_groups.py @@ -164,7 +164,6 @@ def http_method( format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, mitigation_product: List[ Literal[ @@ -211,9 +210,6 @@ def http_method( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -251,7 +247,6 @@ def http_method( "format": format, "http_version": http_version, "ip_version": ip_version, - "limit_per_group": limit_per_group, "location": location, "mitigation_product": mitigation_product, "name": name, @@ -807,7 +802,6 @@ def managed_rules( | NotGiven = NOT_GIVEN, http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, mitigation_product: List[ Literal[ @@ -856,9 +850,6 @@ def managed_rules( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -897,7 +888,6 @@ def managed_rules( "http_method": http_method, "http_version": http_version, "ip_version": ip_version, - "limit_per_group": limit_per_group, "location": location, "mitigation_product": mitigation_product, "name": name, @@ -973,7 +963,6 @@ def mitigation_product( | NotGiven = NOT_GIVEN, http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, normalization: Literal["PERCENTAGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, @@ -1016,9 +1005,6 @@ def mitigation_product( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -1055,7 +1041,6 @@ def mitigation_product( "http_method": http_method, "http_version": http_version, "ip_version": ip_version, - "limit_per_group": limit_per_group, "location": location, "name": name, "normalization": normalization, @@ -1353,7 +1338,6 @@ async def http_method( format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, mitigation_product: List[ Literal[ @@ -1400,9 +1384,6 @@ async def http_method( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -1440,7 +1421,6 @@ async def http_method( "format": format, "http_version": http_version, "ip_version": ip_version, - "limit_per_group": limit_per_group, "location": location, "mitigation_product": mitigation_product, "name": name, @@ -1996,7 +1976,6 @@ async def managed_rules( | NotGiven = NOT_GIVEN, http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, mitigation_product: List[ Literal[ @@ -2045,9 +2024,6 @@ async def managed_rules( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -2086,7 +2062,6 @@ async def managed_rules( "http_method": http_method, "http_version": http_version, "ip_version": ip_version, - "limit_per_group": limit_per_group, "location": location, "mitigation_product": mitigation_product, "name": name, @@ -2162,7 +2137,6 @@ async def mitigation_product( | NotGiven = NOT_GIVEN, http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, normalization: Literal["PERCENTAGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, @@ -2205,9 +2179,6 @@ async def mitigation_product( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -2244,7 +2215,6 @@ async def mitigation_product( "http_method": http_method, "http_version": http_version, "ip_version": ip_version, - "limit_per_group": limit_per_group, "location": location, "name": name, "normalization": normalization, diff --git a/src/cloudflare/resources/radar/http/timeseries_groups.py b/src/cloudflare/resources/radar/http/timeseries_groups.py index 1b1a6da94db..d4c1800e0c5 100644 --- a/src/cloudflare/resources/radar/http/timeseries_groups.py +++ b/src/cloudflare/resources/radar/http/timeseries_groups.py @@ -318,7 +318,6 @@ def browser_family( http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] @@ -369,9 +368,6 @@ def browser_family( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -411,7 +407,6 @@ def browser_family( "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, - "limit_per_group": limit_per_group, "location": location, "name": name, "os": os, @@ -1479,7 +1474,6 @@ async def browser_family( http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] @@ -1530,9 +1524,6 @@ async def browser_family( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -1572,7 +1563,6 @@ async def browser_family( "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, - "limit_per_group": limit_per_group, "location": location, "name": name, "os": os, diff --git a/src/cloudflare/resources/radar/ranking/domain.py b/src/cloudflare/resources/radar/ranking/domain.py index 1c2e3a87f4f..60ea7cf7f98 100644 --- a/src/cloudflare/resources/radar/ranking/domain.py +++ b/src/cloudflare/resources/radar/ranking/domain.py @@ -2,8 +2,7 @@ from __future__ import annotations -from typing import List, Type, Union, cast -from datetime import date +from typing import List, Type, cast from typing_extensions import Literal import httpx @@ -53,9 +52,8 @@ def get( self, domain: str, *, - date: List[Union[str, date]] | NotGiven = NOT_GIVEN, + date: List[str] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - include_top_locations: bool | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, ranking_type: Literal["POPULAR", "TRENDING_RISE", "TRENDING_STEADY"] | NotGiven = NOT_GIVEN, @@ -78,8 +76,6 @@ def get( format: Format results are returned in. - include_top_locations: Include top locations in the response. - limit: Limit the number of objects in the response. name: Array of names that will be used to name the series in responses. @@ -107,7 +103,6 @@ def get( { "date": date, "format": format, - "include_top_locations": include_top_locations, "limit": limit, "name": name, "ranking_type": ranking_type, @@ -144,9 +139,8 @@ async def get( self, domain: str, *, - date: List[Union[str, date]] | NotGiven = NOT_GIVEN, + date: List[str] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - include_top_locations: bool | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, ranking_type: Literal["POPULAR", "TRENDING_RISE", "TRENDING_STEADY"] | NotGiven = NOT_GIVEN, @@ -169,8 +163,6 @@ async def get( format: Format results are returned in. - include_top_locations: Include top locations in the response. - limit: Limit the number of objects in the response. name: Array of names that will be used to name the series in responses. @@ -198,7 +190,6 @@ async def get( { "date": date, "format": format, - "include_top_locations": include_top_locations, "limit": limit, "name": name, "ranking_type": ranking_type, diff --git a/src/cloudflare/resources/radar/ranking/ranking.py b/src/cloudflare/resources/radar/ranking/ranking.py index 86136d7ad46..d3b371159c1 100644 --- a/src/cloudflare/resources/radar/ranking/ranking.py +++ b/src/cloudflare/resources/radar/ranking/ranking.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List, Type, Union, cast -from datetime import date, datetime +from datetime import datetime from typing_extensions import Literal import httpx @@ -143,7 +143,7 @@ def timeseries_groups( def top( self, *, - date: List[Union[str, date]] | NotGiven = NOT_GIVEN, + date: List[str] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, @@ -313,7 +313,7 @@ async def timeseries_groups( async def top( self, *, - date: List[Union[str, date]] | NotGiven = NOT_GIVEN, + date: List[str] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, diff --git a/src/cloudflare/resources/rules/lists/items.py b/src/cloudflare/resources/rules/lists/items.py index 6245c7c21ce..dbe7c34c9b9 100644 --- a/src/cloudflare/resources/rules/lists/items.py +++ b/src/cloudflare/resources/rules/lists/items.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, Iterable, cast +from typing import Any, Type, Iterable, cast import httpx @@ -219,7 +219,7 @@ def list( item_list_params.ItemListParams, ), ), - model=ItemListResponse, + model=cast(Any, ItemListResponse), # Union types cannot be passed in as arguments in the type system ) def delete( @@ -308,16 +308,21 @@ def get( raise ValueError(f"Expected a non-empty value for `list_id` but received {list_id!r}") if not item_id: raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}") - return self._get( - f"/accounts/{account_identifier}/rules/lists/{list_id}/items/{item_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ItemGetResponse]._unwrapper, + return cast( + ItemGetResponse, + self._get( + f"/accounts/{account_identifier}/rules/lists/{list_id}/items/{item_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ItemGetResponse]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[ItemGetResponse] + ), # Union types cannot be passed in as arguments in the type system ), - cast_to=cast(Type[ItemGetResponse], ResultWrapper[ItemGetResponse]), ) @@ -508,7 +513,7 @@ def list( item_list_params.ItemListParams, ), ), - model=ItemListResponse, + model=cast(Any, ItemListResponse), # Union types cannot be passed in as arguments in the type system ) async def delete( @@ -597,16 +602,21 @@ async def get( raise ValueError(f"Expected a non-empty value for `list_id` but received {list_id!r}") if not item_id: raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}") - return await self._get( - f"/accounts/{account_identifier}/rules/lists/{list_id}/items/{item_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ItemGetResponse]._unwrapper, + return cast( + ItemGetResponse, + await self._get( + f"/accounts/{account_identifier}/rules/lists/{list_id}/items/{item_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ItemGetResponse]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[ItemGetResponse] + ), # Union types cannot be passed in as arguments in the type system ), - cast_to=cast(Type[ItemGetResponse], ResultWrapper[ItemGetResponse]), ) diff --git a/src/cloudflare/resources/url_normalization.py b/src/cloudflare/resources/url_normalization.py index 87bab9c625e..3fff83e46ad 100644 --- a/src/cloudflare/resources/url_normalization.py +++ b/src/cloudflare/resources/url_normalization.py @@ -2,12 +2,9 @@ from __future__ import annotations -from typing import Type, cast -from typing_extensions import Literal - import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import ( maybe_transform, async_maybe_transform, @@ -20,7 +17,6 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from .._wrappers import ResultWrapper from .._base_client import make_request_options from ..types.url_normalization import url_normalization_update_params from ..types.url_normalization.url_normalization_get_response import URLNormalizationGetResponse @@ -53,8 +49,8 @@ def update( self, *, zone_id: str, - scope: Literal["incoming", "both"], - type: Literal["cloudflare", "rfc3986"], + scope: str | NotGiven = NOT_GIVEN, + type: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -63,10 +59,10 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> URLNormalizationUpdateResponse: """ - Updates the URL Normalization settings. + Updates the URL normalization settings. Args: - zone_id: The unique ID of the zone. + zone_id: Identifier scope: The scope of the URL normalization. @@ -91,50 +87,10 @@ def update( }, url_normalization_update_params.URLNormalizationUpdateParams, ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[URLNormalizationUpdateResponse]._unwrapper, - ), - cast_to=cast(Type[URLNormalizationUpdateResponse], ResultWrapper[URLNormalizationUpdateResponse]), - ) - - def delete( - self, - *, - zone_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> None: - """ - Deletes the URL Normalization settings. - - Args: - zone_id: The unique ID of the zone. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - extra_headers = {"Accept": "*/*", **(extra_headers or {})} - return self._delete( - f"/zones/{zone_id}/url_normalization", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=NoneType, + cast_to=URLNormalizationUpdateResponse, ) def get( @@ -149,10 +105,10 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> URLNormalizationGetResponse: """ - Fetches the current URL Normalization settings. + Fetches the current URL normalization settings. Args: - zone_id: The unique ID of the zone. + zone_id: Identifier extra_headers: Send extra headers @@ -167,13 +123,9 @@ def get( return self._get( f"/zones/{zone_id}/url_normalization", options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[URLNormalizationGetResponse]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[URLNormalizationGetResponse], ResultWrapper[URLNormalizationGetResponse]), + cast_to=URLNormalizationGetResponse, ) @@ -201,8 +153,8 @@ async def update( self, *, zone_id: str, - scope: Literal["incoming", "both"], - type: Literal["cloudflare", "rfc3986"], + scope: str | NotGiven = NOT_GIVEN, + type: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -211,10 +163,10 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> URLNormalizationUpdateResponse: """ - Updates the URL Normalization settings. + Updates the URL normalization settings. Args: - zone_id: The unique ID of the zone. + zone_id: Identifier scope: The scope of the URL normalization. @@ -239,50 +191,10 @@ async def update( }, url_normalization_update_params.URLNormalizationUpdateParams, ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[URLNormalizationUpdateResponse]._unwrapper, - ), - cast_to=cast(Type[URLNormalizationUpdateResponse], ResultWrapper[URLNormalizationUpdateResponse]), - ) - - async def delete( - self, - *, - zone_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> None: - """ - Deletes the URL Normalization settings. - - Args: - zone_id: The unique ID of the zone. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - extra_headers = {"Accept": "*/*", **(extra_headers or {})} - return await self._delete( - f"/zones/{zone_id}/url_normalization", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=NoneType, + cast_to=URLNormalizationUpdateResponse, ) async def get( @@ -297,10 +209,10 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> URLNormalizationGetResponse: """ - Fetches the current URL Normalization settings. + Fetches the current URL normalization settings. Args: - zone_id: The unique ID of the zone. + zone_id: Identifier extra_headers: Send extra headers @@ -315,13 +227,9 @@ async def get( return await self._get( f"/zones/{zone_id}/url_normalization", options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[URLNormalizationGetResponse]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[URLNormalizationGetResponse], ResultWrapper[URLNormalizationGetResponse]), + cast_to=URLNormalizationGetResponse, ) @@ -332,9 +240,6 @@ def __init__(self, url_normalization: URLNormalizationResource) -> None: self.update = to_raw_response_wrapper( url_normalization.update, ) - self.delete = to_raw_response_wrapper( - url_normalization.delete, - ) self.get = to_raw_response_wrapper( url_normalization.get, ) @@ -347,9 +252,6 @@ def __init__(self, url_normalization: AsyncURLNormalizationResource) -> None: self.update = async_to_raw_response_wrapper( url_normalization.update, ) - self.delete = async_to_raw_response_wrapper( - url_normalization.delete, - ) self.get = async_to_raw_response_wrapper( url_normalization.get, ) @@ -362,9 +264,6 @@ def __init__(self, url_normalization: URLNormalizationResource) -> None: self.update = to_streamed_response_wrapper( url_normalization.update, ) - self.delete = to_streamed_response_wrapper( - url_normalization.delete, - ) self.get = to_streamed_response_wrapper( url_normalization.get, ) @@ -377,9 +276,6 @@ def __init__(self, url_normalization: AsyncURLNormalizationResource) -> None: self.update = async_to_streamed_response_wrapper( url_normalization.update, ) - self.delete = async_to_streamed_response_wrapper( - url_normalization.delete, - ) self.get = async_to_streamed_response_wrapper( url_normalization.get, ) diff --git a/src/cloudflare/resources/url_scanner/responses.py b/src/cloudflare/resources/url_scanner/responses.py index 322e44344bc..cc0beef4e57 100644 --- a/src/cloudflare/resources/url_scanner/responses.py +++ b/src/cloudflare/resources/url_scanner/responses.py @@ -56,7 +56,7 @@ def get( will be returned. Args: - account_id: Account ID. + account_id: Account Id. response_id: Response hash. @@ -120,7 +120,7 @@ async def get( will be returned. Args: - account_id: Account ID. + account_id: Account Id. response_id: Response hash. diff --git a/src/cloudflare/resources/url_scanner/scans.py b/src/cloudflare/resources/url_scanner/scans.py index dc22dbddda8..a060414acce 100644 --- a/src/cloudflare/resources/url_scanner/scans.py +++ b/src/cloudflare/resources/url_scanner/scans.py @@ -62,8 +62,8 @@ def with_streaming_response(self) -> ScansResourceWithStreamingResponse: def create( self, - *, account_id: str, + *, url: str, customagent: str | NotGiven = NOT_GIVEN, custom_headers: Dict[str, str] | NotGiven = NOT_GIVEN, @@ -83,7 +83,7 @@ def create( https://developers.cloudflare.com/security-center/investigate/scan-limits/. Args: - account_id: Account ID. + account_id: Account Id. custom_headers: Set custom headers. @@ -130,8 +130,8 @@ def create( def list( self, - *, account_id: str, + *, q: str | NotGiven = NOT_GIVEN, size: int | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -155,7 +155,7 @@ def list( with the given hash was downloaded. Args: - account_id: Account ID. + account_id: Account Id. q: Filter scans @@ -191,8 +191,8 @@ def list( def bulk_create( self, - *, account_id: str, + *, body: Iterable[scan_bulk_create_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -209,7 +209,7 @@ def bulk_create( longer to finish. Args: - account_id: Account ID. + account_id: Account Id. body: List of urls to scan (up to a 100). @@ -249,9 +249,9 @@ def dom( Chrome. Args: - account_id: Account ID. + account_id: Account Id. - scan_id: Scan UUID. + scan_id: Scan uuid. extra_headers: Send extra headers @@ -290,9 +290,9 @@ def get( Get URL scan by uuid Args: - account_id: Account ID. + account_id: Account Id. - scan_id: Scan UUID. + scan_id: Scan uuid. extra_headers: Send extra headers @@ -332,9 +332,9 @@ def har( http://www.softwareishard.com/blog/har-12-spec/. Args: - account_id: Account ID. + account_id: Account Id. - scan_id: Scan UUID. + scan_id: Scan uuid. extra_headers: Send extra headers @@ -373,9 +373,9 @@ def screenshot( Get scan's screenshot by resolution (desktop/mobile/tablet). Args: - account_id: Account ID. + account_id: Account Id. - scan_id: Scan UUID. + scan_id: Scan uuid. resolution: Target device type. @@ -427,8 +427,8 @@ def with_streaming_response(self) -> AsyncScansResourceWithStreamingResponse: async def create( self, - *, account_id: str, + *, url: str, customagent: str | NotGiven = NOT_GIVEN, custom_headers: Dict[str, str] | NotGiven = NOT_GIVEN, @@ -448,7 +448,7 @@ async def create( https://developers.cloudflare.com/security-center/investigate/scan-limits/. Args: - account_id: Account ID. + account_id: Account Id. custom_headers: Set custom headers. @@ -495,8 +495,8 @@ async def create( async def list( self, - *, account_id: str, + *, q: str | NotGiven = NOT_GIVEN, size: int | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -520,7 +520,7 @@ async def list( with the given hash was downloaded. Args: - account_id: Account ID. + account_id: Account Id. q: Filter scans @@ -556,8 +556,8 @@ async def list( async def bulk_create( self, - *, account_id: str, + *, body: Iterable[scan_bulk_create_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -574,7 +574,7 @@ async def bulk_create( longer to finish. Args: - account_id: Account ID. + account_id: Account Id. body: List of urls to scan (up to a 100). @@ -614,9 +614,9 @@ async def dom( Chrome. Args: - account_id: Account ID. + account_id: Account Id. - scan_id: Scan UUID. + scan_id: Scan uuid. extra_headers: Send extra headers @@ -655,9 +655,9 @@ async def get( Get URL scan by uuid Args: - account_id: Account ID. + account_id: Account Id. - scan_id: Scan UUID. + scan_id: Scan uuid. extra_headers: Send extra headers @@ -697,9 +697,9 @@ async def har( http://www.softwareishard.com/blog/har-12-spec/. Args: - account_id: Account ID. + account_id: Account Id. - scan_id: Scan UUID. + scan_id: Scan uuid. extra_headers: Send extra headers @@ -738,9 +738,9 @@ async def screenshot( Get scan's screenshot by resolution (desktop/mobile/tablet). Args: - account_id: Account ID. + account_id: Account Id. - scan_id: Scan UUID. + scan_id: Scan uuid. resolution: Target device type. diff --git a/src/cloudflare/resources/vectorize/indexes/indexes.py b/src/cloudflare/resources/vectorize/indexes/indexes.py index f0f19510cce..c6529e277b6 100644 --- a/src/cloudflare/resources/vectorize/indexes/indexes.py +++ b/src/cloudflare/resources/vectorize/indexes/indexes.py @@ -175,7 +175,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[IndexDeleteResponse]: + ) -> IndexDeleteResponse: """ Deletes the specified Vectorize Index. @@ -195,7 +195,7 @@ def delete( if not index_name: raise ValueError(f"Expected a non-empty value for `index_name` but received {index_name!r}") return cast( - Optional[IndexDeleteResponse], + IndexDeleteResponse, self._delete( f"/accounts/{account_id}/vectorize/v2/indexes/{index_name}", options=make_request_options( @@ -203,7 +203,7 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[IndexDeleteResponse]]._unwrapper, + post_parser=ResultWrapper[IndexDeleteResponse]._unwrapper, ), cast_to=cast( Any, ResultWrapper[IndexDeleteResponse] @@ -687,7 +687,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[IndexDeleteResponse]: + ) -> IndexDeleteResponse: """ Deletes the specified Vectorize Index. @@ -707,7 +707,7 @@ async def delete( if not index_name: raise ValueError(f"Expected a non-empty value for `index_name` but received {index_name!r}") return cast( - Optional[IndexDeleteResponse], + IndexDeleteResponse, await self._delete( f"/accounts/{account_id}/vectorize/v2/indexes/{index_name}", options=make_request_options( @@ -715,7 +715,7 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[IndexDeleteResponse]]._unwrapper, + post_parser=ResultWrapper[IndexDeleteResponse]._unwrapper, ), cast_to=cast( Any, ResultWrapper[IndexDeleteResponse] diff --git a/src/cloudflare/resources/waiting_rooms/waiting_rooms.py b/src/cloudflare/resources/waiting_rooms/waiting_rooms.py index 4b9c83a3687..a7a4308e856 100644 --- a/src/cloudflare/resources/waiting_rooms/waiting_rooms.py +++ b/src/cloudflare/resources/waiting_rooms/waiting_rooms.py @@ -180,9 +180,6 @@ def create( queueing_status_code: Literal[200, 202, 429] | NotGiven = NOT_GIVEN, session_duration: int | NotGiven = NOT_GIVEN, suspended: bool | NotGiven = NOT_GIVEN, - turnstile_action: Literal["log", "infinite_queue"] | NotGiven = NOT_GIVEN, - turnstile_mode: Literal["off", "invisible", "visible_non_interactive", "visible_managed"] - | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -454,18 +451,6 @@ def create( suspended: Suspends or allows traffic going to the waiting room. If set to `true`, the traffic will not go to the waiting room. - turnstile_action: Which action to take when a bot is detected using Turnstile. `log` will have no - impact on queueing behavior, simply keeping track of how many bots are detected - in Waiting Room Analytics. `infinite_queue` will send bots to a false queueing - state, where they will never reach your origin. `infinite_queue` requires - Advanced Waiting Room. - - turnstile_mode: Which Turnstile widget type to use for detecting bot traffic. See - [the Turnstile documentation](https://developers.cloudflare.com/turnstile/concepts/widget/#widget-types) - for the definitions of these widget types. Set to `off` to disable the Turnstile - integration entirely. Setting this to anything other than `off` or `invisible` - requires Advanced Waiting Room. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -499,8 +484,6 @@ def create( "queueing_status_code": queueing_status_code, "session_duration": session_duration, "suspended": suspended, - "turnstile_action": turnstile_action, - "turnstile_mode": turnstile_mode, }, waiting_room_create_params.WaitingRoomCreateParams, ), @@ -578,9 +561,6 @@ def update( queueing_status_code: Literal[200, 202, 429] | NotGiven = NOT_GIVEN, session_duration: int | NotGiven = NOT_GIVEN, suspended: bool | NotGiven = NOT_GIVEN, - turnstile_action: Literal["log", "infinite_queue"] | NotGiven = NOT_GIVEN, - turnstile_mode: Literal["off", "invisible", "visible_non_interactive", "visible_managed"] - | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -852,18 +832,6 @@ def update( suspended: Suspends or allows traffic going to the waiting room. If set to `true`, the traffic will not go to the waiting room. - turnstile_action: Which action to take when a bot is detected using Turnstile. `log` will have no - impact on queueing behavior, simply keeping track of how many bots are detected - in Waiting Room Analytics. `infinite_queue` will send bots to a false queueing - state, where they will never reach your origin. `infinite_queue` requires - Advanced Waiting Room. - - turnstile_mode: Which Turnstile widget type to use for detecting bot traffic. See - [the Turnstile documentation](https://developers.cloudflare.com/turnstile/concepts/widget/#widget-types) - for the definitions of these widget types. Set to `off` to disable the Turnstile - integration entirely. Setting this to anything other than `off` or `invisible` - requires Advanced Waiting Room. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -899,8 +867,6 @@ def update( "queueing_status_code": queueing_status_code, "session_duration": session_duration, "suspended": suspended, - "turnstile_action": turnstile_action, - "turnstile_mode": turnstile_mode, }, waiting_room_update_params.WaitingRoomUpdateParams, ), @@ -1072,9 +1038,6 @@ def edit( queueing_status_code: Literal[200, 202, 429] | NotGiven = NOT_GIVEN, session_duration: int | NotGiven = NOT_GIVEN, suspended: bool | NotGiven = NOT_GIVEN, - turnstile_action: Literal["log", "infinite_queue"] | NotGiven = NOT_GIVEN, - turnstile_mode: Literal["off", "invisible", "visible_non_interactive", "visible_managed"] - | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1346,18 +1309,6 @@ def edit( suspended: Suspends or allows traffic going to the waiting room. If set to `true`, the traffic will not go to the waiting room. - turnstile_action: Which action to take when a bot is detected using Turnstile. `log` will have no - impact on queueing behavior, simply keeping track of how many bots are detected - in Waiting Room Analytics. `infinite_queue` will send bots to a false queueing - state, where they will never reach your origin. `infinite_queue` requires - Advanced Waiting Room. - - turnstile_mode: Which Turnstile widget type to use for detecting bot traffic. See - [the Turnstile documentation](https://developers.cloudflare.com/turnstile/concepts/widget/#widget-types) - for the definitions of these widget types. Set to `off` to disable the Turnstile - integration entirely. Setting this to anything other than `off` or `invisible` - requires Advanced Waiting Room. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1393,8 +1344,6 @@ def edit( "queueing_status_code": queueing_status_code, "session_duration": session_duration, "suspended": suspended, - "turnstile_action": turnstile_action, - "turnstile_mode": turnstile_mode, }, waiting_room_edit_params.WaitingRoomEditParams, ), @@ -1554,9 +1503,6 @@ async def create( queueing_status_code: Literal[200, 202, 429] | NotGiven = NOT_GIVEN, session_duration: int | NotGiven = NOT_GIVEN, suspended: bool | NotGiven = NOT_GIVEN, - turnstile_action: Literal["log", "infinite_queue"] | NotGiven = NOT_GIVEN, - turnstile_mode: Literal["off", "invisible", "visible_non_interactive", "visible_managed"] - | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1828,18 +1774,6 @@ async def create( suspended: Suspends or allows traffic going to the waiting room. If set to `true`, the traffic will not go to the waiting room. - turnstile_action: Which action to take when a bot is detected using Turnstile. `log` will have no - impact on queueing behavior, simply keeping track of how many bots are detected - in Waiting Room Analytics. `infinite_queue` will send bots to a false queueing - state, where they will never reach your origin. `infinite_queue` requires - Advanced Waiting Room. - - turnstile_mode: Which Turnstile widget type to use for detecting bot traffic. See - [the Turnstile documentation](https://developers.cloudflare.com/turnstile/concepts/widget/#widget-types) - for the definitions of these widget types. Set to `off` to disable the Turnstile - integration entirely. Setting this to anything other than `off` or `invisible` - requires Advanced Waiting Room. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1873,8 +1807,6 @@ async def create( "queueing_status_code": queueing_status_code, "session_duration": session_duration, "suspended": suspended, - "turnstile_action": turnstile_action, - "turnstile_mode": turnstile_mode, }, waiting_room_create_params.WaitingRoomCreateParams, ), @@ -1952,9 +1884,6 @@ async def update( queueing_status_code: Literal[200, 202, 429] | NotGiven = NOT_GIVEN, session_duration: int | NotGiven = NOT_GIVEN, suspended: bool | NotGiven = NOT_GIVEN, - turnstile_action: Literal["log", "infinite_queue"] | NotGiven = NOT_GIVEN, - turnstile_mode: Literal["off", "invisible", "visible_non_interactive", "visible_managed"] - | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2226,18 +2155,6 @@ async def update( suspended: Suspends or allows traffic going to the waiting room. If set to `true`, the traffic will not go to the waiting room. - turnstile_action: Which action to take when a bot is detected using Turnstile. `log` will have no - impact on queueing behavior, simply keeping track of how many bots are detected - in Waiting Room Analytics. `infinite_queue` will send bots to a false queueing - state, where they will never reach your origin. `infinite_queue` requires - Advanced Waiting Room. - - turnstile_mode: Which Turnstile widget type to use for detecting bot traffic. See - [the Turnstile documentation](https://developers.cloudflare.com/turnstile/concepts/widget/#widget-types) - for the definitions of these widget types. Set to `off` to disable the Turnstile - integration entirely. Setting this to anything other than `off` or `invisible` - requires Advanced Waiting Room. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2273,8 +2190,6 @@ async def update( "queueing_status_code": queueing_status_code, "session_duration": session_duration, "suspended": suspended, - "turnstile_action": turnstile_action, - "turnstile_mode": turnstile_mode, }, waiting_room_update_params.WaitingRoomUpdateParams, ), @@ -2446,9 +2361,6 @@ async def edit( queueing_status_code: Literal[200, 202, 429] | NotGiven = NOT_GIVEN, session_duration: int | NotGiven = NOT_GIVEN, suspended: bool | NotGiven = NOT_GIVEN, - turnstile_action: Literal["log", "infinite_queue"] | NotGiven = NOT_GIVEN, - turnstile_mode: Literal["off", "invisible", "visible_non_interactive", "visible_managed"] - | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2720,18 +2632,6 @@ async def edit( suspended: Suspends or allows traffic going to the waiting room. If set to `true`, the traffic will not go to the waiting room. - turnstile_action: Which action to take when a bot is detected using Turnstile. `log` will have no - impact on queueing behavior, simply keeping track of how many bots are detected - in Waiting Room Analytics. `infinite_queue` will send bots to a false queueing - state, where they will never reach your origin. `infinite_queue` requires - Advanced Waiting Room. - - turnstile_mode: Which Turnstile widget type to use for detecting bot traffic. See - [the Turnstile documentation](https://developers.cloudflare.com/turnstile/concepts/widget/#widget-types) - for the definitions of these widget types. Set to `off` to disable the Turnstile - integration entirely. Setting this to anything other than `off` or `invisible` - requires Advanced Waiting Room. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2767,8 +2667,6 @@ async def edit( "queueing_status_code": queueing_status_code, "session_duration": session_duration, "suspended": suspended, - "turnstile_action": turnstile_action, - "turnstile_mode": turnstile_mode, }, waiting_room_edit_params.WaitingRoomEditParams, ), diff --git a/src/cloudflare/resources/workers/__init__.py b/src/cloudflare/resources/workers/__init__.py index 2009583bd8f..dea7e3e0167 100644 --- a/src/cloudflare/resources/workers/__init__.py +++ b/src/cloudflare/resources/workers/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .ai import ( + AIResource, + AsyncAIResource, + AIResourceWithRawResponse, + AsyncAIResourceWithRawResponse, + AIResourceWithStreamingResponse, + AsyncAIResourceWithStreamingResponse, +) from .assets import ( AssetsResource, AsyncAssetsResource, @@ -8,14 +16,6 @@ AssetsResourceWithStreamingResponse, AsyncAssetsResourceWithStreamingResponse, ) -from .routes import ( - RoutesResource, - AsyncRoutesResource, - RoutesResourceWithRawResponse, - AsyncRoutesResourceWithRawResponse, - RoutesResourceWithStreamingResponse, - AsyncRoutesResourceWithStreamingResponse, -) from .domains import ( DomainsResource, AsyncDomainsResource, @@ -58,12 +58,12 @@ ) __all__ = [ - "RoutesResource", - "AsyncRoutesResource", - "RoutesResourceWithRawResponse", - "AsyncRoutesResourceWithRawResponse", - "RoutesResourceWithStreamingResponse", - "AsyncRoutesResourceWithStreamingResponse", + "AIResource", + "AsyncAIResource", + "AIResourceWithRawResponse", + "AsyncAIResourceWithRawResponse", + "AIResourceWithStreamingResponse", + "AsyncAIResourceWithStreamingResponse", "AssetsResource", "AsyncAssetsResource", "AssetsResourceWithRawResponse", diff --git a/src/cloudflare/resources/workers/ai/__init__.py b/src/cloudflare/resources/workers/ai/__init__.py new file mode 100644 index 00000000000..4921cf245a4 --- /dev/null +++ b/src/cloudflare/resources/workers/ai/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .ai import ( + AIResource, + AsyncAIResource, + AIResourceWithRawResponse, + AsyncAIResourceWithRawResponse, + AIResourceWithStreamingResponse, + AsyncAIResourceWithStreamingResponse, +) +from .models import ( + ModelsResource, + AsyncModelsResource, + ModelsResourceWithRawResponse, + AsyncModelsResourceWithRawResponse, + ModelsResourceWithStreamingResponse, + AsyncModelsResourceWithStreamingResponse, +) + +__all__ = [ + "ModelsResource", + "AsyncModelsResource", + "ModelsResourceWithRawResponse", + "AsyncModelsResourceWithRawResponse", + "ModelsResourceWithStreamingResponse", + "AsyncModelsResourceWithStreamingResponse", + "AIResource", + "AsyncAIResource", + "AIResourceWithRawResponse", + "AsyncAIResourceWithRawResponse", + "AIResourceWithStreamingResponse", + "AsyncAIResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/ai/ai.py b/src/cloudflare/resources/workers/ai/ai.py similarity index 94% rename from src/cloudflare/resources/ai/ai.py rename to src/cloudflare/resources/workers/ai/ai.py index 396a1360fe9..91012966858 100644 --- a/src/cloudflare/resources/ai/ai.py +++ b/src/cloudflare/resources/workers/ai/ai.py @@ -7,38 +7,21 @@ import httpx -from .tasks import ( - TasksResource, - AsyncTasksResource, - TasksResourceWithRawResponse, - AsyncTasksResourceWithRawResponse, - TasksResourceWithStreamingResponse, - AsyncTasksResourceWithStreamingResponse, -) -from .authors import ( - AuthorsResource, - AsyncAuthorsResource, - AuthorsResourceWithRawResponse, - AsyncAuthorsResourceWithRawResponse, - AuthorsResourceWithStreamingResponse, - AsyncAuthorsResourceWithStreamingResponse, -) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( required_args, maybe_transform, async_maybe_transform, ) -from ..._compat import cached_property -from ...types.ai import ai_run_params -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._wrappers import ResultWrapper +from ...._wrappers import ResultWrapper from .models.models import ( ModelsResource, AsyncModelsResource, @@ -47,33 +30,14 @@ ModelsResourceWithStreamingResponse, AsyncModelsResourceWithStreamingResponse, ) -from ..._base_client import make_request_options -from .finetunes.finetunes import ( - FinetunesResource, - AsyncFinetunesResource, - FinetunesResourceWithRawResponse, - AsyncFinetunesResourceWithRawResponse, - FinetunesResourceWithStreamingResponse, - AsyncFinetunesResourceWithStreamingResponse, -) -from ...types.ai.ai_run_response import AIRunResponse +from ...._base_client import make_request_options +from ....types.workers import ai_run_params +from ....types.workers.ai_run_response import AIRunResponse __all__ = ["AIResource", "AsyncAIResource"] class AIResource(SyncAPIResource): - @cached_property - def finetunes(self) -> FinetunesResource: - return FinetunesResource(self._client) - - @cached_property - def authors(self) -> AuthorsResource: - return AuthorsResource(self._client) - - @cached_property - def tasks(self) -> TasksResource: - return TasksResource(self._client) - @cached_property def models(self) -> ModelsResource: return ModelsResource(self._client) @@ -814,18 +778,6 @@ def run( class AsyncAIResource(AsyncAPIResource): - @cached_property - def finetunes(self) -> AsyncFinetunesResource: - return AsyncFinetunesResource(self._client) - - @cached_property - def authors(self) -> AsyncAuthorsResource: - return AsyncAuthorsResource(self._client) - - @cached_property - def tasks(self) -> AsyncTasksResource: - return AsyncTasksResource(self._client) - @cached_property def models(self) -> AsyncModelsResource: return AsyncModelsResource(self._client) @@ -1573,18 +1525,6 @@ def __init__(self, ai: AIResource) -> None: ai.run, ) - @cached_property - def finetunes(self) -> FinetunesResourceWithRawResponse: - return FinetunesResourceWithRawResponse(self._ai.finetunes) - - @cached_property - def authors(self) -> AuthorsResourceWithRawResponse: - return AuthorsResourceWithRawResponse(self._ai.authors) - - @cached_property - def tasks(self) -> TasksResourceWithRawResponse: - return TasksResourceWithRawResponse(self._ai.tasks) - @cached_property def models(self) -> ModelsResourceWithRawResponse: return ModelsResourceWithRawResponse(self._ai.models) @@ -1598,18 +1538,6 @@ def __init__(self, ai: AsyncAIResource) -> None: ai.run, ) - @cached_property - def finetunes(self) -> AsyncFinetunesResourceWithRawResponse: - return AsyncFinetunesResourceWithRawResponse(self._ai.finetunes) - - @cached_property - def authors(self) -> AsyncAuthorsResourceWithRawResponse: - return AsyncAuthorsResourceWithRawResponse(self._ai.authors) - - @cached_property - def tasks(self) -> AsyncTasksResourceWithRawResponse: - return AsyncTasksResourceWithRawResponse(self._ai.tasks) - @cached_property def models(self) -> AsyncModelsResourceWithRawResponse: return AsyncModelsResourceWithRawResponse(self._ai.models) @@ -1623,18 +1551,6 @@ def __init__(self, ai: AIResource) -> None: ai.run, ) - @cached_property - def finetunes(self) -> FinetunesResourceWithStreamingResponse: - return FinetunesResourceWithStreamingResponse(self._ai.finetunes) - - @cached_property - def authors(self) -> AuthorsResourceWithStreamingResponse: - return AuthorsResourceWithStreamingResponse(self._ai.authors) - - @cached_property - def tasks(self) -> TasksResourceWithStreamingResponse: - return TasksResourceWithStreamingResponse(self._ai.tasks) - @cached_property def models(self) -> ModelsResourceWithStreamingResponse: return ModelsResourceWithStreamingResponse(self._ai.models) @@ -1648,18 +1564,6 @@ def __init__(self, ai: AsyncAIResource) -> None: ai.run, ) - @cached_property - def finetunes(self) -> AsyncFinetunesResourceWithStreamingResponse: - return AsyncFinetunesResourceWithStreamingResponse(self._ai.finetunes) - - @cached_property - def authors(self) -> AsyncAuthorsResourceWithStreamingResponse: - return AsyncAuthorsResourceWithStreamingResponse(self._ai.authors) - - @cached_property - def tasks(self) -> AsyncTasksResourceWithStreamingResponse: - return AsyncTasksResourceWithStreamingResponse(self._ai.tasks) - @cached_property def models(self) -> AsyncModelsResourceWithStreamingResponse: return AsyncModelsResourceWithStreamingResponse(self._ai.models) diff --git a/src/cloudflare/resources/ai/models/__init__.py b/src/cloudflare/resources/workers/ai/models/__init__.py similarity index 100% rename from src/cloudflare/resources/ai/models/__init__.py rename to src/cloudflare/resources/workers/ai/models/__init__.py diff --git a/src/cloudflare/resources/workers/ai/models/models.py b/src/cloudflare/resources/workers/ai/models/models.py new file mode 100644 index 00000000000..95e2e20f66f --- /dev/null +++ b/src/cloudflare/resources/workers/ai/models/models.py @@ -0,0 +1,102 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .schema import ( + SchemaResource, + AsyncSchemaResource, + SchemaResourceWithRawResponse, + AsyncSchemaResourceWithRawResponse, + SchemaResourceWithStreamingResponse, + AsyncSchemaResourceWithStreamingResponse, +) +from ....._compat import cached_property +from ....._resource import SyncAPIResource, AsyncAPIResource + +__all__ = ["ModelsResource", "AsyncModelsResource"] + + +class ModelsResource(SyncAPIResource): + @cached_property + def schema(self) -> SchemaResource: + return SchemaResource(self._client) + + @cached_property + def with_raw_response(self) -> ModelsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return ModelsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ModelsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return ModelsResourceWithStreamingResponse(self) + + +class AsyncModelsResource(AsyncAPIResource): + @cached_property + def schema(self) -> AsyncSchemaResource: + return AsyncSchemaResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncModelsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncModelsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncModelsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncModelsResourceWithStreamingResponse(self) + + +class ModelsResourceWithRawResponse: + def __init__(self, models: ModelsResource) -> None: + self._models = models + + @cached_property + def schema(self) -> SchemaResourceWithRawResponse: + return SchemaResourceWithRawResponse(self._models.schema) + + +class AsyncModelsResourceWithRawResponse: + def __init__(self, models: AsyncModelsResource) -> None: + self._models = models + + @cached_property + def schema(self) -> AsyncSchemaResourceWithRawResponse: + return AsyncSchemaResourceWithRawResponse(self._models.schema) + + +class ModelsResourceWithStreamingResponse: + def __init__(self, models: ModelsResource) -> None: + self._models = models + + @cached_property + def schema(self) -> SchemaResourceWithStreamingResponse: + return SchemaResourceWithStreamingResponse(self._models.schema) + + +class AsyncModelsResourceWithStreamingResponse: + def __init__(self, models: AsyncModelsResource) -> None: + self._models = models + + @cached_property + def schema(self) -> AsyncSchemaResourceWithStreamingResponse: + return AsyncSchemaResourceWithStreamingResponse(self._models.schema) diff --git a/src/cloudflare/resources/ai/models/schema.py b/src/cloudflare/resources/workers/ai/models/schema.py similarity index 94% rename from src/cloudflare/resources/ai/models/schema.py rename to src/cloudflare/resources/workers/ai/models/schema.py index be4afa7007f..93f1363a597 100644 --- a/src/cloudflare/resources/ai/models/schema.py +++ b/src/cloudflare/resources/workers/ai/models/schema.py @@ -6,22 +6,22 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import ( +from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._utils import ( maybe_transform, async_maybe_transform, ) -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( +from ....._compat import cached_property +from ....._resource import SyncAPIResource, AsyncAPIResource +from ....._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...._wrappers import ResultWrapper -from ...._base_client import make_request_options -from ....types.ai.models import schema_get_params +from ....._wrappers import ResultWrapper +from ....._base_client import make_request_options +from .....types.workers.ai.models import schema_get_params __all__ = ["SchemaResource", "AsyncSchemaResource"] diff --git a/src/cloudflare/resources/workers/assets/upload.py b/src/cloudflare/resources/workers/assets/upload.py index ecc8a178557..1572f007c5f 100644 --- a/src/cloudflare/resources/workers/assets/upload.py +++ b/src/cloudflare/resources/workers/assets/upload.py @@ -61,11 +61,8 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Optional[UploadCreateResponse]: - """Upload assets ahead of creating a Worker version. - - To learn more about the direct - uploads of assets, see - https://developers.cloudflare.com/workers/static-assets/direct-upload/ + """ + Upload assets ahead of creating a Worker version. Args: account_id: Identifier @@ -137,11 +134,8 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Optional[UploadCreateResponse]: - """Upload assets ahead of creating a Worker version. - - To learn more about the direct - uploads of assets, see - https://developers.cloudflare.com/workers/static-assets/direct-upload/ + """ + Upload assets ahead of creating a Worker version. Args: account_id: Identifier diff --git a/src/cloudflare/resources/workers/routes.py b/src/cloudflare/resources/workers/routes.py deleted file mode 100644 index 7af10337af1..00000000000 --- a/src/cloudflare/resources/workers/routes.py +++ /dev/null @@ -1,600 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Type, Optional, cast - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._wrappers import ResultWrapper -from ...pagination import SyncSinglePage, AsyncSinglePage -from ..._base_client import AsyncPaginator, make_request_options -from ...types.workers import route_create_params, route_update_params -from ...types.workers.route_get_response import RouteGetResponse -from ...types.workers.route_list_response import RouteListResponse -from ...types.workers.route_create_response import RouteCreateResponse -from ...types.workers.route_delete_response import RouteDeleteResponse -from ...types.workers.route_update_response import RouteUpdateResponse - -__all__ = ["RoutesResource", "AsyncRoutesResource"] - - -class RoutesResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> RoutesResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return RoutesResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> RoutesResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return RoutesResourceWithStreamingResponse(self) - - def create( - self, - *, - zone_id: str, - pattern: str, - script: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RouteCreateResponse: - """ - Creates a route that maps a URL pattern to a Worker. - - Args: - zone_id: Identifier - - script: Name of the script, used in URLs and route configuration. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._post( - f"/zones/{zone_id}/workers/routes", - body=maybe_transform( - { - "pattern": pattern, - "script": script, - }, - route_create_params.RouteCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=RouteCreateResponse, - ) - - def update( - self, - route_id: str, - *, - zone_id: str, - pattern: str, - script: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RouteUpdateResponse]: - """ - Updates the URL pattern or Worker associated with a route. - - Args: - zone_id: Identifier - - route_id: Identifier - - script: Name of the script, used in URLs and route configuration. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if not route_id: - raise ValueError(f"Expected a non-empty value for `route_id` but received {route_id!r}") - return self._put( - f"/zones/{zone_id}/workers/routes/{route_id}", - body=maybe_transform( - { - "pattern": pattern, - "script": script, - }, - route_update_params.RouteUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RouteUpdateResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[RouteUpdateResponse]], ResultWrapper[RouteUpdateResponse]), - ) - - def list( - self, - *, - zone_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[RouteListResponse]: - """ - Returns routes for a zone. - - Args: - zone_id: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._get_api_list( - f"/zones/{zone_id}/workers/routes", - page=SyncSinglePage[RouteListResponse], - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - model=RouteListResponse, - ) - - def delete( - self, - route_id: str, - *, - zone_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RouteDeleteResponse: - """ - Deletes a route. - - Args: - zone_id: Identifier - - route_id: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if not route_id: - raise ValueError(f"Expected a non-empty value for `route_id` but received {route_id!r}") - return self._delete( - f"/zones/{zone_id}/workers/routes/{route_id}", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=RouteDeleteResponse, - ) - - def get( - self, - route_id: str, - *, - zone_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RouteGetResponse]: - """ - Returns information about a route, including URL pattern and Worker. - - Args: - zone_id: Identifier - - route_id: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if not route_id: - raise ValueError(f"Expected a non-empty value for `route_id` but received {route_id!r}") - return self._get( - f"/zones/{zone_id}/workers/routes/{route_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RouteGetResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[RouteGetResponse]], ResultWrapper[RouteGetResponse]), - ) - - -class AsyncRoutesResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncRoutesResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncRoutesResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncRoutesResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncRoutesResourceWithStreamingResponse(self) - - async def create( - self, - *, - zone_id: str, - pattern: str, - script: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RouteCreateResponse: - """ - Creates a route that maps a URL pattern to a Worker. - - Args: - zone_id: Identifier - - script: Name of the script, used in URLs and route configuration. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._post( - f"/zones/{zone_id}/workers/routes", - body=await async_maybe_transform( - { - "pattern": pattern, - "script": script, - }, - route_create_params.RouteCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=RouteCreateResponse, - ) - - async def update( - self, - route_id: str, - *, - zone_id: str, - pattern: str, - script: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RouteUpdateResponse]: - """ - Updates the URL pattern or Worker associated with a route. - - Args: - zone_id: Identifier - - route_id: Identifier - - script: Name of the script, used in URLs and route configuration. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if not route_id: - raise ValueError(f"Expected a non-empty value for `route_id` but received {route_id!r}") - return await self._put( - f"/zones/{zone_id}/workers/routes/{route_id}", - body=await async_maybe_transform( - { - "pattern": pattern, - "script": script, - }, - route_update_params.RouteUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RouteUpdateResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[RouteUpdateResponse]], ResultWrapper[RouteUpdateResponse]), - ) - - def list( - self, - *, - zone_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[RouteListResponse, AsyncSinglePage[RouteListResponse]]: - """ - Returns routes for a zone. - - Args: - zone_id: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._get_api_list( - f"/zones/{zone_id}/workers/routes", - page=AsyncSinglePage[RouteListResponse], - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - model=RouteListResponse, - ) - - async def delete( - self, - route_id: str, - *, - zone_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RouteDeleteResponse: - """ - Deletes a route. - - Args: - zone_id: Identifier - - route_id: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if not route_id: - raise ValueError(f"Expected a non-empty value for `route_id` but received {route_id!r}") - return await self._delete( - f"/zones/{zone_id}/workers/routes/{route_id}", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=RouteDeleteResponse, - ) - - async def get( - self, - route_id: str, - *, - zone_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RouteGetResponse]: - """ - Returns information about a route, including URL pattern and Worker. - - Args: - zone_id: Identifier - - route_id: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if not route_id: - raise ValueError(f"Expected a non-empty value for `route_id` but received {route_id!r}") - return await self._get( - f"/zones/{zone_id}/workers/routes/{route_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RouteGetResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[RouteGetResponse]], ResultWrapper[RouteGetResponse]), - ) - - -class RoutesResourceWithRawResponse: - def __init__(self, routes: RoutesResource) -> None: - self._routes = routes - - self.create = to_raw_response_wrapper( - routes.create, - ) - self.update = to_raw_response_wrapper( - routes.update, - ) - self.list = to_raw_response_wrapper( - routes.list, - ) - self.delete = to_raw_response_wrapper( - routes.delete, - ) - self.get = to_raw_response_wrapper( - routes.get, - ) - - -class AsyncRoutesResourceWithRawResponse: - def __init__(self, routes: AsyncRoutesResource) -> None: - self._routes = routes - - self.create = async_to_raw_response_wrapper( - routes.create, - ) - self.update = async_to_raw_response_wrapper( - routes.update, - ) - self.list = async_to_raw_response_wrapper( - routes.list, - ) - self.delete = async_to_raw_response_wrapper( - routes.delete, - ) - self.get = async_to_raw_response_wrapper( - routes.get, - ) - - -class RoutesResourceWithStreamingResponse: - def __init__(self, routes: RoutesResource) -> None: - self._routes = routes - - self.create = to_streamed_response_wrapper( - routes.create, - ) - self.update = to_streamed_response_wrapper( - routes.update, - ) - self.list = to_streamed_response_wrapper( - routes.list, - ) - self.delete = to_streamed_response_wrapper( - routes.delete, - ) - self.get = to_streamed_response_wrapper( - routes.get, - ) - - -class AsyncRoutesResourceWithStreamingResponse: - def __init__(self, routes: AsyncRoutesResource) -> None: - self._routes = routes - - self.create = async_to_streamed_response_wrapper( - routes.create, - ) - self.update = async_to_streamed_response_wrapper( - routes.update, - ) - self.list = async_to_streamed_response_wrapper( - routes.list, - ) - self.delete = async_to_streamed_response_wrapper( - routes.delete, - ) - self.get = async_to_streamed_response_wrapper( - routes.get, - ) diff --git a/src/cloudflare/resources/workers/scripts/assets/upload.py b/src/cloudflare/resources/workers/scripts/assets/upload.py index 836583e47f4..711cf2035d4 100644 --- a/src/cloudflare/resources/workers/scripts/assets/upload.py +++ b/src/cloudflare/resources/workers/scripts/assets/upload.py @@ -60,11 +60,8 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Optional[UploadCreateResponse]: - """Start uploading a collection of assets for use in a Worker version. - - To learn - more about the direct uploads of assets, see - https://developers.cloudflare.com/workers/static-assets/direct-upload/ + """ + Start uploading a collection of assets for use in a Worker version. Args: account_id: Identifier @@ -133,11 +130,8 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Optional[UploadCreateResponse]: - """Start uploading a collection of assets for use in a Worker version. - - To learn - more about the direct uploads of assets, see - https://developers.cloudflare.com/workers/static-assets/direct-upload/ + """ + Start uploading a collection of assets for use in a Worker version. Args: account_id: Identifier diff --git a/src/cloudflare/resources/workers/scripts/content.py b/src/cloudflare/resources/workers/scripts/content.py index 09d1d506899..b4c91d83d61 100644 --- a/src/cloudflare/resources/workers/scripts/content.py +++ b/src/cloudflare/resources/workers/scripts/content.py @@ -2,14 +2,16 @@ from __future__ import annotations -from typing import Type, Optional, cast +from typing import List, Type, Mapping, Optional, cast import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes from ...._utils import ( + extract_files, maybe_transform, strip_not_given, + deepcopy_minimal, async_maybe_transform, ) from ...._compat import cached_property @@ -62,7 +64,8 @@ def update( script_name: str, *, account_id: str, - metadata: WorkerMetadataParam, + any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, + metadata: WorkerMetadataParam | NotGiven = NOT_GIVEN, cf_worker_body_part: str | NotGiven = NOT_GIVEN, cf_worker_main_module_part: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -80,6 +83,13 @@ def update( script_name: Name of the script, used in URLs and route configuration. + any_part_name: A module comprising a Worker script, often a javascript file. Multiple modules + may be provided as separate named parts, but at least one module must be + present. This should be referenced either in the metadata as `main_module` + (esm)/`body_part` (service worker) or as a header `CF-WORKER-MAIN-MODULE-PART` + (esm) /`CF-WORKER-BODY-PART` (service worker) by part name. Source maps may also + be included using the `application/source-map` content type. + metadata: JSON encoded metadata about the uploaded parts and Worker configuration. extra_headers: Send extra headers @@ -103,13 +113,21 @@ def update( ), **(extra_headers or {}), } + body = deepcopy_minimal( + { + "any_part_name": any_part_name, + "metadata": metadata, + } + ) + files = extract_files(cast(Mapping[str, object], body), paths=[["", ""]]) # It should be noted that the actual Content-Type header that will be # sent to the server will contain a `boundary` parameter, e.g. # multipart/form-data; boundary=---abc-- extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} return self._put( f"/accounts/{account_id}/workers/scripts/{script_name}/content", - body=maybe_transform({"metadata": metadata}, content_update_params.ContentUpdateParams), + body=maybe_transform(body, content_update_params.ContentUpdateParams), + files=files, options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -187,7 +205,8 @@ async def update( script_name: str, *, account_id: str, - metadata: WorkerMetadataParam, + any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, + metadata: WorkerMetadataParam | NotGiven = NOT_GIVEN, cf_worker_body_part: str | NotGiven = NOT_GIVEN, cf_worker_main_module_part: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -205,6 +224,13 @@ async def update( script_name: Name of the script, used in URLs and route configuration. + any_part_name: A module comprising a Worker script, often a javascript file. Multiple modules + may be provided as separate named parts, but at least one module must be + present. This should be referenced either in the metadata as `main_module` + (esm)/`body_part` (service worker) or as a header `CF-WORKER-MAIN-MODULE-PART` + (esm) /`CF-WORKER-BODY-PART` (service worker) by part name. Source maps may also + be included using the `application/source-map` content type. + metadata: JSON encoded metadata about the uploaded parts and Worker configuration. extra_headers: Send extra headers @@ -228,13 +254,21 @@ async def update( ), **(extra_headers or {}), } + body = deepcopy_minimal( + { + "any_part_name": any_part_name, + "metadata": metadata, + } + ) + files = extract_files(cast(Mapping[str, object], body), paths=[["", ""]]) # It should be noted that the actual Content-Type header that will be # sent to the server will contain a `boundary` parameter, e.g. # multipart/form-data; boundary=---abc-- extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} return await self._put( f"/accounts/{account_id}/workers/scripts/{script_name}/content", - body=await async_maybe_transform({"metadata": metadata}, content_update_params.ContentUpdateParams), + body=await async_maybe_transform(body, content_update_params.ContentUpdateParams), + files=files, options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/cloudflare/resources/workers/scripts/scripts.py b/src/cloudflare/resources/workers/scripts/scripts.py index 5164db2723c..ffc9db763a4 100644 --- a/src/cloudflare/resources/workers/scripts/scripts.py +++ b/src/cloudflare/resources/workers/scripts/scripts.py @@ -2,7 +2,8 @@ from __future__ import annotations -from typing import Type, Optional, cast +from typing import List, Type, Optional, cast +from typing_extensions import overload import httpx @@ -38,8 +39,9 @@ VersionsResourceWithStreamingResponse, AsyncVersionsResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, FileTypes from ...._utils import ( + required_args, maybe_transform, async_maybe_transform, ) @@ -70,10 +72,18 @@ ) from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( + BinaryAPIResponse, + AsyncBinaryAPIResponse, + StreamedBinaryAPIResponse, + AsyncStreamedBinaryAPIResponse, to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, + to_custom_raw_response_wrapper, async_to_streamed_response_wrapper, + to_custom_streamed_response_wrapper, + async_to_custom_raw_response_wrapper, + async_to_custom_streamed_response_wrapper, ) from ...._wrappers import ResultWrapper from ....pagination import SyncSinglePage, AsyncSinglePage @@ -145,12 +155,15 @@ def with_streaming_response(self) -> ScriptsResourceWithStreamingResponse: """ return ScriptsResourceWithStreamingResponse(self) + @overload def update( self, script_name: str, *, account_id: str, - metadata: script_update_params.Metadata, + rollback_to: str | NotGiven = NOT_GIVEN, + any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, + metadata: script_update_params.Variant0Metadata | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -169,6 +182,16 @@ def update( script_name: Name of the script, used in URLs and route configuration. + rollback_to: Rollback to provided deployment based on deployment ID. Request body will only + parse a "message" part. You can learn more about deployments + [here](https://developers.cloudflare.com/workers/platform/deployments/). + + any_part_name: A module comprising a Worker script, often a javascript file. Multiple modules + may be provided as separate named parts, but at least one module must be present + and referenced in the metadata as `main_module` or `body_part` by part name. + Source maps may also be included using the `application/source-map` content + type. + metadata: JSON encoded metadata about the uploaded parts and Worker configuration. extra_headers: Send extra headers @@ -179,18 +202,88 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + def update( + self, + script_name: str, + *, + account_id: str, + rollback_to: str | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[ScriptUpdateResponse]: + """Upload a worker module. + + You can find more about the multipart metadata on our + docs: + https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/. + + Args: + account_id: Identifier + + script_name: Name of the script, used in URLs and route configuration. + + rollback_to: Rollback to provided deployment based on deployment ID. Request body will only + parse a "message" part. You can learn more about deployments + [here](https://developers.cloudflare.com/workers/platform/deployments/). + + message: Rollback message to be associated with this deployment. Only parsed when query + param `"rollback_to"` is present. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["account_id"]) + def update( + self, + script_name: str, + *, + account_id: str, + rollback_to: str | NotGiven = NOT_GIVEN, + any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, + metadata: script_update_params.Variant0Metadata | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[ScriptUpdateResponse]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not script_name: raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") return self._put( f"/accounts/{account_id}/workers/scripts/{script_name}", - body=maybe_transform({"metadata": metadata}, script_update_params.ScriptUpdateParams), + body=maybe_transform( + { + "any_part_name": any_part_name, + "metadata": metadata, + "message": message, + }, + script_update_params.ScriptUpdateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, + query=maybe_transform({"rollback_to": rollback_to}, script_update_params.ScriptUpdateParams), post_parser=ResultWrapper[Optional[ScriptUpdateResponse]]._unwrapper, ), cast_to=cast(Type[Optional[ScriptUpdateResponse]], ResultWrapper[ScriptUpdateResponse]), @@ -294,7 +387,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: + ) -> BinaryAPIResponse: """Fetch raw script content for your worker. Note this is the original script @@ -317,13 +410,13 @@ def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not script_name: raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") - extra_headers = {"Accept": "application/javascript", **(extra_headers or {})} + extra_headers = {"Accept": "undefined", **(extra_headers or {})} return self._get( f"/accounts/{account_id}/workers/scripts/{script_name}", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=str, + cast_to=BinaryAPIResponse, ) @@ -379,12 +472,15 @@ def with_streaming_response(self) -> AsyncScriptsResourceWithStreamingResponse: """ return AsyncScriptsResourceWithStreamingResponse(self) + @overload async def update( self, script_name: str, *, account_id: str, - metadata: script_update_params.Metadata, + rollback_to: str | NotGiven = NOT_GIVEN, + any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, + metadata: script_update_params.Variant0Metadata | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -403,6 +499,16 @@ async def update( script_name: Name of the script, used in URLs and route configuration. + rollback_to: Rollback to provided deployment based on deployment ID. Request body will only + parse a "message" part. You can learn more about deployments + [here](https://developers.cloudflare.com/workers/platform/deployments/). + + any_part_name: A module comprising a Worker script, often a javascript file. Multiple modules + may be provided as separate named parts, but at least one module must be present + and referenced in the metadata as `main_module` or `body_part` by part name. + Source maps may also be included using the `application/source-map` content + type. + metadata: JSON encoded metadata about the uploaded parts and Worker configuration. extra_headers: Send extra headers @@ -413,18 +519,90 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + async def update( + self, + script_name: str, + *, + account_id: str, + rollback_to: str | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[ScriptUpdateResponse]: + """Upload a worker module. + + You can find more about the multipart metadata on our + docs: + https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/. + + Args: + account_id: Identifier + + script_name: Name of the script, used in URLs and route configuration. + + rollback_to: Rollback to provided deployment based on deployment ID. Request body will only + parse a "message" part. You can learn more about deployments + [here](https://developers.cloudflare.com/workers/platform/deployments/). + + message: Rollback message to be associated with this deployment. Only parsed when query + param `"rollback_to"` is present. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["account_id"]) + async def update( + self, + script_name: str, + *, + account_id: str, + rollback_to: str | NotGiven = NOT_GIVEN, + any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, + metadata: script_update_params.Variant0Metadata | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[ScriptUpdateResponse]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not script_name: raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") return await self._put( f"/accounts/{account_id}/workers/scripts/{script_name}", - body=await async_maybe_transform({"metadata": metadata}, script_update_params.ScriptUpdateParams), + body=await async_maybe_transform( + { + "any_part_name": any_part_name, + "metadata": metadata, + "message": message, + }, + script_update_params.ScriptUpdateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, + query=await async_maybe_transform( + {"rollback_to": rollback_to}, script_update_params.ScriptUpdateParams + ), post_parser=ResultWrapper[Optional[ScriptUpdateResponse]]._unwrapper, ), cast_to=cast(Type[Optional[ScriptUpdateResponse]], ResultWrapper[ScriptUpdateResponse]), @@ -528,7 +706,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: + ) -> AsyncBinaryAPIResponse: """Fetch raw script content for your worker. Note this is the original script @@ -551,13 +729,13 @@ async def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not script_name: raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") - extra_headers = {"Accept": "application/javascript", **(extra_headers or {})} + extra_headers = {"Accept": "undefined", **(extra_headers or {})} return await self._get( f"/accounts/{account_id}/workers/scripts/{script_name}", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=str, + cast_to=AsyncBinaryAPIResponse, ) @@ -574,8 +752,9 @@ def __init__(self, scripts: ScriptsResource) -> None: self.delete = to_raw_response_wrapper( scripts.delete, ) - self.get = to_raw_response_wrapper( + self.get = to_custom_raw_response_wrapper( scripts.get, + BinaryAPIResponse, ) @cached_property @@ -624,8 +803,9 @@ def __init__(self, scripts: AsyncScriptsResource) -> None: self.delete = async_to_raw_response_wrapper( scripts.delete, ) - self.get = async_to_raw_response_wrapper( + self.get = async_to_custom_raw_response_wrapper( scripts.get, + AsyncBinaryAPIResponse, ) @cached_property @@ -674,8 +854,9 @@ def __init__(self, scripts: ScriptsResource) -> None: self.delete = to_streamed_response_wrapper( scripts.delete, ) - self.get = to_streamed_response_wrapper( + self.get = to_custom_streamed_response_wrapper( scripts.get, + StreamedBinaryAPIResponse, ) @cached_property @@ -724,8 +905,9 @@ def __init__(self, scripts: AsyncScriptsResource) -> None: self.delete = async_to_streamed_response_wrapper( scripts.delete, ) - self.get = async_to_streamed_response_wrapper( + self.get = async_to_custom_streamed_response_wrapper( scripts.get, + AsyncStreamedBinaryAPIResponse, ) @cached_property diff --git a/src/cloudflare/resources/workers/scripts/versions.py b/src/cloudflare/resources/workers/scripts/versions.py index 749b4f83f55..fa1bb14105f 100644 --- a/src/cloudflare/resources/workers/scripts/versions.py +++ b/src/cloudflare/resources/workers/scripts/versions.py @@ -2,13 +2,15 @@ from __future__ import annotations -from typing import Type, Optional, cast +from typing import List, Type, Mapping, Optional, cast import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes from ...._utils import ( + extract_files, maybe_transform, + deepcopy_minimal, async_maybe_transform, ) from ...._compat import cached_property @@ -55,7 +57,8 @@ def create( script_name: str, *, account_id: str, - metadata: version_create_params.Metadata, + any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, + metadata: version_create_params.Metadata | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -74,6 +77,10 @@ def create( script_name: Name of the script. + any_part_name: A module comprising a Worker script, often a javascript file. Multiple modules + may be provided as separate named parts, but at least one module must be present + and referenced in the metadata as `main_module`. + metadata: JSON encoded metadata about the uploaded parts and Worker configuration. extra_headers: Send extra headers @@ -88,13 +95,21 @@ def create( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not script_name: raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") + body = deepcopy_minimal( + { + "any_part_name": any_part_name, + "metadata": metadata, + } + ) + files = extract_files(cast(Mapping[str, object], body), paths=[["", ""]]) # It should be noted that the actual Content-Type header that will be # sent to the server will contain a `boundary` parameter, e.g. # multipart/form-data; boundary=---abc-- extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} return self._post( f"/accounts/{account_id}/workers/scripts/{script_name}/versions", - body=maybe_transform({"metadata": metadata}, version_create_params.VersionCreateParams), + body=maybe_transform(body, version_create_params.VersionCreateParams), + files=files, options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -240,7 +255,8 @@ async def create( script_name: str, *, account_id: str, - metadata: version_create_params.Metadata, + any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, + metadata: version_create_params.Metadata | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -259,6 +275,10 @@ async def create( script_name: Name of the script. + any_part_name: A module comprising a Worker script, often a javascript file. Multiple modules + may be provided as separate named parts, but at least one module must be present + and referenced in the metadata as `main_module`. + metadata: JSON encoded metadata about the uploaded parts and Worker configuration. extra_headers: Send extra headers @@ -273,13 +293,21 @@ async def create( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not script_name: raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") + body = deepcopy_minimal( + { + "any_part_name": any_part_name, + "metadata": metadata, + } + ) + files = extract_files(cast(Mapping[str, object], body), paths=[["", ""]]) # It should be noted that the actual Content-Type header that will be # sent to the server will contain a `boundary` parameter, e.g. # multipart/form-data; boundary=---abc-- extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} return await self._post( f"/accounts/{account_id}/workers/scripts/{script_name}/versions", - body=await async_maybe_transform({"metadata": metadata}, version_create_params.VersionCreateParams), + body=await async_maybe_transform(body, version_create_params.VersionCreateParams), + files=files, options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/cloudflare/resources/workers/workers.py b/src/cloudflare/resources/workers/workers.py index e167830c87d..ed4da6b38d5 100644 --- a/src/cloudflare/resources/workers/workers.py +++ b/src/cloudflare/resources/workers/workers.py @@ -2,13 +2,13 @@ from __future__ import annotations -from .routes import ( - RoutesResource, - AsyncRoutesResource, - RoutesResourceWithRawResponse, - AsyncRoutesResourceWithRawResponse, - RoutesResourceWithStreamingResponse, - AsyncRoutesResourceWithStreamingResponse, +from .ai.ai import ( + AIResource, + AsyncAIResource, + AIResourceWithRawResponse, + AsyncAIResourceWithRawResponse, + AIResourceWithStreamingResponse, + AsyncAIResourceWithStreamingResponse, ) from .domains import ( DomainsResource, @@ -58,8 +58,8 @@ class WorkersResource(SyncAPIResource): @cached_property - def routes(self) -> RoutesResource: - return RoutesResource(self._client) + def ai(self) -> AIResource: + return AIResource(self._client) @cached_property def assets(self) -> AssetsResource: @@ -103,8 +103,8 @@ def with_streaming_response(self) -> WorkersResourceWithStreamingResponse: class AsyncWorkersResource(AsyncAPIResource): @cached_property - def routes(self) -> AsyncRoutesResource: - return AsyncRoutesResource(self._client) + def ai(self) -> AsyncAIResource: + return AsyncAIResource(self._client) @cached_property def assets(self) -> AsyncAssetsResource: @@ -151,8 +151,8 @@ def __init__(self, workers: WorkersResource) -> None: self._workers = workers @cached_property - def routes(self) -> RoutesResourceWithRawResponse: - return RoutesResourceWithRawResponse(self._workers.routes) + def ai(self) -> AIResourceWithRawResponse: + return AIResourceWithRawResponse(self._workers.ai) @cached_property def assets(self) -> AssetsResourceWithRawResponse: @@ -180,8 +180,8 @@ def __init__(self, workers: AsyncWorkersResource) -> None: self._workers = workers @cached_property - def routes(self) -> AsyncRoutesResourceWithRawResponse: - return AsyncRoutesResourceWithRawResponse(self._workers.routes) + def ai(self) -> AsyncAIResourceWithRawResponse: + return AsyncAIResourceWithRawResponse(self._workers.ai) @cached_property def assets(self) -> AsyncAssetsResourceWithRawResponse: @@ -209,8 +209,8 @@ def __init__(self, workers: WorkersResource) -> None: self._workers = workers @cached_property - def routes(self) -> RoutesResourceWithStreamingResponse: - return RoutesResourceWithStreamingResponse(self._workers.routes) + def ai(self) -> AIResourceWithStreamingResponse: + return AIResourceWithStreamingResponse(self._workers.ai) @cached_property def assets(self) -> AssetsResourceWithStreamingResponse: @@ -238,8 +238,8 @@ def __init__(self, workers: AsyncWorkersResource) -> None: self._workers = workers @cached_property - def routes(self) -> AsyncRoutesResourceWithStreamingResponse: - return AsyncRoutesResourceWithStreamingResponse(self._workers.routes) + def ai(self) -> AsyncAIResourceWithStreamingResponse: + return AsyncAIResourceWithStreamingResponse(self._workers.ai) @cached_property def assets(self) -> AsyncAssetsResourceWithStreamingResponse: diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/__init__.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/__init__.py index 668f9921146..fd5a962f515 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/__init__.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/__init__.py @@ -48,22 +48,8 @@ SettingsResourceWithStreamingResponse, AsyncSettingsResourceWithStreamingResponse, ) -from .asset_upload import ( - AssetUploadResource, - AsyncAssetUploadResource, - AssetUploadResourceWithRawResponse, - AsyncAssetUploadResourceWithRawResponse, - AssetUploadResourceWithStreamingResponse, - AsyncAssetUploadResourceWithStreamingResponse, -) __all__ = [ - "AssetUploadResource", - "AsyncAssetUploadResource", - "AssetUploadResourceWithRawResponse", - "AsyncAssetUploadResourceWithRawResponse", - "AssetUploadResourceWithStreamingResponse", - "AsyncAssetUploadResourceWithStreamingResponse", "ContentResource", "AsyncContentResource", "ContentResourceWithRawResponse", diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/asset_upload.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/asset_upload.py deleted file mode 100644 index 4b4e04a0a4e..00000000000 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/asset_upload.py +++ /dev/null @@ -1,223 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Type, Optional, cast - -import httpx - -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ......_utils import ( - maybe_transform, - async_maybe_transform, -) -from ......_compat import cached_property -from ......_resource import SyncAPIResource, AsyncAPIResource -from ......_response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ......_wrappers import ResultWrapper -from ......_base_client import make_request_options -from ......types.workers_for_platforms.dispatch.namespaces.scripts import asset_upload_create_params -from ......types.workers_for_platforms.dispatch.namespaces.scripts.asset_upload_create_response import ( - AssetUploadCreateResponse, -) - -__all__ = ["AssetUploadResource", "AsyncAssetUploadResource"] - - -class AssetUploadResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> AssetUploadResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AssetUploadResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AssetUploadResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AssetUploadResourceWithStreamingResponse(self) - - def create( - self, - script_name: str, - *, - account_id: str, - dispatch_namespace: str, - manifest: Dict[str, asset_upload_create_params.Manifest] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AssetUploadCreateResponse]: - """Start uploading a collection of assets for use in a Worker version. - - To learn - more about the direct uploads of assets, see - https://developers.cloudflare.com/workers/static-assets/direct-upload/ - - Args: - account_id: Identifier - - dispatch_namespace: Name of the Workers for Platforms dispatch namespace. - - script_name: Name of the script, used in URLs and route configuration. - - manifest: A manifest ([path]: {hash, size}) map of files to upload. As an example, - `/blog/hello-world.html` would be a valid path key. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not dispatch_namespace: - raise ValueError(f"Expected a non-empty value for `dispatch_namespace` but received {dispatch_namespace!r}") - if not script_name: - raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") - return self._post( - f"/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/assets-upload-session", - body=maybe_transform({"manifest": manifest}, asset_upload_create_params.AssetUploadCreateParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[AssetUploadCreateResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[AssetUploadCreateResponse]], ResultWrapper[AssetUploadCreateResponse]), - ) - - -class AsyncAssetUploadResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncAssetUploadResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncAssetUploadResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncAssetUploadResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncAssetUploadResourceWithStreamingResponse(self) - - async def create( - self, - script_name: str, - *, - account_id: str, - dispatch_namespace: str, - manifest: Dict[str, asset_upload_create_params.Manifest] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AssetUploadCreateResponse]: - """Start uploading a collection of assets for use in a Worker version. - - To learn - more about the direct uploads of assets, see - https://developers.cloudflare.com/workers/static-assets/direct-upload/ - - Args: - account_id: Identifier - - dispatch_namespace: Name of the Workers for Platforms dispatch namespace. - - script_name: Name of the script, used in URLs and route configuration. - - manifest: A manifest ([path]: {hash, size}) map of files to upload. As an example, - `/blog/hello-world.html` would be a valid path key. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not dispatch_namespace: - raise ValueError(f"Expected a non-empty value for `dispatch_namespace` but received {dispatch_namespace!r}") - if not script_name: - raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") - return await self._post( - f"/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/assets-upload-session", - body=await async_maybe_transform( - {"manifest": manifest}, asset_upload_create_params.AssetUploadCreateParams - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[AssetUploadCreateResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[AssetUploadCreateResponse]], ResultWrapper[AssetUploadCreateResponse]), - ) - - -class AssetUploadResourceWithRawResponse: - def __init__(self, asset_upload: AssetUploadResource) -> None: - self._asset_upload = asset_upload - - self.create = to_raw_response_wrapper( - asset_upload.create, - ) - - -class AsyncAssetUploadResourceWithRawResponse: - def __init__(self, asset_upload: AsyncAssetUploadResource) -> None: - self._asset_upload = asset_upload - - self.create = async_to_raw_response_wrapper( - asset_upload.create, - ) - - -class AssetUploadResourceWithStreamingResponse: - def __init__(self, asset_upload: AssetUploadResource) -> None: - self._asset_upload = asset_upload - - self.create = to_streamed_response_wrapper( - asset_upload.create, - ) - - -class AsyncAssetUploadResourceWithStreamingResponse: - def __init__(self, asset_upload: AsyncAssetUploadResource) -> None: - self._asset_upload = asset_upload - - self.create = async_to_streamed_response_wrapper( - asset_upload.create, - ) diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/content.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/content.py index 48a6af6ffc6..dd445795f95 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/content.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/content.py @@ -2,14 +2,16 @@ from __future__ import annotations -from typing import Type, Optional, cast +from typing import List, Type, Mapping, Optional, cast import httpx -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes from ......_utils import ( + extract_files, maybe_transform, strip_not_given, + deepcopy_minimal, async_maybe_transform, ) from ......_compat import cached_property @@ -63,7 +65,8 @@ def update( *, account_id: str, dispatch_namespace: str, - metadata: WorkerMetadataParam, + any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, + metadata: WorkerMetadataParam | NotGiven = NOT_GIVEN, cf_worker_body_part: str | NotGiven = NOT_GIVEN, cf_worker_main_module_part: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -83,6 +86,13 @@ def update( script_name: Name of the script, used in URLs and route configuration. + any_part_name: A module comprising a Worker script, often a javascript file. Multiple modules + may be provided as separate named parts, but at least one module must be + present. This should be referenced either in the metadata as `main_module` + (esm)/`body_part` (service worker) or as a header `CF-WORKER-MAIN-MODULE-PART` + (esm) /`CF-WORKER-BODY-PART` (service worker) by part name. Source maps may also + be included using the `application/source-map` content type. + metadata: JSON encoded metadata about the uploaded parts and Worker configuration. extra_headers: Send extra headers @@ -108,13 +118,21 @@ def update( ), **(extra_headers or {}), } + body = deepcopy_minimal( + { + "any_part_name": any_part_name, + "metadata": metadata, + } + ) + files = extract_files(cast(Mapping[str, object], body), paths=[["", ""]]) # It should be noted that the actual Content-Type header that will be # sent to the server will contain a `boundary` parameter, e.g. # multipart/form-data; boundary=---abc-- extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} return self._put( f"/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/content", - body=maybe_transform({"metadata": metadata}, content_update_params.ContentUpdateParams), + body=maybe_transform(body, content_update_params.ContentUpdateParams), + files=files, options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -199,7 +217,8 @@ async def update( *, account_id: str, dispatch_namespace: str, - metadata: WorkerMetadataParam, + any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, + metadata: WorkerMetadataParam | NotGiven = NOT_GIVEN, cf_worker_body_part: str | NotGiven = NOT_GIVEN, cf_worker_main_module_part: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -219,6 +238,13 @@ async def update( script_name: Name of the script, used in URLs and route configuration. + any_part_name: A module comprising a Worker script, often a javascript file. Multiple modules + may be provided as separate named parts, but at least one module must be + present. This should be referenced either in the metadata as `main_module` + (esm)/`body_part` (service worker) or as a header `CF-WORKER-MAIN-MODULE-PART` + (esm) /`CF-WORKER-BODY-PART` (service worker) by part name. Source maps may also + be included using the `application/source-map` content type. + metadata: JSON encoded metadata about the uploaded parts and Worker configuration. extra_headers: Send extra headers @@ -244,13 +270,21 @@ async def update( ), **(extra_headers or {}), } + body = deepcopy_minimal( + { + "any_part_name": any_part_name, + "metadata": metadata, + } + ) + files = extract_files(cast(Mapping[str, object], body), paths=[["", ""]]) # It should be noted that the actual Content-Type header that will be # sent to the server will contain a `boundary` parameter, e.g. # multipart/form-data; boundary=---abc-- extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} return await self._put( f"/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/content", - body=await async_maybe_transform({"metadata": metadata}, content_update_params.ContentUpdateParams), + body=await async_maybe_transform(body, content_update_params.ContentUpdateParams), + files=files, options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/scripts.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/scripts.py index 054cb9de7be..1f29a5acbe9 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/scripts.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/scripts.py @@ -2,7 +2,8 @@ from __future__ import annotations -from typing import Type, Optional, cast +from typing import List, Type, Optional, cast +from typing_extensions import overload import httpx @@ -46,20 +47,13 @@ SettingsResourceWithStreamingResponse, AsyncSettingsResourceWithStreamingResponse, ) -from ......_types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ......_types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, FileTypes from ......_utils import ( + required_args, maybe_transform, async_maybe_transform, ) from ......_compat import cached_property -from .asset_upload import ( - AssetUploadResource, - AsyncAssetUploadResource, - AssetUploadResourceWithRawResponse, - AsyncAssetUploadResourceWithRawResponse, - AssetUploadResourceWithStreamingResponse, - AsyncAssetUploadResourceWithStreamingResponse, -) from ......_resource import SyncAPIResource, AsyncAPIResource from ......_response import ( to_raw_response_wrapper, @@ -77,10 +71,6 @@ class ScriptsResource(SyncAPIResource): - @cached_property - def asset_upload(self) -> AssetUploadResource: - return AssetUploadResource(self._client) - @cached_property def content(self) -> ContentResource: return ContentResource(self._client) @@ -120,13 +110,15 @@ def with_streaming_response(self) -> ScriptsResourceWithStreamingResponse: """ return ScriptsResourceWithStreamingResponse(self) + @overload def update( self, script_name: str, *, account_id: str, dispatch_namespace: str, - metadata: script_update_params.Metadata, + any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, + metadata: script_update_params.Variant0Metadata | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -147,6 +139,12 @@ def update( script_name: Name of the script, used in URLs and route configuration. + any_part_name: A module comprising a Worker script, often a javascript file. Multiple modules + may be provided as separate named parts, but at least one module must be present + and referenced in the metadata as `main_module` or `body_part` by part name. + Source maps may also be included using the `application/source-map` content + type. + metadata: JSON encoded metadata about the uploaded parts and Worker configuration. extra_headers: Send extra headers @@ -157,6 +155,66 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + def update( + self, + script_name: str, + *, + account_id: str, + dispatch_namespace: str, + message: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[ScriptUpdateResponse]: + """Upload a worker module to a Workers for Platforms namespace. + + You can find more + about the multipart metadata on our docs: + https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/. + + Args: + account_id: Identifier + + dispatch_namespace: Name of the Workers for Platforms dispatch namespace. + + script_name: Name of the script, used in URLs and route configuration. + + message: Rollback message to be associated with this deployment. Only parsed when query + param `"rollback_to"` is present. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["account_id", "dispatch_namespace"]) + def update( + self, + script_name: str, + *, + account_id: str, + dispatch_namespace: str, + any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, + metadata: script_update_params.Variant0Metadata | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[ScriptUpdateResponse]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -165,7 +223,14 @@ def update( raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") return self._put( f"/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}", - body=maybe_transform({"metadata": metadata}, script_update_params.ScriptUpdateParams), + body=maybe_transform( + { + "any_part_name": any_part_name, + "metadata": metadata, + "message": message, + }, + script_update_params.ScriptUpdateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -284,10 +349,6 @@ def get( class AsyncScriptsResource(AsyncAPIResource): - @cached_property - def asset_upload(self) -> AsyncAssetUploadResource: - return AsyncAssetUploadResource(self._client) - @cached_property def content(self) -> AsyncContentResource: return AsyncContentResource(self._client) @@ -327,13 +388,15 @@ def with_streaming_response(self) -> AsyncScriptsResourceWithStreamingResponse: """ return AsyncScriptsResourceWithStreamingResponse(self) + @overload async def update( self, script_name: str, *, account_id: str, dispatch_namespace: str, - metadata: script_update_params.Metadata, + any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, + metadata: script_update_params.Variant0Metadata | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -354,6 +417,12 @@ async def update( script_name: Name of the script, used in URLs and route configuration. + any_part_name: A module comprising a Worker script, often a javascript file. Multiple modules + may be provided as separate named parts, but at least one module must be present + and referenced in the metadata as `main_module` or `body_part` by part name. + Source maps may also be included using the `application/source-map` content + type. + metadata: JSON encoded metadata about the uploaded parts and Worker configuration. extra_headers: Send extra headers @@ -364,6 +433,66 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + async def update( + self, + script_name: str, + *, + account_id: str, + dispatch_namespace: str, + message: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[ScriptUpdateResponse]: + """Upload a worker module to a Workers for Platforms namespace. + + You can find more + about the multipart metadata on our docs: + https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/. + + Args: + account_id: Identifier + + dispatch_namespace: Name of the Workers for Platforms dispatch namespace. + + script_name: Name of the script, used in URLs and route configuration. + + message: Rollback message to be associated with this deployment. Only parsed when query + param `"rollback_to"` is present. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["account_id", "dispatch_namespace"]) + async def update( + self, + script_name: str, + *, + account_id: str, + dispatch_namespace: str, + any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, + metadata: script_update_params.Variant0Metadata | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[ScriptUpdateResponse]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -372,7 +501,14 @@ async def update( raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") return await self._put( f"/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}", - body=await async_maybe_transform({"metadata": metadata}, script_update_params.ScriptUpdateParams), + body=await async_maybe_transform( + { + "any_part_name": any_part_name, + "metadata": metadata, + "message": message, + }, + script_update_params.ScriptUpdateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -504,10 +640,6 @@ def __init__(self, scripts: ScriptsResource) -> None: scripts.get, ) - @cached_property - def asset_upload(self) -> AssetUploadResourceWithRawResponse: - return AssetUploadResourceWithRawResponse(self._scripts.asset_upload) - @cached_property def content(self) -> ContentResourceWithRawResponse: return ContentResourceWithRawResponse(self._scripts.content) @@ -543,10 +675,6 @@ def __init__(self, scripts: AsyncScriptsResource) -> None: scripts.get, ) - @cached_property - def asset_upload(self) -> AsyncAssetUploadResourceWithRawResponse: - return AsyncAssetUploadResourceWithRawResponse(self._scripts.asset_upload) - @cached_property def content(self) -> AsyncContentResourceWithRawResponse: return AsyncContentResourceWithRawResponse(self._scripts.content) @@ -582,10 +710,6 @@ def __init__(self, scripts: ScriptsResource) -> None: scripts.get, ) - @cached_property - def asset_upload(self) -> AssetUploadResourceWithStreamingResponse: - return AssetUploadResourceWithStreamingResponse(self._scripts.asset_upload) - @cached_property def content(self) -> ContentResourceWithStreamingResponse: return ContentResourceWithStreamingResponse(self._scripts.content) @@ -621,10 +745,6 @@ def __init__(self, scripts: AsyncScriptsResource) -> None: scripts.get, ) - @cached_property - def asset_upload(self) -> AsyncAssetUploadResourceWithStreamingResponse: - return AsyncAssetUploadResourceWithStreamingResponse(self._scripts.asset_upload) - @cached_property def content(self) -> AsyncContentResourceWithStreamingResponse: return AsyncContentResourceWithStreamingResponse(self._scripts.content) diff --git a/src/cloudflare/resources/zero_trust/access/__init__.py b/src/cloudflare/resources/zero_trust/access/__init__.py index 12bf11047ec..d368bdfbfc8 100644 --- a/src/cloudflare/resources/zero_trust/access/__init__.py +++ b/src/cloudflare/resources/zero_trust/access/__init__.py @@ -64,14 +64,6 @@ BookmarksResourceWithStreamingResponse, AsyncBookmarksResourceWithStreamingResponse, ) -from .gateway_ca import ( - GatewayCAResource, - AsyncGatewayCAResource, - GatewayCAResourceWithRawResponse, - AsyncGatewayCAResourceWithRawResponse, - GatewayCAResourceWithStreamingResponse, - AsyncGatewayCAResourceWithStreamingResponse, -) from .applications import ( ApplicationsResource, AsyncApplicationsResource, @@ -114,12 +106,6 @@ ) __all__ = [ - "GatewayCAResource", - "AsyncGatewayCAResource", - "GatewayCAResourceWithRawResponse", - "AsyncGatewayCAResourceWithRawResponse", - "GatewayCAResourceWithStreamingResponse", - "AsyncGatewayCAResourceWithStreamingResponse", "InfrastructureResource", "AsyncInfrastructureResource", "InfrastructureResourceWithRawResponse", diff --git a/src/cloudflare/resources/zero_trust/access/access.py b/src/cloudflare/resources/zero_trust/access/access.py index d6aef830815..c76631f16f5 100644 --- a/src/cloudflare/resources/zero_trust/access/access.py +++ b/src/cloudflare/resources/zero_trust/access/access.py @@ -51,14 +51,6 @@ AsyncLogsResourceWithStreamingResponse, ) from ...._compat import cached_property -from .gateway_ca import ( - GatewayCAResource, - AsyncGatewayCAResource, - GatewayCAResourceWithRawResponse, - AsyncGatewayCAResourceWithRawResponse, - GatewayCAResourceWithStreamingResponse, - AsyncGatewayCAResourceWithStreamingResponse, -) from .users.users import ( UsersResource, AsyncUsersResource, @@ -113,10 +105,6 @@ class AccessResource(SyncAPIResource): - @cached_property - def gateway_ca(self) -> GatewayCAResource: - return GatewayCAResource(self._client) - @cached_property def infrastructure(self) -> InfrastructureResource: return InfrastructureResource(self._client) @@ -186,10 +174,6 @@ def with_streaming_response(self) -> AccessResourceWithStreamingResponse: class AsyncAccessResource(AsyncAPIResource): - @cached_property - def gateway_ca(self) -> AsyncGatewayCAResource: - return AsyncGatewayCAResource(self._client) - @cached_property def infrastructure(self) -> AsyncInfrastructureResource: return AsyncInfrastructureResource(self._client) @@ -262,10 +246,6 @@ class AccessResourceWithRawResponse: def __init__(self, access: AccessResource) -> None: self._access = access - @cached_property - def gateway_ca(self) -> GatewayCAResourceWithRawResponse: - return GatewayCAResourceWithRawResponse(self._access.gateway_ca) - @cached_property def infrastructure(self) -> InfrastructureResourceWithRawResponse: return InfrastructureResourceWithRawResponse(self._access.infrastructure) @@ -319,10 +299,6 @@ class AsyncAccessResourceWithRawResponse: def __init__(self, access: AsyncAccessResource) -> None: self._access = access - @cached_property - def gateway_ca(self) -> AsyncGatewayCAResourceWithRawResponse: - return AsyncGatewayCAResourceWithRawResponse(self._access.gateway_ca) - @cached_property def infrastructure(self) -> AsyncInfrastructureResourceWithRawResponse: return AsyncInfrastructureResourceWithRawResponse(self._access.infrastructure) @@ -376,10 +352,6 @@ class AccessResourceWithStreamingResponse: def __init__(self, access: AccessResource) -> None: self._access = access - @cached_property - def gateway_ca(self) -> GatewayCAResourceWithStreamingResponse: - return GatewayCAResourceWithStreamingResponse(self._access.gateway_ca) - @cached_property def infrastructure(self) -> InfrastructureResourceWithStreamingResponse: return InfrastructureResourceWithStreamingResponse(self._access.infrastructure) @@ -433,10 +405,6 @@ class AsyncAccessResourceWithStreamingResponse: def __init__(self, access: AsyncAccessResource) -> None: self._access = access - @cached_property - def gateway_ca(self) -> AsyncGatewayCAResourceWithStreamingResponse: - return AsyncGatewayCAResourceWithStreamingResponse(self._access.gateway_ca) - @cached_property def infrastructure(self) -> AsyncInfrastructureResourceWithStreamingResponse: return AsyncInfrastructureResourceWithStreamingResponse(self._access.infrastructure) diff --git a/src/cloudflare/resources/zero_trust/access/gateway_ca.py b/src/cloudflare/resources/zero_trust/access/gateway_ca.py deleted file mode 100644 index d349400078f..00000000000 --- a/src/cloudflare/resources/zero_trust/access/gateway_ca.py +++ /dev/null @@ -1,365 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Type, Optional, cast - -import httpx - -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ...._wrappers import ResultWrapper -from ....pagination import SyncSinglePage, AsyncSinglePage -from ...._base_client import AsyncPaginator, make_request_options -from ....types.zero_trust.access.gateway_ca_list_response import GatewayCAListResponse -from ....types.zero_trust.access.gateway_ca_create_response import GatewayCACreateResponse -from ....types.zero_trust.access.gateway_ca_delete_response import GatewayCADeleteResponse - -__all__ = ["GatewayCAResource", "AsyncGatewayCAResource"] - - -class GatewayCAResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> GatewayCAResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return GatewayCAResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> GatewayCAResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return GatewayCAResourceWithStreamingResponse(self) - - def create( - self, - *, - account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[GatewayCACreateResponse]: - """ - Adds a new SSH Certificate Authority (CA). - - Args: - account_id: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._post( - f"/accounts/{account_id}/access/gateway_ca", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[GatewayCACreateResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[GatewayCACreateResponse]], ResultWrapper[GatewayCACreateResponse]), - ) - - def list( - self, - *, - account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[GatewayCAListResponse]: - """ - Lists SSH Certificate Authorities (CA). - - Args: - account_id: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get_api_list( - f"/accounts/{account_id}/access/gateway_ca", - page=SyncSinglePage[GatewayCAListResponse], - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - model=GatewayCAListResponse, - ) - - def delete( - self, - certificate_id: str, - *, - account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[GatewayCADeleteResponse]: - """ - Deletes an SSH Certificate Authority. - - Args: - account_id: Identifier - - certificate_id: UUID - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not certificate_id: - raise ValueError(f"Expected a non-empty value for `certificate_id` but received {certificate_id!r}") - return self._delete( - f"/accounts/{account_id}/access/gateway_ca/{certificate_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[GatewayCADeleteResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[GatewayCADeleteResponse]], ResultWrapper[GatewayCADeleteResponse]), - ) - - -class AsyncGatewayCAResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncGatewayCAResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncGatewayCAResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncGatewayCAResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncGatewayCAResourceWithStreamingResponse(self) - - async def create( - self, - *, - account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[GatewayCACreateResponse]: - """ - Adds a new SSH Certificate Authority (CA). - - Args: - account_id: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._post( - f"/accounts/{account_id}/access/gateway_ca", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[GatewayCACreateResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[GatewayCACreateResponse]], ResultWrapper[GatewayCACreateResponse]), - ) - - def list( - self, - *, - account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[GatewayCAListResponse, AsyncSinglePage[GatewayCAListResponse]]: - """ - Lists SSH Certificate Authorities (CA). - - Args: - account_id: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get_api_list( - f"/accounts/{account_id}/access/gateway_ca", - page=AsyncSinglePage[GatewayCAListResponse], - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - model=GatewayCAListResponse, - ) - - async def delete( - self, - certificate_id: str, - *, - account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[GatewayCADeleteResponse]: - """ - Deletes an SSH Certificate Authority. - - Args: - account_id: Identifier - - certificate_id: UUID - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not certificate_id: - raise ValueError(f"Expected a non-empty value for `certificate_id` but received {certificate_id!r}") - return await self._delete( - f"/accounts/{account_id}/access/gateway_ca/{certificate_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[GatewayCADeleteResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[GatewayCADeleteResponse]], ResultWrapper[GatewayCADeleteResponse]), - ) - - -class GatewayCAResourceWithRawResponse: - def __init__(self, gateway_ca: GatewayCAResource) -> None: - self._gateway_ca = gateway_ca - - self.create = to_raw_response_wrapper( - gateway_ca.create, - ) - self.list = to_raw_response_wrapper( - gateway_ca.list, - ) - self.delete = to_raw_response_wrapper( - gateway_ca.delete, - ) - - -class AsyncGatewayCAResourceWithRawResponse: - def __init__(self, gateway_ca: AsyncGatewayCAResource) -> None: - self._gateway_ca = gateway_ca - - self.create = async_to_raw_response_wrapper( - gateway_ca.create, - ) - self.list = async_to_raw_response_wrapper( - gateway_ca.list, - ) - self.delete = async_to_raw_response_wrapper( - gateway_ca.delete, - ) - - -class GatewayCAResourceWithStreamingResponse: - def __init__(self, gateway_ca: GatewayCAResource) -> None: - self._gateway_ca = gateway_ca - - self.create = to_streamed_response_wrapper( - gateway_ca.create, - ) - self.list = to_streamed_response_wrapper( - gateway_ca.list, - ) - self.delete = to_streamed_response_wrapper( - gateway_ca.delete, - ) - - -class AsyncGatewayCAResourceWithStreamingResponse: - def __init__(self, gateway_ca: AsyncGatewayCAResource) -> None: - self._gateway_ca = gateway_ca - - self.create = async_to_streamed_response_wrapper( - gateway_ca.create, - ) - self.list = async_to_streamed_response_wrapper( - gateway_ca.list, - ) - self.delete = async_to_streamed_response_wrapper( - gateway_ca.delete, - ) diff --git a/src/cloudflare/resources/zero_trust/access/infrastructure/targets.py b/src/cloudflare/resources/zero_trust/access/infrastructure/targets.py index ff0a4df5312..364b09d482d 100644 --- a/src/cloudflare/resources/zero_trust/access/infrastructure/targets.py +++ b/src/cloudflare/resources/zero_trust/access/infrastructure/targets.py @@ -2,9 +2,8 @@ from __future__ import annotations -from typing import List, Type, Union, Iterable, Optional, cast +from typing import Type, Union, Iterable, Optional, cast from datetime import datetime -from typing_extensions import Literal import httpx @@ -177,16 +176,11 @@ def list( *, account_id: str, created_after: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - created_before: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, hostname: Optional[str] | NotGiven = NOT_GIVEN, hostname_contains: Optional[str] | NotGiven = NOT_GIVEN, ip_v4: Optional[str] | NotGiven = NOT_GIVEN, ip_v6: Optional[str] | NotGiven = NOT_GIVEN, - ips: List[str] | NotGiven = NOT_GIVEN, modified_after: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - modified_before: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - order: Literal["hostname", "created_at"] | NotGiven = NOT_GIVEN, page: int | NotGiven = NOT_GIVEN, per_page: int | NotGiven = NOT_GIVEN, virtual_network_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -197,20 +191,13 @@ def list( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncV4PagePaginationArray[TargetListResponse]: - """Lists and sorts an account’s targets. - - Filters are optional and are ORed - together. However, when a timestamp is specified with both its before and after - counterparts, the timestamp filters are ANDed. + """ + List all targets Args: account_id: Account identifier - created_after: Date and time at which the target was created after (inclusive) - - created_before: Date and time at which the target was created before (inclusive) - - direction: The sorting direction. + created_after: Date and time at which the target was created hostname: Hostname of a target @@ -220,14 +207,7 @@ def list( ip_v6: IPv6 address of the target - ips: Filters for targets that have any of the following IP addresses. Specify `ips` - multiple times in query parameter to build list of candidates. - - modified_after: Date and time at which the target was modified after (inclusive) - - modified_before: Date and time at which the target was modified before (inclusive) - - order: The field to sort by. + modified_after: Date and time at which the target was modified page: Current page in the response @@ -256,16 +236,11 @@ def list( query=maybe_transform( { "created_after": created_after, - "created_before": created_before, - "direction": direction, "hostname": hostname, "hostname_contains": hostname_contains, "ip_v4": ip_v4, "ip_v6": ip_v6, - "ips": ips, "modified_after": modified_after, - "modified_before": modified_before, - "order": order, "page": page, "per_page": per_page, "virtual_network_id": virtual_network_id, @@ -573,16 +548,11 @@ def list( *, account_id: str, created_after: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - created_before: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, hostname: Optional[str] | NotGiven = NOT_GIVEN, hostname_contains: Optional[str] | NotGiven = NOT_GIVEN, ip_v4: Optional[str] | NotGiven = NOT_GIVEN, ip_v6: Optional[str] | NotGiven = NOT_GIVEN, - ips: List[str] | NotGiven = NOT_GIVEN, modified_after: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - modified_before: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - order: Literal["hostname", "created_at"] | NotGiven = NOT_GIVEN, page: int | NotGiven = NOT_GIVEN, per_page: int | NotGiven = NOT_GIVEN, virtual_network_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -593,20 +563,13 @@ def list( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[TargetListResponse, AsyncV4PagePaginationArray[TargetListResponse]]: - """Lists and sorts an account’s targets. - - Filters are optional and are ORed - together. However, when a timestamp is specified with both its before and after - counterparts, the timestamp filters are ANDed. + """ + List all targets Args: account_id: Account identifier - created_after: Date and time at which the target was created after (inclusive) - - created_before: Date and time at which the target was created before (inclusive) - - direction: The sorting direction. + created_after: Date and time at which the target was created hostname: Hostname of a target @@ -616,14 +579,7 @@ def list( ip_v6: IPv6 address of the target - ips: Filters for targets that have any of the following IP addresses. Specify `ips` - multiple times in query parameter to build list of candidates. - - modified_after: Date and time at which the target was modified after (inclusive) - - modified_before: Date and time at which the target was modified before (inclusive) - - order: The field to sort by. + modified_after: Date and time at which the target was modified page: Current page in the response @@ -652,16 +608,11 @@ def list( query=maybe_transform( { "created_after": created_after, - "created_before": created_before, - "direction": direction, "hostname": hostname, "hostname_contains": hostname_contains, "ip_v4": ip_v4, "ip_v6": ip_v6, - "ips": ips, "modified_after": modified_after, - "modified_before": modified_before, - "order": order, "page": page, "per_page": per_page, "virtual_network_id": virtual_network_id, diff --git a/src/cloudflare/resources/zero_trust/devices/devices.py b/src/cloudflare/resources/zero_trust/devices/devices.py index cdb59f224e5..3b946277c22 100644 --- a/src/cloudflare/resources/zero_trust/devices/devices.py +++ b/src/cloudflare/resources/zero_trust/devices/devices.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, Optional, cast +from typing import Any, cast import httpx @@ -197,7 +197,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[DeviceGetResponse]: + ) -> DeviceGetResponse: """ Fetches details for a single device. @@ -216,16 +216,21 @@ def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not device_id: raise ValueError(f"Expected a non-empty value for `device_id` but received {device_id!r}") - return self._get( - f"/accounts/{account_id}/devices/{device_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[DeviceGetResponse]]._unwrapper, + return cast( + DeviceGetResponse, + self._get( + f"/accounts/{account_id}/devices/{device_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[DeviceGetResponse]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[DeviceGetResponse] + ), # Union types cannot be passed in as arguments in the type system ), - cast_to=cast(Type[Optional[DeviceGetResponse]], ResultWrapper[DeviceGetResponse]), ) @@ -330,7 +335,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[DeviceGetResponse]: + ) -> DeviceGetResponse: """ Fetches details for a single device. @@ -349,16 +354,21 @@ async def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not device_id: raise ValueError(f"Expected a non-empty value for `device_id` but received {device_id!r}") - return await self._get( - f"/accounts/{account_id}/devices/{device_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[DeviceGetResponse]]._unwrapper, + return cast( + DeviceGetResponse, + await self._get( + f"/accounts/{account_id}/devices/{device_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[DeviceGetResponse]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[DeviceGetResponse] + ), # Union types cannot be passed in as arguments in the type system ), - cast_to=cast(Type[Optional[DeviceGetResponse]], ResultWrapper[DeviceGetResponse]), ) diff --git a/src/cloudflare/resources/zero_trust/devices/fleet_status.py b/src/cloudflare/resources/zero_trust/devices/fleet_status.py index 57b2c298c03..871b776677f 100644 --- a/src/cloudflare/resources/zero_trust/devices/fleet_status.py +++ b/src/cloudflare/resources/zero_trust/devices/fleet_status.py @@ -85,7 +85,7 @@ def get( if not device_id: raise ValueError(f"Expected a non-empty value for `device_id` but received {device_id!r}") return self._get( - f"/accounts/{account_id}/dex/devices/{device_id}/fleet-status/live", + f"/accounts/{account_id}/devices/{device_id}/fleet-status/live", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -165,7 +165,7 @@ async def get( if not device_id: raise ValueError(f"Expected a non-empty value for `device_id` but received {device_id!r}") return await self._get( - f"/accounts/{account_id}/dex/devices/{device_id}/fleet-status/live", + f"/accounts/{account_id}/devices/{device_id}/fleet-status/live", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/cloudflare/resources/zero_trust/devices/policies/default/certificates.py b/src/cloudflare/resources/zero_trust/devices/policies/default/certificates.py index d14e2eaa953..1996ac06b92 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/default/certificates.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/default/certificates.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, Optional, cast +from typing import Any, cast import httpx @@ -59,7 +59,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CertificateEditResponse]: + ) -> CertificateEditResponse: """ Enable Zero Trust Clients to provision a certificate, containing a x509 subject, and referenced by Access device posture policies when the client visits MTLS @@ -80,7 +80,7 @@ def edit( if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( - Optional[CertificateEditResponse], + CertificateEditResponse, self._patch( f"/zones/{zone_id}/devices/policy/certificates", body=maybe_transform({"enabled": enabled}, certificate_edit_params.CertificateEditParams), @@ -89,7 +89,7 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CertificateEditResponse]]._unwrapper, + post_parser=ResultWrapper[CertificateEditResponse]._unwrapper, ), cast_to=cast( Any, ResultWrapper[CertificateEditResponse] @@ -107,7 +107,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CertificateGetResponse]: + ) -> CertificateGetResponse: """ Fetches device certificate provisioning @@ -123,7 +123,7 @@ def get( if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( - Optional[CertificateGetResponse], + CertificateGetResponse, self._get( f"/zones/{zone_id}/devices/policy/certificates", options=make_request_options( @@ -131,7 +131,7 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CertificateGetResponse]]._unwrapper, + post_parser=ResultWrapper[CertificateGetResponse]._unwrapper, ), cast_to=cast( Any, ResultWrapper[CertificateGetResponse] @@ -171,7 +171,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CertificateEditResponse]: + ) -> CertificateEditResponse: """ Enable Zero Trust Clients to provision a certificate, containing a x509 subject, and referenced by Access device posture policies when the client visits MTLS @@ -192,7 +192,7 @@ async def edit( if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( - Optional[CertificateEditResponse], + CertificateEditResponse, await self._patch( f"/zones/{zone_id}/devices/policy/certificates", body=await async_maybe_transform({"enabled": enabled}, certificate_edit_params.CertificateEditParams), @@ -201,7 +201,7 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CertificateEditResponse]]._unwrapper, + post_parser=ResultWrapper[CertificateEditResponse]._unwrapper, ), cast_to=cast( Any, ResultWrapper[CertificateEditResponse] @@ -219,7 +219,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CertificateGetResponse]: + ) -> CertificateGetResponse: """ Fetches device certificate provisioning @@ -235,7 +235,7 @@ async def get( if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( - Optional[CertificateGetResponse], + CertificateGetResponse, await self._get( f"/zones/{zone_id}/devices/policy/certificates", options=make_request_options( @@ -243,7 +243,7 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CertificateGetResponse]]._unwrapper, + post_parser=ResultWrapper[CertificateGetResponse]._unwrapper, ), cast_to=cast( Any, ResultWrapper[CertificateGetResponse] diff --git a/src/cloudflare/resources/zero_trust/devices/posture/integrations.py b/src/cloudflare/resources/zero_trust/devices/posture/integrations.py index c02ac6559f6..0074d8055da 100644 --- a/src/cloudflare/resources/zero_trust/devices/posture/integrations.py +++ b/src/cloudflare/resources/zero_trust/devices/posture/integrations.py @@ -156,7 +156,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[IntegrationDeleteResponse]: + ) -> IntegrationDeleteResponse: """ Delete a configured device posture integration. @@ -176,7 +176,7 @@ def delete( if not integration_id: raise ValueError(f"Expected a non-empty value for `integration_id` but received {integration_id!r}") return cast( - Optional[IntegrationDeleteResponse], + IntegrationDeleteResponse, self._delete( f"/accounts/{account_id}/devices/posture/integration/{integration_id}", options=make_request_options( @@ -184,7 +184,7 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[IntegrationDeleteResponse]]._unwrapper, + post_parser=ResultWrapper[IntegrationDeleteResponse]._unwrapper, ), cast_to=cast( Any, ResultWrapper[IntegrationDeleteResponse] @@ -428,7 +428,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[IntegrationDeleteResponse]: + ) -> IntegrationDeleteResponse: """ Delete a configured device posture integration. @@ -448,7 +448,7 @@ async def delete( if not integration_id: raise ValueError(f"Expected a non-empty value for `integration_id` but received {integration_id!r}") return cast( - Optional[IntegrationDeleteResponse], + IntegrationDeleteResponse, await self._delete( f"/accounts/{account_id}/devices/posture/integration/{integration_id}", options=make_request_options( @@ -456,7 +456,7 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[IntegrationDeleteResponse]]._unwrapper, + post_parser=ResultWrapper[IntegrationDeleteResponse]._unwrapper, ), cast_to=cast( Any, ResultWrapper[IntegrationDeleteResponse] diff --git a/src/cloudflare/resources/zero_trust/devices/revoke.py b/src/cloudflare/resources/zero_trust/devices/revoke.py index 3057bf6c62d..d14f3536764 100644 --- a/src/cloudflare/resources/zero_trust/devices/revoke.py +++ b/src/cloudflare/resources/zero_trust/devices/revoke.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, List, Optional, cast +from typing import Any, List, cast import httpx @@ -57,7 +57,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RevokeCreateResponse]: + ) -> RevokeCreateResponse: """ Revokes a list of devices. @@ -75,7 +75,7 @@ def create( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( - Optional[RevokeCreateResponse], + RevokeCreateResponse, self._post( f"/accounts/{account_id}/devices/revoke", body=maybe_transform(body, List[str]), @@ -84,7 +84,7 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RevokeCreateResponse]]._unwrapper, + post_parser=ResultWrapper[RevokeCreateResponse]._unwrapper, ), cast_to=cast( Any, ResultWrapper[RevokeCreateResponse] @@ -124,7 +124,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RevokeCreateResponse]: + ) -> RevokeCreateResponse: """ Revokes a list of devices. @@ -142,7 +142,7 @@ async def create( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( - Optional[RevokeCreateResponse], + RevokeCreateResponse, await self._post( f"/accounts/{account_id}/devices/revoke", body=await async_maybe_transform(body, List[str]), @@ -151,7 +151,7 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RevokeCreateResponse]]._unwrapper, + post_parser=ResultWrapper[RevokeCreateResponse]._unwrapper, ), cast_to=cast( Any, ResultWrapper[RevokeCreateResponse] diff --git a/src/cloudflare/resources/zero_trust/devices/unrevoke.py b/src/cloudflare/resources/zero_trust/devices/unrevoke.py index b99f36a0037..3c4489edec1 100644 --- a/src/cloudflare/resources/zero_trust/devices/unrevoke.py +++ b/src/cloudflare/resources/zero_trust/devices/unrevoke.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, List, Optional, cast +from typing import Any, List, cast import httpx @@ -57,7 +57,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[UnrevokeCreateResponse]: + ) -> UnrevokeCreateResponse: """ Unrevokes a list of devices. @@ -75,7 +75,7 @@ def create( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( - Optional[UnrevokeCreateResponse], + UnrevokeCreateResponse, self._post( f"/accounts/{account_id}/devices/unrevoke", body=maybe_transform(body, List[str]), @@ -84,7 +84,7 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[UnrevokeCreateResponse]]._unwrapper, + post_parser=ResultWrapper[UnrevokeCreateResponse]._unwrapper, ), cast_to=cast( Any, ResultWrapper[UnrevokeCreateResponse] @@ -124,7 +124,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[UnrevokeCreateResponse]: + ) -> UnrevokeCreateResponse: """ Unrevokes a list of devices. @@ -142,7 +142,7 @@ async def create( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( - Optional[UnrevokeCreateResponse], + UnrevokeCreateResponse, await self._post( f"/accounts/{account_id}/devices/unrevoke", body=await async_maybe_transform(body, List[str]), @@ -151,7 +151,7 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[UnrevokeCreateResponse]]._unwrapper, + post_parser=ResultWrapper[UnrevokeCreateResponse]._unwrapper, ), cast_to=cast( Any, ResultWrapper[UnrevokeCreateResponse] diff --git a/src/cloudflare/resources/zero_trust/dex/commands/__init__.py b/src/cloudflare/resources/zero_trust/dex/commands/__init__.py index 1cf551c58ba..4566edefe96 100644 --- a/src/cloudflare/resources/zero_trust/dex/commands/__init__.py +++ b/src/cloudflare/resources/zero_trust/dex/commands/__init__.py @@ -8,22 +8,6 @@ QuotaResourceWithStreamingResponse, AsyncQuotaResourceWithStreamingResponse, ) -from .users import ( - UsersResource, - AsyncUsersResource, - UsersResourceWithRawResponse, - AsyncUsersResourceWithRawResponse, - UsersResourceWithStreamingResponse, - AsyncUsersResourceWithStreamingResponse, -) -from .devices import ( - DevicesResource, - AsyncDevicesResource, - DevicesResourceWithRawResponse, - AsyncDevicesResourceWithRawResponse, - DevicesResourceWithStreamingResponse, - AsyncDevicesResourceWithStreamingResponse, -) from .commands import ( CommandsResource, AsyncCommandsResource, @@ -42,18 +26,6 @@ ) __all__ = [ - "UsersResource", - "AsyncUsersResource", - "UsersResourceWithRawResponse", - "AsyncUsersResourceWithRawResponse", - "UsersResourceWithStreamingResponse", - "AsyncUsersResourceWithStreamingResponse", - "DevicesResource", - "AsyncDevicesResource", - "DevicesResourceWithRawResponse", - "AsyncDevicesResourceWithRawResponse", - "DevicesResourceWithStreamingResponse", - "AsyncDevicesResourceWithStreamingResponse", "DownloadsResource", "AsyncDownloadsResource", "DownloadsResourceWithRawResponse", diff --git a/src/cloudflare/resources/zero_trust/dex/commands/commands.py b/src/cloudflare/resources/zero_trust/dex/commands/commands.py index 7f887f8e617..f59aadf5646 100644 --- a/src/cloudflare/resources/zero_trust/dex/commands/commands.py +++ b/src/cloudflare/resources/zero_trust/dex/commands/commands.py @@ -16,22 +16,6 @@ QuotaResourceWithStreamingResponse, AsyncQuotaResourceWithStreamingResponse, ) -from .users import ( - UsersResource, - AsyncUsersResource, - UsersResourceWithRawResponse, - AsyncUsersResourceWithRawResponse, - UsersResourceWithStreamingResponse, - AsyncUsersResourceWithStreamingResponse, -) -from .devices import ( - DevicesResource, - AsyncDevicesResource, - DevicesResourceWithRawResponse, - AsyncDevicesResourceWithRawResponse, - DevicesResourceWithStreamingResponse, - AsyncDevicesResourceWithStreamingResponse, -) from .downloads import ( DownloadsResource, AsyncDownloadsResource, @@ -64,14 +48,6 @@ class CommandsResource(SyncAPIResource): - @cached_property - def users(self) -> UsersResource: - return UsersResource(self._client) - - @cached_property - def devices(self) -> DevicesResource: - return DevicesResource(self._client) - @cached_property def downloads(self) -> DownloadsResource: return DownloadsResource(self._client) @@ -128,7 +104,7 @@ def create( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( - f"/accounts/{account_id}/dex/commands", + f"/accounts/{account_id}/commands", body=maybe_transform({"commands": commands}, command_create_params.CommandCreateParams), options=make_request_options( extra_headers=extra_headers, @@ -191,7 +167,7 @@ def list( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( - f"/accounts/{account_id}/dex/commands", + f"/accounts/{account_id}/commands", page=SyncV4PagePagination[Optional[CommandListResponse]], options=make_request_options( extra_headers=extra_headers, @@ -217,14 +193,6 @@ def list( class AsyncCommandsResource(AsyncAPIResource): - @cached_property - def users(self) -> AsyncUsersResource: - return AsyncUsersResource(self._client) - - @cached_property - def devices(self) -> AsyncDevicesResource: - return AsyncDevicesResource(self._client) - @cached_property def downloads(self) -> AsyncDownloadsResource: return AsyncDownloadsResource(self._client) @@ -281,7 +249,7 @@ async def create( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( - f"/accounts/{account_id}/dex/commands", + f"/accounts/{account_id}/commands", body=await async_maybe_transform({"commands": commands}, command_create_params.CommandCreateParams), options=make_request_options( extra_headers=extra_headers, @@ -344,7 +312,7 @@ def list( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( - f"/accounts/{account_id}/dex/commands", + f"/accounts/{account_id}/commands", page=AsyncV4PagePagination[Optional[CommandListResponse]], options=make_request_options( extra_headers=extra_headers, @@ -380,14 +348,6 @@ def __init__(self, commands: CommandsResource) -> None: commands.list, ) - @cached_property - def users(self) -> UsersResourceWithRawResponse: - return UsersResourceWithRawResponse(self._commands.users) - - @cached_property - def devices(self) -> DevicesResourceWithRawResponse: - return DevicesResourceWithRawResponse(self._commands.devices) - @cached_property def downloads(self) -> DownloadsResourceWithRawResponse: return DownloadsResourceWithRawResponse(self._commands.downloads) @@ -408,14 +368,6 @@ def __init__(self, commands: AsyncCommandsResource) -> None: commands.list, ) - @cached_property - def users(self) -> AsyncUsersResourceWithRawResponse: - return AsyncUsersResourceWithRawResponse(self._commands.users) - - @cached_property - def devices(self) -> AsyncDevicesResourceWithRawResponse: - return AsyncDevicesResourceWithRawResponse(self._commands.devices) - @cached_property def downloads(self) -> AsyncDownloadsResourceWithRawResponse: return AsyncDownloadsResourceWithRawResponse(self._commands.downloads) @@ -436,14 +388,6 @@ def __init__(self, commands: CommandsResource) -> None: commands.list, ) - @cached_property - def users(self) -> UsersResourceWithStreamingResponse: - return UsersResourceWithStreamingResponse(self._commands.users) - - @cached_property - def devices(self) -> DevicesResourceWithStreamingResponse: - return DevicesResourceWithStreamingResponse(self._commands.devices) - @cached_property def downloads(self) -> DownloadsResourceWithStreamingResponse: return DownloadsResourceWithStreamingResponse(self._commands.downloads) @@ -464,14 +408,6 @@ def __init__(self, commands: AsyncCommandsResource) -> None: commands.list, ) - @cached_property - def users(self) -> AsyncUsersResourceWithStreamingResponse: - return AsyncUsersResourceWithStreamingResponse(self._commands.users) - - @cached_property - def devices(self) -> AsyncDevicesResourceWithStreamingResponse: - return AsyncDevicesResourceWithStreamingResponse(self._commands.devices) - @cached_property def downloads(self) -> AsyncDownloadsResourceWithStreamingResponse: return AsyncDownloadsResourceWithStreamingResponse(self._commands.downloads) diff --git a/src/cloudflare/resources/zero_trust/dex/commands/devices.py b/src/cloudflare/resources/zero_trust/dex/commands/devices.py deleted file mode 100644 index 4f3b3697c94..00000000000 --- a/src/cloudflare/resources/zero_trust/dex/commands/devices.py +++ /dev/null @@ -1,212 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Optional - -import httpx - -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ....._utils import maybe_transform -from ....._compat import cached_property -from ....._resource import SyncAPIResource, AsyncAPIResource -from ....._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from .....pagination import SyncV4PagePagination, AsyncV4PagePagination -from ....._base_client import AsyncPaginator, make_request_options -from .....types.zero_trust.dex.commands import device_list_params -from .....types.zero_trust.dex.commands.device_list_response import DeviceListResponse - -__all__ = ["DevicesResource", "AsyncDevicesResource"] - - -class DevicesResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> DevicesResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return DevicesResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> DevicesResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return DevicesResourceWithStreamingResponse(self) - - def list( - self, - *, - account_id: str, - page: float, - per_page: float, - search: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncV4PagePagination[Optional[DeviceListResponse]]: - """ - List devices with WARP client support for remote captures which have been - connected in the last 1 hour. - - Args: - page: Page number of paginated results - - per_page: Number of items per page - - search: Filter devices by name or email - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get_api_list( - f"/accounts/{account_id}/dex/commands/devices", - page=SyncV4PagePagination[Optional[DeviceListResponse]], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "page": page, - "per_page": per_page, - "search": search, - }, - device_list_params.DeviceListParams, - ), - ), - model=DeviceListResponse, - ) - - -class AsyncDevicesResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncDevicesResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncDevicesResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncDevicesResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncDevicesResourceWithStreamingResponse(self) - - def list( - self, - *, - account_id: str, - page: float, - per_page: float, - search: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[Optional[DeviceListResponse], AsyncV4PagePagination[Optional[DeviceListResponse]]]: - """ - List devices with WARP client support for remote captures which have been - connected in the last 1 hour. - - Args: - page: Page number of paginated results - - per_page: Number of items per page - - search: Filter devices by name or email - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get_api_list( - f"/accounts/{account_id}/dex/commands/devices", - page=AsyncV4PagePagination[Optional[DeviceListResponse]], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "page": page, - "per_page": per_page, - "search": search, - }, - device_list_params.DeviceListParams, - ), - ), - model=DeviceListResponse, - ) - - -class DevicesResourceWithRawResponse: - def __init__(self, devices: DevicesResource) -> None: - self._devices = devices - - self.list = to_raw_response_wrapper( - devices.list, - ) - - -class AsyncDevicesResourceWithRawResponse: - def __init__(self, devices: AsyncDevicesResource) -> None: - self._devices = devices - - self.list = async_to_raw_response_wrapper( - devices.list, - ) - - -class DevicesResourceWithStreamingResponse: - def __init__(self, devices: DevicesResource) -> None: - self._devices = devices - - self.list = to_streamed_response_wrapper( - devices.list, - ) - - -class AsyncDevicesResourceWithStreamingResponse: - def __init__(self, devices: AsyncDevicesResource) -> None: - self._devices = devices - - self.list = async_to_streamed_response_wrapper( - devices.list, - ) diff --git a/src/cloudflare/resources/zero_trust/dex/commands/downloads.py b/src/cloudflare/resources/zero_trust/dex/commands/downloads.py index 57b8e0320aa..4baa6e25922 100644 --- a/src/cloudflare/resources/zero_trust/dex/commands/downloads.py +++ b/src/cloudflare/resources/zero_trust/dex/commands/downloads.py @@ -78,7 +78,7 @@ def get( raise ValueError(f"Expected a non-empty value for `filename` but received {filename!r}") extra_headers = {"Accept": "application/zip", **(extra_headers or {})} return self._get( - f"/accounts/{account_id}/dex/commands/{command_id}/downloads/{filename}", + f"/accounts/{account_id}/commands/{command_id}/downloads/{filename}", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -142,7 +142,7 @@ async def get( raise ValueError(f"Expected a non-empty value for `filename` but received {filename!r}") extra_headers = {"Accept": "application/zip", **(extra_headers or {})} return await self._get( - f"/accounts/{account_id}/dex/commands/{command_id}/downloads/{filename}", + f"/accounts/{account_id}/commands/{command_id}/downloads/{filename}", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/cloudflare/resources/zero_trust/dex/commands/quota.py b/src/cloudflare/resources/zero_trust/dex/commands/quota.py index 8a0ba05b4b3..f16c78b78ce 100644 --- a/src/cloudflare/resources/zero_trust/dex/commands/quota.py +++ b/src/cloudflare/resources/zero_trust/dex/commands/quota.py @@ -69,7 +69,7 @@ def get( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( - f"/accounts/{account_id}/dex/commands/quota", + f"/accounts/{account_id}/commands/quota", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -128,7 +128,7 @@ async def get( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( - f"/accounts/{account_id}/dex/commands/quota", + f"/accounts/{account_id}/commands/quota", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/cloudflare/resources/zero_trust/dex/commands/users.py b/src/cloudflare/resources/zero_trust/dex/commands/users.py deleted file mode 100644 index 7c9308df318..00000000000 --- a/src/cloudflare/resources/zero_trust/dex/commands/users.py +++ /dev/null @@ -1,189 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Type, Optional, cast - -import httpx - -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ....._utils import ( - maybe_transform, - async_maybe_transform, -) -from ....._compat import cached_property -from ....._resource import SyncAPIResource, AsyncAPIResource -from ....._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ....._wrappers import ResultWrapper -from ....._base_client import make_request_options -from .....types.zero_trust.dex.commands import user_list_params -from .....types.zero_trust.dex.commands.user_list_response import UserListResponse - -__all__ = ["UsersResource", "AsyncUsersResource"] - - -class UsersResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> UsersResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return UsersResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> UsersResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return UsersResourceWithStreamingResponse(self) - - def list( - self, - *, - account_id: str, - search: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[UserListResponse]: - """ - List users emails associated with devices with WARP client support for remote - captures which have been connected in the last 1 hour. - - Args: - search: filter user emails by search - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get( - f"/accounts/{account_id}/dex/commands/users", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform({"search": search}, user_list_params.UserListParams), - post_parser=ResultWrapper[Optional[UserListResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[UserListResponse]], ResultWrapper[UserListResponse]), - ) - - -class AsyncUsersResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncUsersResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncUsersResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncUsersResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncUsersResourceWithStreamingResponse(self) - - async def list( - self, - *, - account_id: str, - search: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[UserListResponse]: - """ - List users emails associated with devices with WARP client support for remote - captures which have been connected in the last 1 hour. - - Args: - search: filter user emails by search - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._get( - f"/accounts/{account_id}/dex/commands/users", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform({"search": search}, user_list_params.UserListParams), - post_parser=ResultWrapper[Optional[UserListResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[UserListResponse]], ResultWrapper[UserListResponse]), - ) - - -class UsersResourceWithRawResponse: - def __init__(self, users: UsersResource) -> None: - self._users = users - - self.list = to_raw_response_wrapper( - users.list, - ) - - -class AsyncUsersResourceWithRawResponse: - def __init__(self, users: AsyncUsersResource) -> None: - self._users = users - - self.list = async_to_raw_response_wrapper( - users.list, - ) - - -class UsersResourceWithStreamingResponse: - def __init__(self, users: UsersResource) -> None: - self._users = users - - self.list = to_streamed_response_wrapper( - users.list, - ) - - -class AsyncUsersResourceWithStreamingResponse: - def __init__(self, users: AsyncUsersResource) -> None: - self._users = users - - self.list = async_to_streamed_response_wrapper( - users.list, - ) diff --git a/src/cloudflare/resources/zero_trust/dlp/__init__.py b/src/cloudflare/resources/zero_trust/dlp/__init__.py index 03f7e960404..b3185380cfb 100644 --- a/src/cloudflare/resources/zero_trust/dlp/__init__.py +++ b/src/cloudflare/resources/zero_trust/dlp/__init__.py @@ -8,14 +8,6 @@ DLPResourceWithStreamingResponse, AsyncDLPResourceWithStreamingResponse, ) -from .email import ( - EmailResource, - AsyncEmailResource, - EmailResourceWithRawResponse, - AsyncEmailResourceWithRawResponse, - EmailResourceWithStreamingResponse, - AsyncEmailResourceWithStreamingResponse, -) from .limits import ( LimitsResource, AsyncLimitsResource, @@ -84,12 +76,6 @@ "AsyncPayloadLogsResourceWithRawResponse", "PayloadLogsResourceWithStreamingResponse", "AsyncPayloadLogsResourceWithStreamingResponse", - "EmailResource", - "AsyncEmailResource", - "EmailResourceWithRawResponse", - "AsyncEmailResourceWithRawResponse", - "EmailResourceWithStreamingResponse", - "AsyncEmailResourceWithStreamingResponse", "ProfilesResource", "AsyncProfilesResource", "ProfilesResourceWithRawResponse", diff --git a/src/cloudflare/resources/zero_trust/dlp/dlp.py b/src/cloudflare/resources/zero_trust/dlp/dlp.py index 2a5da23c2db..742d20a6233 100644 --- a/src/cloudflare/resources/zero_trust/dlp/dlp.py +++ b/src/cloudflare/resources/zero_trust/dlp/dlp.py @@ -27,14 +27,6 @@ AsyncPatternsResourceWithStreamingResponse, ) from ...._compat import cached_property -from .email.email import ( - EmailResource, - AsyncEmailResource, - EmailResourceWithRawResponse, - AsyncEmailResourceWithRawResponse, - EmailResourceWithStreamingResponse, - AsyncEmailResourceWithStreamingResponse, -) from ...._resource import SyncAPIResource, AsyncAPIResource from .payload_logs import ( PayloadLogsResource, @@ -77,10 +69,6 @@ def patterns(self) -> PatternsResource: def payload_logs(self) -> PayloadLogsResource: return PayloadLogsResource(self._client) - @cached_property - def email(self) -> EmailResource: - return EmailResource(self._client) - @cached_property def profiles(self) -> ProfilesResource: return ProfilesResource(self._client) @@ -126,10 +114,6 @@ def patterns(self) -> AsyncPatternsResource: def payload_logs(self) -> AsyncPayloadLogsResource: return AsyncPayloadLogsResource(self._client) - @cached_property - def email(self) -> AsyncEmailResource: - return AsyncEmailResource(self._client) - @cached_property def profiles(self) -> AsyncProfilesResource: return AsyncProfilesResource(self._client) @@ -178,10 +162,6 @@ def patterns(self) -> PatternsResourceWithRawResponse: def payload_logs(self) -> PayloadLogsResourceWithRawResponse: return PayloadLogsResourceWithRawResponse(self._dlp.payload_logs) - @cached_property - def email(self) -> EmailResourceWithRawResponse: - return EmailResourceWithRawResponse(self._dlp.email) - @cached_property def profiles(self) -> ProfilesResourceWithRawResponse: return ProfilesResourceWithRawResponse(self._dlp.profiles) @@ -211,10 +191,6 @@ def patterns(self) -> AsyncPatternsResourceWithRawResponse: def payload_logs(self) -> AsyncPayloadLogsResourceWithRawResponse: return AsyncPayloadLogsResourceWithRawResponse(self._dlp.payload_logs) - @cached_property - def email(self) -> AsyncEmailResourceWithRawResponse: - return AsyncEmailResourceWithRawResponse(self._dlp.email) - @cached_property def profiles(self) -> AsyncProfilesResourceWithRawResponse: return AsyncProfilesResourceWithRawResponse(self._dlp.profiles) @@ -244,10 +220,6 @@ def patterns(self) -> PatternsResourceWithStreamingResponse: def payload_logs(self) -> PayloadLogsResourceWithStreamingResponse: return PayloadLogsResourceWithStreamingResponse(self._dlp.payload_logs) - @cached_property - def email(self) -> EmailResourceWithStreamingResponse: - return EmailResourceWithStreamingResponse(self._dlp.email) - @cached_property def profiles(self) -> ProfilesResourceWithStreamingResponse: return ProfilesResourceWithStreamingResponse(self._dlp.profiles) @@ -277,10 +249,6 @@ def patterns(self) -> AsyncPatternsResourceWithStreamingResponse: def payload_logs(self) -> AsyncPayloadLogsResourceWithStreamingResponse: return AsyncPayloadLogsResourceWithStreamingResponse(self._dlp.payload_logs) - @cached_property - def email(self) -> AsyncEmailResourceWithStreamingResponse: - return AsyncEmailResourceWithStreamingResponse(self._dlp.email) - @cached_property def profiles(self) -> AsyncProfilesResourceWithStreamingResponse: return AsyncProfilesResourceWithStreamingResponse(self._dlp.profiles) diff --git a/src/cloudflare/resources/zero_trust/dlp/email/__init__.py b/src/cloudflare/resources/zero_trust/dlp/email/__init__.py deleted file mode 100644 index bed0373f820..00000000000 --- a/src/cloudflare/resources/zero_trust/dlp/email/__init__.py +++ /dev/null @@ -1,47 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from .email import ( - EmailResource, - AsyncEmailResource, - EmailResourceWithRawResponse, - AsyncEmailResourceWithRawResponse, - EmailResourceWithStreamingResponse, - AsyncEmailResourceWithStreamingResponse, -) -from .rules import ( - RulesResource, - AsyncRulesResource, - RulesResourceWithRawResponse, - AsyncRulesResourceWithRawResponse, - RulesResourceWithStreamingResponse, - AsyncRulesResourceWithStreamingResponse, -) -from .account_mapping import ( - AccountMappingResource, - AsyncAccountMappingResource, - AccountMappingResourceWithRawResponse, - AsyncAccountMappingResourceWithRawResponse, - AccountMappingResourceWithStreamingResponse, - AsyncAccountMappingResourceWithStreamingResponse, -) - -__all__ = [ - "AccountMappingResource", - "AsyncAccountMappingResource", - "AccountMappingResourceWithRawResponse", - "AsyncAccountMappingResourceWithRawResponse", - "AccountMappingResourceWithStreamingResponse", - "AsyncAccountMappingResourceWithStreamingResponse", - "RulesResource", - "AsyncRulesResource", - "RulesResourceWithRawResponse", - "AsyncRulesResourceWithRawResponse", - "RulesResourceWithStreamingResponse", - "AsyncRulesResourceWithStreamingResponse", - "EmailResource", - "AsyncEmailResource", - "EmailResourceWithRawResponse", - "AsyncEmailResourceWithRawResponse", - "EmailResourceWithStreamingResponse", - "AsyncEmailResourceWithStreamingResponse", -] diff --git a/src/cloudflare/resources/zero_trust/dlp/email/email.py b/src/cloudflare/resources/zero_trust/dlp/email/email.py deleted file mode 100644 index 5a860e81a40..00000000000 --- a/src/cloudflare/resources/zero_trust/dlp/email/email.py +++ /dev/null @@ -1,134 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from .rules import ( - RulesResource, - AsyncRulesResource, - RulesResourceWithRawResponse, - AsyncRulesResourceWithRawResponse, - RulesResourceWithStreamingResponse, - AsyncRulesResourceWithStreamingResponse, -) -from ....._compat import cached_property -from ....._resource import SyncAPIResource, AsyncAPIResource -from .account_mapping import ( - AccountMappingResource, - AsyncAccountMappingResource, - AccountMappingResourceWithRawResponse, - AsyncAccountMappingResourceWithRawResponse, - AccountMappingResourceWithStreamingResponse, - AsyncAccountMappingResourceWithStreamingResponse, -) - -__all__ = ["EmailResource", "AsyncEmailResource"] - - -class EmailResource(SyncAPIResource): - @cached_property - def account_mapping(self) -> AccountMappingResource: - return AccountMappingResource(self._client) - - @cached_property - def rules(self) -> RulesResource: - return RulesResource(self._client) - - @cached_property - def with_raw_response(self) -> EmailResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return EmailResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> EmailResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return EmailResourceWithStreamingResponse(self) - - -class AsyncEmailResource(AsyncAPIResource): - @cached_property - def account_mapping(self) -> AsyncAccountMappingResource: - return AsyncAccountMappingResource(self._client) - - @cached_property - def rules(self) -> AsyncRulesResource: - return AsyncRulesResource(self._client) - - @cached_property - def with_raw_response(self) -> AsyncEmailResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncEmailResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncEmailResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncEmailResourceWithStreamingResponse(self) - - -class EmailResourceWithRawResponse: - def __init__(self, email: EmailResource) -> None: - self._email = email - - @cached_property - def account_mapping(self) -> AccountMappingResourceWithRawResponse: - return AccountMappingResourceWithRawResponse(self._email.account_mapping) - - @cached_property - def rules(self) -> RulesResourceWithRawResponse: - return RulesResourceWithRawResponse(self._email.rules) - - -class AsyncEmailResourceWithRawResponse: - def __init__(self, email: AsyncEmailResource) -> None: - self._email = email - - @cached_property - def account_mapping(self) -> AsyncAccountMappingResourceWithRawResponse: - return AsyncAccountMappingResourceWithRawResponse(self._email.account_mapping) - - @cached_property - def rules(self) -> AsyncRulesResourceWithRawResponse: - return AsyncRulesResourceWithRawResponse(self._email.rules) - - -class EmailResourceWithStreamingResponse: - def __init__(self, email: EmailResource) -> None: - self._email = email - - @cached_property - def account_mapping(self) -> AccountMappingResourceWithStreamingResponse: - return AccountMappingResourceWithStreamingResponse(self._email.account_mapping) - - @cached_property - def rules(self) -> RulesResourceWithStreamingResponse: - return RulesResourceWithStreamingResponse(self._email.rules) - - -class AsyncEmailResourceWithStreamingResponse: - def __init__(self, email: AsyncEmailResource) -> None: - self._email = email - - @cached_property - def account_mapping(self) -> AsyncAccountMappingResourceWithStreamingResponse: - return AsyncAccountMappingResourceWithStreamingResponse(self._email.account_mapping) - - @cached_property - def rules(self) -> AsyncRulesResourceWithStreamingResponse: - return AsyncRulesResourceWithStreamingResponse(self._email.rules) diff --git a/src/cloudflare/resources/zero_trust/dlp/email/rules.py b/src/cloudflare/resources/zero_trust/dlp/email/rules.py deleted file mode 100644 index 63906966157..00000000000 --- a/src/cloudflare/resources/zero_trust/dlp/email/rules.py +++ /dev/null @@ -1,701 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Type, Iterable, Optional, cast - -import httpx - -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ....._utils import ( - maybe_transform, - async_maybe_transform, -) -from ....._compat import cached_property -from ....._resource import SyncAPIResource, AsyncAPIResource -from ....._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ....._wrappers import ResultWrapper -from .....pagination import SyncSinglePage, AsyncSinglePage -from ....._base_client import AsyncPaginator, make_request_options -from .....types.zero_trust.dlp.email import rule_create_params, rule_update_params, rule_bulk_edit_params -from .....types.zero_trust.dlp.email.rule_get_response import RuleGetResponse -from .....types.zero_trust.dlp.email.rule_list_response import RuleListResponse -from .....types.zero_trust.dlp.email.rule_create_response import RuleCreateResponse -from .....types.zero_trust.dlp.email.rule_delete_response import RuleDeleteResponse -from .....types.zero_trust.dlp.email.rule_update_response import RuleUpdateResponse -from .....types.zero_trust.dlp.email.rule_bulk_edit_response import RuleBulkEditResponse - -__all__ = ["RulesResource", "AsyncRulesResource"] - - -class RulesResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> RulesResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return RulesResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> RulesResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return RulesResourceWithStreamingResponse(self) - - def create( - self, - *, - account_id: str, - action: rule_create_params.Action, - conditions: Iterable[rule_create_params.Condition], - enabled: bool, - name: str, - description: Optional[str] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleCreateResponse]: - """ - Create email scanner rule - - Args: - conditions: Rule is triggered if all conditions match - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._post( - f"/accounts/{account_id}/dlp/email/rules", - body=maybe_transform( - { - "action": action, - "conditions": conditions, - "enabled": enabled, - "name": name, - "description": description, - }, - rule_create_params.RuleCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleCreateResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[RuleCreateResponse]], ResultWrapper[RuleCreateResponse]), - ) - - def update( - self, - rule_id: str, - *, - account_id: str, - action: rule_update_params.Action, - conditions: Iterable[rule_update_params.Condition], - enabled: bool, - name: str, - description: Optional[str] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleUpdateResponse]: - """ - Update email scanner rule - - Args: - conditions: Rule is triggered if all conditions match - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not rule_id: - raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") - return self._put( - f"/accounts/{account_id}/dlp/email/rules/{rule_id}", - body=maybe_transform( - { - "action": action, - "conditions": conditions, - "enabled": enabled, - "name": name, - "description": description, - }, - rule_update_params.RuleUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleUpdateResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[RuleUpdateResponse]], ResultWrapper[RuleUpdateResponse]), - ) - - def list( - self, - *, - account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[RuleListResponse]: - """ - Lists all email scanner rules for an account. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get_api_list( - f"/accounts/{account_id}/dlp/email/rules", - page=SyncSinglePage[RuleListResponse], - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - model=RuleListResponse, - ) - - def delete( - self, - rule_id: str, - *, - account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleDeleteResponse]: - """ - Delete email scanner rule - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not rule_id: - raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") - return self._delete( - f"/accounts/{account_id}/dlp/email/rules/{rule_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleDeleteResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[RuleDeleteResponse]], ResultWrapper[RuleDeleteResponse]), - ) - - def bulk_edit( - self, - *, - account_id: str, - new_priorities: Dict[str, int], - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleBulkEditResponse]: - """ - Update email scanner rule priorities - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._patch( - f"/accounts/{account_id}/dlp/email/rules", - body=maybe_transform({"new_priorities": new_priorities}, rule_bulk_edit_params.RuleBulkEditParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleBulkEditResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[RuleBulkEditResponse]], ResultWrapper[RuleBulkEditResponse]), - ) - - def get( - self, - rule_id: str, - *, - account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleGetResponse]: - """ - Get an email scanner rule - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not rule_id: - raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") - return self._get( - f"/accounts/{account_id}/dlp/email/rules/{rule_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleGetResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[RuleGetResponse]], ResultWrapper[RuleGetResponse]), - ) - - -class AsyncRulesResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncRulesResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncRulesResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncRulesResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncRulesResourceWithStreamingResponse(self) - - async def create( - self, - *, - account_id: str, - action: rule_create_params.Action, - conditions: Iterable[rule_create_params.Condition], - enabled: bool, - name: str, - description: Optional[str] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleCreateResponse]: - """ - Create email scanner rule - - Args: - conditions: Rule is triggered if all conditions match - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._post( - f"/accounts/{account_id}/dlp/email/rules", - body=await async_maybe_transform( - { - "action": action, - "conditions": conditions, - "enabled": enabled, - "name": name, - "description": description, - }, - rule_create_params.RuleCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleCreateResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[RuleCreateResponse]], ResultWrapper[RuleCreateResponse]), - ) - - async def update( - self, - rule_id: str, - *, - account_id: str, - action: rule_update_params.Action, - conditions: Iterable[rule_update_params.Condition], - enabled: bool, - name: str, - description: Optional[str] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleUpdateResponse]: - """ - Update email scanner rule - - Args: - conditions: Rule is triggered if all conditions match - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not rule_id: - raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") - return await self._put( - f"/accounts/{account_id}/dlp/email/rules/{rule_id}", - body=await async_maybe_transform( - { - "action": action, - "conditions": conditions, - "enabled": enabled, - "name": name, - "description": description, - }, - rule_update_params.RuleUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleUpdateResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[RuleUpdateResponse]], ResultWrapper[RuleUpdateResponse]), - ) - - def list( - self, - *, - account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[RuleListResponse, AsyncSinglePage[RuleListResponse]]: - """ - Lists all email scanner rules for an account. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get_api_list( - f"/accounts/{account_id}/dlp/email/rules", - page=AsyncSinglePage[RuleListResponse], - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - model=RuleListResponse, - ) - - async def delete( - self, - rule_id: str, - *, - account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleDeleteResponse]: - """ - Delete email scanner rule - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not rule_id: - raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") - return await self._delete( - f"/accounts/{account_id}/dlp/email/rules/{rule_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleDeleteResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[RuleDeleteResponse]], ResultWrapper[RuleDeleteResponse]), - ) - - async def bulk_edit( - self, - *, - account_id: str, - new_priorities: Dict[str, int], - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleBulkEditResponse]: - """ - Update email scanner rule priorities - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._patch( - f"/accounts/{account_id}/dlp/email/rules", - body=await async_maybe_transform( - {"new_priorities": new_priorities}, rule_bulk_edit_params.RuleBulkEditParams - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleBulkEditResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[RuleBulkEditResponse]], ResultWrapper[RuleBulkEditResponse]), - ) - - async def get( - self, - rule_id: str, - *, - account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleGetResponse]: - """ - Get an email scanner rule - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not rule_id: - raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") - return await self._get( - f"/accounts/{account_id}/dlp/email/rules/{rule_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleGetResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[RuleGetResponse]], ResultWrapper[RuleGetResponse]), - ) - - -class RulesResourceWithRawResponse: - def __init__(self, rules: RulesResource) -> None: - self._rules = rules - - self.create = to_raw_response_wrapper( - rules.create, - ) - self.update = to_raw_response_wrapper( - rules.update, - ) - self.list = to_raw_response_wrapper( - rules.list, - ) - self.delete = to_raw_response_wrapper( - rules.delete, - ) - self.bulk_edit = to_raw_response_wrapper( - rules.bulk_edit, - ) - self.get = to_raw_response_wrapper( - rules.get, - ) - - -class AsyncRulesResourceWithRawResponse: - def __init__(self, rules: AsyncRulesResource) -> None: - self._rules = rules - - self.create = async_to_raw_response_wrapper( - rules.create, - ) - self.update = async_to_raw_response_wrapper( - rules.update, - ) - self.list = async_to_raw_response_wrapper( - rules.list, - ) - self.delete = async_to_raw_response_wrapper( - rules.delete, - ) - self.bulk_edit = async_to_raw_response_wrapper( - rules.bulk_edit, - ) - self.get = async_to_raw_response_wrapper( - rules.get, - ) - - -class RulesResourceWithStreamingResponse: - def __init__(self, rules: RulesResource) -> None: - self._rules = rules - - self.create = to_streamed_response_wrapper( - rules.create, - ) - self.update = to_streamed_response_wrapper( - rules.update, - ) - self.list = to_streamed_response_wrapper( - rules.list, - ) - self.delete = to_streamed_response_wrapper( - rules.delete, - ) - self.bulk_edit = to_streamed_response_wrapper( - rules.bulk_edit, - ) - self.get = to_streamed_response_wrapper( - rules.get, - ) - - -class AsyncRulesResourceWithStreamingResponse: - def __init__(self, rules: AsyncRulesResource) -> None: - self._rules = rules - - self.create = async_to_streamed_response_wrapper( - rules.create, - ) - self.update = async_to_streamed_response_wrapper( - rules.update, - ) - self.list = async_to_streamed_response_wrapper( - rules.list, - ) - self.delete = async_to_streamed_response_wrapper( - rules.delete, - ) - self.bulk_edit = async_to_streamed_response_wrapper( - rules.bulk_edit, - ) - self.get = async_to_streamed_response_wrapper( - rules.get, - ) diff --git a/src/cloudflare/resources/zero_trust/gateway/configurations/configurations.py b/src/cloudflare/resources/zero_trust/gateway/configurations/configurations.py index 269e71f769f..4ebaf1a42d5 100755 --- a/src/cloudflare/resources/zero_trust/gateway/configurations/configurations.py +++ b/src/cloudflare/resources/zero_trust/gateway/configurations/configurations.py @@ -81,7 +81,7 @@ def update( Updates the current Zero Trust account configuration. Args: - settings: Account settings + settings: account settings. extra_headers: Send extra headers @@ -127,7 +127,7 @@ def edit( error if any collection of settings is not properly configured. Args: - settings: Account settings + settings: account settings. extra_headers: Send extra headers @@ -230,7 +230,7 @@ async def update( Updates the current Zero Trust account configuration. Args: - settings: Account settings + settings: account settings. extra_headers: Send extra headers @@ -278,7 +278,7 @@ async def edit( error if any collection of settings is not properly configured. Args: - settings: Account settings + settings: account settings. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/zero_trust/gateway/lists/lists.py b/src/cloudflare/resources/zero_trust/gateway/lists/lists.py index 324a7de6194..db84089871a 100644 --- a/src/cloudflare/resources/zero_trust/gateway/lists/lists.py +++ b/src/cloudflare/resources/zero_trust/gateway/lists/lists.py @@ -128,7 +128,6 @@ def update( account_id: str, name: str, description: str | NotGiven = NOT_GIVEN, - items: Iterable[GatewayItemParam] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -136,10 +135,8 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Optional[GatewayList]: - """Updates a configured Zero Trust list. - - Skips updating list items if not included - in the payload. + """ + Updates a configured Zero Trust list. Args: list_id: API Resource UUID tag. @@ -148,8 +145,6 @@ def update( description: The description of the list. - items: The items in the list. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -168,7 +163,6 @@ def update( { "name": name, "description": description, - "items": items, }, list_update_params.ListUpdateParams, ), @@ -452,7 +446,6 @@ async def update( account_id: str, name: str, description: str | NotGiven = NOT_GIVEN, - items: Iterable[GatewayItemParam] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -460,10 +453,8 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Optional[GatewayList]: - """Updates a configured Zero Trust list. - - Skips updating list items if not included - in the payload. + """ + Updates a configured Zero Trust list. Args: list_id: API Resource UUID tag. @@ -472,8 +463,6 @@ async def update( description: The description of the list. - items: The items in the list. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -492,7 +481,6 @@ async def update( { "name": name, "description": description, - "items": items, }, list_update_params.ListUpdateParams, ), diff --git a/src/cloudflare/resources/zero_trust/organizations/doh.py b/src/cloudflare/resources/zero_trust/organizations/doh.py index 70518bc0925..d16604fe4b7 100644 --- a/src/cloudflare/resources/zero_trust/organizations/doh.py +++ b/src/cloudflare/resources/zero_trust/organizations/doh.py @@ -52,7 +52,7 @@ def update( self, *, account_id: str, - doh_jwt_duration: str | NotGiven = NOT_GIVEN, + jwt_duration: str | NotGiven = NOT_GIVEN, service_token_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -67,7 +67,7 @@ def update( Args: account_id: Identifier - doh_jwt_duration: The duration the DoH JWT is valid for. Must be in the format `300ms` or `2h45m`. + jwt_duration: The duration the DoH JWT is valid for. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. Note that the maximum duration for this setting is the same as the key rotation period on the account. Default expiration is 24h @@ -88,7 +88,7 @@ def update( f"/accounts/{account_id}/access/organizations/doh", body=maybe_transform( { - "doh_jwt_duration": doh_jwt_duration, + "jwt_duration": jwt_duration, "service_token_id": service_token_id, }, doh_update_params.DOHUpdateParams, @@ -167,7 +167,7 @@ async def update( self, *, account_id: str, - doh_jwt_duration: str | NotGiven = NOT_GIVEN, + jwt_duration: str | NotGiven = NOT_GIVEN, service_token_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -182,7 +182,7 @@ async def update( Args: account_id: Identifier - doh_jwt_duration: The duration the DoH JWT is valid for. Must be in the format `300ms` or `2h45m`. + jwt_duration: The duration the DoH JWT is valid for. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. Note that the maximum duration for this setting is the same as the key rotation period on the account. Default expiration is 24h @@ -203,7 +203,7 @@ async def update( f"/accounts/{account_id}/access/organizations/doh", body=await async_maybe_transform( { - "doh_jwt_duration": doh_jwt_duration, + "jwt_duration": jwt_duration, "service_token_id": service_token_id, }, doh_update_params.DOHUpdateParams, diff --git a/src/cloudflare/resources/zones/holds.py b/src/cloudflare/resources/zones/holds.py index 50ff188a172..890ce0319b9 100644 --- a/src/cloudflare/resources/zones/holds.py +++ b/src/cloudflare/resources/zones/holds.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, cast +from typing import Type, Optional, cast import httpx @@ -20,7 +20,7 @@ async_to_streamed_response_wrapper, ) from ..._wrappers import ResultWrapper -from ...types.zones import hold_edit_params, hold_create_params, hold_delete_params +from ...types.zones import hold_create_params, hold_delete_params from ..._base_client import make_request_options from ...types.zones.zone_hold import ZoneHold @@ -105,7 +105,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZoneHold: + ) -> Optional[ZoneHold]: """ Stop enforcement of a zone hold on the zone, permanently or temporarily, allowing the creation and activation of zones with this zone's hostname. @@ -135,69 +135,9 @@ def delete( extra_body=extra_body, timeout=timeout, query=maybe_transform({"hold_after": hold_after}, hold_delete_params.HoldDeleteParams), - post_parser=ResultWrapper[ZoneHold]._unwrapper, + post_parser=ResultWrapper[Optional[ZoneHold]]._unwrapper, ), - cast_to=cast(Type[ZoneHold], ResultWrapper[ZoneHold]), - ) - - def edit( - self, - *, - zone_id: str, - hold_after: str | NotGiven = NOT_GIVEN, - include_subdomains: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZoneHold: - """ - Update the `hold_after` and/or `include_subdomains` values on an existing zone - hold. The hold is enabled if the `hold_after` date-time value is in the past. - - Args: - zone_id: Identifier - - hold_after: If `hold_after` is provided and future-dated, the hold will be temporarily - disabled, then automatically re-enabled by the system at the time specified in - this RFC3339-formatted timestamp. A past-dated `hold_after` value will have no - effect on an existing, enabled hold. Providing an empty string will set its - value to the current time. - - include_subdomains: If `true`, the zone hold will extend to block any subdomain of the given zone, - as well as SSL4SaaS Custom Hostnames. For example, a zone hold on a zone with - the hostname 'example.com' and include_subdomains=true will block 'example.com', - 'staging.example.com', 'api.staging.example.com', etc. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._patch( - f"/zones/{zone_id}/hold", - body=maybe_transform( - { - "hold_after": hold_after, - "include_subdomains": include_subdomains, - }, - hold_edit_params.HoldEditParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ZoneHold]._unwrapper, - ), - cast_to=cast(Type[ZoneHold], ResultWrapper[ZoneHold]), + cast_to=cast(Type[Optional[ZoneHold]], ResultWrapper[ZoneHold]), ) def get( @@ -321,7 +261,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZoneHold: + ) -> Optional[ZoneHold]: """ Stop enforcement of a zone hold on the zone, permanently or temporarily, allowing the creation and activation of zones with this zone's hostname. @@ -351,69 +291,9 @@ async def delete( extra_body=extra_body, timeout=timeout, query=await async_maybe_transform({"hold_after": hold_after}, hold_delete_params.HoldDeleteParams), - post_parser=ResultWrapper[ZoneHold]._unwrapper, + post_parser=ResultWrapper[Optional[ZoneHold]]._unwrapper, ), - cast_to=cast(Type[ZoneHold], ResultWrapper[ZoneHold]), - ) - - async def edit( - self, - *, - zone_id: str, - hold_after: str | NotGiven = NOT_GIVEN, - include_subdomains: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZoneHold: - """ - Update the `hold_after` and/or `include_subdomains` values on an existing zone - hold. The hold is enabled if the `hold_after` date-time value is in the past. - - Args: - zone_id: Identifier - - hold_after: If `hold_after` is provided and future-dated, the hold will be temporarily - disabled, then automatically re-enabled by the system at the time specified in - this RFC3339-formatted timestamp. A past-dated `hold_after` value will have no - effect on an existing, enabled hold. Providing an empty string will set its - value to the current time. - - include_subdomains: If `true`, the zone hold will extend to block any subdomain of the given zone, - as well as SSL4SaaS Custom Hostnames. For example, a zone hold on a zone with - the hostname 'example.com' and include_subdomains=true will block 'example.com', - 'staging.example.com', 'api.staging.example.com', etc. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._patch( - f"/zones/{zone_id}/hold", - body=await async_maybe_transform( - { - "hold_after": hold_after, - "include_subdomains": include_subdomains, - }, - hold_edit_params.HoldEditParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ZoneHold]._unwrapper, - ), - cast_to=cast(Type[ZoneHold], ResultWrapper[ZoneHold]), + cast_to=cast(Type[Optional[ZoneHold]], ResultWrapper[ZoneHold]), ) async def get( @@ -467,9 +347,6 @@ def __init__(self, holds: HoldsResource) -> None: self.delete = to_raw_response_wrapper( holds.delete, ) - self.edit = to_raw_response_wrapper( - holds.edit, - ) self.get = to_raw_response_wrapper( holds.get, ) @@ -485,9 +362,6 @@ def __init__(self, holds: AsyncHoldsResource) -> None: self.delete = async_to_raw_response_wrapper( holds.delete, ) - self.edit = async_to_raw_response_wrapper( - holds.edit, - ) self.get = async_to_raw_response_wrapper( holds.get, ) @@ -503,9 +377,6 @@ def __init__(self, holds: HoldsResource) -> None: self.delete = to_streamed_response_wrapper( holds.delete, ) - self.edit = to_streamed_response_wrapper( - holds.edit, - ) self.get = to_streamed_response_wrapper( holds.get, ) @@ -521,9 +392,6 @@ def __init__(self, holds: AsyncHoldsResource) -> None: self.delete = async_to_streamed_response_wrapper( holds.delete, ) - self.edit = async_to_streamed_response_wrapper( - holds.edit, - ) self.get = async_to_streamed_response_wrapper( holds.get, ) diff --git a/src/cloudflare/types/abuse_reports/__init__.py b/src/cloudflare/types/abuse_reports/__init__.py deleted file mode 100644 index c17465cb40c..00000000000 --- a/src/cloudflare/types/abuse_reports/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from .abuse_report_create_params import AbuseReportCreateParams as AbuseReportCreateParams -from .abuse_report_create_response import AbuseReportCreateResponse as AbuseReportCreateResponse diff --git a/src/cloudflare/types/abuse_reports/abuse_report_create_params.py b/src/cloudflare/types/abuse_reports/abuse_report_create_params.py deleted file mode 100644 index ff19f93f7c5..00000000000 --- a/src/cloudflare/types/abuse_reports/abuse_report_create_params.py +++ /dev/null @@ -1,140 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, TypedDict - -__all__ = ["AbuseReportCreateParams"] - - -class AbuseReportCreateParams(TypedDict, total=False): - account_id: Required[str] - - act: Required[ - Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ] - ] - """The abuse report type""" - - email: Required[str] - """A valid email of the abuse reporter""" - - email2: Required[str] - """Should match the value provided in `email`""" - - host_notification: Required[Literal["send", "send-anon", "none"]] - """Notification type based on the abuse type. - - NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. - """ - - ncmec_notification: Required[Literal["send", "send-anon", "none"]] - """Notification type based on the abuse type. - - NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. - """ - - owner_notification: Required[Literal["send", "send-anon", "none"]] - """Notification type based on the abuse type. - - NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. - """ - - urls: Required[str] - """A list of valid URLs separated by ‘ ’ (new line character). - - The list of the URLs should not exceed 250 URLs. All URLs should have the same - hostname. Each URL should be unique - """ - - address1: str - """Text not exceeding 100 characters""" - - agent_name: str - """The name of the copyright holder. Text not exceeding 60 characters.""" - - agree: Literal[0, 1] - """Can be 0 or 1""" - - city: str - """Text not exceeding 255 characters""" - - comments: str - """Any additional comments about the infringement not exceeding 2000 characters""" - - company: str - """Text not exceeding 100 characters""" - - country: str - """Text not exceeding 255 characters""" - - destination_ips: str - """A list of IP addresses separated by ‘ ’ (new line character). - - The list of destination IPs should not exceed 30 IP addresses. Each one of the - IP addresses ought to be unique - """ - - justification: str - """ - A detailed description of the infringement, including any necessary access - details and the exact steps needed to view the content, not exceeding 5000 - characters - """ - - name: str - """Text not exceeding 255 characters""" - - ncsei_subject_representation: bool - """If the submitter is the target of NCSEI in the URLs of the abuse report""" - - original_work: str - """Text not exceeding 255 characters""" - - ports_protocols: str - """A comma separated list of ports and protocols e.g. - - 80/TCP, 22/UDP. The total size of the field should not exceed 2000 characters. - Each individual port/protocol should not exceed 100 characters. The list should - not have more than 30 unique ports and protocols. - """ - - signature: str - """Required for DMCA reports, should be same as Name. - - An affirmation that all information in the report is true and accurate while - agreeing to the policies of Cloudflare's abuse reports - """ - - source_ips: str - """A list of IP addresses separated by ‘ ’ (new line character). - - The list of source IPs should not exceed 30 IP addresses. Each one of the IP - addresses ought to be unique - """ - - state: str - """Text not exceeding 255 characters""" - - tele: str - """Text not exceeding 20 characters""" - - title: str - """Text not exceeding 255 characters""" - - trademark_number: str - """Text not exceeding 1000 characters""" - - trademark_office: str - """Text not exceeding 1000 characters""" - - trademark_symbol: str - """Text not exceeding 1000 characters""" diff --git a/src/cloudflare/types/abuse_reports/abuse_report_create_response.py b/src/cloudflare/types/abuse_reports/abuse_report_create_response.py deleted file mode 100644 index 03fc4011e68..00000000000 --- a/src/cloudflare/types/abuse_reports/abuse_report_create_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["AbuseReportCreateResponse"] - -AbuseReportCreateResponse: TypeAlias = str diff --git a/src/cloudflare/types/accounts/logs/__init__.py b/src/cloudflare/types/accounts/logs/__init__.py deleted file mode 100644 index 4db884733b2..00000000000 --- a/src/cloudflare/types/accounts/logs/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from .audit_list_params import AuditListParams as AuditListParams -from .audit_list_response import AuditListResponse as AuditListResponse diff --git a/src/cloudflare/types/accounts/logs/audit_list_params.py b/src/cloudflare/types/accounts/logs/audit_list_params.py deleted file mode 100644 index 0d0bd685341..00000000000 --- a/src/cloudflare/types/accounts/logs/audit_list_params.py +++ /dev/null @@ -1,115 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from datetime import date -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ...._utils import PropertyInfo - -__all__ = ["AuditListParams"] - - -class AuditListParams(TypedDict, total=False): - account_id: Required[str] - """The unique id that identifies the account.""" - - before: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] - """ - Filters actions based on a given timestamp in the format yyyy-mm-dd, returning - only logs that occurred on and before the specified date. - """ - - since: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] - """ - Filters actions based on a given timestamp in the format yyyy-mm-dd, returning - only logs that occurred on and after the specified date. - """ - - account_name: str - """Filters by the account name.""" - - action_result: Literal["success", "failure"] - """Whether the action was successful or not.""" - - action_type: Literal["create", "delete", "view", "update"] - """Filters by the action type.""" - - actor_context: Literal["api_key", "api_token", "dash", "oauth", "origin_ca_key"] - """Filters by the actor context.""" - - actor_email: str - """Filters by the actor's email address.""" - - actor_id: str - """Filters by the actor ID. This can be either the Account ID or User ID.""" - - actor_ip_address: str - """The IP address where the action was initiated.""" - - actor_token_id: str - """Filters by the API token ID when the actor context is an api_token or oauth.""" - - actor_token_name: str - """Filters by the API token name when the actor context is an api_token or oauth.""" - - actor_type: Literal["cloudflare_admin", "account", "user"] - """Filters by the actor type.""" - - audit_log_id: str - """Finds a specific log by its ID.""" - - cursor: str - """The cursor is an opaque token used to paginate through large sets of records. - - It indicates the position from which to continue when requesting the next set of - records. A valid cursor value can be obtained from the cursor object in the - result_info structure of a previous response. - """ - - direction: Literal["desc", "asc"] - """Sets sorting order.""" - - limit: float - """The number limits the objects to return. - - The cursor attribute may be used to iterate over the next batch of objects if - there are more than the limit. - """ - - raw_cf_rayid: Annotated[str, PropertyInfo(alias="raw_cf_ray_id")] - """Filters by the response CF Ray ID.""" - - raw_method: str - """The HTTP method for the API call.""" - - raw_status_code: int - """The response status code that was returned.""" - - raw_uri: str - """Filters by the request URI.""" - - resource_id: str - """Filters by the resource ID.""" - - resource_product: str - """ - Filters audit logs by the Cloudflare product associated with the changed - resource. - """ - - resource_scope: Literal["accounts", "user", "zones"] - """ - Filters by the resource scope, specifying whether the resource is associated - with an user, an account, or a zone. - """ - - resource_type: str - """Filters audit logs based on the unique type of resource changed by the action.""" - - zone_id: str - """Filters by the zone ID.""" - - zone_name: str - """Filters by the zone name associated with the change.""" diff --git a/src/cloudflare/types/accounts/logs/audit_list_response.py b/src/cloudflare/types/accounts/logs/audit_list_response.py deleted file mode 100644 index ec2281163c6..00000000000 --- a/src/cloudflare/types/accounts/logs/audit_list_response.py +++ /dev/null @@ -1,124 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime -from typing_extensions import Literal - -from pydantic import Field as FieldInfo - -from ...._models import BaseModel - -__all__ = ["AuditListResponse", "Account", "Action", "Actor", "Raw", "Resource", "Zone"] - - -class Account(BaseModel): - id: Optional[str] = None - """A unique identifier for the account.""" - - name: Optional[str] = None - """A string that identifies the account name.""" - - -class Action(BaseModel): - description: Optional[str] = None - """A short description of the action performed.""" - - result: Optional[str] = None - """The result of the action, indicating success or failure.""" - - time: Optional[datetime] = None - """A timestamp indicating when the action was logged.""" - - type: Optional[str] = None - """A short string that describes the action that was performed.""" - - -class Actor(BaseModel): - id: Optional[str] = None - """The ID of the actor who performed the action. - - If a user performed the action, this will be their User ID. - """ - - context: Optional[Literal["api_key", "api_token", "dash", "oauth", "origin_ca_key"]] = None - - email: Optional[str] = None - """The email of the actor who performed the action.""" - - ip_address: Optional[str] = None - """The IP address of the request that performed the action.""" - - token_id: Optional[str] = None - """Filters by the API token ID when the actor context is an api_token.""" - - token_name: Optional[str] = None - """Filters by the API token name when the actor context is an api_token.""" - - type: Optional[Literal["user", "account", "cloudflare-admin"]] = None - """The type of actor.""" - - -class Raw(BaseModel): - cf_rayid: Optional[str] = FieldInfo(alias="cf_ray_id", default=None) - """The Cloudflare Ray ID for the request.""" - - method: Optional[str] = None - """The HTTP method of the request.""" - - status_code: Optional[int] = None - """The HTTP response status code returned by the API.""" - - uri: Optional[str] = None - """The URI of the request.""" - - user_agent: Optional[str] = None - """The client's user agent string sent with the request.""" - - -class Resource(BaseModel): - id: Optional[str] = None - """The unique identifier for the affected resource.""" - - product: Optional[str] = None - """The Cloudflare product associated with the resource.""" - - request: Optional[object] = None - - response: Optional[object] = None - - scope: Optional[object] = None - """The scope of the resource.""" - - type: Optional[str] = None - """The type of the resource.""" - - -class Zone(BaseModel): - id: Optional[str] = None - """A string that identifies the zone id.""" - - name: Optional[str] = None - """A string that identifies the zone name.""" - - -class AuditListResponse(BaseModel): - id: Optional[str] = None - """A unique identifier for the audit log entry.""" - - account: Optional[Account] = None - """Contains account related information.""" - - action: Optional[Action] = None - """Provides information about the action performed.""" - - actor: Optional[Actor] = None - """Provides details about the actor who performed the action.""" - - raw: Optional[Raw] = None - """Provides raw information about the request and response.""" - - resource: Optional[Resource] = None - """Provides details about the affected resource.""" - - zone: Optional[Zone] = None - """Provides details about the zone affected by the action.""" diff --git a/src/cloudflare/types/accounts/token_create_params.py b/src/cloudflare/types/accounts/token_create_params.py index e94512a93f9..aca51228744 100644 --- a/src/cloudflare/types/accounts/token_create_params.py +++ b/src/cloudflare/types/accounts/token_create_params.py @@ -50,5 +50,5 @@ class ConditionRequestIP(_ConditionRequestIPReservedKeywords, total=False): class Condition(TypedDict, total=False): - request_ip: ConditionRequestIP + request_ip: Annotated[ConditionRequestIP, PropertyInfo(alias="request.ip")] """Client IP restrictions.""" diff --git a/src/cloudflare/types/accounts/token_create_response.py b/src/cloudflare/types/accounts/token_create_response.py index baad5983f71..cfc75aba10c 100644 --- a/src/cloudflare/types/accounts/token_create_response.py +++ b/src/cloudflare/types/accounts/token_create_response.py @@ -23,7 +23,7 @@ class ConditionRequestIP(BaseModel): class Condition(BaseModel): - request_ip: Optional[ConditionRequestIP] = None + request_ip: Optional[ConditionRequestIP] = FieldInfo(alias="request.ip", default=None) """Client IP restrictions.""" diff --git a/src/cloudflare/types/accounts/token_update_params.py b/src/cloudflare/types/accounts/token_update_params.py index bec89b38118..1968327cffa 100644 --- a/src/cloudflare/types/accounts/token_update_params.py +++ b/src/cloudflare/types/accounts/token_update_params.py @@ -53,5 +53,5 @@ class ConditionRequestIP(_ConditionRequestIPReservedKeywords, total=False): class Condition(TypedDict, total=False): - request_ip: ConditionRequestIP + request_ip: Annotated[ConditionRequestIP, PropertyInfo(alias="request.ip")] """Client IP restrictions.""" diff --git a/src/cloudflare/types/addressing/address_map.py b/src/cloudflare/types/addressing/address_map.py index 1ff0f0ab4f2..dff7660e50c 100644 --- a/src/cloudflare/types/addressing/address_map.py +++ b/src/cloudflare/types/addressing/address_map.py @@ -10,7 +10,7 @@ class AddressMap(BaseModel): id: Optional[str] = None - """Identifier of an Address Map.""" + """Identifier""" can_delete: Optional[bool] = None """If set to false, then the Address Map cannot be deleted via API. diff --git a/src/cloudflare/types/addressing/address_map_create_params.py b/src/cloudflare/types/addressing/address_map_create_params.py index bef1dcc72a9..ac313102d61 100644 --- a/src/cloudflare/types/addressing/address_map_create_params.py +++ b/src/cloudflare/types/addressing/address_map_create_params.py @@ -12,7 +12,7 @@ class AddressMapCreateParams(TypedDict, total=False): account_id: Required[str] - """Identifier of a Cloudflare account.""" + """Identifier""" description: Optional[str] """ diff --git a/src/cloudflare/types/addressing/address_map_create_response.py b/src/cloudflare/types/addressing/address_map_create_response.py index 08303310e4e..032e1166d18 100644 --- a/src/cloudflare/types/addressing/address_map_create_response.py +++ b/src/cloudflare/types/addressing/address_map_create_response.py @@ -31,7 +31,7 @@ class Membership(BaseModel): class AddressMapCreateResponse(BaseModel): id: Optional[str] = None - """Identifier of an Address Map.""" + """Identifier""" can_delete: Optional[bool] = None """If set to false, then the Address Map cannot be deleted via API. diff --git a/src/cloudflare/types/addressing/address_map_edit_params.py b/src/cloudflare/types/addressing/address_map_edit_params.py index 78a94270693..5d91c15dab3 100644 --- a/src/cloudflare/types/addressing/address_map_edit_params.py +++ b/src/cloudflare/types/addressing/address_map_edit_params.py @@ -10,7 +10,7 @@ class AddressMapEditParams(TypedDict, total=False): account_id: Required[str] - """Identifier of a Cloudflare account.""" + """Identifier""" default_sni: Optional[str] """ diff --git a/src/cloudflare/types/addressing/address_map_get_response.py b/src/cloudflare/types/addressing/address_map_get_response.py index 2eda9977d94..0eb306ccdbd 100644 --- a/src/cloudflare/types/addressing/address_map_get_response.py +++ b/src/cloudflare/types/addressing/address_map_get_response.py @@ -31,7 +31,7 @@ class Membership(BaseModel): class AddressMapGetResponse(BaseModel): id: Optional[str] = None - """Identifier of an Address Map.""" + """Identifier""" can_delete: Optional[bool] = None """If set to false, then the Address Map cannot be deleted via API. diff --git a/src/cloudflare/types/addressing/address_maps/account_update_params.py b/src/cloudflare/types/addressing/address_maps/account_update_params.py index ff618f7f917..f06483675c1 100644 --- a/src/cloudflare/types/addressing/address_maps/account_update_params.py +++ b/src/cloudflare/types/addressing/address_maps/account_update_params.py @@ -9,6 +9,6 @@ class AccountUpdateParams(TypedDict, total=False): account_id: Required[str] - """Identifier of a Cloudflare account.""" + """Identifier""" body: Required[object] diff --git a/src/cloudflare/types/addressing/address_maps/ip_update_params.py b/src/cloudflare/types/addressing/address_maps/ip_update_params.py index 7c4e1611411..41cd04d50b1 100644 --- a/src/cloudflare/types/addressing/address_maps/ip_update_params.py +++ b/src/cloudflare/types/addressing/address_maps/ip_update_params.py @@ -9,9 +9,9 @@ class IPUpdateParams(TypedDict, total=False): account_id: Required[str] - """Identifier of a Cloudflare account.""" + """Identifier""" address_map_id: Required[str] - """Identifier of an Address Map.""" + """Identifier""" body: Required[object] diff --git a/src/cloudflare/types/addressing/address_maps/zone_update_params.py b/src/cloudflare/types/addressing/address_maps/zone_update_params.py index 04047f85fc0..3cd7060a7ed 100644 --- a/src/cloudflare/types/addressing/address_maps/zone_update_params.py +++ b/src/cloudflare/types/addressing/address_maps/zone_update_params.py @@ -9,9 +9,9 @@ class ZoneUpdateParams(TypedDict, total=False): zone_id: Required[str] - """Identifier of a zone.""" + """Identifier""" account_id: Required[str] - """Identifier of a Cloudflare account.""" + """Identifier""" body: Required[object] diff --git a/src/cloudflare/types/addressing/loa_document_create_params.py b/src/cloudflare/types/addressing/loa_document_create_params.py index 3ea6bd6de69..4f8da69a2a5 100644 --- a/src/cloudflare/types/addressing/loa_document_create_params.py +++ b/src/cloudflare/types/addressing/loa_document_create_params.py @@ -9,7 +9,7 @@ class LOADocumentCreateParams(TypedDict, total=False): account_id: Required[str] - """Identifier of a Cloudflare account.""" + """Identifier""" loa_document: Required[str] """LOA document to upload.""" diff --git a/src/cloudflare/types/addressing/loa_document_create_response.py b/src/cloudflare/types/addressing/loa_document_create_response.py index dd84b6a3b39..915d2b130c4 100644 --- a/src/cloudflare/types/addressing/loa_document_create_response.py +++ b/src/cloudflare/types/addressing/loa_document_create_response.py @@ -13,7 +13,7 @@ class LOADocumentCreateResponse(BaseModel): """Identifier for the uploaded LOA document.""" account_id: Optional[str] = None - """Identifier of a Cloudflare account.""" + """Identifier""" created: Optional[datetime] = None diff --git a/tests/api_resources/zero_trust/dlp/email/__init__.py b/src/cloudflare/types/addressing/loa_documents/__init__.py similarity index 70% rename from tests/api_resources/zero_trust/dlp/email/__init__.py rename to src/cloudflare/types/addressing/loa_documents/__init__.py index fd8019a9a1a..f8ee8b14b1c 100644 --- a/tests/api_resources/zero_trust/dlp/email/__init__.py +++ b/src/cloudflare/types/addressing/loa_documents/__init__.py @@ -1 +1,3 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations diff --git a/src/cloudflare/types/addressing/prefix.py b/src/cloudflare/types/addressing/prefix.py index 7a680d672f4..9dd12947704 100644 --- a/src/cloudflare/types/addressing/prefix.py +++ b/src/cloudflare/types/addressing/prefix.py @@ -10,10 +10,10 @@ class Prefix(BaseModel): id: Optional[str] = None - """Identifier of an IP Prefix.""" + """Identifier""" account_id: Optional[str] = None - """Identifier of a Cloudflare account.""" + """Identifier""" advertised: Optional[bool] = None """Prefix advertisement status to the Internet. diff --git a/src/cloudflare/types/addressing/prefix_create_params.py b/src/cloudflare/types/addressing/prefix_create_params.py index b2d40ba7d01..edbe51ebcf4 100644 --- a/src/cloudflare/types/addressing/prefix_create_params.py +++ b/src/cloudflare/types/addressing/prefix_create_params.py @@ -10,7 +10,7 @@ class PrefixCreateParams(TypedDict, total=False): account_id: Required[str] - """Identifier of a Cloudflare account.""" + """Identifier""" asn: Required[Optional[int]] """Autonomous System Number (ASN) the prefix will be advertised under.""" diff --git a/src/cloudflare/types/addressing/prefix_edit_params.py b/src/cloudflare/types/addressing/prefix_edit_params.py index b1ad60bb46f..9f4b08a8b40 100644 --- a/src/cloudflare/types/addressing/prefix_edit_params.py +++ b/src/cloudflare/types/addressing/prefix_edit_params.py @@ -9,7 +9,7 @@ class PrefixEditParams(TypedDict, total=False): account_id: Required[str] - """Identifier of a Cloudflare account.""" + """Identifier""" description: Required[str] """Description of the prefix.""" diff --git a/src/cloudflare/types/addressing/prefixes/__init__.py b/src/cloudflare/types/addressing/prefixes/__init__.py index 70970ffbada..3f5ae7763da 100644 --- a/src/cloudflare/types/addressing/prefixes/__init__.py +++ b/src/cloudflare/types/addressing/prefixes/__init__.py @@ -2,15 +2,6 @@ from __future__ import annotations -from .bgp_prefix import BGPPrefix as BGPPrefix from .delegations import Delegations as Delegations -from .service_binding import ServiceBinding as ServiceBinding -from .bgp_prefix_edit_params import BGPPrefixEditParams as BGPPrefixEditParams -from .bgp_prefix_create_params import BGPPrefixCreateParams as BGPPrefixCreateParams from .delegation_create_params import DelegationCreateParams as DelegationCreateParams from .delegation_delete_response import DelegationDeleteResponse as DelegationDeleteResponse -from .service_binding_create_params import ServiceBindingCreateParams as ServiceBindingCreateParams -from .service_binding_delete_response import ServiceBindingDeleteResponse as ServiceBindingDeleteResponse -from .advertisement_status_edit_params import AdvertisementStatusEditParams as AdvertisementStatusEditParams -from .advertisement_status_get_response import AdvertisementStatusGetResponse as AdvertisementStatusGetResponse -from .advertisement_status_edit_response import AdvertisementStatusEditResponse as AdvertisementStatusEditResponse diff --git a/src/cloudflare/types/addressing/prefixes/advertisement_status_edit_params.py b/src/cloudflare/types/addressing/prefixes/advertisement_status_edit_params.py deleted file mode 100644 index 5de84a7f1d0..00000000000 --- a/src/cloudflare/types/addressing/prefixes/advertisement_status_edit_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["AdvertisementStatusEditParams"] - - -class AdvertisementStatusEditParams(TypedDict, total=False): - account_id: Required[str] - """Identifier of a Cloudflare account.""" - - advertised: Required[bool] - """Advertisement status of the prefix. - - If `true`, the BGP route for the prefix is advertised to the Internet. If - `false`, the BGP route is withdrawn. - """ diff --git a/src/cloudflare/types/addressing/prefixes/bgp/__init__.py b/src/cloudflare/types/addressing/prefixes/bgp/__init__.py new file mode 100644 index 00000000000..bf70ca01135 --- /dev/null +++ b/src/cloudflare/types/addressing/prefixes/bgp/__init__.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .bgp_prefix import BGPPrefix as BGPPrefix +from .service_binding import ServiceBinding as ServiceBinding +from .prefix_edit_params import PrefixEditParams as PrefixEditParams +from .status_edit_params import StatusEditParams as StatusEditParams +from .status_get_response import StatusGetResponse as StatusGetResponse +from .status_edit_response import StatusEditResponse as StatusEditResponse +from .binding_create_params import BindingCreateParams as BindingCreateParams +from .binding_delete_response import BindingDeleteResponse as BindingDeleteResponse diff --git a/src/cloudflare/types/addressing/prefixes/bgp_prefix.py b/src/cloudflare/types/addressing/prefixes/bgp/bgp_prefix.py similarity index 96% rename from src/cloudflare/types/addressing/prefixes/bgp_prefix.py rename to src/cloudflare/types/addressing/prefixes/bgp/bgp_prefix.py index e58c9ebdd33..d9eecdf9d89 100644 --- a/src/cloudflare/types/addressing/prefixes/bgp_prefix.py +++ b/src/cloudflare/types/addressing/prefixes/bgp/bgp_prefix.py @@ -3,7 +3,7 @@ from typing import Optional from datetime import datetime -from ...._models import BaseModel +from ....._models import BaseModel __all__ = ["BGPPrefix", "BGPSignalOpts", "OnDemand"] @@ -50,7 +50,7 @@ class OnDemand(BaseModel): class BGPPrefix(BaseModel): id: Optional[str] = None - """Identifier of BGP Prefix.""" + """Identifier""" asn: Optional[int] = None """Autonomous System Number (ASN) the prefix will be advertised under.""" diff --git a/src/cloudflare/types/addressing/prefixes/bgp_prefix_create_params.py b/src/cloudflare/types/addressing/prefixes/bgp/binding_create_params.py similarity index 65% rename from src/cloudflare/types/addressing/prefixes/bgp_prefix_create_params.py rename to src/cloudflare/types/addressing/prefixes/bgp/binding_create_params.py index 387be0b879f..d4b3604ae77 100644 --- a/src/cloudflare/types/addressing/prefixes/bgp_prefix_create_params.py +++ b/src/cloudflare/types/addressing/prefixes/bgp/binding_create_params.py @@ -4,12 +4,15 @@ from typing_extensions import Required, TypedDict -__all__ = ["BGPPrefixCreateParams"] +__all__ = ["BindingCreateParams"] -class BGPPrefixCreateParams(TypedDict, total=False): +class BindingCreateParams(TypedDict, total=False): account_id: Required[str] - """Identifier of a Cloudflare account.""" + """Identifier""" cidr: str """IP Prefix in Classless Inter-Domain Routing format.""" + + service_id: str + """Identifier""" diff --git a/src/cloudflare/types/workers/route_create_response.py b/src/cloudflare/types/addressing/prefixes/bgp/binding_delete_response.py similarity index 64% rename from src/cloudflare/types/workers/route_create_response.py rename to src/cloudflare/types/addressing/prefixes/bgp/binding_delete_response.py index 9e27967d480..9746074b34a 100644 --- a/src/cloudflare/types/workers/route_create_response.py +++ b/src/cloudflare/types/addressing/prefixes/bgp/binding_delete_response.py @@ -3,13 +3,13 @@ from typing import List from typing_extensions import Literal -from ..._models import BaseModel -from ..shared.response_info import ResponseInfo +from ....._models import BaseModel +from ....shared.response_info import ResponseInfo -__all__ = ["RouteCreateResponse"] +__all__ = ["BindingDeleteResponse"] -class RouteCreateResponse(BaseModel): +class BindingDeleteResponse(BaseModel): errors: List[ResponseInfo] messages: List[ResponseInfo] diff --git a/src/cloudflare/types/addressing/prefixes/bgp_prefix_edit_params.py b/src/cloudflare/types/addressing/prefixes/bgp/prefix_edit_params.py similarity index 64% rename from src/cloudflare/types/addressing/prefixes/bgp_prefix_edit_params.py rename to src/cloudflare/types/addressing/prefixes/bgp/prefix_edit_params.py index 5822fc5a307..5040a427e1f 100644 --- a/src/cloudflare/types/addressing/prefixes/bgp_prefix_edit_params.py +++ b/src/cloudflare/types/addressing/prefixes/bgp/prefix_edit_params.py @@ -4,15 +4,15 @@ from typing_extensions import Required, TypedDict -__all__ = ["BGPPrefixEditParams", "OnDemand"] +__all__ = ["PrefixEditParams", "OnDemand"] -class BGPPrefixEditParams(TypedDict, total=False): +class PrefixEditParams(TypedDict, total=False): account_id: Required[str] - """Identifier of a Cloudflare account.""" + """Identifier""" prefix_id: Required[str] - """Identifier of an IP Prefix.""" + """Identifier""" on_demand: OnDemand diff --git a/src/cloudflare/types/addressing/prefixes/service_binding.py b/src/cloudflare/types/addressing/prefixes/bgp/service_binding.py similarity index 79% rename from src/cloudflare/types/addressing/prefixes/service_binding.py rename to src/cloudflare/types/addressing/prefixes/bgp/service_binding.py index 34bbeabd065..505f89b7c2e 100644 --- a/src/cloudflare/types/addressing/prefixes/service_binding.py +++ b/src/cloudflare/types/addressing/prefixes/bgp/service_binding.py @@ -3,7 +3,7 @@ from typing import Optional from typing_extensions import Literal -from ...._models import BaseModel +from ....._models import BaseModel __all__ = ["ServiceBinding", "Provisioning"] @@ -18,7 +18,7 @@ class Provisioning(BaseModel): class ServiceBinding(BaseModel): id: Optional[str] = None - """Identifier of a Service Binding.""" + """Identifier""" cidr: Optional[str] = None """IP Prefix in Classless Inter-Domain Routing format.""" @@ -27,10 +27,7 @@ class ServiceBinding(BaseModel): """Status of a Service Binding's deployment to the Cloudflare network""" service_id: Optional[str] = None - """Identifier of a Service on the Cloudflare network. - - Available services and their IDs may be found in the **List Services** endpoint. - """ + """Identifier""" service_name: Optional[str] = None """Name of a service running on the Cloudflare network""" diff --git a/src/cloudflare/types/ai/finetunes/asset_create_params.py b/src/cloudflare/types/addressing/prefixes/bgp/status_edit_params.py similarity index 51% rename from src/cloudflare/types/ai/finetunes/asset_create_params.py rename to src/cloudflare/types/addressing/prefixes/bgp/status_edit_params.py index 26f0da33305..10f8c1cf7b3 100644 --- a/src/cloudflare/types/ai/finetunes/asset_create_params.py +++ b/src/cloudflare/types/addressing/prefixes/bgp/status_edit_params.py @@ -4,14 +4,12 @@ from typing_extensions import Required, TypedDict -from ...._types import FileTypes +__all__ = ["StatusEditParams"] -__all__ = ["AssetCreateParams"] - -class AssetCreateParams(TypedDict, total=False): +class StatusEditParams(TypedDict, total=False): account_id: Required[str] + """Identifier""" - file: FileTypes - - file_name: str + advertised: Required[bool] + """Enablement of prefix advertisement to the Internet.""" diff --git a/src/cloudflare/types/addressing/prefixes/advertisement_status_get_response.py b/src/cloudflare/types/addressing/prefixes/bgp/status_edit_response.py similarity index 54% rename from src/cloudflare/types/addressing/prefixes/advertisement_status_get_response.py rename to src/cloudflare/types/addressing/prefixes/bgp/status_edit_response.py index 86260979361..f67cfc5baef 100644 --- a/src/cloudflare/types/addressing/prefixes/advertisement_status_get_response.py +++ b/src/cloudflare/types/addressing/prefixes/bgp/status_edit_response.py @@ -3,18 +3,14 @@ from typing import Optional from datetime import datetime -from ...._models import BaseModel +from ....._models import BaseModel -__all__ = ["AdvertisementStatusGetResponse"] +__all__ = ["StatusEditResponse"] -class AdvertisementStatusGetResponse(BaseModel): +class StatusEditResponse(BaseModel): advertised: Optional[bool] = None - """Advertisement status of the prefix. - - If `true`, the BGP route for the prefix is advertised to the Internet. If - `false`, the BGP route is withdrawn. - """ + """Enablement of prefix advertisement to the Internet.""" advertised_modified_at: Optional[datetime] = None """Last time the advertisement status was changed. diff --git a/src/cloudflare/types/addressing/prefixes/advertisement_status_edit_response.py b/src/cloudflare/types/addressing/prefixes/bgp/status_get_response.py similarity index 54% rename from src/cloudflare/types/addressing/prefixes/advertisement_status_edit_response.py rename to src/cloudflare/types/addressing/prefixes/bgp/status_get_response.py index 3c32d04dfcd..a6012cb77de 100644 --- a/src/cloudflare/types/addressing/prefixes/advertisement_status_edit_response.py +++ b/src/cloudflare/types/addressing/prefixes/bgp/status_get_response.py @@ -3,18 +3,14 @@ from typing import Optional from datetime import datetime -from ...._models import BaseModel +from ....._models import BaseModel -__all__ = ["AdvertisementStatusEditResponse"] +__all__ = ["StatusGetResponse"] -class AdvertisementStatusEditResponse(BaseModel): +class StatusGetResponse(BaseModel): advertised: Optional[bool] = None - """Advertisement status of the prefix. - - If `true`, the BGP route for the prefix is advertised to the Internet. If - `false`, the BGP route is withdrawn. - """ + """Enablement of prefix advertisement to the Internet.""" advertised_modified_at: Optional[datetime] = None """Last time the advertisement status was changed. diff --git a/src/cloudflare/types/addressing/prefixes/delegation_create_params.py b/src/cloudflare/types/addressing/prefixes/delegation_create_params.py index 948fe969d3e..f8f9c9719f2 100644 --- a/src/cloudflare/types/addressing/prefixes/delegation_create_params.py +++ b/src/cloudflare/types/addressing/prefixes/delegation_create_params.py @@ -9,7 +9,7 @@ class DelegationCreateParams(TypedDict, total=False): account_id: Required[str] - """Identifier of a Cloudflare account.""" + """Identifier""" cidr: Required[str] """IP Prefix in Classless Inter-Domain Routing format.""" diff --git a/src/cloudflare/types/addressing/prefixes/delegation_delete_response.py b/src/cloudflare/types/addressing/prefixes/delegation_delete_response.py index 352868765b9..3581f2c3c0a 100644 --- a/src/cloudflare/types/addressing/prefixes/delegation_delete_response.py +++ b/src/cloudflare/types/addressing/prefixes/delegation_delete_response.py @@ -9,4 +9,4 @@ class DelegationDeleteResponse(BaseModel): id: Optional[str] = None - """Identifier of a Delegation.""" + """Delegation identifier tag.""" diff --git a/src/cloudflare/types/addressing/prefixes/delegations.py b/src/cloudflare/types/addressing/prefixes/delegations.py index c9b97dfc3d5..8a2d2d8fea8 100644 --- a/src/cloudflare/types/addressing/prefixes/delegations.py +++ b/src/cloudflare/types/addressing/prefixes/delegations.py @@ -10,7 +10,7 @@ class Delegations(BaseModel): id: Optional[str] = None - """Identifier of a Delegation.""" + """Delegation identifier tag.""" cidr: Optional[str] = None """IP Prefix in Classless Inter-Domain Routing format.""" @@ -23,4 +23,4 @@ class Delegations(BaseModel): modified_at: Optional[datetime] = None parent_prefix_id: Optional[str] = None - """Identifier of an IP Prefix.""" + """Identifier""" diff --git a/src/cloudflare/types/addressing/prefixes/service_binding_create_params.py b/src/cloudflare/types/addressing/prefixes/service_binding_create_params.py deleted file mode 100644 index 6e1f0420211..00000000000 --- a/src/cloudflare/types/addressing/prefixes/service_binding_create_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["ServiceBindingCreateParams"] - - -class ServiceBindingCreateParams(TypedDict, total=False): - account_id: Required[str] - """Identifier of a Cloudflare account.""" - - cidr: str - """IP Prefix in Classless Inter-Domain Routing format.""" - - service_id: str - """Identifier of a Service on the Cloudflare network. - - Available services and their IDs may be found in the **List Services** endpoint. - """ diff --git a/src/cloudflare/types/addressing/prefixes/service_binding_delete_response.py b/src/cloudflare/types/addressing/prefixes/service_binding_delete_response.py deleted file mode 100644 index 7c24a85fea7..00000000000 --- a/src/cloudflare/types/addressing/prefixes/service_binding_delete_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import Literal - -from ...._models import BaseModel -from ...shared.response_info import ResponseInfo - -__all__ = ["ServiceBindingDeleteResponse"] - - -class ServiceBindingDeleteResponse(BaseModel): - errors: List[ResponseInfo] - - messages: List[ResponseInfo] - - success: Literal[True] - """Whether the API call was successful""" diff --git a/src/cloudflare/types/addressing/service_list_response.py b/src/cloudflare/types/addressing/service_list_response.py index a97b11929a2..e4e66040091 100644 --- a/src/cloudflare/types/addressing/service_list_response.py +++ b/src/cloudflare/types/addressing/service_list_response.py @@ -9,10 +9,7 @@ class ServiceListResponse(BaseModel): id: Optional[str] = None - """Identifier of a Service on the Cloudflare network. - - Available services and their IDs may be found in the **List Services** endpoint. - """ + """Identifier""" name: Optional[str] = None """Name of a service running on the Cloudflare network""" diff --git a/src/cloudflare/types/ai/__init__.py b/src/cloudflare/types/ai/__init__.py deleted file mode 100644 index 4f495e50871..00000000000 --- a/src/cloudflare/types/ai/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from .ai_run_params import AIRunParams as AIRunParams -from .ai_run_response import AIRunResponse as AIRunResponse -from .model_list_params import ModelListParams as ModelListParams -from .finetune_create_params import FinetuneCreateParams as FinetuneCreateParams -from .finetune_list_response import FinetuneListResponse as FinetuneListResponse -from .finetune_create_response import FinetuneCreateResponse as FinetuneCreateResponse diff --git a/src/cloudflare/types/ai/finetune_create_params.py b/src/cloudflare/types/ai/finetune_create_params.py deleted file mode 100644 index 84fc0d24f14..00000000000 --- a/src/cloudflare/types/ai/finetune_create_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["FinetuneCreateParams"] - - -class FinetuneCreateParams(TypedDict, total=False): - account_id: Required[str] - - model: Required[str] - - name: Required[str] - - description: str - - public: bool diff --git a/src/cloudflare/types/ai/finetune_create_response.py b/src/cloudflare/types/ai/finetune_create_response.py deleted file mode 100644 index 2b4b9963389..00000000000 --- a/src/cloudflare/types/ai/finetune_create_response.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime - -from ..._models import BaseModel - -__all__ = ["FinetuneCreateResponse"] - - -class FinetuneCreateResponse(BaseModel): - id: str - - created_at: datetime - - model: str - - modified_at: datetime - - name: str - - public: bool - - description: Optional[str] = None diff --git a/src/cloudflare/types/ai/finetune_list_response.py b/src/cloudflare/types/ai/finetune_list_response.py deleted file mode 100644 index b036b170114..00000000000 --- a/src/cloudflare/types/ai/finetune_list_response.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime - -from ..._models import BaseModel - -__all__ = ["FinetuneListResponse"] - - -class FinetuneListResponse(BaseModel): - id: str - - created_at: datetime - - model: str - - modified_at: datetime - - name: str - - description: Optional[str] = None diff --git a/src/cloudflare/types/ai/finetunes/__init__.py b/src/cloudflare/types/ai/finetunes/__init__.py deleted file mode 100644 index 736711396fa..00000000000 --- a/src/cloudflare/types/ai/finetunes/__init__.py +++ /dev/null @@ -1,8 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from .public_list_params import PublicListParams as PublicListParams -from .asset_create_params import AssetCreateParams as AssetCreateParams -from .public_list_response import PublicListResponse as PublicListResponse -from .asset_create_response import AssetCreateResponse as AssetCreateResponse diff --git a/src/cloudflare/types/ai/finetunes/asset_create_response.py b/src/cloudflare/types/ai/finetunes/asset_create_response.py deleted file mode 100644 index eef3e2d7d2d..00000000000 --- a/src/cloudflare/types/ai/finetunes/asset_create_response.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from datetime import datetime - -from ...._models import BaseModel - -__all__ = ["AssetCreateResponse"] - - -class AssetCreateResponse(BaseModel): - id: str - - bucket_name: str - - created_at: datetime - - file_name: str - - finetune_id: str - - modified_at: datetime diff --git a/src/cloudflare/types/ai/finetunes/public_list_params.py b/src/cloudflare/types/ai/finetunes/public_list_params.py deleted file mode 100644 index c5a973eaf63..00000000000 --- a/src/cloudflare/types/ai/finetunes/public_list_params.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ...._utils import PropertyInfo - -__all__ = ["PublicListParams"] - - -class PublicListParams(TypedDict, total=False): - account_id: Required[str] - - limit: float - """Pagination Limit""" - - offset: float - """Pagination Offset""" - - order_by: Annotated[str, PropertyInfo(alias="orderBy")] - """Order By Column Name""" diff --git a/src/cloudflare/types/ai/finetunes/public_list_response.py b/src/cloudflare/types/ai/finetunes/public_list_response.py deleted file mode 100644 index 4f96442b435..00000000000 --- a/src/cloudflare/types/ai/finetunes/public_list_response.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime - -from ...._models import BaseModel - -__all__ = ["PublicListResponse"] - - -class PublicListResponse(BaseModel): - id: str - - created_at: datetime - - model: str - - modified_at: datetime - - name: str - - public: bool - - description: Optional[str] = None diff --git a/src/cloudflare/types/ai/model_list_params.py b/src/cloudflare/types/ai/model_list_params.py deleted file mode 100644 index bcbc1d7bc05..00000000000 --- a/src/cloudflare/types/ai/model_list_params.py +++ /dev/null @@ -1,30 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["ModelListParams"] - - -class ModelListParams(TypedDict, total=False): - account_id: Required[str] - - author: str - """Filter by Author""" - - hide_experimental: bool - """Filter to hide experimental models""" - - page: int - - per_page: int - - search: str - """Search""" - - source: float - """Filter by Source Id""" - - task: str - """Filter by Task Name""" diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_create_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_create_response.py index 8c4df8ce75e..d13ca4fea1f 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_create_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_create_response.py @@ -13,10 +13,6 @@ class AIGatewayCreateResponse(BaseModel): id: str """gateway id""" - account_id: str - - account_tag: str - cache_invalidate_on_update: bool cache_ttl: Optional[int] = None @@ -25,8 +21,6 @@ class AIGatewayCreateResponse(BaseModel): created_at: datetime - internal_id: str - modified_at: datetime rate_limiting_interval: Optional[int] = None diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_delete_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_delete_response.py index 56b71b99466..96e4ed45b33 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_delete_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_delete_response.py @@ -13,10 +13,6 @@ class AIGatewayDeleteResponse(BaseModel): id: str """gateway id""" - account_id: str - - account_tag: str - cache_invalidate_on_update: bool cache_ttl: Optional[int] = None @@ -25,8 +21,6 @@ class AIGatewayDeleteResponse(BaseModel): created_at: datetime - internal_id: str - modified_at: datetime rate_limiting_interval: Optional[int] = None diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_get_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_get_response.py index eed84b4ee8d..4686eb08c4f 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_get_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_get_response.py @@ -13,10 +13,6 @@ class AIGatewayGetResponse(BaseModel): id: str """gateway id""" - account_id: str - - account_tag: str - cache_invalidate_on_update: bool cache_ttl: Optional[int] = None @@ -25,8 +21,6 @@ class AIGatewayGetResponse(BaseModel): created_at: datetime - internal_id: str - modified_at: datetime rate_limiting_interval: Optional[int] = None diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_list_params.py b/src/cloudflare/types/ai_gateway/ai_gateway_list_params.py index a2545d4af8e..a363b567a3f 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_list_params.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["AIGatewayListParams"] @@ -10,6 +10,12 @@ class AIGatewayListParams(TypedDict, total=False): account_id: Required[str] + order_by: str + """Order By Column Name""" + + order_by_direction: Literal["asc", "desc"] + """Order By Direction""" + page: int per_page: int diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_list_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_list_response.py index 31dca9345f4..b7e93763d69 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_list_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_list_response.py @@ -13,10 +13,6 @@ class AIGatewayListResponse(BaseModel): id: str """gateway id""" - account_id: str - - account_tag: str - cache_invalidate_on_update: bool cache_ttl: Optional[int] = None @@ -25,8 +21,6 @@ class AIGatewayListResponse(BaseModel): created_at: datetime - internal_id: str - modified_at: datetime rate_limiting_interval: Optional[int] = None diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_update_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_update_response.py index 21e6cd223b6..9a0077bb441 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_update_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_update_response.py @@ -13,10 +13,6 @@ class AIGatewayUpdateResponse(BaseModel): id: str """gateway id""" - account_id: str - - account_tag: str - cache_invalidate_on_update: bool cache_ttl: Optional[int] = None @@ -25,8 +21,6 @@ class AIGatewayUpdateResponse(BaseModel): created_at: datetime - internal_id: str - modified_at: datetime rate_limiting_interval: Optional[int] = None diff --git a/src/cloudflare/types/ai_gateway/dataset_create_response.py b/src/cloudflare/types/ai_gateway/dataset_create_response.py index 5be90be4a14..806584ab12e 100644 --- a/src/cloudflare/types/ai_gateway/dataset_create_response.py +++ b/src/cloudflare/types/ai_gateway/dataset_create_response.py @@ -34,10 +34,6 @@ class Filter(BaseModel): class DatasetCreateResponse(BaseModel): id: str - account_id: str - - account_tag: str - created_at: datetime enable: bool diff --git a/src/cloudflare/types/ai_gateway/dataset_delete_response.py b/src/cloudflare/types/ai_gateway/dataset_delete_response.py index 9b9ede756f2..b097128ba3c 100644 --- a/src/cloudflare/types/ai_gateway/dataset_delete_response.py +++ b/src/cloudflare/types/ai_gateway/dataset_delete_response.py @@ -34,10 +34,6 @@ class Filter(BaseModel): class DatasetDeleteResponse(BaseModel): id: str - account_id: str - - account_tag: str - created_at: datetime enable: bool diff --git a/src/cloudflare/types/ai_gateway/dataset_get_response.py b/src/cloudflare/types/ai_gateway/dataset_get_response.py index 102c0cd1b49..1641c723f9e 100644 --- a/src/cloudflare/types/ai_gateway/dataset_get_response.py +++ b/src/cloudflare/types/ai_gateway/dataset_get_response.py @@ -34,10 +34,6 @@ class Filter(BaseModel): class DatasetGetResponse(BaseModel): id: str - account_id: str - - account_tag: str - created_at: datetime enable: bool diff --git a/src/cloudflare/types/ai_gateway/dataset_list_params.py b/src/cloudflare/types/ai_gateway/dataset_list_params.py index 440331fa032..29c35578d00 100644 --- a/src/cloudflare/types/ai_gateway/dataset_list_params.py +++ b/src/cloudflare/types/ai_gateway/dataset_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["DatasetListParams"] @@ -14,6 +14,12 @@ class DatasetListParams(TypedDict, total=False): name: str + order_by: str + """Order By Column Name""" + + order_by_direction: Literal["asc", "desc"] + """Order By Direction""" + page: int per_page: int diff --git a/src/cloudflare/types/ai_gateway/dataset_list_response.py b/src/cloudflare/types/ai_gateway/dataset_list_response.py index cf9d6e28bd3..710a48b322d 100644 --- a/src/cloudflare/types/ai_gateway/dataset_list_response.py +++ b/src/cloudflare/types/ai_gateway/dataset_list_response.py @@ -34,10 +34,6 @@ class Filter(BaseModel): class DatasetListResponse(BaseModel): id: str - account_id: str - - account_tag: str - created_at: datetime enable: bool diff --git a/src/cloudflare/types/ai_gateway/dataset_update_response.py b/src/cloudflare/types/ai_gateway/dataset_update_response.py index 2cfeca9e20c..a68021d1647 100644 --- a/src/cloudflare/types/ai_gateway/dataset_update_response.py +++ b/src/cloudflare/types/ai_gateway/dataset_update_response.py @@ -34,10 +34,6 @@ class Filter(BaseModel): class DatasetUpdateResponse(BaseModel): id: str - account_id: str - - account_tag: str - created_at: datetime enable: bool diff --git a/src/cloudflare/types/ai_gateway/evaluation_create_response.py b/src/cloudflare/types/ai_gateway/evaluation_create_response.py index 40b1b09254b..41775aef604 100644 --- a/src/cloudflare/types/ai_gateway/evaluation_create_response.py +++ b/src/cloudflare/types/ai_gateway/evaluation_create_response.py @@ -34,10 +34,6 @@ class DatasetFilter(BaseModel): class Dataset(BaseModel): id: str - account_id: str - - account_tag: str - created_at: datetime enable: bool @@ -75,10 +71,6 @@ class Result(BaseModel): class EvaluationCreateResponse(BaseModel): id: str - account_id: str - - account_tag: str - created_at: datetime datasets: List[Dataset] diff --git a/src/cloudflare/types/ai_gateway/evaluation_delete_response.py b/src/cloudflare/types/ai_gateway/evaluation_delete_response.py index 163d4406dd6..97255d29893 100644 --- a/src/cloudflare/types/ai_gateway/evaluation_delete_response.py +++ b/src/cloudflare/types/ai_gateway/evaluation_delete_response.py @@ -34,10 +34,6 @@ class DatasetFilter(BaseModel): class Dataset(BaseModel): id: str - account_id: str - - account_tag: str - created_at: datetime enable: bool @@ -75,10 +71,6 @@ class Result(BaseModel): class EvaluationDeleteResponse(BaseModel): id: str - account_id: str - - account_tag: str - created_at: datetime datasets: List[Dataset] diff --git a/src/cloudflare/types/ai_gateway/evaluation_get_response.py b/src/cloudflare/types/ai_gateway/evaluation_get_response.py index 2ac71bd4a18..63b8598ce32 100644 --- a/src/cloudflare/types/ai_gateway/evaluation_get_response.py +++ b/src/cloudflare/types/ai_gateway/evaluation_get_response.py @@ -34,10 +34,6 @@ class DatasetFilter(BaseModel): class Dataset(BaseModel): id: str - account_id: str - - account_tag: str - created_at: datetime enable: bool @@ -75,10 +71,6 @@ class Result(BaseModel): class EvaluationGetResponse(BaseModel): id: str - account_id: str - - account_tag: str - created_at: datetime datasets: List[Dataset] diff --git a/src/cloudflare/types/ai_gateway/evaluation_list_params.py b/src/cloudflare/types/ai_gateway/evaluation_list_params.py index deefec45cbf..1577eb25188 100644 --- a/src/cloudflare/types/ai_gateway/evaluation_list_params.py +++ b/src/cloudflare/types/ai_gateway/evaluation_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["EvaluationListParams"] @@ -12,6 +12,12 @@ class EvaluationListParams(TypedDict, total=False): name: str + order_by: str + """Order By Column Name""" + + order_by_direction: Literal["asc", "desc"] + """Order By Direction""" + page: int per_page: int diff --git a/src/cloudflare/types/ai_gateway/evaluation_list_response.py b/src/cloudflare/types/ai_gateway/evaluation_list_response.py index e40b09a38aa..75a55183881 100644 --- a/src/cloudflare/types/ai_gateway/evaluation_list_response.py +++ b/src/cloudflare/types/ai_gateway/evaluation_list_response.py @@ -34,10 +34,6 @@ class DatasetFilter(BaseModel): class Dataset(BaseModel): id: str - account_id: str - - account_tag: str - created_at: datetime enable: bool @@ -75,10 +71,6 @@ class Result(BaseModel): class EvaluationListResponse(BaseModel): id: str - account_id: str - - account_tag: str - created_at: datetime datasets: List[Dataset] diff --git a/src/cloudflare/types/ai_gateway/log_delete_params.py b/src/cloudflare/types/ai_gateway/log_delete_params.py index 0f7f4ca6c3c..4a6d76f27a0 100644 --- a/src/cloudflare/types/ai_gateway/log_delete_params.py +++ b/src/cloudflare/types/ai_gateway/log_delete_params.py @@ -35,7 +35,6 @@ class LogDeleteParams(TypedDict, total=False): class Filter(TypedDict, total=False): key: Required[ Literal[ - "id", "created_at", "request_content_type", "response_content_type", @@ -50,12 +49,6 @@ class Filter(TypedDict, total=False): "tokens_out", "duration", "feedback", - "event_id", - "request_type", - "metadata.key", - "metadata.value", - "prompts.prompt_id", - "prompts.version_id", ] ] diff --git a/src/cloudflare/types/ai_gateway/log_list_params.py b/src/cloudflare/types/ai_gateway/log_list_params.py index dbdf158649c..14365d3a489 100644 --- a/src/cloudflare/types/ai_gateway/log_list_params.py +++ b/src/cloudflare/types/ai_gateway/log_list_params.py @@ -74,7 +74,6 @@ class LogListParams(TypedDict, total=False): class Filter(TypedDict, total=False): key: Required[ Literal[ - "id", "created_at", "request_content_type", "response_content_type", @@ -89,12 +88,6 @@ class Filter(TypedDict, total=False): "tokens_out", "duration", "feedback", - "event_id", - "request_type", - "metadata.key", - "metadata.value", - "prompts.prompt_id", - "prompts.version_id", ] ] diff --git a/src/cloudflare/types/api_gateway/__init__.py b/src/cloudflare/types/api_gateway/__init__.py index bb1373799ba..272e71c2b78 100644 --- a/src/cloudflare/types/api_gateway/__init__.py +++ b/src/cloudflare/types/api_gateway/__init__.py @@ -4,6 +4,7 @@ from .message import Message as Message from .settings import Settings as Settings +from .api_shield import APIShield as APIShield from .configuration import Configuration as Configuration from .public_schema import PublicSchema as PublicSchema from .schema_upload import SchemaUpload as SchemaUpload @@ -25,7 +26,5 @@ from .user_schema_create_params import UserSchemaCreateParams as UserSchemaCreateParams from .configuration_update_params import ConfigurationUpdateParams as ConfigurationUpdateParams from .user_schema_delete_response import UserSchemaDeleteResponse as UserSchemaDeleteResponse -from .operation_bulk_create_params import OperationBulkCreateParams as OperationBulkCreateParams from .configuration_update_response import ConfigurationUpdateResponse as ConfigurationUpdateResponse -from .operation_bulk_create_response import OperationBulkCreateResponse as OperationBulkCreateResponse from .operation_bulk_delete_response import OperationBulkDeleteResponse as OperationBulkDeleteResponse diff --git a/src/cloudflare/types/api_gateway/api_shield.py b/src/cloudflare/types/api_gateway/api_shield.py new file mode 100644 index 00000000000..f884d96b96c --- /dev/null +++ b/src/cloudflare/types/api_gateway/api_shield.py @@ -0,0 +1,227 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, TypeAlias + +from ..._models import BaseModel + +__all__ = [ + "APIShield", + "Features", + "FeaturesAPIShieldOperationFeatureThresholds", + "FeaturesAPIShieldOperationFeatureThresholdsThresholds", + "FeaturesAPIShieldOperationFeatureParameterSchemas", + "FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas", + "FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas", + "FeaturesAPIShieldOperationFeatureAPIRouting", + "FeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting", + "FeaturesAPIShieldOperationFeatureConfidenceIntervals", + "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals", + "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold", + "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals", + "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90", + "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95", + "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99", + "FeaturesAPIShieldOperationFeatureSchemaInfo", + "FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo", + "FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema", +] + + +class FeaturesAPIShieldOperationFeatureThresholdsThresholds(BaseModel): + auth_id_tokens: Optional[int] = None + """The total number of auth-ids seen across this calculation.""" + + data_points: Optional[int] = None + """The number of data points used for the threshold suggestion calculation.""" + + last_updated: Optional[datetime] = None + + p50: Optional[int] = None + """The p50 quantile of requests (in period_seconds).""" + + p90: Optional[int] = None + """The p90 quantile of requests (in period_seconds).""" + + p99: Optional[int] = None + """The p99 quantile of requests (in period_seconds).""" + + period_seconds: Optional[int] = None + """The period over which this threshold is suggested.""" + + requests: Optional[int] = None + """The estimated number of requests covered by these calculations.""" + + suggested_threshold: Optional[int] = None + """The suggested threshold in requests done by the same auth_id or period_seconds.""" + + +class FeaturesAPIShieldOperationFeatureThresholds(BaseModel): + thresholds: Optional[FeaturesAPIShieldOperationFeatureThresholdsThresholds] = None + + +class FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas(BaseModel): + parameters: Optional[List[object]] = None + """An array containing the learned parameter schemas.""" + + responses: Optional[object] = None + """An empty response object. + + This field is required to yield a valid operation schema. + """ + + +class FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas(BaseModel): + last_updated: Optional[datetime] = None + + parameter_schemas: Optional[FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas] = ( + None + ) + """An operation schema object containing a response.""" + + +class FeaturesAPIShieldOperationFeatureParameterSchemas(BaseModel): + parameter_schemas: FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas + + +class FeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting(BaseModel): + last_updated: Optional[datetime] = None + + route: Optional[str] = None + """Target route.""" + + +class FeaturesAPIShieldOperationFeatureAPIRouting(BaseModel): + api_routing: Optional[FeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting] = None + """API Routing settings on endpoint.""" + + +class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90( + BaseModel +): + lower: Optional[float] = None + """Lower bound for percentile estimate""" + + upper: Optional[float] = None + """Upper bound for percentile estimate""" + + +class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95( + BaseModel +): + lower: Optional[float] = None + """Lower bound for percentile estimate""" + + upper: Optional[float] = None + """Upper bound for percentile estimate""" + + +class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99( + BaseModel +): + lower: Optional[float] = None + """Lower bound for percentile estimate""" + + upper: Optional[float] = None + """Upper bound for percentile estimate""" + + +class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals( + BaseModel +): + p90: Optional[ + FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90 + ] = None + """Upper and lower bound for percentile estimate""" + + p95: Optional[ + FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95 + ] = None + """Upper and lower bound for percentile estimate""" + + p99: Optional[ + FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99 + ] = None + """Upper and lower bound for percentile estimate""" + + +class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold(BaseModel): + confidence_intervals: Optional[ + FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals + ] = None + + mean: Optional[float] = None + """Suggested threshold.""" + + +class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals(BaseModel): + last_updated: Optional[datetime] = None + + suggested_threshold: Optional[ + FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold + ] = None + + +class FeaturesAPIShieldOperationFeatureConfidenceIntervals(BaseModel): + confidence_intervals: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals] = None + + +class FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema(BaseModel): + id: Optional[str] = None + """UUID""" + + created_at: Optional[datetime] = None + + is_learned: Optional[bool] = None + """True if schema is Cloudflare-provided.""" + + name: Optional[str] = None + """Schema file name.""" + + +class FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo(BaseModel): + active_schema: Optional[FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema] = None + """Schema active on endpoint.""" + + learned_available: Optional[bool] = None + """True if a Cloudflare-provided learned schema is available for this endpoint.""" + + mitigation_action: Optional[Literal["none", "log", "block"]] = None + """Action taken on requests failing validation.""" + + +class FeaturesAPIShieldOperationFeatureSchemaInfo(BaseModel): + schema_info: Optional[FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo] = None + + +Features: TypeAlias = Union[ + FeaturesAPIShieldOperationFeatureThresholds, + FeaturesAPIShieldOperationFeatureParameterSchemas, + FeaturesAPIShieldOperationFeatureAPIRouting, + FeaturesAPIShieldOperationFeatureConfidenceIntervals, + FeaturesAPIShieldOperationFeatureSchemaInfo, +] + + +class APIShield(BaseModel): + endpoint: str + """ + The endpoint which can contain path parameter templates in curly braces, each + will be replaced from left to right with {varN}, starting with {var1}, during + insertion. This will further be Cloudflare-normalized upon insertion. See: + https://developers.cloudflare.com/rules/normalization/how-it-works/. + """ + + host: str + """RFC3986-compliant host.""" + + last_updated: datetime + + method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"] + """The HTTP method used to access the endpoint.""" + + operation_id: str + """UUID""" + + features: Optional[Features] = None diff --git a/src/cloudflare/types/api_gateway/operation_bulk_create_params.py b/src/cloudflare/types/api_gateway/operation_bulk_create_params.py deleted file mode 100644 index 8672ae972e9..00000000000 --- a/src/cloudflare/types/api_gateway/operation_bulk_create_params.py +++ /dev/null @@ -1,31 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Literal, Required, TypedDict - -__all__ = ["OperationBulkCreateParams", "Body"] - - -class OperationBulkCreateParams(TypedDict, total=False): - zone_id: Required[str] - """Identifier""" - - body: Required[Iterable[Body]] - - -class Body(TypedDict, total=False): - endpoint: Required[str] - """ - The endpoint which can contain path parameter templates in curly braces, each - will be replaced from left to right with {varN}, starting with {var1}, during - insertion. This will further be Cloudflare-normalized upon insertion. See: - https://developers.cloudflare.com/rules/normalization/how-it-works/. - """ - - host: Required[str] - """RFC3986-compliant host.""" - - method: Required[Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"]] - """The HTTP method used to access the endpoint.""" diff --git a/src/cloudflare/types/api_gateway/operation_bulk_create_response.py b/src/cloudflare/types/api_gateway/operation_bulk_create_response.py deleted file mode 100644 index cf7c4824a17..00000000000 --- a/src/cloudflare/types/api_gateway/operation_bulk_create_response.py +++ /dev/null @@ -1,239 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, TypeAlias - -from ..._models import BaseModel - -__all__ = [ - "OperationBulkCreateResponse", - "OperationBulkCreateResponseItem", - "OperationBulkCreateResponseItemFeatures", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureThresholds", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureThresholdsThresholds", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemas", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureAPIRouting", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervals", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfo", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema", -] - - -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureThresholdsThresholds(BaseModel): - auth_id_tokens: Optional[int] = None - """The total number of auth-ids seen across this calculation.""" - - data_points: Optional[int] = None - """The number of data points used for the threshold suggestion calculation.""" - - last_updated: Optional[datetime] = None - - p50: Optional[int] = None - """The p50 quantile of requests (in period_seconds).""" - - p90: Optional[int] = None - """The p90 quantile of requests (in period_seconds).""" - - p99: Optional[int] = None - """The p99 quantile of requests (in period_seconds).""" - - period_seconds: Optional[int] = None - """The period over which this threshold is suggested.""" - - requests: Optional[int] = None - """The estimated number of requests covered by these calculations.""" - - suggested_threshold: Optional[int] = None - """The suggested threshold in requests done by the same auth_id or period_seconds.""" - - -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureThresholds(BaseModel): - thresholds: Optional[OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureThresholdsThresholds] = None - - -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas( - BaseModel -): - parameters: Optional[List[object]] = None - """An array containing the learned parameter schemas.""" - - responses: Optional[object] = None - """An empty response object. - - This field is required to yield a valid operation schema. - """ - - -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas(BaseModel): - last_updated: Optional[datetime] = None - - parameter_schemas: Optional[ - OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas - ] = None - """An operation schema object containing a response.""" - - -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemas(BaseModel): - parameter_schemas: OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas - - -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting(BaseModel): - last_updated: Optional[datetime] = None - - route: Optional[str] = None - """Target route.""" - - -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureAPIRouting(BaseModel): - api_routing: Optional[OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting] = None - """API Routing settings on endpoint.""" - - -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90( - BaseModel -): - lower: Optional[float] = None - """Lower bound for percentile estimate""" - - upper: Optional[float] = None - """Upper bound for percentile estimate""" - - -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95( - BaseModel -): - lower: Optional[float] = None - """Lower bound for percentile estimate""" - - upper: Optional[float] = None - """Upper bound for percentile estimate""" - - -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99( - BaseModel -): - lower: Optional[float] = None - """Lower bound for percentile estimate""" - - upper: Optional[float] = None - """Upper bound for percentile estimate""" - - -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals( - BaseModel -): - p90: Optional[ - OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90 - ] = None - """Upper and lower bound for percentile estimate""" - - p95: Optional[ - OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95 - ] = None - """Upper and lower bound for percentile estimate""" - - p99: Optional[ - OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99 - ] = None - """Upper and lower bound for percentile estimate""" - - -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold( - BaseModel -): - confidence_intervals: Optional[ - OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals - ] = None - - mean: Optional[float] = None - """Suggested threshold.""" - - -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals(BaseModel): - last_updated: Optional[datetime] = None - - suggested_threshold: Optional[ - OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold - ] = None - - -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervals(BaseModel): - confidence_intervals: Optional[ - OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals - ] = None - - -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema(BaseModel): - id: Optional[str] = None - """UUID""" - - created_at: Optional[datetime] = None - - is_learned: Optional[bool] = None - """True if schema is Cloudflare-provided.""" - - name: Optional[str] = None - """Schema file name.""" - - -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo(BaseModel): - active_schema: Optional[ - OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema - ] = None - """Schema active on endpoint.""" - - learned_available: Optional[bool] = None - """True if a Cloudflare-provided learned schema is available for this endpoint.""" - - mitigation_action: Optional[Literal["none", "log", "block"]] = None - """Action taken on requests failing validation.""" - - -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfo(BaseModel): - schema_info: Optional[OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo] = None - - -OperationBulkCreateResponseItemFeatures: TypeAlias = Union[ - OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureThresholds, - OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemas, - OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureAPIRouting, - OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervals, - OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfo, -] - - -class OperationBulkCreateResponseItem(BaseModel): - endpoint: str - """ - The endpoint which can contain path parameter templates in curly braces, each - will be replaced from left to right with {varN}, starting with {var1}, during - insertion. This will further be Cloudflare-normalized upon insertion. See: - https://developers.cloudflare.com/rules/normalization/how-it-works/. - """ - - host: str - """RFC3986-compliant host.""" - - last_updated: datetime - - method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"] - """The HTTP method used to access the endpoint.""" - - operation_id: str - """UUID""" - - features: Optional[OperationBulkCreateResponseItemFeatures] = None - - -OperationBulkCreateResponse: TypeAlias = List[OperationBulkCreateResponseItem] diff --git a/src/cloudflare/types/api_gateway/operation_create_params.py b/src/cloudflare/types/api_gateway/operation_create_params.py index 4563a0f9afb..dbfa97bf6e8 100644 --- a/src/cloudflare/types/api_gateway/operation_create_params.py +++ b/src/cloudflare/types/api_gateway/operation_create_params.py @@ -2,15 +2,20 @@ from __future__ import annotations +from typing import Iterable from typing_extensions import Literal, Required, TypedDict -__all__ = ["OperationCreateParams"] +__all__ = ["OperationCreateParams", "Body"] class OperationCreateParams(TypedDict, total=False): zone_id: Required[str] """Identifier""" + body: Required[Iterable[Body]] + + +class Body(TypedDict, total=False): endpoint: Required[str] """ The endpoint which can contain path parameter templates in curly braces, each diff --git a/src/cloudflare/types/api_gateway/operation_create_response.py b/src/cloudflare/types/api_gateway/operation_create_response.py index a9b73ff2a91..23d0751ec12 100644 --- a/src/cloudflare/types/api_gateway/operation_create_response.py +++ b/src/cloudflare/types/api_gateway/operation_create_response.py @@ -1,227 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, TypeAlias +from typing import List +from typing_extensions import TypeAlias -from ..._models import BaseModel +from .api_shield import APIShield -__all__ = [ - "OperationCreateResponse", - "Features", - "FeaturesAPIShieldOperationFeatureThresholds", - "FeaturesAPIShieldOperationFeatureThresholdsThresholds", - "FeaturesAPIShieldOperationFeatureParameterSchemas", - "FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas", - "FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas", - "FeaturesAPIShieldOperationFeatureAPIRouting", - "FeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting", - "FeaturesAPIShieldOperationFeatureConfidenceIntervals", - "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals", - "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold", - "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals", - "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90", - "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95", - "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99", - "FeaturesAPIShieldOperationFeatureSchemaInfo", - "FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo", - "FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema", -] +__all__ = ["OperationCreateResponse"] - -class FeaturesAPIShieldOperationFeatureThresholdsThresholds(BaseModel): - auth_id_tokens: Optional[int] = None - """The total number of auth-ids seen across this calculation.""" - - data_points: Optional[int] = None - """The number of data points used for the threshold suggestion calculation.""" - - last_updated: Optional[datetime] = None - - p50: Optional[int] = None - """The p50 quantile of requests (in period_seconds).""" - - p90: Optional[int] = None - """The p90 quantile of requests (in period_seconds).""" - - p99: Optional[int] = None - """The p99 quantile of requests (in period_seconds).""" - - period_seconds: Optional[int] = None - """The period over which this threshold is suggested.""" - - requests: Optional[int] = None - """The estimated number of requests covered by these calculations.""" - - suggested_threshold: Optional[int] = None - """The suggested threshold in requests done by the same auth_id or period_seconds.""" - - -class FeaturesAPIShieldOperationFeatureThresholds(BaseModel): - thresholds: Optional[FeaturesAPIShieldOperationFeatureThresholdsThresholds] = None - - -class FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas(BaseModel): - parameters: Optional[List[object]] = None - """An array containing the learned parameter schemas.""" - - responses: Optional[object] = None - """An empty response object. - - This field is required to yield a valid operation schema. - """ - - -class FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas(BaseModel): - last_updated: Optional[datetime] = None - - parameter_schemas: Optional[FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas] = ( - None - ) - """An operation schema object containing a response.""" - - -class FeaturesAPIShieldOperationFeatureParameterSchemas(BaseModel): - parameter_schemas: FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas - - -class FeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting(BaseModel): - last_updated: Optional[datetime] = None - - route: Optional[str] = None - """Target route.""" - - -class FeaturesAPIShieldOperationFeatureAPIRouting(BaseModel): - api_routing: Optional[FeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting] = None - """API Routing settings on endpoint.""" - - -class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90( - BaseModel -): - lower: Optional[float] = None - """Lower bound for percentile estimate""" - - upper: Optional[float] = None - """Upper bound for percentile estimate""" - - -class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95( - BaseModel -): - lower: Optional[float] = None - """Lower bound for percentile estimate""" - - upper: Optional[float] = None - """Upper bound for percentile estimate""" - - -class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99( - BaseModel -): - lower: Optional[float] = None - """Lower bound for percentile estimate""" - - upper: Optional[float] = None - """Upper bound for percentile estimate""" - - -class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals( - BaseModel -): - p90: Optional[ - FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90 - ] = None - """Upper and lower bound for percentile estimate""" - - p95: Optional[ - FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95 - ] = None - """Upper and lower bound for percentile estimate""" - - p99: Optional[ - FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99 - ] = None - """Upper and lower bound for percentile estimate""" - - -class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold(BaseModel): - confidence_intervals: Optional[ - FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals - ] = None - - mean: Optional[float] = None - """Suggested threshold.""" - - -class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals(BaseModel): - last_updated: Optional[datetime] = None - - suggested_threshold: Optional[ - FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold - ] = None - - -class FeaturesAPIShieldOperationFeatureConfidenceIntervals(BaseModel): - confidence_intervals: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals] = None - - -class FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema(BaseModel): - id: Optional[str] = None - """UUID""" - - created_at: Optional[datetime] = None - - is_learned: Optional[bool] = None - """True if schema is Cloudflare-provided.""" - - name: Optional[str] = None - """Schema file name.""" - - -class FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo(BaseModel): - active_schema: Optional[FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema] = None - """Schema active on endpoint.""" - - learned_available: Optional[bool] = None - """True if a Cloudflare-provided learned schema is available for this endpoint.""" - - mitigation_action: Optional[Literal["none", "log", "block"]] = None - """Action taken on requests failing validation.""" - - -class FeaturesAPIShieldOperationFeatureSchemaInfo(BaseModel): - schema_info: Optional[FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo] = None - - -Features: TypeAlias = Union[ - FeaturesAPIShieldOperationFeatureThresholds, - FeaturesAPIShieldOperationFeatureParameterSchemas, - FeaturesAPIShieldOperationFeatureAPIRouting, - FeaturesAPIShieldOperationFeatureConfidenceIntervals, - FeaturesAPIShieldOperationFeatureSchemaInfo, -] - - -class OperationCreateResponse(BaseModel): - endpoint: str - """ - The endpoint which can contain path parameter templates in curly braces, each - will be replaced from left to right with {varN}, starting with {var1}, during - insertion. This will further be Cloudflare-normalized upon insertion. See: - https://developers.cloudflare.com/rules/normalization/how-it-works/. - """ - - host: str - """RFC3986-compliant host.""" - - last_updated: datetime - - method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"] - """The HTTP method used to access the endpoint.""" - - operation_id: str - """UUID""" - - features: Optional[Features] = None +OperationCreateResponse: TypeAlias = List[APIShield] diff --git a/src/cloudflare/types/api_gateway/user_schemas/operation_list_response.py b/src/cloudflare/types/api_gateway/user_schemas/operation_list_response.py index cae8a5a0a92..3149155c055 100644 --- a/src/cloudflare/types/api_gateway/user_schemas/operation_list_response.py +++ b/src/cloudflare/types/api_gateway/user_schemas/operation_list_response.py @@ -1,236 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from datetime import datetime +from typing import Union from typing_extensions import Literal, TypeAlias from ...._models import BaseModel +from ..api_shield import APIShield -__all__ = [ - "OperationListResponse", - "APIShieldOperation", - "APIShieldOperationFeatures", - "APIShieldOperationFeaturesAPIShieldOperationFeatureThresholds", - "APIShieldOperationFeaturesAPIShieldOperationFeatureThresholdsThresholds", - "APIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemas", - "APIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas", - "APIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas", - "APIShieldOperationFeaturesAPIShieldOperationFeatureAPIRouting", - "APIShieldOperationFeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting", - "APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervals", - "APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals", - "APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold", - "APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals", - "APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90", - "APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95", - "APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99", - "APIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfo", - "APIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo", - "APIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema", - "APIShieldBasicOperation", -] - - -class APIShieldOperationFeaturesAPIShieldOperationFeatureThresholdsThresholds(BaseModel): - auth_id_tokens: Optional[int] = None - """The total number of auth-ids seen across this calculation.""" - - data_points: Optional[int] = None - """The number of data points used for the threshold suggestion calculation.""" - - last_updated: Optional[datetime] = None - - p50: Optional[int] = None - """The p50 quantile of requests (in period_seconds).""" - - p90: Optional[int] = None - """The p90 quantile of requests (in period_seconds).""" - - p99: Optional[int] = None - """The p99 quantile of requests (in period_seconds).""" - - period_seconds: Optional[int] = None - """The period over which this threshold is suggested.""" - - requests: Optional[int] = None - """The estimated number of requests covered by these calculations.""" - - suggested_threshold: Optional[int] = None - """The suggested threshold in requests done by the same auth_id or period_seconds.""" - - -class APIShieldOperationFeaturesAPIShieldOperationFeatureThresholds(BaseModel): - thresholds: Optional[APIShieldOperationFeaturesAPIShieldOperationFeatureThresholdsThresholds] = None - - -class APIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas(BaseModel): - parameters: Optional[List[object]] = None - """An array containing the learned parameter schemas.""" - - responses: Optional[object] = None - """An empty response object. - - This field is required to yield a valid operation schema. - """ - - -class APIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas(BaseModel): - last_updated: Optional[datetime] = None - - parameter_schemas: Optional[ - APIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas - ] = None - """An operation schema object containing a response.""" - - -class APIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemas(BaseModel): - parameter_schemas: APIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas - - -class APIShieldOperationFeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting(BaseModel): - last_updated: Optional[datetime] = None - - route: Optional[str] = None - """Target route.""" - - -class APIShieldOperationFeaturesAPIShieldOperationFeatureAPIRouting(BaseModel): - api_routing: Optional[APIShieldOperationFeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting] = None - """API Routing settings on endpoint.""" - - -class APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90( - BaseModel -): - lower: Optional[float] = None - """Lower bound for percentile estimate""" - - upper: Optional[float] = None - """Upper bound for percentile estimate""" - - -class APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95( - BaseModel -): - lower: Optional[float] = None - """Lower bound for percentile estimate""" - - upper: Optional[float] = None - """Upper bound for percentile estimate""" - - -class APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99( - BaseModel -): - lower: Optional[float] = None - """Lower bound for percentile estimate""" - - upper: Optional[float] = None - """Upper bound for percentile estimate""" - - -class APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals( - BaseModel -): - p90: Optional[ - APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90 - ] = None - """Upper and lower bound for percentile estimate""" - - p95: Optional[ - APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95 - ] = None - """Upper and lower bound for percentile estimate""" - - p99: Optional[ - APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99 - ] = None - """Upper and lower bound for percentile estimate""" - - -class APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold( - BaseModel -): - confidence_intervals: Optional[ - APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals - ] = None - - mean: Optional[float] = None - """Suggested threshold.""" - - -class APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals(BaseModel): - last_updated: Optional[datetime] = None - - suggested_threshold: Optional[ - APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold - ] = None - - -class APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervals(BaseModel): - confidence_intervals: Optional[ - APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals - ] = None - - -class APIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema(BaseModel): - id: Optional[str] = None - """UUID""" - - created_at: Optional[datetime] = None - - is_learned: Optional[bool] = None - """True if schema is Cloudflare-provided.""" - - name: Optional[str] = None - """Schema file name.""" - - -class APIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo(BaseModel): - active_schema: Optional[APIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema] = None - """Schema active on endpoint.""" - - learned_available: Optional[bool] = None - """True if a Cloudflare-provided learned schema is available for this endpoint.""" - - mitigation_action: Optional[Literal["none", "log", "block"]] = None - """Action taken on requests failing validation.""" - - -class APIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfo(BaseModel): - schema_info: Optional[APIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo] = None - - -APIShieldOperationFeatures: TypeAlias = Union[ - APIShieldOperationFeaturesAPIShieldOperationFeatureThresholds, - APIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemas, - APIShieldOperationFeaturesAPIShieldOperationFeatureAPIRouting, - APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervals, - APIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfo, -] - - -class APIShieldOperation(BaseModel): - endpoint: str - """ - The endpoint which can contain path parameter templates in curly braces, each - will be replaced from left to right with {varN}, starting with {var1}, during - insertion. This will further be Cloudflare-normalized upon insertion. See: - https://developers.cloudflare.com/rules/normalization/how-it-works/. - """ - - host: str - """RFC3986-compliant host.""" - - last_updated: datetime - - method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"] - """The HTTP method used to access the endpoint.""" - - operation_id: str - """UUID""" - - features: Optional[APIShieldOperationFeatures] = None +__all__ = ["OperationListResponse", "APIShieldBasicOperation"] class APIShieldBasicOperation(BaseModel): @@ -249,4 +25,4 @@ class APIShieldBasicOperation(BaseModel): """The HTTP method used to access the endpoint.""" -OperationListResponse: TypeAlias = Union[APIShieldOperation, APIShieldBasicOperation] +OperationListResponse: TypeAlias = Union[APIShield, APIShieldBasicOperation] diff --git a/src/cloudflare/types/argo/tiered_caching_edit_response.py b/src/cloudflare/types/argo/tiered_caching_edit_response.py index dfabfbc67c2..0e99559b8f5 100644 --- a/src/cloudflare/types/argo/tiered_caching_edit_response.py +++ b/src/cloudflare/types/argo/tiered_caching_edit_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from datetime import datetime from typing_extensions import Literal @@ -10,14 +9,14 @@ class TieredCachingEditResponse(BaseModel): - id: Literal["tiered_caching"] - """ID of the zone setting.""" + id: str + """The identifier of the caching setting""" editable: bool """Whether the setting is editable""" - value: Literal["on", "off"] - """The value of the feature""" + modified_on: datetime + """The time when the setting was last modified""" - modified_on: Optional[datetime] = None - """Last time this setting was modified.""" + value: Literal["on", "off"] + """The status of the feature being on / off""" diff --git a/src/cloudflare/types/argo/tiered_caching_get_response.py b/src/cloudflare/types/argo/tiered_caching_get_response.py index 8747f72e833..72f04aac880 100644 --- a/src/cloudflare/types/argo/tiered_caching_get_response.py +++ b/src/cloudflare/types/argo/tiered_caching_get_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from datetime import datetime from typing_extensions import Literal @@ -10,14 +9,14 @@ class TieredCachingGetResponse(BaseModel): - id: Literal["tiered_caching"] - """ID of the zone setting.""" + id: str + """The identifier of the caching setting""" editable: bool """Whether the setting is editable""" - value: Literal["on", "off"] - """The value of the feature""" + modified_on: datetime + """The time when the setting was last modified""" - modified_on: Optional[datetime] = None - """Last time this setting was modified.""" + value: Literal["on", "off"] + """The status of the feature being on / off""" diff --git a/src/cloudflare/types/cache/__init__.py b/src/cloudflare/types/cache/__init__.py index 10937a5c1b3..dca49dade79 100644 --- a/src/cloudflare/types/cache/__init__.py +++ b/src/cloudflare/types/cache/__init__.py @@ -4,6 +4,7 @@ from .state import State as State from .cache_reserve import CacheReserve as CacheReserve +from .cache_variant import CacheVariant as CacheVariant from .cache_purge_params import CachePurgeParams as CachePurgeParams from .cache_reserve_clear import CacheReserveClear as CacheReserveClear from .variant_edit_params import VariantEditParams as VariantEditParams @@ -11,7 +12,6 @@ from .variant_get_response import VariantGetResponse as VariantGetResponse from .regional_tiered_cache import RegionalTieredCache as RegionalTieredCache from .variant_edit_response import VariantEditResponse as VariantEditResponse -from .variant_delete_response import VariantDeleteResponse as VariantDeleteResponse from .cache_reserve_edit_params import CacheReserveEditParams as CacheReserveEditParams from .cache_reserve_clear_params import CacheReserveClearParams as CacheReserveClearParams from .cache_reserve_get_response import CacheReserveGetResponse as CacheReserveGetResponse diff --git a/src/cloudflare/types/cache/cache_reserve_clear_response.py b/src/cloudflare/types/cache/cache_reserve_clear_response.py index 48410c41b3c..6ef83d88029 100644 --- a/src/cloudflare/types/cache/cache_reserve_clear_response.py +++ b/src/cloudflare/types/cache/cache_reserve_clear_response.py @@ -14,6 +14,9 @@ class CacheReserveClearResponse(BaseModel): id: CacheReserveClear """ID of the zone setting.""" + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + start_ts: datetime """The time that the latest Cache Reserve Clear operation started.""" @@ -22,6 +25,3 @@ class CacheReserveClearResponse(BaseModel): end_ts: Optional[datetime] = None """The time that the latest Cache Reserve Clear operation completed.""" - - modified_on: Optional[datetime] = None - """Last time this setting was modified.""" diff --git a/src/cloudflare/types/cache/cache_reserve_edit_response.py b/src/cloudflare/types/cache/cache_reserve_edit_response.py index 1ecbfb5cc66..cf94dab2551 100644 --- a/src/cloudflare/types/cache/cache_reserve_edit_response.py +++ b/src/cloudflare/types/cache/cache_reserve_edit_response.py @@ -14,11 +14,8 @@ class CacheReserveEditResponse(BaseModel): id: CacheReserve """ID of the zone setting.""" - editable: bool - """Whether the setting is editable""" + modified_on: Optional[datetime] = None + """last time this setting was modified.""" value: Literal["on", "off"] - """The value of the feature""" - - modified_on: Optional[datetime] = None - """Last time this setting was modified.""" + """Value of the Cache Reserve zone setting.""" diff --git a/src/cloudflare/types/cache/cache_reserve_get_response.py b/src/cloudflare/types/cache/cache_reserve_get_response.py index bfca4dcc125..78ddefe3883 100644 --- a/src/cloudflare/types/cache/cache_reserve_get_response.py +++ b/src/cloudflare/types/cache/cache_reserve_get_response.py @@ -14,11 +14,8 @@ class CacheReserveGetResponse(BaseModel): id: CacheReserve """ID of the zone setting.""" - editable: bool - """Whether the setting is editable""" + modified_on: Optional[datetime] = None + """last time this setting was modified.""" value: Literal["on", "off"] - """The value of the feature""" - - modified_on: Optional[datetime] = None - """Last time this setting was modified.""" + """Value of the Cache Reserve zone setting.""" diff --git a/src/cloudflare/types/cache/cache_reserve_status_response.py b/src/cloudflare/types/cache/cache_reserve_status_response.py index 277b898dd11..abc1c4cba82 100644 --- a/src/cloudflare/types/cache/cache_reserve_status_response.py +++ b/src/cloudflare/types/cache/cache_reserve_status_response.py @@ -14,6 +14,9 @@ class CacheReserveStatusResponse(BaseModel): id: CacheReserveClear """ID of the zone setting.""" + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + start_ts: datetime """The time that the latest Cache Reserve Clear operation started.""" @@ -22,6 +25,3 @@ class CacheReserveStatusResponse(BaseModel): end_ts: Optional[datetime] = None """The time that the latest Cache Reserve Clear operation completed.""" - - modified_on: Optional[datetime] = None - """Last time this setting was modified.""" diff --git a/src/cloudflare/types/cache/variant_delete_response.py b/src/cloudflare/types/cache/cache_variant.py similarity index 63% rename from src/cloudflare/types/cache/variant_delete_response.py rename to src/cloudflare/types/cache/cache_variant.py index 6d697bb1232..e83ec666d1c 100644 --- a/src/cloudflare/types/cache/variant_delete_response.py +++ b/src/cloudflare/types/cache/cache_variant.py @@ -6,15 +6,12 @@ from ..._models import BaseModel -__all__ = ["VariantDeleteResponse"] +__all__ = ["CacheVariant"] -class VariantDeleteResponse(BaseModel): +class CacheVariant(BaseModel): id: Literal["variants"] """ID of the zone setting.""" - editable: bool - """Whether the setting is editable""" - modified_on: Optional[datetime] = None - """Last time this setting was modified.""" + """last time this setting was modified.""" diff --git a/src/cloudflare/types/cache/regional_tiered_cache_edit_response.py b/src/cloudflare/types/cache/regional_tiered_cache_edit_response.py index 089ee489e99..8350d75dc86 100644 --- a/src/cloudflare/types/cache/regional_tiered_cache_edit_response.py +++ b/src/cloudflare/types/cache/regional_tiered_cache_edit_response.py @@ -2,23 +2,31 @@ from typing import Optional from datetime import datetime -from typing_extensions import Literal from ..._models import BaseModel from .regional_tiered_cache import RegionalTieredCache -__all__ = ["RegionalTieredCacheEditResponse"] +__all__ = ["RegionalTieredCacheEditResponse", "Value"] -class RegionalTieredCacheEditResponse(BaseModel): +class Value(BaseModel): id: RegionalTieredCache """ID of the zone setting.""" - editable: bool - """Whether the setting is editable""" + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + - value: Literal["on", "off"] - """The value of the feature""" +class RegionalTieredCacheEditResponse(BaseModel): + id: RegionalTieredCache + """ID of the zone setting.""" modified_on: Optional[datetime] = None - """Last time this setting was modified.""" + """last time this setting was modified.""" + + value: Value + """ + Instructs Cloudflare to check a regional hub data center on the way to your + upper tier. This can help improve performance for smart and custom tiered cache + topologies. + """ diff --git a/src/cloudflare/types/cache/regional_tiered_cache_get_response.py b/src/cloudflare/types/cache/regional_tiered_cache_get_response.py index 2730910de20..ac3f6c4e6e3 100644 --- a/src/cloudflare/types/cache/regional_tiered_cache_get_response.py +++ b/src/cloudflare/types/cache/regional_tiered_cache_get_response.py @@ -2,23 +2,31 @@ from typing import Optional from datetime import datetime -from typing_extensions import Literal from ..._models import BaseModel from .regional_tiered_cache import RegionalTieredCache -__all__ = ["RegionalTieredCacheGetResponse"] +__all__ = ["RegionalTieredCacheGetResponse", "Value"] -class RegionalTieredCacheGetResponse(BaseModel): +class Value(BaseModel): id: RegionalTieredCache """ID of the zone setting.""" - editable: bool - """Whether the setting is editable""" + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + - value: Literal["on", "off"] - """The value of the feature""" +class RegionalTieredCacheGetResponse(BaseModel): + id: RegionalTieredCache + """ID of the zone setting.""" modified_on: Optional[datetime] = None - """Last time this setting was modified.""" + """last time this setting was modified.""" + + value: Value + """ + Instructs Cloudflare to check a regional hub data center on the way to your + upper tier. This can help improve performance for smart and custom tiered cache + topologies. + """ diff --git a/src/cloudflare/types/cache/smart_tiered_cache_delete_response.py b/src/cloudflare/types/cache/smart_tiered_cache_delete_response.py index 7bc174f36ae..3ccc2711f88 100644 --- a/src/cloudflare/types/cache/smart_tiered_cache_delete_response.py +++ b/src/cloudflare/types/cache/smart_tiered_cache_delete_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from datetime import datetime from typing_extensions import Literal @@ -10,11 +9,14 @@ class SmartTieredCacheDeleteResponse(BaseModel): - id: Literal["tiered_cache_smart_topology_enable"] - """ID of the zone setting.""" + id: str + """The identifier of the caching setting""" editable: bool """Whether the setting is editable""" - modified_on: Optional[datetime] = None - """Last time this setting was modified.""" + modified_on: datetime + """The time when the setting was last modified""" + + value: Literal["on", "off"] + """The status of the feature being on / off""" diff --git a/src/cloudflare/types/cache/smart_tiered_cache_edit_response.py b/src/cloudflare/types/cache/smart_tiered_cache_edit_response.py index 75ab468d3bb..8e871b0599c 100644 --- a/src/cloudflare/types/cache/smart_tiered_cache_edit_response.py +++ b/src/cloudflare/types/cache/smart_tiered_cache_edit_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from datetime import datetime from typing_extensions import Literal @@ -10,14 +9,14 @@ class SmartTieredCacheEditResponse(BaseModel): - id: Literal["tiered_cache_smart_topology_enable"] - """ID of the zone setting.""" + id: str + """The identifier of the caching setting""" editable: bool """Whether the setting is editable""" - value: Literal["on", "off"] - """The value of the feature""" + modified_on: datetime + """The time when the setting was last modified""" - modified_on: Optional[datetime] = None - """Last time this setting was modified.""" + value: Literal["on", "off"] + """The status of the feature being on / off""" diff --git a/src/cloudflare/types/cache/smart_tiered_cache_get_response.py b/src/cloudflare/types/cache/smart_tiered_cache_get_response.py index b8066e94776..787aa0d5d59 100644 --- a/src/cloudflare/types/cache/smart_tiered_cache_get_response.py +++ b/src/cloudflare/types/cache/smart_tiered_cache_get_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from datetime import datetime from typing_extensions import Literal @@ -10,14 +9,14 @@ class SmartTieredCacheGetResponse(BaseModel): - id: Literal["tiered_cache_smart_topology_enable"] - """ID of the zone setting.""" + id: str + """The identifier of the caching setting""" editable: bool """Whether the setting is editable""" - value: Literal["on", "off"] - """The value of the feature""" + modified_on: datetime + """The time when the setting was last modified""" - modified_on: Optional[datetime] = None - """Last time this setting was modified.""" + value: Literal["on", "off"] + """The status of the feature being on / off""" diff --git a/src/cloudflare/types/cache/variant_edit_response.py b/src/cloudflare/types/cache/variant_edit_response.py index 0cd828d795a..bdd337a206e 100644 --- a/src/cloudflare/types/cache/variant_edit_response.py +++ b/src/cloudflare/types/cache/variant_edit_response.py @@ -1,23 +1,88 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional from datetime import datetime from typing_extensions import Literal from ..._models import BaseModel -__all__ = ["VariantEditResponse"] +__all__ = ["VariantEditResponse", "Value"] + + +class Value(BaseModel): + avif: Optional[List[str]] = None + """ + List of strings with the MIME types of all the variants that should be served + for avif. + """ + + bmp: Optional[List[str]] = None + """ + List of strings with the MIME types of all the variants that should be served + for bmp. + """ + + gif: Optional[List[str]] = None + """ + List of strings with the MIME types of all the variants that should be served + for gif. + """ + + jp2: Optional[List[str]] = None + """ + List of strings with the MIME types of all the variants that should be served + for jp2. + """ + + jpeg: Optional[List[str]] = None + """ + List of strings with the MIME types of all the variants that should be served + for jpeg. + """ + + jpg: Optional[List[str]] = None + """ + List of strings with the MIME types of all the variants that should be served + for jpg. + """ + + jpg2: Optional[List[str]] = None + """ + List of strings with the MIME types of all the variants that should be served + for jpg2. + """ + + png: Optional[List[str]] = None + """ + List of strings with the MIME types of all the variants that should be served + for png. + """ + + tif: Optional[List[str]] = None + """ + List of strings with the MIME types of all the variants that should be served + for tif. + """ + + tiff: Optional[List[str]] = None + """ + List of strings with the MIME types of all the variants that should be served + for tiff. + """ + + webp: Optional[List[str]] = None + """ + List of strings with the MIME types of all the variants that should be served + for webp. + """ class VariantEditResponse(BaseModel): id: Literal["variants"] """ID of the zone setting.""" - editable: bool - """Whether the setting is editable""" - - value: str - """The value of the feature""" - modified_on: Optional[datetime] = None - """Last time this setting was modified.""" + """last time this setting was modified.""" + + value: Value + """Value of the zone setting.""" diff --git a/src/cloudflare/types/cache/variant_get_response.py b/src/cloudflare/types/cache/variant_get_response.py index 1b440b5b812..777c7d0da5c 100644 --- a/src/cloudflare/types/cache/variant_get_response.py +++ b/src/cloudflare/types/cache/variant_get_response.py @@ -1,23 +1,88 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional from datetime import datetime from typing_extensions import Literal from ..._models import BaseModel -__all__ = ["VariantGetResponse"] +__all__ = ["VariantGetResponse", "Value"] + + +class Value(BaseModel): + avif: Optional[List[str]] = None + """ + List of strings with the MIME types of all the variants that should be served + for avif. + """ + + bmp: Optional[List[str]] = None + """ + List of strings with the MIME types of all the variants that should be served + for bmp. + """ + + gif: Optional[List[str]] = None + """ + List of strings with the MIME types of all the variants that should be served + for gif. + """ + + jp2: Optional[List[str]] = None + """ + List of strings with the MIME types of all the variants that should be served + for jp2. + """ + + jpeg: Optional[List[str]] = None + """ + List of strings with the MIME types of all the variants that should be served + for jpeg. + """ + + jpg: Optional[List[str]] = None + """ + List of strings with the MIME types of all the variants that should be served + for jpg. + """ + + jpg2: Optional[List[str]] = None + """ + List of strings with the MIME types of all the variants that should be served + for jpg2. + """ + + png: Optional[List[str]] = None + """ + List of strings with the MIME types of all the variants that should be served + for png. + """ + + tif: Optional[List[str]] = None + """ + List of strings with the MIME types of all the variants that should be served + for tif. + """ + + tiff: Optional[List[str]] = None + """ + List of strings with the MIME types of all the variants that should be served + for tiff. + """ + + webp: Optional[List[str]] = None + """ + List of strings with the MIME types of all the variants that should be served + for webp. + """ class VariantGetResponse(BaseModel): id: Literal["variants"] """ID of the zone setting.""" - editable: bool - """Whether the setting is editable""" - - value: str - """The value of the feature""" - modified_on: Optional[datetime] = None - """Last time this setting was modified.""" + """last time this setting was modified.""" + + value: Value + """Value of the zone setting.""" diff --git a/src/cloudflare/types/cloud_connector/rule_update_params.py b/src/cloudflare/types/cloud_connector/rule_update_params.py index 41d4e4aaa74..f8c25c9b2a7 100644 --- a/src/cloudflare/types/cloud_connector/rule_update_params.py +++ b/src/cloudflare/types/cloud_connector/rule_update_params.py @@ -5,23 +5,23 @@ from typing import Iterable from typing_extensions import Literal, Required, TypedDict -__all__ = ["RuleUpdateParams", "Rule", "RuleParameters"] +__all__ = ["RuleUpdateParams", "Body", "BodyParameters"] class RuleUpdateParams(TypedDict, total=False): zone_id: Required[str] """Identifier""" - rules: Required[Iterable[Rule]] + body: Required[Iterable[Body]] """List of Cloud Connector rules""" -class RuleParameters(TypedDict, total=False): +class BodyParameters(TypedDict, total=False): host: str """Host to perform Cloud Connection to""" -class Rule(TypedDict, total=False): +class Body(TypedDict, total=False): id: str description: str @@ -30,7 +30,7 @@ class Rule(TypedDict, total=False): expression: str - parameters: RuleParameters + parameters: BodyParameters """Parameters of Cloud Connector Rule""" provider: Literal["aws_s3", "r2", "gcp_storage", "azure_storage"] diff --git a/src/cloudflare/types/dns/__init__.py b/src/cloudflare/types/dns/__init__.py index 13c7472b8f1..896ce3f6c10 100644 --- a/src/cloudflare/types/dns/__init__.py +++ b/src/cloudflare/types/dns/__init__.py @@ -28,11 +28,9 @@ from .dnskey_record import DNSKEYRecord as DNSKEYRecord from .smimea_record import SMIMEARecord as SMIMEARecord from .a_record_param import ARecordParam as ARecordParam -from .batch_put_param import BatchPutParam as BatchPutParam from .ds_record_param import DSRecordParam as DSRecordParam from .mx_record_param import MXRecordParam as MXRecordParam from .ns_record_param import NSRecordParam as NSRecordParam -from .record_response import RecordResponse as RecordResponse from .caa_record_param import CAARecordParam as CAARecordParam from .loc_record_param import LOCRecordParam as LOCRecordParam from .ptr_record_param import PTRRecordParam as PTRRecordParam @@ -40,7 +38,6 @@ from .txt_record_param import TXTRecordParam as TXTRecordParam from .uri_record_param import URIRecordParam as URIRecordParam from .aaaa_record_param import AAAARecordParam as AAAARecordParam -from .batch_patch_param import BatchPatchParam as BatchPatchParam from .cert_record_param import CERTRecordParam as CERTRecordParam from .svcb_record_param import SVCBRecordParam as SVCBRecordParam from .tlsa_record_param import TLSARecordParam as TLSARecordParam @@ -55,17 +52,23 @@ from .dns_analytics_query import DNSAnalyticsQuery as DNSAnalyticsQuery from .dnskey_record_param import DNSKEYRecordParam as DNSKEYRecordParam from .record_batch_params import RecordBatchParams as RecordBatchParams +from .record_get_response import RecordGetResponse as RecordGetResponse from .setting_edit_params import SettingEditParams as SettingEditParams from .smimea_record_param import SMIMEARecordParam as SMIMEARecordParam from .record_create_params import RecordCreateParams as RecordCreateParams +from .record_edit_response import RecordEditResponse as RecordEditResponse from .record_import_params import RecordImportParams as RecordImportParams +from .record_list_response import RecordListResponse as RecordListResponse from .record_scan_response import RecordScanResponse as RecordScanResponse from .record_update_params import RecordUpdateParams as RecordUpdateParams from .setting_get_response import SettingGetResponse as SettingGetResponse from .record_batch_response import RecordBatchResponse as RecordBatchResponse +from .record_process_timing import RecordProcessTiming as RecordProcessTiming from .setting_edit_response import SettingEditResponse as SettingEditResponse from .dnssec_delete_response import DNSSECDeleteResponse as DNSSECDeleteResponse +from .record_create_response import RecordCreateResponse as RecordCreateResponse from .record_delete_response import RecordDeleteResponse as RecordDeleteResponse from .record_export_response import RecordExportResponse as RecordExportResponse from .record_import_response import RecordImportResponse as RecordImportResponse +from .record_update_response import RecordUpdateResponse as RecordUpdateResponse from .dns_analytics_nominal_metric import DNSAnalyticsNominalMetric as DNSAnalyticsNominalMetric diff --git a/src/cloudflare/types/dns/a_record.py b/src/cloudflare/types/dns/a_record.py index 45e3bc709a2..0e92b18aa87 100644 --- a/src/cloudflare/types/dns/a_record.py +++ b/src/cloudflare/types/dns/a_record.py @@ -7,25 +7,7 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["ARecord", "Settings"] - - -class Settings(BaseModel): - ipv4_only: Optional[bool] = None - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: Optional[bool] = None - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ +__all__ = ["ARecord"] class ARecord(BaseModel): @@ -47,9 +29,6 @@ class ARecord(BaseModel): Cloudflare. """ - settings: Optional[Settings] = None - """Settings for the DNS record.""" - tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/a_record_param.py b/src/cloudflare/types/dns/a_record_param.py index 181939fa954..a7b46b5a982 100644 --- a/src/cloudflare/types/dns/a_record_param.py +++ b/src/cloudflare/types/dns/a_record_param.py @@ -8,25 +8,7 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["ARecordParam", "Settings"] - - -class Settings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ +__all__ = ["ARecordParam"] class ARecordParam(TypedDict, total=False): @@ -48,9 +30,6 @@ class ARecordParam(TypedDict, total=False): Cloudflare. """ - settings: Settings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/aaaa_record.py b/src/cloudflare/types/dns/aaaa_record.py index a9b929e4f9f..12b4a80d50f 100644 --- a/src/cloudflare/types/dns/aaaa_record.py +++ b/src/cloudflare/types/dns/aaaa_record.py @@ -7,25 +7,7 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["AAAARecord", "Settings"] - - -class Settings(BaseModel): - ipv4_only: Optional[bool] = None - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: Optional[bool] = None - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ +__all__ = ["AAAARecord"] class AAAARecord(BaseModel): @@ -47,9 +29,6 @@ class AAAARecord(BaseModel): Cloudflare. """ - settings: Optional[Settings] = None - """Settings for the DNS record.""" - tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/aaaa_record_param.py b/src/cloudflare/types/dns/aaaa_record_param.py index d305b76b8f0..dda366f6e09 100644 --- a/src/cloudflare/types/dns/aaaa_record_param.py +++ b/src/cloudflare/types/dns/aaaa_record_param.py @@ -8,25 +8,7 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["AAAARecordParam", "Settings"] - - -class Settings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ +__all__ = ["AAAARecordParam"] class AAAARecordParam(TypedDict, total=False): @@ -48,9 +30,6 @@ class AAAARecordParam(TypedDict, total=False): Cloudflare. """ - settings: Settings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/batch_patch_param.py b/src/cloudflare/types/dns/batch_patch_param.py deleted file mode 100644 index e3e0ae92005..00000000000 --- a/src/cloudflare/types/dns/batch_patch_param.py +++ /dev/null @@ -1,237 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Union -from typing_extensions import Literal, Required, TypeAlias, TypedDict - -from .ttl_param import TTLParam -from .record_tags import RecordTags -from .a_record_param import ARecordParam -from .ds_record_param import DSRecordParam -from .mx_record_param import MXRecordParam -from .ns_record_param import NSRecordParam -from .caa_record_param import CAARecordParam -from .loc_record_param import LOCRecordParam -from .ptr_record_param import PTRRecordParam -from .srv_record_param import SRVRecordParam -from .txt_record_param import TXTRecordParam -from .uri_record_param import URIRecordParam -from .aaaa_record_param import AAAARecordParam -from .cert_record_param import CERTRecordParam -from .svcb_record_param import SVCBRecordParam -from .tlsa_record_param import TLSARecordParam -from .cname_record_param import CNAMERecordParam -from .https_record_param import HTTPSRecordParam -from .naptr_record_param import NAPTRRecordParam -from .sshfp_record_param import SSHFPRecordParam -from .dnskey_record_param import DNSKEYRecordParam -from .smimea_record_param import SMIMEARecordParam - -__all__ = [ - "BatchPatchParam", - "ARecord", - "AAAARecord", - "CAARecord", - "CERTRecord", - "CNAMERecord", - "DNSKEYRecord", - "DSRecord", - "HTTPSRecord", - "LOCRecord", - "MXRecord", - "NAPTRRecord", - "NSRecord", - "Openpgpkey", - "OpenpgpkeySettings", - "PTRRecord", - "SMIMEARecord", - "SRVRecord", - "SSHFPRecord", - "SVCBRecord", - "TLSARecord", - "TXTRecord", - "URIRecord", -] - - -class ARecord(ARecordParam): - id: Required[str] - """Identifier""" - - -class AAAARecord(AAAARecordParam): - id: Required[str] - """Identifier""" - - -class CAARecord(CAARecordParam): - id: Required[str] - """Identifier""" - - -class CERTRecord(CERTRecordParam): - id: Required[str] - """Identifier""" - - -class CNAMERecord(CNAMERecordParam): - id: Required[str] - """Identifier""" - - -class DNSKEYRecord(DNSKEYRecordParam): - id: Required[str] - """Identifier""" - - -class DSRecord(DSRecordParam): - id: Required[str] - """Identifier""" - - -class HTTPSRecord(HTTPSRecordParam): - id: Required[str] - """Identifier""" - - -class LOCRecord(LOCRecordParam): - id: Required[str] - """Identifier""" - - -class MXRecord(MXRecordParam): - id: Required[str] - """Identifier""" - - -class NAPTRRecord(NAPTRRecordParam): - id: Required[str] - """Identifier""" - - -class NSRecord(NSRecordParam): - id: Required[str] - """Identifier""" - - -class OpenpgpkeySettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - -class Openpgpkey(TypedDict, total=False): - id: Required[str] - """Identifier""" - - comment: str - """Comments or notes about the DNS record. - - This field has no effect on DNS responses. - """ - - content: str - """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - - proxied: bool - """ - Whether the record is receiving the performance and security benefits of - Cloudflare. - """ - - settings: OpenpgpkeySettings - """Settings for the DNS record.""" - - tags: List[RecordTags] - """Custom tags for the DNS record. This field has no effect on DNS responses.""" - - ttl: TTLParam - """Time To Live (TTL) of the DNS record in seconds. - - Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the - minimum reduced to 30 for Enterprise zones. - """ - - type: Literal["OPENPGPKEY"] - """Record type.""" - - -class PTRRecord(PTRRecordParam): - id: Required[str] - """Identifier""" - - -class SMIMEARecord(SMIMEARecordParam): - id: Required[str] - """Identifier""" - - -class SRVRecord(SRVRecordParam): - id: Required[str] - """Identifier""" - - -class SSHFPRecord(SSHFPRecordParam): - id: Required[str] - """Identifier""" - - -class SVCBRecord(SVCBRecordParam): - id: Required[str] - """Identifier""" - - -class TLSARecord(TLSARecordParam): - id: Required[str] - """Identifier""" - - -class TXTRecord(TXTRecordParam): - id: Required[str] - """Identifier""" - - -class URIRecord(URIRecordParam): - id: Required[str] - """Identifier""" - - -BatchPatchParam: TypeAlias = Union[ - ARecord, - AAAARecord, - CAARecord, - CERTRecord, - CNAMERecord, - DNSKEYRecord, - DSRecord, - HTTPSRecord, - LOCRecord, - MXRecord, - NAPTRRecord, - NSRecord, - Openpgpkey, - PTRRecord, - SMIMEARecord, - SRVRecord, - SSHFPRecord, - SVCBRecord, - TLSARecord, - TXTRecord, - URIRecord, -] diff --git a/src/cloudflare/types/dns/batch_put_param.py b/src/cloudflare/types/dns/batch_put_param.py deleted file mode 100644 index d21c25d5b4c..00000000000 --- a/src/cloudflare/types/dns/batch_put_param.py +++ /dev/null @@ -1,237 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Union -from typing_extensions import Literal, Required, TypeAlias, TypedDict - -from .ttl_param import TTLParam -from .record_tags import RecordTags -from .a_record_param import ARecordParam -from .ds_record_param import DSRecordParam -from .mx_record_param import MXRecordParam -from .ns_record_param import NSRecordParam -from .caa_record_param import CAARecordParam -from .loc_record_param import LOCRecordParam -from .ptr_record_param import PTRRecordParam -from .srv_record_param import SRVRecordParam -from .txt_record_param import TXTRecordParam -from .uri_record_param import URIRecordParam -from .aaaa_record_param import AAAARecordParam -from .cert_record_param import CERTRecordParam -from .svcb_record_param import SVCBRecordParam -from .tlsa_record_param import TLSARecordParam -from .cname_record_param import CNAMERecordParam -from .https_record_param import HTTPSRecordParam -from .naptr_record_param import NAPTRRecordParam -from .sshfp_record_param import SSHFPRecordParam -from .dnskey_record_param import DNSKEYRecordParam -from .smimea_record_param import SMIMEARecordParam - -__all__ = [ - "BatchPutParam", - "ARecord", - "AAAARecord", - "CAARecord", - "CERTRecord", - "CNAMERecord", - "DNSKEYRecord", - "DSRecord", - "HTTPSRecord", - "LOCRecord", - "MXRecord", - "NAPTRRecord", - "NSRecord", - "Openpgpkey", - "OpenpgpkeySettings", - "PTRRecord", - "SMIMEARecord", - "SRVRecord", - "SSHFPRecord", - "SVCBRecord", - "TLSARecord", - "TXTRecord", - "URIRecord", -] - - -class ARecord(ARecordParam): - id: str - """Identifier""" - - -class AAAARecord(AAAARecordParam): - id: str - """Identifier""" - - -class CAARecord(CAARecordParam): - id: str - """Identifier""" - - -class CERTRecord(CERTRecordParam): - id: str - """Identifier""" - - -class CNAMERecord(CNAMERecordParam): - id: str - """Identifier""" - - -class DNSKEYRecord(DNSKEYRecordParam): - id: str - """Identifier""" - - -class DSRecord(DSRecordParam): - id: str - """Identifier""" - - -class HTTPSRecord(HTTPSRecordParam): - id: str - """Identifier""" - - -class LOCRecord(LOCRecordParam): - id: str - """Identifier""" - - -class MXRecord(MXRecordParam): - id: str - """Identifier""" - - -class NAPTRRecord(NAPTRRecordParam): - id: str - """Identifier""" - - -class NSRecord(NSRecordParam): - id: str - """Identifier""" - - -class OpenpgpkeySettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - -class Openpgpkey(TypedDict, total=False): - content: Required[str] - """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" - - name: Required[str] - """DNS record name (or @ for the zone apex) in Punycode.""" - - type: Required[Literal["OPENPGPKEY"]] - """Record type.""" - - id: str - """Identifier""" - - comment: str - """Comments or notes about the DNS record. - - This field has no effect on DNS responses. - """ - - proxied: bool - """ - Whether the record is receiving the performance and security benefits of - Cloudflare. - """ - - settings: OpenpgpkeySettings - """Settings for the DNS record.""" - - tags: List[RecordTags] - """Custom tags for the DNS record. This field has no effect on DNS responses.""" - - ttl: TTLParam - """Time To Live (TTL) of the DNS record in seconds. - - Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the - minimum reduced to 30 for Enterprise zones. - """ - - -class PTRRecord(PTRRecordParam): - id: str - """Identifier""" - - -class SMIMEARecord(SMIMEARecordParam): - id: str - """Identifier""" - - -class SRVRecord(SRVRecordParam): - id: str - """Identifier""" - - -class SSHFPRecord(SSHFPRecordParam): - id: str - """Identifier""" - - -class SVCBRecord(SVCBRecordParam): - id: str - """Identifier""" - - -class TLSARecord(TLSARecordParam): - id: str - """Identifier""" - - -class TXTRecord(TXTRecordParam): - id: str - """Identifier""" - - -class URIRecord(URIRecordParam): - id: str - """Identifier""" - - -BatchPutParam: TypeAlias = Union[ - ARecord, - AAAARecord, - CAARecord, - CERTRecord, - CNAMERecord, - DNSKEYRecord, - DSRecord, - HTTPSRecord, - LOCRecord, - MXRecord, - NAPTRRecord, - NSRecord, - Openpgpkey, - PTRRecord, - SMIMEARecord, - SRVRecord, - SSHFPRecord, - SVCBRecord, - TLSARecord, - TXTRecord, - URIRecord, -] diff --git a/src/cloudflare/types/dns/caa_record.py b/src/cloudflare/types/dns/caa_record.py index c4635a7d010..db52be5fb3d 100644 --- a/src/cloudflare/types/dns/caa_record.py +++ b/src/cloudflare/types/dns/caa_record.py @@ -7,7 +7,7 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["CAARecord", "Data", "Settings"] +__all__ = ["CAARecord", "Data"] class Data(BaseModel): @@ -21,24 +21,6 @@ class Data(BaseModel): """Value of the record. This field's semantics depend on the chosen tag.""" -class Settings(BaseModel): - ipv4_only: Optional[bool] = None - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: Optional[bool] = None - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class CAARecord(BaseModel): comment: Optional[str] = None """Comments or notes about the DNS record. @@ -61,9 +43,6 @@ class CAARecord(BaseModel): Cloudflare. """ - settings: Optional[Settings] = None - """Settings for the DNS record.""" - tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/caa_record_param.py b/src/cloudflare/types/dns/caa_record_param.py index b33a737dcfd..f4607bff8a3 100644 --- a/src/cloudflare/types/dns/caa_record_param.py +++ b/src/cloudflare/types/dns/caa_record_param.py @@ -8,7 +8,7 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["CAARecordParam", "Data", "Settings"] +__all__ = ["CAARecordParam", "Data"] class Data(TypedDict, total=False): @@ -22,24 +22,6 @@ class Data(TypedDict, total=False): """Value of the record. This field's semantics depend on the chosen tag.""" -class Settings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class CAARecordParam(TypedDict, total=False): comment: str """Comments or notes about the DNS record. @@ -59,9 +41,6 @@ class CAARecordParam(TypedDict, total=False): Cloudflare. """ - settings: Settings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/cert_record.py b/src/cloudflare/types/dns/cert_record.py index 158b93608aa..773fc039929 100644 --- a/src/cloudflare/types/dns/cert_record.py +++ b/src/cloudflare/types/dns/cert_record.py @@ -7,7 +7,7 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["CERTRecord", "Data", "Settings"] +__all__ = ["CERTRecord", "Data"] class Data(BaseModel): @@ -24,24 +24,6 @@ class Data(BaseModel): """Type.""" -class Settings(BaseModel): - ipv4_only: Optional[bool] = None - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: Optional[bool] = None - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class CERTRecord(BaseModel): comment: Optional[str] = None """Comments or notes about the DNS record. @@ -64,9 +46,6 @@ class CERTRecord(BaseModel): Cloudflare. """ - settings: Optional[Settings] = None - """Settings for the DNS record.""" - tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/cert_record_param.py b/src/cloudflare/types/dns/cert_record_param.py index 139c4c13d84..ae6a63bf15f 100644 --- a/src/cloudflare/types/dns/cert_record_param.py +++ b/src/cloudflare/types/dns/cert_record_param.py @@ -8,7 +8,7 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["CERTRecordParam", "Data", "Settings"] +__all__ = ["CERTRecordParam", "Data"] class Data(TypedDict, total=False): @@ -25,24 +25,6 @@ class Data(TypedDict, total=False): """Type.""" -class Settings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class CERTRecordParam(TypedDict, total=False): comment: str """Comments or notes about the DNS record. @@ -62,9 +44,6 @@ class CERTRecordParam(TypedDict, total=False): Cloudflare. """ - settings: Settings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/cname_record.py b/src/cloudflare/types/dns/cname_record.py index acbb165c725..fb32c1ca384 100644 --- a/src/cloudflare/types/dns/cname_record.py +++ b/src/cloudflare/types/dns/cname_record.py @@ -15,26 +15,10 @@ class Settings(BaseModel): """ If enabled, causes the CNAME record to be resolved externally and the resulting address records (e.g., A and AAAA) to be returned instead of the CNAME record - itself. This setting is unavailable for proxied records, since they are always + itself. This setting has no effect on proxied records, which are always flattened. """ - ipv4_only: Optional[bool] = None - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: Optional[bool] = None - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - class CNAMERecord(BaseModel): comment: Optional[str] = None @@ -56,7 +40,6 @@ class CNAMERecord(BaseModel): """ settings: Optional[Settings] = None - """Settings for the DNS record.""" tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/cname_record_param.py b/src/cloudflare/types/dns/cname_record_param.py index 122daccc16c..87006d1b36d 100644 --- a/src/cloudflare/types/dns/cname_record_param.py +++ b/src/cloudflare/types/dns/cname_record_param.py @@ -16,26 +16,10 @@ class Settings(TypedDict, total=False): """ If enabled, causes the CNAME record to be resolved externally and the resulting address records (e.g., A and AAAA) to be returned instead of the CNAME record - itself. This setting is unavailable for proxied records, since they are always + itself. This setting has no effect on proxied records, which are always flattened. """ - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - class CNAMERecordParam(TypedDict, total=False): comment: str @@ -57,7 +41,6 @@ class CNAMERecordParam(TypedDict, total=False): """ settings: Settings - """Settings for the DNS record.""" tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/dnskey_record.py b/src/cloudflare/types/dns/dnskey_record.py index b7ab534a265..650e258205b 100644 --- a/src/cloudflare/types/dns/dnskey_record.py +++ b/src/cloudflare/types/dns/dnskey_record.py @@ -7,7 +7,7 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["DNSKEYRecord", "Data", "Settings"] +__all__ = ["DNSKEYRecord", "Data"] class Data(BaseModel): @@ -24,24 +24,6 @@ class Data(BaseModel): """Public Key.""" -class Settings(BaseModel): - ipv4_only: Optional[bool] = None - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: Optional[bool] = None - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class DNSKEYRecord(BaseModel): comment: Optional[str] = None """Comments or notes about the DNS record. @@ -64,9 +46,6 @@ class DNSKEYRecord(BaseModel): Cloudflare. """ - settings: Optional[Settings] = None - """Settings for the DNS record.""" - tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/dnskey_record_param.py b/src/cloudflare/types/dns/dnskey_record_param.py index 87784bd7f8c..daba9a3225e 100644 --- a/src/cloudflare/types/dns/dnskey_record_param.py +++ b/src/cloudflare/types/dns/dnskey_record_param.py @@ -8,7 +8,7 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["DNSKEYRecordParam", "Data", "Settings"] +__all__ = ["DNSKEYRecordParam", "Data"] class Data(TypedDict, total=False): @@ -25,24 +25,6 @@ class Data(TypedDict, total=False): """Public Key.""" -class Settings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class DNSKEYRecordParam(TypedDict, total=False): comment: str """Comments or notes about the DNS record. @@ -62,9 +44,6 @@ class DNSKEYRecordParam(TypedDict, total=False): Cloudflare. """ - settings: Settings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/ds_record.py b/src/cloudflare/types/dns/ds_record.py index 7a6f2b87cfc..2d13516a67e 100644 --- a/src/cloudflare/types/dns/ds_record.py +++ b/src/cloudflare/types/dns/ds_record.py @@ -7,7 +7,7 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["DSRecord", "Data", "Settings"] +__all__ = ["DSRecord", "Data"] class Data(BaseModel): @@ -24,24 +24,6 @@ class Data(BaseModel): """Key Tag.""" -class Settings(BaseModel): - ipv4_only: Optional[bool] = None - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: Optional[bool] = None - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class DSRecord(BaseModel): comment: Optional[str] = None """Comments or notes about the DNS record. @@ -64,9 +46,6 @@ class DSRecord(BaseModel): Cloudflare. """ - settings: Optional[Settings] = None - """Settings for the DNS record.""" - tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/ds_record_param.py b/src/cloudflare/types/dns/ds_record_param.py index b37b3e538b2..14618b80a4b 100644 --- a/src/cloudflare/types/dns/ds_record_param.py +++ b/src/cloudflare/types/dns/ds_record_param.py @@ -8,7 +8,7 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["DSRecordParam", "Data", "Settings"] +__all__ = ["DSRecordParam", "Data"] class Data(TypedDict, total=False): @@ -25,24 +25,6 @@ class Data(TypedDict, total=False): """Key Tag.""" -class Settings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class DSRecordParam(TypedDict, total=False): comment: str """Comments or notes about the DNS record. @@ -62,9 +44,6 @@ class DSRecordParam(TypedDict, total=False): Cloudflare. """ - settings: Settings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/https_record.py b/src/cloudflare/types/dns/https_record.py index 9080fc0d2ca..7fb87c4bcf3 100644 --- a/src/cloudflare/types/dns/https_record.py +++ b/src/cloudflare/types/dns/https_record.py @@ -7,7 +7,7 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["HTTPSRecord", "Data", "Settings"] +__all__ = ["HTTPSRecord", "Data"] class Data(BaseModel): @@ -21,24 +21,6 @@ class Data(BaseModel): """value.""" -class Settings(BaseModel): - ipv4_only: Optional[bool] = None - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: Optional[bool] = None - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class HTTPSRecord(BaseModel): comment: Optional[str] = None """Comments or notes about the DNS record. @@ -61,9 +43,6 @@ class HTTPSRecord(BaseModel): Cloudflare. """ - settings: Optional[Settings] = None - """Settings for the DNS record.""" - tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/https_record_param.py b/src/cloudflare/types/dns/https_record_param.py index 510e57ae626..250fbb445ee 100644 --- a/src/cloudflare/types/dns/https_record_param.py +++ b/src/cloudflare/types/dns/https_record_param.py @@ -8,7 +8,7 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["HTTPSRecordParam", "Data", "Settings"] +__all__ = ["HTTPSRecordParam", "Data"] class Data(TypedDict, total=False): @@ -22,24 +22,6 @@ class Data(TypedDict, total=False): """value.""" -class Settings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class HTTPSRecordParam(TypedDict, total=False): comment: str """Comments or notes about the DNS record. @@ -59,9 +41,6 @@ class HTTPSRecordParam(TypedDict, total=False): Cloudflare. """ - settings: Settings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/loc_record.py b/src/cloudflare/types/dns/loc_record.py index 6fdf091618b..0fa1b139124 100644 --- a/src/cloudflare/types/dns/loc_record.py +++ b/src/cloudflare/types/dns/loc_record.py @@ -7,7 +7,7 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["LOCRecord", "Data", "Settings"] +__all__ = ["LOCRecord", "Data"] class Data(BaseModel): @@ -48,24 +48,6 @@ class Data(BaseModel): """Size of location in meters.""" -class Settings(BaseModel): - ipv4_only: Optional[bool] = None - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: Optional[bool] = None - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class LOCRecord(BaseModel): comment: Optional[str] = None """Comments or notes about the DNS record. @@ -88,9 +70,6 @@ class LOCRecord(BaseModel): Cloudflare. """ - settings: Optional[Settings] = None - """Settings for the DNS record.""" - tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/loc_record_param.py b/src/cloudflare/types/dns/loc_record_param.py index 55ec03b2297..15b31223784 100644 --- a/src/cloudflare/types/dns/loc_record_param.py +++ b/src/cloudflare/types/dns/loc_record_param.py @@ -8,7 +8,7 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["LOCRecordParam", "Data", "Settings"] +__all__ = ["LOCRecordParam", "Data"] class Data(TypedDict, total=False): @@ -49,24 +49,6 @@ class Data(TypedDict, total=False): """Size of location in meters.""" -class Settings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class LOCRecordParam(TypedDict, total=False): comment: str """Comments or notes about the DNS record. @@ -86,9 +68,6 @@ class LOCRecordParam(TypedDict, total=False): Cloudflare. """ - settings: Settings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/mx_record.py b/src/cloudflare/types/dns/mx_record.py index 4d3a7dd1874..ef6c49db053 100644 --- a/src/cloudflare/types/dns/mx_record.py +++ b/src/cloudflare/types/dns/mx_record.py @@ -7,25 +7,7 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["MXRecord", "Settings"] - - -class Settings(BaseModel): - ipv4_only: Optional[bool] = None - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: Optional[bool] = None - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ +__all__ = ["MXRecord"] class MXRecord(BaseModel): @@ -53,9 +35,6 @@ class MXRecord(BaseModel): Cloudflare. """ - settings: Optional[Settings] = None - """Settings for the DNS record.""" - tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/mx_record_param.py b/src/cloudflare/types/dns/mx_record_param.py index e38ea7456ca..633211e4684 100644 --- a/src/cloudflare/types/dns/mx_record_param.py +++ b/src/cloudflare/types/dns/mx_record_param.py @@ -8,25 +8,7 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["MXRecordParam", "Settings"] - - -class Settings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ +__all__ = ["MXRecordParam"] class MXRecordParam(TypedDict, total=False): @@ -54,9 +36,6 @@ class MXRecordParam(TypedDict, total=False): Cloudflare. """ - settings: Settings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/naptr_record.py b/src/cloudflare/types/dns/naptr_record.py index b2fe91864bf..909bdc97dad 100644 --- a/src/cloudflare/types/dns/naptr_record.py +++ b/src/cloudflare/types/dns/naptr_record.py @@ -7,7 +7,7 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["NAPTRRecord", "Data", "Settings"] +__all__ = ["NAPTRRecord", "Data"] class Data(BaseModel): @@ -30,24 +30,6 @@ class Data(BaseModel): """Service.""" -class Settings(BaseModel): - ipv4_only: Optional[bool] = None - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: Optional[bool] = None - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class NAPTRRecord(BaseModel): comment: Optional[str] = None """Comments or notes about the DNS record. @@ -70,9 +52,6 @@ class NAPTRRecord(BaseModel): Cloudflare. """ - settings: Optional[Settings] = None - """Settings for the DNS record.""" - tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/naptr_record_param.py b/src/cloudflare/types/dns/naptr_record_param.py index 25b91ed4f29..9511cbba68e 100644 --- a/src/cloudflare/types/dns/naptr_record_param.py +++ b/src/cloudflare/types/dns/naptr_record_param.py @@ -8,7 +8,7 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["NAPTRRecordParam", "Data", "Settings"] +__all__ = ["NAPTRRecordParam", "Data"] class Data(TypedDict, total=False): @@ -31,24 +31,6 @@ class Data(TypedDict, total=False): """Service.""" -class Settings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class NAPTRRecordParam(TypedDict, total=False): comment: str """Comments or notes about the DNS record. @@ -68,9 +50,6 @@ class NAPTRRecordParam(TypedDict, total=False): Cloudflare. """ - settings: Settings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/ns_record.py b/src/cloudflare/types/dns/ns_record.py index 78ac6fe4049..76e5aaff7c1 100644 --- a/src/cloudflare/types/dns/ns_record.py +++ b/src/cloudflare/types/dns/ns_record.py @@ -7,25 +7,7 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["NSRecord", "Settings"] - - -class Settings(BaseModel): - ipv4_only: Optional[bool] = None - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: Optional[bool] = None - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ +__all__ = ["NSRecord"] class NSRecord(BaseModel): @@ -47,9 +29,6 @@ class NSRecord(BaseModel): Cloudflare. """ - settings: Optional[Settings] = None - """Settings for the DNS record.""" - tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/ns_record_param.py b/src/cloudflare/types/dns/ns_record_param.py index eabb69eedd4..f036a719ddf 100644 --- a/src/cloudflare/types/dns/ns_record_param.py +++ b/src/cloudflare/types/dns/ns_record_param.py @@ -8,25 +8,7 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["NSRecordParam", "Settings"] - - -class Settings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ +__all__ = ["NSRecordParam"] class NSRecordParam(TypedDict, total=False): @@ -48,9 +30,6 @@ class NSRecordParam(TypedDict, total=False): Cloudflare. """ - settings: Settings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/ptr_record.py b/src/cloudflare/types/dns/ptr_record.py index c392256cbbc..3eee7c802d1 100644 --- a/src/cloudflare/types/dns/ptr_record.py +++ b/src/cloudflare/types/dns/ptr_record.py @@ -7,25 +7,7 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["PTRRecord", "Settings"] - - -class Settings(BaseModel): - ipv4_only: Optional[bool] = None - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: Optional[bool] = None - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ +__all__ = ["PTRRecord"] class PTRRecord(BaseModel): @@ -47,9 +29,6 @@ class PTRRecord(BaseModel): Cloudflare. """ - settings: Optional[Settings] = None - """Settings for the DNS record.""" - tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/ptr_record_param.py b/src/cloudflare/types/dns/ptr_record_param.py index 82d92c301fd..d0390797c51 100644 --- a/src/cloudflare/types/dns/ptr_record_param.py +++ b/src/cloudflare/types/dns/ptr_record_param.py @@ -8,25 +8,7 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["PTRRecordParam", "Settings"] - - -class Settings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ +__all__ = ["PTRRecordParam"] class PTRRecordParam(TypedDict, total=False): @@ -48,9 +30,6 @@ class PTRRecordParam(TypedDict, total=False): Cloudflare. """ - settings: Settings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/record_batch_params.py b/src/cloudflare/types/dns/record_batch_params.py index cb31cfdef94..3b9a78fbd2f 100644 --- a/src/cloudflare/types/dns/record_batch_params.py +++ b/src/cloudflare/types/dns/record_batch_params.py @@ -2,14 +2,81 @@ from __future__ import annotations -from typing import Iterable -from typing_extensions import Required, TypedDict +from typing import List, Union, Iterable +from typing_extensions import Literal, Required, TypeAlias, TypedDict +from .ttl_param import TTLParam +from .record_tags import RecordTags from .record_param import RecordParam -from .batch_put_param import BatchPutParam -from .batch_patch_param import BatchPatchParam +from .a_record_param import ARecordParam +from .ds_record_param import DSRecordParam +from .mx_record_param import MXRecordParam +from .ns_record_param import NSRecordParam +from .caa_record_param import CAARecordParam +from .loc_record_param import LOCRecordParam +from .ptr_record_param import PTRRecordParam +from .srv_record_param import SRVRecordParam +from .txt_record_param import TXTRecordParam +from .uri_record_param import URIRecordParam +from .aaaa_record_param import AAAARecordParam +from .cert_record_param import CERTRecordParam +from .svcb_record_param import SVCBRecordParam +from .tlsa_record_param import TLSARecordParam +from .cname_record_param import CNAMERecordParam +from .https_record_param import HTTPSRecordParam +from .naptr_record_param import NAPTRRecordParam +from .sshfp_record_param import SSHFPRecordParam +from .dnskey_record_param import DNSKEYRecordParam +from .smimea_record_param import SMIMEARecordParam -__all__ = ["RecordBatchParams", "Delete"] +__all__ = [ + "RecordBatchParams", + "Delete", + "Patch", + "PatchARecord", + "PatchAAAARecord", + "PatchCAARecord", + "PatchCERTRecord", + "PatchCNAMERecord", + "PatchDNSKEYRecord", + "PatchDSRecord", + "PatchHTTPSRecord", + "PatchLOCRecord", + "PatchMXRecord", + "PatchNAPTRRecord", + "PatchNSRecord", + "PatchOpenpgpkeyRecord", + "PatchPTRRecord", + "PatchSMIMEARecord", + "PatchSRVRecord", + "PatchSSHFPRecord", + "PatchSVCBRecord", + "PatchTLSARecord", + "PatchTXTRecord", + "PatchURIRecord", + "Put", + "PutARecord", + "PutAAAARecord", + "PutCAARecord", + "PutCERTRecord", + "PutCNAMERecord", + "PutDNSKEYRecord", + "PutDSRecord", + "PutHTTPSRecord", + "PutLOCRecord", + "PutMXRecord", + "PutNAPTRRecord", + "PutNSRecord", + "PutOpenpgpkeyRecord", + "PutPTRRecord", + "PutSMIMEARecord", + "PutSRVRecord", + "PutSSHFPRecord", + "PutSVCBRecord", + "PutTLSARecord", + "PutTXTRecord", + "PutURIRecord", +] class RecordBatchParams(TypedDict, total=False): @@ -18,13 +85,335 @@ class RecordBatchParams(TypedDict, total=False): deletes: Iterable[Delete] - patches: Iterable[BatchPatchParam] + patches: Iterable[Patch] posts: Iterable[RecordParam] - puts: Iterable[BatchPutParam] + puts: Iterable[Put] class Delete(TypedDict, total=False): id: Required[str] """Identifier""" + + +class PatchARecord(ARecordParam): + id: Required[str] + """Identifier""" + + +class PatchAAAARecord(AAAARecordParam): + id: Required[str] + """Identifier""" + + +class PatchCAARecord(CAARecordParam): + id: Required[str] + """Identifier""" + + +class PatchCERTRecord(CERTRecordParam): + id: Required[str] + """Identifier""" + + +class PatchCNAMERecord(CNAMERecordParam): + id: Required[str] + """Identifier""" + + +class PatchDNSKEYRecord(DNSKEYRecordParam): + id: Required[str] + """Identifier""" + + +class PatchDSRecord(DSRecordParam): + id: Required[str] + """Identifier""" + + +class PatchHTTPSRecord(HTTPSRecordParam): + id: Required[str] + """Identifier""" + + +class PatchLOCRecord(LOCRecordParam): + id: Required[str] + """Identifier""" + + +class PatchMXRecord(MXRecordParam): + id: Required[str] + """Identifier""" + + +class PatchNAPTRRecord(NAPTRRecordParam): + id: Required[str] + """Identifier""" + + +class PatchNSRecord(NSRecordParam): + id: Required[str] + """Identifier""" + + +class PatchOpenpgpkeyRecord(TypedDict, total=False): + id: Required[str] + """Identifier""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + content: str + """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" + + name: str + """DNS record name (or @ for the zone apex) in Punycode.""" + + proxied: bool + """ + Whether the record is receiving the performance and security benefits of + Cloudflare. + """ + + tags: List[RecordTags] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: TTLParam + """Time To Live (TTL) of the DNS record in seconds. + + Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the + minimum reduced to 30 for Enterprise zones. + """ + + type: Literal["OPENPGPKEY"] + """Record type.""" + + +class PatchPTRRecord(PTRRecordParam): + id: Required[str] + """Identifier""" + + +class PatchSMIMEARecord(SMIMEARecordParam): + id: Required[str] + """Identifier""" + + +class PatchSRVRecord(SRVRecordParam): + id: Required[str] + """Identifier""" + + +class PatchSSHFPRecord(SSHFPRecordParam): + id: Required[str] + """Identifier""" + + +class PatchSVCBRecord(SVCBRecordParam): + id: Required[str] + """Identifier""" + + +class PatchTLSARecord(TLSARecordParam): + id: Required[str] + """Identifier""" + + +class PatchTXTRecord(TXTRecordParam): + id: Required[str] + """Identifier""" + + +class PatchURIRecord(URIRecordParam): + id: Required[str] + """Identifier""" + + +Patch: TypeAlias = Union[ + PatchARecord, + PatchAAAARecord, + PatchCAARecord, + PatchCERTRecord, + PatchCNAMERecord, + PatchDNSKEYRecord, + PatchDSRecord, + PatchHTTPSRecord, + PatchLOCRecord, + PatchMXRecord, + PatchNAPTRRecord, + PatchNSRecord, + PatchOpenpgpkeyRecord, + PatchPTRRecord, + PatchSMIMEARecord, + PatchSRVRecord, + PatchSSHFPRecord, + PatchSVCBRecord, + PatchTLSARecord, + PatchTXTRecord, + PatchURIRecord, +] + + +class PutARecord(ARecordParam): + id: Required[str] + """Identifier""" + + +class PutAAAARecord(AAAARecordParam): + id: Required[str] + """Identifier""" + + +class PutCAARecord(CAARecordParam): + id: Required[str] + """Identifier""" + + +class PutCERTRecord(CERTRecordParam): + id: Required[str] + """Identifier""" + + +class PutCNAMERecord(CNAMERecordParam): + id: Required[str] + """Identifier""" + + +class PutDNSKEYRecord(DNSKEYRecordParam): + id: Required[str] + """Identifier""" + + +class PutDSRecord(DSRecordParam): + id: Required[str] + """Identifier""" + + +class PutHTTPSRecord(HTTPSRecordParam): + id: Required[str] + """Identifier""" + + +class PutLOCRecord(LOCRecordParam): + id: Required[str] + """Identifier""" + + +class PutMXRecord(MXRecordParam): + id: Required[str] + """Identifier""" + + +class PutNAPTRRecord(NAPTRRecordParam): + id: Required[str] + """Identifier""" + + +class PutNSRecord(NSRecordParam): + id: Required[str] + """Identifier""" + + +class PutOpenpgpkeyRecord(TypedDict, total=False): + id: Required[str] + """Identifier""" + + content: Required[str] + """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["OPENPGPKEY"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + proxied: bool + """ + Whether the record is receiving the performance and security benefits of + Cloudflare. + """ + + tags: List[RecordTags] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: TTLParam + """Time To Live (TTL) of the DNS record in seconds. + + Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the + minimum reduced to 30 for Enterprise zones. + """ + + +class PutPTRRecord(PTRRecordParam): + id: Required[str] + """Identifier""" + + +class PutSMIMEARecord(SMIMEARecordParam): + id: Required[str] + """Identifier""" + + +class PutSRVRecord(SRVRecordParam): + id: Required[str] + """Identifier""" + + +class PutSSHFPRecord(SSHFPRecordParam): + id: Required[str] + """Identifier""" + + +class PutSVCBRecord(SVCBRecordParam): + id: Required[str] + """Identifier""" + + +class PutTLSARecord(TLSARecordParam): + id: Required[str] + """Identifier""" + + +class PutTXTRecord(TXTRecordParam): + id: Required[str] + """Identifier""" + + +class PutURIRecord(URIRecordParam): + id: Required[str] + """Identifier""" + + +Put: TypeAlias = Union[ + PutARecord, + PutAAAARecord, + PutCAARecord, + PutCERTRecord, + PutCNAMERecord, + PutDNSKEYRecord, + PutDSRecord, + PutHTTPSRecord, + PutLOCRecord, + PutMXRecord, + PutNAPTRRecord, + PutNSRecord, + PutOpenpgpkeyRecord, + PutPTRRecord, + PutSMIMEARecord, + PutSRVRecord, + PutSSHFPRecord, + PutSVCBRecord, + PutTLSARecord, + PutTXTRecord, + PutURIRecord, +] diff --git a/src/cloudflare/types/dns/record_batch_response.py b/src/cloudflare/types/dns/record_batch_response.py index 4bdc03c4b1c..c11f212f328 100644 --- a/src/cloudflare/types/dns/record_batch_response.py +++ b/src/cloudflare/types/dns/record_batch_response.py @@ -1,18 +1,2287 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, TypeAlias +from .ttl import TTL +from .a_record import ARecord from ..._models import BaseModel -from .record_response import RecordResponse +from .ds_record import DSRecord +from .mx_record import MXRecord +from .ns_record import NSRecord +from .caa_record import CAARecord +from .loc_record import LOCRecord +from .ptr_record import PTRRecord +from .srv_record import SRVRecord +from .txt_record import TXTRecord +from .uri_record import URIRecord +from .aaaa_record import AAAARecord +from .cert_record import CERTRecord +from .record_tags import RecordTags +from .svcb_record import SVCBRecord +from .tlsa_record import TLSARecord +from .cname_record import CNAMERecord +from .https_record import HTTPSRecord +from .naptr_record import NAPTRRecord +from .sshfp_record import SSHFPRecord +from .dnskey_record import DNSKEYRecord +from .smimea_record import SMIMEARecord -__all__ = ["RecordBatchResponse"] +__all__ = [ + "RecordBatchResponse", + "Delete", + "DeleteARecord", + "DeleteAAAARecord", + "DeleteCAARecord", + "DeleteCERTRecord", + "DeleteCNAMERecord", + "DeleteDNSKEYRecord", + "DeleteDSRecord", + "DeleteHTTPSRecord", + "DeleteLOCRecord", + "DeleteMXRecord", + "DeleteNAPTRRecord", + "DeleteNSRecord", + "DeleteOpenpgpkeyRecord", + "DeletePTRRecord", + "DeleteSMIMEARecord", + "DeleteSRVRecord", + "DeleteSSHFPRecord", + "DeleteSVCBRecord", + "DeleteTLSARecord", + "DeleteTXTRecord", + "DeleteURIRecord", + "Patch", + "PatchARecord", + "PatchAAAARecord", + "PatchCAARecord", + "PatchCERTRecord", + "PatchCNAMERecord", + "PatchDNSKEYRecord", + "PatchDSRecord", + "PatchHTTPSRecord", + "PatchLOCRecord", + "PatchMXRecord", + "PatchNAPTRRecord", + "PatchNSRecord", + "PatchOpenpgpkeyRecord", + "PatchPTRRecord", + "PatchSMIMEARecord", + "PatchSRVRecord", + "PatchSSHFPRecord", + "PatchSVCBRecord", + "PatchTLSARecord", + "PatchTXTRecord", + "PatchURIRecord", + "Post", + "PostARecord", + "PostAAAARecord", + "PostCAARecord", + "PostCERTRecord", + "PostCNAMERecord", + "PostDNSKEYRecord", + "PostDSRecord", + "PostHTTPSRecord", + "PostLOCRecord", + "PostMXRecord", + "PostNAPTRRecord", + "PostNSRecord", + "PostOpenpgpkeyRecord", + "PostPTRRecord", + "PostSMIMEARecord", + "PostSRVRecord", + "PostSSHFPRecord", + "PostSVCBRecord", + "PostTLSARecord", + "PostTXTRecord", + "PostURIRecord", + "Put", + "PutARecord", + "PutAAAARecord", + "PutCAARecord", + "PutCERTRecord", + "PutCNAMERecord", + "PutDNSKEYRecord", + "PutDSRecord", + "PutHTTPSRecord", + "PutLOCRecord", + "PutMXRecord", + "PutNAPTRRecord", + "PutNSRecord", + "PutOpenpgpkeyRecord", + "PutPTRRecord", + "PutSMIMEARecord", + "PutSRVRecord", + "PutSSHFPRecord", + "PutSVCBRecord", + "PutTLSARecord", + "PutTXTRecord", + "PutURIRecord", +] + + +class DeleteARecord(ARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class DeleteAAAARecord(AAAARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class DeleteCAARecord(CAARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class DeleteCERTRecord(CERTRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class DeleteCNAMERecord(CNAMERecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class DeleteDNSKEYRecord(DNSKEYRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class DeleteDSRecord(DSRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class DeleteHTTPSRecord(HTTPSRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class DeleteLOCRecord(LOCRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class DeleteMXRecord(MXRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class DeleteNAPTRRecord(NAPTRRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class DeleteNSRecord(NSRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class DeleteOpenpgpkeyRecord(BaseModel): + id: str + """Identifier""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + content: str + """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + name: str + """DNS record name (or @ for the zone apex) in Punycode.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + proxied: bool + """ + Whether the record is receiving the performance and security benefits of + Cloudflare. + """ + + tags: List[RecordTags] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: TTL + """Time To Live (TTL) of the DNS record in seconds. + + Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the + minimum reduced to 30 for Enterprise zones. + """ + + type: Literal["OPENPGPKEY"] + """Record type.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class DeletePTRRecord(PTRRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class DeleteSMIMEARecord(SMIMEARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class DeleteSRVRecord(SRVRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class DeleteSSHFPRecord(SSHFPRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class DeleteSVCBRecord(SVCBRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class DeleteTLSARecord(TLSARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class DeleteTXTRecord(TXTRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class DeleteURIRecord(URIRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +Delete: TypeAlias = Union[ + DeleteARecord, + DeleteAAAARecord, + DeleteCAARecord, + DeleteCERTRecord, + DeleteCNAMERecord, + DeleteDNSKEYRecord, + DeleteDSRecord, + DeleteHTTPSRecord, + DeleteLOCRecord, + DeleteMXRecord, + DeleteNAPTRRecord, + DeleteNSRecord, + DeleteOpenpgpkeyRecord, + DeletePTRRecord, + DeleteSMIMEARecord, + DeleteSRVRecord, + DeleteSSHFPRecord, + DeleteSVCBRecord, + DeleteTLSARecord, + DeleteTXTRecord, + DeleteURIRecord, +] + + +class PatchARecord(ARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PatchAAAARecord(AAAARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PatchCAARecord(CAARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PatchCERTRecord(CERTRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PatchCNAMERecord(CNAMERecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PatchDNSKEYRecord(DNSKEYRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PatchDSRecord(DSRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PatchHTTPSRecord(HTTPSRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PatchLOCRecord(LOCRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PatchMXRecord(MXRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PatchNAPTRRecord(NAPTRRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PatchNSRecord(NSRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PatchOpenpgpkeyRecord(BaseModel): + id: str + """Identifier""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + content: str + """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + name: str + """DNS record name (or @ for the zone apex) in Punycode.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + proxied: bool + """ + Whether the record is receiving the performance and security benefits of + Cloudflare. + """ + + tags: List[RecordTags] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: TTL + """Time To Live (TTL) of the DNS record in seconds. + + Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the + minimum reduced to 30 for Enterprise zones. + """ + + type: Literal["OPENPGPKEY"] + """Record type.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PatchPTRRecord(PTRRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PatchSMIMEARecord(SMIMEARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PatchSRVRecord(SRVRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PatchSSHFPRecord(SSHFPRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PatchSVCBRecord(SVCBRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PatchTLSARecord(TLSARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PatchTXTRecord(TXTRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PatchURIRecord(URIRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +Patch: TypeAlias = Union[ + PatchARecord, + PatchAAAARecord, + PatchCAARecord, + PatchCERTRecord, + PatchCNAMERecord, + PatchDNSKEYRecord, + PatchDSRecord, + PatchHTTPSRecord, + PatchLOCRecord, + PatchMXRecord, + PatchNAPTRRecord, + PatchNSRecord, + PatchOpenpgpkeyRecord, + PatchPTRRecord, + PatchSMIMEARecord, + PatchSRVRecord, + PatchSSHFPRecord, + PatchSVCBRecord, + PatchTLSARecord, + PatchTXTRecord, + PatchURIRecord, +] + + +class PostARecord(ARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PostAAAARecord(AAAARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PostCAARecord(CAARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PostCERTRecord(CERTRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PostCNAMERecord(CNAMERecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PostDNSKEYRecord(DNSKEYRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PostDSRecord(DSRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PostHTTPSRecord(HTTPSRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PostLOCRecord(LOCRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PostMXRecord(MXRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PostNAPTRRecord(NAPTRRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PostNSRecord(NSRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PostOpenpgpkeyRecord(BaseModel): + id: str + """Identifier""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + content: str + """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + name: str + """DNS record name (or @ for the zone apex) in Punycode.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + proxied: bool + """ + Whether the record is receiving the performance and security benefits of + Cloudflare. + """ + + tags: List[RecordTags] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: TTL + """Time To Live (TTL) of the DNS record in seconds. + + Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the + minimum reduced to 30 for Enterprise zones. + """ + + type: Literal["OPENPGPKEY"] + """Record type.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PostPTRRecord(PTRRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PostSMIMEARecord(SMIMEARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PostSRVRecord(SRVRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PostSSHFPRecord(SSHFPRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PostSVCBRecord(SVCBRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PostTLSARecord(TLSARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PostTXTRecord(TXTRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PostURIRecord(URIRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +Post: TypeAlias = Union[ + PostARecord, + PostAAAARecord, + PostCAARecord, + PostCERTRecord, + PostCNAMERecord, + PostDNSKEYRecord, + PostDSRecord, + PostHTTPSRecord, + PostLOCRecord, + PostMXRecord, + PostNAPTRRecord, + PostNSRecord, + PostOpenpgpkeyRecord, + PostPTRRecord, + PostSMIMEARecord, + PostSRVRecord, + PostSSHFPRecord, + PostSVCBRecord, + PostTLSARecord, + PostTXTRecord, + PostURIRecord, +] + + +class PutARecord(ARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PutAAAARecord(AAAARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PutCAARecord(CAARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PutCERTRecord(CERTRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PutCNAMERecord(CNAMERecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PutDNSKEYRecord(DNSKEYRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PutDSRecord(DSRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PutHTTPSRecord(HTTPSRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PutLOCRecord(LOCRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PutMXRecord(MXRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PutNAPTRRecord(NAPTRRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PutNSRecord(NSRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PutOpenpgpkeyRecord(BaseModel): + id: str + """Identifier""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + content: str + """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + name: str + """DNS record name (or @ for the zone apex) in Punycode.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + proxied: bool + """ + Whether the record is receiving the performance and security benefits of + Cloudflare. + """ + + tags: List[RecordTags] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: TTL + """Time To Live (TTL) of the DNS record in seconds. + + Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the + minimum reduced to 30 for Enterprise zones. + """ + + type: Literal["OPENPGPKEY"] + """Record type.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PutPTRRecord(PTRRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PutSMIMEARecord(SMIMEARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PutSRVRecord(SRVRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PutSSHFPRecord(SSHFPRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PutSVCBRecord(SVCBRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PutTLSARecord(TLSARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PutTXTRecord(TXTRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PutURIRecord(URIRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +Put: TypeAlias = Union[ + PutARecord, + PutAAAARecord, + PutCAARecord, + PutCERTRecord, + PutCNAMERecord, + PutDNSKEYRecord, + PutDSRecord, + PutHTTPSRecord, + PutLOCRecord, + PutMXRecord, + PutNAPTRRecord, + PutNSRecord, + PutOpenpgpkeyRecord, + PutPTRRecord, + PutSMIMEARecord, + PutSRVRecord, + PutSSHFPRecord, + PutSVCBRecord, + PutTLSARecord, + PutTXTRecord, + PutURIRecord, +] class RecordBatchResponse(BaseModel): - deletes: Optional[List[RecordResponse]] = None + deletes: Optional[List[Delete]] = None - patches: Optional[List[RecordResponse]] = None + patches: Optional[List[Patch]] = None - posts: Optional[List[RecordResponse]] = None + posts: Optional[List[Post]] = None - puts: Optional[List[RecordResponse]] = None + puts: Optional[List[Put]] = None diff --git a/src/cloudflare/types/dns/record_create_params.py b/src/cloudflare/types/dns/record_create_params.py index c04cfc7995e..b9ce9b46a95 100644 --- a/src/cloudflare/types/dns/record_create_params.py +++ b/src/cloudflare/types/dns/record_create_params.py @@ -11,60 +11,40 @@ __all__ = [ "RecordCreateParams", "ARecord", - "ARecordSettings", "AAAARecord", - "AAAARecordSettings", "CAARecord", "CAARecordData", - "CAARecordSettings", "CERTRecord", "CERTRecordData", - "CERTRecordSettings", "CNAMERecord", "CNAMERecordSettings", "DNSKEYRecord", "DNSKEYRecordData", - "DNSKEYRecordSettings", "DSRecord", "DSRecordData", - "DSRecordSettings", "HTTPSRecord", "HTTPSRecordData", - "HTTPSRecordSettings", "LOCRecord", "LOCRecordData", - "LOCRecordSettings", "MXRecord", - "MXRecordSettings", "NAPTRRecord", "NAPTRRecordData", - "NAPTRRecordSettings", "NSRecord", - "NSRecordSettings", "DNSRecordsOpenpgpkeyRecord", - "DNSRecordsOpenpgpkeyRecordSettings", "PTRRecord", - "PTRRecordSettings", "SMIMEARecord", "SMIMEARecordData", - "SMIMEARecordSettings", "SRVRecord", "SRVRecordData", - "SRVRecordSettings", "SSHFPRecord", "SSHFPRecordData", - "SSHFPRecordSettings", "SVCBRecord", "SVCBRecordData", - "SVCBRecordSettings", "TLSARecord", "TLSARecordData", - "TLSARecordSettings", "TXTRecord", - "TXTRecordSettings", "URIRecord", "URIRecordData", - "URIRecordSettings", ] @@ -90,9 +70,6 @@ class ARecord(TypedDict, total=False): Cloudflare. """ - settings: ARecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -107,24 +84,6 @@ class ARecord(TypedDict, total=False): """Record type.""" -class ARecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class AAAARecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -147,9 +106,6 @@ class AAAARecord(TypedDict, total=False): Cloudflare. """ - settings: AAAARecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -164,24 +120,6 @@ class AAAARecord(TypedDict, total=False): """Record type.""" -class AAAARecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class CAARecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -204,9 +142,6 @@ class CAARecord(TypedDict, total=False): Cloudflare. """ - settings: CAARecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -232,24 +167,6 @@ class CAARecordData(TypedDict, total=False): """Value of the record. This field's semantics depend on the chosen tag.""" -class CAARecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class CERTRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -272,9 +189,6 @@ class CERTRecord(TypedDict, total=False): Cloudflare. """ - settings: CERTRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -303,24 +217,6 @@ class CERTRecordData(TypedDict, total=False): """Type.""" -class CERTRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class CNAMERecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -344,7 +240,6 @@ class CNAMERecord(TypedDict, total=False): """ settings: CNAMERecordSettings - """Settings for the DNS record.""" tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -365,26 +260,10 @@ class CNAMERecordSettings(TypedDict, total=False): """ If enabled, causes the CNAME record to be resolved externally and the resulting address records (e.g., A and AAAA) to be returned instead of the CNAME record - itself. This setting is unavailable for proxied records, since they are always + itself. This setting has no effect on proxied records, which are always flattened. """ - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - class DNSKEYRecord(TypedDict, total=False): zone_id: Required[str] @@ -408,9 +287,6 @@ class DNSKEYRecord(TypedDict, total=False): Cloudflare. """ - settings: DNSKEYRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -439,24 +315,6 @@ class DNSKEYRecordData(TypedDict, total=False): """Public Key.""" -class DNSKEYRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class DSRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -479,9 +337,6 @@ class DSRecord(TypedDict, total=False): Cloudflare. """ - settings: DSRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -510,24 +365,6 @@ class DSRecordData(TypedDict, total=False): """Key Tag.""" -class DSRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class HTTPSRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -550,9 +387,6 @@ class HTTPSRecord(TypedDict, total=False): Cloudflare. """ - settings: HTTPSRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -578,24 +412,6 @@ class HTTPSRecordData(TypedDict, total=False): """value.""" -class HTTPSRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class LOCRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -618,9 +434,6 @@ class LOCRecord(TypedDict, total=False): Cloudflare. """ - settings: LOCRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -673,24 +486,6 @@ class LOCRecordData(TypedDict, total=False): """Size of location in meters.""" -class LOCRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class MXRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -719,9 +514,6 @@ class MXRecord(TypedDict, total=False): Cloudflare. """ - settings: MXRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -736,24 +528,6 @@ class MXRecord(TypedDict, total=False): """Record type.""" -class MXRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class NAPTRRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -776,9 +550,6 @@ class NAPTRRecord(TypedDict, total=False): Cloudflare. """ - settings: NAPTRRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -813,24 +584,6 @@ class NAPTRRecordData(TypedDict, total=False): """Service.""" -class NAPTRRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class NSRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -853,9 +606,6 @@ class NSRecord(TypedDict, total=False): Cloudflare. """ - settings: NSRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -870,24 +620,6 @@ class NSRecord(TypedDict, total=False): """Record type.""" -class NSRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -910,9 +642,6 @@ class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): Cloudflare. """ - settings: DNSRecordsOpenpgpkeyRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -927,24 +656,6 @@ class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): """Record type.""" -class DNSRecordsOpenpgpkeyRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class PTRRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -967,9 +678,6 @@ class PTRRecord(TypedDict, total=False): Cloudflare. """ - settings: PTRRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -984,24 +692,6 @@ class PTRRecord(TypedDict, total=False): """Record type.""" -class PTRRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class SMIMEARecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -1024,9 +714,6 @@ class SMIMEARecord(TypedDict, total=False): Cloudflare. """ - settings: SMIMEARecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -1055,24 +742,6 @@ class SMIMEARecordData(TypedDict, total=False): """Usage.""" -class SMIMEARecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class SRVRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -1095,9 +764,6 @@ class SRVRecord(TypedDict, total=False): Cloudflare. """ - settings: SRVRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -1129,24 +795,6 @@ class SRVRecordData(TypedDict, total=False): """The record weight.""" -class SRVRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class SSHFPRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -1169,9 +817,6 @@ class SSHFPRecord(TypedDict, total=False): Cloudflare. """ - settings: SSHFPRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -1197,24 +842,6 @@ class SSHFPRecordData(TypedDict, total=False): """type.""" -class SSHFPRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class SVCBRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -1237,9 +864,6 @@ class SVCBRecord(TypedDict, total=False): Cloudflare. """ - settings: SVCBRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -1265,24 +889,6 @@ class SVCBRecordData(TypedDict, total=False): """value.""" -class SVCBRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class TLSARecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -1305,9 +911,6 @@ class TLSARecord(TypedDict, total=False): Cloudflare. """ - settings: TLSARecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -1336,24 +939,6 @@ class TLSARecordData(TypedDict, total=False): """Usage.""" -class TLSARecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class TXTRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -1384,9 +969,6 @@ class TXTRecord(TypedDict, total=False): Cloudflare. """ - settings: TXTRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -1401,24 +983,6 @@ class TXTRecord(TypedDict, total=False): """Record type.""" -class TXTRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class URIRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -1447,9 +1011,6 @@ class URIRecord(TypedDict, total=False): Cloudflare. """ - settings: URIRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -1472,24 +1033,6 @@ class URIRecordData(TypedDict, total=False): """The record weight.""" -class URIRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - RecordCreateParams: TypeAlias = Union[ ARecord, AAAARecord, diff --git a/src/cloudflare/types/dns/record_response.py b/src/cloudflare/types/dns/record_create_response.py similarity index 94% rename from src/cloudflare/types/dns/record_response.py rename to src/cloudflare/types/dns/record_create_response.py index 86334c5f111..ae0ed8bb218 100644 --- a/src/cloudflare/types/dns/record_response.py +++ b/src/cloudflare/types/dns/record_create_response.py @@ -31,7 +31,7 @@ from .record_tags import RecordTags __all__ = [ - "RecordResponse", + "RecordCreateResponse", "ARecord", "AAAARecord", "CAARecord", @@ -44,8 +44,7 @@ "MXRecord", "NAPTRRecord", "NSRecord", - "Openpgpkey", - "OpenpgpkeySettings", + "OpenpgpkeyRecord", "PTRRecord", "SMIMEARecord", "SRVRecord", @@ -333,25 +332,7 @@ class NSRecord(ns_record.NSRecord): """When the record tags were last modified. Omitted if there are no tags.""" -class OpenpgpkeySettings(BaseModel): - ipv4_only: Optional[bool] = None - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: Optional[bool] = None - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - -class Openpgpkey(BaseModel): +class OpenpgpkeyRecord(BaseModel): id: str """Identifier""" @@ -385,9 +366,6 @@ class Openpgpkey(BaseModel): Cloudflare. """ - settings: OpenpgpkeySettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -592,7 +570,7 @@ class URIRecord(uri_record.URIRecord): """When the record tags were last modified. Omitted if there are no tags.""" -RecordResponse: TypeAlias = Union[ +RecordCreateResponse: TypeAlias = Union[ ARecord, AAAARecord, CAARecord, @@ -605,7 +583,7 @@ class URIRecord(uri_record.URIRecord): MXRecord, NAPTRRecord, NSRecord, - Openpgpkey, + OpenpgpkeyRecord, PTRRecord, SMIMEARecord, SRVRecord, diff --git a/src/cloudflare/types/dns/record_edit_params.py b/src/cloudflare/types/dns/record_edit_params.py index 179b94923d9..560790f1419 100644 --- a/src/cloudflare/types/dns/record_edit_params.py +++ b/src/cloudflare/types/dns/record_edit_params.py @@ -11,60 +11,40 @@ __all__ = [ "RecordEditParams", "ARecord", - "ARecordSettings", "AAAARecord", - "AAAARecordSettings", "CAARecord", "CAARecordData", - "CAARecordSettings", "CERTRecord", "CERTRecordData", - "CERTRecordSettings", "CNAMERecord", "CNAMERecordSettings", "DNSKEYRecord", "DNSKEYRecordData", - "DNSKEYRecordSettings", "DSRecord", "DSRecordData", - "DSRecordSettings", "HTTPSRecord", "HTTPSRecordData", - "HTTPSRecordSettings", "LOCRecord", "LOCRecordData", - "LOCRecordSettings", "MXRecord", - "MXRecordSettings", "NAPTRRecord", "NAPTRRecordData", - "NAPTRRecordSettings", "NSRecord", - "NSRecordSettings", "DNSRecordsOpenpgpkeyRecord", - "DNSRecordsOpenpgpkeyRecordSettings", "PTRRecord", - "PTRRecordSettings", "SMIMEARecord", "SMIMEARecordData", - "SMIMEARecordSettings", "SRVRecord", "SRVRecordData", - "SRVRecordSettings", "SSHFPRecord", "SSHFPRecordData", - "SSHFPRecordSettings", "SVCBRecord", "SVCBRecordData", - "SVCBRecordSettings", "TLSARecord", "TLSARecordData", - "TLSARecordSettings", "TXTRecord", - "TXTRecordSettings", "URIRecord", "URIRecordData", - "URIRecordSettings", ] @@ -90,9 +70,6 @@ class ARecord(TypedDict, total=False): Cloudflare. """ - settings: ARecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -107,24 +84,6 @@ class ARecord(TypedDict, total=False): """Record type.""" -class ARecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class AAAARecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -147,9 +106,6 @@ class AAAARecord(TypedDict, total=False): Cloudflare. """ - settings: AAAARecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -164,24 +120,6 @@ class AAAARecord(TypedDict, total=False): """Record type.""" -class AAAARecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class CAARecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -204,9 +142,6 @@ class CAARecord(TypedDict, total=False): Cloudflare. """ - settings: CAARecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -232,24 +167,6 @@ class CAARecordData(TypedDict, total=False): """Value of the record. This field's semantics depend on the chosen tag.""" -class CAARecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class CERTRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -272,9 +189,6 @@ class CERTRecord(TypedDict, total=False): Cloudflare. """ - settings: CERTRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -303,24 +217,6 @@ class CERTRecordData(TypedDict, total=False): """Type.""" -class CERTRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class CNAMERecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -344,7 +240,6 @@ class CNAMERecord(TypedDict, total=False): """ settings: CNAMERecordSettings - """Settings for the DNS record.""" tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -365,26 +260,10 @@ class CNAMERecordSettings(TypedDict, total=False): """ If enabled, causes the CNAME record to be resolved externally and the resulting address records (e.g., A and AAAA) to be returned instead of the CNAME record - itself. This setting is unavailable for proxied records, since they are always + itself. This setting has no effect on proxied records, which are always flattened. """ - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - class DNSKEYRecord(TypedDict, total=False): zone_id: Required[str] @@ -408,9 +287,6 @@ class DNSKEYRecord(TypedDict, total=False): Cloudflare. """ - settings: DNSKEYRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -439,24 +315,6 @@ class DNSKEYRecordData(TypedDict, total=False): """Public Key.""" -class DNSKEYRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class DSRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -479,9 +337,6 @@ class DSRecord(TypedDict, total=False): Cloudflare. """ - settings: DSRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -510,24 +365,6 @@ class DSRecordData(TypedDict, total=False): """Key Tag.""" -class DSRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class HTTPSRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -550,9 +387,6 @@ class HTTPSRecord(TypedDict, total=False): Cloudflare. """ - settings: HTTPSRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -578,24 +412,6 @@ class HTTPSRecordData(TypedDict, total=False): """value.""" -class HTTPSRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class LOCRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -618,9 +434,6 @@ class LOCRecord(TypedDict, total=False): Cloudflare. """ - settings: LOCRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -673,24 +486,6 @@ class LOCRecordData(TypedDict, total=False): """Size of location in meters.""" -class LOCRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class MXRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -719,9 +514,6 @@ class MXRecord(TypedDict, total=False): Cloudflare. """ - settings: MXRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -736,24 +528,6 @@ class MXRecord(TypedDict, total=False): """Record type.""" -class MXRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class NAPTRRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -776,9 +550,6 @@ class NAPTRRecord(TypedDict, total=False): Cloudflare. """ - settings: NAPTRRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -813,24 +584,6 @@ class NAPTRRecordData(TypedDict, total=False): """Service.""" -class NAPTRRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class NSRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -853,9 +606,6 @@ class NSRecord(TypedDict, total=False): Cloudflare. """ - settings: NSRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -870,24 +620,6 @@ class NSRecord(TypedDict, total=False): """Record type.""" -class NSRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -910,9 +642,6 @@ class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): Cloudflare. """ - settings: DNSRecordsOpenpgpkeyRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -927,24 +656,6 @@ class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): """Record type.""" -class DNSRecordsOpenpgpkeyRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class PTRRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -967,9 +678,6 @@ class PTRRecord(TypedDict, total=False): Cloudflare. """ - settings: PTRRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -984,24 +692,6 @@ class PTRRecord(TypedDict, total=False): """Record type.""" -class PTRRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class SMIMEARecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -1024,9 +714,6 @@ class SMIMEARecord(TypedDict, total=False): Cloudflare. """ - settings: SMIMEARecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -1055,24 +742,6 @@ class SMIMEARecordData(TypedDict, total=False): """Usage.""" -class SMIMEARecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class SRVRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -1095,9 +764,6 @@ class SRVRecord(TypedDict, total=False): Cloudflare. """ - settings: SRVRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -1129,24 +795,6 @@ class SRVRecordData(TypedDict, total=False): """The record weight.""" -class SRVRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class SSHFPRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -1169,9 +817,6 @@ class SSHFPRecord(TypedDict, total=False): Cloudflare. """ - settings: SSHFPRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -1197,24 +842,6 @@ class SSHFPRecordData(TypedDict, total=False): """type.""" -class SSHFPRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class SVCBRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -1237,9 +864,6 @@ class SVCBRecord(TypedDict, total=False): Cloudflare. """ - settings: SVCBRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -1265,24 +889,6 @@ class SVCBRecordData(TypedDict, total=False): """value.""" -class SVCBRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class TLSARecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -1305,9 +911,6 @@ class TLSARecord(TypedDict, total=False): Cloudflare. """ - settings: TLSARecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -1336,24 +939,6 @@ class TLSARecordData(TypedDict, total=False): """Usage.""" -class TLSARecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class TXTRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -1384,9 +969,6 @@ class TXTRecord(TypedDict, total=False): Cloudflare. """ - settings: TXTRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -1401,24 +983,6 @@ class TXTRecord(TypedDict, total=False): """Record type.""" -class TXTRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class URIRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -1447,9 +1011,6 @@ class URIRecord(TypedDict, total=False): Cloudflare. """ - settings: URIRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -1472,24 +1033,6 @@ class URIRecordData(TypedDict, total=False): """The record weight.""" -class URIRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - RecordEditParams: TypeAlias = Union[ ARecord, AAAARecord, diff --git a/src/cloudflare/types/dns/record_edit_response.py b/src/cloudflare/types/dns/record_edit_response.py new file mode 100644 index 00000000000..685475e6962 --- /dev/null +++ b/src/cloudflare/types/dns/record_edit_response.py @@ -0,0 +1,595 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, TypeAlias + +from . import ( + a_record, + ds_record, + mx_record, + ns_record, + caa_record, + loc_record, + ptr_record, + srv_record, + txt_record, + uri_record, + aaaa_record, + cert_record, + svcb_record, + tlsa_record, + cname_record, + https_record, + naptr_record, + sshfp_record, + dnskey_record, + smimea_record, +) +from .ttl import TTL +from ..._models import BaseModel +from .record_tags import RecordTags + +__all__ = [ + "RecordEditResponse", + "ARecord", + "AAAARecord", + "CAARecord", + "CERTRecord", + "CNAMERecord", + "DNSKEYRecord", + "DSRecord", + "HTTPSRecord", + "LOCRecord", + "MXRecord", + "NAPTRRecord", + "NSRecord", + "OpenpgpkeyRecord", + "PTRRecord", + "SMIMEARecord", + "SRVRecord", + "SSHFPRecord", + "SVCBRecord", + "TLSARecord", + "TXTRecord", + "URIRecord", +] + + +class ARecord(a_record.ARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class AAAARecord(aaaa_record.AAAARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class CAARecord(caa_record.CAARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class CERTRecord(cert_record.CERTRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class CNAMERecord(cname_record.CNAMERecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class DNSKEYRecord(dnskey_record.DNSKEYRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class DSRecord(ds_record.DSRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class HTTPSRecord(https_record.HTTPSRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class LOCRecord(loc_record.LOCRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class MXRecord(mx_record.MXRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class NAPTRRecord(naptr_record.NAPTRRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class NSRecord(ns_record.NSRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class OpenpgpkeyRecord(BaseModel): + id: str + """Identifier""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + content: str + """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + name: str + """DNS record name (or @ for the zone apex) in Punycode.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + proxied: bool + """ + Whether the record is receiving the performance and security benefits of + Cloudflare. + """ + + tags: List[RecordTags] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: TTL + """Time To Live (TTL) of the DNS record in seconds. + + Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the + minimum reduced to 30 for Enterprise zones. + """ + + type: Literal["OPENPGPKEY"] + """Record type.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PTRRecord(ptr_record.PTRRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class SMIMEARecord(smimea_record.SMIMEARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class SRVRecord(srv_record.SRVRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class SSHFPRecord(sshfp_record.SSHFPRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class SVCBRecord(svcb_record.SVCBRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class TLSARecord(tlsa_record.TLSARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class TXTRecord(txt_record.TXTRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class URIRecord(uri_record.URIRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +RecordEditResponse: TypeAlias = Union[ + ARecord, + AAAARecord, + CAARecord, + CERTRecord, + CNAMERecord, + DNSKEYRecord, + DSRecord, + HTTPSRecord, + LOCRecord, + MXRecord, + NAPTRRecord, + NSRecord, + OpenpgpkeyRecord, + PTRRecord, + SMIMEARecord, + SRVRecord, + SSHFPRecord, + SVCBRecord, + TLSARecord, + TXTRecord, + URIRecord, +] diff --git a/src/cloudflare/types/dns/record_get_response.py b/src/cloudflare/types/dns/record_get_response.py new file mode 100644 index 00000000000..35c2ce1092d --- /dev/null +++ b/src/cloudflare/types/dns/record_get_response.py @@ -0,0 +1,595 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, TypeAlias + +from . import ( + a_record, + ds_record, + mx_record, + ns_record, + caa_record, + loc_record, + ptr_record, + srv_record, + txt_record, + uri_record, + aaaa_record, + cert_record, + svcb_record, + tlsa_record, + cname_record, + https_record, + naptr_record, + sshfp_record, + dnskey_record, + smimea_record, +) +from .ttl import TTL +from ..._models import BaseModel +from .record_tags import RecordTags + +__all__ = [ + "RecordGetResponse", + "ARecord", + "AAAARecord", + "CAARecord", + "CERTRecord", + "CNAMERecord", + "DNSKEYRecord", + "DSRecord", + "HTTPSRecord", + "LOCRecord", + "MXRecord", + "NAPTRRecord", + "NSRecord", + "OpenpgpkeyRecord", + "PTRRecord", + "SMIMEARecord", + "SRVRecord", + "SSHFPRecord", + "SVCBRecord", + "TLSARecord", + "TXTRecord", + "URIRecord", +] + + +class ARecord(a_record.ARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class AAAARecord(aaaa_record.AAAARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class CAARecord(caa_record.CAARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class CERTRecord(cert_record.CERTRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class CNAMERecord(cname_record.CNAMERecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class DNSKEYRecord(dnskey_record.DNSKEYRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class DSRecord(ds_record.DSRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class HTTPSRecord(https_record.HTTPSRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class LOCRecord(loc_record.LOCRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class MXRecord(mx_record.MXRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class NAPTRRecord(naptr_record.NAPTRRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class NSRecord(ns_record.NSRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class OpenpgpkeyRecord(BaseModel): + id: str + """Identifier""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + content: str + """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + name: str + """DNS record name (or @ for the zone apex) in Punycode.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + proxied: bool + """ + Whether the record is receiving the performance and security benefits of + Cloudflare. + """ + + tags: List[RecordTags] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: TTL + """Time To Live (TTL) of the DNS record in seconds. + + Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the + minimum reduced to 30 for Enterprise zones. + """ + + type: Literal["OPENPGPKEY"] + """Record type.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PTRRecord(ptr_record.PTRRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class SMIMEARecord(smimea_record.SMIMEARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class SRVRecord(srv_record.SRVRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class SSHFPRecord(sshfp_record.SSHFPRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class SVCBRecord(svcb_record.SVCBRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class TLSARecord(tlsa_record.TLSARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class TXTRecord(txt_record.TXTRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class URIRecord(uri_record.URIRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +RecordGetResponse: TypeAlias = Union[ + ARecord, + AAAARecord, + CAARecord, + CERTRecord, + CNAMERecord, + DNSKEYRecord, + DSRecord, + HTTPSRecord, + LOCRecord, + MXRecord, + NAPTRRecord, + NSRecord, + OpenpgpkeyRecord, + PTRRecord, + SMIMEARecord, + SRVRecord, + SSHFPRecord, + SVCBRecord, + TLSARecord, + TXTRecord, + URIRecord, +] diff --git a/src/cloudflare/types/dns/record_list_response.py b/src/cloudflare/types/dns/record_list_response.py new file mode 100644 index 00000000000..db08bb0b1a0 --- /dev/null +++ b/src/cloudflare/types/dns/record_list_response.py @@ -0,0 +1,595 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, TypeAlias + +from . import ( + a_record, + ds_record, + mx_record, + ns_record, + caa_record, + loc_record, + ptr_record, + srv_record, + txt_record, + uri_record, + aaaa_record, + cert_record, + svcb_record, + tlsa_record, + cname_record, + https_record, + naptr_record, + sshfp_record, + dnskey_record, + smimea_record, +) +from .ttl import TTL +from ..._models import BaseModel +from .record_tags import RecordTags + +__all__ = [ + "RecordListResponse", + "ARecord", + "AAAARecord", + "CAARecord", + "CERTRecord", + "CNAMERecord", + "DNSKEYRecord", + "DSRecord", + "HTTPSRecord", + "LOCRecord", + "MXRecord", + "NAPTRRecord", + "NSRecord", + "OpenpgpkeyRecord", + "PTRRecord", + "SMIMEARecord", + "SRVRecord", + "SSHFPRecord", + "SVCBRecord", + "TLSARecord", + "TXTRecord", + "URIRecord", +] + + +class ARecord(a_record.ARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class AAAARecord(aaaa_record.AAAARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class CAARecord(caa_record.CAARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class CERTRecord(cert_record.CERTRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class CNAMERecord(cname_record.CNAMERecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class DNSKEYRecord(dnskey_record.DNSKEYRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class DSRecord(ds_record.DSRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class HTTPSRecord(https_record.HTTPSRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class LOCRecord(loc_record.LOCRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class MXRecord(mx_record.MXRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class NAPTRRecord(naptr_record.NAPTRRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class NSRecord(ns_record.NSRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class OpenpgpkeyRecord(BaseModel): + id: str + """Identifier""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + content: str + """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + name: str + """DNS record name (or @ for the zone apex) in Punycode.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + proxied: bool + """ + Whether the record is receiving the performance and security benefits of + Cloudflare. + """ + + tags: List[RecordTags] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: TTL + """Time To Live (TTL) of the DNS record in seconds. + + Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the + minimum reduced to 30 for Enterprise zones. + """ + + type: Literal["OPENPGPKEY"] + """Record type.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PTRRecord(ptr_record.PTRRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class SMIMEARecord(smimea_record.SMIMEARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class SRVRecord(srv_record.SRVRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class SSHFPRecord(sshfp_record.SSHFPRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class SVCBRecord(svcb_record.SVCBRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class TLSARecord(tlsa_record.TLSARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class TXTRecord(txt_record.TXTRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class URIRecord(uri_record.URIRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +RecordListResponse: TypeAlias = Union[ + ARecord, + AAAARecord, + CAARecord, + CERTRecord, + CNAMERecord, + DNSKEYRecord, + DSRecord, + HTTPSRecord, + LOCRecord, + MXRecord, + NAPTRRecord, + NSRecord, + OpenpgpkeyRecord, + PTRRecord, + SMIMEARecord, + SRVRecord, + SSHFPRecord, + SVCBRecord, + TLSARecord, + TXTRecord, + URIRecord, +] diff --git a/src/cloudflare/types/dns/record_param.py b/src/cloudflare/types/dns/record_param.py index fd9202fefef..86c91d8b874 100644 --- a/src/cloudflare/types/dns/record_param.py +++ b/src/cloudflare/types/dns/record_param.py @@ -28,28 +28,10 @@ from .dnskey_record_param import DNSKEYRecordParam from .smimea_record_param import SMIMEARecordParam -__all__ = ["RecordParam", "Openpgpkey", "OpenpgpkeySettings"] +__all__ = ["RecordParam", "DNSRecordsOpenpgpkeyRecord"] -class OpenpgpkeySettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - -class Openpgpkey(TypedDict, total=False): +class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): comment: str """Comments or notes about the DNS record. @@ -68,9 +50,6 @@ class Openpgpkey(TypedDict, total=False): Cloudflare. """ - settings: OpenpgpkeySettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -98,7 +77,7 @@ class Openpgpkey(TypedDict, total=False): MXRecordParam, NAPTRRecordParam, NSRecordParam, - Openpgpkey, + DNSRecordsOpenpgpkeyRecord, PTRRecordParam, SMIMEARecordParam, SRVRecordParam, diff --git a/src/cloudflare/types/dns/record_process_timing.py b/src/cloudflare/types/dns/record_process_timing.py new file mode 100644 index 00000000000..1fc4d7db12a --- /dev/null +++ b/src/cloudflare/types/dns/record_process_timing.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from ..._models import BaseModel + +__all__ = ["RecordProcessTiming"] + + +class RecordProcessTiming(BaseModel): + end_time: Optional[datetime] = None + """When the file parsing ended.""" + + process_time: Optional[float] = None + """Processing time of the file in seconds.""" + + start_time: Optional[datetime] = None + """When the file parsing started.""" diff --git a/src/cloudflare/types/dns/record_update_params.py b/src/cloudflare/types/dns/record_update_params.py index e594247fb7e..d959b8c6e1e 100644 --- a/src/cloudflare/types/dns/record_update_params.py +++ b/src/cloudflare/types/dns/record_update_params.py @@ -11,60 +11,40 @@ __all__ = [ "RecordUpdateParams", "ARecord", - "ARecordSettings", "AAAARecord", - "AAAARecordSettings", "CAARecord", "CAARecordData", - "CAARecordSettings", "CERTRecord", "CERTRecordData", - "CERTRecordSettings", "CNAMERecord", "CNAMERecordSettings", "DNSKEYRecord", "DNSKEYRecordData", - "DNSKEYRecordSettings", "DSRecord", "DSRecordData", - "DSRecordSettings", "HTTPSRecord", "HTTPSRecordData", - "HTTPSRecordSettings", "LOCRecord", "LOCRecordData", - "LOCRecordSettings", "MXRecord", - "MXRecordSettings", "NAPTRRecord", "NAPTRRecordData", - "NAPTRRecordSettings", "NSRecord", - "NSRecordSettings", "DNSRecordsOpenpgpkeyRecord", - "DNSRecordsOpenpgpkeyRecordSettings", "PTRRecord", - "PTRRecordSettings", "SMIMEARecord", "SMIMEARecordData", - "SMIMEARecordSettings", "SRVRecord", "SRVRecordData", - "SRVRecordSettings", "SSHFPRecord", "SSHFPRecordData", - "SSHFPRecordSettings", "SVCBRecord", "SVCBRecordData", - "SVCBRecordSettings", "TLSARecord", "TLSARecordData", - "TLSARecordSettings", "TXTRecord", - "TXTRecordSettings", "URIRecord", "URIRecordData", - "URIRecordSettings", ] @@ -90,9 +70,6 @@ class ARecord(TypedDict, total=False): Cloudflare. """ - settings: ARecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -107,24 +84,6 @@ class ARecord(TypedDict, total=False): """Record type.""" -class ARecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class AAAARecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -147,9 +106,6 @@ class AAAARecord(TypedDict, total=False): Cloudflare. """ - settings: AAAARecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -164,24 +120,6 @@ class AAAARecord(TypedDict, total=False): """Record type.""" -class AAAARecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class CAARecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -204,9 +142,6 @@ class CAARecord(TypedDict, total=False): Cloudflare. """ - settings: CAARecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -232,24 +167,6 @@ class CAARecordData(TypedDict, total=False): """Value of the record. This field's semantics depend on the chosen tag.""" -class CAARecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class CERTRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -272,9 +189,6 @@ class CERTRecord(TypedDict, total=False): Cloudflare. """ - settings: CERTRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -303,24 +217,6 @@ class CERTRecordData(TypedDict, total=False): """Type.""" -class CERTRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class CNAMERecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -344,7 +240,6 @@ class CNAMERecord(TypedDict, total=False): """ settings: CNAMERecordSettings - """Settings for the DNS record.""" tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -365,26 +260,10 @@ class CNAMERecordSettings(TypedDict, total=False): """ If enabled, causes the CNAME record to be resolved externally and the resulting address records (e.g., A and AAAA) to be returned instead of the CNAME record - itself. This setting is unavailable for proxied records, since they are always + itself. This setting has no effect on proxied records, which are always flattened. """ - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - class DNSKEYRecord(TypedDict, total=False): zone_id: Required[str] @@ -408,9 +287,6 @@ class DNSKEYRecord(TypedDict, total=False): Cloudflare. """ - settings: DNSKEYRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -439,24 +315,6 @@ class DNSKEYRecordData(TypedDict, total=False): """Public Key.""" -class DNSKEYRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class DSRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -479,9 +337,6 @@ class DSRecord(TypedDict, total=False): Cloudflare. """ - settings: DSRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -510,24 +365,6 @@ class DSRecordData(TypedDict, total=False): """Key Tag.""" -class DSRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class HTTPSRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -550,9 +387,6 @@ class HTTPSRecord(TypedDict, total=False): Cloudflare. """ - settings: HTTPSRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -578,24 +412,6 @@ class HTTPSRecordData(TypedDict, total=False): """value.""" -class HTTPSRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class LOCRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -618,9 +434,6 @@ class LOCRecord(TypedDict, total=False): Cloudflare. """ - settings: LOCRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -673,24 +486,6 @@ class LOCRecordData(TypedDict, total=False): """Size of location in meters.""" -class LOCRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class MXRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -719,9 +514,6 @@ class MXRecord(TypedDict, total=False): Cloudflare. """ - settings: MXRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -736,24 +528,6 @@ class MXRecord(TypedDict, total=False): """Record type.""" -class MXRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class NAPTRRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -776,9 +550,6 @@ class NAPTRRecord(TypedDict, total=False): Cloudflare. """ - settings: NAPTRRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -813,24 +584,6 @@ class NAPTRRecordData(TypedDict, total=False): """Service.""" -class NAPTRRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class NSRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -853,9 +606,6 @@ class NSRecord(TypedDict, total=False): Cloudflare. """ - settings: NSRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -870,24 +620,6 @@ class NSRecord(TypedDict, total=False): """Record type.""" -class NSRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -910,9 +642,6 @@ class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): Cloudflare. """ - settings: DNSRecordsOpenpgpkeyRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -927,24 +656,6 @@ class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): """Record type.""" -class DNSRecordsOpenpgpkeyRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class PTRRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -967,9 +678,6 @@ class PTRRecord(TypedDict, total=False): Cloudflare. """ - settings: PTRRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -984,24 +692,6 @@ class PTRRecord(TypedDict, total=False): """Record type.""" -class PTRRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class SMIMEARecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -1024,9 +714,6 @@ class SMIMEARecord(TypedDict, total=False): Cloudflare. """ - settings: SMIMEARecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -1055,24 +742,6 @@ class SMIMEARecordData(TypedDict, total=False): """Usage.""" -class SMIMEARecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class SRVRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -1095,9 +764,6 @@ class SRVRecord(TypedDict, total=False): Cloudflare. """ - settings: SRVRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -1129,24 +795,6 @@ class SRVRecordData(TypedDict, total=False): """The record weight.""" -class SRVRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class SSHFPRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -1169,9 +817,6 @@ class SSHFPRecord(TypedDict, total=False): Cloudflare. """ - settings: SSHFPRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -1197,24 +842,6 @@ class SSHFPRecordData(TypedDict, total=False): """type.""" -class SSHFPRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class SVCBRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -1237,9 +864,6 @@ class SVCBRecord(TypedDict, total=False): Cloudflare. """ - settings: SVCBRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -1265,24 +889,6 @@ class SVCBRecordData(TypedDict, total=False): """value.""" -class SVCBRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class TLSARecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -1305,9 +911,6 @@ class TLSARecord(TypedDict, total=False): Cloudflare. """ - settings: TLSARecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -1336,24 +939,6 @@ class TLSARecordData(TypedDict, total=False): """Usage.""" -class TLSARecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class TXTRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -1384,9 +969,6 @@ class TXTRecord(TypedDict, total=False): Cloudflare. """ - settings: TXTRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -1401,24 +983,6 @@ class TXTRecord(TypedDict, total=False): """Record type.""" -class TXTRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class URIRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -1447,9 +1011,6 @@ class URIRecord(TypedDict, total=False): Cloudflare. """ - settings: URIRecordSettings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -1472,24 +1033,6 @@ class URIRecordData(TypedDict, total=False): """The record weight.""" -class URIRecordSettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - RecordUpdateParams: TypeAlias = Union[ ARecord, AAAARecord, diff --git a/src/cloudflare/types/dns/record_update_response.py b/src/cloudflare/types/dns/record_update_response.py new file mode 100644 index 00000000000..342d44349d1 --- /dev/null +++ b/src/cloudflare/types/dns/record_update_response.py @@ -0,0 +1,595 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, TypeAlias + +from . import ( + a_record, + ds_record, + mx_record, + ns_record, + caa_record, + loc_record, + ptr_record, + srv_record, + txt_record, + uri_record, + aaaa_record, + cert_record, + svcb_record, + tlsa_record, + cname_record, + https_record, + naptr_record, + sshfp_record, + dnskey_record, + smimea_record, +) +from .ttl import TTL +from ..._models import BaseModel +from .record_tags import RecordTags + +__all__ = [ + "RecordUpdateResponse", + "ARecord", + "AAAARecord", + "CAARecord", + "CERTRecord", + "CNAMERecord", + "DNSKEYRecord", + "DSRecord", + "HTTPSRecord", + "LOCRecord", + "MXRecord", + "NAPTRRecord", + "NSRecord", + "OpenpgpkeyRecord", + "PTRRecord", + "SMIMEARecord", + "SRVRecord", + "SSHFPRecord", + "SVCBRecord", + "TLSARecord", + "TXTRecord", + "URIRecord", +] + + +class ARecord(a_record.ARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class AAAARecord(aaaa_record.AAAARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class CAARecord(caa_record.CAARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class CERTRecord(cert_record.CERTRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class CNAMERecord(cname_record.CNAMERecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class DNSKEYRecord(dnskey_record.DNSKEYRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class DSRecord(ds_record.DSRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class HTTPSRecord(https_record.HTTPSRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class LOCRecord(loc_record.LOCRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class MXRecord(mx_record.MXRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class NAPTRRecord(naptr_record.NAPTRRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class NSRecord(ns_record.NSRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class OpenpgpkeyRecord(BaseModel): + id: str + """Identifier""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + content: str + """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + name: str + """DNS record name (or @ for the zone apex) in Punycode.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + proxied: bool + """ + Whether the record is receiving the performance and security benefits of + Cloudflare. + """ + + tags: List[RecordTags] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: TTL + """Time To Live (TTL) of the DNS record in seconds. + + Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the + minimum reduced to 30 for Enterprise zones. + """ + + type: Literal["OPENPGPKEY"] + """Record type.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PTRRecord(ptr_record.PTRRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class SMIMEARecord(smimea_record.SMIMEARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class SRVRecord(srv_record.SRVRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class SSHFPRecord(sshfp_record.SSHFPRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class SVCBRecord(svcb_record.SVCBRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class TLSARecord(tlsa_record.TLSARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class TXTRecord(txt_record.TXTRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class URIRecord(uri_record.URIRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +RecordUpdateResponse: TypeAlias = Union[ + ARecord, + AAAARecord, + CAARecord, + CERTRecord, + CNAMERecord, + DNSKEYRecord, + DSRecord, + HTTPSRecord, + LOCRecord, + MXRecord, + NAPTRRecord, + NSRecord, + OpenpgpkeyRecord, + PTRRecord, + SMIMEARecord, + SRVRecord, + SSHFPRecord, + SVCBRecord, + TLSARecord, + TXTRecord, + URIRecord, +] diff --git a/src/cloudflare/types/dns/smimea_record.py b/src/cloudflare/types/dns/smimea_record.py index 7dc5ddbe673..7fae716400b 100644 --- a/src/cloudflare/types/dns/smimea_record.py +++ b/src/cloudflare/types/dns/smimea_record.py @@ -7,7 +7,7 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["SMIMEARecord", "Data", "Settings"] +__all__ = ["SMIMEARecord", "Data"] class Data(BaseModel): @@ -24,24 +24,6 @@ class Data(BaseModel): """Usage.""" -class Settings(BaseModel): - ipv4_only: Optional[bool] = None - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: Optional[bool] = None - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class SMIMEARecord(BaseModel): comment: Optional[str] = None """Comments or notes about the DNS record. @@ -64,9 +46,6 @@ class SMIMEARecord(BaseModel): Cloudflare. """ - settings: Optional[Settings] = None - """Settings for the DNS record.""" - tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/smimea_record_param.py b/src/cloudflare/types/dns/smimea_record_param.py index 45fb99c8700..ce121a41674 100644 --- a/src/cloudflare/types/dns/smimea_record_param.py +++ b/src/cloudflare/types/dns/smimea_record_param.py @@ -8,7 +8,7 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["SMIMEARecordParam", "Data", "Settings"] +__all__ = ["SMIMEARecordParam", "Data"] class Data(TypedDict, total=False): @@ -25,24 +25,6 @@ class Data(TypedDict, total=False): """Usage.""" -class Settings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class SMIMEARecordParam(TypedDict, total=False): comment: str """Comments or notes about the DNS record. @@ -62,9 +44,6 @@ class SMIMEARecordParam(TypedDict, total=False): Cloudflare. """ - settings: Settings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/srv_record.py b/src/cloudflare/types/dns/srv_record.py index add58ecb3c5..5be06e73406 100644 --- a/src/cloudflare/types/dns/srv_record.py +++ b/src/cloudflare/types/dns/srv_record.py @@ -7,7 +7,7 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["SRVRecord", "Data", "Settings"] +__all__ = ["SRVRecord", "Data"] class Data(BaseModel): @@ -27,24 +27,6 @@ class Data(BaseModel): """The record weight.""" -class Settings(BaseModel): - ipv4_only: Optional[bool] = None - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: Optional[bool] = None - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class SRVRecord(BaseModel): comment: Optional[str] = None """Comments or notes about the DNS record. @@ -70,9 +52,6 @@ class SRVRecord(BaseModel): Cloudflare. """ - settings: Optional[Settings] = None - """Settings for the DNS record.""" - tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/srv_record_param.py b/src/cloudflare/types/dns/srv_record_param.py index a451de23711..69812aa320e 100644 --- a/src/cloudflare/types/dns/srv_record_param.py +++ b/src/cloudflare/types/dns/srv_record_param.py @@ -8,7 +8,7 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["SRVRecordParam", "Data", "Settings"] +__all__ = ["SRVRecordParam", "Data"] class Data(TypedDict, total=False): @@ -28,24 +28,6 @@ class Data(TypedDict, total=False): """The record weight.""" -class Settings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class SRVRecordParam(TypedDict, total=False): comment: str """Comments or notes about the DNS record. @@ -65,9 +47,6 @@ class SRVRecordParam(TypedDict, total=False): Cloudflare. """ - settings: Settings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/sshfp_record.py b/src/cloudflare/types/dns/sshfp_record.py index cc8082194a4..855c412d9c6 100644 --- a/src/cloudflare/types/dns/sshfp_record.py +++ b/src/cloudflare/types/dns/sshfp_record.py @@ -7,7 +7,7 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["SSHFPRecord", "Data", "Settings"] +__all__ = ["SSHFPRecord", "Data"] class Data(BaseModel): @@ -21,24 +21,6 @@ class Data(BaseModel): """type.""" -class Settings(BaseModel): - ipv4_only: Optional[bool] = None - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: Optional[bool] = None - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class SSHFPRecord(BaseModel): comment: Optional[str] = None """Comments or notes about the DNS record. @@ -61,9 +43,6 @@ class SSHFPRecord(BaseModel): Cloudflare. """ - settings: Optional[Settings] = None - """Settings for the DNS record.""" - tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/sshfp_record_param.py b/src/cloudflare/types/dns/sshfp_record_param.py index 1f76cd1426b..90bced65ccd 100644 --- a/src/cloudflare/types/dns/sshfp_record_param.py +++ b/src/cloudflare/types/dns/sshfp_record_param.py @@ -8,7 +8,7 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["SSHFPRecordParam", "Data", "Settings"] +__all__ = ["SSHFPRecordParam", "Data"] class Data(TypedDict, total=False): @@ -22,24 +22,6 @@ class Data(TypedDict, total=False): """type.""" -class Settings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class SSHFPRecordParam(TypedDict, total=False): comment: str """Comments or notes about the DNS record. @@ -59,9 +41,6 @@ class SSHFPRecordParam(TypedDict, total=False): Cloudflare. """ - settings: Settings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/svcb_record.py b/src/cloudflare/types/dns/svcb_record.py index 9daf5db47e4..57e4bfa4b62 100644 --- a/src/cloudflare/types/dns/svcb_record.py +++ b/src/cloudflare/types/dns/svcb_record.py @@ -7,7 +7,7 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["SVCBRecord", "Data", "Settings"] +__all__ = ["SVCBRecord", "Data"] class Data(BaseModel): @@ -21,24 +21,6 @@ class Data(BaseModel): """value.""" -class Settings(BaseModel): - ipv4_only: Optional[bool] = None - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: Optional[bool] = None - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class SVCBRecord(BaseModel): comment: Optional[str] = None """Comments or notes about the DNS record. @@ -61,9 +43,6 @@ class SVCBRecord(BaseModel): Cloudflare. """ - settings: Optional[Settings] = None - """Settings for the DNS record.""" - tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/svcb_record_param.py b/src/cloudflare/types/dns/svcb_record_param.py index d82b6b1fa75..e96d13d1bf3 100644 --- a/src/cloudflare/types/dns/svcb_record_param.py +++ b/src/cloudflare/types/dns/svcb_record_param.py @@ -8,7 +8,7 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["SVCBRecordParam", "Data", "Settings"] +__all__ = ["SVCBRecordParam", "Data"] class Data(TypedDict, total=False): @@ -22,24 +22,6 @@ class Data(TypedDict, total=False): """value.""" -class Settings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class SVCBRecordParam(TypedDict, total=False): comment: str """Comments or notes about the DNS record. @@ -59,9 +41,6 @@ class SVCBRecordParam(TypedDict, total=False): Cloudflare. """ - settings: Settings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/tlsa_record.py b/src/cloudflare/types/dns/tlsa_record.py index f87a2bf2e98..a822b971be1 100644 --- a/src/cloudflare/types/dns/tlsa_record.py +++ b/src/cloudflare/types/dns/tlsa_record.py @@ -7,7 +7,7 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["TLSARecord", "Data", "Settings"] +__all__ = ["TLSARecord", "Data"] class Data(BaseModel): @@ -24,24 +24,6 @@ class Data(BaseModel): """Usage.""" -class Settings(BaseModel): - ipv4_only: Optional[bool] = None - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: Optional[bool] = None - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class TLSARecord(BaseModel): comment: Optional[str] = None """Comments or notes about the DNS record. @@ -64,9 +46,6 @@ class TLSARecord(BaseModel): Cloudflare. """ - settings: Optional[Settings] = None - """Settings for the DNS record.""" - tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/tlsa_record_param.py b/src/cloudflare/types/dns/tlsa_record_param.py index 8ccad170c08..9ee66f2ec8d 100644 --- a/src/cloudflare/types/dns/tlsa_record_param.py +++ b/src/cloudflare/types/dns/tlsa_record_param.py @@ -8,7 +8,7 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["TLSARecordParam", "Data", "Settings"] +__all__ = ["TLSARecordParam", "Data"] class Data(TypedDict, total=False): @@ -25,24 +25,6 @@ class Data(TypedDict, total=False): """Usage.""" -class Settings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class TLSARecordParam(TypedDict, total=False): comment: str """Comments or notes about the DNS record. @@ -62,9 +44,6 @@ class TLSARecordParam(TypedDict, total=False): Cloudflare. """ - settings: Settings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/txt_record.py b/src/cloudflare/types/dns/txt_record.py index 77e0cba8c67..065a97c8938 100644 --- a/src/cloudflare/types/dns/txt_record.py +++ b/src/cloudflare/types/dns/txt_record.py @@ -7,25 +7,7 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["TXTRecord", "Settings"] - - -class Settings(BaseModel): - ipv4_only: Optional[bool] = None - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: Optional[bool] = None - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ +__all__ = ["TXTRecord"] class TXTRecord(BaseModel): @@ -55,9 +37,6 @@ class TXTRecord(BaseModel): Cloudflare. """ - settings: Optional[Settings] = None - """Settings for the DNS record.""" - tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/txt_record_param.py b/src/cloudflare/types/dns/txt_record_param.py index b17a8385426..4395ac4bcee 100644 --- a/src/cloudflare/types/dns/txt_record_param.py +++ b/src/cloudflare/types/dns/txt_record_param.py @@ -8,25 +8,7 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["TXTRecordParam", "Settings"] - - -class Settings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ +__all__ = ["TXTRecordParam"] class TXTRecordParam(TypedDict, total=False): @@ -56,9 +38,6 @@ class TXTRecordParam(TypedDict, total=False): Cloudflare. """ - settings: Settings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/uri_record.py b/src/cloudflare/types/dns/uri_record.py index d281d0c6d28..b3d45461850 100644 --- a/src/cloudflare/types/dns/uri_record.py +++ b/src/cloudflare/types/dns/uri_record.py @@ -7,7 +7,7 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["URIRecord", "Data", "Settings"] +__all__ = ["URIRecord", "Data"] class Data(BaseModel): @@ -18,24 +18,6 @@ class Data(BaseModel): """The record weight.""" -class Settings(BaseModel): - ipv4_only: Optional[bool] = None - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: Optional[bool] = None - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class URIRecord(BaseModel): comment: Optional[str] = None """Comments or notes about the DNS record. @@ -64,9 +46,6 @@ class URIRecord(BaseModel): Cloudflare. """ - settings: Optional[Settings] = None - """Settings for the DNS record.""" - tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/uri_record_param.py b/src/cloudflare/types/dns/uri_record_param.py index 4995b415771..59aafdfd3bc 100644 --- a/src/cloudflare/types/dns/uri_record_param.py +++ b/src/cloudflare/types/dns/uri_record_param.py @@ -8,7 +8,7 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["URIRecordParam", "Data", "Settings"] +__all__ = ["URIRecordParam", "Data"] class Data(TypedDict, total=False): @@ -19,24 +19,6 @@ class Data(TypedDict, total=False): """The record weight.""" -class Settings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - class URIRecordParam(TypedDict, total=False): comment: str """Comments or notes about the DNS record. @@ -62,9 +44,6 @@ class URIRecordParam(TypedDict, total=False): Cloudflare. """ - settings: Settings - """Settings for the DNS record.""" - tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/email_security/investigate/preview_create_response.py b/src/cloudflare/types/email_security/investigate/preview_create_response.py index 21d6b0ca34a..decc493cddc 100644 --- a/src/cloudflare/types/email_security/investigate/preview_create_response.py +++ b/src/cloudflare/types/email_security/investigate/preview_create_response.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import Optional from ...._models import BaseModel @@ -8,4 +9,5 @@ class PreviewCreateResponse(BaseModel): screenshot: str - """A base64 encoded PNG image of the email.""" + + error: Optional[str] = None diff --git a/src/cloudflare/types/email_security/settings/block_sender_create_params.py b/src/cloudflare/types/email_security/settings/block_sender_create_params.py index dc5290d600f..1408cb0674c 100644 --- a/src/cloudflare/types/email_security/settings/block_sender_create_params.py +++ b/src/cloudflare/types/email_security/settings/block_sender_create_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing import Optional -from typing_extensions import Literal, Required, TypedDict +from typing import Union, Iterable, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict -__all__ = ["BlockSenderCreateParams"] +__all__ = ["BlockSenderCreateParams", "EmailSecurityCreateBlockedSender", "Variant1", "Variant1Body"] -class BlockSenderCreateParams(TypedDict, total=False): +class EmailSecurityCreateBlockedSender(TypedDict, total=False): account_id: Required[str] """Account Identifier""" @@ -19,3 +19,23 @@ class BlockSenderCreateParams(TypedDict, total=False): pattern_type: Required[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]] comments: Optional[str] + + +class Variant1(TypedDict, total=False): + account_id: Required[str] + """Account Identifier""" + + body: Required[Iterable[Variant1Body]] + + +class Variant1Body(TypedDict, total=False): + is_regex: Required[bool] + + pattern: Required[str] + + pattern_type: Required[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]] + + comments: Optional[str] + + +BlockSenderCreateParams: TypeAlias = Union[EmailSecurityCreateBlockedSender, Variant1] diff --git a/src/cloudflare/types/email_security/settings/block_sender_create_response.py b/src/cloudflare/types/email_security/settings/block_sender_create_response.py index 615755f8fd7..b3e80c9195e 100644 --- a/src/cloudflare/types/email_security/settings/block_sender_create_response.py +++ b/src/cloudflare/types/email_security/settings/block_sender_create_response.py @@ -1,17 +1,16 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Union, Optional from datetime import datetime -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from ...._models import BaseModel -__all__ = ["BlockSenderCreateResponse"] +__all__ = ["BlockSenderCreateResponse", "EmailSecurityBlockedSender", "UnionMember1"] -class BlockSenderCreateResponse(BaseModel): +class EmailSecurityBlockedSender(BaseModel): id: int - """The unique identifier for the allow policy.""" created_at: datetime @@ -24,3 +23,22 @@ class BlockSenderCreateResponse(BaseModel): pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"] comments: Optional[str] = None + + +class UnionMember1(BaseModel): + id: int + + created_at: datetime + + is_regex: bool + + last_modified: datetime + + pattern: str + + pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"] + + comments: Optional[str] = None + + +BlockSenderCreateResponse: TypeAlias = Union[EmailSecurityBlockedSender, List[UnionMember1]] diff --git a/src/cloudflare/types/email_security/settings/block_sender_delete_response.py b/src/cloudflare/types/email_security/settings/block_sender_delete_response.py index f19dbd8d807..2dac65de0e7 100644 --- a/src/cloudflare/types/email_security/settings/block_sender_delete_response.py +++ b/src/cloudflare/types/email_security/settings/block_sender_delete_response.py @@ -8,4 +8,3 @@ class BlockSenderDeleteResponse(BaseModel): id: int - """The unique identifier for the allow policy.""" diff --git a/src/cloudflare/types/email_security/settings/block_sender_edit_response.py b/src/cloudflare/types/email_security/settings/block_sender_edit_response.py index 764d9fd5dee..55252960899 100644 --- a/src/cloudflare/types/email_security/settings/block_sender_edit_response.py +++ b/src/cloudflare/types/email_security/settings/block_sender_edit_response.py @@ -11,7 +11,6 @@ class BlockSenderEditResponse(BaseModel): id: int - """The unique identifier for the allow policy.""" created_at: datetime diff --git a/src/cloudflare/types/email_security/settings/block_sender_get_response.py b/src/cloudflare/types/email_security/settings/block_sender_get_response.py index 66f03f3e3f6..5ec8429d4b8 100644 --- a/src/cloudflare/types/email_security/settings/block_sender_get_response.py +++ b/src/cloudflare/types/email_security/settings/block_sender_get_response.py @@ -11,7 +11,6 @@ class BlockSenderGetResponse(BaseModel): id: int - """The unique identifier for the allow policy.""" created_at: datetime diff --git a/src/cloudflare/types/email_security/settings/block_sender_list_response.py b/src/cloudflare/types/email_security/settings/block_sender_list_response.py index 497ae4dc93d..3b30e018736 100644 --- a/src/cloudflare/types/email_security/settings/block_sender_list_response.py +++ b/src/cloudflare/types/email_security/settings/block_sender_list_response.py @@ -11,7 +11,6 @@ class BlockSenderListResponse(BaseModel): id: int - """The unique identifier for the allow policy.""" created_at: datetime diff --git a/src/cloudflare/types/email_security/settings/impersonation_registry_create_params.py b/src/cloudflare/types/email_security/settings/impersonation_registry_create_params.py index db25db7e746..6afe1e4ecc2 100644 --- a/src/cloudflare/types/email_security/settings/impersonation_registry_create_params.py +++ b/src/cloudflare/types/email_security/settings/impersonation_registry_create_params.py @@ -2,12 +2,13 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing import Union, Iterable +from typing_extensions import Required, TypeAlias, TypedDict -__all__ = ["ImpersonationRegistryCreateParams"] +__all__ = ["ImpersonationRegistryCreateParams", "EmailSecurityCreateDisplayName", "Variant1", "Variant1Body"] -class ImpersonationRegistryCreateParams(TypedDict, total=False): +class EmailSecurityCreateDisplayName(TypedDict, total=False): account_id: Required[str] """Account Identifier""" @@ -16,3 +17,21 @@ class ImpersonationRegistryCreateParams(TypedDict, total=False): is_email_regex: Required[bool] name: Required[str] + + +class Variant1(TypedDict, total=False): + account_id: Required[str] + """Account Identifier""" + + body: Required[Iterable[Variant1Body]] + + +class Variant1Body(TypedDict, total=False): + email: Required[str] + + is_email_regex: Required[bool] + + name: Required[str] + + +ImpersonationRegistryCreateParams: TypeAlias = Union[EmailSecurityCreateDisplayName, Variant1] diff --git a/src/cloudflare/types/email_security/settings/impersonation_registry_create_response.py b/src/cloudflare/types/email_security/settings/impersonation_registry_create_response.py index c0dd1f55354..9a6c685fde3 100644 --- a/src/cloudflare/types/email_security/settings/impersonation_registry_create_response.py +++ b/src/cloudflare/types/email_security/settings/impersonation_registry_create_response.py @@ -1,19 +1,42 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Union, Optional from datetime import datetime +from typing_extensions import TypeAlias from ...._models import BaseModel -__all__ = ["ImpersonationRegistryCreateResponse"] +__all__ = ["ImpersonationRegistryCreateResponse", "EmailSecurityDisplayName", "UnionMember1"] -class ImpersonationRegistryCreateResponse(BaseModel): +class EmailSecurityDisplayName(BaseModel): id: int created_at: datetime - email: str + is_email_regex: bool + + last_modified: datetime + + name: str + + comments: Optional[str] = None + + directory_id: Optional[int] = None + + directory_node_id: Optional[int] = None + + email: Optional[str] = None + + external_directory_node_id: Optional[str] = None + + provenance: Optional[str] = None + + +class UnionMember1(BaseModel): + id: int + + created_at: datetime is_email_regex: bool @@ -27,6 +50,11 @@ class ImpersonationRegistryCreateResponse(BaseModel): directory_node_id: Optional[int] = None + email: Optional[str] = None + external_directory_node_id: Optional[str] = None provenance: Optional[str] = None + + +ImpersonationRegistryCreateResponse: TypeAlias = Union[EmailSecurityDisplayName, List[UnionMember1]] diff --git a/src/cloudflare/types/email_security/settings/impersonation_registry_edit_response.py b/src/cloudflare/types/email_security/settings/impersonation_registry_edit_response.py index 824a0946f7c..8555fe6e757 100644 --- a/src/cloudflare/types/email_security/settings/impersonation_registry_edit_response.py +++ b/src/cloudflare/types/email_security/settings/impersonation_registry_edit_response.py @@ -13,8 +13,6 @@ class ImpersonationRegistryEditResponse(BaseModel): created_at: datetime - email: str - is_email_regex: bool last_modified: datetime @@ -27,6 +25,8 @@ class ImpersonationRegistryEditResponse(BaseModel): directory_node_id: Optional[int] = None + email: Optional[str] = None + external_directory_node_id: Optional[str] = None provenance: Optional[str] = None diff --git a/src/cloudflare/types/email_security/settings/impersonation_registry_get_response.py b/src/cloudflare/types/email_security/settings/impersonation_registry_get_response.py index 85a8ab50d71..2ffea2569d4 100644 --- a/src/cloudflare/types/email_security/settings/impersonation_registry_get_response.py +++ b/src/cloudflare/types/email_security/settings/impersonation_registry_get_response.py @@ -13,8 +13,6 @@ class ImpersonationRegistryGetResponse(BaseModel): created_at: datetime - email: str - is_email_regex: bool last_modified: datetime @@ -27,6 +25,8 @@ class ImpersonationRegistryGetResponse(BaseModel): directory_node_id: Optional[int] = None + email: Optional[str] = None + external_directory_node_id: Optional[str] = None provenance: Optional[str] = None diff --git a/src/cloudflare/types/email_security/settings/impersonation_registry_list_response.py b/src/cloudflare/types/email_security/settings/impersonation_registry_list_response.py index 800c8d4bfd7..d75829c8a05 100644 --- a/src/cloudflare/types/email_security/settings/impersonation_registry_list_response.py +++ b/src/cloudflare/types/email_security/settings/impersonation_registry_list_response.py @@ -13,8 +13,6 @@ class ImpersonationRegistryListResponse(BaseModel): created_at: datetime - email: str - is_email_regex: bool last_modified: datetime @@ -27,6 +25,8 @@ class ImpersonationRegistryListResponse(BaseModel): directory_node_id: Optional[int] = None + email: Optional[str] = None + external_directory_node_id: Optional[str] = None provenance: Optional[str] = None diff --git a/src/cloudflare/types/images/v1/variant_delete_response.py b/src/cloudflare/types/images/v1/variant_delete_response.py index 3b3a97038ec..849e187534e 100644 --- a/src/cloudflare/types/images/v1/variant_delete_response.py +++ b/src/cloudflare/types/images/v1/variant_delete_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union +from typing import Union, Optional from typing_extensions import TypeAlias __all__ = ["VariantDeleteResponse"] -VariantDeleteResponse: TypeAlias = Union[str, object] +VariantDeleteResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/images/v1_delete_response.py b/src/cloudflare/types/images/v1_delete_response.py index 0122c846f86..b616950e39c 100644 --- a/src/cloudflare/types/images/v1_delete_response.py +++ b/src/cloudflare/types/images/v1_delete_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union +from typing import Union, Optional from typing_extensions import TypeAlias __all__ = ["V1DeleteResponse"] -V1DeleteResponse: TypeAlias = Union[str, object] +V1DeleteResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/logpush/job_update_params.py b/src/cloudflare/types/logpush/job_update_params.py index dda7f649121..857882c86bf 100644 --- a/src/cloudflare/types/logpush/job_update_params.py +++ b/src/cloudflare/types/logpush/job_update_params.py @@ -79,13 +79,6 @@ class JobUpdateParams(TypedDict, total=False): available for jobs with `edge` as its kind. """ - name: Optional[str] - """Optional human readable job name. - - Not unique. Cloudflare suggests that you set this to a meaningful string, like - the domain name, to make it easier to identify your job. - """ - output_options: Optional[OutputOptionsParam] """The structured replacement for `logpull_options`. diff --git a/src/cloudflare/types/magic_transit/sites/acl.py b/src/cloudflare/types/magic_transit/sites/acl.py index 41429544d0f..5565fc0f5c9 100644 --- a/src/cloudflare/types/magic_transit/sites/acl.py +++ b/src/cloudflare/types/magic_transit/sites/acl.py @@ -32,11 +32,3 @@ class ACL(BaseModel): """The name of the ACL.""" protocols: Optional[List[AllowedProtocol]] = None - - unidirectional: Optional[bool] = None - """The desired traffic direction for this ACL policy. - - If set to "false", the policy will allow bidirectional traffic. If set to - "true", the policy will only allow traffic in one direction. If not included in - request, will default to false. - """ diff --git a/src/cloudflare/types/magic_transit/sites/acl_create_params.py b/src/cloudflare/types/magic_transit/sites/acl_create_params.py index c193c6d556c..48b2d5f517b 100644 --- a/src/cloudflare/types/magic_transit/sites/acl_create_params.py +++ b/src/cloudflare/types/magic_transit/sites/acl_create_params.py @@ -34,11 +34,3 @@ class ACLCreateParams(TypedDict, total=False): """ protocols: List[AllowedProtocol] - - unidirectional: bool - """The desired traffic direction for this ACL policy. - - If set to "false", the policy will allow bidirectional traffic. If set to - "true", the policy will only allow traffic in one direction. If not included in - request, will default to false. - """ diff --git a/src/cloudflare/types/magic_transit/sites/acl_edit_params.py b/src/cloudflare/types/magic_transit/sites/acl_edit_params.py index 3280bbe53b2..8a6c7b0f5c6 100644 --- a/src/cloudflare/types/magic_transit/sites/acl_edit_params.py +++ b/src/cloudflare/types/magic_transit/sites/acl_edit_params.py @@ -37,11 +37,3 @@ class ACLEditParams(TypedDict, total=False): """The name of the ACL.""" protocols: List[AllowedProtocol] - - unidirectional: bool - """The desired traffic direction for this ACL policy. - - If set to "false", the policy will allow bidirectional traffic. If set to - "true", the policy will only allow traffic in one direction. If not included in - request, will default to false. - """ diff --git a/src/cloudflare/types/magic_transit/sites/acl_update_params.py b/src/cloudflare/types/magic_transit/sites/acl_update_params.py index 250ed85c126..5abc70c2329 100644 --- a/src/cloudflare/types/magic_transit/sites/acl_update_params.py +++ b/src/cloudflare/types/magic_transit/sites/acl_update_params.py @@ -37,11 +37,3 @@ class ACLUpdateParams(TypedDict, total=False): """The name of the ACL.""" protocols: List[AllowedProtocol] - - unidirectional: bool - """The desired traffic direction for this ACL policy. - - If set to "false", the policy will allow bidirectional traffic. If set to - "true", the policy will only allow traffic in one direction. If not included in - request, will default to false. - """ diff --git a/src/cloudflare/types/magic_transit/sites/wan.py b/src/cloudflare/types/magic_transit/sites/wan.py index dc8378ae312..1148e9f087f 100644 --- a/src/cloudflare/types/magic_transit/sites/wan.py +++ b/src/cloudflare/types/magic_transit/sites/wan.py @@ -1,7 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from typing_extensions import Literal from ...._models import BaseModel from .wan_static_addressing import WANStaticAddressing @@ -13,12 +12,6 @@ class WAN(BaseModel): id: Optional[str] = None """Identifier""" - health_check_rate: Optional[Literal["low", "mid", "high"]] = None - """Magic WAN health check rate for tunnels created on this link. - - The default value is `mid`. - """ - name: Optional[str] = None physport: Optional[int] = None diff --git a/src/cloudflare/types/managed_transforms/__init__.py b/src/cloudflare/types/managed_transforms/__init__.py index 34117bfe591..09e75d9fc15 100644 --- a/src/cloudflare/types/managed_transforms/__init__.py +++ b/src/cloudflare/types/managed_transforms/__init__.py @@ -2,6 +2,8 @@ from __future__ import annotations +from .request_model import RequestModel as RequestModel +from .request_model_param import RequestModelParam as RequestModelParam from .managed_transform_edit_params import ManagedTransformEditParams as ManagedTransformEditParams from .managed_transform_edit_response import ManagedTransformEditResponse as ManagedTransformEditResponse from .managed_transform_list_response import ManagedTransformListResponse as ManagedTransformListResponse diff --git a/src/cloudflare/types/managed_transforms/managed_transform_edit_params.py b/src/cloudflare/types/managed_transforms/managed_transform_edit_params.py index 0d92ba91f8d..3f45bc1e8ef 100644 --- a/src/cloudflare/types/managed_transforms/managed_transform_edit_params.py +++ b/src/cloudflare/types/managed_transforms/managed_transform_edit_params.py @@ -5,31 +5,15 @@ from typing import Iterable from typing_extensions import Required, TypedDict -__all__ = ["ManagedTransformEditParams", "ManagedRequestHeader", "ManagedResponseHeader"] +from .request_model_param import RequestModelParam + +__all__ = ["ManagedTransformEditParams"] class ManagedTransformEditParams(TypedDict, total=False): zone_id: Required[str] - """The unique ID of the zone.""" - - managed_request_headers: Required[Iterable[ManagedRequestHeader]] - """The list of Managed Request Transforms.""" - - managed_response_headers: Required[Iterable[ManagedResponseHeader]] - """The list of Managed Response Transforms.""" - - -class ManagedRequestHeader(TypedDict, total=False): - id: Required[str] - """The human-readable identifier of the Managed Transform.""" - - enabled: Required[bool] - """Whether the Managed Transform is enabled.""" - + """Identifier""" -class ManagedResponseHeader(TypedDict, total=False): - id: Required[str] - """The human-readable identifier of the Managed Transform.""" + managed_request_headers: Required[Iterable[RequestModelParam]] - enabled: Required[bool] - """Whether the Managed Transform is enabled.""" + managed_response_headers: Required[Iterable[RequestModelParam]] diff --git a/src/cloudflare/types/managed_transforms/managed_transform_edit_response.py b/src/cloudflare/types/managed_transforms/managed_transform_edit_response.py index 762945a848b..59fab379331 100644 --- a/src/cloudflare/types/managed_transforms/managed_transform_edit_response.py +++ b/src/cloudflare/types/managed_transforms/managed_transform_edit_response.py @@ -8,42 +8,28 @@ class ManagedRequestHeader(BaseModel): - id: str - """The human-readable identifier of the Managed Transform.""" + id: Optional[str] = None + """Human-readable identifier of the Managed Transform.""" - enabled: bool - """Whether the Managed Transform is enabled.""" + available: Optional[bool] = None + """When true, the Managed Transform is available in the current Cloudflare plan.""" - has_conflict: bool - """ - Whether the Managed Transform conflicts with the currently-enabled Managed - Transforms. - """ - - conflicts_with: Optional[List[str]] = None - """The Managed Transforms that this Managed Transform conflicts with.""" + enabled: Optional[bool] = None + """When true, the Managed Transform is enabled.""" class ManagedResponseHeader(BaseModel): - id: str - """The human-readable identifier of the Managed Transform.""" - - enabled: bool - """Whether the Managed Transform is enabled.""" + id: Optional[str] = None + """Human-readable identifier of the Managed Transform.""" - has_conflict: bool - """ - Whether the Managed Transform conflicts with the currently-enabled Managed - Transforms. - """ + available: Optional[bool] = None + """When true, the Managed Transform is available in the current Cloudflare plan.""" - conflicts_with: Optional[List[str]] = None - """The Managed Transforms that this Managed Transform conflicts with.""" + enabled: Optional[bool] = None + """When true, the Managed Transform is enabled.""" class ManagedTransformEditResponse(BaseModel): - managed_request_headers: List[ManagedRequestHeader] - """The list of Managed Request Transforms.""" + managed_request_headers: Optional[List[ManagedRequestHeader]] = None - managed_response_headers: List[ManagedResponseHeader] - """The list of Managed Response Transforms.""" + managed_response_headers: Optional[List[ManagedResponseHeader]] = None diff --git a/src/cloudflare/types/managed_transforms/managed_transform_list_response.py b/src/cloudflare/types/managed_transforms/managed_transform_list_response.py index c9c5f5c4af2..dfc3ffc7171 100644 --- a/src/cloudflare/types/managed_transforms/managed_transform_list_response.py +++ b/src/cloudflare/types/managed_transforms/managed_transform_list_response.py @@ -3,47 +3,12 @@ from typing import List, Optional from ..._models import BaseModel +from .request_model import RequestModel -__all__ = ["ManagedTransformListResponse", "ManagedRequestHeader", "ManagedResponseHeader"] - - -class ManagedRequestHeader(BaseModel): - id: str - """The human-readable identifier of the Managed Transform.""" - - enabled: bool - """Whether the Managed Transform is enabled.""" - - has_conflict: bool - """ - Whether the Managed Transform conflicts with the currently-enabled Managed - Transforms. - """ - - conflicts_with: Optional[List[str]] = None - """The Managed Transforms that this Managed Transform conflicts with.""" - - -class ManagedResponseHeader(BaseModel): - id: str - """The human-readable identifier of the Managed Transform.""" - - enabled: bool - """Whether the Managed Transform is enabled.""" - - has_conflict: bool - """ - Whether the Managed Transform conflicts with the currently-enabled Managed - Transforms. - """ - - conflicts_with: Optional[List[str]] = None - """The Managed Transforms that this Managed Transform conflicts with.""" +__all__ = ["ManagedTransformListResponse"] class ManagedTransformListResponse(BaseModel): - managed_request_headers: List[ManagedRequestHeader] - """The list of Managed Request Transforms.""" + managed_request_headers: Optional[List[RequestModel]] = None - managed_response_headers: List[ManagedResponseHeader] - """The list of Managed Response Transforms.""" + managed_response_headers: Optional[List[RequestModel]] = None diff --git a/src/cloudflare/types/managed_transforms/request_model.py b/src/cloudflare/types/managed_transforms/request_model.py new file mode 100644 index 00000000000..281db0613d3 --- /dev/null +++ b/src/cloudflare/types/managed_transforms/request_model.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["RequestModel"] + + +class RequestModel(BaseModel): + id: Optional[str] = None + """Human-readable identifier of the Managed Transform.""" + + enabled: Optional[bool] = None + """When true, the Managed Transform is enabled.""" diff --git a/src/cloudflare/types/managed_transforms/request_model_param.py b/src/cloudflare/types/managed_transforms/request_model_param.py new file mode 100644 index 00000000000..d207b5bf111 --- /dev/null +++ b/src/cloudflare/types/managed_transforms/request_model_param.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["RequestModelParam"] + + +class RequestModelParam(TypedDict, total=False): + id: str + """Human-readable identifier of the Managed Transform.""" + + enabled: bool + """When true, the Managed Transform is enabled.""" diff --git a/src/cloudflare/types/origin_post_quantum_encryption/origin_post_quantum_encryption_get_response.py b/src/cloudflare/types/origin_post_quantum_encryption/origin_post_quantum_encryption_get_response.py index 160be05baa8..6f1aa4dca49 100644 --- a/src/cloudflare/types/origin_post_quantum_encryption/origin_post_quantum_encryption_get_response.py +++ b/src/cloudflare/types/origin_post_quantum_encryption/origin_post_quantum_encryption_get_response.py @@ -1,23 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional -from datetime import datetime -from typing_extensions import Literal - -from ..._models import BaseModel +from typing import Union, Optional +from typing_extensions import TypeAlias __all__ = ["OriginPostQuantumEncryptionGetResponse"] - -class OriginPostQuantumEncryptionGetResponse(BaseModel): - id: Literal["origin_pqe"] - """Value of the zone setting.""" - - editable: bool - """Whether the setting is editable""" - - value: Literal["preferred", "supported", "off"] - """The value of the feature""" - - modified_on: Optional[datetime] = None - """Last time this setting was modified.""" +OriginPostQuantumEncryptionGetResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/origin_post_quantum_encryption/origin_post_quantum_encryption_update_response.py b/src/cloudflare/types/origin_post_quantum_encryption/origin_post_quantum_encryption_update_response.py index f2ec8775f16..bfc6dab7036 100644 --- a/src/cloudflare/types/origin_post_quantum_encryption/origin_post_quantum_encryption_update_response.py +++ b/src/cloudflare/types/origin_post_quantum_encryption/origin_post_quantum_encryption_update_response.py @@ -1,23 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional -from datetime import datetime -from typing_extensions import Literal - -from ..._models import BaseModel +from typing import Union, Optional +from typing_extensions import TypeAlias __all__ = ["OriginPostQuantumEncryptionUpdateResponse"] - -class OriginPostQuantumEncryptionUpdateResponse(BaseModel): - id: Literal["origin_pqe"] - """Value of the zone setting.""" - - editable: bool - """Whether the setting is editable""" - - value: Literal["preferred", "supported", "off"] - """The value of the feature""" - - modified_on: Optional[datetime] = None - """Last time this setting was modified.""" +OriginPostQuantumEncryptionUpdateResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/page_rules/page_rule.py b/src/cloudflare/types/page_rules/page_rule.py index 64a7fa0508c..3792ea151f9 100644 --- a/src/cloudflare/types/page_rules/page_rule.py +++ b/src/cloudflare/types/page_rules/page_rule.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Union, Optional +from typing import List, Union, Optional from datetime import datetime from typing_extensions import Literal, Annotated, TypeAlias @@ -32,15 +32,14 @@ "ActionBypassCacheOnCookie", "ActionCacheByDeviceType", "ActionCacheDeceptionArmor", - "ActionCacheKeyFields", - "ActionCacheKeyFieldsValue", - "ActionCacheKeyFieldsValueCookie", - "ActionCacheKeyFieldsValueHeader", - "ActionCacheKeyFieldsValueHost", - "ActionCacheKeyFieldsValueQueryString", - "ActionCacheKeyFieldsValueUser", + "ActionCacheKey", + "ActionCacheKeyValue", + "ActionCacheKeyValueCookie", + "ActionCacheKeyValueHeader", + "ActionCacheKeyValueHost", + "ActionCacheKeyValueQueryString", + "ActionCacheKeyValueUser", "ActionCacheOnCookie", - "ActionCacheTTLByStatus", "ActionDisableApps", "ActionDisablePerformance", "ActionDisableSecurity", @@ -91,7 +90,7 @@ class ActionCacheDeceptionArmor(BaseModel): """The status of Cache Deception Armor.""" -class ActionCacheKeyFieldsValueCookie(BaseModel): +class ActionCacheKeyValueCookie(BaseModel): check_presence: Optional[List[str]] = None """ A list of cookies to check for the presence of, without including their actual @@ -102,7 +101,7 @@ class ActionCacheKeyFieldsValueCookie(BaseModel): """A list of cookies to include.""" -class ActionCacheKeyFieldsValueHeader(BaseModel): +class ActionCacheKeyValueHeader(BaseModel): check_presence: Optional[List[str]] = None """ A list of headers to check for the presence of, without including their actual @@ -116,12 +115,12 @@ class ActionCacheKeyFieldsValueHeader(BaseModel): """A list of headers to include.""" -class ActionCacheKeyFieldsValueHost(BaseModel): +class ActionCacheKeyValueHost(BaseModel): resolved: Optional[bool] = None """Whether to include the Host header in the HTTP request sent to the origin.""" -class ActionCacheKeyFieldsValueQueryString(BaseModel): +class ActionCacheKeyValueQueryString(BaseModel): exclude: Union[Literal["*"], List[str], None] = None """Ignore all query string parameters.""" @@ -129,7 +128,7 @@ class ActionCacheKeyFieldsValueQueryString(BaseModel): """Include all query string parameters.""" -class ActionCacheKeyFieldsValueUser(BaseModel): +class ActionCacheKeyValueUser(BaseModel): device_type: Optional[bool] = None """ Classifies a request as `mobile`, `desktop`, or `tablet` based on the User @@ -146,38 +145,38 @@ class ActionCacheKeyFieldsValueUser(BaseModel): """ -class ActionCacheKeyFieldsValue(BaseModel): - cookie: Optional[ActionCacheKeyFieldsValueCookie] = None +class ActionCacheKeyValue(BaseModel): + cookie: Optional[ActionCacheKeyValueCookie] = None """Controls which cookies appear in the Cache Key.""" - header: Optional[ActionCacheKeyFieldsValueHeader] = None + header: Optional[ActionCacheKeyValueHeader] = None """Controls which headers go into the Cache Key. Exactly one of `include` or `exclude` is expected. """ - host: Optional[ActionCacheKeyFieldsValueHost] = None + host: Optional[ActionCacheKeyValueHost] = None """Determines which host header to include in the Cache Key.""" - query_string: Optional[ActionCacheKeyFieldsValueQueryString] = None + query_string: Optional[ActionCacheKeyValueQueryString] = None """Controls which URL query string parameters go into the Cache Key. Exactly one of `include` or `exclude` is expected. """ - user: Optional[ActionCacheKeyFieldsValueUser] = None + user: Optional[ActionCacheKeyValueUser] = None """Feature fields to add features about the end-user (client) into the Cache Key.""" -class ActionCacheKeyFields(BaseModel): - id: Optional[Literal["cache_key_fields"]] = None +class ActionCacheKey(BaseModel): + id: Optional[Literal["cache_key"]] = None """ Control specifically what variables to include when deciding which resources to cache. This allows customers to determine what to cache based on something other than just the URL. """ - value: Optional[ActionCacheKeyFieldsValue] = None + value: Optional[ActionCacheKeyValue] = None class ActionCacheOnCookie(BaseModel): @@ -191,36 +190,6 @@ class ActionCacheOnCookie(BaseModel): """The regular expression to use for matching cookie names in the request.""" -class ActionCacheTTLByStatus(BaseModel): - id: Optional[Literal["cache_ttl_by_status"]] = None - """ - Enterprise customers can set cache time-to-live (TTL) based on the response - status from the origin web server. Cache TTL refers to the duration of a - resource in the Cloudflare network before being marked as stale or discarded - from cache. Status codes are returned by a resource's origin. Setting cache TTL - based on response status overrides the default cache behavior (standard caching) - for static files and overrides cache instructions sent by the origin web server. - To cache non-static assets, set a Cache Level of Cache Everything using a Page - Rule. Setting no-store Cache-Control or a low TTL (using `max-age`/`s-maxage`) - increases requests to origin web servers and decreases performance. - """ - - value: Optional[Dict[str, Union[Literal["no-cache", "no-store"], int]]] = None - """ - A JSON object containing status codes and their corresponding TTLs. Each - key-value pair in the cache TTL by status cache rule has the following syntax - - - `status_code`: An integer value such as 200 or 500. status_code matches the - exact status code from the origin web server. Valid status codes are between - 100-999. - - `status_code_range`: Integer values for from and to. status_code_range matches - any status code from the origin web server within the specified range. - - `value`: An integer value that defines the duration an asset is valid in - seconds or one of the following strings: no-store (equivalent to -1), no-cache - (equivalent to 0). - """ - - class ActionDisableApps(BaseModel): id: Optional[Literal["disable_apps"]] = None """ @@ -340,10 +309,9 @@ class ActionRespectStrongEtag(BaseModel): ActionBypassCacheOnCookie, ActionCacheByDeviceType, ActionCacheDeceptionArmor, - ActionCacheKeyFields, + ActionCacheKey, CacheLevel, ActionCacheOnCookie, - ActionCacheTTLByStatus, ActionDisableApps, ActionDisablePerformance, ActionDisableSecurity, diff --git a/src/cloudflare/types/page_rules/page_rule_create_params.py b/src/cloudflare/types/page_rules/page_rule_create_params.py index 9a137919711..7a3dbc4fcf9 100644 --- a/src/cloudflare/types/page_rules/page_rule_create_params.py +++ b/src/cloudflare/types/page_rules/page_rule_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, List, Union, Iterable +from typing import List, Union, Iterable from typing_extensions import Literal, Required, TypeAlias, TypedDict from .target_param import TargetParam @@ -31,15 +31,14 @@ "ActionBypassCacheOnCookie", "ActionCacheByDeviceType", "ActionCacheDeceptionArmor", - "ActionCacheKeyFields", - "ActionCacheKeyFieldsValue", - "ActionCacheKeyFieldsValueCookie", - "ActionCacheKeyFieldsValueHeader", - "ActionCacheKeyFieldsValueHost", - "ActionCacheKeyFieldsValueQueryString", - "ActionCacheKeyFieldsValueUser", + "ActionCacheKey", + "ActionCacheKeyValue", + "ActionCacheKeyValueCookie", + "ActionCacheKeyValueHeader", + "ActionCacheKeyValueHost", + "ActionCacheKeyValueQueryString", + "ActionCacheKeyValueUser", "ActionCacheOnCookie", - "ActionCacheTTLByStatus", "ActionDisableApps", "ActionDisablePerformance", "ActionDisableSecurity", @@ -116,7 +115,7 @@ class ActionCacheDeceptionArmor(TypedDict, total=False): """The status of Cache Deception Armor.""" -class ActionCacheKeyFieldsValueCookie(TypedDict, total=False): +class ActionCacheKeyValueCookie(TypedDict, total=False): check_presence: List[str] """ A list of cookies to check for the presence of, without including their actual @@ -127,7 +126,7 @@ class ActionCacheKeyFieldsValueCookie(TypedDict, total=False): """A list of cookies to include.""" -class ActionCacheKeyFieldsValueHeader(TypedDict, total=False): +class ActionCacheKeyValueHeader(TypedDict, total=False): check_presence: List[str] """ A list of headers to check for the presence of, without including their actual @@ -141,12 +140,12 @@ class ActionCacheKeyFieldsValueHeader(TypedDict, total=False): """A list of headers to include.""" -class ActionCacheKeyFieldsValueHost(TypedDict, total=False): +class ActionCacheKeyValueHost(TypedDict, total=False): resolved: bool """Whether to include the Host header in the HTTP request sent to the origin.""" -class ActionCacheKeyFieldsValueQueryString(TypedDict, total=False): +class ActionCacheKeyValueQueryString(TypedDict, total=False): exclude: Union[Literal["*"], List[str]] """Ignore all query string parameters.""" @@ -154,7 +153,7 @@ class ActionCacheKeyFieldsValueQueryString(TypedDict, total=False): """Include all query string parameters.""" -class ActionCacheKeyFieldsValueUser(TypedDict, total=False): +class ActionCacheKeyValueUser(TypedDict, total=False): device_type: bool """ Classifies a request as `mobile`, `desktop`, or `tablet` based on the User @@ -171,38 +170,38 @@ class ActionCacheKeyFieldsValueUser(TypedDict, total=False): """ -class ActionCacheKeyFieldsValue(TypedDict, total=False): - cookie: ActionCacheKeyFieldsValueCookie +class ActionCacheKeyValue(TypedDict, total=False): + cookie: ActionCacheKeyValueCookie """Controls which cookies appear in the Cache Key.""" - header: ActionCacheKeyFieldsValueHeader + header: ActionCacheKeyValueHeader """Controls which headers go into the Cache Key. Exactly one of `include` or `exclude` is expected. """ - host: ActionCacheKeyFieldsValueHost + host: ActionCacheKeyValueHost """Determines which host header to include in the Cache Key.""" - query_string: ActionCacheKeyFieldsValueQueryString + query_string: ActionCacheKeyValueQueryString """Controls which URL query string parameters go into the Cache Key. Exactly one of `include` or `exclude` is expected. """ - user: ActionCacheKeyFieldsValueUser + user: ActionCacheKeyValueUser """Feature fields to add features about the end-user (client) into the Cache Key.""" -class ActionCacheKeyFields(TypedDict, total=False): - id: Literal["cache_key_fields"] +class ActionCacheKey(TypedDict, total=False): + id: Literal["cache_key"] """ Control specifically what variables to include when deciding which resources to cache. This allows customers to determine what to cache based on something other than just the URL. """ - value: ActionCacheKeyFieldsValue + value: ActionCacheKeyValue class ActionCacheOnCookie(TypedDict, total=False): @@ -216,36 +215,6 @@ class ActionCacheOnCookie(TypedDict, total=False): """The regular expression to use for matching cookie names in the request.""" -class ActionCacheTTLByStatus(TypedDict, total=False): - id: Literal["cache_ttl_by_status"] - """ - Enterprise customers can set cache time-to-live (TTL) based on the response - status from the origin web server. Cache TTL refers to the duration of a - resource in the Cloudflare network before being marked as stale or discarded - from cache. Status codes are returned by a resource's origin. Setting cache TTL - based on response status overrides the default cache behavior (standard caching) - for static files and overrides cache instructions sent by the origin web server. - To cache non-static assets, set a Cache Level of Cache Everything using a Page - Rule. Setting no-store Cache-Control or a low TTL (using `max-age`/`s-maxage`) - increases requests to origin web servers and decreases performance. - """ - - value: Dict[str, Union[Literal["no-cache", "no-store"], int]] - """ - A JSON object containing status codes and their corresponding TTLs. Each - key-value pair in the cache TTL by status cache rule has the following syntax - - - `status_code`: An integer value such as 200 or 500. status_code matches the - exact status code from the origin web server. Valid status codes are between - 100-999. - - `status_code_range`: Integer values for from and to. status_code_range matches - any status code from the origin web server within the specified range. - - `value`: An integer value that defines the duration an asset is valid in - seconds or one of the following strings: no-store (equivalent to -1), no-cache - (equivalent to 0). - """ - - class ActionDisableApps(TypedDict, total=False): id: Literal["disable_apps"] """ @@ -364,10 +333,9 @@ class ActionRespectStrongEtag(TypedDict, total=False): ActionBypassCacheOnCookie, ActionCacheByDeviceType, ActionCacheDeceptionArmor, - ActionCacheKeyFields, + ActionCacheKey, CacheLevelParam, ActionCacheOnCookie, - ActionCacheTTLByStatus, ActionDisableApps, ActionDisablePerformance, ActionDisableSecurity, diff --git a/src/cloudflare/types/page_rules/page_rule_edit_params.py b/src/cloudflare/types/page_rules/page_rule_edit_params.py index ea3b103842d..fe7c599ea02 100644 --- a/src/cloudflare/types/page_rules/page_rule_edit_params.py +++ b/src/cloudflare/types/page_rules/page_rule_edit_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, List, Union, Iterable +from typing import List, Union, Iterable from typing_extensions import Literal, Required, TypeAlias, TypedDict from .target_param import TargetParam @@ -31,15 +31,14 @@ "ActionBypassCacheOnCookie", "ActionCacheByDeviceType", "ActionCacheDeceptionArmor", - "ActionCacheKeyFields", - "ActionCacheKeyFieldsValue", - "ActionCacheKeyFieldsValueCookie", - "ActionCacheKeyFieldsValueHeader", - "ActionCacheKeyFieldsValueHost", - "ActionCacheKeyFieldsValueQueryString", - "ActionCacheKeyFieldsValueUser", + "ActionCacheKey", + "ActionCacheKeyValue", + "ActionCacheKeyValueCookie", + "ActionCacheKeyValueHeader", + "ActionCacheKeyValueHost", + "ActionCacheKeyValueQueryString", + "ActionCacheKeyValueUser", "ActionCacheOnCookie", - "ActionCacheTTLByStatus", "ActionDisableApps", "ActionDisablePerformance", "ActionDisableSecurity", @@ -116,7 +115,7 @@ class ActionCacheDeceptionArmor(TypedDict, total=False): """The status of Cache Deception Armor.""" -class ActionCacheKeyFieldsValueCookie(TypedDict, total=False): +class ActionCacheKeyValueCookie(TypedDict, total=False): check_presence: List[str] """ A list of cookies to check for the presence of, without including their actual @@ -127,7 +126,7 @@ class ActionCacheKeyFieldsValueCookie(TypedDict, total=False): """A list of cookies to include.""" -class ActionCacheKeyFieldsValueHeader(TypedDict, total=False): +class ActionCacheKeyValueHeader(TypedDict, total=False): check_presence: List[str] """ A list of headers to check for the presence of, without including their actual @@ -141,12 +140,12 @@ class ActionCacheKeyFieldsValueHeader(TypedDict, total=False): """A list of headers to include.""" -class ActionCacheKeyFieldsValueHost(TypedDict, total=False): +class ActionCacheKeyValueHost(TypedDict, total=False): resolved: bool """Whether to include the Host header in the HTTP request sent to the origin.""" -class ActionCacheKeyFieldsValueQueryString(TypedDict, total=False): +class ActionCacheKeyValueQueryString(TypedDict, total=False): exclude: Union[Literal["*"], List[str]] """Ignore all query string parameters.""" @@ -154,7 +153,7 @@ class ActionCacheKeyFieldsValueQueryString(TypedDict, total=False): """Include all query string parameters.""" -class ActionCacheKeyFieldsValueUser(TypedDict, total=False): +class ActionCacheKeyValueUser(TypedDict, total=False): device_type: bool """ Classifies a request as `mobile`, `desktop`, or `tablet` based on the User @@ -171,38 +170,38 @@ class ActionCacheKeyFieldsValueUser(TypedDict, total=False): """ -class ActionCacheKeyFieldsValue(TypedDict, total=False): - cookie: ActionCacheKeyFieldsValueCookie +class ActionCacheKeyValue(TypedDict, total=False): + cookie: ActionCacheKeyValueCookie """Controls which cookies appear in the Cache Key.""" - header: ActionCacheKeyFieldsValueHeader + header: ActionCacheKeyValueHeader """Controls which headers go into the Cache Key. Exactly one of `include` or `exclude` is expected. """ - host: ActionCacheKeyFieldsValueHost + host: ActionCacheKeyValueHost """Determines which host header to include in the Cache Key.""" - query_string: ActionCacheKeyFieldsValueQueryString + query_string: ActionCacheKeyValueQueryString """Controls which URL query string parameters go into the Cache Key. Exactly one of `include` or `exclude` is expected. """ - user: ActionCacheKeyFieldsValueUser + user: ActionCacheKeyValueUser """Feature fields to add features about the end-user (client) into the Cache Key.""" -class ActionCacheKeyFields(TypedDict, total=False): - id: Literal["cache_key_fields"] +class ActionCacheKey(TypedDict, total=False): + id: Literal["cache_key"] """ Control specifically what variables to include when deciding which resources to cache. This allows customers to determine what to cache based on something other than just the URL. """ - value: ActionCacheKeyFieldsValue + value: ActionCacheKeyValue class ActionCacheOnCookie(TypedDict, total=False): @@ -216,36 +215,6 @@ class ActionCacheOnCookie(TypedDict, total=False): """The regular expression to use for matching cookie names in the request.""" -class ActionCacheTTLByStatus(TypedDict, total=False): - id: Literal["cache_ttl_by_status"] - """ - Enterprise customers can set cache time-to-live (TTL) based on the response - status from the origin web server. Cache TTL refers to the duration of a - resource in the Cloudflare network before being marked as stale or discarded - from cache. Status codes are returned by a resource's origin. Setting cache TTL - based on response status overrides the default cache behavior (standard caching) - for static files and overrides cache instructions sent by the origin web server. - To cache non-static assets, set a Cache Level of Cache Everything using a Page - Rule. Setting no-store Cache-Control or a low TTL (using `max-age`/`s-maxage`) - increases requests to origin web servers and decreases performance. - """ - - value: Dict[str, Union[Literal["no-cache", "no-store"], int]] - """ - A JSON object containing status codes and their corresponding TTLs. Each - key-value pair in the cache TTL by status cache rule has the following syntax - - - `status_code`: An integer value such as 200 or 500. status_code matches the - exact status code from the origin web server. Valid status codes are between - 100-999. - - `status_code_range`: Integer values for from and to. status_code_range matches - any status code from the origin web server within the specified range. - - `value`: An integer value that defines the duration an asset is valid in - seconds or one of the following strings: no-store (equivalent to -1), no-cache - (equivalent to 0). - """ - - class ActionDisableApps(TypedDict, total=False): id: Literal["disable_apps"] """ @@ -364,10 +333,9 @@ class ActionRespectStrongEtag(TypedDict, total=False): ActionBypassCacheOnCookie, ActionCacheByDeviceType, ActionCacheDeceptionArmor, - ActionCacheKeyFields, + ActionCacheKey, CacheLevelParam, ActionCacheOnCookie, - ActionCacheTTLByStatus, ActionDisableApps, ActionDisablePerformance, ActionDisableSecurity, diff --git a/src/cloudflare/types/page_rules/page_rule_update_params.py b/src/cloudflare/types/page_rules/page_rule_update_params.py index 9328f0540b8..ceff13a48fe 100644 --- a/src/cloudflare/types/page_rules/page_rule_update_params.py +++ b/src/cloudflare/types/page_rules/page_rule_update_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, List, Union, Iterable +from typing import List, Union, Iterable from typing_extensions import Literal, Required, TypeAlias, TypedDict from .target_param import TargetParam @@ -31,15 +31,14 @@ "ActionBypassCacheOnCookie", "ActionCacheByDeviceType", "ActionCacheDeceptionArmor", - "ActionCacheKeyFields", - "ActionCacheKeyFieldsValue", - "ActionCacheKeyFieldsValueCookie", - "ActionCacheKeyFieldsValueHeader", - "ActionCacheKeyFieldsValueHost", - "ActionCacheKeyFieldsValueQueryString", - "ActionCacheKeyFieldsValueUser", + "ActionCacheKey", + "ActionCacheKeyValue", + "ActionCacheKeyValueCookie", + "ActionCacheKeyValueHeader", + "ActionCacheKeyValueHost", + "ActionCacheKeyValueQueryString", + "ActionCacheKeyValueUser", "ActionCacheOnCookie", - "ActionCacheTTLByStatus", "ActionDisableApps", "ActionDisablePerformance", "ActionDisableSecurity", @@ -116,7 +115,7 @@ class ActionCacheDeceptionArmor(TypedDict, total=False): """The status of Cache Deception Armor.""" -class ActionCacheKeyFieldsValueCookie(TypedDict, total=False): +class ActionCacheKeyValueCookie(TypedDict, total=False): check_presence: List[str] """ A list of cookies to check for the presence of, without including their actual @@ -127,7 +126,7 @@ class ActionCacheKeyFieldsValueCookie(TypedDict, total=False): """A list of cookies to include.""" -class ActionCacheKeyFieldsValueHeader(TypedDict, total=False): +class ActionCacheKeyValueHeader(TypedDict, total=False): check_presence: List[str] """ A list of headers to check for the presence of, without including their actual @@ -141,12 +140,12 @@ class ActionCacheKeyFieldsValueHeader(TypedDict, total=False): """A list of headers to include.""" -class ActionCacheKeyFieldsValueHost(TypedDict, total=False): +class ActionCacheKeyValueHost(TypedDict, total=False): resolved: bool """Whether to include the Host header in the HTTP request sent to the origin.""" -class ActionCacheKeyFieldsValueQueryString(TypedDict, total=False): +class ActionCacheKeyValueQueryString(TypedDict, total=False): exclude: Union[Literal["*"], List[str]] """Ignore all query string parameters.""" @@ -154,7 +153,7 @@ class ActionCacheKeyFieldsValueQueryString(TypedDict, total=False): """Include all query string parameters.""" -class ActionCacheKeyFieldsValueUser(TypedDict, total=False): +class ActionCacheKeyValueUser(TypedDict, total=False): device_type: bool """ Classifies a request as `mobile`, `desktop`, or `tablet` based on the User @@ -171,38 +170,38 @@ class ActionCacheKeyFieldsValueUser(TypedDict, total=False): """ -class ActionCacheKeyFieldsValue(TypedDict, total=False): - cookie: ActionCacheKeyFieldsValueCookie +class ActionCacheKeyValue(TypedDict, total=False): + cookie: ActionCacheKeyValueCookie """Controls which cookies appear in the Cache Key.""" - header: ActionCacheKeyFieldsValueHeader + header: ActionCacheKeyValueHeader """Controls which headers go into the Cache Key. Exactly one of `include` or `exclude` is expected. """ - host: ActionCacheKeyFieldsValueHost + host: ActionCacheKeyValueHost """Determines which host header to include in the Cache Key.""" - query_string: ActionCacheKeyFieldsValueQueryString + query_string: ActionCacheKeyValueQueryString """Controls which URL query string parameters go into the Cache Key. Exactly one of `include` or `exclude` is expected. """ - user: ActionCacheKeyFieldsValueUser + user: ActionCacheKeyValueUser """Feature fields to add features about the end-user (client) into the Cache Key.""" -class ActionCacheKeyFields(TypedDict, total=False): - id: Literal["cache_key_fields"] +class ActionCacheKey(TypedDict, total=False): + id: Literal["cache_key"] """ Control specifically what variables to include when deciding which resources to cache. This allows customers to determine what to cache based on something other than just the URL. """ - value: ActionCacheKeyFieldsValue + value: ActionCacheKeyValue class ActionCacheOnCookie(TypedDict, total=False): @@ -216,36 +215,6 @@ class ActionCacheOnCookie(TypedDict, total=False): """The regular expression to use for matching cookie names in the request.""" -class ActionCacheTTLByStatus(TypedDict, total=False): - id: Literal["cache_ttl_by_status"] - """ - Enterprise customers can set cache time-to-live (TTL) based on the response - status from the origin web server. Cache TTL refers to the duration of a - resource in the Cloudflare network before being marked as stale or discarded - from cache. Status codes are returned by a resource's origin. Setting cache TTL - based on response status overrides the default cache behavior (standard caching) - for static files and overrides cache instructions sent by the origin web server. - To cache non-static assets, set a Cache Level of Cache Everything using a Page - Rule. Setting no-store Cache-Control or a low TTL (using `max-age`/`s-maxage`) - increases requests to origin web servers and decreases performance. - """ - - value: Dict[str, Union[Literal["no-cache", "no-store"], int]] - """ - A JSON object containing status codes and their corresponding TTLs. Each - key-value pair in the cache TTL by status cache rule has the following syntax - - - `status_code`: An integer value such as 200 or 500. status_code matches the - exact status code from the origin web server. Valid status codes are between - 100-999. - - `status_code_range`: Integer values for from and to. status_code_range matches - any status code from the origin web server within the specified range. - - `value`: An integer value that defines the duration an asset is valid in - seconds or one of the following strings: no-store (equivalent to -1), no-cache - (equivalent to 0). - """ - - class ActionDisableApps(TypedDict, total=False): id: Literal["disable_apps"] """ @@ -364,10 +333,9 @@ class ActionRespectStrongEtag(TypedDict, total=False): ActionBypassCacheOnCookie, ActionCacheByDeviceType, ActionCacheDeceptionArmor, - ActionCacheKeyFields, + ActionCacheKey, CacheLevelParam, ActionCacheOnCookie, - ActionCacheTTLByStatus, ActionDisableApps, ActionDisablePerformance, ActionDisableSecurity, diff --git a/src/cloudflare/types/r2/bucket_create_params.py b/src/cloudflare/types/r2/bucket_create_params.py index 2515c1d8a5c..f3c106fa96f 100644 --- a/src/cloudflare/types/r2/bucket_create_params.py +++ b/src/cloudflare/types/r2/bucket_create_params.py @@ -22,5 +22,5 @@ class BucketCreateParams(TypedDict, total=False): storage_class: Annotated[Literal["Standard", "InfrequentAccess"], PropertyInfo(alias="storageClass")] """Storage class for newly uploaded objects, unless specified otherwise.""" - jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] + cf_r2_jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] """Creates the bucket in the provided jurisdiction""" diff --git a/src/cloudflare/types/r2/bucket_list_params.py b/src/cloudflare/types/r2/bucket_list_params.py index debb1a9c91d..81069cdc221 100644 --- a/src/cloudflare/types/r2/bucket_list_params.py +++ b/src/cloudflare/types/r2/bucket_list_params.py @@ -37,5 +37,5 @@ class BucketListParams(TypedDict, total=False): start_after: str """Bucket name to start searching after. Buckets are ordered lexicographically.""" - jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] + cf_r2_jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] """Lists buckets in the provided jurisdiction""" diff --git a/src/cloudflare/types/r2/buckets/cors_update_params.py b/src/cloudflare/types/r2/buckets/cors_update_params.py index ad5b14f0775..3b88a5fea57 100644 --- a/src/cloudflare/types/r2/buckets/cors_update_params.py +++ b/src/cloudflare/types/r2/buckets/cors_update_params.py @@ -16,7 +16,7 @@ class CORSUpdateParams(TypedDict, total=False): rules: Iterable[Rule] - jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] + cf_r2_jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] """The bucket jurisdiction""" diff --git a/src/cloudflare/types/r2/buckets/domains/custom_create_params.py b/src/cloudflare/types/r2/buckets/domains/custom_create_params.py index 304a30f83b6..d975f7ddba6 100644 --- a/src/cloudflare/types/r2/buckets/domains/custom_create_params.py +++ b/src/cloudflare/types/r2/buckets/domains/custom_create_params.py @@ -31,5 +31,5 @@ class CustomCreateParams(TypedDict, total=False): If not set, defaults to 1.0. """ - jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] + cf_r2_jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] """The bucket jurisdiction""" diff --git a/src/cloudflare/types/r2/buckets/domains/custom_update_params.py b/src/cloudflare/types/r2/buckets/domains/custom_update_params.py index 5719767b9bb..874833c65b7 100644 --- a/src/cloudflare/types/r2/buckets/domains/custom_update_params.py +++ b/src/cloudflare/types/r2/buckets/domains/custom_update_params.py @@ -25,5 +25,5 @@ class CustomUpdateParams(TypedDict, total=False): If not set, defaults to previous value. """ - jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] + cf_r2_jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] """The bucket jurisdiction""" diff --git a/src/cloudflare/types/r2/buckets/domains/managed_update_params.py b/src/cloudflare/types/r2/buckets/domains/managed_update_params.py index bf053372804..8e6546e1361 100644 --- a/src/cloudflare/types/r2/buckets/domains/managed_update_params.py +++ b/src/cloudflare/types/r2/buckets/domains/managed_update_params.py @@ -16,5 +16,5 @@ class ManagedUpdateParams(TypedDict, total=False): enabled: Required[bool] """Whether to enable public bucket access at the r2.dev domain""" - jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] + cf_r2_jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] """The bucket jurisdiction""" diff --git a/src/cloudflare/types/r2/buckets/event_notifications/configuration/queue_update_params.py b/src/cloudflare/types/r2/buckets/event_notifications/configuration/queue_update_params.py index 6d0db95320f..0de29620db4 100644 --- a/src/cloudflare/types/r2/buckets/event_notifications/configuration/queue_update_params.py +++ b/src/cloudflare/types/r2/buckets/event_notifications/configuration/queue_update_params.py @@ -20,7 +20,7 @@ class QueueUpdateParams(TypedDict, total=False): rules: Iterable[Rule] """Array of rules to drive notifications""" - jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] + cf_r2_jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] """The bucket jurisdiction""" diff --git a/src/cloudflare/types/r2/buckets/lifecycle_update_params.py b/src/cloudflare/types/r2/buckets/lifecycle_update_params.py index 5ee16f78bab..0de8fab57b1 100644 --- a/src/cloudflare/types/r2/buckets/lifecycle_update_params.py +++ b/src/cloudflare/types/r2/buckets/lifecycle_update_params.py @@ -31,7 +31,7 @@ class LifecycleUpdateParams(TypedDict, total=False): rules: Iterable[Rule] - jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] + cf_r2_jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] """The bucket jurisdiction""" diff --git a/src/cloudflare/types/r2/buckets/sippy_update_params.py b/src/cloudflare/types/r2/buckets/sippy_update_params.py index b260ff4a373..3e40fe0fc31 100644 --- a/src/cloudflare/types/r2/buckets/sippy_update_params.py +++ b/src/cloudflare/types/r2/buckets/sippy_update_params.py @@ -29,7 +29,7 @@ class R2EnableSippyAws(TypedDict, total=False): source: R2EnableSippyAwsSource """AWS S3 bucket to copy objects from""" - jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] + cf_r2_jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] """The bucket jurisdiction""" @@ -83,7 +83,7 @@ class R2EnableSippyGcs(TypedDict, total=False): source: R2EnableSippyGcsSource """GCS bucket to copy objects from""" - jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] + cf_r2_jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] """The bucket jurisdiction""" diff --git a/src/cloudflare/types/radar/ai/bots/summary_user_agent_params.py b/src/cloudflare/types/radar/ai/bots/summary_user_agent_params.py index 448b49a9f2c..1056e13c5b2 100644 --- a/src/cloudflare/types/radar/ai/bots/summary_user_agent_params.py +++ b/src/cloudflare/types/radar/ai/bots/summary_user_agent_params.py @@ -42,12 +42,6 @@ class SummaryUserAgentParams(TypedDict, total=False): format: Literal["JSON", "CSV"] """Format results are returned in.""" - limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] - """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - """ - location: List[str] """Array of comma separated list of locations (alpha-2 country codes). diff --git a/src/cloudflare/types/radar/ai/bots/summary_user_agent_response.py b/src/cloudflare/types/radar/ai/bots/summary_user_agent_response.py index d47ce220214..b46f01345af 100644 --- a/src/cloudflare/types/radar/ai/bots/summary_user_agent_response.py +++ b/src/cloudflare/types/radar/ai/bots/summary_user_agent_response.py @@ -53,4 +53,4 @@ class Meta(BaseModel): class SummaryUserAgentResponse(BaseModel): meta: Meta - summary_0: Dict[str, str] + summary_0: Dict[str, List[str]] diff --git a/src/cloudflare/types/radar/as112/summary_query_type_params.py b/src/cloudflare/types/radar/as112/summary_query_type_params.py index 6ff8f600ad8..aea17cb0a58 100644 --- a/src/cloudflare/types/radar/as112/summary_query_type_params.py +++ b/src/cloudflare/types/radar/as112/summary_query_type_params.py @@ -42,12 +42,6 @@ class SummaryQueryTypeParams(TypedDict, total=False): format: Literal["JSON", "CSV"] """Format results are returned in.""" - limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] - """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - """ - location: List[str] """Array of comma separated list of locations (alpha-2 country codes). diff --git a/src/cloudflare/types/radar/as112/summary_query_type_response.py b/src/cloudflare/types/radar/as112/summary_query_type_response.py index 87baa9cd63b..d5268d2eb3f 100644 --- a/src/cloudflare/types/radar/as112/summary_query_type_response.py +++ b/src/cloudflare/types/radar/as112/summary_query_type_response.py @@ -1,13 +1,20 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Optional +from typing import List, Optional from datetime import datetime from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["SummaryQueryTypeResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation"] +__all__ = [ + "SummaryQueryTypeResponse", + "Meta", + "MetaDateRange", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "Summary0", +] class MetaDateRange(BaseModel): @@ -50,7 +57,19 @@ class Meta(BaseModel): confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) +class Summary0(BaseModel): + a: str = FieldInfo(alias="A") + + aaaa: str = FieldInfo(alias="AAAA") + + ptr: str = FieldInfo(alias="PTR") + + soa: str = FieldInfo(alias="SOA") + + srv: str = FieldInfo(alias="SRV") + + class SummaryQueryTypeResponse(BaseModel): meta: Meta - summary_0: Dict[str, str] + summary_0: Summary0 diff --git a/src/cloudflare/types/radar/as112/summary_response_codes_params.py b/src/cloudflare/types/radar/as112/summary_response_codes_params.py index 1ee19186ded..9579b04766e 100644 --- a/src/cloudflare/types/radar/as112/summary_response_codes_params.py +++ b/src/cloudflare/types/radar/as112/summary_response_codes_params.py @@ -42,12 +42,6 @@ class SummaryResponseCodesParams(TypedDict, total=False): format: Literal["JSON", "CSV"] """Format results are returned in.""" - limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] - """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - """ - location: List[str] """Array of comma separated list of locations (alpha-2 country codes). diff --git a/src/cloudflare/types/radar/as112/summary_response_codes_response.py b/src/cloudflare/types/radar/as112/summary_response_codes_response.py index f4e19fe4238..9c916f07a98 100644 --- a/src/cloudflare/types/radar/as112/summary_response_codes_response.py +++ b/src/cloudflare/types/radar/as112/summary_response_codes_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Optional +from typing import List, Optional from datetime import datetime from pydantic import Field as FieldInfo @@ -13,6 +13,7 @@ "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "Summary0", ] @@ -56,7 +57,13 @@ class Meta(BaseModel): confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) +class Summary0(BaseModel): + noerror: str = FieldInfo(alias="NOERROR") + + nxdomain: str = FieldInfo(alias="NXDOMAIN") + + class SummaryResponseCodesResponse(BaseModel): meta: Meta - summary_0: Dict[str, str] + summary_0: Summary0 diff --git a/src/cloudflare/types/radar/as112/timeseries_group_query_type_params.py b/src/cloudflare/types/radar/as112/timeseries_group_query_type_params.py index cb0afb94023..d83568fe1d3 100644 --- a/src/cloudflare/types/radar/as112/timeseries_group_query_type_params.py +++ b/src/cloudflare/types/radar/as112/timeseries_group_query_type_params.py @@ -49,12 +49,6 @@ class TimeseriesGroupQueryTypeParams(TypedDict, total=False): format: Literal["JSON", "CSV"] """Format results are returned in.""" - limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] - """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - """ - location: List[str] """Array of comma separated list of locations (alpha-2 country codes). diff --git a/src/cloudflare/types/radar/as112/timeseries_group_response_codes_params.py b/src/cloudflare/types/radar/as112/timeseries_group_response_codes_params.py index 50fa3dd1979..05cf4ac7fab 100644 --- a/src/cloudflare/types/radar/as112/timeseries_group_response_codes_params.py +++ b/src/cloudflare/types/radar/as112/timeseries_group_response_codes_params.py @@ -49,12 +49,6 @@ class TimeseriesGroupResponseCodesParams(TypedDict, total=False): format: Literal["JSON", "CSV"] """Format results are returned in.""" - limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] - """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - """ - location: List[str] """Array of comma separated list of locations (alpha-2 country codes). diff --git a/src/cloudflare/types/radar/attacks/layer3/summary_vector_params.py b/src/cloudflare/types/radar/attacks/layer3/summary_vector_params.py index 55e3ea8a30a..3da6f2912a7 100644 --- a/src/cloudflare/types/radar/attacks/layer3/summary_vector_params.py +++ b/src/cloudflare/types/radar/attacks/layer3/summary_vector_params.py @@ -44,12 +44,6 @@ class SummaryVectorParams(TypedDict, total=False): ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] """Filter for ip version.""" - limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] - """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - """ - location: List[str] """Array of comma separated list of locations (alpha-2 country codes). diff --git a/src/cloudflare/types/radar/attacks/layer3/summary_vector_response.py b/src/cloudflare/types/radar/attacks/layer3/summary_vector_response.py index 7dd4becaf4b..cf21e355719 100644 --- a/src/cloudflare/types/radar/attacks/layer3/summary_vector_response.py +++ b/src/cloudflare/types/radar/attacks/layer3/summary_vector_response.py @@ -53,4 +53,4 @@ class Meta(BaseModel): class SummaryVectorResponse(BaseModel): meta: Meta - summary_0: Dict[str, str] + summary_0: Dict[str, List[str]] diff --git a/src/cloudflare/types/radar/attacks/layer7/summary_http_method_params.py b/src/cloudflare/types/radar/attacks/layer7/summary_http_method_params.py index 056c66ca9f4..6060fcfa603 100644 --- a/src/cloudflare/types/radar/attacks/layer7/summary_http_method_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/summary_http_method_params.py @@ -48,12 +48,6 @@ class SummaryHTTPMethodParams(TypedDict, total=False): ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] """Filter for ip version.""" - limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] - """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - """ - location: List[str] """Array of comma separated list of locations (alpha-2 country codes). diff --git a/src/cloudflare/types/radar/attacks/layer7/summary_http_method_response.py b/src/cloudflare/types/radar/attacks/layer7/summary_http_method_response.py index 79afadef9b6..38203e4eb07 100644 --- a/src/cloudflare/types/radar/attacks/layer7/summary_http_method_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/summary_http_method_response.py @@ -1,13 +1,20 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Optional +from typing import List, Optional from datetime import datetime from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = ["SummaryHTTPMethodResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation"] +__all__ = [ + "SummaryHTTPMethodResponse", + "Meta", + "MetaDateRange", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "Summary0", +] class MetaDateRange(BaseModel): @@ -50,7 +57,13 @@ class Meta(BaseModel): confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) +class Summary0(BaseModel): + get: str = FieldInfo(alias="GET") + + post: str = FieldInfo(alias="POST") + + class SummaryHTTPMethodResponse(BaseModel): meta: Meta - summary_0: Dict[str, str] + summary_0: Summary0 diff --git a/src/cloudflare/types/radar/attacks/layer7/summary_managed_rules_params.py b/src/cloudflare/types/radar/attacks/layer7/summary_managed_rules_params.py index 16197925be5..5dfedbebd51 100644 --- a/src/cloudflare/types/radar/attacks/layer7/summary_managed_rules_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/summary_managed_rules_params.py @@ -103,12 +103,6 @@ class SummaryManagedRulesParams(TypedDict, total=False): ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] """Filter for ip version.""" - limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] - """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - """ - location: List[str] """Array of comma separated list of locations (alpha-2 country codes). diff --git a/src/cloudflare/types/radar/attacks/layer7/summary_managed_rules_response.py b/src/cloudflare/types/radar/attacks/layer7/summary_managed_rules_response.py index d63373ae0c7..2a095a472e6 100644 --- a/src/cloudflare/types/radar/attacks/layer7/summary_managed_rules_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/summary_managed_rules_response.py @@ -53,4 +53,4 @@ class Meta(BaseModel): class SummaryManagedRulesResponse(BaseModel): meta: Meta - summary_0: Dict[str, str] + summary_0: Dict[str, List[str]] diff --git a/src/cloudflare/types/radar/attacks/layer7/summary_mitigation_product_params.py b/src/cloudflare/types/radar/attacks/layer7/summary_mitigation_product_params.py index 55a45aa7fc1..4013e1ee425 100644 --- a/src/cloudflare/types/radar/attacks/layer7/summary_mitigation_product_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/summary_mitigation_product_params.py @@ -103,12 +103,6 @@ class SummaryMitigationProductParams(TypedDict, total=False): ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] """Filter for ip version.""" - limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] - """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - """ - location: List[str] """Array of comma separated list of locations (alpha-2 country codes). diff --git a/src/cloudflare/types/radar/attacks/layer7/summary_mitigation_product_response.py b/src/cloudflare/types/radar/attacks/layer7/summary_mitigation_product_response.py index eebfb391f20..f815da2375a 100644 --- a/src/cloudflare/types/radar/attacks/layer7/summary_mitigation_product_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/summary_mitigation_product_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Optional +from typing import List, Optional from datetime import datetime from pydantic import Field as FieldInfo @@ -13,6 +13,7 @@ "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", + "Summary0", ] @@ -56,7 +57,13 @@ class Meta(BaseModel): confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) +class Summary0(BaseModel): + ddos: str = FieldInfo(alias="DDOS") + + waf: str = FieldInfo(alias="WAF") + + class SummaryMitigationProductResponse(BaseModel): meta: Meta - summary_0: Dict[str, str] + summary_0: Summary0 diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_method_params.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_method_params.py index 098e2050b40..d6ea3e4eec2 100644 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_method_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_method_params.py @@ -55,12 +55,6 @@ class TimeseriesGroupHTTPMethodParams(TypedDict, total=False): ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] """Filter for ip version.""" - limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] - """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - """ - location: List[str] """Array of comma separated list of locations (alpha-2 country codes). diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_method_response.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_method_response.py index 45e7a8b8a9f..a0f6379a2c5 100644 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_method_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_method_response.py @@ -1,6 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import TYPE_CHECKING, List +from typing import List + +from pydantic import Field as FieldInfo from ....._models import BaseModel @@ -8,13 +10,9 @@ class Serie0(BaseModel): - timestamps: List[str] + get: List[str] = FieldInfo(alias="GET") - if TYPE_CHECKING: - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> List[str]: ... + timestamps: List[str] class TimeseriesGroupHTTPMethodResponse(BaseModel): diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_version_response.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_version_response.py index 0aeb0474fd0..f8085143fa2 100644 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_version_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_version_response.py @@ -12,10 +12,6 @@ class Serie0(BaseModel): http_1_x: List[str] = FieldInfo(alias="HTTP/1.x") - http_2: List[str] = FieldInfo(alias="HTTP/2") - - http_3: List[str] = FieldInfo(alias="HTTP/3") - timestamps: List[str] diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_managed_rules_params.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_managed_rules_params.py index 055a4d3e140..7c26f5c6c64 100644 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_managed_rules_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_managed_rules_params.py @@ -110,12 +110,6 @@ class TimeseriesGroupManagedRulesParams(TypedDict, total=False): ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] """Filter for ip version.""" - limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] - """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - """ - location: List[str] """Array of comma separated list of locations (alpha-2 country codes). diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_mitigation_product_params.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_mitigation_product_params.py index 97c71692e3c..7dfb3741259 100644 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_mitigation_product_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_mitigation_product_params.py @@ -110,12 +110,6 @@ class TimeseriesGroupMitigationProductParams(TypedDict, total=False): ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] """Filter for ip version.""" - limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] - """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - """ - location: List[str] """Array of comma separated list of locations (alpha-2 country codes). diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_mitigation_product_response.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_mitigation_product_response.py index b3e88c1e6a0..7e598104c96 100644 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_mitigation_product_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_mitigation_product_response.py @@ -1,6 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import TYPE_CHECKING, List +from typing import List + +from pydantic import Field as FieldInfo from ....._models import BaseModel @@ -8,13 +10,9 @@ class Serie0(BaseModel): - timestamps: List[str] + ddos: List[str] = FieldInfo(alias="DDOS") - if TYPE_CHECKING: - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> List[str]: ... + timestamps: List[str] class TimeseriesGroupMitigationProductResponse(BaseModel): diff --git a/src/cloudflare/types/radar/http/timeseries_group_browser_family_params.py b/src/cloudflare/types/radar/http/timeseries_group_browser_family_params.py index ae16d65d0c7..df17101636c 100644 --- a/src/cloudflare/types/radar/http/timeseries_group_browser_family_params.py +++ b/src/cloudflare/types/radar/http/timeseries_group_browser_family_params.py @@ -68,12 +68,6 @@ class TimeseriesGroupBrowserFamilyParams(TypedDict, total=False): ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] """Filter for ip version.""" - limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] - """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. - """ - location: List[str] """Array of comma separated list of locations (alpha-2 country codes). diff --git a/src/cloudflare/types/radar/ranking/domain_get_params.py b/src/cloudflare/types/radar/ranking/domain_get_params.py index 95eb1587c83..98bbbaf27da 100644 --- a/src/cloudflare/types/radar/ranking/domain_get_params.py +++ b/src/cloudflare/types/radar/ranking/domain_get_params.py @@ -2,8 +2,7 @@ from __future__ import annotations -import datetime -from typing import List, Union +from typing import List from typing_extensions import Literal, Annotated, TypedDict from ...._utils import PropertyInfo @@ -12,15 +11,12 @@ class DomainGetParams(TypedDict, total=False): - date: Annotated[List[Union[str, datetime.date]], PropertyInfo(format="iso8601")] + date: List[str] """Array of dates to filter the ranking.""" format: Literal["JSON", "CSV"] """Format results are returned in.""" - include_top_locations: Annotated[bool, PropertyInfo(alias="includeTopLocations")] - """Include top locations in the response.""" - limit: int """Limit the number of objects in the response.""" diff --git a/src/cloudflare/types/radar/ranking_top_params.py b/src/cloudflare/types/radar/ranking_top_params.py index 903af228882..e482e6f9f96 100644 --- a/src/cloudflare/types/radar/ranking_top_params.py +++ b/src/cloudflare/types/radar/ranking_top_params.py @@ -2,8 +2,7 @@ from __future__ import annotations -import datetime -from typing import List, Union +from typing import List from typing_extensions import Literal, Annotated, TypedDict from ..._utils import PropertyInfo @@ -12,7 +11,7 @@ class RankingTopParams(TypedDict, total=False): - date: Annotated[List[Union[str, datetime.date]], PropertyInfo(format="iso8601")] + date: List[str] """Array of dates to filter the ranking.""" format: Literal["JSON", "CSV"] diff --git a/src/cloudflare/types/radar/tcp_resets_timeout_timeseries_groups_response.py b/src/cloudflare/types/radar/tcp_resets_timeout_timeseries_groups_response.py index b6ab06c0b94..84e1ce0e8ea 100644 --- a/src/cloudflare/types/radar/tcp_resets_timeout_timeseries_groups_response.py +++ b/src/cloudflare/types/radar/tcp_resets_timeout_timeseries_groups_response.py @@ -59,14 +59,31 @@ class Meta(BaseModel): class Serie0(BaseModel): later_in_flow: List[str] + """ + Connection resets within the first 10 packets from the client, but after the + server has received multiple data packets. + """ no_match: List[str] + """All other connections.""" post_ack: List[str] + """ + Connection resets or timeouts after the server received both a SYN packet and an + ACK packet, meaning the connection was successfully established. + """ post_psh: List[str] + """ + Connection resets or timeouts after the server received a packet with PSH flag + set, following connection establishment. + """ post_syn: List[str] + """ + Connection resets or timeouts after the server received only a single SYN + packet. + """ timestamps: List[datetime] diff --git a/src/cloudflare/types/rules/lists/item_get_response.py b/src/cloudflare/types/rules/lists/item_get_response.py index 7293cef70a3..7ed243ab3ae 100644 --- a/src/cloudflare/types/rules/lists/item_get_response.py +++ b/src/cloudflare/types/rules/lists/item_get_response.py @@ -1,15 +1,19 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import Union, Optional +from typing_extensions import TypeAlias from ..hostname import Hostname from ..redirect import Redirect -from ...._models import BaseModel -__all__ = ["ItemGetResponse"] +__all__ = ["ItemGetResponse", "UnionMember0", "RulesListsRedirect", "RulesListsHostname", "UnionMember3"] -class ItemGetResponse(BaseModel): +class UnionMember0: + pass + + +class RulesListsRedirect(Redirect): id: Optional[str] = None """The unique ID of the list.""" @@ -39,3 +43,42 @@ class ItemGetResponse(BaseModel): redirect: Optional[Redirect] = None """The definition of the redirect.""" + + +class RulesListsHostname(Hostname): + id: Optional[str] = None + """The unique ID of the list.""" + + asn: Optional[int] = None + """A non-negative 32 bit integer""" + + comment: Optional[str] = None + """An informative summary of the list item.""" + + created_on: Optional[str] = None + """The RFC 3339 timestamp of when the item was created.""" + + hostname: Optional[Hostname] = None + """ + Valid characters for hostnames are ASCII(7) letters from a to z, the digits from + 0 to 9, wildcards (\\**), and the hyphen (-). + """ + + ip: Optional[str] = None + """An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. + + IPv6 CIDRs are limited to a maximum of /64. + """ + + modified_on: Optional[str] = None + """The RFC 3339 timestamp of when the item was last modified.""" + + redirect: Optional[Redirect] = None + """The definition of the redirect.""" + + +class UnionMember3: + pass + + +ItemGetResponse: TypeAlias = Union[UnionMember0, RulesListsRedirect, RulesListsHostname, UnionMember3] diff --git a/src/cloudflare/types/rules/lists/item_list_response.py b/src/cloudflare/types/rules/lists/item_list_response.py index 233b99f1da7..21703540fd6 100644 --- a/src/cloudflare/types/rules/lists/item_list_response.py +++ b/src/cloudflare/types/rules/lists/item_list_response.py @@ -1,15 +1,19 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import Union, Optional +from typing_extensions import TypeAlias from ..hostname import Hostname from ..redirect import Redirect -from ...._models import BaseModel -__all__ = ["ItemListResponse"] +__all__ = ["ItemListResponse", "UnionMember0", "RulesListsRedirect", "RulesListsHostname", "UnionMember3"] -class ItemListResponse(BaseModel): +class UnionMember0: + pass + + +class RulesListsRedirect(Redirect): id: Optional[str] = None """The unique ID of the list.""" @@ -39,3 +43,42 @@ class ItemListResponse(BaseModel): redirect: Optional[Redirect] = None """The definition of the redirect.""" + + +class RulesListsHostname(Hostname): + id: Optional[str] = None + """The unique ID of the list.""" + + asn: Optional[int] = None + """A non-negative 32 bit integer""" + + comment: Optional[str] = None + """An informative summary of the list item.""" + + created_on: Optional[str] = None + """The RFC 3339 timestamp of when the item was created.""" + + hostname: Optional[Hostname] = None + """ + Valid characters for hostnames are ASCII(7) letters from a to z, the digits from + 0 to 9, wildcards (\\**), and the hyphen (-). + """ + + ip: Optional[str] = None + """An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. + + IPv6 CIDRs are limited to a maximum of /64. + """ + + modified_on: Optional[str] = None + """The RFC 3339 timestamp of when the item was last modified.""" + + redirect: Optional[Redirect] = None + """The definition of the redirect.""" + + +class UnionMember3: + pass + + +ItemListResponse: TypeAlias = Union[UnionMember0, RulesListsRedirect, RulesListsHostname, UnionMember3] diff --git a/src/cloudflare/types/rulesets/rule_create_params.py b/src/cloudflare/types/rulesets/rule_create_params.py index bb8fb83441d..efc9c72846f 100644 --- a/src/cloudflare/types/rulesets/rule_create_params.py +++ b/src/cloudflare/types/rulesets/rule_create_params.py @@ -147,14 +147,8 @@ "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeader", "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHost", "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString", - "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters", - "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude", - "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters", - "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters", - "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters", - "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude", - "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters", - "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude", "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser", "SetCacheSettingsRuleActionParametersCacheReserve", "SetCacheSettingsRuleActionParametersEdgeTTL", @@ -2282,66 +2276,38 @@ class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHost(TypedDict, total """ -class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters( - TypedDict, total=False -): - list: List[str] - - -class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters( - TypedDict, total=False -): +class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude(TypedDict, total=False): all: bool - """Determines whether to include all query string parameters in the cache key.""" - - -SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude: TypeAlias = Union[ - SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters, - SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters, -] - + """Exclude all query string parameters from use in building the cache key.""" -class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters( - TypedDict, total=False -): - include: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude - """A list of query string parameters used to build the cache key.""" - - -class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters( - TypedDict, total=False -): list: List[str] + """A list of query string parameters NOT used to build the cache key. - -class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters( - TypedDict, total=False -): - all: bool - """Determines whether to exclude all query string parameters from the cache key.""" + All parameters present in the request but missing in this list will be used to + build the cache key. + """ -SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude: TypeAlias = Union[ - SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters, - SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters, -] +class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude(TypedDict, total=False): + all: bool + """Use all query string parameters in the cache key.""" + list: List[str] + """A list of query string parameters used to build the cache key.""" -class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters( - TypedDict, total=False -): - exclude: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude - """A list of query string parameters NOT used to build the cache key. - All parameters present in the request but missing in this list will be used to - build the cache key. +class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString(TypedDict, total=False): + exclude: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude + """ + build the cache key using all query string parameters EXCECPT these excluded + parameters """ - -SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString: TypeAlias = Union[ - SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters, - SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters, -] + include: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude + """ + build the cache key using a list of query string parameters that ARE in the + request. + """ class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser(TypedDict, total=False): @@ -2366,7 +2332,10 @@ class SetCacheSettingsRuleActionParametersCacheKeyCustomKey(TypedDict, total=Fal """Whether to use the original host or the resolved host in the cache key.""" query_string: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString - """Use the presence of parameters in the query string to build the cache key.""" + """ + Use the presence or absence of parameters in the query string to build the cache + key. + """ user: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser """Characteristics of the request user agent used in building the cache key.""" diff --git a/src/cloudflare/types/rulesets/rule_edit_params.py b/src/cloudflare/types/rulesets/rule_edit_params.py index 396a92a4459..201bf84f5b3 100644 --- a/src/cloudflare/types/rulesets/rule_edit_params.py +++ b/src/cloudflare/types/rulesets/rule_edit_params.py @@ -147,14 +147,8 @@ "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeader", "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHost", "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString", - "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters", - "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude", - "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters", - "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters", - "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters", - "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude", - "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters", - "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude", "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser", "SetCacheSettingsRuleActionParametersCacheReserve", "SetCacheSettingsRuleActionParametersEdgeTTL", @@ -2327,66 +2321,38 @@ class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHost(TypedDict, total """ -class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters( - TypedDict, total=False -): - list: List[str] - - -class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters( - TypedDict, total=False -): +class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude(TypedDict, total=False): all: bool - """Determines whether to include all query string parameters in the cache key.""" - - -SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude: TypeAlias = Union[ - SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters, - SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters, -] - + """Exclude all query string parameters from use in building the cache key.""" -class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters( - TypedDict, total=False -): - include: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude - """A list of query string parameters used to build the cache key.""" - - -class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters( - TypedDict, total=False -): list: List[str] + """A list of query string parameters NOT used to build the cache key. - -class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters( - TypedDict, total=False -): - all: bool - """Determines whether to exclude all query string parameters from the cache key.""" + All parameters present in the request but missing in this list will be used to + build the cache key. + """ -SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude: TypeAlias = Union[ - SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters, - SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters, -] +class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude(TypedDict, total=False): + all: bool + """Use all query string parameters in the cache key.""" + list: List[str] + """A list of query string parameters used to build the cache key.""" -class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters( - TypedDict, total=False -): - exclude: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude - """A list of query string parameters NOT used to build the cache key. - All parameters present in the request but missing in this list will be used to - build the cache key. +class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString(TypedDict, total=False): + exclude: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude + """ + build the cache key using all query string parameters EXCECPT these excluded + parameters """ - -SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString: TypeAlias = Union[ - SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters, - SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters, -] + include: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude + """ + build the cache key using a list of query string parameters that ARE in the + request. + """ class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser(TypedDict, total=False): @@ -2411,7 +2377,10 @@ class SetCacheSettingsRuleActionParametersCacheKeyCustomKey(TypedDict, total=Fal """Whether to use the original host or the resolved host in the cache key.""" query_string: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString - """Use the presence of parameters in the query string to build the cache key.""" + """ + Use the presence or absence of parameters in the query string to build the cache + key. + """ user: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser """Characteristics of the request user agent used in building the cache key.""" diff --git a/src/cloudflare/types/rulesets/set_cache_settings_rule.py b/src/cloudflare/types/rulesets/set_cache_settings_rule.py index e88114d9f66..2b35f718029 100644 --- a/src/cloudflare/types/rulesets/set_cache_settings_rule.py +++ b/src/cloudflare/types/rulesets/set_cache_settings_rule.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Union, Optional +from typing import Dict, List, Optional from datetime import datetime -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -19,14 +19,8 @@ "ActionParametersCacheKeyCustomKeyHeader", "ActionParametersCacheKeyCustomKeyHost", "ActionParametersCacheKeyCustomKeyQueryString", - "ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters", - "ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude", - "ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters", - "ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters", - "ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters", - "ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude", - "ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters", - "ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters", + "ActionParametersCacheKeyCustomKeyQueryStringExclude", + "ActionParametersCacheKeyCustomKeyQueryStringInclude", "ActionParametersCacheKeyCustomKeyUser", "ActionParametersCacheReserve", "ActionParametersEdgeTTL", @@ -91,62 +85,38 @@ class ActionParametersCacheKeyCustomKeyHost(BaseModel): """ -class ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters( - BaseModel -): - rule_list: Optional[List[str]] = FieldInfo(alias="list", default=None) - - -class ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters( - BaseModel -): +class ActionParametersCacheKeyCustomKeyQueryStringExclude(BaseModel): all: Optional[bool] = None - """Determines whether to include all query string parameters in the cache key.""" - + """Exclude all query string parameters from use in building the cache key.""" -ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude: TypeAlias = Union[ - ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters, - ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters, -] - - -class ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters(BaseModel): - include: Optional[ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude] = None - """A list of query string parameters used to build the cache key.""" - - -class ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters( - BaseModel -): rule_list: Optional[List[str]] = FieldInfo(alias="list", default=None) + """A list of query string parameters NOT used to build the cache key. - -class ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters( - BaseModel -): - all: Optional[bool] = None - """Determines whether to exclude all query string parameters from the cache key.""" + All parameters present in the request but missing in this list will be used to + build the cache key. + """ -ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude: TypeAlias = Union[ - ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters, - ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters, -] +class ActionParametersCacheKeyCustomKeyQueryStringInclude(BaseModel): + all: Optional[bool] = None + """Use all query string parameters in the cache key.""" + rule_list: Optional[List[str]] = FieldInfo(alias="list", default=None) + """A list of query string parameters used to build the cache key.""" -class ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters(BaseModel): - exclude: Optional[ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude] = None - """A list of query string parameters NOT used to build the cache key. - All parameters present in the request but missing in this list will be used to - build the cache key. +class ActionParametersCacheKeyCustomKeyQueryString(BaseModel): + exclude: Optional[ActionParametersCacheKeyCustomKeyQueryStringExclude] = None + """ + build the cache key using all query string parameters EXCECPT these excluded + parameters """ - -ActionParametersCacheKeyCustomKeyQueryString: TypeAlias = Union[ - ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters, - ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters, -] + include: Optional[ActionParametersCacheKeyCustomKeyQueryStringInclude] = None + """ + build the cache key using a list of query string parameters that ARE in the + request. + """ class ActionParametersCacheKeyCustomKeyUser(BaseModel): @@ -171,7 +141,10 @@ class ActionParametersCacheKeyCustomKey(BaseModel): """Whether to use the original host or the resolved host in the cache key.""" query_string: Optional[ActionParametersCacheKeyCustomKeyQueryString] = None - """Use the presence of parameters in the query string to build the cache key.""" + """ + Use the presence or absence of parameters in the query string to build the cache + key. + """ user: Optional[ActionParametersCacheKeyCustomKeyUser] = None """Characteristics of the request user agent used in building the cache key.""" diff --git a/src/cloudflare/types/rulesets/set_cache_settings_rule_param.py b/src/cloudflare/types/rulesets/set_cache_settings_rule_param.py index ed6d9f5818e..ff8c9861e22 100644 --- a/src/cloudflare/types/rulesets/set_cache_settings_rule_param.py +++ b/src/cloudflare/types/rulesets/set_cache_settings_rule_param.py @@ -2,8 +2,8 @@ from __future__ import annotations -from typing import Dict, List, Union, Iterable -from typing_extensions import Literal, Required, TypeAlias, TypedDict +from typing import Dict, List, Iterable +from typing_extensions import Literal, Required, TypedDict from .logging_param import LoggingParam @@ -17,14 +17,8 @@ "ActionParametersCacheKeyCustomKeyHeader", "ActionParametersCacheKeyCustomKeyHost", "ActionParametersCacheKeyCustomKeyQueryString", - "ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters", - "ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude", - "ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters", - "ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters", - "ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters", - "ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude", - "ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters", - "ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters", + "ActionParametersCacheKeyCustomKeyQueryStringExclude", + "ActionParametersCacheKeyCustomKeyQueryStringInclude", "ActionParametersCacheKeyCustomKeyUser", "ActionParametersCacheReserve", "ActionParametersEdgeTTL", @@ -89,62 +83,38 @@ class ActionParametersCacheKeyCustomKeyHost(TypedDict, total=False): """ -class ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters( - TypedDict, total=False -): - list: List[str] - - -class ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters( - TypedDict, total=False -): +class ActionParametersCacheKeyCustomKeyQueryStringExclude(TypedDict, total=False): all: bool - """Determines whether to include all query string parameters in the cache key.""" - - -ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude: TypeAlias = Union[ - ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters, - ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters, -] - + """Exclude all query string parameters from use in building the cache key.""" -class ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters(TypedDict, total=False): - include: ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude - """A list of query string parameters used to build the cache key.""" - - -class ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters( - TypedDict, total=False -): list: List[str] + """A list of query string parameters NOT used to build the cache key. - -class ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters( - TypedDict, total=False -): - all: bool - """Determines whether to exclude all query string parameters from the cache key.""" + All parameters present in the request but missing in this list will be used to + build the cache key. + """ -ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude: TypeAlias = Union[ - ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters, - ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters, -] +class ActionParametersCacheKeyCustomKeyQueryStringInclude(TypedDict, total=False): + all: bool + """Use all query string parameters in the cache key.""" + list: List[str] + """A list of query string parameters used to build the cache key.""" -class ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters(TypedDict, total=False): - exclude: ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude - """A list of query string parameters NOT used to build the cache key. - All parameters present in the request but missing in this list will be used to - build the cache key. +class ActionParametersCacheKeyCustomKeyQueryString(TypedDict, total=False): + exclude: ActionParametersCacheKeyCustomKeyQueryStringExclude + """ + build the cache key using all query string parameters EXCECPT these excluded + parameters """ - -ActionParametersCacheKeyCustomKeyQueryString: TypeAlias = Union[ - ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters, - ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters, -] + include: ActionParametersCacheKeyCustomKeyQueryStringInclude + """ + build the cache key using a list of query string parameters that ARE in the + request. + """ class ActionParametersCacheKeyCustomKeyUser(TypedDict, total=False): @@ -169,7 +139,10 @@ class ActionParametersCacheKeyCustomKey(TypedDict, total=False): """Whether to use the original host or the resolved host in the cache key.""" query_string: ActionParametersCacheKeyCustomKeyQueryString - """Use the presence of parameters in the query string to build the cache key.""" + """ + Use the presence or absence of parameters in the query string to build the cache + key. + """ user: ActionParametersCacheKeyCustomKeyUser """Characteristics of the request user agent used in building the cache key.""" diff --git a/src/cloudflare/types/shared/token.py b/src/cloudflare/types/shared/token.py index fd4787368c9..60c5cc8e911 100644 --- a/src/cloudflare/types/shared/token.py +++ b/src/cloudflare/types/shared/token.py @@ -22,7 +22,7 @@ class ConditionRequestIP(BaseModel): class Condition(BaseModel): - request_ip: Optional[ConditionRequestIP] = None + request_ip: Optional[ConditionRequestIP] = FieldInfo(alias="request.ip", default=None) """Client IP restrictions.""" diff --git a/src/cloudflare/types/shared/token_policy.py b/src/cloudflare/types/shared/token_policy.py index 10909830a01..9611c150894 100644 --- a/src/cloudflare/types/shared/token_policy.py +++ b/src/cloudflare/types/shared/token_policy.py @@ -1,11 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Optional +from typing import List, Optional from typing_extensions import Literal from ..._models import BaseModel -__all__ = ["TokenPolicy", "PermissionGroup", "PermissionGroupMeta"] +__all__ = ["TokenPolicy", "PermissionGroup", "PermissionGroupMeta", "Resources"] class PermissionGroupMeta(BaseModel): @@ -25,6 +25,12 @@ class PermissionGroup(BaseModel): """Name of the group.""" +class Resources(BaseModel): + resource: Optional[str] = None + + scope: Optional[str] = None + + class TokenPolicy(BaseModel): id: str """Policy identifier.""" @@ -35,5 +41,5 @@ class TokenPolicy(BaseModel): permission_groups: List[PermissionGroup] """A set of permission groups that are specified to the policy.""" - resources: Dict[str, str] + resources: Resources """A list of resource names that the policy applies to.""" diff --git a/src/cloudflare/types/shared_params/token_policy.py b/src/cloudflare/types/shared_params/token_policy.py index 96b7d37451f..789802e3df7 100644 --- a/src/cloudflare/types/shared_params/token_policy.py +++ b/src/cloudflare/types/shared_params/token_policy.py @@ -2,10 +2,10 @@ from __future__ import annotations -from typing import Dict, Iterable +from typing import Iterable from typing_extensions import Literal, Required, TypedDict -__all__ = ["TokenPolicy", "PermissionGroup", "PermissionGroupMeta"] +__all__ = ["TokenPolicy", "PermissionGroup", "PermissionGroupMeta", "Resources"] class PermissionGroupMeta(TypedDict, total=False): @@ -19,6 +19,12 @@ class PermissionGroup(TypedDict, total=False): """Attributes associated to the permission group.""" +class Resources(TypedDict, total=False): + resource: str + + scope: str + + class TokenPolicy(TypedDict, total=False): effect: Required[Literal["allow", "deny"]] """Allow or deny operations against the resources.""" @@ -26,5 +32,5 @@ class TokenPolicy(TypedDict, total=False): permission_groups: Required[Iterable[PermissionGroup]] """A set of permission groups that are specified to the policy.""" - resources: Required[Dict[str, str]] + resources: Required[Resources] """A list of resource names that the policy applies to.""" diff --git a/src/cloudflare/types/url_normalization/url_normalization_get_response.py b/src/cloudflare/types/url_normalization/url_normalization_get_response.py index 9ea0d8949ea..0bebaa4413c 100644 --- a/src/cloudflare/types/url_normalization/url_normalization_get_response.py +++ b/src/cloudflare/types/url_normalization/url_normalization_get_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing_extensions import Literal +from typing import Optional from ..._models import BaseModel @@ -8,8 +8,8 @@ class URLNormalizationGetResponse(BaseModel): - scope: Literal["incoming", "both"] + scope: Optional[str] = None """The scope of the URL normalization.""" - type: Literal["cloudflare", "rfc3986"] + type: Optional[str] = None """The type of URL normalization performed by Cloudflare.""" diff --git a/src/cloudflare/types/url_normalization/url_normalization_update_params.py b/src/cloudflare/types/url_normalization/url_normalization_update_params.py index 77533d9d48a..fb2b4551fa4 100644 --- a/src/cloudflare/types/url_normalization/url_normalization_update_params.py +++ b/src/cloudflare/types/url_normalization/url_normalization_update_params.py @@ -2,17 +2,17 @@ from __future__ import annotations -from typing_extensions import Literal, Required, TypedDict +from typing_extensions import Required, TypedDict __all__ = ["URLNormalizationUpdateParams"] class URLNormalizationUpdateParams(TypedDict, total=False): zone_id: Required[str] - """The unique ID of the zone.""" + """Identifier""" - scope: Required[Literal["incoming", "both"]] + scope: str """The scope of the URL normalization.""" - type: Required[Literal["cloudflare", "rfc3986"]] + type: str """The type of URL normalization performed by Cloudflare.""" diff --git a/src/cloudflare/types/url_normalization/url_normalization_update_response.py b/src/cloudflare/types/url_normalization/url_normalization_update_response.py index 610eef85af1..b7d70096ced 100644 --- a/src/cloudflare/types/url_normalization/url_normalization_update_response.py +++ b/src/cloudflare/types/url_normalization/url_normalization_update_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing_extensions import Literal +from typing import Optional from ..._models import BaseModel @@ -8,8 +8,8 @@ class URLNormalizationUpdateResponse(BaseModel): - scope: Literal["incoming", "both"] + scope: Optional[str] = None """The scope of the URL normalization.""" - type: Literal["cloudflare", "rfc3986"] + type: Optional[str] = None """The type of URL normalization performed by Cloudflare.""" diff --git a/src/cloudflare/types/url_scanner/scan_bulk_create_params.py b/src/cloudflare/types/url_scanner/scan_bulk_create_params.py index 6509c75550e..8bdd2ef9263 100644 --- a/src/cloudflare/types/url_scanner/scan_bulk_create_params.py +++ b/src/cloudflare/types/url_scanner/scan_bulk_create_params.py @@ -11,9 +11,6 @@ class ScanBulkCreateParams(TypedDict, total=False): - account_id: Required[str] - """Account ID.""" - body: Required[Iterable[Body]] """List of urls to scan (up to a 100).""" diff --git a/src/cloudflare/types/url_scanner/scan_create_params.py b/src/cloudflare/types/url_scanner/scan_create_params.py index 782da4a9c85..16a71092669 100644 --- a/src/cloudflare/types/url_scanner/scan_create_params.py +++ b/src/cloudflare/types/url_scanner/scan_create_params.py @@ -11,9 +11,6 @@ class ScanCreateParams(TypedDict, total=False): - account_id: Required[str] - """Account ID.""" - url: Required[str] customagent: str diff --git a/src/cloudflare/types/url_scanner/scan_list_params.py b/src/cloudflare/types/url_scanner/scan_list_params.py index 97421b92ccc..c13e697eda1 100644 --- a/src/cloudflare/types/url_scanner/scan_list_params.py +++ b/src/cloudflare/types/url_scanner/scan_list_params.py @@ -2,15 +2,12 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import TypedDict __all__ = ["ScanListParams"] class ScanListParams(TypedDict, total=False): - account_id: Required[str] - """Account ID.""" - q: str """Filter scans""" diff --git a/src/cloudflare/types/url_scanner/scan_screenshot_params.py b/src/cloudflare/types/url_scanner/scan_screenshot_params.py index 263a003363f..2b3a24b0dd4 100644 --- a/src/cloudflare/types/url_scanner/scan_screenshot_params.py +++ b/src/cloudflare/types/url_scanner/scan_screenshot_params.py @@ -2,14 +2,16 @@ from __future__ import annotations -from typing_extensions import Literal, Required, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo __all__ = ["ScanScreenshotParams"] class ScanScreenshotParams(TypedDict, total=False): - account_id: Required[str] - """Account ID.""" + account_id: Required[Annotated[str, PropertyInfo(alias="accountId")]] + """Account Id.""" resolution: Literal["desktop", "mobile", "tablet"] """Target device type.""" diff --git a/src/cloudflare/types/user/token_create_params.py b/src/cloudflare/types/user/token_create_params.py index 166b95b2e7f..bf9e2e8de5b 100644 --- a/src/cloudflare/types/user/token_create_params.py +++ b/src/cloudflare/types/user/token_create_params.py @@ -47,5 +47,5 @@ class ConditionRequestIP(_ConditionRequestIPReservedKeywords, total=False): class Condition(TypedDict, total=False): - request_ip: ConditionRequestIP + request_ip: Annotated[ConditionRequestIP, PropertyInfo(alias="request.ip")] """Client IP restrictions.""" diff --git a/src/cloudflare/types/user/token_create_response.py b/src/cloudflare/types/user/token_create_response.py index baad5983f71..cfc75aba10c 100644 --- a/src/cloudflare/types/user/token_create_response.py +++ b/src/cloudflare/types/user/token_create_response.py @@ -23,7 +23,7 @@ class ConditionRequestIP(BaseModel): class Condition(BaseModel): - request_ip: Optional[ConditionRequestIP] = None + request_ip: Optional[ConditionRequestIP] = FieldInfo(alias="request.ip", default=None) """Client IP restrictions.""" diff --git a/src/cloudflare/types/user/token_update_params.py b/src/cloudflare/types/user/token_update_params.py index b48ae15215b..55c166825b4 100644 --- a/src/cloudflare/types/user/token_update_params.py +++ b/src/cloudflare/types/user/token_update_params.py @@ -50,5 +50,5 @@ class ConditionRequestIP(_ConditionRequestIPReservedKeywords, total=False): class Condition(TypedDict, total=False): - request_ip: ConditionRequestIP + request_ip: Annotated[ConditionRequestIP, PropertyInfo(alias="request.ip")] """Client IP restrictions.""" diff --git a/src/cloudflare/types/vectorize/index_delete_response.py b/src/cloudflare/types/vectorize/index_delete_response.py index 04ceee6b545..2680eb61604 100644 --- a/src/cloudflare/types/vectorize/index_delete_response.py +++ b/src/cloudflare/types/vectorize/index_delete_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union +from typing import Union, Optional from typing_extensions import TypeAlias __all__ = ["IndexDeleteResponse"] -IndexDeleteResponse: TypeAlias = Union[str, object, None] +IndexDeleteResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/waiting_rooms/waiting_room.py b/src/cloudflare/types/waiting_rooms/waiting_room.py index 0364a65dfb7..eff1d6b5d24 100644 --- a/src/cloudflare/types/waiting_rooms/waiting_room.py +++ b/src/cloudflare/types/waiting_rooms/waiting_room.py @@ -376,22 +376,3 @@ class WaitingRoom(BaseModel): active users sessions on the route based on the traffic patterns at that time around the world. """ - - turnstile_action: Optional[Literal["log", "infinite_queue"]] = None - """Which action to take when a bot is detected using Turnstile. - - `log` will have no impact on queueing behavior, simply keeping track of how many - bots are detected in Waiting Room Analytics. `infinite_queue` will send bots to - a false queueing state, where they will never reach your origin. - `infinite_queue` requires Advanced Waiting Room. - """ - - turnstile_mode: Optional[Literal["off", "invisible", "visible_non_interactive", "visible_managed"]] = None - """Which Turnstile widget type to use for detecting bot traffic. - - See - [the Turnstile documentation](https://developers.cloudflare.com/turnstile/concepts/widget/#widget-types) - for the definitions of these widget types. Set to `off` to disable the Turnstile - integration entirely. Setting this to anything other than `off` or `invisible` - requires Advanced Waiting Room. - """ diff --git a/src/cloudflare/types/waiting_rooms/waiting_room_create_params.py b/src/cloudflare/types/waiting_rooms/waiting_room_create_params.py index 775fc8974ca..ef0cf714c53 100644 --- a/src/cloudflare/types/waiting_rooms/waiting_room_create_params.py +++ b/src/cloudflare/types/waiting_rooms/waiting_room_create_params.py @@ -365,22 +365,3 @@ class WaitingRoomCreateParams(TypedDict, total=False): If set to `true`, the traffic will not go to the waiting room. """ - - turnstile_action: Literal["log", "infinite_queue"] - """Which action to take when a bot is detected using Turnstile. - - `log` will have no impact on queueing behavior, simply keeping track of how many - bots are detected in Waiting Room Analytics. `infinite_queue` will send bots to - a false queueing state, where they will never reach your origin. - `infinite_queue` requires Advanced Waiting Room. - """ - - turnstile_mode: Literal["off", "invisible", "visible_non_interactive", "visible_managed"] - """Which Turnstile widget type to use for detecting bot traffic. - - See - [the Turnstile documentation](https://developers.cloudflare.com/turnstile/concepts/widget/#widget-types) - for the definitions of these widget types. Set to `off` to disable the Turnstile - integration entirely. Setting this to anything other than `off` or `invisible` - requires Advanced Waiting Room. - """ diff --git a/src/cloudflare/types/waiting_rooms/waiting_room_edit_params.py b/src/cloudflare/types/waiting_rooms/waiting_room_edit_params.py index c2c494dc57c..f47bf7c06c6 100644 --- a/src/cloudflare/types/waiting_rooms/waiting_room_edit_params.py +++ b/src/cloudflare/types/waiting_rooms/waiting_room_edit_params.py @@ -365,22 +365,3 @@ class WaitingRoomEditParams(TypedDict, total=False): If set to `true`, the traffic will not go to the waiting room. """ - - turnstile_action: Literal["log", "infinite_queue"] - """Which action to take when a bot is detected using Turnstile. - - `log` will have no impact on queueing behavior, simply keeping track of how many - bots are detected in Waiting Room Analytics. `infinite_queue` will send bots to - a false queueing state, where they will never reach your origin. - `infinite_queue` requires Advanced Waiting Room. - """ - - turnstile_mode: Literal["off", "invisible", "visible_non_interactive", "visible_managed"] - """Which Turnstile widget type to use for detecting bot traffic. - - See - [the Turnstile documentation](https://developers.cloudflare.com/turnstile/concepts/widget/#widget-types) - for the definitions of these widget types. Set to `off` to disable the Turnstile - integration entirely. Setting this to anything other than `off` or `invisible` - requires Advanced Waiting Room. - """ diff --git a/src/cloudflare/types/waiting_rooms/waiting_room_update_params.py b/src/cloudflare/types/waiting_rooms/waiting_room_update_params.py index 52e93cfbc38..f93d914d4b0 100644 --- a/src/cloudflare/types/waiting_rooms/waiting_room_update_params.py +++ b/src/cloudflare/types/waiting_rooms/waiting_room_update_params.py @@ -365,22 +365,3 @@ class WaitingRoomUpdateParams(TypedDict, total=False): If set to `true`, the traffic will not go to the waiting room. """ - - turnstile_action: Literal["log", "infinite_queue"] - """Which action to take when a bot is detected using Turnstile. - - `log` will have no impact on queueing behavior, simply keeping track of how many - bots are detected in Waiting Room Analytics. `infinite_queue` will send bots to - a false queueing state, where they will never reach your origin. - `infinite_queue` requires Advanced Waiting Room. - """ - - turnstile_mode: Literal["off", "invisible", "visible_non_interactive", "visible_managed"] - """Which Turnstile widget type to use for detecting bot traffic. - - See - [the Turnstile documentation](https://developers.cloudflare.com/turnstile/concepts/widget/#widget-types) - for the definitions of these widget types. Set to `off` to disable the Turnstile - integration entirely. Setting this to anything other than `off` or `invisible` - requires Advanced Waiting Room. - """ diff --git a/src/cloudflare/types/workers/__init__.py b/src/cloudflare/types/workers/__init__.py index 201450ef852..57bde2d76cb 100644 --- a/src/cloudflare/types/workers/__init__.py +++ b/src/cloudflare/types/workers/__init__.py @@ -4,28 +4,42 @@ from .domain import Domain as Domain from .script import Script as Script +from .binding import Binding as Binding +from .d1_binding import D1Binding as D1Binding +from .r2_binding import R2Binding as R2Binding +from .ai_run_params import AIRunParams as AIRunParams +from .binding_param import BindingParam as BindingParam from .migration_step import MigrationStep as MigrationStep from .script_setting import ScriptSetting as ScriptSetting +from .ai_run_response import AIRunResponse as AIRunResponse +from .service_binding import ServiceBinding as ServiceBinding +from .d1_binding_param import D1BindingParam as D1BindingParam +from .r2_binding_param import R2BindingParam as R2BindingParam +from .mtls_cert_binding import MTLSCERTBinding as MTLSCERTBinding +from .stepped_migration import SteppedMigration as SteppedMigration from .domain_list_params import DomainListParams as DomainListParams -from .route_get_response import RouteGetResponse as RouteGetResponse -from .route_create_params import RouteCreateParams as RouteCreateParams -from .route_list_response import RouteListResponse as RouteListResponse -from .route_update_params import RouteUpdateParams as RouteUpdateParams -from .script_get_response import ScriptGetResponse as ScriptGetResponse from .domain_update_params import DomainUpdateParams as DomainUpdateParams +from .kv_namespace_binding import KVNamespaceBinding as KVNamespaceBinding from .migration_step_param import MigrationStepParam as MigrationStepParam from .script_delete_params import ScriptDeleteParams as ScriptDeleteParams from .script_update_params import ScriptUpdateParams as ScriptUpdateParams -from .route_create_response import RouteCreateResponse as RouteCreateResponse -from .route_delete_response import RouteDeleteResponse as RouteDeleteResponse -from .route_update_response import RouteUpdateResponse as RouteUpdateResponse +from .service_binding_param import ServiceBindingParam as ServiceBindingParam from .single_step_migration import SingleStepMigration as SingleStepMigration from .worker_metadata_param import WorkerMetadataParam as WorkerMetadataParam +from .durable_object_binding import DurableObjectBinding as DurableObjectBinding from .script_update_response import ScriptUpdateResponse as ScriptUpdateResponse from .subdomain_get_response import SubdomainGetResponse as SubdomainGetResponse +from .mtls_cert_binding_param import MTLSCERTBindingParam as MTLSCERTBindingParam +from .placement_configuration import PlacementConfiguration as PlacementConfiguration +from .stepped_migration_param import SteppedMigrationParam as SteppedMigrationParam from .subdomain_update_params import SubdomainUpdateParams as SubdomainUpdateParams from .subdomain_update_response import SubdomainUpdateResponse as SubdomainUpdateResponse +from .dispatch_namespace_binding import DispatchNamespaceBinding as DispatchNamespaceBinding +from .kv_namespace_binding_param import KVNamespaceBindingParam as KVNamespaceBindingParam from .single_step_migration_param import SingleStepMigrationParam as SingleStepMigrationParam from .account_setting_get_response import AccountSettingGetResponse as AccountSettingGetResponse +from .durable_object_binding_param import DurableObjectBindingParam as DurableObjectBindingParam from .account_setting_update_params import AccountSettingUpdateParams as AccountSettingUpdateParams +from .placement_configuration_param import PlacementConfigurationParam as PlacementConfigurationParam from .account_setting_update_response import AccountSettingUpdateResponse as AccountSettingUpdateResponse +from .dispatch_namespace_binding_param import DispatchNamespaceBindingParam as DispatchNamespaceBindingParam diff --git a/src/cloudflare/types/workers/ai/__init__.py b/src/cloudflare/types/workers/ai/__init__.py new file mode 100644 index 00000000000..f8ee8b14b1c --- /dev/null +++ b/src/cloudflare/types/workers/ai/__init__.py @@ -0,0 +1,3 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations diff --git a/src/cloudflare/types/ai/models/__init__.py b/src/cloudflare/types/workers/ai/models/__init__.py similarity index 100% rename from src/cloudflare/types/ai/models/__init__.py rename to src/cloudflare/types/workers/ai/models/__init__.py diff --git a/src/cloudflare/types/ai/models/schema_get_params.py b/src/cloudflare/types/workers/ai/models/schema_get_params.py similarity index 100% rename from src/cloudflare/types/ai/models/schema_get_params.py rename to src/cloudflare/types/workers/ai/models/schema_get_params.py diff --git a/src/cloudflare/types/ai/ai_run_params.py b/src/cloudflare/types/workers/ai_run_params.py similarity index 100% rename from src/cloudflare/types/ai/ai_run_params.py rename to src/cloudflare/types/workers/ai_run_params.py diff --git a/src/cloudflare/types/ai/ai_run_response.py b/src/cloudflare/types/workers/ai_run_response.py similarity index 100% rename from src/cloudflare/types/ai/ai_run_response.py rename to src/cloudflare/types/workers/ai_run_response.py diff --git a/src/cloudflare/types/workers/binding.py b/src/cloudflare/types/workers/binding.py new file mode 100644 index 00000000000..9a34a8ef377 --- /dev/null +++ b/src/cloudflare/types/workers/binding.py @@ -0,0 +1,47 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import Literal, TypeAlias + +from ..._models import BaseModel +from .d1_binding import D1Binding +from .r2_binding import R2Binding +from .service_binding import ServiceBinding +from .mtls_cert_binding import MTLSCERTBinding +from .kv_namespace_binding import KVNamespaceBinding +from .durable_object_binding import DurableObjectBinding +from .dispatch_namespace_binding import DispatchNamespaceBinding + +__all__ = ["Binding", "WorkersQueueBinding", "WorkersAssetsBinding"] + + +class WorkersQueueBinding(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + queue_name: str + """Name of the Queue to bind to""" + + type: Literal["queue"] + """The class of resource that the binding provides.""" + + +class WorkersAssetsBinding(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["assets"] + """The class of resource that the binding provides.""" + + +Binding: TypeAlias = Union[ + KVNamespaceBinding, + ServiceBinding, + DurableObjectBinding, + R2Binding, + WorkersQueueBinding, + D1Binding, + DispatchNamespaceBinding, + MTLSCERTBinding, + WorkersAssetsBinding, +] diff --git a/src/cloudflare/types/workers/binding_param.py b/src/cloudflare/types/workers/binding_param.py new file mode 100644 index 00000000000..b0d2a41ab37 --- /dev/null +++ b/src/cloudflare/types/workers/binding_param.py @@ -0,0 +1,42 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from .d1_binding_param import D1BindingParam +from .r2_binding_param import R2BindingParam +from .service_binding_param import ServiceBindingParam +from .mtls_cert_binding_param import MTLSCERTBindingParam +from .kv_namespace_binding_param import KVNamespaceBindingParam +from .durable_object_binding_param import DurableObjectBindingParam +from .dispatch_namespace_binding_param import DispatchNamespaceBindingParam + +__all__ = ["BindingParam", "WorkersQueueBinding", "WorkersAssetsBinding"] + + +class WorkersQueueBinding(TypedDict, total=False): + queue_name: Required[str] + """Name of the Queue to bind to""" + + type: Required[Literal["queue"]] + """The class of resource that the binding provides.""" + + +class WorkersAssetsBinding(TypedDict, total=False): + type: Required[Literal["assets"]] + """The class of resource that the binding provides.""" + + +BindingParam: TypeAlias = Union[ + KVNamespaceBindingParam, + ServiceBindingParam, + DurableObjectBindingParam, + R2BindingParam, + WorkersQueueBinding, + D1BindingParam, + DispatchNamespaceBindingParam, + MTLSCERTBindingParam, + WorkersAssetsBinding, +] diff --git a/src/cloudflare/types/workers/d1_binding.py b/src/cloudflare/types/workers/d1_binding.py new file mode 100644 index 00000000000..7010fcfa068 --- /dev/null +++ b/src/cloudflare/types/workers/d1_binding.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["D1Binding"] + + +class D1Binding(BaseModel): + id: str + """ID of the D1 database to bind to""" + + binding: str + """A JavaScript variable name for the binding.""" + + name: str + """The name of the D1 database associated with the 'id' provided.""" + + type: Literal["d1"] + """The class of resource that the binding provides.""" diff --git a/src/cloudflare/types/workers/d1_binding_param.py b/src/cloudflare/types/workers/d1_binding_param.py new file mode 100644 index 00000000000..74face1628f --- /dev/null +++ b/src/cloudflare/types/workers/d1_binding_param.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["D1BindingParam"] + + +class D1BindingParam(TypedDict, total=False): + id: Required[str] + """ID of the D1 database to bind to""" + + name: Required[str] + """The name of the D1 database associated with the 'id' provided.""" + + type: Required[Literal["d1"]] + """The class of resource that the binding provides.""" diff --git a/src/cloudflare/types/workers/dispatch_namespace_binding.py b/src/cloudflare/types/workers/dispatch_namespace_binding.py new file mode 100644 index 00000000000..7211e0a0dbb --- /dev/null +++ b/src/cloudflare/types/workers/dispatch_namespace_binding.py @@ -0,0 +1,41 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["DispatchNamespaceBinding", "Outbound", "OutboundWorker"] + + +class OutboundWorker(BaseModel): + environment: Optional[str] = None + """Environment of the outbound worker""" + + service: Optional[str] = None + """Name of the outbound worker""" + + +class Outbound(BaseModel): + params: Optional[List[str]] = None + """ + Pass information from the Dispatch Worker to the Outbound Worker through the + parameters + """ + + worker: Optional[OutboundWorker] = None + """Outbound worker""" + + +class DispatchNamespaceBinding(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + namespace: str + """Namespace to bind to""" + + type: Literal["dispatch_namespace"] + """The class of resource that the binding provides.""" + + outbound: Optional[Outbound] = None + """Outbound worker""" diff --git a/src/cloudflare/types/workers/dispatch_namespace_binding_param.py b/src/cloudflare/types/workers/dispatch_namespace_binding_param.py new file mode 100644 index 00000000000..584c5d86e15 --- /dev/null +++ b/src/cloudflare/types/workers/dispatch_namespace_binding_param.py @@ -0,0 +1,38 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["DispatchNamespaceBindingParam", "Outbound", "OutboundWorker"] + + +class OutboundWorker(TypedDict, total=False): + environment: str + """Environment of the outbound worker""" + + service: str + """Name of the outbound worker""" + + +class Outbound(TypedDict, total=False): + params: List[str] + """ + Pass information from the Dispatch Worker to the Outbound Worker through the + parameters + """ + + worker: OutboundWorker + """Outbound worker""" + + +class DispatchNamespaceBindingParam(TypedDict, total=False): + namespace: Required[str] + """Namespace to bind to""" + + type: Required[Literal["dispatch_namespace"]] + """The class of resource that the binding provides.""" + + outbound: Outbound + """Outbound worker""" diff --git a/src/cloudflare/types/workers/durable_object_binding.py b/src/cloudflare/types/workers/durable_object_binding.py new file mode 100644 index 00000000000..acef5a67aae --- /dev/null +++ b/src/cloudflare/types/workers/durable_object_binding.py @@ -0,0 +1,30 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["DurableObjectBinding"] + + +class DurableObjectBinding(BaseModel): + class_name: str + """The exported class name of the Durable Object""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["durable_object_namespace"] + """The class of resource that the binding provides.""" + + environment: Optional[str] = None + """The environment of the script_name to bind to""" + + namespace_id: Optional[str] = None + """Namespace identifier tag.""" + + script_name: Optional[str] = None + """ + The script where the Durable Object is defined, if it is external to this Worker + """ diff --git a/src/cloudflare/types/workers/durable_object_binding_param.py b/src/cloudflare/types/workers/durable_object_binding_param.py new file mode 100644 index 00000000000..6c00bbd63a9 --- /dev/null +++ b/src/cloudflare/types/workers/durable_object_binding_param.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["DurableObjectBindingParam"] + + +class DurableObjectBindingParam(TypedDict, total=False): + class_name: Required[str] + """The exported class name of the Durable Object""" + + type: Required[Literal["durable_object_namespace"]] + """The class of resource that the binding provides.""" + + environment: str + """The environment of the script_name to bind to""" + + script_name: str + """ + The script where the Durable Object is defined, if it is external to this Worker + """ diff --git a/src/cloudflare/types/workers/kv_namespace_binding.py b/src/cloudflare/types/workers/kv_namespace_binding.py new file mode 100644 index 00000000000..bf28ce9caac --- /dev/null +++ b/src/cloudflare/types/workers/kv_namespace_binding.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["KVNamespaceBinding"] + + +class KVNamespaceBinding(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + namespace_id: str + """Namespace identifier tag.""" + + type: Literal["kv_namespace"] + """The class of resource that the binding provides.""" diff --git a/src/cloudflare/types/workers/kv_namespace_binding_param.py b/src/cloudflare/types/workers/kv_namespace_binding_param.py new file mode 100644 index 00000000000..7dc97bab2a6 --- /dev/null +++ b/src/cloudflare/types/workers/kv_namespace_binding_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["KVNamespaceBindingParam"] + + +class KVNamespaceBindingParam(TypedDict, total=False): + type: Required[Literal["kv_namespace"]] + """The class of resource that the binding provides.""" diff --git a/src/cloudflare/types/workers/mtls_cert_binding.py b/src/cloudflare/types/workers/mtls_cert_binding.py new file mode 100644 index 00000000000..e80080bd283 --- /dev/null +++ b/src/cloudflare/types/workers/mtls_cert_binding.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["MTLSCERTBinding"] + + +class MTLSCERTBinding(BaseModel): + certificate_id: str + """ID of the certificate to bind to""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["mtls_certificate"] + """The class of resource that the binding provides.""" diff --git a/src/cloudflare/types/workers/mtls_cert_binding_param.py b/src/cloudflare/types/workers/mtls_cert_binding_param.py new file mode 100644 index 00000000000..5dbf4a2d61b --- /dev/null +++ b/src/cloudflare/types/workers/mtls_cert_binding_param.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["MTLSCERTBindingParam"] + + +class MTLSCERTBindingParam(TypedDict, total=False): + certificate_id: Required[str] + """ID of the certificate to bind to""" + + type: Required[Literal["mtls_certificate"]] + """The class of resource that the binding provides.""" diff --git a/src/cloudflare/types/workers/placement_configuration.py b/src/cloudflare/types/workers/placement_configuration.py new file mode 100644 index 00000000000..0eb2b9eec7d --- /dev/null +++ b/src/cloudflare/types/workers/placement_configuration.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["PlacementConfiguration"] + + +class PlacementConfiguration(BaseModel): + mode: Optional[Literal["smart"]] = None + """ + Enables + [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). + Only `"smart"` is currently supported + """ diff --git a/src/cloudflare/types/workers/placement_configuration_param.py b/src/cloudflare/types/workers/placement_configuration_param.py new file mode 100644 index 00000000000..f6ef4c070fd --- /dev/null +++ b/src/cloudflare/types/workers/placement_configuration_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["PlacementConfigurationParam"] + + +class PlacementConfigurationParam(TypedDict, total=False): + mode: Literal["smart"] + """ + Enables + [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). + Only `"smart"` is currently supported + """ diff --git a/src/cloudflare/types/workers/r2_binding.py b/src/cloudflare/types/workers/r2_binding.py new file mode 100644 index 00000000000..523844ac272 --- /dev/null +++ b/src/cloudflare/types/workers/r2_binding.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["R2Binding"] + + +class R2Binding(BaseModel): + bucket_name: str + """R2 bucket to bind to""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["r2_bucket"] + """The class of resource that the binding provides.""" diff --git a/src/cloudflare/types/workers/r2_binding_param.py b/src/cloudflare/types/workers/r2_binding_param.py new file mode 100644 index 00000000000..559667ded10 --- /dev/null +++ b/src/cloudflare/types/workers/r2_binding_param.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["R2BindingParam"] + + +class R2BindingParam(TypedDict, total=False): + bucket_name: Required[str] + """R2 bucket to bind to""" + + type: Required[Literal["r2_bucket"]] + """The class of resource that the binding provides.""" diff --git a/src/cloudflare/types/workers/route_create_params.py b/src/cloudflare/types/workers/route_create_params.py deleted file mode 100644 index 479c701b0e9..00000000000 --- a/src/cloudflare/types/workers/route_create_params.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["RouteCreateParams"] - - -class RouteCreateParams(TypedDict, total=False): - zone_id: Required[str] - """Identifier""" - - pattern: Required[str] - - script: str - """Name of the script, used in URLs and route configuration.""" diff --git a/src/cloudflare/types/workers/route_delete_response.py b/src/cloudflare/types/workers/route_delete_response.py deleted file mode 100644 index df25ccce223..00000000000 --- a/src/cloudflare/types/workers/route_delete_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import Literal - -from ..._models import BaseModel -from ..shared.response_info import ResponseInfo - -__all__ = ["RouteDeleteResponse"] - - -class RouteDeleteResponse(BaseModel): - errors: List[ResponseInfo] - - messages: List[ResponseInfo] - - success: Literal[True] - """Whether the API call was successful""" diff --git a/src/cloudflare/types/workers/route_get_response.py b/src/cloudflare/types/workers/route_get_response.py deleted file mode 100644 index 169dcf43ea2..00000000000 --- a/src/cloudflare/types/workers/route_get_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["RouteGetResponse"] - - -class RouteGetResponse(BaseModel): - id: str - """Identifier""" - - pattern: str - - script: str - """Name of the script, used in URLs and route configuration.""" diff --git a/src/cloudflare/types/workers/route_list_response.py b/src/cloudflare/types/workers/route_list_response.py deleted file mode 100644 index b6002c20b63..00000000000 --- a/src/cloudflare/types/workers/route_list_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["RouteListResponse"] - - -class RouteListResponse(BaseModel): - id: str - """Identifier""" - - pattern: str - - script: str - """Name of the script, used in URLs and route configuration.""" diff --git a/src/cloudflare/types/workers/route_update_params.py b/src/cloudflare/types/workers/route_update_params.py deleted file mode 100644 index d4954d0bd6a..00000000000 --- a/src/cloudflare/types/workers/route_update_params.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["RouteUpdateParams"] - - -class RouteUpdateParams(TypedDict, total=False): - zone_id: Required[str] - """Identifier""" - - pattern: Required[str] - - script: str - """Name of the script, used in URLs and route configuration.""" diff --git a/src/cloudflare/types/workers/route_update_response.py b/src/cloudflare/types/workers/route_update_response.py deleted file mode 100644 index 1c2e70ac262..00000000000 --- a/src/cloudflare/types/workers/route_update_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["RouteUpdateResponse"] - - -class RouteUpdateResponse(BaseModel): - id: str - """Identifier""" - - pattern: str - - script: str - """Name of the script, used in URLs and route configuration.""" diff --git a/src/cloudflare/types/workers/script.py b/src/cloudflare/types/workers/script.py index 336e5797a4f..f57a98a895f 100644 --- a/src/cloudflare/types/workers/script.py +++ b/src/cloudflare/types/workers/script.py @@ -2,26 +2,11 @@ from typing import List, Optional from datetime import datetime -from typing_extensions import Literal from ..._models import BaseModel from .scripts.consumer_script import ConsumerScript -__all__ = ["Script", "Placement"] - - -class Placement(BaseModel): - mode: Optional[Literal["smart"]] = None - """ - Enables - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - """ - - status: Optional[Literal["SUCCESS", "UNSUPPORTED_APPLICATION", "INSUFFICIENT_INVOCATIONS"]] = None - """ - Status of - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - """ +__all__ = ["Script"] class Script(BaseModel): @@ -46,26 +31,11 @@ class Script(BaseModel): modified_on: Optional[datetime] = None """When the script was last modified.""" - placement: Optional[Placement] = None - """ - Configuration for - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - """ - - placement_mode: Optional[Literal["smart"]] = None - """ - Enables - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - """ - - placement_status: Optional[Literal["SUCCESS", "UNSUPPORTED_APPLICATION", "INSUFFICIENT_INVOCATIONS"]] = None - """ - Status of - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - """ + placement_mode: Optional[str] = None + """Specifies the placement mode for the Worker (e.g. 'smart').""" tail_consumers: Optional[List[ConsumerScript]] = None """List of Workers that will consume logs from the attached Worker.""" - usage_model: Optional[Literal["standard"]] = None - """Usage model for the Worker invocations.""" + usage_model: Optional[str] = None + """Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound').""" diff --git a/src/cloudflare/types/workers/script_get_response.py b/src/cloudflare/types/workers/script_get_response.py deleted file mode 100644 index 7d789c074c7..00000000000 --- a/src/cloudflare/types/workers/script_get_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["ScriptGetResponse"] - -ScriptGetResponse: TypeAlias = str diff --git a/src/cloudflare/types/workers/script_update_params.py b/src/cloudflare/types/workers/script_update_params.py index 3bac9979ed1..ebdb23511ac 100644 --- a/src/cloudflare/types/workers/script_update_params.py +++ b/src/cloudflare/types/workers/script_update_params.py @@ -3,56 +3,54 @@ from __future__ import annotations from typing import Dict, List, Union, Iterable, Optional -from typing_extensions import Literal, Required, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict -from .migration_step_param import MigrationStepParam +from ..._types import FileTypes +from ..._utils import PropertyInfo +from .stepped_migration_param import SteppedMigrationParam from .single_step_migration_param import SingleStepMigrationParam +from .placement_configuration_param import PlacementConfigurationParam from .scripts.consumer_script_param import ConsumerScriptParam __all__ = [ "ScriptUpdateParams", - "Metadata", - "MetadataAssets", - "MetadataAssetsConfig", - "MetadataBinding", - "MetadataBindingWorkersBindingKindAny", - "MetadataBindingWorkersBindingKindAI", - "MetadataBindingWorkersBindingKindAnalyticsEngine", - "MetadataBindingWorkersBindingKindAssets", - "MetadataBindingWorkersBindingKindBrowserRendering", - "MetadataBindingWorkersBindingKindD1", - "MetadataBindingWorkersBindingKindDispatchNamespace", - "MetadataBindingWorkersBindingKindDispatchNamespaceOutbound", - "MetadataBindingWorkersBindingKindDispatchNamespaceOutboundWorker", - "MetadataBindingWorkersBindingKindDo", - "MetadataBindingWorkersBindingKindHyperdrive", - "MetadataBindingWorkersBindingKindJson", - "MetadataBindingWorkersBindingKindKVNamespace", - "MetadataBindingWorkersBindingKindMTLSCERT", - "MetadataBindingWorkersBindingKindPlainText", - "MetadataBindingWorkersBindingKindQueue", - "MetadataBindingWorkersBindingKindR2", - "MetadataBindingWorkersBindingKindSecret", - "MetadataBindingWorkersBindingKindService", - "MetadataBindingWorkersBindingKindTailConsumer", - "MetadataBindingWorkersBindingKindVectorize", - "MetadataBindingWorkersBindingKindVersionMetadata", - "MetadataMigrations", - "MetadataMigrationsWorkersMultipleStepMigrations", - "MetadataObservability", - "MetadataPlacement", + "Variant0", + "Variant0Metadata", + "Variant0MetadataAssets", + "Variant0MetadataAssetsConfig", + "Variant0MetadataBinding", + "Variant0MetadataMigrations", + "Variant0MetadataObservability", + "Variant1", ] -class ScriptUpdateParams(TypedDict, total=False): +class Variant0(TypedDict, total=False): account_id: Required[str] """Identifier""" - metadata: Required[Metadata] + rollback_to: str + """Rollback to provided deployment based on deployment ID. + + Request body will only parse a "message" part. You can learn more about + deployments + [here](https://developers.cloudflare.com/workers/platform/deployments/). + """ + + any_part_name: Annotated[List[FileTypes], PropertyInfo(alias="")] + """A module comprising a Worker script, often a javascript file. + + Multiple modules may be provided as separate named parts, but at least one + module must be present and referenced in the metadata as `main_module` or + `body_part` by part name. Source maps may also be included using the + `application/source-map` content type. + """ + + metadata: Variant0Metadata """JSON encoded metadata about the uploaded parts and Worker configuration.""" -class MetadataAssetsConfig(TypedDict, total=False): +class Variant0MetadataAssetsConfig(TypedDict, total=False): html_handling: Literal["auto-trailing-slash", "force-trailing-slash", "drop-trailing-slash", "none"] """Determines the redirects and rewrites of requests for HTML content.""" @@ -70,301 +68,32 @@ class MetadataAssetsConfig(TypedDict, total=False): """ -class MetadataAssets(TypedDict, total=False): - config: MetadataAssetsConfig +class Variant0MetadataAssets(TypedDict, total=False): + config: Variant0MetadataAssetsConfig """Configuration for assets within a Worker.""" jwt: str """Token provided upon successful upload of all files from a registered manifest.""" -class MetadataBindingWorkersBindingKindAnyTyped(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[str] - """The kind of resource that the binding provides.""" - - -MetadataBindingWorkersBindingKindAny: TypeAlias = Union[MetadataBindingWorkersBindingKindAnyTyped, Dict[str, object]] - - -class MetadataBindingWorkersBindingKindAI(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["ai"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindAnalyticsEngine(TypedDict, total=False): - dataset: Required[str] - """The dataset name to bind to.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["analytics_engine"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindAssets(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["assets"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindBrowserRendering(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["browser_rendering"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindD1(TypedDict, total=False): - id: Required[str] - """Identifier of the D1 database to bind to.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["d1"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindDispatchNamespaceOutboundWorker(TypedDict, total=False): - environment: str - """Environment of the outbound worker.""" - - service: str - """Name of the outbound worker.""" - - -class MetadataBindingWorkersBindingKindDispatchNamespaceOutbound(TypedDict, total=False): - params: List[str] - """ - Pass information from the Dispatch Worker to the Outbound Worker through the - parameters. - """ - - worker: MetadataBindingWorkersBindingKindDispatchNamespaceOutboundWorker - """Outbound worker.""" - - -class MetadataBindingWorkersBindingKindDispatchNamespace(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - namespace: Required[str] - """Namespace to bind to.""" - - type: Required[Literal["dispatch_namespace"]] - """The kind of resource that the binding provides.""" - - outbound: MetadataBindingWorkersBindingKindDispatchNamespaceOutbound - """Outbound worker.""" - - -class MetadataBindingWorkersBindingKindDo(TypedDict, total=False): - class_name: Required[str] - """The exported class name of the Durable Object.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["durable_object_namespace"]] - """The kind of resource that the binding provides.""" - - environment: str - """The environment of the script_name to bind to.""" - - namespace_id: str - """Namespace identifier tag.""" - - script_name: str - """ - The script where the Durable Object is defined, if it is external to this - Worker. - """ - - -class MetadataBindingWorkersBindingKindHyperdrive(TypedDict, total=False): - id: Required[str] - """Identifier of the Hyperdrive connection to bind to.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["hyperdrive"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindJson(TypedDict, total=False): - json: Required[str] - """JSON data to use.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["json"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindKVNamespace(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - namespace_id: Required[str] - """Namespace identifier tag.""" - - type: Required[Literal["kv_namespace"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindMTLSCERT(TypedDict, total=False): - certificate_id: Required[str] - """Identifier of the certificate to bind to.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" +class Variant0MetadataBindingTyped(TypedDict, total=False): + name: str + """Name of the binding variable.""" - type: Required[Literal["mtls_certificate"]] - """The kind of resource that the binding provides.""" + type: str + """Type of binding. - -class MetadataBindingWorkersBindingKindPlainText(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - text: Required[str] - """The text value to use.""" - - type: Required[Literal["plain_text"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindQueue(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - queue_name: Required[str] - """Name of the Queue to bind to.""" - - type: Required[Literal["queue"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindR2(TypedDict, total=False): - bucket_name: Required[str] - """R2 bucket to bind to.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["r2_bucket"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindSecret(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - text: Required[str] - """The secret value to use.""" - - type: Required[Literal["secret_text"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindService(TypedDict, total=False): - environment: Required[str] - """Optional environment if the Worker utilizes one.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - service: Required[str] - """Name of Worker to bind to.""" - - type: Required[Literal["service"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindTailConsumer(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - service: Required[str] - """Name of Tail Worker to bind to.""" - - type: Required[Literal["tail_consumer"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindVectorize(TypedDict, total=False): - index_name: Required[str] - """Name of the Vectorize index to bind to.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["vectorize"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindVersionMetadata(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["version_metadata"]] - """The kind of resource that the binding provides.""" - - -MetadataBinding: TypeAlias = Union[ - MetadataBindingWorkersBindingKindAny, - MetadataBindingWorkersBindingKindAI, - MetadataBindingWorkersBindingKindAnalyticsEngine, - MetadataBindingWorkersBindingKindAssets, - MetadataBindingWorkersBindingKindBrowserRendering, - MetadataBindingWorkersBindingKindD1, - MetadataBindingWorkersBindingKindDispatchNamespace, - MetadataBindingWorkersBindingKindDo, - MetadataBindingWorkersBindingKindHyperdrive, - MetadataBindingWorkersBindingKindJson, - MetadataBindingWorkersBindingKindKVNamespace, - MetadataBindingWorkersBindingKindMTLSCERT, - MetadataBindingWorkersBindingKindPlainText, - MetadataBindingWorkersBindingKindQueue, - MetadataBindingWorkersBindingKindR2, - MetadataBindingWorkersBindingKindSecret, - MetadataBindingWorkersBindingKindService, - MetadataBindingWorkersBindingKindTailConsumer, - MetadataBindingWorkersBindingKindVectorize, - MetadataBindingWorkersBindingKindVersionMetadata, -] - - -class MetadataMigrationsWorkersMultipleStepMigrations(TypedDict, total=False): - new_tag: str - """Tag to set as the latest migration tag.""" - - old_tag: str - """Tag used to verify against the latest migration tag for this Worker. - - If they don't match, the upload is rejected. + You can find more about bindings on our docs: + https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings. """ - steps: Iterable[MigrationStepParam] - """Migrations to apply in order.""" +Variant0MetadataBinding: TypeAlias = Union[Variant0MetadataBindingTyped, Dict[str, object]] -MetadataMigrations: TypeAlias = Union[SingleStepMigrationParam, MetadataMigrationsWorkersMultipleStepMigrations] +Variant0MetadataMigrations: TypeAlias = Union[SingleStepMigrationParam, SteppedMigrationParam] -class MetadataObservability(TypedDict, total=False): +class Variant0MetadataObservability(TypedDict, total=False): enabled: Required[bool] """Whether observability is enabled for the Worker.""" @@ -375,24 +104,12 @@ class MetadataObservability(TypedDict, total=False): """ -class MetadataPlacement(TypedDict, total=False): - mode: Literal["smart"] - """ - Enables - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - """ - - -class Metadata(TypedDict, total=False): - assets: MetadataAssets +class Variant0Metadata(TypedDict, total=False): + assets: Variant0MetadataAssets """Configuration for assets within a Worker""" - bindings: Iterable[MetadataBinding] - """List of bindings attached to a Worker. - - You can find more about bindings on our docs: - https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings. - """ + bindings: Iterable[Variant0MetadataBinding] + """List of bindings available to the worker.""" body_part: str """Name of the part in the multipart request that contains the script (e.g. @@ -433,17 +150,13 @@ class Metadata(TypedDict, total=False): the file exporting a `fetch` handler). Indicates a `module syntax` Worker. """ - migrations: MetadataMigrations + migrations: Variant0MetadataMigrations """Migrations to apply for Durable Objects associated with this Worker.""" - observability: MetadataObservability + observability: Variant0MetadataObservability """Observability settings for the Worker.""" - placement: MetadataPlacement - """ - Configuration for - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - """ + placement: PlacementConfigurationParam tags: List[str] """List of strings to use as tags for this Worker.""" @@ -451,5 +164,30 @@ class Metadata(TypedDict, total=False): tail_consumers: Iterable[ConsumerScriptParam] """List of Workers that will consume logs from the attached Worker.""" - usage_model: Literal["standard"] - """Usage model for the Worker invocations.""" + usage_model: Literal["bundled", "unbound"] + """Usage model to apply to invocations.""" + + version_tags: Dict[str, str] + """Key-value pairs to use as tags for this version of this Worker.""" + + +class Variant1(TypedDict, total=False): + account_id: Required[str] + """Identifier""" + + rollback_to: str + """Rollback to provided deployment based on deployment ID. + + Request body will only parse a "message" part. You can learn more about + deployments + [here](https://developers.cloudflare.com/workers/platform/deployments/). + """ + + message: str + """Rollback message to be associated with this deployment. + + Only parsed when query param `"rollback_to"` is present. + """ + + +ScriptUpdateParams: TypeAlias = Union[Variant0, Variant1] diff --git a/src/cloudflare/types/workers/script_update_response.py b/src/cloudflare/types/workers/script_update_response.py index 53d735b8638..b677f246eda 100644 --- a/src/cloudflare/types/workers/script_update_response.py +++ b/src/cloudflare/types/workers/script_update_response.py @@ -2,26 +2,11 @@ from typing import List, Optional from datetime import datetime -from typing_extensions import Literal from ..._models import BaseModel from .scripts.consumer_script import ConsumerScript -__all__ = ["ScriptUpdateResponse", "Placement"] - - -class Placement(BaseModel): - mode: Optional[Literal["smart"]] = None - """ - Enables - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - """ - - status: Optional[Literal["SUCCESS", "UNSUPPORTED_APPLICATION", "INSUFFICIENT_INVOCATIONS"]] = None - """ - Status of - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - """ +__all__ = ["ScriptUpdateResponse"] class ScriptUpdateResponse(BaseModel): @@ -46,28 +31,13 @@ class ScriptUpdateResponse(BaseModel): modified_on: Optional[datetime] = None """When the script was last modified.""" - placement: Optional[Placement] = None - """ - Configuration for - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - """ - - placement_mode: Optional[Literal["smart"]] = None - """ - Enables - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - """ - - placement_status: Optional[Literal["SUCCESS", "UNSUPPORTED_APPLICATION", "INSUFFICIENT_INVOCATIONS"]] = None - """ - Status of - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - """ + placement_mode: Optional[str] = None + """Specifies the placement mode for the Worker (e.g. 'smart').""" startup_time_ms: Optional[int] = None tail_consumers: Optional[List[ConsumerScript]] = None """List of Workers that will consume logs from the attached Worker.""" - usage_model: Optional[Literal["standard"]] = None - """Usage model for the Worker invocations.""" + usage_model: Optional[str] = None + """Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound').""" diff --git a/src/cloudflare/types/workers/scripts/content_update_params.py b/src/cloudflare/types/workers/scripts/content_update_params.py index 4228706762e..f5c5e96e343 100644 --- a/src/cloudflare/types/workers/scripts/content_update_params.py +++ b/src/cloudflare/types/workers/scripts/content_update_params.py @@ -2,8 +2,10 @@ from __future__ import annotations +from typing import List from typing_extensions import Required, Annotated, TypedDict +from ...._types import FileTypes from ...._utils import PropertyInfo from ..worker_metadata_param import WorkerMetadataParam @@ -14,7 +16,18 @@ class ContentUpdateParams(TypedDict, total=False): account_id: Required[str] """Identifier""" - metadata: Required[WorkerMetadataParam] + any_part_name: Annotated[List[FileTypes], PropertyInfo(alias="")] + """A module comprising a Worker script, often a javascript file. + + Multiple modules may be provided as separate named parts, but at least one + module must be present. This should be referenced either in the metadata as + `main_module` (esm)/`body_part` (service worker) or as a header + `CF-WORKER-MAIN-MODULE-PART` (esm) /`CF-WORKER-BODY-PART` (service worker) by + part name. Source maps may also be included using the `application/source-map` + content type. + """ + + metadata: WorkerMetadataParam """JSON encoded metadata about the uploaded parts and Worker configuration.""" cf_worker_body_part: Annotated[str, PropertyInfo(alias="CF-WORKER-BODY-PART")] diff --git a/src/cloudflare/types/workers/scripts/version_create_params.py b/src/cloudflare/types/workers/scripts/version_create_params.py index ea793046aa2..a80b0f876e9 100644 --- a/src/cloudflare/types/workers/scripts/version_create_params.py +++ b/src/cloudflare/types/workers/scripts/version_create_params.py @@ -2,46 +2,27 @@ from __future__ import annotations -from typing import Dict, List, Union, Iterable -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing import List, Iterable +from typing_extensions import Literal, Required, Annotated, TypedDict +from ...._types import FileTypes from ...._utils import PropertyInfo -__all__ = [ - "VersionCreateParams", - "Metadata", - "MetadataAnnotations", - "MetadataBinding", - "MetadataBindingWorkersBindingKindAny", - "MetadataBindingWorkersBindingKindAI", - "MetadataBindingWorkersBindingKindAnalyticsEngine", - "MetadataBindingWorkersBindingKindAssets", - "MetadataBindingWorkersBindingKindBrowserRendering", - "MetadataBindingWorkersBindingKindD1", - "MetadataBindingWorkersBindingKindDispatchNamespace", - "MetadataBindingWorkersBindingKindDispatchNamespaceOutbound", - "MetadataBindingWorkersBindingKindDispatchNamespaceOutboundWorker", - "MetadataBindingWorkersBindingKindDo", - "MetadataBindingWorkersBindingKindHyperdrive", - "MetadataBindingWorkersBindingKindJson", - "MetadataBindingWorkersBindingKindKVNamespace", - "MetadataBindingWorkersBindingKindMTLSCERT", - "MetadataBindingWorkersBindingKindPlainText", - "MetadataBindingWorkersBindingKindQueue", - "MetadataBindingWorkersBindingKindR2", - "MetadataBindingWorkersBindingKindSecret", - "MetadataBindingWorkersBindingKindService", - "MetadataBindingWorkersBindingKindTailConsumer", - "MetadataBindingWorkersBindingKindVectorize", - "MetadataBindingWorkersBindingKindVersionMetadata", -] +__all__ = ["VersionCreateParams", "Metadata", "MetadataAnnotations"] class VersionCreateParams(TypedDict, total=False): account_id: Required[str] """Identifier""" - metadata: Required[Metadata] + any_part_name: Annotated[List[FileTypes], PropertyInfo(alias="")] + """A module comprising a Worker script, often a javascript file. + + Multiple modules may be provided as separate named parts, but at least one + module must be present and referenced in the metadata as `main_module`. + """ + + metadata: Metadata """JSON encoded metadata about the uploaded parts and Worker configuration.""" @@ -53,291 +34,11 @@ class MetadataAnnotations(TypedDict, total=False): """User-provided identifier for the version.""" -class MetadataBindingWorkersBindingKindAnyTyped(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[str] - """The kind of resource that the binding provides.""" - - -MetadataBindingWorkersBindingKindAny: TypeAlias = Union[MetadataBindingWorkersBindingKindAnyTyped, Dict[str, object]] - - -class MetadataBindingWorkersBindingKindAI(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["ai"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindAnalyticsEngine(TypedDict, total=False): - dataset: Required[str] - """The dataset name to bind to.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["analytics_engine"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindAssets(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["assets"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindBrowserRendering(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["browser_rendering"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindD1(TypedDict, total=False): - id: Required[str] - """Identifier of the D1 database to bind to.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["d1"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindDispatchNamespaceOutboundWorker(TypedDict, total=False): - environment: str - """Environment of the outbound worker.""" - - service: str - """Name of the outbound worker.""" - - -class MetadataBindingWorkersBindingKindDispatchNamespaceOutbound(TypedDict, total=False): - params: List[str] - """ - Pass information from the Dispatch Worker to the Outbound Worker through the - parameters. - """ - - worker: MetadataBindingWorkersBindingKindDispatchNamespaceOutboundWorker - """Outbound worker.""" - - -class MetadataBindingWorkersBindingKindDispatchNamespace(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - namespace: Required[str] - """Namespace to bind to.""" - - type: Required[Literal["dispatch_namespace"]] - """The kind of resource that the binding provides.""" - - outbound: MetadataBindingWorkersBindingKindDispatchNamespaceOutbound - """Outbound worker.""" - - -class MetadataBindingWorkersBindingKindDo(TypedDict, total=False): - class_name: Required[str] - """The exported class name of the Durable Object.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["durable_object_namespace"]] - """The kind of resource that the binding provides.""" - - environment: str - """The environment of the script_name to bind to.""" - - namespace_id: str - """Namespace identifier tag.""" - - script_name: str - """ - The script where the Durable Object is defined, if it is external to this - Worker. - """ - - -class MetadataBindingWorkersBindingKindHyperdrive(TypedDict, total=False): - id: Required[str] - """Identifier of the Hyperdrive connection to bind to.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["hyperdrive"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindJson(TypedDict, total=False): - json: Required[str] - """JSON data to use.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["json"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindKVNamespace(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - namespace_id: Required[str] - """Namespace identifier tag.""" - - type: Required[Literal["kv_namespace"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindMTLSCERT(TypedDict, total=False): - certificate_id: Required[str] - """Identifier of the certificate to bind to.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["mtls_certificate"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindPlainText(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - text: Required[str] - """The text value to use.""" - - type: Required[Literal["plain_text"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindQueue(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - queue_name: Required[str] - """Name of the Queue to bind to.""" - - type: Required[Literal["queue"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindR2(TypedDict, total=False): - bucket_name: Required[str] - """R2 bucket to bind to.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["r2_bucket"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindSecret(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - text: Required[str] - """The secret value to use.""" - - type: Required[Literal["secret_text"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindService(TypedDict, total=False): - environment: Required[str] - """Optional environment if the Worker utilizes one.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - service: Required[str] - """Name of Worker to bind to.""" - - type: Required[Literal["service"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindTailConsumer(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - service: Required[str] - """Name of Tail Worker to bind to.""" - - type: Required[Literal["tail_consumer"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindVectorize(TypedDict, total=False): - index_name: Required[str] - """Name of the Vectorize index to bind to.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["vectorize"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindVersionMetadata(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["version_metadata"]] - """The kind of resource that the binding provides.""" - - -MetadataBinding: TypeAlias = Union[ - MetadataBindingWorkersBindingKindAny, - MetadataBindingWorkersBindingKindAI, - MetadataBindingWorkersBindingKindAnalyticsEngine, - MetadataBindingWorkersBindingKindAssets, - MetadataBindingWorkersBindingKindBrowserRendering, - MetadataBindingWorkersBindingKindD1, - MetadataBindingWorkersBindingKindDispatchNamespace, - MetadataBindingWorkersBindingKindDo, - MetadataBindingWorkersBindingKindHyperdrive, - MetadataBindingWorkersBindingKindJson, - MetadataBindingWorkersBindingKindKVNamespace, - MetadataBindingWorkersBindingKindMTLSCERT, - MetadataBindingWorkersBindingKindPlainText, - MetadataBindingWorkersBindingKindQueue, - MetadataBindingWorkersBindingKindR2, - MetadataBindingWorkersBindingKindSecret, - MetadataBindingWorkersBindingKindService, - MetadataBindingWorkersBindingKindTailConsumer, - MetadataBindingWorkersBindingKindVectorize, - MetadataBindingWorkersBindingKindVersionMetadata, -] - - class Metadata(TypedDict, total=False): - main_module: Required[str] - """Name of the part in the multipart request that contains the main module (e.g. - - the file exporting a `fetch` handler). Indicates a `module syntax` Worker, which - is required for Version Upload. - """ - annotations: MetadataAnnotations - bindings: Iterable[MetadataBinding] - """List of bindings attached to a Worker. - - You can find more about bindings on our docs: - https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings. - """ + bindings: Iterable[object] + """List of bindings available to the worker.""" compatibility_date: str """Date indicating targeted support in the Workers runtime. @@ -356,5 +57,11 @@ class Metadata(TypedDict, total=False): keep_bindings: List[str] """List of binding types to keep from previous_upload.""" + main_module: str + """Name of the part in the multipart request that contains the main module (e.g. + + the file exporting a `fetch` handler). Indicates a `module syntax` Worker. + """ + usage_model: Literal["standard"] - """Usage model for the Worker invocations.""" + """Usage model to apply to invocations.""" diff --git a/src/cloudflare/types/workers/service_binding.py b/src/cloudflare/types/workers/service_binding.py new file mode 100644 index 00000000000..ffd0c7b07f5 --- /dev/null +++ b/src/cloudflare/types/workers/service_binding.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ServiceBinding"] + + +class ServiceBinding(BaseModel): + environment: str + """Optional environment if the Worker utilizes one.""" + + name: str + """A JavaScript variable name for the binding.""" + + service: str + """Name of Worker to bind to""" + + type: Literal["service"] + """The class of resource that the binding provides.""" diff --git a/src/cloudflare/types/workers/service_binding_param.py b/src/cloudflare/types/workers/service_binding_param.py new file mode 100644 index 00000000000..52ecb335075 --- /dev/null +++ b/src/cloudflare/types/workers/service_binding_param.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ServiceBindingParam"] + + +class ServiceBindingParam(TypedDict, total=False): + environment: Required[str] + """Optional environment if the Worker utilizes one.""" + + service: Required[str] + """Name of Worker to bind to""" + + type: Required[Literal["service"]] + """The class of resource that the binding provides.""" diff --git a/src/cloudflare/types/workers/stepped_migration.py b/src/cloudflare/types/workers/stepped_migration.py new file mode 100644 index 00000000000..3383a9a473f --- /dev/null +++ b/src/cloudflare/types/workers/stepped_migration.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel +from .migration_step import MigrationStep + +__all__ = ["SteppedMigration"] + + +class SteppedMigration(BaseModel): + new_tag: Optional[str] = None + """Tag to set as the latest migration tag.""" + + old_tag: Optional[str] = None + """Tag used to verify against the latest migration tag for this Worker. + + If they don't match, the upload is rejected. + """ + + steps: Optional[List[MigrationStep]] = None + """Migrations to apply in order.""" diff --git a/src/cloudflare/types/workers/stepped_migration_param.py b/src/cloudflare/types/workers/stepped_migration_param.py new file mode 100644 index 00000000000..2465041142b --- /dev/null +++ b/src/cloudflare/types/workers/stepped_migration_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import TypedDict + +from .migration_step_param import MigrationStepParam + +__all__ = ["SteppedMigrationParam"] + + +class SteppedMigrationParam(TypedDict, total=False): + new_tag: str + """Tag to set as the latest migration tag.""" + + old_tag: str + """Tag used to verify against the latest migration tag for this Worker. + + If they don't match, the upload is rejected. + """ + + steps: Iterable[MigrationStepParam] + """Migrations to apply in order.""" diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py index 0470a9fe602..13d32321c3f 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py @@ -3,59 +3,49 @@ from __future__ import annotations from typing import Dict, List, Union, Iterable, Optional -from typing_extensions import Literal, Required, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict -from ....workers.migration_step_param import MigrationStepParam +from ....._types import FileTypes +from ....._utils import PropertyInfo +from ....workers.stepped_migration_param import SteppedMigrationParam from ....workers.single_step_migration_param import SingleStepMigrationParam +from ....workers.placement_configuration_param import PlacementConfigurationParam from ....workers.scripts.consumer_script_param import ConsumerScriptParam __all__ = [ "ScriptUpdateParams", - "Metadata", - "MetadataAssets", - "MetadataAssetsConfig", - "MetadataBinding", - "MetadataBindingWorkersBindingKindAny", - "MetadataBindingWorkersBindingKindAI", - "MetadataBindingWorkersBindingKindAnalyticsEngine", - "MetadataBindingWorkersBindingKindAssets", - "MetadataBindingWorkersBindingKindBrowserRendering", - "MetadataBindingWorkersBindingKindD1", - "MetadataBindingWorkersBindingKindDispatchNamespace", - "MetadataBindingWorkersBindingKindDispatchNamespaceOutbound", - "MetadataBindingWorkersBindingKindDispatchNamespaceOutboundWorker", - "MetadataBindingWorkersBindingKindDo", - "MetadataBindingWorkersBindingKindHyperdrive", - "MetadataBindingWorkersBindingKindJson", - "MetadataBindingWorkersBindingKindKVNamespace", - "MetadataBindingWorkersBindingKindMTLSCERT", - "MetadataBindingWorkersBindingKindPlainText", - "MetadataBindingWorkersBindingKindQueue", - "MetadataBindingWorkersBindingKindR2", - "MetadataBindingWorkersBindingKindSecret", - "MetadataBindingWorkersBindingKindService", - "MetadataBindingWorkersBindingKindTailConsumer", - "MetadataBindingWorkersBindingKindVectorize", - "MetadataBindingWorkersBindingKindVersionMetadata", - "MetadataMigrations", - "MetadataMigrationsWorkersMultipleStepMigrations", - "MetadataObservability", - "MetadataPlacement", + "Variant0", + "Variant0Metadata", + "Variant0MetadataAssets", + "Variant0MetadataAssetsConfig", + "Variant0MetadataBinding", + "Variant0MetadataMigrations", + "Variant0MetadataObservability", + "Variant1", ] -class ScriptUpdateParams(TypedDict, total=False): +class Variant0(TypedDict, total=False): account_id: Required[str] """Identifier""" dispatch_namespace: Required[str] """Name of the Workers for Platforms dispatch namespace.""" - metadata: Required[Metadata] + any_part_name: Annotated[List[FileTypes], PropertyInfo(alias="")] + """A module comprising a Worker script, often a javascript file. + + Multiple modules may be provided as separate named parts, but at least one + module must be present and referenced in the metadata as `main_module` or + `body_part` by part name. Source maps may also be included using the + `application/source-map` content type. + """ + + metadata: Variant0Metadata """JSON encoded metadata about the uploaded parts and Worker configuration.""" -class MetadataAssetsConfig(TypedDict, total=False): +class Variant0MetadataAssetsConfig(TypedDict, total=False): html_handling: Literal["auto-trailing-slash", "force-trailing-slash", "drop-trailing-slash", "none"] """Determines the redirects and rewrites of requests for HTML content.""" @@ -73,301 +63,32 @@ class MetadataAssetsConfig(TypedDict, total=False): """ -class MetadataAssets(TypedDict, total=False): - config: MetadataAssetsConfig +class Variant0MetadataAssets(TypedDict, total=False): + config: Variant0MetadataAssetsConfig """Configuration for assets within a Worker.""" jwt: str """Token provided upon successful upload of all files from a registered manifest.""" -class MetadataBindingWorkersBindingKindAnyTyped(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[str] - """The kind of resource that the binding provides.""" - - -MetadataBindingWorkersBindingKindAny: TypeAlias = Union[MetadataBindingWorkersBindingKindAnyTyped, Dict[str, object]] - - -class MetadataBindingWorkersBindingKindAI(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["ai"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindAnalyticsEngine(TypedDict, total=False): - dataset: Required[str] - """The dataset name to bind to.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["analytics_engine"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindAssets(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["assets"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindBrowserRendering(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["browser_rendering"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindD1(TypedDict, total=False): - id: Required[str] - """Identifier of the D1 database to bind to.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["d1"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindDispatchNamespaceOutboundWorker(TypedDict, total=False): - environment: str - """Environment of the outbound worker.""" - - service: str - """Name of the outbound worker.""" - - -class MetadataBindingWorkersBindingKindDispatchNamespaceOutbound(TypedDict, total=False): - params: List[str] - """ - Pass information from the Dispatch Worker to the Outbound Worker through the - parameters. - """ - - worker: MetadataBindingWorkersBindingKindDispatchNamespaceOutboundWorker - """Outbound worker.""" - - -class MetadataBindingWorkersBindingKindDispatchNamespace(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - namespace: Required[str] - """Namespace to bind to.""" - - type: Required[Literal["dispatch_namespace"]] - """The kind of resource that the binding provides.""" - - outbound: MetadataBindingWorkersBindingKindDispatchNamespaceOutbound - """Outbound worker.""" - - -class MetadataBindingWorkersBindingKindDo(TypedDict, total=False): - class_name: Required[str] - """The exported class name of the Durable Object.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["durable_object_namespace"]] - """The kind of resource that the binding provides.""" - - environment: str - """The environment of the script_name to bind to.""" - - namespace_id: str - """Namespace identifier tag.""" - - script_name: str - """ - The script where the Durable Object is defined, if it is external to this - Worker. - """ - - -class MetadataBindingWorkersBindingKindHyperdrive(TypedDict, total=False): - id: Required[str] - """Identifier of the Hyperdrive connection to bind to.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["hyperdrive"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindJson(TypedDict, total=False): - json: Required[str] - """JSON data to use.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["json"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindKVNamespace(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - namespace_id: Required[str] - """Namespace identifier tag.""" - - type: Required[Literal["kv_namespace"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindMTLSCERT(TypedDict, total=False): - certificate_id: Required[str] - """Identifier of the certificate to bind to.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["mtls_certificate"]] - """The kind of resource that the binding provides.""" - +class Variant0MetadataBindingTyped(TypedDict, total=False): + name: str + """Name of the binding variable.""" -class MetadataBindingWorkersBindingKindPlainText(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" + type: str + """Type of binding. - text: Required[str] - """The text value to use.""" - - type: Required[Literal["plain_text"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindQueue(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - queue_name: Required[str] - """Name of the Queue to bind to.""" - - type: Required[Literal["queue"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindR2(TypedDict, total=False): - bucket_name: Required[str] - """R2 bucket to bind to.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["r2_bucket"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindSecret(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - text: Required[str] - """The secret value to use.""" - - type: Required[Literal["secret_text"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindService(TypedDict, total=False): - environment: Required[str] - """Optional environment if the Worker utilizes one.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - service: Required[str] - """Name of Worker to bind to.""" - - type: Required[Literal["service"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindTailConsumer(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - service: Required[str] - """Name of Tail Worker to bind to.""" - - type: Required[Literal["tail_consumer"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindVectorize(TypedDict, total=False): - index_name: Required[str] - """Name of the Vectorize index to bind to.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["vectorize"]] - """The kind of resource that the binding provides.""" - - -class MetadataBindingWorkersBindingKindVersionMetadata(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["version_metadata"]] - """The kind of resource that the binding provides.""" - - -MetadataBinding: TypeAlias = Union[ - MetadataBindingWorkersBindingKindAny, - MetadataBindingWorkersBindingKindAI, - MetadataBindingWorkersBindingKindAnalyticsEngine, - MetadataBindingWorkersBindingKindAssets, - MetadataBindingWorkersBindingKindBrowserRendering, - MetadataBindingWorkersBindingKindD1, - MetadataBindingWorkersBindingKindDispatchNamespace, - MetadataBindingWorkersBindingKindDo, - MetadataBindingWorkersBindingKindHyperdrive, - MetadataBindingWorkersBindingKindJson, - MetadataBindingWorkersBindingKindKVNamespace, - MetadataBindingWorkersBindingKindMTLSCERT, - MetadataBindingWorkersBindingKindPlainText, - MetadataBindingWorkersBindingKindQueue, - MetadataBindingWorkersBindingKindR2, - MetadataBindingWorkersBindingKindSecret, - MetadataBindingWorkersBindingKindService, - MetadataBindingWorkersBindingKindTailConsumer, - MetadataBindingWorkersBindingKindVectorize, - MetadataBindingWorkersBindingKindVersionMetadata, -] - - -class MetadataMigrationsWorkersMultipleStepMigrations(TypedDict, total=False): - new_tag: str - """Tag to set as the latest migration tag.""" - - old_tag: str - """Tag used to verify against the latest migration tag for this Worker. - - If they don't match, the upload is rejected. + You can find more about bindings on our docs: + https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings. """ - steps: Iterable[MigrationStepParam] - """Migrations to apply in order.""" +Variant0MetadataBinding: TypeAlias = Union[Variant0MetadataBindingTyped, Dict[str, object]] -MetadataMigrations: TypeAlias = Union[SingleStepMigrationParam, MetadataMigrationsWorkersMultipleStepMigrations] +Variant0MetadataMigrations: TypeAlias = Union[SingleStepMigrationParam, SteppedMigrationParam] -class MetadataObservability(TypedDict, total=False): +class Variant0MetadataObservability(TypedDict, total=False): enabled: Required[bool] """Whether observability is enabled for the Worker.""" @@ -378,24 +99,12 @@ class MetadataObservability(TypedDict, total=False): """ -class MetadataPlacement(TypedDict, total=False): - mode: Literal["smart"] - """ - Enables - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - """ - - -class Metadata(TypedDict, total=False): - assets: MetadataAssets +class Variant0Metadata(TypedDict, total=False): + assets: Variant0MetadataAssets """Configuration for assets within a Worker""" - bindings: Iterable[MetadataBinding] - """List of bindings attached to a Worker. - - You can find more about bindings on our docs: - https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings. - """ + bindings: Iterable[Variant0MetadataBinding] + """List of bindings available to the worker.""" body_part: str """Name of the part in the multipart request that contains the script (e.g. @@ -436,17 +145,13 @@ class Metadata(TypedDict, total=False): the file exporting a `fetch` handler). Indicates a `module syntax` Worker. """ - migrations: MetadataMigrations + migrations: Variant0MetadataMigrations """Migrations to apply for Durable Objects associated with this Worker.""" - observability: MetadataObservability + observability: Variant0MetadataObservability """Observability settings for the Worker.""" - placement: MetadataPlacement - """ - Configuration for - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - """ + placement: PlacementConfigurationParam tags: List[str] """List of strings to use as tags for this Worker.""" @@ -454,5 +159,25 @@ class Metadata(TypedDict, total=False): tail_consumers: Iterable[ConsumerScriptParam] """List of Workers that will consume logs from the attached Worker.""" - usage_model: Literal["standard"] - """Usage model for the Worker invocations.""" + usage_model: Literal["bundled", "unbound"] + """Usage model to apply to invocations.""" + + version_tags: Dict[str, str] + """Key-value pairs to use as tags for this version of this Worker.""" + + +class Variant1(TypedDict, total=False): + account_id: Required[str] + """Identifier""" + + dispatch_namespace: Required[str] + """Name of the Workers for Platforms dispatch namespace.""" + + message: str + """Rollback message to be associated with this deployment. + + Only parsed when query param `"rollback_to"` is present. + """ + + +ScriptUpdateParams: TypeAlias = Union[Variant0, Variant1] diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_response.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_response.py index d79a5e9b267..e4fd8cf4809 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_response.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_response.py @@ -2,26 +2,11 @@ from typing import List, Optional from datetime import datetime -from typing_extensions import Literal from ....._models import BaseModel from ....workers.scripts.consumer_script import ConsumerScript -__all__ = ["ScriptUpdateResponse", "Placement"] - - -class Placement(BaseModel): - mode: Optional[Literal["smart"]] = None - """ - Enables - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - """ - - status: Optional[Literal["SUCCESS", "UNSUPPORTED_APPLICATION", "INSUFFICIENT_INVOCATIONS"]] = None - """ - Status of - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - """ +__all__ = ["ScriptUpdateResponse"] class ScriptUpdateResponse(BaseModel): @@ -46,28 +31,13 @@ class ScriptUpdateResponse(BaseModel): modified_on: Optional[datetime] = None """When the script was last modified.""" - placement: Optional[Placement] = None - """ - Configuration for - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - """ - - placement_mode: Optional[Literal["smart"]] = None - """ - Enables - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - """ - - placement_status: Optional[Literal["SUCCESS", "UNSUPPORTED_APPLICATION", "INSUFFICIENT_INVOCATIONS"]] = None - """ - Status of - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - """ + placement_mode: Optional[str] = None + """Specifies the placement mode for the Worker (e.g. 'smart').""" startup_time_ms: Optional[int] = None tail_consumers: Optional[List[ConsumerScript]] = None """List of Workers that will consume logs from the attached Worker.""" - usage_model: Optional[Literal["standard"]] = None - """Usage model for the Worker invocations.""" + usage_model: Optional[str] = None + """Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound').""" diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/__init__.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/__init__.py index b1d4cb724c8..b1e6bf59e47 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/__init__.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/__init__.py @@ -14,5 +14,3 @@ from .content_update_params import ContentUpdateParams as ContentUpdateParams from .setting_edit_response import SettingEditResponse as SettingEditResponse from .secret_update_response import SecretUpdateResponse as SecretUpdateResponse -from .asset_upload_create_params import AssetUploadCreateParams as AssetUploadCreateParams -from .asset_upload_create_response import AssetUploadCreateResponse as AssetUploadCreateResponse diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/asset_upload_create_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/asset_upload_create_params.py deleted file mode 100644 index 83870f01ad2..00000000000 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/asset_upload_create_params.py +++ /dev/null @@ -1,30 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict -from typing_extensions import Required, TypedDict - -__all__ = ["AssetUploadCreateParams", "Manifest"] - - -class AssetUploadCreateParams(TypedDict, total=False): - account_id: Required[str] - """Identifier""" - - dispatch_namespace: Required[str] - """Name of the Workers for Platforms dispatch namespace.""" - - manifest: Dict[str, Manifest] - """A manifest ([path]: {hash, size}) map of files to upload. - - As an example, `/blog/hello-world.html` would be a valid path key. - """ - - -class Manifest(TypedDict, total=False): - hash: str - """The hash of the file.""" - - size: int - """The size of the file in bytes.""" diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/asset_upload_create_response.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/asset_upload_create_response.py deleted file mode 100644 index e25a814291a..00000000000 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/asset_upload_create_response.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ......_models import BaseModel - -__all__ = ["AssetUploadCreateResponse"] - - -class AssetUploadCreateResponse(BaseModel): - buckets: Optional[List[List[str]]] = None - """The requests to make to upload assets.""" - - jwt: Optional[str] = None - """A JWT to use as authentication for uploading assets.""" diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py index c347a833b16..b7a3d0c673f 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py @@ -1,309 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import TYPE_CHECKING, List, Union, Optional -from typing_extensions import Literal, TypeAlias +from typing import List +from typing_extensions import TypeAlias -from pydantic import Field as FieldInfo +from .....workers.binding import Binding -from ......_models import BaseModel +__all__ = ["BindingGetResponse"] -__all__ = [ - "BindingGetResponse", - "BindingGetResponseItem", - "BindingGetResponseItemWorkersBindingKindAny", - "BindingGetResponseItemWorkersBindingKindAI", - "BindingGetResponseItemWorkersBindingKindAnalyticsEngine", - "BindingGetResponseItemWorkersBindingKindAssets", - "BindingGetResponseItemWorkersBindingKindBrowserRendering", - "BindingGetResponseItemWorkersBindingKindD1", - "BindingGetResponseItemWorkersBindingKindDispatchNamespace", - "BindingGetResponseItemWorkersBindingKindDispatchNamespaceOutbound", - "BindingGetResponseItemWorkersBindingKindDispatchNamespaceOutboundWorker", - "BindingGetResponseItemWorkersBindingKindDo", - "BindingGetResponseItemWorkersBindingKindHyperdrive", - "BindingGetResponseItemWorkersBindingKindJson", - "BindingGetResponseItemWorkersBindingKindKVNamespace", - "BindingGetResponseItemWorkersBindingKindMTLSCERT", - "BindingGetResponseItemWorkersBindingKindPlainText", - "BindingGetResponseItemWorkersBindingKindQueue", - "BindingGetResponseItemWorkersBindingKindR2", - "BindingGetResponseItemWorkersBindingKindSecret", - "BindingGetResponseItemWorkersBindingKindService", - "BindingGetResponseItemWorkersBindingKindTailConsumer", - "BindingGetResponseItemWorkersBindingKindVectorize", - "BindingGetResponseItemWorkersBindingKindVersionMetadata", -] - - -class BindingGetResponseItemWorkersBindingKindAny(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - type: str - """The kind of resource that the binding provides.""" - - if TYPE_CHECKING: - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - - -class BindingGetResponseItemWorkersBindingKindAI(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["ai"] - """The kind of resource that the binding provides.""" - - -class BindingGetResponseItemWorkersBindingKindAnalyticsEngine(BaseModel): - dataset: str - """The dataset name to bind to.""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["analytics_engine"] - """The kind of resource that the binding provides.""" - - -class BindingGetResponseItemWorkersBindingKindAssets(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["assets"] - """The kind of resource that the binding provides.""" - - -class BindingGetResponseItemWorkersBindingKindBrowserRendering(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["browser_rendering"] - """The kind of resource that the binding provides.""" - - -class BindingGetResponseItemWorkersBindingKindD1(BaseModel): - id: str - """Identifier of the D1 database to bind to.""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["d1"] - """The kind of resource that the binding provides.""" - - -class BindingGetResponseItemWorkersBindingKindDispatchNamespaceOutboundWorker(BaseModel): - environment: Optional[str] = None - """Environment of the outbound worker.""" - - service: Optional[str] = None - """Name of the outbound worker.""" - - -class BindingGetResponseItemWorkersBindingKindDispatchNamespaceOutbound(BaseModel): - params: Optional[List[str]] = None - """ - Pass information from the Dispatch Worker to the Outbound Worker through the - parameters. - """ - - worker: Optional[BindingGetResponseItemWorkersBindingKindDispatchNamespaceOutboundWorker] = None - """Outbound worker.""" - - -class BindingGetResponseItemWorkersBindingKindDispatchNamespace(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - namespace: str - """Namespace to bind to.""" - - type: Literal["dispatch_namespace"] - """The kind of resource that the binding provides.""" - - outbound: Optional[BindingGetResponseItemWorkersBindingKindDispatchNamespaceOutbound] = None - """Outbound worker.""" - - -class BindingGetResponseItemWorkersBindingKindDo(BaseModel): - class_name: str - """The exported class name of the Durable Object.""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["durable_object_namespace"] - """The kind of resource that the binding provides.""" - - environment: Optional[str] = None - """The environment of the script_name to bind to.""" - - namespace_id: Optional[str] = None - """Namespace identifier tag.""" - - script_name: Optional[str] = None - """ - The script where the Durable Object is defined, if it is external to this - Worker. - """ - - -class BindingGetResponseItemWorkersBindingKindHyperdrive(BaseModel): - id: str - """Identifier of the Hyperdrive connection to bind to.""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["hyperdrive"] - """The kind of resource that the binding provides.""" - - -class BindingGetResponseItemWorkersBindingKindJson(BaseModel): - json_: str = FieldInfo(alias="json") - """JSON data to use.""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["json"] - """The kind of resource that the binding provides.""" - - -class BindingGetResponseItemWorkersBindingKindKVNamespace(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - namespace_id: str - """Namespace identifier tag.""" - - type: Literal["kv_namespace"] - """The kind of resource that the binding provides.""" - - -class BindingGetResponseItemWorkersBindingKindMTLSCERT(BaseModel): - certificate_id: str - """Identifier of the certificate to bind to.""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["mtls_certificate"] - """The kind of resource that the binding provides.""" - - -class BindingGetResponseItemWorkersBindingKindPlainText(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - text: str - """The text value to use.""" - - type: Literal["plain_text"] - """The kind of resource that the binding provides.""" - - -class BindingGetResponseItemWorkersBindingKindQueue(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - queue_name: str - """Name of the Queue to bind to.""" - - type: Literal["queue"] - """The kind of resource that the binding provides.""" - - -class BindingGetResponseItemWorkersBindingKindR2(BaseModel): - bucket_name: str - """R2 bucket to bind to.""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["r2_bucket"] - """The kind of resource that the binding provides.""" - - -class BindingGetResponseItemWorkersBindingKindSecret(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - text: str - """The secret value to use.""" - - type: Literal["secret_text"] - """The kind of resource that the binding provides.""" - - -class BindingGetResponseItemWorkersBindingKindService(BaseModel): - environment: str - """Optional environment if the Worker utilizes one.""" - - name: str - """A JavaScript variable name for the binding.""" - - service: str - """Name of Worker to bind to.""" - - type: Literal["service"] - """The kind of resource that the binding provides.""" - - -class BindingGetResponseItemWorkersBindingKindTailConsumer(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - service: str - """Name of Tail Worker to bind to.""" - - type: Literal["tail_consumer"] - """The kind of resource that the binding provides.""" - - -class BindingGetResponseItemWorkersBindingKindVectorize(BaseModel): - index_name: str - """Name of the Vectorize index to bind to.""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["vectorize"] - """The kind of resource that the binding provides.""" - - -class BindingGetResponseItemWorkersBindingKindVersionMetadata(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["version_metadata"] - """The kind of resource that the binding provides.""" - - -BindingGetResponseItem: TypeAlias = Union[ - BindingGetResponseItemWorkersBindingKindAny, - BindingGetResponseItemWorkersBindingKindAI, - BindingGetResponseItemWorkersBindingKindAnalyticsEngine, - BindingGetResponseItemWorkersBindingKindAssets, - BindingGetResponseItemWorkersBindingKindBrowserRendering, - BindingGetResponseItemWorkersBindingKindD1, - BindingGetResponseItemWorkersBindingKindDispatchNamespace, - BindingGetResponseItemWorkersBindingKindDo, - BindingGetResponseItemWorkersBindingKindHyperdrive, - BindingGetResponseItemWorkersBindingKindJson, - BindingGetResponseItemWorkersBindingKindKVNamespace, - BindingGetResponseItemWorkersBindingKindMTLSCERT, - BindingGetResponseItemWorkersBindingKindPlainText, - BindingGetResponseItemWorkersBindingKindQueue, - BindingGetResponseItemWorkersBindingKindR2, - BindingGetResponseItemWorkersBindingKindSecret, - BindingGetResponseItemWorkersBindingKindService, - BindingGetResponseItemWorkersBindingKindTailConsumer, - BindingGetResponseItemWorkersBindingKindVectorize, - BindingGetResponseItemWorkersBindingKindVersionMetadata, -] - -BindingGetResponse: TypeAlias = List[BindingGetResponseItem] +BindingGetResponse: TypeAlias = List[Binding] diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/content_update_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/content_update_params.py index 84e1916a5ef..9f4d3118469 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/content_update_params.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/content_update_params.py @@ -2,8 +2,10 @@ from __future__ import annotations +from typing import List from typing_extensions import Required, Annotated, TypedDict +from ......_types import FileTypes from ......_utils import PropertyInfo from .....workers.worker_metadata_param import WorkerMetadataParam @@ -17,7 +19,18 @@ class ContentUpdateParams(TypedDict, total=False): dispatch_namespace: Required[str] """Name of the Workers for Platforms dispatch namespace.""" - metadata: Required[WorkerMetadataParam] + any_part_name: Annotated[List[FileTypes], PropertyInfo(alias="")] + """A module comprising a Worker script, often a javascript file. + + Multiple modules may be provided as separate named parts, but at least one + module must be present. This should be referenced either in the metadata as + `main_module` (esm)/`body_part` (service worker) or as a header + `CF-WORKER-MAIN-MODULE-PART` (esm) /`CF-WORKER-BODY-PART` (service worker) by + part name. Source maps may also be included using the `application/source-map` + content type. + """ + + metadata: WorkerMetadataParam """JSON encoded metadata about the uploaded parts and Worker configuration.""" cf_worker_body_part: Annotated[str, PropertyInfo(alias="CF-WORKER-BODY-PART")] diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py index cfb478bb1c8..f7e8aedcdf9 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py @@ -2,45 +2,16 @@ from __future__ import annotations -from typing import Dict, List, Union, Iterable, Optional -from typing_extensions import Literal, Required, TypeAlias, TypedDict +from typing import List, Union, Iterable, Optional +from typing_extensions import Required, TypeAlias, TypedDict -from .....workers.migration_step_param import MigrationStepParam +from .....workers.binding_param import BindingParam +from .....workers.stepped_migration_param import SteppedMigrationParam from .....workers.single_step_migration_param import SingleStepMigrationParam +from .....workers.placement_configuration_param import PlacementConfigurationParam from .....workers.scripts.consumer_script_param import ConsumerScriptParam -__all__ = [ - "SettingEditParams", - "Settings", - "SettingsBinding", - "SettingsBindingWorkersBindingKindAny", - "SettingsBindingWorkersBindingKindAI", - "SettingsBindingWorkersBindingKindAnalyticsEngine", - "SettingsBindingWorkersBindingKindAssets", - "SettingsBindingWorkersBindingKindBrowserRendering", - "SettingsBindingWorkersBindingKindD1", - "SettingsBindingWorkersBindingKindDispatchNamespace", - "SettingsBindingWorkersBindingKindDispatchNamespaceOutbound", - "SettingsBindingWorkersBindingKindDispatchNamespaceOutboundWorker", - "SettingsBindingWorkersBindingKindDo", - "SettingsBindingWorkersBindingKindHyperdrive", - "SettingsBindingWorkersBindingKindJson", - "SettingsBindingWorkersBindingKindKVNamespace", - "SettingsBindingWorkersBindingKindMTLSCERT", - "SettingsBindingWorkersBindingKindPlainText", - "SettingsBindingWorkersBindingKindQueue", - "SettingsBindingWorkersBindingKindR2", - "SettingsBindingWorkersBindingKindSecret", - "SettingsBindingWorkersBindingKindService", - "SettingsBindingWorkersBindingKindTailConsumer", - "SettingsBindingWorkersBindingKindVectorize", - "SettingsBindingWorkersBindingKindVersionMetadata", - "SettingsLimits", - "SettingsMigrations", - "SettingsMigrationsWorkersMultipleStepMigrations", - "SettingsObservability", - "SettingsPlacement", -] +__all__ = ["SettingEditParams", "Settings", "SettingsLimits", "SettingsMigrations", "SettingsObservability"] class SettingEditParams(TypedDict, total=False): @@ -53,295 +24,12 @@ class SettingEditParams(TypedDict, total=False): settings: Settings -class SettingsBindingWorkersBindingKindAnyTyped(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[str] - """The kind of resource that the binding provides.""" - - -SettingsBindingWorkersBindingKindAny: TypeAlias = Union[SettingsBindingWorkersBindingKindAnyTyped, Dict[str, object]] - - -class SettingsBindingWorkersBindingKindAI(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["ai"]] - """The kind of resource that the binding provides.""" - - -class SettingsBindingWorkersBindingKindAnalyticsEngine(TypedDict, total=False): - dataset: Required[str] - """The dataset name to bind to.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["analytics_engine"]] - """The kind of resource that the binding provides.""" - - -class SettingsBindingWorkersBindingKindAssets(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["assets"]] - """The kind of resource that the binding provides.""" - - -class SettingsBindingWorkersBindingKindBrowserRendering(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["browser_rendering"]] - """The kind of resource that the binding provides.""" - - -class SettingsBindingWorkersBindingKindD1(TypedDict, total=False): - id: Required[str] - """Identifier of the D1 database to bind to.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["d1"]] - """The kind of resource that the binding provides.""" - - -class SettingsBindingWorkersBindingKindDispatchNamespaceOutboundWorker(TypedDict, total=False): - environment: str - """Environment of the outbound worker.""" - - service: str - """Name of the outbound worker.""" - - -class SettingsBindingWorkersBindingKindDispatchNamespaceOutbound(TypedDict, total=False): - params: List[str] - """ - Pass information from the Dispatch Worker to the Outbound Worker through the - parameters. - """ - - worker: SettingsBindingWorkersBindingKindDispatchNamespaceOutboundWorker - """Outbound worker.""" - - -class SettingsBindingWorkersBindingKindDispatchNamespace(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - namespace: Required[str] - """Namespace to bind to.""" - - type: Required[Literal["dispatch_namespace"]] - """The kind of resource that the binding provides.""" - - outbound: SettingsBindingWorkersBindingKindDispatchNamespaceOutbound - """Outbound worker.""" - - -class SettingsBindingWorkersBindingKindDo(TypedDict, total=False): - class_name: Required[str] - """The exported class name of the Durable Object.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["durable_object_namespace"]] - """The kind of resource that the binding provides.""" - - environment: str - """The environment of the script_name to bind to.""" - - namespace_id: str - """Namespace identifier tag.""" - - script_name: str - """ - The script where the Durable Object is defined, if it is external to this - Worker. - """ - - -class SettingsBindingWorkersBindingKindHyperdrive(TypedDict, total=False): - id: Required[str] - """Identifier of the Hyperdrive connection to bind to.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["hyperdrive"]] - """The kind of resource that the binding provides.""" - - -class SettingsBindingWorkersBindingKindJson(TypedDict, total=False): - json: Required[str] - """JSON data to use.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["json"]] - """The kind of resource that the binding provides.""" - - -class SettingsBindingWorkersBindingKindKVNamespace(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - namespace_id: Required[str] - """Namespace identifier tag.""" - - type: Required[Literal["kv_namespace"]] - """The kind of resource that the binding provides.""" - - -class SettingsBindingWorkersBindingKindMTLSCERT(TypedDict, total=False): - certificate_id: Required[str] - """Identifier of the certificate to bind to.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["mtls_certificate"]] - """The kind of resource that the binding provides.""" - - -class SettingsBindingWorkersBindingKindPlainText(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - text: Required[str] - """The text value to use.""" - - type: Required[Literal["plain_text"]] - """The kind of resource that the binding provides.""" - - -class SettingsBindingWorkersBindingKindQueue(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - queue_name: Required[str] - """Name of the Queue to bind to.""" - - type: Required[Literal["queue"]] - """The kind of resource that the binding provides.""" - - -class SettingsBindingWorkersBindingKindR2(TypedDict, total=False): - bucket_name: Required[str] - """R2 bucket to bind to.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["r2_bucket"]] - """The kind of resource that the binding provides.""" - - -class SettingsBindingWorkersBindingKindSecret(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - text: Required[str] - """The secret value to use.""" - - type: Required[Literal["secret_text"]] - """The kind of resource that the binding provides.""" - - -class SettingsBindingWorkersBindingKindService(TypedDict, total=False): - environment: Required[str] - """Optional environment if the Worker utilizes one.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - service: Required[str] - """Name of Worker to bind to.""" - - type: Required[Literal["service"]] - """The kind of resource that the binding provides.""" - - -class SettingsBindingWorkersBindingKindTailConsumer(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - service: Required[str] - """Name of Tail Worker to bind to.""" - - type: Required[Literal["tail_consumer"]] - """The kind of resource that the binding provides.""" - - -class SettingsBindingWorkersBindingKindVectorize(TypedDict, total=False): - index_name: Required[str] - """Name of the Vectorize index to bind to.""" - - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["vectorize"]] - """The kind of resource that the binding provides.""" - - -class SettingsBindingWorkersBindingKindVersionMetadata(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[Literal["version_metadata"]] - """The kind of resource that the binding provides.""" - - -SettingsBinding: TypeAlias = Union[ - SettingsBindingWorkersBindingKindAny, - SettingsBindingWorkersBindingKindAI, - SettingsBindingWorkersBindingKindAnalyticsEngine, - SettingsBindingWorkersBindingKindAssets, - SettingsBindingWorkersBindingKindBrowserRendering, - SettingsBindingWorkersBindingKindD1, - SettingsBindingWorkersBindingKindDispatchNamespace, - SettingsBindingWorkersBindingKindDo, - SettingsBindingWorkersBindingKindHyperdrive, - SettingsBindingWorkersBindingKindJson, - SettingsBindingWorkersBindingKindKVNamespace, - SettingsBindingWorkersBindingKindMTLSCERT, - SettingsBindingWorkersBindingKindPlainText, - SettingsBindingWorkersBindingKindQueue, - SettingsBindingWorkersBindingKindR2, - SettingsBindingWorkersBindingKindSecret, - SettingsBindingWorkersBindingKindService, - SettingsBindingWorkersBindingKindTailConsumer, - SettingsBindingWorkersBindingKindVectorize, - SettingsBindingWorkersBindingKindVersionMetadata, -] - - class SettingsLimits(TypedDict, total=False): cpu_ms: int """The amount of CPU time this Worker can use in milliseconds.""" -class SettingsMigrationsWorkersMultipleStepMigrations(TypedDict, total=False): - new_tag: str - """Tag to set as the latest migration tag.""" - - old_tag: str - """Tag used to verify against the latest migration tag for this Worker. - - If they don't match, the upload is rejected. - """ - - steps: Iterable[MigrationStepParam] - """Migrations to apply in order.""" - - -SettingsMigrations: TypeAlias = Union[SingleStepMigrationParam, SettingsMigrationsWorkersMultipleStepMigrations] +SettingsMigrations: TypeAlias = Union[SingleStepMigrationParam, SteppedMigrationParam] class SettingsObservability(TypedDict, total=False): @@ -355,35 +43,15 @@ class SettingsObservability(TypedDict, total=False): """ -class SettingsPlacement(TypedDict, total=False): - mode: Literal["smart"] - """ - Enables - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - """ - - class Settings(TypedDict, total=False): - bindings: Iterable[SettingsBinding] - """List of bindings attached to a Worker. - - You can find more about bindings on our docs: - https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings. - """ + bindings: Iterable[BindingParam] + """List of bindings attached to this Worker""" compatibility_date: str - """Date indicating targeted support in the Workers runtime. - - Backwards incompatible fixes to the runtime following this date will not affect - this Worker. - """ + """Opt your Worker into changes after this date""" compatibility_flags: List[str] - """Flags that enable or disable certain features in the Workers runtime. - - Used to enable upcoming features or opt in or out of specific changes not - included in a `compatibility_date`. - """ + """Opt your Worker into specific changes""" limits: SettingsLimits """Limits to apply for this Worker.""" @@ -397,11 +65,7 @@ class Settings(TypedDict, total=False): observability: SettingsObservability """Observability settings for the Worker.""" - placement: SettingsPlacement - """ - Configuration for - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - """ + placement: PlacementConfigurationParam tags: List[str] """Tags to help you manage your Workers""" @@ -409,5 +73,5 @@ class Settings(TypedDict, total=False): tail_consumers: Iterable[ConsumerScriptParam] """List of Workers that will consume logs from the attached Worker.""" - usage_model: Literal["standard"] - """Usage model for the Worker invocations.""" + usage_model: str + """Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound').""" diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_response.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_response.py index 799ad01b712..a5f8112d446 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_response.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_response.py @@ -1,318 +1,16 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import TYPE_CHECKING, List, Union, Optional -from typing_extensions import Literal, TypeAlias - -from pydantic import Field as FieldInfo +from typing import List, Union, Optional +from typing_extensions import TypeAlias from ......_models import BaseModel -from .....workers.migration_step import MigrationStep +from .....workers.binding import Binding +from .....workers.stepped_migration import SteppedMigration from .....workers.single_step_migration import SingleStepMigration +from .....workers.placement_configuration import PlacementConfiguration from .....workers.scripts.consumer_script import ConsumerScript -__all__ = [ - "SettingEditResponse", - "Binding", - "BindingWorkersBindingKindAny", - "BindingWorkersBindingKindAI", - "BindingWorkersBindingKindAnalyticsEngine", - "BindingWorkersBindingKindAssets", - "BindingWorkersBindingKindBrowserRendering", - "BindingWorkersBindingKindD1", - "BindingWorkersBindingKindDispatchNamespace", - "BindingWorkersBindingKindDispatchNamespaceOutbound", - "BindingWorkersBindingKindDispatchNamespaceOutboundWorker", - "BindingWorkersBindingKindDo", - "BindingWorkersBindingKindHyperdrive", - "BindingWorkersBindingKindJson", - "BindingWorkersBindingKindKVNamespace", - "BindingWorkersBindingKindMTLSCERT", - "BindingWorkersBindingKindPlainText", - "BindingWorkersBindingKindQueue", - "BindingWorkersBindingKindR2", - "BindingWorkersBindingKindSecret", - "BindingWorkersBindingKindService", - "BindingWorkersBindingKindTailConsumer", - "BindingWorkersBindingKindVectorize", - "BindingWorkersBindingKindVersionMetadata", - "Limits", - "Migrations", - "MigrationsWorkersMultipleStepMigrations", - "Observability", - "Placement", -] - - -class BindingWorkersBindingKindAny(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - type: str - """The kind of resource that the binding provides.""" - - if TYPE_CHECKING: - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - - -class BindingWorkersBindingKindAI(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["ai"] - """The kind of resource that the binding provides.""" - - -class BindingWorkersBindingKindAnalyticsEngine(BaseModel): - dataset: str - """The dataset name to bind to.""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["analytics_engine"] - """The kind of resource that the binding provides.""" - - -class BindingWorkersBindingKindAssets(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["assets"] - """The kind of resource that the binding provides.""" - - -class BindingWorkersBindingKindBrowserRendering(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["browser_rendering"] - """The kind of resource that the binding provides.""" - - -class BindingWorkersBindingKindD1(BaseModel): - id: str - """Identifier of the D1 database to bind to.""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["d1"] - """The kind of resource that the binding provides.""" - - -class BindingWorkersBindingKindDispatchNamespaceOutboundWorker(BaseModel): - environment: Optional[str] = None - """Environment of the outbound worker.""" - - service: Optional[str] = None - """Name of the outbound worker.""" - - -class BindingWorkersBindingKindDispatchNamespaceOutbound(BaseModel): - params: Optional[List[str]] = None - """ - Pass information from the Dispatch Worker to the Outbound Worker through the - parameters. - """ - - worker: Optional[BindingWorkersBindingKindDispatchNamespaceOutboundWorker] = None - """Outbound worker.""" - - -class BindingWorkersBindingKindDispatchNamespace(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - namespace: str - """Namespace to bind to.""" - - type: Literal["dispatch_namespace"] - """The kind of resource that the binding provides.""" - - outbound: Optional[BindingWorkersBindingKindDispatchNamespaceOutbound] = None - """Outbound worker.""" - - -class BindingWorkersBindingKindDo(BaseModel): - class_name: str - """The exported class name of the Durable Object.""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["durable_object_namespace"] - """The kind of resource that the binding provides.""" - - environment: Optional[str] = None - """The environment of the script_name to bind to.""" - - namespace_id: Optional[str] = None - """Namespace identifier tag.""" - - script_name: Optional[str] = None - """ - The script where the Durable Object is defined, if it is external to this - Worker. - """ - - -class BindingWorkersBindingKindHyperdrive(BaseModel): - id: str - """Identifier of the Hyperdrive connection to bind to.""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["hyperdrive"] - """The kind of resource that the binding provides.""" - - -class BindingWorkersBindingKindJson(BaseModel): - json_: str = FieldInfo(alias="json") - """JSON data to use.""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["json"] - """The kind of resource that the binding provides.""" - - -class BindingWorkersBindingKindKVNamespace(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - namespace_id: str - """Namespace identifier tag.""" - - type: Literal["kv_namespace"] - """The kind of resource that the binding provides.""" - - -class BindingWorkersBindingKindMTLSCERT(BaseModel): - certificate_id: str - """Identifier of the certificate to bind to.""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["mtls_certificate"] - """The kind of resource that the binding provides.""" - - -class BindingWorkersBindingKindPlainText(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - text: str - """The text value to use.""" - - type: Literal["plain_text"] - """The kind of resource that the binding provides.""" - - -class BindingWorkersBindingKindQueue(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - queue_name: str - """Name of the Queue to bind to.""" - - type: Literal["queue"] - """The kind of resource that the binding provides.""" - - -class BindingWorkersBindingKindR2(BaseModel): - bucket_name: str - """R2 bucket to bind to.""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["r2_bucket"] - """The kind of resource that the binding provides.""" - - -class BindingWorkersBindingKindSecret(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - text: str - """The secret value to use.""" - - type: Literal["secret_text"] - """The kind of resource that the binding provides.""" - - -class BindingWorkersBindingKindService(BaseModel): - environment: str - """Optional environment if the Worker utilizes one.""" - - name: str - """A JavaScript variable name for the binding.""" - - service: str - """Name of Worker to bind to.""" - - type: Literal["service"] - """The kind of resource that the binding provides.""" - - -class BindingWorkersBindingKindTailConsumer(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - service: str - """Name of Tail Worker to bind to.""" - - type: Literal["tail_consumer"] - """The kind of resource that the binding provides.""" - - -class BindingWorkersBindingKindVectorize(BaseModel): - index_name: str - """Name of the Vectorize index to bind to.""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["vectorize"] - """The kind of resource that the binding provides.""" - - -class BindingWorkersBindingKindVersionMetadata(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["version_metadata"] - """The kind of resource that the binding provides.""" - - -Binding: TypeAlias = Union[ - BindingWorkersBindingKindAny, - BindingWorkersBindingKindAI, - BindingWorkersBindingKindAnalyticsEngine, - BindingWorkersBindingKindAssets, - BindingWorkersBindingKindBrowserRendering, - BindingWorkersBindingKindD1, - BindingWorkersBindingKindDispatchNamespace, - BindingWorkersBindingKindDo, - BindingWorkersBindingKindHyperdrive, - BindingWorkersBindingKindJson, - BindingWorkersBindingKindKVNamespace, - BindingWorkersBindingKindMTLSCERT, - BindingWorkersBindingKindPlainText, - BindingWorkersBindingKindQueue, - BindingWorkersBindingKindR2, - BindingWorkersBindingKindSecret, - BindingWorkersBindingKindService, - BindingWorkersBindingKindTailConsumer, - BindingWorkersBindingKindVectorize, - BindingWorkersBindingKindVersionMetadata, -] +__all__ = ["SettingEditResponse", "Limits", "Migrations", "Observability"] class Limits(BaseModel): @@ -320,21 +18,7 @@ class Limits(BaseModel): """The amount of CPU time this Worker can use in milliseconds.""" -class MigrationsWorkersMultipleStepMigrations(BaseModel): - new_tag: Optional[str] = None - """Tag to set as the latest migration tag.""" - - old_tag: Optional[str] = None - """Tag used to verify against the latest migration tag for this Worker. - - If they don't match, the upload is rejected. - """ - - steps: Optional[List[MigrationStep]] = None - """Migrations to apply in order.""" - - -Migrations: TypeAlias = Union[SingleStepMigration, MigrationsWorkersMultipleStepMigrations] +Migrations: TypeAlias = Union[SingleStepMigration, SteppedMigration] class Observability(BaseModel): @@ -348,35 +32,15 @@ class Observability(BaseModel): """ -class Placement(BaseModel): - mode: Optional[Literal["smart"]] = None - """ - Enables - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - """ - - class SettingEditResponse(BaseModel): bindings: Optional[List[Binding]] = None - """List of bindings attached to a Worker. - - You can find more about bindings on our docs: - https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings. - """ + """List of bindings attached to this Worker""" compatibility_date: Optional[str] = None - """Date indicating targeted support in the Workers runtime. - - Backwards incompatible fixes to the runtime following this date will not affect - this Worker. - """ + """Opt your Worker into changes after this date""" compatibility_flags: Optional[List[str]] = None - """Flags that enable or disable certain features in the Workers runtime. - - Used to enable upcoming features or opt in or out of specific changes not - included in a `compatibility_date`. - """ + """Opt your Worker into specific changes""" limits: Optional[Limits] = None """Limits to apply for this Worker.""" @@ -390,11 +54,7 @@ class SettingEditResponse(BaseModel): observability: Optional[Observability] = None """Observability settings for the Worker.""" - placement: Optional[Placement] = None - """ - Configuration for - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - """ + placement: Optional[PlacementConfiguration] = None tags: Optional[List[str]] = None """Tags to help you manage your Workers""" @@ -402,5 +62,5 @@ class SettingEditResponse(BaseModel): tail_consumers: Optional[List[ConsumerScript]] = None """List of Workers that will consume logs from the attached Worker.""" - usage_model: Optional[Literal["standard"]] = None - """Usage model for the Worker invocations.""" + usage_model: Optional[str] = None + """Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound').""" diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_get_response.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_get_response.py index e6a39d1e9af..8e7516ccf3d 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_get_response.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_get_response.py @@ -1,318 +1,16 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import TYPE_CHECKING, List, Union, Optional -from typing_extensions import Literal, TypeAlias - -from pydantic import Field as FieldInfo +from typing import List, Union, Optional +from typing_extensions import TypeAlias from ......_models import BaseModel -from .....workers.migration_step import MigrationStep +from .....workers.binding import Binding +from .....workers.stepped_migration import SteppedMigration from .....workers.single_step_migration import SingleStepMigration +from .....workers.placement_configuration import PlacementConfiguration from .....workers.scripts.consumer_script import ConsumerScript -__all__ = [ - "SettingGetResponse", - "Binding", - "BindingWorkersBindingKindAny", - "BindingWorkersBindingKindAI", - "BindingWorkersBindingKindAnalyticsEngine", - "BindingWorkersBindingKindAssets", - "BindingWorkersBindingKindBrowserRendering", - "BindingWorkersBindingKindD1", - "BindingWorkersBindingKindDispatchNamespace", - "BindingWorkersBindingKindDispatchNamespaceOutbound", - "BindingWorkersBindingKindDispatchNamespaceOutboundWorker", - "BindingWorkersBindingKindDo", - "BindingWorkersBindingKindHyperdrive", - "BindingWorkersBindingKindJson", - "BindingWorkersBindingKindKVNamespace", - "BindingWorkersBindingKindMTLSCERT", - "BindingWorkersBindingKindPlainText", - "BindingWorkersBindingKindQueue", - "BindingWorkersBindingKindR2", - "BindingWorkersBindingKindSecret", - "BindingWorkersBindingKindService", - "BindingWorkersBindingKindTailConsumer", - "BindingWorkersBindingKindVectorize", - "BindingWorkersBindingKindVersionMetadata", - "Limits", - "Migrations", - "MigrationsWorkersMultipleStepMigrations", - "Observability", - "Placement", -] - - -class BindingWorkersBindingKindAny(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - type: str - """The kind of resource that the binding provides.""" - - if TYPE_CHECKING: - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - - -class BindingWorkersBindingKindAI(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["ai"] - """The kind of resource that the binding provides.""" - - -class BindingWorkersBindingKindAnalyticsEngine(BaseModel): - dataset: str - """The dataset name to bind to.""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["analytics_engine"] - """The kind of resource that the binding provides.""" - - -class BindingWorkersBindingKindAssets(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["assets"] - """The kind of resource that the binding provides.""" - - -class BindingWorkersBindingKindBrowserRendering(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["browser_rendering"] - """The kind of resource that the binding provides.""" - - -class BindingWorkersBindingKindD1(BaseModel): - id: str - """Identifier of the D1 database to bind to.""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["d1"] - """The kind of resource that the binding provides.""" - - -class BindingWorkersBindingKindDispatchNamespaceOutboundWorker(BaseModel): - environment: Optional[str] = None - """Environment of the outbound worker.""" - - service: Optional[str] = None - """Name of the outbound worker.""" - - -class BindingWorkersBindingKindDispatchNamespaceOutbound(BaseModel): - params: Optional[List[str]] = None - """ - Pass information from the Dispatch Worker to the Outbound Worker through the - parameters. - """ - - worker: Optional[BindingWorkersBindingKindDispatchNamespaceOutboundWorker] = None - """Outbound worker.""" - - -class BindingWorkersBindingKindDispatchNamespace(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - namespace: str - """Namespace to bind to.""" - - type: Literal["dispatch_namespace"] - """The kind of resource that the binding provides.""" - - outbound: Optional[BindingWorkersBindingKindDispatchNamespaceOutbound] = None - """Outbound worker.""" - - -class BindingWorkersBindingKindDo(BaseModel): - class_name: str - """The exported class name of the Durable Object.""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["durable_object_namespace"] - """The kind of resource that the binding provides.""" - - environment: Optional[str] = None - """The environment of the script_name to bind to.""" - - namespace_id: Optional[str] = None - """Namespace identifier tag.""" - - script_name: Optional[str] = None - """ - The script where the Durable Object is defined, if it is external to this - Worker. - """ - - -class BindingWorkersBindingKindHyperdrive(BaseModel): - id: str - """Identifier of the Hyperdrive connection to bind to.""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["hyperdrive"] - """The kind of resource that the binding provides.""" - - -class BindingWorkersBindingKindJson(BaseModel): - json_: str = FieldInfo(alias="json") - """JSON data to use.""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["json"] - """The kind of resource that the binding provides.""" - - -class BindingWorkersBindingKindKVNamespace(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - namespace_id: str - """Namespace identifier tag.""" - - type: Literal["kv_namespace"] - """The kind of resource that the binding provides.""" - - -class BindingWorkersBindingKindMTLSCERT(BaseModel): - certificate_id: str - """Identifier of the certificate to bind to.""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["mtls_certificate"] - """The kind of resource that the binding provides.""" - - -class BindingWorkersBindingKindPlainText(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - text: str - """The text value to use.""" - - type: Literal["plain_text"] - """The kind of resource that the binding provides.""" - - -class BindingWorkersBindingKindQueue(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - queue_name: str - """Name of the Queue to bind to.""" - - type: Literal["queue"] - """The kind of resource that the binding provides.""" - - -class BindingWorkersBindingKindR2(BaseModel): - bucket_name: str - """R2 bucket to bind to.""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["r2_bucket"] - """The kind of resource that the binding provides.""" - - -class BindingWorkersBindingKindSecret(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - text: str - """The secret value to use.""" - - type: Literal["secret_text"] - """The kind of resource that the binding provides.""" - - -class BindingWorkersBindingKindService(BaseModel): - environment: str - """Optional environment if the Worker utilizes one.""" - - name: str - """A JavaScript variable name for the binding.""" - - service: str - """Name of Worker to bind to.""" - - type: Literal["service"] - """The kind of resource that the binding provides.""" - - -class BindingWorkersBindingKindTailConsumer(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - service: str - """Name of Tail Worker to bind to.""" - - type: Literal["tail_consumer"] - """The kind of resource that the binding provides.""" - - -class BindingWorkersBindingKindVectorize(BaseModel): - index_name: str - """Name of the Vectorize index to bind to.""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["vectorize"] - """The kind of resource that the binding provides.""" - - -class BindingWorkersBindingKindVersionMetadata(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["version_metadata"] - """The kind of resource that the binding provides.""" - - -Binding: TypeAlias = Union[ - BindingWorkersBindingKindAny, - BindingWorkersBindingKindAI, - BindingWorkersBindingKindAnalyticsEngine, - BindingWorkersBindingKindAssets, - BindingWorkersBindingKindBrowserRendering, - BindingWorkersBindingKindD1, - BindingWorkersBindingKindDispatchNamespace, - BindingWorkersBindingKindDo, - BindingWorkersBindingKindHyperdrive, - BindingWorkersBindingKindJson, - BindingWorkersBindingKindKVNamespace, - BindingWorkersBindingKindMTLSCERT, - BindingWorkersBindingKindPlainText, - BindingWorkersBindingKindQueue, - BindingWorkersBindingKindR2, - BindingWorkersBindingKindSecret, - BindingWorkersBindingKindService, - BindingWorkersBindingKindTailConsumer, - BindingWorkersBindingKindVectorize, - BindingWorkersBindingKindVersionMetadata, -] +__all__ = ["SettingGetResponse", "Limits", "Migrations", "Observability"] class Limits(BaseModel): @@ -320,21 +18,7 @@ class Limits(BaseModel): """The amount of CPU time this Worker can use in milliseconds.""" -class MigrationsWorkersMultipleStepMigrations(BaseModel): - new_tag: Optional[str] = None - """Tag to set as the latest migration tag.""" - - old_tag: Optional[str] = None - """Tag used to verify against the latest migration tag for this Worker. - - If they don't match, the upload is rejected. - """ - - steps: Optional[List[MigrationStep]] = None - """Migrations to apply in order.""" - - -Migrations: TypeAlias = Union[SingleStepMigration, MigrationsWorkersMultipleStepMigrations] +Migrations: TypeAlias = Union[SingleStepMigration, SteppedMigration] class Observability(BaseModel): @@ -348,35 +32,15 @@ class Observability(BaseModel): """ -class Placement(BaseModel): - mode: Optional[Literal["smart"]] = None - """ - Enables - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - """ - - class SettingGetResponse(BaseModel): bindings: Optional[List[Binding]] = None - """List of bindings attached to a Worker. - - You can find more about bindings on our docs: - https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings. - """ + """List of bindings attached to this Worker""" compatibility_date: Optional[str] = None - """Date indicating targeted support in the Workers runtime. - - Backwards incompatible fixes to the runtime following this date will not affect - this Worker. - """ + """Opt your Worker into changes after this date""" compatibility_flags: Optional[List[str]] = None - """Flags that enable or disable certain features in the Workers runtime. - - Used to enable upcoming features or opt in or out of specific changes not - included in a `compatibility_date`. - """ + """Opt your Worker into specific changes""" limits: Optional[Limits] = None """Limits to apply for this Worker.""" @@ -390,11 +54,7 @@ class SettingGetResponse(BaseModel): observability: Optional[Observability] = None """Observability settings for the Worker.""" - placement: Optional[Placement] = None - """ - Configuration for - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - """ + placement: Optional[PlacementConfiguration] = None tags: Optional[List[str]] = None """Tags to help you manage your Workers""" @@ -402,5 +62,5 @@ class SettingGetResponse(BaseModel): tail_consumers: Optional[List[ConsumerScript]] = None """List of Workers that will consume logs from the attached Worker.""" - usage_model: Optional[Literal["standard"]] = None - """Usage model for the Worker invocations.""" + usage_model: Optional[str] = None + """Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound').""" diff --git a/src/cloudflare/types/zero_trust/access/__init__.py b/src/cloudflare/types/zero_trust/access/__init__.py index 3db17eae160..042c3929e5c 100644 --- a/src/cloudflare/types/zero_trust/access/__init__.py +++ b/src/cloudflare/types/zero_trust/access/__init__.py @@ -54,7 +54,6 @@ from .application_get_response import ApplicationGetResponse as ApplicationGetResponse from .bookmark_delete_response import BookmarkDeleteResponse as BookmarkDeleteResponse from .custom_page_without_html import CustomPageWithoutHTML as CustomPageWithoutHTML -from .gateway_ca_list_response import GatewayCAListResponse as GatewayCAListResponse from .application_create_params import ApplicationCreateParams as ApplicationCreateParams from .application_list_response import ApplicationListResponse as ApplicationListResponse from .application_update_params import ApplicationUpdateParams as ApplicationUpdateParams @@ -64,8 +63,6 @@ from .custom_page_update_params import CustomPageUpdateParams as CustomPageUpdateParams from .scim_config_mapping_param import SCIMConfigMappingParam as SCIMConfigMappingParam from .service_token_list_params import ServiceTokenListParams as ServiceTokenListParams -from .gateway_ca_create_response import GatewayCACreateResponse as GatewayCACreateResponse -from .gateway_ca_delete_response import GatewayCADeleteResponse as GatewayCADeleteResponse from .application_create_response import ApplicationCreateResponse as ApplicationCreateResponse from .application_delete_response import ApplicationDeleteResponse as ApplicationDeleteResponse from .application_update_response import ApplicationUpdateResponse as ApplicationUpdateResponse diff --git a/src/cloudflare/types/zero_trust/access/application_create_params.py b/src/cloudflare/types/zero_trust/access/application_create_params.py index 8f28b6ec26a..46981914209 100644 --- a/src/cloudflare/types/zero_trust/access/application_create_params.py +++ b/src/cloudflare/types/zero_trust/access/application_create_params.py @@ -23,16 +23,11 @@ "ApplicationCreateParams", "SelfHostedApplication", "SelfHostedApplicationDestination", - "SelfHostedApplicationDestinationPublicDestination", - "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationPolicy", "SelfHostedApplicationPolicyAccessAppPolicyLink", "SelfHostedApplicationPolicyUnionMember2", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", - "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "SaaSApplication", "SaaSApplicationPolicy", "SaaSApplicationPolicyAccessAppPolicyLink", @@ -40,33 +35,20 @@ "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", "SaaSApplicationSCIMConfigAuthentication", - "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", - "BrowserSSHApplicationDestinationPublicDestination", - "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationPolicyAccessAppPolicyLink", "BrowserSSHApplicationPolicyUnionMember2", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", - "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", - "BrowserVNCApplicationDestinationPublicDestination", - "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationPolicyAccessAppPolicyLink", "BrowserVNCApplicationPolicyUnionMember2", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", - "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "AppLauncherApplication", "AppLauncherApplicationFooterLink", "AppLauncherApplicationLandingPageDesign", @@ -75,9 +57,6 @@ "AppLauncherApplicationPolicyUnionMember2", "AppLauncherApplicationSCIMConfig", "AppLauncherApplicationSCIMConfigAuthentication", - "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationFooterLink", "DeviceEnrollmentPermissionsApplicationLandingPageDesign", @@ -86,9 +65,6 @@ "DeviceEnrollmentPermissionsApplicationPolicyUnionMember2", "DeviceEnrollmentPermissionsApplicationSCIMConfig", "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthentication", - "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationFooterLink", "BrowserIsolationPermissionsApplicationLandingPageDesign", @@ -97,15 +73,9 @@ "BrowserIsolationPermissionsApplicationPolicyUnionMember2", "BrowserIsolationPermissionsApplicationSCIMConfig", "BrowserIsolationPermissionsApplicationSCIMConfigAuthentication", - "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BookmarkApplication", "BookmarkApplicationSCIMConfig", "BookmarkApplicationSCIMConfigAuthentication", - "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", "InfrastructureApplicationPolicy", @@ -263,47 +233,20 @@ class SelfHostedApplication(TypedDict, total=False): """ -class SelfHostedApplicationDestinationPublicDestination(TypedDict, total=False): - type: Literal["public"] +class SelfHostedApplicationDestination(TypedDict, total=False): + type: Literal["public", "private"] uri: str """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class SelfHostedApplicationDestinationPrivateDestination(TypedDict, total=False): - cidr: str - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: str - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Literal["tcp", "udp"] - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: str - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Literal["private"] - - vnet_id: str - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -SelfHostedApplicationDestination: TypeAlias = Union[ - SelfHostedApplicationDestinationPublicDestination, SelfHostedApplicationDestinationPrivateDestination -] - - class SelfHostedApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): id: str """The UUID of the policy""" @@ -359,58 +302,10 @@ class SelfHostedApplicationPolicyUnionMember2(TypedDict, total=False): SelfHostedApplicationPolicyAccessAppPolicyLink, str, SelfHostedApplicationPolicyUnionMember2 ] - -class SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - TypedDict, total=False -): - client_id: Required[str] - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: Required[str] - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Required[Literal["access_service_token"]] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - TypedDict, total=False -): - client_id: Required[str] - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: Required[str] - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Required[Literal["access_service_token"]] - """The authentication scheme to use when making SCIM requests to this application.""" - - -SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasicParam, - SCIMConfigAuthenticationOAuthBearerTokenParam, - SCIMConfigAuthenticationOauth2Param, - SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - SelfHostedApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, - SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - Iterable[SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -562,56 +457,10 @@ class SaaSApplicationPolicyUnionMember2(TypedDict, total=False): SaaSApplicationSaaSApp: TypeAlias = Union[SAMLSaaSAppParam, OIDCSaaSAppParam] - -class SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(TypedDict, total=False): - client_id: Required[str] - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: Required[str] - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Required[Literal["access_service_token"]] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - TypedDict, total=False -): - client_id: Required[str] - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: Required[str] - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Required[Literal["access_service_token"]] - """The authentication scheme to use when making SCIM requests to this application.""" - - -SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasicParam, - SCIMConfigAuthenticationOAuthBearerTokenParam, - SCIMConfigAuthenticationOauth2Param, - SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - SaaSApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, - SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - Iterable[SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -797,47 +646,20 @@ class BrowserSSHApplication(TypedDict, total=False): """ -class BrowserSSHApplicationDestinationPublicDestination(TypedDict, total=False): - type: Literal["public"] +class BrowserSSHApplicationDestination(TypedDict, total=False): + type: Literal["public", "private"] uri: str """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class BrowserSSHApplicationDestinationPrivateDestination(TypedDict, total=False): - cidr: str - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: str - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Literal["tcp", "udp"] - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: str - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Literal["private"] - - vnet_id: str - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -BrowserSSHApplicationDestination: TypeAlias = Union[ - BrowserSSHApplicationDestinationPublicDestination, BrowserSSHApplicationDestinationPrivateDestination -] - - class BrowserSSHApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): id: str """The UUID of the policy""" @@ -893,58 +715,10 @@ class BrowserSSHApplicationPolicyUnionMember2(TypedDict, total=False): BrowserSSHApplicationPolicyAccessAppPolicyLink, str, BrowserSSHApplicationPolicyUnionMember2 ] - -class BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - TypedDict, total=False -): - client_id: Required[str] - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: Required[str] - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Required[Literal["access_service_token"]] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - TypedDict, total=False -): - client_id: Required[str] - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: Required[str] - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Required[Literal["access_service_token"]] - """The authentication scheme to use when making SCIM requests to this application.""" - - -BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasicParam, - SCIMConfigAuthenticationOAuthBearerTokenParam, - SCIMConfigAuthenticationOauth2Param, - BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - BrowserSSHApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, - BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - Iterable[BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -1130,47 +904,20 @@ class BrowserVNCApplication(TypedDict, total=False): """ -class BrowserVNCApplicationDestinationPublicDestination(TypedDict, total=False): - type: Literal["public"] +class BrowserVNCApplicationDestination(TypedDict, total=False): + type: Literal["public", "private"] uri: str """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class BrowserVNCApplicationDestinationPrivateDestination(TypedDict, total=False): - cidr: str - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: str - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Literal["tcp", "udp"] - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: str - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Literal["private"] - - vnet_id: str - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -BrowserVNCApplicationDestination: TypeAlias = Union[ - BrowserVNCApplicationDestinationPublicDestination, BrowserVNCApplicationDestinationPrivateDestination -] - - class BrowserVNCApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): id: str """The UUID of the policy""" @@ -1226,58 +973,10 @@ class BrowserVNCApplicationPolicyUnionMember2(TypedDict, total=False): BrowserVNCApplicationPolicyAccessAppPolicyLink, str, BrowserVNCApplicationPolicyUnionMember2 ] - -class BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - TypedDict, total=False -): - client_id: Required[str] - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: Required[str] - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Required[Literal["access_service_token"]] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - TypedDict, total=False -): - client_id: Required[str] - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: Required[str] - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Required[Literal["access_service_token"]] - """The authentication scheme to use when making SCIM requests to this application.""" - - -BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasicParam, - SCIMConfigAuthenticationOAuthBearerTokenParam, - SCIMConfigAuthenticationOauth2Param, - BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - BrowserVNCApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, - BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - Iterable[BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -1457,58 +1156,10 @@ class AppLauncherApplicationPolicyUnionMember2(TypedDict, total=False): AppLauncherApplicationPolicyAccessAppPolicyLink, str, AppLauncherApplicationPolicyUnionMember2 ] - -class AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - TypedDict, total=False -): - client_id: Required[str] - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: Required[str] - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Required[Literal["access_service_token"]] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - TypedDict, total=False -): - client_id: Required[str] - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: Required[str] - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Required[Literal["access_service_token"]] - """The authentication scheme to use when making SCIM requests to this application.""" - - -AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasicParam, - SCIMConfigAuthenticationOAuthBearerTokenParam, - SCIMConfigAuthenticationOauth2Param, - AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - AppLauncherApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, - AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - Iterable[AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -1690,58 +1341,10 @@ class DeviceEnrollmentPermissionsApplicationPolicyUnionMember2(TypedDict, total= DeviceEnrollmentPermissionsApplicationPolicyUnionMember2, ] - -class DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - TypedDict, total=False -): - client_id: Required[str] - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: Required[str] - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Required[Literal["access_service_token"]] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - TypedDict, total=False -): - client_id: Required[str] - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: Required[str] - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Required[Literal["access_service_token"]] - """The authentication scheme to use when making SCIM requests to this application.""" - - -DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasicParam, - SCIMConfigAuthenticationOAuthBearerTokenParam, - SCIMConfigAuthenticationOauth2Param, - DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - DeviceEnrollmentPermissionsApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, - DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - Iterable[DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -1923,58 +1526,10 @@ class BrowserIsolationPermissionsApplicationPolicyUnionMember2(TypedDict, total= BrowserIsolationPermissionsApplicationPolicyUnionMember2, ] - -class BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - TypedDict, total=False -): - client_id: Required[str] - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: Required[str] - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Required[Literal["access_service_token"]] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - TypedDict, total=False -): - client_id: Required[str] - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: Required[str] - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Required[Literal["access_service_token"]] - """The authentication scheme to use when making SCIM requests to this application.""" - - -BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasicParam, - SCIMConfigAuthenticationOAuthBearerTokenParam, - SCIMConfigAuthenticationOauth2Param, - BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - BrowserIsolationPermissionsApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, - BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - Iterable[BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -2046,57 +1601,10 @@ class BookmarkApplication(TypedDict, total=False): """The application type.""" -class BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - TypedDict, total=False -): - client_id: Required[str] - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: Required[str] - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Required[Literal["access_service_token"]] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - TypedDict, total=False -): - client_id: Required[str] - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: Required[str] - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Required[Literal["access_service_token"]] - """The authentication scheme to use when making SCIM requests to this application.""" - - -BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasicParam, - SCIMConfigAuthenticationOAuthBearerTokenParam, - SCIMConfigAuthenticationOauth2Param, - BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - BookmarkApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, - BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - Iterable[BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] diff --git a/src/cloudflare/types/zero_trust/access/application_create_response.py b/src/cloudflare/types/zero_trust/access/application_create_response.py index 1f3a5fdb214..6249dd96de2 100644 --- a/src/cloudflare/types/zero_trust/access/application_create_response.py +++ b/src/cloudflare/types/zero_trust/access/application_create_response.py @@ -23,75 +23,45 @@ "ApplicationCreateResponse", "SelfHostedApplication", "SelfHostedApplicationDestination", - "SelfHostedApplicationDestinationPublicDestination", - "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationPolicy", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", - "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "SaaSApplication", "SaaSApplicationPolicy", "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", "SaaSApplicationSCIMConfigAuthentication", - "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", - "BrowserSSHApplicationDestinationPublicDestination", - "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", - "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", - "BrowserVNCApplicationDestinationPublicDestination", - "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", - "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "AppLauncherApplication", "AppLauncherApplicationFooterLink", "AppLauncherApplicationLandingPageDesign", "AppLauncherApplicationPolicy", "AppLauncherApplicationSCIMConfig", "AppLauncherApplicationSCIMConfigAuthentication", - "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationFooterLink", "DeviceEnrollmentPermissionsApplicationLandingPageDesign", "DeviceEnrollmentPermissionsApplicationPolicy", "DeviceEnrollmentPermissionsApplicationSCIMConfig", "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthentication", - "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationFooterLink", "BrowserIsolationPermissionsApplicationLandingPageDesign", "BrowserIsolationPermissionsApplicationPolicy", "BrowserIsolationPermissionsApplicationSCIMConfig", "BrowserIsolationPermissionsApplicationSCIMConfigAuthentication", - "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BookmarkApplication", "BookmarkApplicationSCIMConfig", "BookmarkApplicationSCIMConfigAuthentication", - "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", "InfrastructureApplicationPolicy", @@ -99,53 +69,23 @@ "InfrastructureApplicationPolicyConnectionRulesSSH", "InfrastructureApplicationSCIMConfig", "InfrastructureApplicationSCIMConfigAuthentication", - "InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", ] -class SelfHostedApplicationDestinationPublicDestination(BaseModel): - type: Optional[Literal["public"]] = None +class SelfHostedApplicationDestination(BaseModel): + type: Optional[Literal["public", "private"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class SelfHostedApplicationDestinationPrivateDestination(BaseModel): - cidr: Optional[str] = None - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: Optional[str] = None - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Optional[Literal["tcp", "udp"]] = None - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: Optional[str] = None - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Optional[Literal["private"]] = None - - vnet_id: Optional[str] = None - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -SelfHostedApplicationDestination: TypeAlias = Union[ - SelfHostedApplicationDestinationPublicDestination, SelfHostedApplicationDestinationPrivateDestination -] - - class SelfHostedApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -154,55 +94,8 @@ class SelfHostedApplicationPolicy(ApplicationPolicy): """ -class SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - SelfHostedApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] @@ -397,56 +290,8 @@ class SaaSApplicationPolicy(ApplicationPolicy): SaaSApplicationSaaSApp: TypeAlias = Union[SAMLSaaSApp, OIDCSaaSApp] - -class SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - SaaSApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] @@ -540,47 +385,20 @@ class SaaSApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserSSHApplicationDestinationPublicDestination(BaseModel): - type: Optional[Literal["public"]] = None +class BrowserSSHApplicationDestination(BaseModel): + type: Optional[Literal["public", "private"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class BrowserSSHApplicationDestinationPrivateDestination(BaseModel): - cidr: Optional[str] = None - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: Optional[str] = None - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Optional[Literal["tcp", "udp"]] = None - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: Optional[str] = None - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Optional[Literal["private"]] = None - - vnet_id: Optional[str] = None - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -BrowserSSHApplicationDestination: TypeAlias = Union[ - BrowserSSHApplicationDestinationPublicDestination, BrowserSSHApplicationDestinationPrivateDestination -] - - class BrowserSSHApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -589,55 +407,8 @@ class BrowserSSHApplicationPolicy(ApplicationPolicy): """ -class BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - BrowserSSHApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] @@ -822,47 +593,20 @@ class BrowserSSHApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserVNCApplicationDestinationPublicDestination(BaseModel): - type: Optional[Literal["public"]] = None +class BrowserVNCApplicationDestination(BaseModel): + type: Optional[Literal["public", "private"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class BrowserVNCApplicationDestinationPrivateDestination(BaseModel): - cidr: Optional[str] = None - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: Optional[str] = None - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Optional[Literal["tcp", "udp"]] = None - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: Optional[str] = None - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Optional[Literal["private"]] = None - - vnet_id: Optional[str] = None - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -BrowserVNCApplicationDestination: TypeAlias = Union[ - BrowserVNCApplicationDestinationPublicDestination, BrowserVNCApplicationDestinationPrivateDestination -] - - class BrowserVNCApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -871,55 +615,8 @@ class BrowserVNCApplicationPolicy(ApplicationPolicy): """ -class BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - BrowserVNCApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] @@ -1137,55 +834,8 @@ class AppLauncherApplicationPolicy(ApplicationPolicy): """ -class AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - AppLauncherApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] @@ -1326,57 +976,8 @@ class DeviceEnrollmentPermissionsApplicationPolicy(ApplicationPolicy): """ -class DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - DeviceEnrollmentPermissionsApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] @@ -1517,57 +1118,8 @@ class BrowserIsolationPermissionsApplicationPolicy(ApplicationPolicy): """ -class BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - BrowserIsolationPermissionsApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] @@ -1675,55 +1227,8 @@ class BrowserIsolationPermissionsApplication(BaseModel): updated_at: Optional[datetime] = None -class BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - BookmarkApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] @@ -1871,55 +1376,8 @@ class InfrastructureApplicationPolicy(BaseModel): updated_at: Optional[datetime] = None -class InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - InfrastructureApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] diff --git a/src/cloudflare/types/zero_trust/access/application_get_response.py b/src/cloudflare/types/zero_trust/access/application_get_response.py index cffacb3a76a..1cd213b07d0 100644 --- a/src/cloudflare/types/zero_trust/access/application_get_response.py +++ b/src/cloudflare/types/zero_trust/access/application_get_response.py @@ -23,75 +23,45 @@ "ApplicationGetResponse", "SelfHostedApplication", "SelfHostedApplicationDestination", - "SelfHostedApplicationDestinationPublicDestination", - "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationPolicy", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", - "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "SaaSApplication", "SaaSApplicationPolicy", "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", "SaaSApplicationSCIMConfigAuthentication", - "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", - "BrowserSSHApplicationDestinationPublicDestination", - "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", - "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", - "BrowserVNCApplicationDestinationPublicDestination", - "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", - "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "AppLauncherApplication", "AppLauncherApplicationFooterLink", "AppLauncherApplicationLandingPageDesign", "AppLauncherApplicationPolicy", "AppLauncherApplicationSCIMConfig", "AppLauncherApplicationSCIMConfigAuthentication", - "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationFooterLink", "DeviceEnrollmentPermissionsApplicationLandingPageDesign", "DeviceEnrollmentPermissionsApplicationPolicy", "DeviceEnrollmentPermissionsApplicationSCIMConfig", "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthentication", - "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationFooterLink", "BrowserIsolationPermissionsApplicationLandingPageDesign", "BrowserIsolationPermissionsApplicationPolicy", "BrowserIsolationPermissionsApplicationSCIMConfig", "BrowserIsolationPermissionsApplicationSCIMConfigAuthentication", - "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BookmarkApplication", "BookmarkApplicationSCIMConfig", "BookmarkApplicationSCIMConfigAuthentication", - "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", "InfrastructureApplicationPolicy", @@ -99,53 +69,23 @@ "InfrastructureApplicationPolicyConnectionRulesSSH", "InfrastructureApplicationSCIMConfig", "InfrastructureApplicationSCIMConfigAuthentication", - "InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", ] -class SelfHostedApplicationDestinationPublicDestination(BaseModel): - type: Optional[Literal["public"]] = None +class SelfHostedApplicationDestination(BaseModel): + type: Optional[Literal["public", "private"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class SelfHostedApplicationDestinationPrivateDestination(BaseModel): - cidr: Optional[str] = None - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: Optional[str] = None - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Optional[Literal["tcp", "udp"]] = None - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: Optional[str] = None - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Optional[Literal["private"]] = None - - vnet_id: Optional[str] = None - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -SelfHostedApplicationDestination: TypeAlias = Union[ - SelfHostedApplicationDestinationPublicDestination, SelfHostedApplicationDestinationPrivateDestination -] - - class SelfHostedApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -154,55 +94,8 @@ class SelfHostedApplicationPolicy(ApplicationPolicy): """ -class SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - SelfHostedApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] @@ -397,56 +290,8 @@ class SaaSApplicationPolicy(ApplicationPolicy): SaaSApplicationSaaSApp: TypeAlias = Union[SAMLSaaSApp, OIDCSaaSApp] - -class SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - SaaSApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] @@ -540,47 +385,20 @@ class SaaSApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserSSHApplicationDestinationPublicDestination(BaseModel): - type: Optional[Literal["public"]] = None +class BrowserSSHApplicationDestination(BaseModel): + type: Optional[Literal["public", "private"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class BrowserSSHApplicationDestinationPrivateDestination(BaseModel): - cidr: Optional[str] = None - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: Optional[str] = None - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Optional[Literal["tcp", "udp"]] = None - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: Optional[str] = None - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Optional[Literal["private"]] = None - - vnet_id: Optional[str] = None - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -BrowserSSHApplicationDestination: TypeAlias = Union[ - BrowserSSHApplicationDestinationPublicDestination, BrowserSSHApplicationDestinationPrivateDestination -] - - class BrowserSSHApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -589,55 +407,8 @@ class BrowserSSHApplicationPolicy(ApplicationPolicy): """ -class BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - BrowserSSHApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] @@ -822,47 +593,20 @@ class BrowserSSHApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserVNCApplicationDestinationPublicDestination(BaseModel): - type: Optional[Literal["public"]] = None +class BrowserVNCApplicationDestination(BaseModel): + type: Optional[Literal["public", "private"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class BrowserVNCApplicationDestinationPrivateDestination(BaseModel): - cidr: Optional[str] = None - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: Optional[str] = None - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Optional[Literal["tcp", "udp"]] = None - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: Optional[str] = None - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Optional[Literal["private"]] = None - - vnet_id: Optional[str] = None - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -BrowserVNCApplicationDestination: TypeAlias = Union[ - BrowserVNCApplicationDestinationPublicDestination, BrowserVNCApplicationDestinationPrivateDestination -] - - class BrowserVNCApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -871,55 +615,8 @@ class BrowserVNCApplicationPolicy(ApplicationPolicy): """ -class BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - BrowserVNCApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] @@ -1137,55 +834,8 @@ class AppLauncherApplicationPolicy(ApplicationPolicy): """ -class AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - AppLauncherApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] @@ -1326,57 +976,8 @@ class DeviceEnrollmentPermissionsApplicationPolicy(ApplicationPolicy): """ -class DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - DeviceEnrollmentPermissionsApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] @@ -1517,57 +1118,8 @@ class BrowserIsolationPermissionsApplicationPolicy(ApplicationPolicy): """ -class BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - BrowserIsolationPermissionsApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] @@ -1675,55 +1227,8 @@ class BrowserIsolationPermissionsApplication(BaseModel): updated_at: Optional[datetime] = None -class BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - BookmarkApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] @@ -1871,55 +1376,8 @@ class InfrastructureApplicationPolicy(BaseModel): updated_at: Optional[datetime] = None -class InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - InfrastructureApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] diff --git a/src/cloudflare/types/zero_trust/access/application_list_response.py b/src/cloudflare/types/zero_trust/access/application_list_response.py index 1a0257ad43c..975532467ec 100644 --- a/src/cloudflare/types/zero_trust/access/application_list_response.py +++ b/src/cloudflare/types/zero_trust/access/application_list_response.py @@ -23,75 +23,45 @@ "ApplicationListResponse", "SelfHostedApplication", "SelfHostedApplicationDestination", - "SelfHostedApplicationDestinationPublicDestination", - "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationPolicy", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", - "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "SaaSApplication", "SaaSApplicationPolicy", "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", "SaaSApplicationSCIMConfigAuthentication", - "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", - "BrowserSSHApplicationDestinationPublicDestination", - "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", - "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", - "BrowserVNCApplicationDestinationPublicDestination", - "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", - "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "AppLauncherApplication", "AppLauncherApplicationFooterLink", "AppLauncherApplicationLandingPageDesign", "AppLauncherApplicationPolicy", "AppLauncherApplicationSCIMConfig", "AppLauncherApplicationSCIMConfigAuthentication", - "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationFooterLink", "DeviceEnrollmentPermissionsApplicationLandingPageDesign", "DeviceEnrollmentPermissionsApplicationPolicy", "DeviceEnrollmentPermissionsApplicationSCIMConfig", "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthentication", - "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationFooterLink", "BrowserIsolationPermissionsApplicationLandingPageDesign", "BrowserIsolationPermissionsApplicationPolicy", "BrowserIsolationPermissionsApplicationSCIMConfig", "BrowserIsolationPermissionsApplicationSCIMConfigAuthentication", - "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BookmarkApplication", "BookmarkApplicationSCIMConfig", "BookmarkApplicationSCIMConfigAuthentication", - "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", "InfrastructureApplicationPolicy", @@ -99,53 +69,23 @@ "InfrastructureApplicationPolicyConnectionRulesSSH", "InfrastructureApplicationSCIMConfig", "InfrastructureApplicationSCIMConfigAuthentication", - "InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", ] -class SelfHostedApplicationDestinationPublicDestination(BaseModel): - type: Optional[Literal["public"]] = None +class SelfHostedApplicationDestination(BaseModel): + type: Optional[Literal["public", "private"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class SelfHostedApplicationDestinationPrivateDestination(BaseModel): - cidr: Optional[str] = None - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: Optional[str] = None - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Optional[Literal["tcp", "udp"]] = None - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: Optional[str] = None - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Optional[Literal["private"]] = None - - vnet_id: Optional[str] = None - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -SelfHostedApplicationDestination: TypeAlias = Union[ - SelfHostedApplicationDestinationPublicDestination, SelfHostedApplicationDestinationPrivateDestination -] - - class SelfHostedApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -154,55 +94,8 @@ class SelfHostedApplicationPolicy(ApplicationPolicy): """ -class SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - SelfHostedApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] @@ -397,56 +290,8 @@ class SaaSApplicationPolicy(ApplicationPolicy): SaaSApplicationSaaSApp: TypeAlias = Union[SAMLSaaSApp, OIDCSaaSApp] - -class SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - SaaSApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] @@ -540,47 +385,20 @@ class SaaSApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserSSHApplicationDestinationPublicDestination(BaseModel): - type: Optional[Literal["public"]] = None +class BrowserSSHApplicationDestination(BaseModel): + type: Optional[Literal["public", "private"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class BrowserSSHApplicationDestinationPrivateDestination(BaseModel): - cidr: Optional[str] = None - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: Optional[str] = None - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Optional[Literal["tcp", "udp"]] = None - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: Optional[str] = None - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Optional[Literal["private"]] = None - - vnet_id: Optional[str] = None - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -BrowserSSHApplicationDestination: TypeAlias = Union[ - BrowserSSHApplicationDestinationPublicDestination, BrowserSSHApplicationDestinationPrivateDestination -] - - class BrowserSSHApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -589,55 +407,8 @@ class BrowserSSHApplicationPolicy(ApplicationPolicy): """ -class BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - BrowserSSHApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] @@ -822,47 +593,20 @@ class BrowserSSHApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserVNCApplicationDestinationPublicDestination(BaseModel): - type: Optional[Literal["public"]] = None +class BrowserVNCApplicationDestination(BaseModel): + type: Optional[Literal["public", "private"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class BrowserVNCApplicationDestinationPrivateDestination(BaseModel): - cidr: Optional[str] = None - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: Optional[str] = None - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Optional[Literal["tcp", "udp"]] = None - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: Optional[str] = None - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Optional[Literal["private"]] = None - - vnet_id: Optional[str] = None - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -BrowserVNCApplicationDestination: TypeAlias = Union[ - BrowserVNCApplicationDestinationPublicDestination, BrowserVNCApplicationDestinationPrivateDestination -] - - class BrowserVNCApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -871,55 +615,8 @@ class BrowserVNCApplicationPolicy(ApplicationPolicy): """ -class BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - BrowserVNCApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] @@ -1137,55 +834,8 @@ class AppLauncherApplicationPolicy(ApplicationPolicy): """ -class AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - AppLauncherApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] @@ -1326,57 +976,8 @@ class DeviceEnrollmentPermissionsApplicationPolicy(ApplicationPolicy): """ -class DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - DeviceEnrollmentPermissionsApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] @@ -1517,57 +1118,8 @@ class BrowserIsolationPermissionsApplicationPolicy(ApplicationPolicy): """ -class BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - BrowserIsolationPermissionsApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] @@ -1675,55 +1227,8 @@ class BrowserIsolationPermissionsApplication(BaseModel): updated_at: Optional[datetime] = None -class BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - BookmarkApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] @@ -1871,55 +1376,8 @@ class InfrastructureApplicationPolicy(BaseModel): updated_at: Optional[datetime] = None -class InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - InfrastructureApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] diff --git a/src/cloudflare/types/zero_trust/access/application_update_params.py b/src/cloudflare/types/zero_trust/access/application_update_params.py index f96f295a24f..2a8f59a7281 100644 --- a/src/cloudflare/types/zero_trust/access/application_update_params.py +++ b/src/cloudflare/types/zero_trust/access/application_update_params.py @@ -23,16 +23,11 @@ "ApplicationUpdateParams", "SelfHostedApplication", "SelfHostedApplicationDestination", - "SelfHostedApplicationDestinationPublicDestination", - "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationPolicy", "SelfHostedApplicationPolicyAccessAppPolicyLink", "SelfHostedApplicationPolicyUnionMember2", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", - "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "SaaSApplication", "SaaSApplicationPolicy", "SaaSApplicationPolicyAccessAppPolicyLink", @@ -40,33 +35,20 @@ "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", "SaaSApplicationSCIMConfigAuthentication", - "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", - "BrowserSSHApplicationDestinationPublicDestination", - "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationPolicyAccessAppPolicyLink", "BrowserSSHApplicationPolicyUnionMember2", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", - "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", - "BrowserVNCApplicationDestinationPublicDestination", - "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationPolicyAccessAppPolicyLink", "BrowserVNCApplicationPolicyUnionMember2", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", - "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "AppLauncherApplication", "AppLauncherApplicationFooterLink", "AppLauncherApplicationLandingPageDesign", @@ -75,9 +57,6 @@ "AppLauncherApplicationPolicyUnionMember2", "AppLauncherApplicationSCIMConfig", "AppLauncherApplicationSCIMConfigAuthentication", - "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationFooterLink", "DeviceEnrollmentPermissionsApplicationLandingPageDesign", @@ -86,9 +65,6 @@ "DeviceEnrollmentPermissionsApplicationPolicyUnionMember2", "DeviceEnrollmentPermissionsApplicationSCIMConfig", "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthentication", - "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationFooterLink", "BrowserIsolationPermissionsApplicationLandingPageDesign", @@ -97,15 +73,9 @@ "BrowserIsolationPermissionsApplicationPolicyUnionMember2", "BrowserIsolationPermissionsApplicationSCIMConfig", "BrowserIsolationPermissionsApplicationSCIMConfigAuthentication", - "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BookmarkApplication", "BookmarkApplicationSCIMConfig", "BookmarkApplicationSCIMConfigAuthentication", - "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", "InfrastructureApplicationPolicy", @@ -263,47 +233,20 @@ class SelfHostedApplication(TypedDict, total=False): """ -class SelfHostedApplicationDestinationPublicDestination(TypedDict, total=False): - type: Literal["public"] +class SelfHostedApplicationDestination(TypedDict, total=False): + type: Literal["public", "private"] uri: str """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class SelfHostedApplicationDestinationPrivateDestination(TypedDict, total=False): - cidr: str - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: str - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Literal["tcp", "udp"] - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: str - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Literal["private"] - - vnet_id: str - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -SelfHostedApplicationDestination: TypeAlias = Union[ - SelfHostedApplicationDestinationPublicDestination, SelfHostedApplicationDestinationPrivateDestination -] - - class SelfHostedApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): id: str """The UUID of the policy""" @@ -359,58 +302,10 @@ class SelfHostedApplicationPolicyUnionMember2(TypedDict, total=False): SelfHostedApplicationPolicyAccessAppPolicyLink, str, SelfHostedApplicationPolicyUnionMember2 ] - -class SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - TypedDict, total=False -): - client_id: Required[str] - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: Required[str] - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Required[Literal["access_service_token"]] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - TypedDict, total=False -): - client_id: Required[str] - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: Required[str] - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Required[Literal["access_service_token"]] - """The authentication scheme to use when making SCIM requests to this application.""" - - -SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasicParam, - SCIMConfigAuthenticationOAuthBearerTokenParam, - SCIMConfigAuthenticationOauth2Param, - SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - SelfHostedApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, - SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - Iterable[SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -562,56 +457,10 @@ class SaaSApplicationPolicyUnionMember2(TypedDict, total=False): SaaSApplicationSaaSApp: TypeAlias = Union[SAMLSaaSAppParam, OIDCSaaSAppParam] - -class SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(TypedDict, total=False): - client_id: Required[str] - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: Required[str] - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Required[Literal["access_service_token"]] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - TypedDict, total=False -): - client_id: Required[str] - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: Required[str] - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Required[Literal["access_service_token"]] - """The authentication scheme to use when making SCIM requests to this application.""" - - -SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasicParam, - SCIMConfigAuthenticationOAuthBearerTokenParam, - SCIMConfigAuthenticationOauth2Param, - SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - SaaSApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, - SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - Iterable[SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -797,47 +646,20 @@ class BrowserSSHApplication(TypedDict, total=False): """ -class BrowserSSHApplicationDestinationPublicDestination(TypedDict, total=False): - type: Literal["public"] +class BrowserSSHApplicationDestination(TypedDict, total=False): + type: Literal["public", "private"] uri: str """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class BrowserSSHApplicationDestinationPrivateDestination(TypedDict, total=False): - cidr: str - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: str - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Literal["tcp", "udp"] - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: str - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Literal["private"] - - vnet_id: str - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -BrowserSSHApplicationDestination: TypeAlias = Union[ - BrowserSSHApplicationDestinationPublicDestination, BrowserSSHApplicationDestinationPrivateDestination -] - - class BrowserSSHApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): id: str """The UUID of the policy""" @@ -893,58 +715,10 @@ class BrowserSSHApplicationPolicyUnionMember2(TypedDict, total=False): BrowserSSHApplicationPolicyAccessAppPolicyLink, str, BrowserSSHApplicationPolicyUnionMember2 ] - -class BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - TypedDict, total=False -): - client_id: Required[str] - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: Required[str] - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Required[Literal["access_service_token"]] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - TypedDict, total=False -): - client_id: Required[str] - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: Required[str] - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Required[Literal["access_service_token"]] - """The authentication scheme to use when making SCIM requests to this application.""" - - -BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasicParam, - SCIMConfigAuthenticationOAuthBearerTokenParam, - SCIMConfigAuthenticationOauth2Param, - BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - BrowserSSHApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, - BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - Iterable[BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -1130,47 +904,20 @@ class BrowserVNCApplication(TypedDict, total=False): """ -class BrowserVNCApplicationDestinationPublicDestination(TypedDict, total=False): - type: Literal["public"] +class BrowserVNCApplicationDestination(TypedDict, total=False): + type: Literal["public", "private"] uri: str """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class BrowserVNCApplicationDestinationPrivateDestination(TypedDict, total=False): - cidr: str - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: str - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Literal["tcp", "udp"] - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: str - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Literal["private"] - - vnet_id: str - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -BrowserVNCApplicationDestination: TypeAlias = Union[ - BrowserVNCApplicationDestinationPublicDestination, BrowserVNCApplicationDestinationPrivateDestination -] - - class BrowserVNCApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): id: str """The UUID of the policy""" @@ -1226,58 +973,10 @@ class BrowserVNCApplicationPolicyUnionMember2(TypedDict, total=False): BrowserVNCApplicationPolicyAccessAppPolicyLink, str, BrowserVNCApplicationPolicyUnionMember2 ] - -class BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - TypedDict, total=False -): - client_id: Required[str] - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: Required[str] - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Required[Literal["access_service_token"]] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - TypedDict, total=False -): - client_id: Required[str] - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: Required[str] - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Required[Literal["access_service_token"]] - """The authentication scheme to use when making SCIM requests to this application.""" - - -BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasicParam, - SCIMConfigAuthenticationOAuthBearerTokenParam, - SCIMConfigAuthenticationOauth2Param, - BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - BrowserVNCApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, - BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - Iterable[BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -1457,58 +1156,10 @@ class AppLauncherApplicationPolicyUnionMember2(TypedDict, total=False): AppLauncherApplicationPolicyAccessAppPolicyLink, str, AppLauncherApplicationPolicyUnionMember2 ] - -class AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - TypedDict, total=False -): - client_id: Required[str] - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: Required[str] - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Required[Literal["access_service_token"]] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - TypedDict, total=False -): - client_id: Required[str] - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: Required[str] - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Required[Literal["access_service_token"]] - """The authentication scheme to use when making SCIM requests to this application.""" - - -AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasicParam, - SCIMConfigAuthenticationOAuthBearerTokenParam, - SCIMConfigAuthenticationOauth2Param, - AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - AppLauncherApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, - AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - Iterable[AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -1690,58 +1341,10 @@ class DeviceEnrollmentPermissionsApplicationPolicyUnionMember2(TypedDict, total= DeviceEnrollmentPermissionsApplicationPolicyUnionMember2, ] - -class DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - TypedDict, total=False -): - client_id: Required[str] - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: Required[str] - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Required[Literal["access_service_token"]] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - TypedDict, total=False -): - client_id: Required[str] - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: Required[str] - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Required[Literal["access_service_token"]] - """The authentication scheme to use when making SCIM requests to this application.""" - - -DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasicParam, - SCIMConfigAuthenticationOAuthBearerTokenParam, - SCIMConfigAuthenticationOauth2Param, - DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - DeviceEnrollmentPermissionsApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, - DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - Iterable[DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -1923,58 +1526,10 @@ class BrowserIsolationPermissionsApplicationPolicyUnionMember2(TypedDict, total= BrowserIsolationPermissionsApplicationPolicyUnionMember2, ] - -class BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - TypedDict, total=False -): - client_id: Required[str] - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: Required[str] - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Required[Literal["access_service_token"]] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - TypedDict, total=False -): - client_id: Required[str] - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: Required[str] - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Required[Literal["access_service_token"]] - """The authentication scheme to use when making SCIM requests to this application.""" - - -BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasicParam, - SCIMConfigAuthenticationOAuthBearerTokenParam, - SCIMConfigAuthenticationOauth2Param, - BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - BrowserIsolationPermissionsApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, - BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - Iterable[BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -2046,57 +1601,10 @@ class BookmarkApplication(TypedDict, total=False): """The application type.""" -class BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - TypedDict, total=False -): - client_id: Required[str] - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: Required[str] - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Required[Literal["access_service_token"]] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - TypedDict, total=False -): - client_id: Required[str] - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: Required[str] - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Required[Literal["access_service_token"]] - """The authentication scheme to use when making SCIM requests to this application.""" - - -BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasicParam, - SCIMConfigAuthenticationOAuthBearerTokenParam, - SCIMConfigAuthenticationOauth2Param, - BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - BookmarkApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, - BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - Iterable[BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] diff --git a/src/cloudflare/types/zero_trust/access/application_update_response.py b/src/cloudflare/types/zero_trust/access/application_update_response.py index 00ea299d5f3..72369b46d05 100644 --- a/src/cloudflare/types/zero_trust/access/application_update_response.py +++ b/src/cloudflare/types/zero_trust/access/application_update_response.py @@ -23,75 +23,45 @@ "ApplicationUpdateResponse", "SelfHostedApplication", "SelfHostedApplicationDestination", - "SelfHostedApplicationDestinationPublicDestination", - "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationPolicy", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", - "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "SaaSApplication", "SaaSApplicationPolicy", "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", "SaaSApplicationSCIMConfigAuthentication", - "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", - "BrowserSSHApplicationDestinationPublicDestination", - "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", - "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", - "BrowserVNCApplicationDestinationPublicDestination", - "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", - "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "AppLauncherApplication", "AppLauncherApplicationFooterLink", "AppLauncherApplicationLandingPageDesign", "AppLauncherApplicationPolicy", "AppLauncherApplicationSCIMConfig", "AppLauncherApplicationSCIMConfigAuthentication", - "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationFooterLink", "DeviceEnrollmentPermissionsApplicationLandingPageDesign", "DeviceEnrollmentPermissionsApplicationPolicy", "DeviceEnrollmentPermissionsApplicationSCIMConfig", "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthentication", - "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationFooterLink", "BrowserIsolationPermissionsApplicationLandingPageDesign", "BrowserIsolationPermissionsApplicationPolicy", "BrowserIsolationPermissionsApplicationSCIMConfig", "BrowserIsolationPermissionsApplicationSCIMConfigAuthentication", - "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BookmarkApplication", "BookmarkApplicationSCIMConfig", "BookmarkApplicationSCIMConfigAuthentication", - "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", "InfrastructureApplicationPolicy", @@ -99,53 +69,23 @@ "InfrastructureApplicationPolicyConnectionRulesSSH", "InfrastructureApplicationSCIMConfig", "InfrastructureApplicationSCIMConfigAuthentication", - "InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", ] -class SelfHostedApplicationDestinationPublicDestination(BaseModel): - type: Optional[Literal["public"]] = None +class SelfHostedApplicationDestination(BaseModel): + type: Optional[Literal["public", "private"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class SelfHostedApplicationDestinationPrivateDestination(BaseModel): - cidr: Optional[str] = None - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: Optional[str] = None - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Optional[Literal["tcp", "udp"]] = None - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: Optional[str] = None - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Optional[Literal["private"]] = None - - vnet_id: Optional[str] = None - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -SelfHostedApplicationDestination: TypeAlias = Union[ - SelfHostedApplicationDestinationPublicDestination, SelfHostedApplicationDestinationPrivateDestination -] - - class SelfHostedApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -154,55 +94,8 @@ class SelfHostedApplicationPolicy(ApplicationPolicy): """ -class SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - SelfHostedApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] @@ -397,56 +290,8 @@ class SaaSApplicationPolicy(ApplicationPolicy): SaaSApplicationSaaSApp: TypeAlias = Union[SAMLSaaSApp, OIDCSaaSApp] - -class SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - SaaSApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] @@ -540,47 +385,20 @@ class SaaSApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserSSHApplicationDestinationPublicDestination(BaseModel): - type: Optional[Literal["public"]] = None +class BrowserSSHApplicationDestination(BaseModel): + type: Optional[Literal["public", "private"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class BrowserSSHApplicationDestinationPrivateDestination(BaseModel): - cidr: Optional[str] = None - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: Optional[str] = None - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Optional[Literal["tcp", "udp"]] = None - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: Optional[str] = None - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Optional[Literal["private"]] = None - - vnet_id: Optional[str] = None - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -BrowserSSHApplicationDestination: TypeAlias = Union[ - BrowserSSHApplicationDestinationPublicDestination, BrowserSSHApplicationDestinationPrivateDestination -] - - class BrowserSSHApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -589,55 +407,8 @@ class BrowserSSHApplicationPolicy(ApplicationPolicy): """ -class BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - BrowserSSHApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] @@ -822,47 +593,20 @@ class BrowserSSHApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserVNCApplicationDestinationPublicDestination(BaseModel): - type: Optional[Literal["public"]] = None +class BrowserVNCApplicationDestination(BaseModel): + type: Optional[Literal["public", "private"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations' URIs can include a domain and path with + Public destinations can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + Private destinations are an early access feature and gated behind a feature + flag. Private destinations support private IPv4, IPv6, and Server Name + Indications (SNI) with optional port ranges. """ -class BrowserVNCApplicationDestinationPrivateDestination(BaseModel): - cidr: Optional[str] = None - """The CIDR range of the destination. Single IPs will be computed as /32.""" - - hostname: Optional[str] = None - """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" - - l4_protocol: Optional[Literal["tcp", "udp"]] = None - """The L4 protocol of the destination. - - When omitted, both UDP and TCP traffic will match. - """ - - port_range: Optional[str] = None - """The port range of the destination. - - Can be a single port or a range of ports. When omitted, all ports will match. - """ - - type: Optional[Literal["private"]] = None - - vnet_id: Optional[str] = None - """The VNET ID to match the destination. When omitted, all VNETs will match.""" - - -BrowserVNCApplicationDestination: TypeAlias = Union[ - BrowserVNCApplicationDestinationPublicDestination, BrowserVNCApplicationDestinationPrivateDestination -] - - class BrowserVNCApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -871,55 +615,8 @@ class BrowserVNCApplicationPolicy(ApplicationPolicy): """ -class BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - BrowserVNCApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] @@ -1137,55 +834,8 @@ class AppLauncherApplicationPolicy(ApplicationPolicy): """ -class AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - AppLauncherApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] @@ -1326,57 +976,8 @@ class DeviceEnrollmentPermissionsApplicationPolicy(ApplicationPolicy): """ -class DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - DeviceEnrollmentPermissionsApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] @@ -1517,57 +1118,8 @@ class BrowserIsolationPermissionsApplicationPolicy(ApplicationPolicy): """ -class BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - BrowserIsolationPermissionsApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] @@ -1675,55 +1227,8 @@ class BrowserIsolationPermissionsApplication(BaseModel): updated_at: Optional[datetime] = None -class BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - BookmarkApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] @@ -1871,55 +1376,8 @@ class InfrastructureApplicationPolicy(BaseModel): updated_at: Optional[datetime] = None -class InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -class InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( - BaseModel -): - client_id: str - """ - Client ID of the Access service token used to authenticate with the remote - service. - """ - - client_secret: str - """ - Client secret of the Access service token used to authenticate with the remote - service. - """ - - scheme: Literal["access_service_token"] - """The authentication scheme to use when making SCIM requests to this application.""" - - -InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, -] - InfrastructureApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, - SCIMConfigAuthenticationOAuthBearerToken, - SCIMConfigAuthenticationOauth2, - InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 ] diff --git a/src/cloudflare/types/zero_trust/access/gateway_ca_create_response.py b/src/cloudflare/types/zero_trust/access/gateway_ca_create_response.py deleted file mode 100644 index 42288b6edad..00000000000 --- a/src/cloudflare/types/zero_trust/access/gateway_ca_create_response.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ...._models import BaseModel - -__all__ = ["GatewayCACreateResponse"] - - -class GatewayCACreateResponse(BaseModel): - id: Optional[str] = None - """The key ID of this certificate.""" - - public_key: Optional[str] = None - """The public key of this certificate.""" diff --git a/src/cloudflare/types/zero_trust/access/gateway_ca_delete_response.py b/src/cloudflare/types/zero_trust/access/gateway_ca_delete_response.py deleted file mode 100644 index a30c09026e1..00000000000 --- a/src/cloudflare/types/zero_trust/access/gateway_ca_delete_response.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ...._models import BaseModel - -__all__ = ["GatewayCADeleteResponse"] - - -class GatewayCADeleteResponse(BaseModel): - id: Optional[str] = None - """UUID""" diff --git a/src/cloudflare/types/zero_trust/access/gateway_ca_list_response.py b/src/cloudflare/types/zero_trust/access/gateway_ca_list_response.py deleted file mode 100644 index 4a1ebc3f0b2..00000000000 --- a/src/cloudflare/types/zero_trust/access/gateway_ca_list_response.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ...._models import BaseModel - -__all__ = ["GatewayCAListResponse"] - - -class GatewayCAListResponse(BaseModel): - id: Optional[str] = None - """The key ID of this certificate.""" - - public_key: Optional[str] = None - """The public key of this certificate.""" diff --git a/src/cloudflare/types/zero_trust/access/infrastructure/target_list_params.py b/src/cloudflare/types/zero_trust/access/infrastructure/target_list_params.py index fb6f96ce9ad..fae2ccc7255 100644 --- a/src/cloudflare/types/zero_trust/access/infrastructure/target_list_params.py +++ b/src/cloudflare/types/zero_trust/access/infrastructure/target_list_params.py @@ -2,9 +2,9 @@ from __future__ import annotations -from typing import List, Union, Optional +from typing import Union, Optional from datetime import datetime -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ....._utils import PropertyInfo @@ -16,13 +16,7 @@ class TargetListParams(TypedDict, total=False): """Account identifier""" created_after: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] - """Date and time at which the target was created after (inclusive)""" - - created_before: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] - """Date and time at which the target was created before (inclusive)""" - - direction: Literal["asc", "desc"] - """The sorting direction.""" + """Date and time at which the target was created""" hostname: Optional[str] """Hostname of a target""" @@ -36,20 +30,8 @@ class TargetListParams(TypedDict, total=False): ip_v6: Optional[str] """IPv6 address of the target""" - ips: List[str] - """Filters for targets that have any of the following IP addresses. - - Specify `ips` multiple times in query parameter to build list of candidates. - """ - modified_after: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] - """Date and time at which the target was modified after (inclusive)""" - - modified_before: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] - """Date and time at which the target was modified before (inclusive)""" - - order: Literal["hostname", "created_at"] - """The field to sort by.""" + """Date and time at which the target was modified""" page: int """Current page in the response""" diff --git a/src/cloudflare/types/zero_trust/device_get_response.py b/src/cloudflare/types/zero_trust/device_get_response.py index 12ecc5f039a..0b11c5ec1cc 100644 --- a/src/cloudflare/types/zero_trust/device_get_response.py +++ b/src/cloudflare/types/zero_trust/device_get_response.py @@ -1,83 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional -from datetime import datetime +from typing import Union, Optional +from typing_extensions import TypeAlias -from ..._models import BaseModel +__all__ = ["DeviceGetResponse"] -__all__ = ["DeviceGetResponse", "Account", "User"] - - -class Account(BaseModel): - id: Optional[str] = None - - account_type: Optional[str] = None - - name: Optional[str] = None - """The name of the enrolled account.""" - - -class User(BaseModel): - id: Optional[str] = None - """UUID""" - - email: Optional[str] = None - """The contact email address of the user.""" - - name: Optional[str] = None - """The enrolled device user's name.""" - - -class DeviceGetResponse(BaseModel): - id: Optional[str] = None - """Device ID.""" - - account: Optional[Account] = None - - created: Optional[datetime] = None - """When the device was created.""" - - deleted: Optional[bool] = None - """True if the device was deleted.""" - - device_type: Optional[str] = None - - gateway_device_id: Optional[str] = None - - ip: Optional[str] = None - """IPv4 or IPv6 address.""" - - key: Optional[str] = None - """The device's public key.""" - - key_type: Optional[str] = None - """Type of the key.""" - - last_seen: Optional[datetime] = None - """When the device last connected to Cloudflare services.""" - - mac_address: Optional[str] = None - """The device mac address.""" - - model: Optional[str] = None - """The device model name.""" - - name: Optional[str] = None - """The device name.""" - - os_version: Optional[str] = None - """The operating system version.""" - - serial_number: Optional[str] = None - """The device serial number.""" - - tunnel_type: Optional[str] = None - """Type of the tunnel connection used.""" - - updated: Optional[datetime] = None - """When the device was updated.""" - - user: Optional[User] = None - - version: Optional[str] = None - """The WARP client version.""" +DeviceGetResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/zero_trust/devices/policies/default/certificate_edit_response.py b/src/cloudflare/types/zero_trust/devices/policies/default/certificate_edit_response.py index b74cd9b2576..0cd113c6420 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/default/certificate_edit_response.py +++ b/src/cloudflare/types/zero_trust/devices/policies/default/certificate_edit_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union +from typing import Union, Optional from typing_extensions import TypeAlias __all__ = ["CertificateEditResponse"] -CertificateEditResponse: TypeAlias = Union[str, object, None] +CertificateEditResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/zero_trust/devices/policies/default/certificate_get_response.py b/src/cloudflare/types/zero_trust/devices/policies/default/certificate_get_response.py index 47253a71db8..055be51f531 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/default/certificate_get_response.py +++ b/src/cloudflare/types/zero_trust/devices/policies/default/certificate_get_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union +from typing import Union, Optional from typing_extensions import TypeAlias __all__ = ["CertificateGetResponse"] -CertificateGetResponse: TypeAlias = Union[str, object, None] +CertificateGetResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/zero_trust/devices/posture/integration_delete_response.py b/src/cloudflare/types/zero_trust/devices/posture/integration_delete_response.py index 5ad6c5cee94..df93cf5607b 100644 --- a/src/cloudflare/types/zero_trust/devices/posture/integration_delete_response.py +++ b/src/cloudflare/types/zero_trust/devices/posture/integration_delete_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union +from typing import Union, Optional from typing_extensions import TypeAlias __all__ = ["IntegrationDeleteResponse"] -IntegrationDeleteResponse: TypeAlias = Union[str, object, None] +IntegrationDeleteResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/zero_trust/devices/revoke_create_response.py b/src/cloudflare/types/zero_trust/devices/revoke_create_response.py index 42834980772..09aceb4935f 100644 --- a/src/cloudflare/types/zero_trust/devices/revoke_create_response.py +++ b/src/cloudflare/types/zero_trust/devices/revoke_create_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union +from typing import Union, Optional from typing_extensions import TypeAlias __all__ = ["RevokeCreateResponse"] -RevokeCreateResponse: TypeAlias = Union[str, object, None] +RevokeCreateResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/zero_trust/devices/unrevoke_create_response.py b/src/cloudflare/types/zero_trust/devices/unrevoke_create_response.py index 80dd27e6b84..4b3977f4e98 100644 --- a/src/cloudflare/types/zero_trust/devices/unrevoke_create_response.py +++ b/src/cloudflare/types/zero_trust/devices/unrevoke_create_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union +from typing import Union, Optional from typing_extensions import TypeAlias __all__ = ["UnrevokeCreateResponse"] -UnrevokeCreateResponse: TypeAlias = Union[str, object, None] +UnrevokeCreateResponse: TypeAlias = Union[Optional[str], Optional[object]] diff --git a/src/cloudflare/types/zero_trust/dex/commands/__init__.py b/src/cloudflare/types/zero_trust/dex/commands/__init__.py index cf51077364d..83304891f5e 100644 --- a/src/cloudflare/types/zero_trust/dex/commands/__init__.py +++ b/src/cloudflare/types/zero_trust/dex/commands/__init__.py @@ -2,8 +2,4 @@ from __future__ import annotations -from .user_list_params import UserListParams as UserListParams -from .device_list_params import DeviceListParams as DeviceListParams from .quota_get_response import QuotaGetResponse as QuotaGetResponse -from .user_list_response import UserListResponse as UserListResponse -from .device_list_response import DeviceListResponse as DeviceListResponse diff --git a/src/cloudflare/types/zero_trust/dex/commands/device_list_params.py b/src/cloudflare/types/zero_trust/dex/commands/device_list_params.py deleted file mode 100644 index 126d1a8cb20..00000000000 --- a/src/cloudflare/types/zero_trust/dex/commands/device_list_params.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["DeviceListParams"] - - -class DeviceListParams(TypedDict, total=False): - account_id: Required[str] - - page: Required[float] - """Page number of paginated results""" - - per_page: Required[float] - """Number of items per page""" - - search: str - """Filter devices by name or email""" diff --git a/src/cloudflare/types/zero_trust/dex/commands/device_list_response.py b/src/cloudflare/types/zero_trust/dex/commands/device_list_response.py deleted file mode 100644 index 5fb1c642279..00000000000 --- a/src/cloudflare/types/zero_trust/dex/commands/device_list_response.py +++ /dev/null @@ -1,37 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ....._models import BaseModel - -__all__ = ["DeviceListResponse", "Device"] - - -class Device(BaseModel): - device_id: Optional[str] = FieldInfo(alias="deviceId", default=None) - """Device identifier (UUID v4)""" - - device_name: Optional[str] = FieldInfo(alias="deviceName", default=None) - """Device identifier (human readable)""" - - person_email: Optional[str] = FieldInfo(alias="personEmail", default=None) - """User contact email address""" - - platform: Optional[str] = None - """Operating system""" - - status: Optional[str] = None - """Network status""" - - timestamp: Optional[str] = None - """Timestamp in ISO format""" - - version: Optional[str] = None - """WARP client version""" - - -class DeviceListResponse(BaseModel): - devices: Optional[List[Device]] = None - """List of eligible devices""" diff --git a/src/cloudflare/types/zero_trust/dex/commands/user_list_params.py b/src/cloudflare/types/zero_trust/dex/commands/user_list_params.py deleted file mode 100644 index 753ca290284..00000000000 --- a/src/cloudflare/types/zero_trust/dex/commands/user_list_params.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["UserListParams"] - - -class UserListParams(TypedDict, total=False): - account_id: Required[str] - - search: str - """filter user emails by search""" diff --git a/src/cloudflare/types/zero_trust/dex/commands/user_list_response.py b/src/cloudflare/types/zero_trust/dex/commands/user_list_response.py deleted file mode 100644 index d2394cc4a99..00000000000 --- a/src/cloudflare/types/zero_trust/dex/commands/user_list_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ....._models import BaseModel - -__all__ = ["UserListResponse"] - - -class UserListResponse(BaseModel): - user_emails: Optional[List[str]] = FieldInfo(alias="userEmails", default=None) - """List of user emails""" diff --git a/src/cloudflare/types/zero_trust/dlp/dataset.py b/src/cloudflare/types/zero_trust/dlp/dataset.py index 88fe2483702..a7f2b015e78 100644 --- a/src/cloudflare/types/zero_trust/dlp/dataset.py +++ b/src/cloudflare/types/zero_trust/dlp/dataset.py @@ -45,10 +45,6 @@ class Dataset(BaseModel): status: Literal["empty", "uploading", "processing", "failed", "complete"] updated_at: datetime - """When the dataset was last updated. - - This includes name or description changes as well as uploads. - """ uploads: List[Upload] diff --git a/src/cloudflare/types/zero_trust/dlp/email/__init__.py b/src/cloudflare/types/zero_trust/dlp/email/__init__.py deleted file mode 100644 index d6f82bc8871..00000000000 --- a/src/cloudflare/types/zero_trust/dlp/email/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from .rule_get_response import RuleGetResponse as RuleGetResponse -from .rule_create_params import RuleCreateParams as RuleCreateParams -from .rule_list_response import RuleListResponse as RuleListResponse -from .rule_update_params import RuleUpdateParams as RuleUpdateParams -from .rule_create_response import RuleCreateResponse as RuleCreateResponse -from .rule_delete_response import RuleDeleteResponse as RuleDeleteResponse -from .rule_update_response import RuleUpdateResponse as RuleUpdateResponse -from .rule_bulk_edit_params import RuleBulkEditParams as RuleBulkEditParams -from .rule_bulk_edit_response import RuleBulkEditResponse as RuleBulkEditResponse -from .account_mapping_get_response import AccountMappingGetResponse as AccountMappingGetResponse -from .account_mapping_create_params import AccountMappingCreateParams as AccountMappingCreateParams -from .account_mapping_create_response import AccountMappingCreateResponse as AccountMappingCreateResponse diff --git a/src/cloudflare/types/zero_trust/dlp/email/account_mapping_create_params.py b/src/cloudflare/types/zero_trust/dlp/email/account_mapping_create_params.py deleted file mode 100644 index 0c6ebbedd48..00000000000 --- a/src/cloudflare/types/zero_trust/dlp/email/account_mapping_create_params.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Union -from typing_extensions import Literal, Required, TypeAlias, TypedDict - -__all__ = ["AccountMappingCreateParams", "AuthRequirements", "AuthRequirementsUnionMember0", "AuthRequirementsType"] - - -class AccountMappingCreateParams(TypedDict, total=False): - account_id: Required[str] - - auth_requirements: Required[AuthRequirements] - - -class AuthRequirementsUnionMember0(TypedDict, total=False): - allowed_microsoft_organizations: Required[List[str]] - - type: Required[Literal["Org"]] - - -class AuthRequirementsType(TypedDict, total=False): - type: Required[Literal["NoAuth"]] - - -AuthRequirements: TypeAlias = Union[AuthRequirementsUnionMember0, AuthRequirementsType] diff --git a/src/cloudflare/types/zero_trust/dlp/email/account_mapping_create_response.py b/src/cloudflare/types/zero_trust/dlp/email/account_mapping_create_response.py deleted file mode 100644 index 5be7c141a7d..00000000000 --- a/src/cloudflare/types/zero_trust/dlp/email/account_mapping_create_response.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union -from typing_extensions import Literal, TypeAlias - -from ....._models import BaseModel - -__all__ = ["AccountMappingCreateResponse", "AuthRequirements", "AuthRequirementsUnionMember0", "AuthRequirementsType"] - - -class AuthRequirementsUnionMember0(BaseModel): - allowed_microsoft_organizations: List[str] - - type: Literal["Org"] - - -class AuthRequirementsType(BaseModel): - type: Literal["NoAuth"] - - -AuthRequirements: TypeAlias = Union[AuthRequirementsUnionMember0, AuthRequirementsType] - - -class AccountMappingCreateResponse(BaseModel): - addin_identifier_token: str - - auth_requirements: AuthRequirements diff --git a/src/cloudflare/types/zero_trust/dlp/email/account_mapping_get_response.py b/src/cloudflare/types/zero_trust/dlp/email/account_mapping_get_response.py deleted file mode 100644 index 2b3be1a1c92..00000000000 --- a/src/cloudflare/types/zero_trust/dlp/email/account_mapping_get_response.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union -from typing_extensions import Literal, TypeAlias - -from ....._models import BaseModel - -__all__ = ["AccountMappingGetResponse", "AuthRequirements", "AuthRequirementsUnionMember0", "AuthRequirementsType"] - - -class AuthRequirementsUnionMember0(BaseModel): - allowed_microsoft_organizations: List[str] - - type: Literal["Org"] - - -class AuthRequirementsType(BaseModel): - type: Literal["NoAuth"] - - -AuthRequirements: TypeAlias = Union[AuthRequirementsUnionMember0, AuthRequirementsType] - - -class AccountMappingGetResponse(BaseModel): - addin_identifier_token: str - - auth_requirements: AuthRequirements diff --git a/src/cloudflare/types/zero_trust/dlp/email/rule_bulk_edit_params.py b/src/cloudflare/types/zero_trust/dlp/email/rule_bulk_edit_params.py deleted file mode 100644 index bd76fa7aa29..00000000000 --- a/src/cloudflare/types/zero_trust/dlp/email/rule_bulk_edit_params.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict -from typing_extensions import Required, TypedDict - -__all__ = ["RuleBulkEditParams"] - - -class RuleBulkEditParams(TypedDict, total=False): - account_id: Required[str] - - new_priorities: Required[Dict[str, int]] diff --git a/src/cloudflare/types/zero_trust/dlp/email/rule_bulk_edit_response.py b/src/cloudflare/types/zero_trust/dlp/email/rule_bulk_edit_response.py deleted file mode 100644 index 55a9db93b90..00000000000 --- a/src/cloudflare/types/zero_trust/dlp/email/rule_bulk_edit_response.py +++ /dev/null @@ -1,44 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from datetime import datetime -from typing_extensions import Literal - -from ....._models import BaseModel - -__all__ = ["RuleBulkEditResponse", "Action", "Condition"] - - -class Action(BaseModel): - action: Literal["Block"] - - message: Optional[str] = None - - -class Condition(BaseModel): - operator: Literal["InList", "NotInList", "MatchRegex", "NotMatchRegex"] - - selector: Literal["Recipients", "Sender", "DLPProfiles"] - - value: object - - -class RuleBulkEditResponse(BaseModel): - action: Action - - conditions: List[Condition] - """Rule is triggered if all conditions match""" - - created_at: datetime - - enabled: bool - - name: str - - priority: int - - rule_id: str - - updated_at: datetime - - description: Optional[str] = None diff --git a/src/cloudflare/types/zero_trust/dlp/email/rule_create_params.py b/src/cloudflare/types/zero_trust/dlp/email/rule_create_params.py deleted file mode 100644 index 8d1bf0f8cd2..00000000000 --- a/src/cloudflare/types/zero_trust/dlp/email/rule_create_params.py +++ /dev/null @@ -1,37 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable, Optional -from typing_extensions import Literal, Required, TypedDict - -__all__ = ["RuleCreateParams", "Action", "Condition"] - - -class RuleCreateParams(TypedDict, total=False): - account_id: Required[str] - - action: Required[Action] - - conditions: Required[Iterable[Condition]] - """Rule is triggered if all conditions match""" - - enabled: Required[bool] - - name: Required[str] - - description: Optional[str] - - -class Action(TypedDict, total=False): - action: Required[Literal["Block"]] - - message: Optional[str] - - -class Condition(TypedDict, total=False): - operator: Required[Literal["InList", "NotInList", "MatchRegex", "NotMatchRegex"]] - - selector: Required[Literal["Recipients", "Sender", "DLPProfiles"]] - - value: Required[object] diff --git a/src/cloudflare/types/zero_trust/dlp/email/rule_create_response.py b/src/cloudflare/types/zero_trust/dlp/email/rule_create_response.py deleted file mode 100644 index 7077679dc93..00000000000 --- a/src/cloudflare/types/zero_trust/dlp/email/rule_create_response.py +++ /dev/null @@ -1,44 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from datetime import datetime -from typing_extensions import Literal - -from ....._models import BaseModel - -__all__ = ["RuleCreateResponse", "Action", "Condition"] - - -class Action(BaseModel): - action: Literal["Block"] - - message: Optional[str] = None - - -class Condition(BaseModel): - operator: Literal["InList", "NotInList", "MatchRegex", "NotMatchRegex"] - - selector: Literal["Recipients", "Sender", "DLPProfiles"] - - value: object - - -class RuleCreateResponse(BaseModel): - action: Action - - conditions: List[Condition] - """Rule is triggered if all conditions match""" - - created_at: datetime - - enabled: bool - - name: str - - priority: int - - rule_id: str - - updated_at: datetime - - description: Optional[str] = None diff --git a/src/cloudflare/types/zero_trust/dlp/email/rule_delete_response.py b/src/cloudflare/types/zero_trust/dlp/email/rule_delete_response.py deleted file mode 100644 index b67309d5e8a..00000000000 --- a/src/cloudflare/types/zero_trust/dlp/email/rule_delete_response.py +++ /dev/null @@ -1,44 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from datetime import datetime -from typing_extensions import Literal - -from ....._models import BaseModel - -__all__ = ["RuleDeleteResponse", "Action", "Condition"] - - -class Action(BaseModel): - action: Literal["Block"] - - message: Optional[str] = None - - -class Condition(BaseModel): - operator: Literal["InList", "NotInList", "MatchRegex", "NotMatchRegex"] - - selector: Literal["Recipients", "Sender", "DLPProfiles"] - - value: object - - -class RuleDeleteResponse(BaseModel): - action: Action - - conditions: List[Condition] - """Rule is triggered if all conditions match""" - - created_at: datetime - - enabled: bool - - name: str - - priority: int - - rule_id: str - - updated_at: datetime - - description: Optional[str] = None diff --git a/src/cloudflare/types/zero_trust/dlp/email/rule_get_response.py b/src/cloudflare/types/zero_trust/dlp/email/rule_get_response.py deleted file mode 100644 index 75681ab045e..00000000000 --- a/src/cloudflare/types/zero_trust/dlp/email/rule_get_response.py +++ /dev/null @@ -1,44 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from datetime import datetime -from typing_extensions import Literal - -from ....._models import BaseModel - -__all__ = ["RuleGetResponse", "Action", "Condition"] - - -class Action(BaseModel): - action: Literal["Block"] - - message: Optional[str] = None - - -class Condition(BaseModel): - operator: Literal["InList", "NotInList", "MatchRegex", "NotMatchRegex"] - - selector: Literal["Recipients", "Sender", "DLPProfiles"] - - value: object - - -class RuleGetResponse(BaseModel): - action: Action - - conditions: List[Condition] - """Rule is triggered if all conditions match""" - - created_at: datetime - - enabled: bool - - name: str - - priority: int - - rule_id: str - - updated_at: datetime - - description: Optional[str] = None diff --git a/src/cloudflare/types/zero_trust/dlp/email/rule_list_response.py b/src/cloudflare/types/zero_trust/dlp/email/rule_list_response.py deleted file mode 100644 index 0e5913db430..00000000000 --- a/src/cloudflare/types/zero_trust/dlp/email/rule_list_response.py +++ /dev/null @@ -1,44 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from datetime import datetime -from typing_extensions import Literal - -from ....._models import BaseModel - -__all__ = ["RuleListResponse", "Action", "Condition"] - - -class Action(BaseModel): - action: Literal["Block"] - - message: Optional[str] = None - - -class Condition(BaseModel): - operator: Literal["InList", "NotInList", "MatchRegex", "NotMatchRegex"] - - selector: Literal["Recipients", "Sender", "DLPProfiles"] - - value: object - - -class RuleListResponse(BaseModel): - action: Action - - conditions: List[Condition] - """Rule is triggered if all conditions match""" - - created_at: datetime - - enabled: bool - - name: str - - priority: int - - rule_id: str - - updated_at: datetime - - description: Optional[str] = None diff --git a/src/cloudflare/types/zero_trust/dlp/email/rule_update_params.py b/src/cloudflare/types/zero_trust/dlp/email/rule_update_params.py deleted file mode 100644 index 1bf1e76cf2f..00000000000 --- a/src/cloudflare/types/zero_trust/dlp/email/rule_update_params.py +++ /dev/null @@ -1,37 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable, Optional -from typing_extensions import Literal, Required, TypedDict - -__all__ = ["RuleUpdateParams", "Action", "Condition"] - - -class RuleUpdateParams(TypedDict, total=False): - account_id: Required[str] - - action: Required[Action] - - conditions: Required[Iterable[Condition]] - """Rule is triggered if all conditions match""" - - enabled: Required[bool] - - name: Required[str] - - description: Optional[str] - - -class Action(TypedDict, total=False): - action: Required[Literal["Block"]] - - message: Optional[str] - - -class Condition(TypedDict, total=False): - operator: Required[Literal["InList", "NotInList", "MatchRegex", "NotMatchRegex"]] - - selector: Required[Literal["Recipients", "Sender", "DLPProfiles"]] - - value: Required[object] diff --git a/src/cloudflare/types/zero_trust/dlp/email/rule_update_response.py b/src/cloudflare/types/zero_trust/dlp/email/rule_update_response.py deleted file mode 100644 index c1e9f32703d..00000000000 --- a/src/cloudflare/types/zero_trust/dlp/email/rule_update_response.py +++ /dev/null @@ -1,44 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from datetime import datetime -from typing_extensions import Literal - -from ....._models import BaseModel - -__all__ = ["RuleUpdateResponse", "Action", "Condition"] - - -class Action(BaseModel): - action: Literal["Block"] - - message: Optional[str] = None - - -class Condition(BaseModel): - operator: Literal["InList", "NotInList", "MatchRegex", "NotMatchRegex"] - - selector: Literal["Recipients", "Sender", "DLPProfiles"] - - value: object - - -class RuleUpdateResponse(BaseModel): - action: Action - - conditions: List[Condition] - """Rule is triggered if all conditions match""" - - created_at: datetime - - enabled: bool - - name: str - - priority: int - - rule_id: str - - updated_at: datetime - - description: Optional[str] = None diff --git a/src/cloudflare/types/zero_trust/gateway/configuration_edit_params.py b/src/cloudflare/types/zero_trust/gateway/configuration_edit_params.py index e2a203f8dd8..9adb3f5ae01 100644 --- a/src/cloudflare/types/zero_trust/gateway/configuration_edit_params.py +++ b/src/cloudflare/types/zero_trust/gateway/configuration_edit_params.py @@ -13,4 +13,4 @@ class ConfigurationEditParams(TypedDict, total=False): account_id: Required[str] settings: GatewayConfigurationSettingsParam - """Account settings""" + """account settings.""" diff --git a/src/cloudflare/types/zero_trust/gateway/configuration_edit_response.py b/src/cloudflare/types/zero_trust/gateway/configuration_edit_response.py index 13a39732b9b..e7659cf264e 100644 --- a/src/cloudflare/types/zero_trust/gateway/configuration_edit_response.py +++ b/src/cloudflare/types/zero_trust/gateway/configuration_edit_response.py @@ -13,6 +13,6 @@ class ConfigurationEditResponse(BaseModel): created_at: Optional[datetime] = None settings: Optional[GatewayConfigurationSettings] = None - """Account settings""" + """account settings.""" updated_at: Optional[datetime] = None diff --git a/src/cloudflare/types/zero_trust/gateway/configuration_get_response.py b/src/cloudflare/types/zero_trust/gateway/configuration_get_response.py index 63636f9ea17..ab5d764c721 100644 --- a/src/cloudflare/types/zero_trust/gateway/configuration_get_response.py +++ b/src/cloudflare/types/zero_trust/gateway/configuration_get_response.py @@ -13,6 +13,6 @@ class ConfigurationGetResponse(BaseModel): created_at: Optional[datetime] = None settings: Optional[GatewayConfigurationSettings] = None - """Account settings""" + """account settings.""" updated_at: Optional[datetime] = None diff --git a/src/cloudflare/types/zero_trust/gateway/configuration_update_params.py b/src/cloudflare/types/zero_trust/gateway/configuration_update_params.py index 8dc9dece583..7fcc1d00377 100644 --- a/src/cloudflare/types/zero_trust/gateway/configuration_update_params.py +++ b/src/cloudflare/types/zero_trust/gateway/configuration_update_params.py @@ -13,4 +13,4 @@ class ConfigurationUpdateParams(TypedDict, total=False): account_id: Required[str] settings: GatewayConfigurationSettingsParam - """Account settings""" + """account settings.""" diff --git a/src/cloudflare/types/zero_trust/gateway/configuration_update_response.py b/src/cloudflare/types/zero_trust/gateway/configuration_update_response.py index 17c9c505bf3..f88c116ea7e 100644 --- a/src/cloudflare/types/zero_trust/gateway/configuration_update_response.py +++ b/src/cloudflare/types/zero_trust/gateway/configuration_update_response.py @@ -13,6 +13,6 @@ class ConfigurationUpdateResponse(BaseModel): created_at: Optional[datetime] = None settings: Optional[GatewayConfigurationSettings] = None - """Account settings""" + """account settings.""" updated_at: Optional[datetime] = None diff --git a/src/cloudflare/types/zero_trust/gateway/gateway_rule.py b/src/cloudflare/types/zero_trust/gateway/gateway_rule.py index ba61ea684bd..0f312358eea 100644 --- a/src/cloudflare/types/zero_trust/gateway/gateway_rule.py +++ b/src/cloudflare/types/zero_trust/gateway/gateway_rule.py @@ -117,6 +117,3 @@ class GatewayRule(BaseModel): """The wirefilter expression used for traffic matching.""" updated_at: Optional[datetime] = None - - version: Optional[int] = None - """version number of the rule""" diff --git a/src/cloudflare/types/zero_trust/gateway/list_update_params.py b/src/cloudflare/types/zero_trust/gateway/list_update_params.py index d02a3f2a256..0177452d00e 100644 --- a/src/cloudflare/types/zero_trust/gateway/list_update_params.py +++ b/src/cloudflare/types/zero_trust/gateway/list_update_params.py @@ -2,11 +2,8 @@ from __future__ import annotations -from typing import Iterable from typing_extensions import Required, TypedDict -from .gateway_item_param import GatewayItemParam - __all__ = ["ListUpdateParams"] @@ -18,6 +15,3 @@ class ListUpdateParams(TypedDict, total=False): description: str """The description of the list.""" - - items: Iterable[GatewayItemParam] - """The items in the list.""" diff --git a/src/cloudflare/types/zero_trust/gateway/location.py b/src/cloudflare/types/zero_trust/gateway/location.py index a5755c64010..b13ca136603 100644 --- a/src/cloudflare/types/zero_trust/gateway/location.py +++ b/src/cloudflare/types/zero_trust/gateway/location.py @@ -25,13 +25,6 @@ class Location(BaseModel): dns_destination_ips_id: Optional[str] = None """The identifier of the pair of IPv4 addresses assigned to this location.""" - dns_destination_ipv6_block_id: Optional[str] = None - """ - The uuid identifier of the IPv6 block brought to the gateway, so that this - location's IPv6 address is allocated from the Bring Your Own Ipv6(BYOIPv6) block - and not from the standard CloudFlare IPv6 block. - """ - doh_subdomain: Optional[str] = None """The DNS over HTTPS domain to send DNS requests to. diff --git a/src/cloudflare/types/zero_trust/gateway/rule_setting.py b/src/cloudflare/types/zero_trust/gateway/rule_setting.py index 3d73a0b442c..60b6eff04c4 100644 --- a/src/cloudflare/types/zero_trust/gateway/rule_setting.py +++ b/src/cloudflare/types/zero_trust/gateway/rule_setting.py @@ -18,7 +18,6 @@ "NotificationSettings", "PayloadLog", "Quarantine", - "ResolveDNSInternally", "UntrustedCERT", ] @@ -108,18 +107,6 @@ class Quarantine(BaseModel): """Types of files to sandbox.""" -class ResolveDNSInternally(BaseModel): - fallback: Optional[Literal["none", "public_dns"]] = None - """ - The fallback behavior to apply when the internal DNS response code is different - from 'NOERROR' or when the response data only contains CNAME records for 'A' or - 'AAAA' queries. - """ - - view_id: Optional[str] = None - """The internal DNS view identifier that's passed to the internal DNS service.""" - - class UntrustedCERT(BaseModel): action: Optional[Literal["pass_through", "block", "error"]] = None """The action performed when an untrusted certificate is seen. @@ -162,9 +149,9 @@ class RuleSetting(BaseModel): dns_resolvers: Optional[DNSResolvers] = None """Add your own custom resolvers to route queries that match the resolver policy. - Cannot be used when 'resolve_dns_through_cloudflare' or 'resolve_dns_internally' - are set. DNS queries will route to the address closest to their origin. Only - valid when a rule's action is set to 'resolve'. + Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will + route to the address closest to their origin. Only valid when a rule's action is + set to 'resolve'. """ egress: Optional[Egress] = None @@ -217,20 +204,11 @@ class RuleSetting(BaseModel): quarantine: Optional[Quarantine] = None """Settings that apply to quarantine rules""" - resolve_dns_internally: Optional[ResolveDNSInternally] = None - """ - Configure to forward the query to the internal DNS service, passing the - specified 'view_id' as input. Cannot be set when 'dns_resolvers' are specified - or 'resolve_dns_through_cloudflare' is set. Only valid when a rule's action is - set to 'resolve'. - """ - resolve_dns_through_cloudflare: Optional[bool] = None """ Enable to send queries that match the policy to Cloudflare's default 1.1.1.1 DNS - resolver. Cannot be set when 'dns_resolvers' are specified or - 'resolve_dns_internally' is set. Only valid when a rule's action is set to - 'resolve'. + resolver. Cannot be set when dns_resolvers are specified. Only valid when a + rule's action is set to 'resolve'. """ untrusted_cert: Optional[UntrustedCERT] = None diff --git a/src/cloudflare/types/zero_trust/gateway/rule_setting_param.py b/src/cloudflare/types/zero_trust/gateway/rule_setting_param.py index 6f3884920e2..11da19fb61f 100644 --- a/src/cloudflare/types/zero_trust/gateway/rule_setting_param.py +++ b/src/cloudflare/types/zero_trust/gateway/rule_setting_param.py @@ -19,7 +19,6 @@ "NotificationSettings", "PayloadLog", "Quarantine", - "ResolveDNSInternally", "UntrustedCERT", ] @@ -109,18 +108,6 @@ class Quarantine(TypedDict, total=False): """Types of files to sandbox.""" -class ResolveDNSInternally(TypedDict, total=False): - fallback: Literal["none", "public_dns"] - """ - The fallback behavior to apply when the internal DNS response code is different - from 'NOERROR' or when the response data only contains CNAME records for 'A' or - 'AAAA' queries. - """ - - view_id: str - """The internal DNS view identifier that's passed to the internal DNS service.""" - - class UntrustedCERT(TypedDict, total=False): action: Literal["pass_through", "block", "error"] """The action performed when an untrusted certificate is seen. @@ -163,9 +150,9 @@ class RuleSettingParam(TypedDict, total=False): dns_resolvers: DNSResolvers """Add your own custom resolvers to route queries that match the resolver policy. - Cannot be used when 'resolve_dns_through_cloudflare' or 'resolve_dns_internally' - are set. DNS queries will route to the address closest to their origin. Only - valid when a rule's action is set to 'resolve'. + Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will + route to the address closest to their origin. Only valid when a rule's action is + set to 'resolve'. """ egress: Egress @@ -218,20 +205,11 @@ class RuleSettingParam(TypedDict, total=False): quarantine: Quarantine """Settings that apply to quarantine rules""" - resolve_dns_internally: ResolveDNSInternally - """ - Configure to forward the query to the internal DNS service, passing the - specified 'view_id' as input. Cannot be set when 'dns_resolvers' are specified - or 'resolve_dns_through_cloudflare' is set. Only valid when a rule's action is - set to 'resolve'. - """ - resolve_dns_through_cloudflare: bool """ Enable to send queries that match the policy to Cloudflare's default 1.1.1.1 DNS - resolver. Cannot be set when 'dns_resolvers' are specified or - 'resolve_dns_internally' is set. Only valid when a rule's action is set to - 'resolve'. + resolver. Cannot be set when dns_resolvers are specified. Only valid when a + rule's action is set to 'resolve'. """ untrusted_cert: UntrustedCERT diff --git a/src/cloudflare/types/zero_trust/identity_provider_scim_config.py b/src/cloudflare/types/zero_trust/identity_provider_scim_config.py index aa4b9fecffe..3f664fe6216 100644 --- a/src/cloudflare/types/zero_trust/identity_provider_scim_config.py +++ b/src/cloudflare/types/zero_trust/identity_provider_scim_config.py @@ -23,9 +23,6 @@ class IdentityProviderSCIMConfig(BaseModel): updates in any way and users will not be prompted to reauthenticate. """ - scim_base_url: Optional[str] = None - """The base URL of Cloudflare's SCIM V2.0 API endpoint.""" - seat_deprovision: Optional[bool] = None """ A flag to remove a user's seat in Zero Trust when they have been deprovisioned @@ -37,7 +34,7 @@ class IdentityProviderSCIMConfig(BaseModel): """ A read-only token generated when the SCIM integration is enabled for the first time. It is redacted on subsequent requests. If you lose this you will need to - refresh it at /access/identity_providers/:idpID/refresh_scim_secret. + refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. """ user_deprovision: Optional[bool] = None diff --git a/src/cloudflare/types/zero_trust/organizations/doh_get_response.py b/src/cloudflare/types/zero_trust/organizations/doh_get_response.py index adb3be9867c..45cb3c7a793 100644 --- a/src/cloudflare/types/zero_trust/organizations/doh_get_response.py +++ b/src/cloudflare/types/zero_trust/organizations/doh_get_response.py @@ -20,14 +20,6 @@ class DOHGetResponse(BaseModel): created_at: Optional[datetime] = None - doh_jwt_duration: Optional[str] = None - """The duration the DoH JWT is valid for. - - Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), - ms, s, m, h. Note that the maximum duration for this setting is the same as the - key rotation period on the account. - """ - duration: Optional[str] = None """The duration for how long the service token will be valid. @@ -37,6 +29,14 @@ class DOHGetResponse(BaseModel): expires_at: Optional[datetime] = None + jwt_duration: Optional[str] = None + """The duration the DoH JWT is valid for. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. Note that the maximum duration for this setting is the same as the + key rotation period on the account. + """ + name: Optional[str] = None """The name of the service token.""" diff --git a/src/cloudflare/types/zero_trust/organizations/doh_update_params.py b/src/cloudflare/types/zero_trust/organizations/doh_update_params.py index 2392abf7fe0..46ff3ae5df6 100644 --- a/src/cloudflare/types/zero_trust/organizations/doh_update_params.py +++ b/src/cloudflare/types/zero_trust/organizations/doh_update_params.py @@ -11,7 +11,7 @@ class DOHUpdateParams(TypedDict, total=False): account_id: Required[str] """Identifier""" - doh_jwt_duration: str + jwt_duration: str """The duration the DoH JWT is valid for. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), diff --git a/src/cloudflare/types/zero_trust/organizations/doh_update_response.py b/src/cloudflare/types/zero_trust/organizations/doh_update_response.py index 128469eebb3..4a9196368f9 100644 --- a/src/cloudflare/types/zero_trust/organizations/doh_update_response.py +++ b/src/cloudflare/types/zero_trust/organizations/doh_update_response.py @@ -20,14 +20,6 @@ class DOHUpdateResponse(BaseModel): created_at: Optional[datetime] = None - doh_jwt_duration: Optional[str] = None - """The duration the DoH JWT is valid for. - - Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), - ms, s, m, h. Note that the maximum duration for this setting is the same as the - key rotation period on the account. Default expiration is 24h - """ - duration: Optional[str] = None """The duration for how long the service token will be valid. @@ -37,6 +29,14 @@ class DOHUpdateResponse(BaseModel): expires_at: Optional[datetime] = None + jwt_duration: Optional[str] = None + """The duration the DoH JWT is valid for. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. Note that the maximum duration for this setting is the same as the + key rotation period on the account. Default expiration is 24h + """ + name: Optional[str] = None """The name of the service token.""" diff --git a/src/cloudflare/types/zones/__init__.py b/src/cloudflare/types/zones/__init__.py index 5b7501b8935..f82d8f8e328 100644 --- a/src/cloudflare/types/zones/__init__.py +++ b/src/cloudflare/types/zones/__init__.py @@ -49,7 +49,6 @@ from .websocket_param import WebsocketParam as WebsocketParam from .always_use_https import AlwaysUseHTTPS as AlwaysUseHTTPS from .development_mode import DevelopmentMode as DevelopmentMode -from .hold_edit_params import HoldEditParams as HoldEditParams from .orange_to_orange import OrangeToOrange as OrangeToOrange from .prefetch_preload import PrefetchPreload as PrefetchPreload from .security_headers import SecurityHeaders as SecurityHeaders @@ -95,6 +94,7 @@ from .browser_cache_ttl_param import BrowserCacheTTLParam as BrowserCacheTTLParam from .email_obfuscation_param import EmailObfuscationParam as EmailObfuscationParam from .h2_prioritization_param import H2PrioritizationParam as H2PrioritizationParam +from .origin_max_http_version import OriginMaxHTTPVersion as OriginMaxHTTPVersion from .automatic_https_rewrites import AutomaticHTTPSRewrites as AutomaticHTTPSRewrites from .hotlink_protection_param import HotlinkProtectionParam as HotlinkProtectionParam from .opportunistic_encryption import OpportunisticEncryption as OpportunisticEncryption diff --git a/src/cloudflare/types/zones/hold_edit_params.py b/src/cloudflare/types/zones/hold_edit_params.py deleted file mode 100644 index fc5e878576f..00000000000 --- a/src/cloudflare/types/zones/hold_edit_params.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["HoldEditParams"] - - -class HoldEditParams(TypedDict, total=False): - zone_id: Required[str] - """Identifier""" - - hold_after: str - """ - If `hold_after` is provided and future-dated, the hold will be temporarily - disabled, then automatically re-enabled by the system at the time specified in - this RFC3339-formatted timestamp. A past-dated `hold_after` value will have no - effect on an existing, enabled hold. Providing an empty string will set its - value to the current time. - """ - - include_subdomains: bool - """ - If `true`, the zone hold will extend to block any subdomain of the given zone, - as well as SSL4SaaS Custom Hostnames. For example, a zone hold on a zone with - the hostname 'example.com' and include_subdomains=true will block 'example.com', - 'staging.example.com', 'api.staging.example.com', etc. - """ diff --git a/src/cloudflare/types/zones/origin_max_http_version.py b/src/cloudflare/types/zones/origin_max_http_version.py new file mode 100644 index 00000000000..4572b289282 --- /dev/null +++ b/src/cloudflare/types/zones/origin_max_http_version.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["OriginMaxHTTPVersion"] + +OriginMaxHTTPVersion: TypeAlias = Literal["origin_max_http_version"] diff --git a/tests/api_resources/accounts/logs/test_audit.py b/tests/api_resources/accounts/logs/test_audit.py deleted file mode 100644 index 0c9faafda0e..00000000000 --- a/tests/api_resources/accounts/logs/test_audit.py +++ /dev/null @@ -1,192 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare._utils import parse_date -from cloudflare.pagination import SyncCursorLimitPagination, AsyncCursorLimitPagination -from cloudflare.types.accounts.logs import AuditListResponse - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestAudit: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip(reason="TODO:investigate broken test") - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - audit = client.accounts.logs.audit.list( - account_id="a67e14daa5f8dceeb91fe5449ba496ef", - before=parse_date("2024-10-31"), - since=parse_date("2024-10-30"), - ) - assert_matches_type(SyncCursorLimitPagination[AuditListResponse], audit, path=["response"]) - - @pytest.mark.skip(reason="TODO:investigate broken test") - @parametrize - def test_method_list_with_all_params(self, client: Cloudflare) -> None: - audit = client.accounts.logs.audit.list( - account_id="a67e14daa5f8dceeb91fe5449ba496ef", - before=parse_date("2024-10-31"), - since=parse_date("2024-10-30"), - account_name="account_name", - action_result="success", - action_type="create", - actor_context="api_key", - actor_email="alice@example.com", - actor_id="1d20c3afe174f18b642710cec6298a9d", - actor_ip_address="17.168.228.63", - actor_token_id="144cdb2e39c55e203cf225d8d8208647", - actor_token_name="Test Token", - actor_type="cloudflare_admin", - audit_log_id="f174be97-19b1-40d6-954d-70cd5fbd52db", - cursor="Q1buH-__DQqqig7SVYXT-SsMOTGY2Z3Y80W-fGgva7yaDdmPKveucH5ddOcHsJRhNb-xUK8agZQqkJSMAENGO8NU6g==", - direction="desc", - limit=25, - raw_cf_rayid="8e8dd2156ef28414", - raw_method="GET", - raw_status_code=200, - raw_uri="raw_uri", - resource_id="resource_id", - resource_product="Stream", - resource_scope="accounts", - resource_type="Video", - zone_id="zone_id", - zone_name="example.com", - ) - assert_matches_type(SyncCursorLimitPagination[AuditListResponse], audit, path=["response"]) - - @pytest.mark.skip(reason="TODO:investigate broken test") - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.accounts.logs.audit.with_raw_response.list( - account_id="a67e14daa5f8dceeb91fe5449ba496ef", - before=parse_date("2024-10-31"), - since=parse_date("2024-10-30"), - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - audit = response.parse() - assert_matches_type(SyncCursorLimitPagination[AuditListResponse], audit, path=["response"]) - - @pytest.mark.skip(reason="TODO:investigate broken test") - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.accounts.logs.audit.with_streaming_response.list( - account_id="a67e14daa5f8dceeb91fe5449ba496ef", - before=parse_date("2024-10-31"), - since=parse_date("2024-10-30"), - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - audit = response.parse() - assert_matches_type(SyncCursorLimitPagination[AuditListResponse], audit, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip(reason="TODO:investigate broken test") - @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.accounts.logs.audit.with_raw_response.list( - account_id="", - before=parse_date("2024-10-31"), - since=parse_date("2024-10-30"), - ) - - -class TestAsyncAudit: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip(reason="TODO:investigate broken test") - @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - audit = await async_client.accounts.logs.audit.list( - account_id="a67e14daa5f8dceeb91fe5449ba496ef", - before=parse_date("2024-10-31"), - since=parse_date("2024-10-30"), - ) - assert_matches_type(AsyncCursorLimitPagination[AuditListResponse], audit, path=["response"]) - - @pytest.mark.skip(reason="TODO:investigate broken test") - @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: - audit = await async_client.accounts.logs.audit.list( - account_id="a67e14daa5f8dceeb91fe5449ba496ef", - before=parse_date("2024-10-31"), - since=parse_date("2024-10-30"), - account_name="account_name", - action_result="success", - action_type="create", - actor_context="api_key", - actor_email="alice@example.com", - actor_id="1d20c3afe174f18b642710cec6298a9d", - actor_ip_address="17.168.228.63", - actor_token_id="144cdb2e39c55e203cf225d8d8208647", - actor_token_name="Test Token", - actor_type="cloudflare_admin", - audit_log_id="f174be97-19b1-40d6-954d-70cd5fbd52db", - cursor="Q1buH-__DQqqig7SVYXT-SsMOTGY2Z3Y80W-fGgva7yaDdmPKveucH5ddOcHsJRhNb-xUK8agZQqkJSMAENGO8NU6g==", - direction="desc", - limit=25, - raw_cf_rayid="8e8dd2156ef28414", - raw_method="GET", - raw_status_code=200, - raw_uri="raw_uri", - resource_id="resource_id", - resource_product="Stream", - resource_scope="accounts", - resource_type="Video", - zone_id="zone_id", - zone_name="example.com", - ) - assert_matches_type(AsyncCursorLimitPagination[AuditListResponse], audit, path=["response"]) - - @pytest.mark.skip(reason="TODO:investigate broken test") - @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.accounts.logs.audit.with_raw_response.list( - account_id="a67e14daa5f8dceeb91fe5449ba496ef", - before=parse_date("2024-10-31"), - since=parse_date("2024-10-30"), - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - audit = await response.parse() - assert_matches_type(AsyncCursorLimitPagination[AuditListResponse], audit, path=["response"]) - - @pytest.mark.skip(reason="TODO:investigate broken test") - @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.accounts.logs.audit.with_streaming_response.list( - account_id="a67e14daa5f8dceeb91fe5449ba496ef", - before=parse_date("2024-10-31"), - since=parse_date("2024-10-30"), - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - audit = await response.parse() - assert_matches_type(AsyncCursorLimitPagination[AuditListResponse], audit, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip(reason="TODO:investigate broken test") - @parametrize - async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.accounts.logs.audit.with_raw_response.list( - account_id="", - before=parse_date("2024-10-31"), - since=parse_date("2024-10-30"), - ) diff --git a/tests/api_resources/accounts/test_tokens.py b/tests/api_resources/accounts/test_tokens.py index dc10d79e1de..e0b183d7188 100644 --- a/tests/api_resources/accounts/test_tokens.py +++ b/tests/api_resources/accounts/test_tokens.py @@ -34,10 +34,7 @@ def test_method_create(self, client: Cloudflare) -> None: { "effect": "allow", "permission_groups": [{}, {}], - "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }, + "resources": {}, } ], ) @@ -67,8 +64,8 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: }, ], "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + "resource": "resource", + "scope": "scope", }, } ], @@ -93,10 +90,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: { "effect": "allow", "permission_groups": [{}, {}], - "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }, + "resources": {}, } ], ) @@ -116,10 +110,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: { "effect": "allow", "permission_groups": [{}, {}], - "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }, + "resources": {}, } ], ) as response: @@ -142,10 +133,7 @@ def test_path_params_create(self, client: Cloudflare) -> None: { "effect": "allow", "permission_groups": [{}, {}], - "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }, + "resources": {}, } ], ) @@ -192,8 +180,8 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: }, ], "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + "resource": "resource", + "scope": "scope", }, } ], @@ -457,10 +445,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: { "effect": "allow", "permission_groups": [{}, {}], - "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }, + "resources": {}, } ], ) @@ -490,8 +475,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare }, ], "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + "resource": "resource", + "scope": "scope", }, } ], @@ -516,10 +501,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: { "effect": "allow", "permission_groups": [{}, {}], - "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }, + "resources": {}, } ], ) @@ -539,10 +521,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> { "effect": "allow", "permission_groups": [{}, {}], - "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }, + "resources": {}, } ], ) as response: @@ -565,10 +544,7 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: { "effect": "allow", "permission_groups": [{}, {}], - "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }, + "resources": {}, } ], ) @@ -615,8 +591,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare }, ], "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + "resource": "resource", + "scope": "scope", }, } ], diff --git a/tests/api_resources/addressing/address_maps/test_accounts.py b/tests/api_resources/addressing/address_maps/test_accounts.py index 3bb5dc17626..b84e7ea91ed 100644 --- a/tests/api_resources/addressing/address_maps/test_accounts.py +++ b/tests/api_resources/addressing/address_maps/test_accounts.py @@ -20,8 +20,8 @@ class TestAccounts: @parametrize def test_method_update(self, client: Cloudflare) -> None: account = client.addressing.address_maps.accounts.update( - address_map_id="055817b111884e0227e1be16a0be6ee0", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) assert_matches_type(AccountUpdateResponse, account, path=["response"]) @@ -29,8 +29,8 @@ def test_method_update(self, client: Cloudflare) -> None: @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: response = client.addressing.address_maps.accounts.with_raw_response.update( - address_map_id="055817b111884e0227e1be16a0be6ee0", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) @@ -42,8 +42,8 @@ def test_raw_response_update(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: with client.addressing.address_maps.accounts.with_streaming_response.update( - address_map_id="055817b111884e0227e1be16a0be6ee0", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) as response: assert not response.is_closed @@ -58,7 +58,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.addressing.address_maps.accounts.with_raw_response.update( - address_map_id="055817b111884e0227e1be16a0be6ee0", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", body={}, ) @@ -66,23 +66,23 @@ def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): client.addressing.address_maps.accounts.with_raw_response.update( address_map_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) @parametrize def test_method_delete(self, client: Cloudflare) -> None: account = client.addressing.address_maps.accounts.delete( - address_map_id="055817b111884e0227e1be16a0be6ee0", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(AccountDeleteResponse, account, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: response = client.addressing.address_maps.accounts.with_raw_response.delete( - address_map_id="055817b111884e0227e1be16a0be6ee0", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -93,8 +93,8 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: with client.addressing.address_maps.accounts.with_streaming_response.delete( - address_map_id="055817b111884e0227e1be16a0be6ee0", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -108,14 +108,14 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: def test_path_params_delete(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.addressing.address_maps.accounts.with_raw_response.delete( - address_map_id="055817b111884e0227e1be16a0be6ee0", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): client.addressing.address_maps.accounts.with_raw_response.delete( address_map_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -125,8 +125,8 @@ class TestAsyncAccounts: @parametrize async def test_method_update(self, async_client: AsyncCloudflare) -> None: account = await async_client.addressing.address_maps.accounts.update( - address_map_id="055817b111884e0227e1be16a0be6ee0", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) assert_matches_type(AccountUpdateResponse, account, path=["response"]) @@ -134,8 +134,8 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.address_maps.accounts.with_raw_response.update( - address_map_id="055817b111884e0227e1be16a0be6ee0", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) @@ -147,8 +147,8 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.address_maps.accounts.with_streaming_response.update( - address_map_id="055817b111884e0227e1be16a0be6ee0", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) as response: assert not response.is_closed @@ -163,7 +163,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.addressing.address_maps.accounts.with_raw_response.update( - address_map_id="055817b111884e0227e1be16a0be6ee0", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", body={}, ) @@ -171,23 +171,23 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): await async_client.addressing.address_maps.accounts.with_raw_response.update( address_map_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) @parametrize async def test_method_delete(self, async_client: AsyncCloudflare) -> None: account = await async_client.addressing.address_maps.accounts.delete( - address_map_id="055817b111884e0227e1be16a0be6ee0", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(AccountDeleteResponse, account, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.address_maps.accounts.with_raw_response.delete( - address_map_id="055817b111884e0227e1be16a0be6ee0", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -198,8 +198,8 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.address_maps.accounts.with_streaming_response.delete( - address_map_id="055817b111884e0227e1be16a0be6ee0", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -213,12 +213,12 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.addressing.address_maps.accounts.with_raw_response.delete( - address_map_id="055817b111884e0227e1be16a0be6ee0", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): await async_client.addressing.address_maps.accounts.with_raw_response.delete( address_map_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/addressing/address_maps/test_ips.py b/tests/api_resources/addressing/address_maps/test_ips.py index 63221153f3a..8525eee077b 100644 --- a/tests/api_resources/addressing/address_maps/test_ips.py +++ b/tests/api_resources/addressing/address_maps/test_ips.py @@ -21,8 +21,8 @@ class TestIPs: def test_method_update(self, client: Cloudflare) -> None: ip = client.addressing.address_maps.ips.update( ip_address="192.0.2.1", - account_id="258def64c72dae45f3e4c8516e2111f2", - address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) assert_matches_type(IPUpdateResponse, ip, path=["response"]) @@ -31,8 +31,8 @@ def test_method_update(self, client: Cloudflare) -> None: def test_raw_response_update(self, client: Cloudflare) -> None: response = client.addressing.address_maps.ips.with_raw_response.update( ip_address="192.0.2.1", - account_id="258def64c72dae45f3e4c8516e2111f2", - address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) @@ -45,8 +45,8 @@ def test_raw_response_update(self, client: Cloudflare) -> None: def test_streaming_response_update(self, client: Cloudflare) -> None: with client.addressing.address_maps.ips.with_streaming_response.update( ip_address="192.0.2.1", - account_id="258def64c72dae45f3e4c8516e2111f2", - address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) as response: assert not response.is_closed @@ -63,14 +63,14 @@ def test_path_params_update(self, client: Cloudflare) -> None: client.addressing.address_maps.ips.with_raw_response.update( ip_address="192.0.2.1", account_id="", - address_map_id="055817b111884e0227e1be16a0be6ee0", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): client.addressing.address_maps.ips.with_raw_response.update( ip_address="192.0.2.1", - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", address_map_id="", body={}, ) @@ -78,8 +78,8 @@ def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `ip_address` but received ''"): client.addressing.address_maps.ips.with_raw_response.update( ip_address="", - account_id="258def64c72dae45f3e4c8516e2111f2", - address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) @@ -87,8 +87,8 @@ def test_path_params_update(self, client: Cloudflare) -> None: def test_method_delete(self, client: Cloudflare) -> None: ip = client.addressing.address_maps.ips.delete( ip_address="192.0.2.1", - account_id="258def64c72dae45f3e4c8516e2111f2", - address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(IPDeleteResponse, ip, path=["response"]) @@ -96,8 +96,8 @@ def test_method_delete(self, client: Cloudflare) -> None: def test_raw_response_delete(self, client: Cloudflare) -> None: response = client.addressing.address_maps.ips.with_raw_response.delete( ip_address="192.0.2.1", - account_id="258def64c72dae45f3e4c8516e2111f2", - address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -109,8 +109,8 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: def test_streaming_response_delete(self, client: Cloudflare) -> None: with client.addressing.address_maps.ips.with_streaming_response.delete( ip_address="192.0.2.1", - account_id="258def64c72dae45f3e4c8516e2111f2", - address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -126,21 +126,21 @@ def test_path_params_delete(self, client: Cloudflare) -> None: client.addressing.address_maps.ips.with_raw_response.delete( ip_address="192.0.2.1", account_id="", - address_map_id="055817b111884e0227e1be16a0be6ee0", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): client.addressing.address_maps.ips.with_raw_response.delete( ip_address="192.0.2.1", - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", address_map_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `ip_address` but received ''"): client.addressing.address_maps.ips.with_raw_response.delete( ip_address="", - account_id="258def64c72dae45f3e4c8516e2111f2", - address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -151,8 +151,8 @@ class TestAsyncIPs: async def test_method_update(self, async_client: AsyncCloudflare) -> None: ip = await async_client.addressing.address_maps.ips.update( ip_address="192.0.2.1", - account_id="258def64c72dae45f3e4c8516e2111f2", - address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) assert_matches_type(IPUpdateResponse, ip, path=["response"]) @@ -161,8 +161,8 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.address_maps.ips.with_raw_response.update( ip_address="192.0.2.1", - account_id="258def64c72dae45f3e4c8516e2111f2", - address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) @@ -175,8 +175,8 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.address_maps.ips.with_streaming_response.update( ip_address="192.0.2.1", - account_id="258def64c72dae45f3e4c8516e2111f2", - address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) as response: assert not response.is_closed @@ -193,14 +193,14 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: await async_client.addressing.address_maps.ips.with_raw_response.update( ip_address="192.0.2.1", account_id="", - address_map_id="055817b111884e0227e1be16a0be6ee0", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): await async_client.addressing.address_maps.ips.with_raw_response.update( ip_address="192.0.2.1", - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", address_map_id="", body={}, ) @@ -208,8 +208,8 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `ip_address` but received ''"): await async_client.addressing.address_maps.ips.with_raw_response.update( ip_address="", - account_id="258def64c72dae45f3e4c8516e2111f2", - address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) @@ -217,8 +217,8 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: async def test_method_delete(self, async_client: AsyncCloudflare) -> None: ip = await async_client.addressing.address_maps.ips.delete( ip_address="192.0.2.1", - account_id="258def64c72dae45f3e4c8516e2111f2", - address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(IPDeleteResponse, ip, path=["response"]) @@ -226,8 +226,8 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.address_maps.ips.with_raw_response.delete( ip_address="192.0.2.1", - account_id="258def64c72dae45f3e4c8516e2111f2", - address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -239,8 +239,8 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.address_maps.ips.with_streaming_response.delete( ip_address="192.0.2.1", - account_id="258def64c72dae45f3e4c8516e2111f2", - address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -256,19 +256,19 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: await async_client.addressing.address_maps.ips.with_raw_response.delete( ip_address="192.0.2.1", account_id="", - address_map_id="055817b111884e0227e1be16a0be6ee0", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): await async_client.addressing.address_maps.ips.with_raw_response.delete( ip_address="192.0.2.1", - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", address_map_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `ip_address` but received ''"): await async_client.addressing.address_maps.ips.with_raw_response.delete( ip_address="", - account_id="258def64c72dae45f3e4c8516e2111f2", - address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/addressing/address_maps/test_zones.py b/tests/api_resources/addressing/address_maps/test_zones.py index f0fe5d2d2bb..12786fdfd14 100644 --- a/tests/api_resources/addressing/address_maps/test_zones.py +++ b/tests/api_resources/addressing/address_maps/test_zones.py @@ -20,9 +20,9 @@ class TestZones: @parametrize def test_method_update(self, client: Cloudflare) -> None: zone = client.addressing.address_maps.zones.update( - address_map_id="055817b111884e0227e1be16a0be6ee0", - zone_id="8ac8489932db6327334c9b6d58544cfe", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) assert_matches_type(ZoneUpdateResponse, zone, path=["response"]) @@ -30,9 +30,9 @@ def test_method_update(self, client: Cloudflare) -> None: @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: response = client.addressing.address_maps.zones.with_raw_response.update( - address_map_id="055817b111884e0227e1be16a0be6ee0", - zone_id="8ac8489932db6327334c9b6d58544cfe", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) @@ -44,9 +44,9 @@ def test_raw_response_update(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: with client.addressing.address_maps.zones.with_streaming_response.update( - address_map_id="055817b111884e0227e1be16a0be6ee0", - zone_id="8ac8489932db6327334c9b6d58544cfe", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) as response: assert not response.is_closed @@ -61,16 +61,16 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.addressing.address_maps.zones.with_raw_response.update( - address_map_id="055817b111884e0227e1be16a0be6ee0", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.addressing.address_maps.zones.with_raw_response.update( - address_map_id="055817b111884e0227e1be16a0be6ee0", - zone_id="8ac8489932db6327334c9b6d58544cfe", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", body={}, ) @@ -78,26 +78,26 @@ def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): client.addressing.address_maps.zones.with_raw_response.update( address_map_id="", - zone_id="8ac8489932db6327334c9b6d58544cfe", - account_id="258def64c72dae45f3e4c8516e2111f2", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) @parametrize def test_method_delete(self, client: Cloudflare) -> None: zone = client.addressing.address_maps.zones.delete( - address_map_id="055817b111884e0227e1be16a0be6ee0", - zone_id="8ac8489932db6327334c9b6d58544cfe", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(ZoneDeleteResponse, zone, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: response = client.addressing.address_maps.zones.with_raw_response.delete( - address_map_id="055817b111884e0227e1be16a0be6ee0", - zone_id="8ac8489932db6327334c9b6d58544cfe", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -108,9 +108,9 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: with client.addressing.address_maps.zones.with_streaming_response.delete( - address_map_id="055817b111884e0227e1be16a0be6ee0", - zone_id="8ac8489932db6327334c9b6d58544cfe", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -124,23 +124,23 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: def test_path_params_delete(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.addressing.address_maps.zones.with_raw_response.delete( - address_map_id="055817b111884e0227e1be16a0be6ee0", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.addressing.address_maps.zones.with_raw_response.delete( - address_map_id="055817b111884e0227e1be16a0be6ee0", - zone_id="8ac8489932db6327334c9b6d58544cfe", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): client.addressing.address_maps.zones.with_raw_response.delete( address_map_id="", - zone_id="8ac8489932db6327334c9b6d58544cfe", - account_id="258def64c72dae45f3e4c8516e2111f2", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -150,9 +150,9 @@ class TestAsyncZones: @parametrize async def test_method_update(self, async_client: AsyncCloudflare) -> None: zone = await async_client.addressing.address_maps.zones.update( - address_map_id="055817b111884e0227e1be16a0be6ee0", - zone_id="8ac8489932db6327334c9b6d58544cfe", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) assert_matches_type(ZoneUpdateResponse, zone, path=["response"]) @@ -160,9 +160,9 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.address_maps.zones.with_raw_response.update( - address_map_id="055817b111884e0227e1be16a0be6ee0", - zone_id="8ac8489932db6327334c9b6d58544cfe", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) @@ -174,9 +174,9 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.address_maps.zones.with_streaming_response.update( - address_map_id="055817b111884e0227e1be16a0be6ee0", - zone_id="8ac8489932db6327334c9b6d58544cfe", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) as response: assert not response.is_closed @@ -191,16 +191,16 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.addressing.address_maps.zones.with_raw_response.update( - address_map_id="055817b111884e0227e1be16a0be6ee0", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.addressing.address_maps.zones.with_raw_response.update( - address_map_id="055817b111884e0227e1be16a0be6ee0", - zone_id="8ac8489932db6327334c9b6d58544cfe", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", body={}, ) @@ -208,26 +208,26 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): await async_client.addressing.address_maps.zones.with_raw_response.update( address_map_id="", - zone_id="8ac8489932db6327334c9b6d58544cfe", - account_id="258def64c72dae45f3e4c8516e2111f2", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) @parametrize async def test_method_delete(self, async_client: AsyncCloudflare) -> None: zone = await async_client.addressing.address_maps.zones.delete( - address_map_id="055817b111884e0227e1be16a0be6ee0", - zone_id="8ac8489932db6327334c9b6d58544cfe", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(ZoneDeleteResponse, zone, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.address_maps.zones.with_raw_response.delete( - address_map_id="055817b111884e0227e1be16a0be6ee0", - zone_id="8ac8489932db6327334c9b6d58544cfe", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -238,9 +238,9 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.address_maps.zones.with_streaming_response.delete( - address_map_id="055817b111884e0227e1be16a0be6ee0", - zone_id="8ac8489932db6327334c9b6d58544cfe", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -254,21 +254,21 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.addressing.address_maps.zones.with_raw_response.delete( - address_map_id="055817b111884e0227e1be16a0be6ee0", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.addressing.address_maps.zones.with_raw_response.delete( - address_map_id="055817b111884e0227e1be16a0be6ee0", - zone_id="8ac8489932db6327334c9b6d58544cfe", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): await async_client.addressing.address_maps.zones.with_raw_response.delete( address_map_id="", - zone_id="8ac8489932db6327334c9b6d58544cfe", - account_id="258def64c72dae45f3e4c8516e2111f2", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/accounts/logs/__init__.py b/tests/api_resources/addressing/loa_documents/__init__.py similarity index 100% rename from tests/api_resources/accounts/logs/__init__.py rename to tests/api_resources/addressing/loa_documents/__init__.py diff --git a/tests/api_resources/addressing/loa_documents/test_downloads.py b/tests/api_resources/addressing/loa_documents/test_downloads.py new file mode 100644 index 00000000000..b4ff36279c0 --- /dev/null +++ b/tests/api_resources/addressing/loa_documents/test_downloads.py @@ -0,0 +1,184 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import httpx +import pytest +from respx import MockRouter + +from cloudflare import Cloudflare, AsyncCloudflare +from cloudflare._response import ( + BinaryAPIResponse, + AsyncBinaryAPIResponse, + StreamedBinaryAPIResponse, + AsyncStreamedBinaryAPIResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestDownloads: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip( + reason="TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489" + ) + @parametrize + @pytest.mark.respx(base_url=base_url) + def test_method_get(self, client: Cloudflare, respx_mock: MockRouter) -> None: + respx_mock.get( + "/accounts/023e105f4ecef8ad9ca31a8372d0c353/addressing/loa_documents/d933b1530bc56c9953cf8ce166da8004/download" + ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) + download = client.addressing.loa_documents.downloads.get( + loa_document_id="d933b1530bc56c9953cf8ce166da8004", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert download.is_closed + assert download.json() == {"foo": "bar"} + assert cast(Any, download.is_closed) is True + assert isinstance(download, BinaryAPIResponse) + + @pytest.mark.skip( + reason="TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489" + ) + @parametrize + @pytest.mark.respx(base_url=base_url) + def test_raw_response_get(self, client: Cloudflare, respx_mock: MockRouter) -> None: + respx_mock.get( + "/accounts/023e105f4ecef8ad9ca31a8372d0c353/addressing/loa_documents/d933b1530bc56c9953cf8ce166da8004/download" + ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) + + download = client.addressing.loa_documents.downloads.with_raw_response.get( + loa_document_id="d933b1530bc56c9953cf8ce166da8004", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert download.is_closed is True + assert download.http_request.headers.get("X-Stainless-Lang") == "python" + assert download.json() == {"foo": "bar"} + assert isinstance(download, BinaryAPIResponse) + + @pytest.mark.skip( + reason="TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489" + ) + @parametrize + @pytest.mark.respx(base_url=base_url) + def test_streaming_response_get(self, client: Cloudflare, respx_mock: MockRouter) -> None: + respx_mock.get( + "/accounts/023e105f4ecef8ad9ca31a8372d0c353/addressing/loa_documents/d933b1530bc56c9953cf8ce166da8004/download" + ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) + with client.addressing.loa_documents.downloads.with_streaming_response.get( + loa_document_id="d933b1530bc56c9953cf8ce166da8004", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as download: + assert not download.is_closed + assert download.http_request.headers.get("X-Stainless-Lang") == "python" + + assert download.json() == {"foo": "bar"} + assert cast(Any, download.is_closed) is True + assert isinstance(download, StreamedBinaryAPIResponse) + + assert cast(Any, download.is_closed) is True + + @pytest.mark.skip( + reason="TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489" + ) + @parametrize + @pytest.mark.respx(base_url=base_url) + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.addressing.loa_documents.downloads.with_raw_response.get( + loa_document_id="d933b1530bc56c9953cf8ce166da8004", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `loa_document_id` but received ''"): + client.addressing.loa_documents.downloads.with_raw_response.get( + loa_document_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + +class TestAsyncDownloads: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip( + reason="TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489" + ) + @parametrize + @pytest.mark.respx(base_url=base_url) + async def test_method_get(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None: + respx_mock.get( + "/accounts/023e105f4ecef8ad9ca31a8372d0c353/addressing/loa_documents/d933b1530bc56c9953cf8ce166da8004/download" + ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) + download = await async_client.addressing.loa_documents.downloads.get( + loa_document_id="d933b1530bc56c9953cf8ce166da8004", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert download.is_closed + assert await download.json() == {"foo": "bar"} + assert cast(Any, download.is_closed) is True + assert isinstance(download, AsyncBinaryAPIResponse) + + @pytest.mark.skip( + reason="TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489" + ) + @parametrize + @pytest.mark.respx(base_url=base_url) + async def test_raw_response_get(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None: + respx_mock.get( + "/accounts/023e105f4ecef8ad9ca31a8372d0c353/addressing/loa_documents/d933b1530bc56c9953cf8ce166da8004/download" + ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) + + download = await async_client.addressing.loa_documents.downloads.with_raw_response.get( + loa_document_id="d933b1530bc56c9953cf8ce166da8004", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert download.is_closed is True + assert download.http_request.headers.get("X-Stainless-Lang") == "python" + assert await download.json() == {"foo": "bar"} + assert isinstance(download, AsyncBinaryAPIResponse) + + @pytest.mark.skip( + reason="TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489" + ) + @parametrize + @pytest.mark.respx(base_url=base_url) + async def test_streaming_response_get(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None: + respx_mock.get( + "/accounts/023e105f4ecef8ad9ca31a8372d0c353/addressing/loa_documents/d933b1530bc56c9953cf8ce166da8004/download" + ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) + async with async_client.addressing.loa_documents.downloads.with_streaming_response.get( + loa_document_id="d933b1530bc56c9953cf8ce166da8004", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as download: + assert not download.is_closed + assert download.http_request.headers.get("X-Stainless-Lang") == "python" + + assert await download.json() == {"foo": "bar"} + assert cast(Any, download.is_closed) is True + assert isinstance(download, AsyncStreamedBinaryAPIResponse) + + assert cast(Any, download.is_closed) is True + + @pytest.mark.skip( + reason="TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489" + ) + @parametrize + @pytest.mark.respx(base_url=base_url) + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.addressing.loa_documents.downloads.with_raw_response.get( + loa_document_id="d933b1530bc56c9953cf8ce166da8004", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `loa_document_id` but received ''"): + await async_client.addressing.loa_documents.downloads.with_raw_response.get( + loa_document_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) diff --git a/tests/api_resources/ai/__init__.py b/tests/api_resources/addressing/prefixes/bgp/__init__.py similarity index 100% rename from tests/api_resources/ai/__init__.py rename to tests/api_resources/addressing/prefixes/bgp/__init__.py diff --git a/tests/api_resources/addressing/prefixes/bgp/test_bindings.py b/tests/api_resources/addressing/prefixes/bgp/test_bindings.py new file mode 100644 index 00000000000..1fca628ca73 --- /dev/null +++ b/tests/api_resources/addressing/prefixes/bgp/test_bindings.py @@ -0,0 +1,475 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.addressing.prefixes.bgp import ServiceBinding, BindingDeleteResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestBindings: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Cloudflare) -> None: + binding = client.addressing.prefixes.bgp.bindings.create( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[ServiceBinding], binding, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Cloudflare) -> None: + binding = client.addressing.prefixes.bgp.bindings.create( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + cidr="192.0.2.0/24", + service_id="2db684ee7ca04e159946fd05b99e1bcd", + ) + assert_matches_type(Optional[ServiceBinding], binding, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Cloudflare) -> None: + response = client.addressing.prefixes.bgp.bindings.with_raw_response.create( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + binding = response.parse() + assert_matches_type(Optional[ServiceBinding], binding, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Cloudflare) -> None: + with client.addressing.prefixes.bgp.bindings.with_streaming_response.create( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + binding = response.parse() + assert_matches_type(Optional[ServiceBinding], binding, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.addressing.prefixes.bgp.bindings.with_raw_response.create( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + client.addressing.prefixes.bgp.bindings.with_raw_response.create( + prefix_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + binding = client.addressing.prefixes.bgp.bindings.list( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(SyncSinglePage[ServiceBinding], binding, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.addressing.prefixes.bgp.bindings.with_raw_response.list( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + binding = response.parse() + assert_matches_type(SyncSinglePage[ServiceBinding], binding, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.addressing.prefixes.bgp.bindings.with_streaming_response.list( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + binding = response.parse() + assert_matches_type(SyncSinglePage[ServiceBinding], binding, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.addressing.prefixes.bgp.bindings.with_raw_response.list( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + client.addressing.prefixes.bgp.bindings.with_raw_response.list( + prefix_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @parametrize + def test_method_delete(self, client: Cloudflare) -> None: + binding = client.addressing.prefixes.bgp.bindings.delete( + binding_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(BindingDeleteResponse, binding, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.addressing.prefixes.bgp.bindings.with_raw_response.delete( + binding_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + binding = response.parse() + assert_matches_type(BindingDeleteResponse, binding, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.addressing.prefixes.bgp.bindings.with_streaming_response.delete( + binding_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + binding = response.parse() + assert_matches_type(BindingDeleteResponse, binding, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.addressing.prefixes.bgp.bindings.with_raw_response.delete( + binding_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + client.addressing.prefixes.bgp.bindings.with_raw_response.delete( + binding_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `binding_id` but received ''"): + client.addressing.prefixes.bgp.bindings.with_raw_response.delete( + binding_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + binding = client.addressing.prefixes.bgp.bindings.get( + binding_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[ServiceBinding], binding, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.addressing.prefixes.bgp.bindings.with_raw_response.get( + binding_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + binding = response.parse() + assert_matches_type(Optional[ServiceBinding], binding, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.addressing.prefixes.bgp.bindings.with_streaming_response.get( + binding_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + binding = response.parse() + assert_matches_type(Optional[ServiceBinding], binding, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.addressing.prefixes.bgp.bindings.with_raw_response.get( + binding_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + client.addressing.prefixes.bgp.bindings.with_raw_response.get( + binding_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `binding_id` but received ''"): + client.addressing.prefixes.bgp.bindings.with_raw_response.get( + binding_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + +class TestAsyncBindings: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncCloudflare) -> None: + binding = await async_client.addressing.prefixes.bgp.bindings.create( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[ServiceBinding], binding, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: + binding = await async_client.addressing.prefixes.bgp.bindings.create( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + cidr="192.0.2.0/24", + service_id="2db684ee7ca04e159946fd05b99e1bcd", + ) + assert_matches_type(Optional[ServiceBinding], binding, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: + response = await async_client.addressing.prefixes.bgp.bindings.with_raw_response.create( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + binding = await response.parse() + assert_matches_type(Optional[ServiceBinding], binding, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: + async with async_client.addressing.prefixes.bgp.bindings.with_streaming_response.create( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + binding = await response.parse() + assert_matches_type(Optional[ServiceBinding], binding, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.addressing.prefixes.bgp.bindings.with_raw_response.create( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + await async_client.addressing.prefixes.bgp.bindings.with_raw_response.create( + prefix_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + binding = await async_client.addressing.prefixes.bgp.bindings.list( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(AsyncSinglePage[ServiceBinding], binding, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.addressing.prefixes.bgp.bindings.with_raw_response.list( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + binding = await response.parse() + assert_matches_type(AsyncSinglePage[ServiceBinding], binding, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.addressing.prefixes.bgp.bindings.with_streaming_response.list( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + binding = await response.parse() + assert_matches_type(AsyncSinglePage[ServiceBinding], binding, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.addressing.prefixes.bgp.bindings.with_raw_response.list( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + await async_client.addressing.prefixes.bgp.bindings.with_raw_response.list( + prefix_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @parametrize + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + binding = await async_client.addressing.prefixes.bgp.bindings.delete( + binding_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(BindingDeleteResponse, binding, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.addressing.prefixes.bgp.bindings.with_raw_response.delete( + binding_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + binding = await response.parse() + assert_matches_type(BindingDeleteResponse, binding, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.addressing.prefixes.bgp.bindings.with_streaming_response.delete( + binding_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + binding = await response.parse() + assert_matches_type(BindingDeleteResponse, binding, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.addressing.prefixes.bgp.bindings.with_raw_response.delete( + binding_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + await async_client.addressing.prefixes.bgp.bindings.with_raw_response.delete( + binding_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `binding_id` but received ''"): + await async_client.addressing.prefixes.bgp.bindings.with_raw_response.delete( + binding_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + binding = await async_client.addressing.prefixes.bgp.bindings.get( + binding_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[ServiceBinding], binding, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.addressing.prefixes.bgp.bindings.with_raw_response.get( + binding_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + binding = await response.parse() + assert_matches_type(Optional[ServiceBinding], binding, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.addressing.prefixes.bgp.bindings.with_streaming_response.get( + binding_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + binding = await response.parse() + assert_matches_type(Optional[ServiceBinding], binding, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.addressing.prefixes.bgp.bindings.with_raw_response.get( + binding_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + await async_client.addressing.prefixes.bgp.bindings.with_raw_response.get( + binding_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `binding_id` but received ''"): + await async_client.addressing.prefixes.bgp.bindings.with_raw_response.get( + binding_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) diff --git a/tests/api_resources/addressing/prefixes/bgp/test_prefixes.py b/tests/api_resources/addressing/prefixes/bgp/test_prefixes.py new file mode 100644 index 00000000000..c0486fa677a --- /dev/null +++ b/tests/api_resources/addressing/prefixes/bgp/test_prefixes.py @@ -0,0 +1,379 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.addressing.prefixes.bgp import BGPPrefix + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestPrefixes: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + prefix = client.addressing.prefixes.bgp.prefixes.list( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(SyncSinglePage[BGPPrefix], prefix, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.addressing.prefixes.bgp.prefixes.with_raw_response.list( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prefix = response.parse() + assert_matches_type(SyncSinglePage[BGPPrefix], prefix, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.addressing.prefixes.bgp.prefixes.with_streaming_response.list( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prefix = response.parse() + assert_matches_type(SyncSinglePage[BGPPrefix], prefix, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.addressing.prefixes.bgp.prefixes.with_raw_response.list( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + client.addressing.prefixes.bgp.prefixes.with_raw_response.list( + prefix_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @parametrize + def test_method_edit(self, client: Cloudflare) -> None: + prefix = client.addressing.prefixes.bgp.prefixes.edit( + bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[BGPPrefix], prefix, path=["response"]) + + @parametrize + def test_method_edit_with_all_params(self, client: Cloudflare) -> None: + prefix = client.addressing.prefixes.bgp.prefixes.edit( + bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + on_demand={"advertised": True}, + ) + assert_matches_type(Optional[BGPPrefix], prefix, path=["response"]) + + @parametrize + def test_raw_response_edit(self, client: Cloudflare) -> None: + response = client.addressing.prefixes.bgp.prefixes.with_raw_response.edit( + bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prefix = response.parse() + assert_matches_type(Optional[BGPPrefix], prefix, path=["response"]) + + @parametrize + def test_streaming_response_edit(self, client: Cloudflare) -> None: + with client.addressing.prefixes.bgp.prefixes.with_streaming_response.edit( + bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prefix = response.parse() + assert_matches_type(Optional[BGPPrefix], prefix, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_edit(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.addressing.prefixes.bgp.prefixes.with_raw_response.edit( + bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + client.addressing.prefixes.bgp.prefixes.with_raw_response.edit( + bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `bgp_prefix_id` but received ''"): + client.addressing.prefixes.bgp.prefixes.with_raw_response.edit( + bgp_prefix_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + prefix = client.addressing.prefixes.bgp.prefixes.get( + bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[BGPPrefix], prefix, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.addressing.prefixes.bgp.prefixes.with_raw_response.get( + bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prefix = response.parse() + assert_matches_type(Optional[BGPPrefix], prefix, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.addressing.prefixes.bgp.prefixes.with_streaming_response.get( + bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prefix = response.parse() + assert_matches_type(Optional[BGPPrefix], prefix, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.addressing.prefixes.bgp.prefixes.with_raw_response.get( + bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + client.addressing.prefixes.bgp.prefixes.with_raw_response.get( + bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `bgp_prefix_id` but received ''"): + client.addressing.prefixes.bgp.prefixes.with_raw_response.get( + bgp_prefix_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + +class TestAsyncPrefixes: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + prefix = await async_client.addressing.prefixes.bgp.prefixes.list( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(AsyncSinglePage[BGPPrefix], prefix, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.addressing.prefixes.bgp.prefixes.with_raw_response.list( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prefix = await response.parse() + assert_matches_type(AsyncSinglePage[BGPPrefix], prefix, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.addressing.prefixes.bgp.prefixes.with_streaming_response.list( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prefix = await response.parse() + assert_matches_type(AsyncSinglePage[BGPPrefix], prefix, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.addressing.prefixes.bgp.prefixes.with_raw_response.list( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + await async_client.addressing.prefixes.bgp.prefixes.with_raw_response.list( + prefix_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @parametrize + async def test_method_edit(self, async_client: AsyncCloudflare) -> None: + prefix = await async_client.addressing.prefixes.bgp.prefixes.edit( + bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[BGPPrefix], prefix, path=["response"]) + + @parametrize + async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: + prefix = await async_client.addressing.prefixes.bgp.prefixes.edit( + bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + on_demand={"advertised": True}, + ) + assert_matches_type(Optional[BGPPrefix], prefix, path=["response"]) + + @parametrize + async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: + response = await async_client.addressing.prefixes.bgp.prefixes.with_raw_response.edit( + bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prefix = await response.parse() + assert_matches_type(Optional[BGPPrefix], prefix, path=["response"]) + + @parametrize + async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: + async with async_client.addressing.prefixes.bgp.prefixes.with_streaming_response.edit( + bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prefix = await response.parse() + assert_matches_type(Optional[BGPPrefix], prefix, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.addressing.prefixes.bgp.prefixes.with_raw_response.edit( + bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + await async_client.addressing.prefixes.bgp.prefixes.with_raw_response.edit( + bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `bgp_prefix_id` but received ''"): + await async_client.addressing.prefixes.bgp.prefixes.with_raw_response.edit( + bgp_prefix_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + prefix = await async_client.addressing.prefixes.bgp.prefixes.get( + bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[BGPPrefix], prefix, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.addressing.prefixes.bgp.prefixes.with_raw_response.get( + bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + prefix = await response.parse() + assert_matches_type(Optional[BGPPrefix], prefix, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.addressing.prefixes.bgp.prefixes.with_streaming_response.get( + bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + prefix = await response.parse() + assert_matches_type(Optional[BGPPrefix], prefix, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.addressing.prefixes.bgp.prefixes.with_raw_response.get( + bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + await async_client.addressing.prefixes.bgp.prefixes.with_raw_response.get( + bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `bgp_prefix_id` but received ''"): + await async_client.addressing.prefixes.bgp.prefixes.with_raw_response.get( + bgp_prefix_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + ) diff --git a/tests/api_resources/addressing/prefixes/bgp/test_statuses.py b/tests/api_resources/addressing/prefixes/bgp/test_statuses.py new file mode 100644 index 00000000000..3a1bf7f4e57 --- /dev/null +++ b/tests/api_resources/addressing/prefixes/bgp/test_statuses.py @@ -0,0 +1,224 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.addressing.prefixes.bgp import StatusGetResponse, StatusEditResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestStatuses: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_edit(self, client: Cloudflare) -> None: + status = client.addressing.prefixes.bgp.statuses.edit( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + advertised=True, + ) + assert_matches_type(Optional[StatusEditResponse], status, path=["response"]) + + @parametrize + def test_raw_response_edit(self, client: Cloudflare) -> None: + response = client.addressing.prefixes.bgp.statuses.with_raw_response.edit( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + advertised=True, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + status = response.parse() + assert_matches_type(Optional[StatusEditResponse], status, path=["response"]) + + @parametrize + def test_streaming_response_edit(self, client: Cloudflare) -> None: + with client.addressing.prefixes.bgp.statuses.with_streaming_response.edit( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + advertised=True, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + status = response.parse() + assert_matches_type(Optional[StatusEditResponse], status, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_edit(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.addressing.prefixes.bgp.statuses.with_raw_response.edit( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + advertised=True, + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + client.addressing.prefixes.bgp.statuses.with_raw_response.edit( + prefix_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + advertised=True, + ) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + status = client.addressing.prefixes.bgp.statuses.get( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[StatusGetResponse], status, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.addressing.prefixes.bgp.statuses.with_raw_response.get( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + status = response.parse() + assert_matches_type(Optional[StatusGetResponse], status, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.addressing.prefixes.bgp.statuses.with_streaming_response.get( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + status = response.parse() + assert_matches_type(Optional[StatusGetResponse], status, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.addressing.prefixes.bgp.statuses.with_raw_response.get( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + client.addressing.prefixes.bgp.statuses.with_raw_response.get( + prefix_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + +class TestAsyncStatuses: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_edit(self, async_client: AsyncCloudflare) -> None: + status = await async_client.addressing.prefixes.bgp.statuses.edit( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + advertised=True, + ) + assert_matches_type(Optional[StatusEditResponse], status, path=["response"]) + + @parametrize + async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: + response = await async_client.addressing.prefixes.bgp.statuses.with_raw_response.edit( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + advertised=True, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + status = await response.parse() + assert_matches_type(Optional[StatusEditResponse], status, path=["response"]) + + @parametrize + async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: + async with async_client.addressing.prefixes.bgp.statuses.with_streaming_response.edit( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + advertised=True, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + status = await response.parse() + assert_matches_type(Optional[StatusEditResponse], status, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.addressing.prefixes.bgp.statuses.with_raw_response.edit( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + advertised=True, + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + await async_client.addressing.prefixes.bgp.statuses.with_raw_response.edit( + prefix_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + advertised=True, + ) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + status = await async_client.addressing.prefixes.bgp.statuses.get( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[StatusGetResponse], status, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.addressing.prefixes.bgp.statuses.with_raw_response.get( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + status = await response.parse() + assert_matches_type(Optional[StatusGetResponse], status, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.addressing.prefixes.bgp.statuses.with_streaming_response.get( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + status = await response.parse() + assert_matches_type(Optional[StatusGetResponse], status, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.addressing.prefixes.bgp.statuses.with_raw_response.get( + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + await async_client.addressing.prefixes.bgp.statuses.with_raw_response.get( + prefix_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) diff --git a/tests/api_resources/addressing/prefixes/test_advertisement_status.py b/tests/api_resources/addressing/prefixes/test_advertisement_status.py deleted file mode 100644 index 49a7236d5d7..00000000000 --- a/tests/api_resources/addressing/prefixes/test_advertisement_status.py +++ /dev/null @@ -1,227 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, Optional, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.types.addressing.prefixes import ( - AdvertisementStatusGetResponse, - AdvertisementStatusEditResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestAdvertisementStatus: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_edit(self, client: Cloudflare) -> None: - advertisement_status = client.addressing.prefixes.advertisement_status.edit( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - advertised=True, - ) - assert_matches_type(Optional[AdvertisementStatusEditResponse], advertisement_status, path=["response"]) - - @parametrize - def test_raw_response_edit(self, client: Cloudflare) -> None: - response = client.addressing.prefixes.advertisement_status.with_raw_response.edit( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - advertised=True, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - advertisement_status = response.parse() - assert_matches_type(Optional[AdvertisementStatusEditResponse], advertisement_status, path=["response"]) - - @parametrize - def test_streaming_response_edit(self, client: Cloudflare) -> None: - with client.addressing.prefixes.advertisement_status.with_streaming_response.edit( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - advertised=True, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - advertisement_status = response.parse() - assert_matches_type(Optional[AdvertisementStatusEditResponse], advertisement_status, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_edit(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.addressing.prefixes.advertisement_status.with_raw_response.edit( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="", - advertised=True, - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - client.addressing.prefixes.advertisement_status.with_raw_response.edit( - prefix_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", - advertised=True, - ) - - @parametrize - def test_method_get(self, client: Cloudflare) -> None: - advertisement_status = client.addressing.prefixes.advertisement_status.get( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - assert_matches_type(Optional[AdvertisementStatusGetResponse], advertisement_status, path=["response"]) - - @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.addressing.prefixes.advertisement_status.with_raw_response.get( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - advertisement_status = response.parse() - assert_matches_type(Optional[AdvertisementStatusGetResponse], advertisement_status, path=["response"]) - - @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.addressing.prefixes.advertisement_status.with_streaming_response.get( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - advertisement_status = response.parse() - assert_matches_type(Optional[AdvertisementStatusGetResponse], advertisement_status, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.addressing.prefixes.advertisement_status.with_raw_response.get( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - client.addressing.prefixes.advertisement_status.with_raw_response.get( - prefix_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - - -class TestAsyncAdvertisementStatus: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_edit(self, async_client: AsyncCloudflare) -> None: - advertisement_status = await async_client.addressing.prefixes.advertisement_status.edit( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - advertised=True, - ) - assert_matches_type(Optional[AdvertisementStatusEditResponse], advertisement_status, path=["response"]) - - @parametrize - async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addressing.prefixes.advertisement_status.with_raw_response.edit( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - advertised=True, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - advertisement_status = await response.parse() - assert_matches_type(Optional[AdvertisementStatusEditResponse], advertisement_status, path=["response"]) - - @parametrize - async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: - async with async_client.addressing.prefixes.advertisement_status.with_streaming_response.edit( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - advertised=True, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - advertisement_status = await response.parse() - assert_matches_type(Optional[AdvertisementStatusEditResponse], advertisement_status, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.addressing.prefixes.advertisement_status.with_raw_response.edit( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="", - advertised=True, - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - await async_client.addressing.prefixes.advertisement_status.with_raw_response.edit( - prefix_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", - advertised=True, - ) - - @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - advertisement_status = await async_client.addressing.prefixes.advertisement_status.get( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - assert_matches_type(Optional[AdvertisementStatusGetResponse], advertisement_status, path=["response"]) - - @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addressing.prefixes.advertisement_status.with_raw_response.get( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - advertisement_status = await response.parse() - assert_matches_type(Optional[AdvertisementStatusGetResponse], advertisement_status, path=["response"]) - - @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.addressing.prefixes.advertisement_status.with_streaming_response.get( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - advertisement_status = await response.parse() - assert_matches_type(Optional[AdvertisementStatusGetResponse], advertisement_status, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.addressing.prefixes.advertisement_status.with_raw_response.get( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - await async_client.addressing.prefixes.advertisement_status.with_raw_response.get( - prefix_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) diff --git a/tests/api_resources/addressing/prefixes/test_bgp_prefixes.py b/tests/api_resources/addressing/prefixes/test_bgp_prefixes.py deleted file mode 100644 index 06fe971018a..00000000000 --- a/tests/api_resources/addressing/prefixes/test_bgp_prefixes.py +++ /dev/null @@ -1,493 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, Optional, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.addressing.prefixes import BGPPrefix - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestBGPPrefixes: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_create(self, client: Cloudflare) -> None: - bgp_prefix = client.addressing.prefixes.bgp_prefixes.create( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) - - @parametrize - def test_method_create_with_all_params(self, client: Cloudflare) -> None: - bgp_prefix = client.addressing.prefixes.bgp_prefixes.create( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - cidr="192.0.2.0/24", - ) - assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) - - @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.addressing.prefixes.bgp_prefixes.with_raw_response.create( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bgp_prefix = response.parse() - assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) - - @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.addressing.prefixes.bgp_prefixes.with_streaming_response.create( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - bgp_prefix = response.parse() - assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.addressing.prefixes.bgp_prefixes.with_raw_response.create( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - client.addressing.prefixes.bgp_prefixes.with_raw_response.create( - prefix_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - bgp_prefix = client.addressing.prefixes.bgp_prefixes.list( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - assert_matches_type(SyncSinglePage[BGPPrefix], bgp_prefix, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.addressing.prefixes.bgp_prefixes.with_raw_response.list( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bgp_prefix = response.parse() - assert_matches_type(SyncSinglePage[BGPPrefix], bgp_prefix, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.addressing.prefixes.bgp_prefixes.with_streaming_response.list( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - bgp_prefix = response.parse() - assert_matches_type(SyncSinglePage[BGPPrefix], bgp_prefix, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.addressing.prefixes.bgp_prefixes.with_raw_response.list( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - client.addressing.prefixes.bgp_prefixes.with_raw_response.list( - prefix_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - - @parametrize - def test_method_edit(self, client: Cloudflare) -> None: - bgp_prefix = client.addressing.prefixes.bgp_prefixes.edit( - bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) - assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) - - @parametrize - def test_method_edit_with_all_params(self, client: Cloudflare) -> None: - bgp_prefix = client.addressing.prefixes.bgp_prefixes.edit( - bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - on_demand={"advertised": True}, - ) - assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) - - @parametrize - def test_raw_response_edit(self, client: Cloudflare) -> None: - response = client.addressing.prefixes.bgp_prefixes.with_raw_response.edit( - bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bgp_prefix = response.parse() - assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) - - @parametrize - def test_streaming_response_edit(self, client: Cloudflare) -> None: - with client.addressing.prefixes.bgp_prefixes.with_streaming_response.edit( - bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - bgp_prefix = response.parse() - assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_edit(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.addressing.prefixes.bgp_prefixes.with_raw_response.edit( - bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", - account_id="", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - client.addressing.prefixes.bgp_prefixes.with_raw_response.edit( - bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `bgp_prefix_id` but received ''"): - client.addressing.prefixes.bgp_prefixes.with_raw_response.edit( - bgp_prefix_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) - - @parametrize - def test_method_get(self, client: Cloudflare) -> None: - bgp_prefix = client.addressing.prefixes.bgp_prefixes.get( - bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) - assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) - - @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.addressing.prefixes.bgp_prefixes.with_raw_response.get( - bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bgp_prefix = response.parse() - assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) - - @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.addressing.prefixes.bgp_prefixes.with_streaming_response.get( - bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - bgp_prefix = response.parse() - assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.addressing.prefixes.bgp_prefixes.with_raw_response.get( - bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", - account_id="", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - client.addressing.prefixes.bgp_prefixes.with_raw_response.get( - bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `bgp_prefix_id` but received ''"): - client.addressing.prefixes.bgp_prefixes.with_raw_response.get( - bgp_prefix_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) - - -class TestAsyncBGPPrefixes: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: - bgp_prefix = await async_client.addressing.prefixes.bgp_prefixes.create( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) - - @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: - bgp_prefix = await async_client.addressing.prefixes.bgp_prefixes.create( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - cidr="192.0.2.0/24", - ) - assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) - - @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.create( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bgp_prefix = await response.parse() - assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) - - @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.addressing.prefixes.bgp_prefixes.with_streaming_response.create( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - bgp_prefix = await response.parse() - assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.create( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.create( - prefix_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - - @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - bgp_prefix = await async_client.addressing.prefixes.bgp_prefixes.list( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - assert_matches_type(AsyncSinglePage[BGPPrefix], bgp_prefix, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.list( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bgp_prefix = await response.parse() - assert_matches_type(AsyncSinglePage[BGPPrefix], bgp_prefix, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.addressing.prefixes.bgp_prefixes.with_streaming_response.list( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - bgp_prefix = await response.parse() - assert_matches_type(AsyncSinglePage[BGPPrefix], bgp_prefix, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.list( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.list( - prefix_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - - @parametrize - async def test_method_edit(self, async_client: AsyncCloudflare) -> None: - bgp_prefix = await async_client.addressing.prefixes.bgp_prefixes.edit( - bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) - assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) - - @parametrize - async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: - bgp_prefix = await async_client.addressing.prefixes.bgp_prefixes.edit( - bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - on_demand={"advertised": True}, - ) - assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) - - @parametrize - async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.edit( - bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bgp_prefix = await response.parse() - assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) - - @parametrize - async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: - async with async_client.addressing.prefixes.bgp_prefixes.with_streaming_response.edit( - bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - bgp_prefix = await response.parse() - assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.edit( - bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", - account_id="", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.edit( - bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `bgp_prefix_id` but received ''"): - await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.edit( - bgp_prefix_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) - - @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - bgp_prefix = await async_client.addressing.prefixes.bgp_prefixes.get( - bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) - assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) - - @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.get( - bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bgp_prefix = await response.parse() - assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) - - @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.addressing.prefixes.bgp_prefixes.with_streaming_response.get( - bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - bgp_prefix = await response.parse() - assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.get( - bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", - account_id="", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.get( - bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `bgp_prefix_id` but received ''"): - await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.get( - bgp_prefix_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) diff --git a/tests/api_resources/addressing/prefixes/test_delegations.py b/tests/api_resources/addressing/prefixes/test_delegations.py index 83ec07279cc..dd17a7ac44b 100644 --- a/tests/api_resources/addressing/prefixes/test_delegations.py +++ b/tests/api_resources/addressing/prefixes/test_delegations.py @@ -21,8 +21,8 @@ class TestDelegations: @parametrize def test_method_create(self, client: Cloudflare) -> None: delegation = client.addressing.prefixes.delegations.create( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", cidr="192.0.2.0/24", delegated_account_id="b1946ac92492d2347c6235b4d2611184", ) @@ -31,8 +31,8 @@ def test_method_create(self, client: Cloudflare) -> None: @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: response = client.addressing.prefixes.delegations.with_raw_response.create( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", cidr="192.0.2.0/24", delegated_account_id="b1946ac92492d2347c6235b4d2611184", ) @@ -45,8 +45,8 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: with client.addressing.prefixes.delegations.with_streaming_response.create( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", cidr="192.0.2.0/24", delegated_account_id="b1946ac92492d2347c6235b4d2611184", ) as response: @@ -62,7 +62,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: def test_path_params_create(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.addressing.prefixes.delegations.with_raw_response.create( - prefix_id="2af39739cc4e3b5910c918468bb89828", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", cidr="192.0.2.0/24", delegated_account_id="b1946ac92492d2347c6235b4d2611184", @@ -71,7 +71,7 @@ def test_path_params_create(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): client.addressing.prefixes.delegations.with_raw_response.create( prefix_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", cidr="192.0.2.0/24", delegated_account_id="b1946ac92492d2347c6235b4d2611184", ) @@ -79,16 +79,16 @@ def test_path_params_create(self, client: Cloudflare) -> None: @parametrize def test_method_list(self, client: Cloudflare) -> None: delegation = client.addressing.prefixes.delegations.list( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(SyncSinglePage[Delegations], delegation, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.addressing.prefixes.delegations.with_raw_response.list( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -99,8 +99,8 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.addressing.prefixes.delegations.with_streaming_response.list( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -114,22 +114,22 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: def test_path_params_list(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.addressing.prefixes.delegations.with_raw_response.list( - prefix_id="2af39739cc4e3b5910c918468bb89828", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): client.addressing.prefixes.delegations.with_raw_response.list( prefix_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @parametrize def test_method_delete(self, client: Cloudflare) -> None: delegation = client.addressing.prefixes.delegations.delete( delegation_id="d933b1530bc56c9953cf8ce166da8004", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[DelegationDeleteResponse], delegation, path=["response"]) @@ -137,8 +137,8 @@ def test_method_delete(self, client: Cloudflare) -> None: def test_raw_response_delete(self, client: Cloudflare) -> None: response = client.addressing.prefixes.delegations.with_raw_response.delete( delegation_id="d933b1530bc56c9953cf8ce166da8004", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -150,8 +150,8 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: def test_streaming_response_delete(self, client: Cloudflare) -> None: with client.addressing.prefixes.delegations.with_streaming_response.delete( delegation_id="d933b1530bc56c9953cf8ce166da8004", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -167,21 +167,21 @@ def test_path_params_delete(self, client: Cloudflare) -> None: client.addressing.prefixes.delegations.with_raw_response.delete( delegation_id="d933b1530bc56c9953cf8ce166da8004", account_id="", - prefix_id="2af39739cc4e3b5910c918468bb89828", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): client.addressing.prefixes.delegations.with_raw_response.delete( delegation_id="d933b1530bc56c9953cf8ce166da8004", - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", prefix_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `delegation_id` but received ''"): client.addressing.prefixes.delegations.with_raw_response.delete( delegation_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -191,8 +191,8 @@ class TestAsyncDelegations: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: delegation = await async_client.addressing.prefixes.delegations.create( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", cidr="192.0.2.0/24", delegated_account_id="b1946ac92492d2347c6235b4d2611184", ) @@ -201,8 +201,8 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.prefixes.delegations.with_raw_response.create( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", cidr="192.0.2.0/24", delegated_account_id="b1946ac92492d2347c6235b4d2611184", ) @@ -215,8 +215,8 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.prefixes.delegations.with_streaming_response.create( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", cidr="192.0.2.0/24", delegated_account_id="b1946ac92492d2347c6235b4d2611184", ) as response: @@ -232,7 +232,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.addressing.prefixes.delegations.with_raw_response.create( - prefix_id="2af39739cc4e3b5910c918468bb89828", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", cidr="192.0.2.0/24", delegated_account_id="b1946ac92492d2347c6235b4d2611184", @@ -241,7 +241,7 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): await async_client.addressing.prefixes.delegations.with_raw_response.create( prefix_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", cidr="192.0.2.0/24", delegated_account_id="b1946ac92492d2347c6235b4d2611184", ) @@ -249,16 +249,16 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: delegation = await async_client.addressing.prefixes.delegations.list( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(AsyncSinglePage[Delegations], delegation, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.prefixes.delegations.with_raw_response.list( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -269,8 +269,8 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.prefixes.delegations.with_streaming_response.list( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -284,22 +284,22 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.addressing.prefixes.delegations.with_raw_response.list( - prefix_id="2af39739cc4e3b5910c918468bb89828", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): await async_client.addressing.prefixes.delegations.with_raw_response.list( prefix_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @parametrize async def test_method_delete(self, async_client: AsyncCloudflare) -> None: delegation = await async_client.addressing.prefixes.delegations.delete( delegation_id="d933b1530bc56c9953cf8ce166da8004", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[DelegationDeleteResponse], delegation, path=["response"]) @@ -307,8 +307,8 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.prefixes.delegations.with_raw_response.delete( delegation_id="d933b1530bc56c9953cf8ce166da8004", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -320,8 +320,8 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.prefixes.delegations.with_streaming_response.delete( delegation_id="d933b1530bc56c9953cf8ce166da8004", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -337,19 +337,19 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: await async_client.addressing.prefixes.delegations.with_raw_response.delete( delegation_id="d933b1530bc56c9953cf8ce166da8004", account_id="", - prefix_id="2af39739cc4e3b5910c918468bb89828", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): await async_client.addressing.prefixes.delegations.with_raw_response.delete( delegation_id="d933b1530bc56c9953cf8ce166da8004", - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", prefix_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `delegation_id` but received ''"): await async_client.addressing.prefixes.delegations.with_raw_response.delete( delegation_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/addressing/prefixes/test_service_bindings.py b/tests/api_resources/addressing/prefixes/test_service_bindings.py deleted file mode 100644 index 98156802f9c..00000000000 --- a/tests/api_resources/addressing/prefixes/test_service_bindings.py +++ /dev/null @@ -1,478 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, Optional, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.addressing.prefixes import ( - ServiceBinding, - ServiceBindingDeleteResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestServiceBindings: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_create(self, client: Cloudflare) -> None: - service_binding = client.addressing.prefixes.service_bindings.create( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - assert_matches_type(Optional[ServiceBinding], service_binding, path=["response"]) - - @parametrize - def test_method_create_with_all_params(self, client: Cloudflare) -> None: - service_binding = client.addressing.prefixes.service_bindings.create( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - cidr="192.0.2.0/24", - service_id="2db684ee7ca04e159946fd05b99e1bcd", - ) - assert_matches_type(Optional[ServiceBinding], service_binding, path=["response"]) - - @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.addressing.prefixes.service_bindings.with_raw_response.create( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - service_binding = response.parse() - assert_matches_type(Optional[ServiceBinding], service_binding, path=["response"]) - - @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.addressing.prefixes.service_bindings.with_streaming_response.create( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - service_binding = response.parse() - assert_matches_type(Optional[ServiceBinding], service_binding, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.addressing.prefixes.service_bindings.with_raw_response.create( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - client.addressing.prefixes.service_bindings.with_raw_response.create( - prefix_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - service_binding = client.addressing.prefixes.service_bindings.list( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - assert_matches_type(SyncSinglePage[ServiceBinding], service_binding, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.addressing.prefixes.service_bindings.with_raw_response.list( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - service_binding = response.parse() - assert_matches_type(SyncSinglePage[ServiceBinding], service_binding, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.addressing.prefixes.service_bindings.with_streaming_response.list( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - service_binding = response.parse() - assert_matches_type(SyncSinglePage[ServiceBinding], service_binding, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.addressing.prefixes.service_bindings.with_raw_response.list( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - client.addressing.prefixes.service_bindings.with_raw_response.list( - prefix_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - - @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - service_binding = client.addressing.prefixes.service_bindings.delete( - binding_id="0429b49b6a5155297b78e75a44b09e14", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) - assert_matches_type(ServiceBindingDeleteResponse, service_binding, path=["response"]) - - @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.addressing.prefixes.service_bindings.with_raw_response.delete( - binding_id="0429b49b6a5155297b78e75a44b09e14", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - service_binding = response.parse() - assert_matches_type(ServiceBindingDeleteResponse, service_binding, path=["response"]) - - @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.addressing.prefixes.service_bindings.with_streaming_response.delete( - binding_id="0429b49b6a5155297b78e75a44b09e14", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - service_binding = response.parse() - assert_matches_type(ServiceBindingDeleteResponse, service_binding, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.addressing.prefixes.service_bindings.with_raw_response.delete( - binding_id="0429b49b6a5155297b78e75a44b09e14", - account_id="", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - client.addressing.prefixes.service_bindings.with_raw_response.delete( - binding_id="0429b49b6a5155297b78e75a44b09e14", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `binding_id` but received ''"): - client.addressing.prefixes.service_bindings.with_raw_response.delete( - binding_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) - - @parametrize - def test_method_get(self, client: Cloudflare) -> None: - service_binding = client.addressing.prefixes.service_bindings.get( - binding_id="0429b49b6a5155297b78e75a44b09e14", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) - assert_matches_type(Optional[ServiceBinding], service_binding, path=["response"]) - - @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.addressing.prefixes.service_bindings.with_raw_response.get( - binding_id="0429b49b6a5155297b78e75a44b09e14", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - service_binding = response.parse() - assert_matches_type(Optional[ServiceBinding], service_binding, path=["response"]) - - @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.addressing.prefixes.service_bindings.with_streaming_response.get( - binding_id="0429b49b6a5155297b78e75a44b09e14", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - service_binding = response.parse() - assert_matches_type(Optional[ServiceBinding], service_binding, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.addressing.prefixes.service_bindings.with_raw_response.get( - binding_id="0429b49b6a5155297b78e75a44b09e14", - account_id="", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - client.addressing.prefixes.service_bindings.with_raw_response.get( - binding_id="0429b49b6a5155297b78e75a44b09e14", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `binding_id` but received ''"): - client.addressing.prefixes.service_bindings.with_raw_response.get( - binding_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) - - -class TestAsyncServiceBindings: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: - service_binding = await async_client.addressing.prefixes.service_bindings.create( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - assert_matches_type(Optional[ServiceBinding], service_binding, path=["response"]) - - @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: - service_binding = await async_client.addressing.prefixes.service_bindings.create( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - cidr="192.0.2.0/24", - service_id="2db684ee7ca04e159946fd05b99e1bcd", - ) - assert_matches_type(Optional[ServiceBinding], service_binding, path=["response"]) - - @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addressing.prefixes.service_bindings.with_raw_response.create( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - service_binding = await response.parse() - assert_matches_type(Optional[ServiceBinding], service_binding, path=["response"]) - - @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.addressing.prefixes.service_bindings.with_streaming_response.create( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - service_binding = await response.parse() - assert_matches_type(Optional[ServiceBinding], service_binding, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.addressing.prefixes.service_bindings.with_raw_response.create( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - await async_client.addressing.prefixes.service_bindings.with_raw_response.create( - prefix_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - - @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - service_binding = await async_client.addressing.prefixes.service_bindings.list( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - assert_matches_type(AsyncSinglePage[ServiceBinding], service_binding, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addressing.prefixes.service_bindings.with_raw_response.list( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - service_binding = await response.parse() - assert_matches_type(AsyncSinglePage[ServiceBinding], service_binding, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.addressing.prefixes.service_bindings.with_streaming_response.list( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - service_binding = await response.parse() - assert_matches_type(AsyncSinglePage[ServiceBinding], service_binding, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.addressing.prefixes.service_bindings.with_raw_response.list( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - await async_client.addressing.prefixes.service_bindings.with_raw_response.list( - prefix_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - - @parametrize - async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - service_binding = await async_client.addressing.prefixes.service_bindings.delete( - binding_id="0429b49b6a5155297b78e75a44b09e14", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) - assert_matches_type(ServiceBindingDeleteResponse, service_binding, path=["response"]) - - @parametrize - async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addressing.prefixes.service_bindings.with_raw_response.delete( - binding_id="0429b49b6a5155297b78e75a44b09e14", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - service_binding = await response.parse() - assert_matches_type(ServiceBindingDeleteResponse, service_binding, path=["response"]) - - @parametrize - async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.addressing.prefixes.service_bindings.with_streaming_response.delete( - binding_id="0429b49b6a5155297b78e75a44b09e14", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - service_binding = await response.parse() - assert_matches_type(ServiceBindingDeleteResponse, service_binding, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.addressing.prefixes.service_bindings.with_raw_response.delete( - binding_id="0429b49b6a5155297b78e75a44b09e14", - account_id="", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - await async_client.addressing.prefixes.service_bindings.with_raw_response.delete( - binding_id="0429b49b6a5155297b78e75a44b09e14", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `binding_id` but received ''"): - await async_client.addressing.prefixes.service_bindings.with_raw_response.delete( - binding_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) - - @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - service_binding = await async_client.addressing.prefixes.service_bindings.get( - binding_id="0429b49b6a5155297b78e75a44b09e14", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) - assert_matches_type(Optional[ServiceBinding], service_binding, path=["response"]) - - @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addressing.prefixes.service_bindings.with_raw_response.get( - binding_id="0429b49b6a5155297b78e75a44b09e14", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - service_binding = await response.parse() - assert_matches_type(Optional[ServiceBinding], service_binding, path=["response"]) - - @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.addressing.prefixes.service_bindings.with_streaming_response.get( - binding_id="0429b49b6a5155297b78e75a44b09e14", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - service_binding = await response.parse() - assert_matches_type(Optional[ServiceBinding], service_binding, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.addressing.prefixes.service_bindings.with_raw_response.get( - binding_id="0429b49b6a5155297b78e75a44b09e14", - account_id="", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - await async_client.addressing.prefixes.service_bindings.with_raw_response.get( - binding_id="0429b49b6a5155297b78e75a44b09e14", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `binding_id` but received ''"): - await async_client.addressing.prefixes.service_bindings.with_raw_response.get( - binding_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", - prefix_id="2af39739cc4e3b5910c918468bb89828", - ) diff --git a/tests/api_resources/addressing/test_address_maps.py b/tests/api_resources/addressing/test_address_maps.py index ed645091db9..217bc4bbe15 100644 --- a/tests/api_resources/addressing/test_address_maps.py +++ b/tests/api_resources/addressing/test_address_maps.py @@ -26,14 +26,14 @@ class TestAddressMaps: @parametrize def test_method_create(self, client: Cloudflare) -> None: address_map = client.addressing.address_maps.create( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[AddressMapCreateResponse], address_map, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: address_map = client.addressing.address_maps.create( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", description="My Ecommerce zones", enabled=True, ips=["192.0.2.1"], @@ -49,7 +49,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: response = client.addressing.address_maps.with_raw_response.create( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -60,7 +60,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: with client.addressing.address_maps.with_streaming_response.create( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -80,14 +80,14 @@ def test_path_params_create(self, client: Cloudflare) -> None: @parametrize def test_method_list(self, client: Cloudflare) -> None: address_map = client.addressing.address_maps.list( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(SyncSinglePage[AddressMap], address_map, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.addressing.address_maps.with_raw_response.list( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -98,7 +98,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.addressing.address_maps.with_streaming_response.list( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -118,16 +118,16 @@ def test_path_params_list(self, client: Cloudflare) -> None: @parametrize def test_method_delete(self, client: Cloudflare) -> None: address_map = client.addressing.address_maps.delete( - address_map_id="055817b111884e0227e1be16a0be6ee0", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(AddressMapDeleteResponse, address_map, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: response = client.addressing.address_maps.with_raw_response.delete( - address_map_id="055817b111884e0227e1be16a0be6ee0", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -138,8 +138,8 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: with client.addressing.address_maps.with_streaming_response.delete( - address_map_id="055817b111884e0227e1be16a0be6ee0", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -153,29 +153,29 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: def test_path_params_delete(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.addressing.address_maps.with_raw_response.delete( - address_map_id="055817b111884e0227e1be16a0be6ee0", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): client.addressing.address_maps.with_raw_response.delete( address_map_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @parametrize def test_method_edit(self, client: Cloudflare) -> None: address_map = client.addressing.address_maps.edit( - address_map_id="055817b111884e0227e1be16a0be6ee0", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[AddressMap], address_map, path=["response"]) @parametrize def test_method_edit_with_all_params(self, client: Cloudflare) -> None: address_map = client.addressing.address_maps.edit( - address_map_id="055817b111884e0227e1be16a0be6ee0", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", default_sni="*.example.com", description="My Ecommerce zones", enabled=True, @@ -185,8 +185,8 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: response = client.addressing.address_maps.with_raw_response.edit( - address_map_id="055817b111884e0227e1be16a0be6ee0", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -197,8 +197,8 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: with client.addressing.address_maps.with_streaming_response.edit( - address_map_id="055817b111884e0227e1be16a0be6ee0", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -212,29 +212,29 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: def test_path_params_edit(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.addressing.address_maps.with_raw_response.edit( - address_map_id="055817b111884e0227e1be16a0be6ee0", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): client.addressing.address_maps.with_raw_response.edit( address_map_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @parametrize def test_method_get(self, client: Cloudflare) -> None: address_map = client.addressing.address_maps.get( - address_map_id="055817b111884e0227e1be16a0be6ee0", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[AddressMapGetResponse], address_map, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: response = client.addressing.address_maps.with_raw_response.get( - address_map_id="055817b111884e0227e1be16a0be6ee0", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -245,8 +245,8 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: with client.addressing.address_maps.with_streaming_response.get( - address_map_id="055817b111884e0227e1be16a0be6ee0", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -260,14 +260,14 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.addressing.address_maps.with_raw_response.get( - address_map_id="055817b111884e0227e1be16a0be6ee0", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): client.addressing.address_maps.with_raw_response.get( address_map_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -277,14 +277,14 @@ class TestAsyncAddressMaps: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: address_map = await async_client.addressing.address_maps.create( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[AddressMapCreateResponse], address_map, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: address_map = await async_client.addressing.address_maps.create( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", description="My Ecommerce zones", enabled=True, ips=["192.0.2.1"], @@ -300,7 +300,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.address_maps.with_raw_response.create( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -311,7 +311,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.address_maps.with_streaming_response.create( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -331,14 +331,14 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: address_map = await async_client.addressing.address_maps.list( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(AsyncSinglePage[AddressMap], address_map, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.address_maps.with_raw_response.list( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -349,7 +349,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.address_maps.with_streaming_response.list( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -369,16 +369,16 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_delete(self, async_client: AsyncCloudflare) -> None: address_map = await async_client.addressing.address_maps.delete( - address_map_id="055817b111884e0227e1be16a0be6ee0", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(AddressMapDeleteResponse, address_map, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.address_maps.with_raw_response.delete( - address_map_id="055817b111884e0227e1be16a0be6ee0", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -389,8 +389,8 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.address_maps.with_streaming_response.delete( - address_map_id="055817b111884e0227e1be16a0be6ee0", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -404,29 +404,29 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.addressing.address_maps.with_raw_response.delete( - address_map_id="055817b111884e0227e1be16a0be6ee0", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): await async_client.addressing.address_maps.with_raw_response.delete( address_map_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @parametrize async def test_method_edit(self, async_client: AsyncCloudflare) -> None: address_map = await async_client.addressing.address_maps.edit( - address_map_id="055817b111884e0227e1be16a0be6ee0", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[AddressMap], address_map, path=["response"]) @parametrize async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: address_map = await async_client.addressing.address_maps.edit( - address_map_id="055817b111884e0227e1be16a0be6ee0", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", default_sni="*.example.com", description="My Ecommerce zones", enabled=True, @@ -436,8 +436,8 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.address_maps.with_raw_response.edit( - address_map_id="055817b111884e0227e1be16a0be6ee0", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -448,8 +448,8 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.address_maps.with_streaming_response.edit( - address_map_id="055817b111884e0227e1be16a0be6ee0", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -463,29 +463,29 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.addressing.address_maps.with_raw_response.edit( - address_map_id="055817b111884e0227e1be16a0be6ee0", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): await async_client.addressing.address_maps.with_raw_response.edit( address_map_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: address_map = await async_client.addressing.address_maps.get( - address_map_id="055817b111884e0227e1be16a0be6ee0", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[AddressMapGetResponse], address_map, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.address_maps.with_raw_response.get( - address_map_id="055817b111884e0227e1be16a0be6ee0", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -496,8 +496,8 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.address_maps.with_streaming_response.get( - address_map_id="055817b111884e0227e1be16a0be6ee0", - account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -511,12 +511,12 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.addressing.address_maps.with_raw_response.get( - address_map_id="055817b111884e0227e1be16a0be6ee0", + address_map_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): await async_client.addressing.address_maps.with_raw_response.get( address_map_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/addressing/test_loa_documents.py b/tests/api_resources/addressing/test_loa_documents.py index 6cfbe04f072..b3bc8c3e862 100644 --- a/tests/api_resources/addressing/test_loa_documents.py +++ b/tests/api_resources/addressing/test_loa_documents.py @@ -5,18 +5,10 @@ import os from typing import Any, Optional, cast -import httpx import pytest -from respx import MockRouter from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare._response import ( - BinaryAPIResponse, - AsyncBinaryAPIResponse, - StreamedBinaryAPIResponse, - AsyncStreamedBinaryAPIResponse, -) from cloudflare.types.addressing import LOADocumentCreateResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -29,7 +21,7 @@ class TestLOADocuments: @parametrize def test_method_create(self, client: Cloudflare) -> None: loa_document = client.addressing.loa_documents.create( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", loa_document="@document.pdf", ) assert_matches_type(Optional[LOADocumentCreateResponse], loa_document, path=["response"]) @@ -38,7 +30,7 @@ def test_method_create(self, client: Cloudflare) -> None: @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: response = client.addressing.loa_documents.with_raw_response.create( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", loa_document="@document.pdf", ) @@ -51,7 +43,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: with client.addressing.loa_documents.with_streaming_response.create( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", loa_document="@document.pdf", ) as response: assert not response.is_closed @@ -71,84 +63,6 @@ def test_path_params_create(self, client: Cloudflare) -> None: loa_document="@document.pdf", ) - @pytest.mark.skip( - reason="TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489" - ) - @parametrize - @pytest.mark.respx(base_url=base_url) - def test_method_get(self, client: Cloudflare, respx_mock: MockRouter) -> None: - respx_mock.get( - "/accounts/258def64c72dae45f3e4c8516e2111f2/addressing/loa_documents/d933b1530bc56c9953cf8ce166da8004/download" - ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) - loa_document = client.addressing.loa_documents.get( - loa_document_id="d933b1530bc56c9953cf8ce166da8004", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - assert loa_document.is_closed - assert loa_document.json() == {"foo": "bar"} - assert cast(Any, loa_document.is_closed) is True - assert isinstance(loa_document, BinaryAPIResponse) - - @pytest.mark.skip( - reason="TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489" - ) - @parametrize - @pytest.mark.respx(base_url=base_url) - def test_raw_response_get(self, client: Cloudflare, respx_mock: MockRouter) -> None: - respx_mock.get( - "/accounts/258def64c72dae45f3e4c8516e2111f2/addressing/loa_documents/d933b1530bc56c9953cf8ce166da8004/download" - ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) - - loa_document = client.addressing.loa_documents.with_raw_response.get( - loa_document_id="d933b1530bc56c9953cf8ce166da8004", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - - assert loa_document.is_closed is True - assert loa_document.http_request.headers.get("X-Stainless-Lang") == "python" - assert loa_document.json() == {"foo": "bar"} - assert isinstance(loa_document, BinaryAPIResponse) - - @pytest.mark.skip( - reason="TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489" - ) - @parametrize - @pytest.mark.respx(base_url=base_url) - def test_streaming_response_get(self, client: Cloudflare, respx_mock: MockRouter) -> None: - respx_mock.get( - "/accounts/258def64c72dae45f3e4c8516e2111f2/addressing/loa_documents/d933b1530bc56c9953cf8ce166da8004/download" - ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) - with client.addressing.loa_documents.with_streaming_response.get( - loa_document_id="d933b1530bc56c9953cf8ce166da8004", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) as loa_document: - assert not loa_document.is_closed - assert loa_document.http_request.headers.get("X-Stainless-Lang") == "python" - - assert loa_document.json() == {"foo": "bar"} - assert cast(Any, loa_document.is_closed) is True - assert isinstance(loa_document, StreamedBinaryAPIResponse) - - assert cast(Any, loa_document.is_closed) is True - - @pytest.mark.skip( - reason="TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489" - ) - @parametrize - @pytest.mark.respx(base_url=base_url) - def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.addressing.loa_documents.with_raw_response.get( - loa_document_id="d933b1530bc56c9953cf8ce166da8004", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `loa_document_id` but received ''"): - client.addressing.loa_documents.with_raw_response.get( - loa_document_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - class TestAsyncLOADocuments: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -157,7 +71,7 @@ class TestAsyncLOADocuments: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: loa_document = await async_client.addressing.loa_documents.create( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", loa_document="@document.pdf", ) assert_matches_type(Optional[LOADocumentCreateResponse], loa_document, path=["response"]) @@ -166,7 +80,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.loa_documents.with_raw_response.create( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", loa_document="@document.pdf", ) @@ -179,7 +93,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.loa_documents.with_streaming_response.create( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", loa_document="@document.pdf", ) as response: assert not response.is_closed @@ -198,81 +112,3 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: account_id="", loa_document="@document.pdf", ) - - @pytest.mark.skip( - reason="TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489" - ) - @parametrize - @pytest.mark.respx(base_url=base_url) - async def test_method_get(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None: - respx_mock.get( - "/accounts/258def64c72dae45f3e4c8516e2111f2/addressing/loa_documents/d933b1530bc56c9953cf8ce166da8004/download" - ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) - loa_document = await async_client.addressing.loa_documents.get( - loa_document_id="d933b1530bc56c9953cf8ce166da8004", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - assert loa_document.is_closed - assert await loa_document.json() == {"foo": "bar"} - assert cast(Any, loa_document.is_closed) is True - assert isinstance(loa_document, AsyncBinaryAPIResponse) - - @pytest.mark.skip( - reason="TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489" - ) - @parametrize - @pytest.mark.respx(base_url=base_url) - async def test_raw_response_get(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None: - respx_mock.get( - "/accounts/258def64c72dae45f3e4c8516e2111f2/addressing/loa_documents/d933b1530bc56c9953cf8ce166da8004/download" - ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) - - loa_document = await async_client.addressing.loa_documents.with_raw_response.get( - loa_document_id="d933b1530bc56c9953cf8ce166da8004", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) - - assert loa_document.is_closed is True - assert loa_document.http_request.headers.get("X-Stainless-Lang") == "python" - assert await loa_document.json() == {"foo": "bar"} - assert isinstance(loa_document, AsyncBinaryAPIResponse) - - @pytest.mark.skip( - reason="TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489" - ) - @parametrize - @pytest.mark.respx(base_url=base_url) - async def test_streaming_response_get(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None: - respx_mock.get( - "/accounts/258def64c72dae45f3e4c8516e2111f2/addressing/loa_documents/d933b1530bc56c9953cf8ce166da8004/download" - ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) - async with async_client.addressing.loa_documents.with_streaming_response.get( - loa_document_id="d933b1530bc56c9953cf8ce166da8004", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) as loa_document: - assert not loa_document.is_closed - assert loa_document.http_request.headers.get("X-Stainless-Lang") == "python" - - assert await loa_document.json() == {"foo": "bar"} - assert cast(Any, loa_document.is_closed) is True - assert isinstance(loa_document, AsyncStreamedBinaryAPIResponse) - - assert cast(Any, loa_document.is_closed) is True - - @pytest.mark.skip( - reason="TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489" - ) - @parametrize - @pytest.mark.respx(base_url=base_url) - async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.addressing.loa_documents.with_raw_response.get( - loa_document_id="d933b1530bc56c9953cf8ce166da8004", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `loa_document_id` but received ''"): - await async_client.addressing.loa_documents.with_raw_response.get( - loa_document_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", - ) diff --git a/tests/api_resources/addressing/test_prefixes.py b/tests/api_resources/addressing/test_prefixes.py index 955b4eaa157..bf75c6e7bd0 100644 --- a/tests/api_resources/addressing/test_prefixes.py +++ b/tests/api_resources/addressing/test_prefixes.py @@ -21,7 +21,7 @@ class TestPrefixes: @parametrize def test_method_create(self, client: Cloudflare) -> None: prefix = client.addressing.prefixes.create( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", asn=209242, cidr="192.0.2.0/24", loa_document_id="d933b1530bc56c9953cf8ce166da8004", @@ -31,7 +31,7 @@ def test_method_create(self, client: Cloudflare) -> None: @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: response = client.addressing.prefixes.with_raw_response.create( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", asn=209242, cidr="192.0.2.0/24", loa_document_id="d933b1530bc56c9953cf8ce166da8004", @@ -45,7 +45,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: with client.addressing.prefixes.with_streaming_response.create( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", asn=209242, cidr="192.0.2.0/24", loa_document_id="d933b1530bc56c9953cf8ce166da8004", @@ -71,14 +71,14 @@ def test_path_params_create(self, client: Cloudflare) -> None: @parametrize def test_method_list(self, client: Cloudflare) -> None: prefix = client.addressing.prefixes.list( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(SyncSinglePage[Prefix], prefix, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.addressing.prefixes.with_raw_response.list( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -89,7 +89,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.addressing.prefixes.with_streaming_response.list( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -109,16 +109,16 @@ def test_path_params_list(self, client: Cloudflare) -> None: @parametrize def test_method_delete(self, client: Cloudflare) -> None: prefix = client.addressing.prefixes.delete( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(PrefixDeleteResponse, prefix, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: response = client.addressing.prefixes.with_raw_response.delete( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -129,8 +129,8 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: with client.addressing.prefixes.with_streaming_response.delete( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -144,21 +144,21 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: def test_path_params_delete(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.addressing.prefixes.with_raw_response.delete( - prefix_id="2af39739cc4e3b5910c918468bb89828", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): client.addressing.prefixes.with_raw_response.delete( prefix_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @parametrize def test_method_edit(self, client: Cloudflare) -> None: prefix = client.addressing.prefixes.edit( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", description="Internal test prefix", ) assert_matches_type(Optional[Prefix], prefix, path=["response"]) @@ -166,8 +166,8 @@ def test_method_edit(self, client: Cloudflare) -> None: @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: response = client.addressing.prefixes.with_raw_response.edit( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", description="Internal test prefix", ) @@ -179,8 +179,8 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: with client.addressing.prefixes.with_streaming_response.edit( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", description="Internal test prefix", ) as response: assert not response.is_closed @@ -195,7 +195,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: def test_path_params_edit(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.addressing.prefixes.with_raw_response.edit( - prefix_id="2af39739cc4e3b5910c918468bb89828", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", description="Internal test prefix", ) @@ -203,23 +203,23 @@ def test_path_params_edit(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): client.addressing.prefixes.with_raw_response.edit( prefix_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", description="Internal test prefix", ) @parametrize def test_method_get(self, client: Cloudflare) -> None: prefix = client.addressing.prefixes.get( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[Prefix], prefix, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: response = client.addressing.prefixes.with_raw_response.get( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -230,8 +230,8 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: with client.addressing.prefixes.with_streaming_response.get( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -245,14 +245,14 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.addressing.prefixes.with_raw_response.get( - prefix_id="2af39739cc4e3b5910c918468bb89828", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): client.addressing.prefixes.with_raw_response.get( prefix_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -262,7 +262,7 @@ class TestAsyncPrefixes: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: prefix = await async_client.addressing.prefixes.create( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", asn=209242, cidr="192.0.2.0/24", loa_document_id="d933b1530bc56c9953cf8ce166da8004", @@ -272,7 +272,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.prefixes.with_raw_response.create( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", asn=209242, cidr="192.0.2.0/24", loa_document_id="d933b1530bc56c9953cf8ce166da8004", @@ -286,7 +286,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.prefixes.with_streaming_response.create( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", asn=209242, cidr="192.0.2.0/24", loa_document_id="d933b1530bc56c9953cf8ce166da8004", @@ -312,14 +312,14 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: prefix = await async_client.addressing.prefixes.list( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(AsyncSinglePage[Prefix], prefix, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.prefixes.with_raw_response.list( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -330,7 +330,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.prefixes.with_streaming_response.list( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -350,16 +350,16 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_delete(self, async_client: AsyncCloudflare) -> None: prefix = await async_client.addressing.prefixes.delete( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(PrefixDeleteResponse, prefix, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.prefixes.with_raw_response.delete( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -370,8 +370,8 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.prefixes.with_streaming_response.delete( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -385,21 +385,21 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.addressing.prefixes.with_raw_response.delete( - prefix_id="2af39739cc4e3b5910c918468bb89828", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): await async_client.addressing.prefixes.with_raw_response.delete( prefix_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @parametrize async def test_method_edit(self, async_client: AsyncCloudflare) -> None: prefix = await async_client.addressing.prefixes.edit( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", description="Internal test prefix", ) assert_matches_type(Optional[Prefix], prefix, path=["response"]) @@ -407,8 +407,8 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.prefixes.with_raw_response.edit( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", description="Internal test prefix", ) @@ -420,8 +420,8 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.prefixes.with_streaming_response.edit( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", description="Internal test prefix", ) as response: assert not response.is_closed @@ -436,7 +436,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.addressing.prefixes.with_raw_response.edit( - prefix_id="2af39739cc4e3b5910c918468bb89828", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", description="Internal test prefix", ) @@ -444,23 +444,23 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): await async_client.addressing.prefixes.with_raw_response.edit( prefix_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", description="Internal test prefix", ) @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: prefix = await async_client.addressing.prefixes.get( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[Prefix], prefix, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.prefixes.with_raw_response.get( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -471,8 +471,8 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.prefixes.with_streaming_response.get( - prefix_id="2af39739cc4e3b5910c918468bb89828", - account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -486,12 +486,12 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.addressing.prefixes.with_raw_response.get( - prefix_id="2af39739cc4e3b5910c918468bb89828", + prefix_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): await async_client.addressing.prefixes.with_raw_response.get( prefix_id="", - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/addressing/test_services.py b/tests/api_resources/addressing/test_services.py index 8d51e635ff9..e54cb33ece0 100644 --- a/tests/api_resources/addressing/test_services.py +++ b/tests/api_resources/addressing/test_services.py @@ -21,14 +21,14 @@ class TestServices: @parametrize def test_method_list(self, client: Cloudflare) -> None: service = client.addressing.services.list( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(SyncSinglePage[ServiceListResponse], service, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.addressing.services.with_raw_response.list( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -39,7 +39,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.addressing.services.with_streaming_response.list( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -63,14 +63,14 @@ class TestAsyncServices: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: service = await async_client.addressing.services.list( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(AsyncSinglePage[ServiceListResponse], service, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.services.with_raw_response.list( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -81,7 +81,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.services.with_streaming_response.list( - account_id="258def64c72dae45f3e4c8516e2111f2", + account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/ai/finetunes/test_assets.py b/tests/api_resources/ai/finetunes/test_assets.py deleted file mode 100644 index 1a692800031..00000000000 --- a/tests/api_resources/ai/finetunes/test_assets.py +++ /dev/null @@ -1,138 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.types.ai.finetunes import AssetCreateResponse - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestAssets: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_create(self, client: Cloudflare) -> None: - asset = client.ai.finetunes.assets.create( - finetune_id="bc451aef-f723-4b26-a6b2-901afd2e7a8a", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(AssetCreateResponse, asset, path=["response"]) - - @parametrize - def test_method_create_with_all_params(self, client: Cloudflare) -> None: - asset = client.ai.finetunes.assets.create( - finetune_id="bc451aef-f723-4b26-a6b2-901afd2e7a8a", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - file=b"raw file contents", - file_name="file_name", - ) - assert_matches_type(AssetCreateResponse, asset, path=["response"]) - - @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.ai.finetunes.assets.with_raw_response.create( - finetune_id="bc451aef-f723-4b26-a6b2-901afd2e7a8a", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - asset = response.parse() - assert_matches_type(AssetCreateResponse, asset, path=["response"]) - - @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.ai.finetunes.assets.with_streaming_response.create( - finetune_id="bc451aef-f723-4b26-a6b2-901afd2e7a8a", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - asset = response.parse() - assert_matches_type(AssetCreateResponse, asset, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.ai.finetunes.assets.with_raw_response.create( - finetune_id="bc451aef-f723-4b26-a6b2-901afd2e7a8a", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `finetune_id` but received ''"): - client.ai.finetunes.assets.with_raw_response.create( - finetune_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - -class TestAsyncAssets: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: - asset = await async_client.ai.finetunes.assets.create( - finetune_id="bc451aef-f723-4b26-a6b2-901afd2e7a8a", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(AssetCreateResponse, asset, path=["response"]) - - @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: - asset = await async_client.ai.finetunes.assets.create( - finetune_id="bc451aef-f723-4b26-a6b2-901afd2e7a8a", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - file=b"raw file contents", - file_name="file_name", - ) - assert_matches_type(AssetCreateResponse, asset, path=["response"]) - - @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.ai.finetunes.assets.with_raw_response.create( - finetune_id="bc451aef-f723-4b26-a6b2-901afd2e7a8a", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - asset = await response.parse() - assert_matches_type(AssetCreateResponse, asset, path=["response"]) - - @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.ai.finetunes.assets.with_streaming_response.create( - finetune_id="bc451aef-f723-4b26-a6b2-901afd2e7a8a", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - asset = await response.parse() - assert_matches_type(AssetCreateResponse, asset, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.ai.finetunes.assets.with_raw_response.create( - finetune_id="bc451aef-f723-4b26-a6b2-901afd2e7a8a", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `finetune_id` but received ''"): - await async_client.ai.finetunes.assets.with_raw_response.create( - finetune_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) diff --git a/tests/api_resources/ai/finetunes/test_public.py b/tests/api_resources/ai/finetunes/test_public.py deleted file mode 100644 index cc5f2b658c4..00000000000 --- a/tests/api_resources/ai/finetunes/test_public.py +++ /dev/null @@ -1,119 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.ai.finetunes import PublicListResponse - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestPublic: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - public = client.ai.finetunes.public.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(SyncSinglePage[PublicListResponse], public, path=["response"]) - - @parametrize - def test_method_list_with_all_params(self, client: Cloudflare) -> None: - public = client.ai.finetunes.public.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - limit=0, - offset=0, - order_by="orderBy", - ) - assert_matches_type(SyncSinglePage[PublicListResponse], public, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.ai.finetunes.public.with_raw_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - public = response.parse() - assert_matches_type(SyncSinglePage[PublicListResponse], public, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.ai.finetunes.public.with_streaming_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - public = response.parse() - assert_matches_type(SyncSinglePage[PublicListResponse], public, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.ai.finetunes.public.with_raw_response.list( - account_id="", - ) - - -class TestAsyncPublic: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - public = await async_client.ai.finetunes.public.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(AsyncSinglePage[PublicListResponse], public, path=["response"]) - - @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: - public = await async_client.ai.finetunes.public.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - limit=0, - offset=0, - order_by="orderBy", - ) - assert_matches_type(AsyncSinglePage[PublicListResponse], public, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.ai.finetunes.public.with_raw_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - public = await response.parse() - assert_matches_type(AsyncSinglePage[PublicListResponse], public, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.ai.finetunes.public.with_streaming_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - public = await response.parse() - assert_matches_type(AsyncSinglePage[PublicListResponse], public, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.ai.finetunes.public.with_raw_response.list( - account_id="", - ) diff --git a/tests/api_resources/ai/test_authors.py b/tests/api_resources/ai/test_authors.py deleted file mode 100644 index 16cdb1d7750..00000000000 --- a/tests/api_resources/ai/test_authors.py +++ /dev/null @@ -1,98 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.pagination import SyncSinglePage, AsyncSinglePage - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestAuthors: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - author = client.ai.authors.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(SyncSinglePage[object], author, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.ai.authors.with_raw_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - author = response.parse() - assert_matches_type(SyncSinglePage[object], author, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.ai.authors.with_streaming_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - author = response.parse() - assert_matches_type(SyncSinglePage[object], author, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.ai.authors.with_raw_response.list( - account_id="", - ) - - -class TestAsyncAuthors: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - author = await async_client.ai.authors.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(AsyncSinglePage[object], author, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.ai.authors.with_raw_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - author = await response.parse() - assert_matches_type(AsyncSinglePage[object], author, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.ai.authors.with_streaming_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - author = await response.parse() - assert_matches_type(AsyncSinglePage[object], author, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.ai.authors.with_raw_response.list( - account_id="", - ) diff --git a/tests/api_resources/ai/test_finetunes.py b/tests/api_resources/ai/test_finetunes.py deleted file mode 100644 index e01ec841666..00000000000 --- a/tests/api_resources/ai/test_finetunes.py +++ /dev/null @@ -1,212 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.types.ai import FinetuneListResponse, FinetuneCreateResponse - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestFinetunes: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_create(self, client: Cloudflare) -> None: - finetune = client.ai.finetunes.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - model="model", - name="name", - ) - assert_matches_type(FinetuneCreateResponse, finetune, path=["response"]) - - @parametrize - def test_method_create_with_all_params(self, client: Cloudflare) -> None: - finetune = client.ai.finetunes.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - model="model", - name="name", - description="description", - public=True, - ) - assert_matches_type(FinetuneCreateResponse, finetune, path=["response"]) - - @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.ai.finetunes.with_raw_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - model="model", - name="name", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - finetune = response.parse() - assert_matches_type(FinetuneCreateResponse, finetune, path=["response"]) - - @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.ai.finetunes.with_streaming_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - model="model", - name="name", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - finetune = response.parse() - assert_matches_type(FinetuneCreateResponse, finetune, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.ai.finetunes.with_raw_response.create( - account_id="", - model="model", - name="name", - ) - - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - finetune = client.ai.finetunes.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(FinetuneListResponse, finetune, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.ai.finetunes.with_raw_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - finetune = response.parse() - assert_matches_type(FinetuneListResponse, finetune, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.ai.finetunes.with_streaming_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - finetune = response.parse() - assert_matches_type(FinetuneListResponse, finetune, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.ai.finetunes.with_raw_response.list( - account_id="", - ) - - -class TestAsyncFinetunes: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: - finetune = await async_client.ai.finetunes.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - model="model", - name="name", - ) - assert_matches_type(FinetuneCreateResponse, finetune, path=["response"]) - - @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: - finetune = await async_client.ai.finetunes.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - model="model", - name="name", - description="description", - public=True, - ) - assert_matches_type(FinetuneCreateResponse, finetune, path=["response"]) - - @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.ai.finetunes.with_raw_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - model="model", - name="name", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - finetune = await response.parse() - assert_matches_type(FinetuneCreateResponse, finetune, path=["response"]) - - @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.ai.finetunes.with_streaming_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - model="model", - name="name", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - finetune = await response.parse() - assert_matches_type(FinetuneCreateResponse, finetune, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.ai.finetunes.with_raw_response.create( - account_id="", - model="model", - name="name", - ) - - @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - finetune = await async_client.ai.finetunes.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(FinetuneListResponse, finetune, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.ai.finetunes.with_raw_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - finetune = await response.parse() - assert_matches_type(FinetuneListResponse, finetune, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.ai.finetunes.with_streaming_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - finetune = await response.parse() - assert_matches_type(FinetuneListResponse, finetune, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.ai.finetunes.with_raw_response.list( - account_id="", - ) diff --git a/tests/api_resources/ai/test_models.py b/tests/api_resources/ai/test_models.py deleted file mode 100644 index 56897b9a250..00000000000 --- a/tests/api_resources/ai/test_models.py +++ /dev/null @@ -1,126 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestModels: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - model = client.ai.models.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(SyncV4PagePaginationArray[object], model, path=["response"]) - - @parametrize - def test_method_list_with_all_params(self, client: Cloudflare) -> None: - model = client.ai.models.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - author="author", - hide_experimental=True, - page=0, - per_page=0, - search="search", - source=0, - task="Text Generation", - ) - assert_matches_type(SyncV4PagePaginationArray[object], model, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.ai.models.with_raw_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - model = response.parse() - assert_matches_type(SyncV4PagePaginationArray[object], model, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.ai.models.with_streaming_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - model = response.parse() - assert_matches_type(SyncV4PagePaginationArray[object], model, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.ai.models.with_raw_response.list( - account_id="", - ) - - -class TestAsyncModels: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - model = await async_client.ai.models.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(AsyncV4PagePaginationArray[object], model, path=["response"]) - - @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: - model = await async_client.ai.models.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - author="author", - hide_experimental=True, - page=0, - per_page=0, - search="search", - source=0, - task="Text Generation", - ) - assert_matches_type(AsyncV4PagePaginationArray[object], model, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.ai.models.with_raw_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - model = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[object], model, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.ai.models.with_streaming_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - model = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[object], model, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.ai.models.with_raw_response.list( - account_id="", - ) diff --git a/tests/api_resources/ai/test_tasks.py b/tests/api_resources/ai/test_tasks.py deleted file mode 100644 index 4383e0af353..00000000000 --- a/tests/api_resources/ai/test_tasks.py +++ /dev/null @@ -1,98 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.pagination import SyncSinglePage, AsyncSinglePage - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestTasks: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - task = client.ai.tasks.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(SyncSinglePage[object], task, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.ai.tasks.with_raw_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - task = response.parse() - assert_matches_type(SyncSinglePage[object], task, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.ai.tasks.with_streaming_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - task = response.parse() - assert_matches_type(SyncSinglePage[object], task, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.ai.tasks.with_raw_response.list( - account_id="", - ) - - -class TestAsyncTasks: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - task = await async_client.ai.tasks.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(AsyncSinglePage[object], task, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.ai.tasks.with_raw_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - task = await response.parse() - assert_matches_type(AsyncSinglePage[object], task, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.ai.tasks.with_streaming_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - task = await response.parse() - assert_matches_type(AsyncSinglePage[object], task, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.ai.tasks.with_raw_response.list( - account_id="", - ) diff --git a/tests/api_resources/ai_gateway/test_datasets.py b/tests/api_resources/ai_gateway/test_datasets.py index dc7ab2a74c5..b89ce377825 100644 --- a/tests/api_resources/ai_gateway/test_datasets.py +++ b/tests/api_resources/ai_gateway/test_datasets.py @@ -246,6 +246,8 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0", enable=True, name="name", + order_by="order_by", + order_by_direction="asc", page=1, per_page=1, search="search", @@ -638,6 +640,8 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0", enable=True, name="name", + order_by="order_by", + order_by_direction="asc", page=1, per_page=1, search="search", diff --git a/tests/api_resources/ai_gateway/test_evaluations.py b/tests/api_resources/ai_gateway/test_evaluations.py index 444549e3cef..6d6566a3b2d 100644 --- a/tests/api_resources/ai_gateway/test_evaluations.py +++ b/tests/api_resources/ai_gateway/test_evaluations.py @@ -100,6 +100,8 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: gateway_id="my-gateway", account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0", name="name", + order_by="order_by", + order_by_direction="asc", page=1, per_page=1, processed=True, @@ -348,6 +350,8 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) gateway_id="my-gateway", account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0", name="name", + order_by="order_by", + order_by_direction="asc", page=1, per_page=1, processed=True, diff --git a/tests/api_resources/ai_gateway/test_logs.py b/tests/api_resources/ai_gateway/test_logs.py index 4be76ce1282..44ff2500f24 100644 --- a/tests/api_resources/ai_gateway/test_logs.py +++ b/tests/api_resources/ai_gateway/test_logs.py @@ -42,7 +42,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: feedback=0, filters=[ { - "key": "id", + "key": "created_at", "operator": "eq", "value": ["string"], } @@ -128,7 +128,7 @@ def test_method_delete_with_all_params(self, client: Cloudflare) -> None: account_id="0d37909e38d3e99c29fa2cd343ac421a", filters=[ { - "key": "id", + "key": "created_at", "operator": "eq", "value": ["string"], } @@ -454,7 +454,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) feedback=0, filters=[ { - "key": "id", + "key": "created_at", "operator": "eq", "value": ["string"], } @@ -540,7 +540,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare account_id="0d37909e38d3e99c29fa2cd343ac421a", filters=[ { - "key": "id", + "key": "created_at", "operator": "eq", "value": ["string"], } diff --git a/tests/api_resources/api_gateway/test_operations.py b/tests/api_resources/api_gateway/test_operations.py index f61103adcc9..2be09e57fa3 100644 --- a/tests/api_resources/api_gateway/test_operations.py +++ b/tests/api_resources/api_gateway/test_operations.py @@ -15,7 +15,6 @@ OperationListResponse, OperationCreateResponse, OperationDeleteResponse, - OperationBulkCreateResponse, OperationBulkDeleteResponse, ) @@ -29,9 +28,13 @@ class TestOperations: def test_method_create(self, client: Cloudflare) -> None: operation = client.api_gateway.operations.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - endpoint="/api/v1/users/{var1}", - host="www.example.com", - method="GET", + body=[ + { + "endpoint": "/api/v1/users/{var1}", + "host": "www.example.com", + "method": "GET", + } + ], ) assert_matches_type(OperationCreateResponse, operation, path=["response"]) @@ -39,9 +42,13 @@ def test_method_create(self, client: Cloudflare) -> None: def test_raw_response_create(self, client: Cloudflare) -> None: response = client.api_gateway.operations.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - endpoint="/api/v1/users/{var1}", - host="www.example.com", - method="GET", + body=[ + { + "endpoint": "/api/v1/users/{var1}", + "host": "www.example.com", + "method": "GET", + } + ], ) assert response.is_closed is True @@ -53,9 +60,13 @@ def test_raw_response_create(self, client: Cloudflare) -> None: def test_streaming_response_create(self, client: Cloudflare) -> None: with client.api_gateway.operations.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - endpoint="/api/v1/users/{var1}", - host="www.example.com", - method="GET", + body=[ + { + "endpoint": "/api/v1/users/{var1}", + "host": "www.example.com", + "method": "GET", + } + ], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -70,9 +81,13 @@ def test_path_params_create(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.api_gateway.operations.with_raw_response.create( zone_id="", - endpoint="/api/v1/users/{var1}", - host="www.example.com", - method="GET", + body=[ + { + "endpoint": "/api/v1/users/{var1}", + "host": "www.example.com", + "method": "GET", + } + ], ) @parametrize @@ -176,72 +191,6 @@ def test_path_params_delete(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - @parametrize - def test_method_bulk_create(self, client: Cloudflare) -> None: - operation = client.api_gateway.operations.bulk_create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[ - { - "endpoint": "/api/v1/users/{var1}", - "host": "www.example.com", - "method": "GET", - } - ], - ) - assert_matches_type(OperationBulkCreateResponse, operation, path=["response"]) - - @parametrize - def test_raw_response_bulk_create(self, client: Cloudflare) -> None: - response = client.api_gateway.operations.with_raw_response.bulk_create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[ - { - "endpoint": "/api/v1/users/{var1}", - "host": "www.example.com", - "method": "GET", - } - ], - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - operation = response.parse() - assert_matches_type(OperationBulkCreateResponse, operation, path=["response"]) - - @parametrize - def test_streaming_response_bulk_create(self, client: Cloudflare) -> None: - with client.api_gateway.operations.with_streaming_response.bulk_create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[ - { - "endpoint": "/api/v1/users/{var1}", - "host": "www.example.com", - "method": "GET", - } - ], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - operation = response.parse() - assert_matches_type(OperationBulkCreateResponse, operation, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_bulk_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.api_gateway.operations.with_raw_response.bulk_create( - zone_id="", - body=[ - { - "endpoint": "/api/v1/users/{var1}", - "host": "www.example.com", - "method": "GET", - } - ], - ) - @parametrize def test_method_bulk_delete(self, client: Cloudflare) -> None: operation = client.api_gateway.operations.bulk_delete( @@ -345,9 +294,13 @@ class TestAsyncOperations: async def test_method_create(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.operations.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - endpoint="/api/v1/users/{var1}", - host="www.example.com", - method="GET", + body=[ + { + "endpoint": "/api/v1/users/{var1}", + "host": "www.example.com", + "method": "GET", + } + ], ) assert_matches_type(OperationCreateResponse, operation, path=["response"]) @@ -355,9 +308,13 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.operations.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - endpoint="/api/v1/users/{var1}", - host="www.example.com", - method="GET", + body=[ + { + "endpoint": "/api/v1/users/{var1}", + "host": "www.example.com", + "method": "GET", + } + ], ) assert response.is_closed is True @@ -369,9 +326,13 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.operations.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - endpoint="/api/v1/users/{var1}", - host="www.example.com", - method="GET", + body=[ + { + "endpoint": "/api/v1/users/{var1}", + "host": "www.example.com", + "method": "GET", + } + ], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -386,9 +347,13 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.api_gateway.operations.with_raw_response.create( zone_id="", - endpoint="/api/v1/users/{var1}", - host="www.example.com", - method="GET", + body=[ + { + "endpoint": "/api/v1/users/{var1}", + "host": "www.example.com", + "method": "GET", + } + ], ) @parametrize @@ -492,72 +457,6 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - @parametrize - async def test_method_bulk_create(self, async_client: AsyncCloudflare) -> None: - operation = await async_client.api_gateway.operations.bulk_create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[ - { - "endpoint": "/api/v1/users/{var1}", - "host": "www.example.com", - "method": "GET", - } - ], - ) - assert_matches_type(OperationBulkCreateResponse, operation, path=["response"]) - - @parametrize - async def test_raw_response_bulk_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.api_gateway.operations.with_raw_response.bulk_create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[ - { - "endpoint": "/api/v1/users/{var1}", - "host": "www.example.com", - "method": "GET", - } - ], - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - operation = await response.parse() - assert_matches_type(OperationBulkCreateResponse, operation, path=["response"]) - - @parametrize - async def test_streaming_response_bulk_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.api_gateway.operations.with_streaming_response.bulk_create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[ - { - "endpoint": "/api/v1/users/{var1}", - "host": "www.example.com", - "method": "GET", - } - ], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - operation = await response.parse() - assert_matches_type(OperationBulkCreateResponse, operation, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_bulk_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.api_gateway.operations.with_raw_response.bulk_create( - zone_id="", - body=[ - { - "endpoint": "/api/v1/users/{var1}", - "host": "www.example.com", - "method": "GET", - } - ], - ) - @parametrize async def test_method_bulk_delete(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.operations.bulk_delete( diff --git a/tests/api_resources/argo/test_tiered_caching.py b/tests/api_resources/argo/test_tiered_caching.py index d91060caa7b..9afbafa5d1c 100644 --- a/tests/api_resources/argo/test_tiered_caching.py +++ b/tests/api_resources/argo/test_tiered_caching.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest @@ -23,7 +23,7 @@ def test_method_edit(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", value="on", ) - assert_matches_type(Optional[TieredCachingEditResponse], tiered_caching, path=["response"]) + assert_matches_type(TieredCachingEditResponse, tiered_caching, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: @@ -35,7 +35,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" tiered_caching = response.parse() - assert_matches_type(Optional[TieredCachingEditResponse], tiered_caching, path=["response"]) + assert_matches_type(TieredCachingEditResponse, tiered_caching, path=["response"]) @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: @@ -47,7 +47,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" tiered_caching = response.parse() - assert_matches_type(Optional[TieredCachingEditResponse], tiered_caching, path=["response"]) + assert_matches_type(TieredCachingEditResponse, tiered_caching, path=["response"]) assert cast(Any, response.is_closed) is True @@ -64,7 +64,7 @@ def test_method_get(self, client: Cloudflare) -> None: tiered_caching = client.argo.tiered_caching.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[TieredCachingGetResponse], tiered_caching, path=["response"]) + assert_matches_type(TieredCachingGetResponse, tiered_caching, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -75,7 +75,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" tiered_caching = response.parse() - assert_matches_type(Optional[TieredCachingGetResponse], tiered_caching, path=["response"]) + assert_matches_type(TieredCachingGetResponse, tiered_caching, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -86,7 +86,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" tiered_caching = response.parse() - assert_matches_type(Optional[TieredCachingGetResponse], tiered_caching, path=["response"]) + assert_matches_type(TieredCachingGetResponse, tiered_caching, path=["response"]) assert cast(Any, response.is_closed) is True @@ -107,7 +107,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", value="on", ) - assert_matches_type(Optional[TieredCachingEditResponse], tiered_caching, path=["response"]) + assert_matches_type(TieredCachingEditResponse, tiered_caching, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -119,7 +119,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" tiered_caching = await response.parse() - assert_matches_type(Optional[TieredCachingEditResponse], tiered_caching, path=["response"]) + assert_matches_type(TieredCachingEditResponse, tiered_caching, path=["response"]) @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -131,7 +131,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" tiered_caching = await response.parse() - assert_matches_type(Optional[TieredCachingEditResponse], tiered_caching, path=["response"]) + assert_matches_type(TieredCachingEditResponse, tiered_caching, path=["response"]) assert cast(Any, response.is_closed) is True @@ -148,7 +148,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: tiered_caching = await async_client.argo.tiered_caching.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[TieredCachingGetResponse], tiered_caching, path=["response"]) + assert_matches_type(TieredCachingGetResponse, tiered_caching, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -159,7 +159,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" tiered_caching = await response.parse() - assert_matches_type(Optional[TieredCachingGetResponse], tiered_caching, path=["response"]) + assert_matches_type(TieredCachingGetResponse, tiered_caching, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -170,7 +170,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" tiered_caching = await response.parse() - assert_matches_type(Optional[TieredCachingGetResponse], tiered_caching, path=["response"]) + assert_matches_type(TieredCachingGetResponse, tiered_caching, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/cache/test_cache_reserve.py b/tests/api_resources/cache/test_cache_reserve.py index 1d125319b6f..1d1478215cf 100644 --- a/tests/api_resources/cache/test_cache_reserve.py +++ b/tests/api_resources/cache/test_cache_reserve.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest @@ -28,7 +28,7 @@ def test_method_clear(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(Optional[CacheReserveClearResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveClearResponse, cache_reserve, path=["response"]) @parametrize def test_raw_response_clear(self, client: Cloudflare) -> None: @@ -40,7 +40,7 @@ def test_raw_response_clear(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = response.parse() - assert_matches_type(Optional[CacheReserveClearResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveClearResponse, cache_reserve, path=["response"]) @parametrize def test_streaming_response_clear(self, client: Cloudflare) -> None: @@ -52,7 +52,7 @@ def test_streaming_response_clear(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = response.parse() - assert_matches_type(Optional[CacheReserveClearResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveClearResponse, cache_reserve, path=["response"]) assert cast(Any, response.is_closed) is True @@ -70,7 +70,7 @@ def test_method_edit(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", value="on", ) - assert_matches_type(Optional[CacheReserveEditResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveEditResponse, cache_reserve, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: @@ -82,7 +82,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = response.parse() - assert_matches_type(Optional[CacheReserveEditResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveEditResponse, cache_reserve, path=["response"]) @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: @@ -94,7 +94,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = response.parse() - assert_matches_type(Optional[CacheReserveEditResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveEditResponse, cache_reserve, path=["response"]) assert cast(Any, response.is_closed) is True @@ -111,7 +111,7 @@ def test_method_get(self, client: Cloudflare) -> None: cache_reserve = client.cache.cache_reserve.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[CacheReserveGetResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveGetResponse, cache_reserve, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -122,7 +122,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = response.parse() - assert_matches_type(Optional[CacheReserveGetResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveGetResponse, cache_reserve, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -133,7 +133,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = response.parse() - assert_matches_type(Optional[CacheReserveGetResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveGetResponse, cache_reserve, path=["response"]) assert cast(Any, response.is_closed) is True @@ -149,7 +149,7 @@ def test_method_status(self, client: Cloudflare) -> None: cache_reserve = client.cache.cache_reserve.status( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[CacheReserveStatusResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveStatusResponse, cache_reserve, path=["response"]) @parametrize def test_raw_response_status(self, client: Cloudflare) -> None: @@ -160,7 +160,7 @@ def test_raw_response_status(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = response.parse() - assert_matches_type(Optional[CacheReserveStatusResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveStatusResponse, cache_reserve, path=["response"]) @parametrize def test_streaming_response_status(self, client: Cloudflare) -> None: @@ -171,7 +171,7 @@ def test_streaming_response_status(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = response.parse() - assert_matches_type(Optional[CacheReserveStatusResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveStatusResponse, cache_reserve, path=["response"]) assert cast(Any, response.is_closed) is True @@ -192,7 +192,7 @@ async def test_method_clear(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(Optional[CacheReserveClearResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveClearResponse, cache_reserve, path=["response"]) @parametrize async def test_raw_response_clear(self, async_client: AsyncCloudflare) -> None: @@ -204,7 +204,7 @@ async def test_raw_response_clear(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = await response.parse() - assert_matches_type(Optional[CacheReserveClearResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveClearResponse, cache_reserve, path=["response"]) @parametrize async def test_streaming_response_clear(self, async_client: AsyncCloudflare) -> None: @@ -216,7 +216,7 @@ async def test_streaming_response_clear(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = await response.parse() - assert_matches_type(Optional[CacheReserveClearResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveClearResponse, cache_reserve, path=["response"]) assert cast(Any, response.is_closed) is True @@ -234,7 +234,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", value="on", ) - assert_matches_type(Optional[CacheReserveEditResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveEditResponse, cache_reserve, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -246,7 +246,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = await response.parse() - assert_matches_type(Optional[CacheReserveEditResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveEditResponse, cache_reserve, path=["response"]) @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -258,7 +258,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = await response.parse() - assert_matches_type(Optional[CacheReserveEditResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveEditResponse, cache_reserve, path=["response"]) assert cast(Any, response.is_closed) is True @@ -275,7 +275,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: cache_reserve = await async_client.cache.cache_reserve.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[CacheReserveGetResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveGetResponse, cache_reserve, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -286,7 +286,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = await response.parse() - assert_matches_type(Optional[CacheReserveGetResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveGetResponse, cache_reserve, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -297,7 +297,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = await response.parse() - assert_matches_type(Optional[CacheReserveGetResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveGetResponse, cache_reserve, path=["response"]) assert cast(Any, response.is_closed) is True @@ -313,7 +313,7 @@ async def test_method_status(self, async_client: AsyncCloudflare) -> None: cache_reserve = await async_client.cache.cache_reserve.status( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[CacheReserveStatusResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveStatusResponse, cache_reserve, path=["response"]) @parametrize async def test_raw_response_status(self, async_client: AsyncCloudflare) -> None: @@ -324,7 +324,7 @@ async def test_raw_response_status(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = await response.parse() - assert_matches_type(Optional[CacheReserveStatusResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveStatusResponse, cache_reserve, path=["response"]) @parametrize async def test_streaming_response_status(self, async_client: AsyncCloudflare) -> None: @@ -335,7 +335,7 @@ async def test_streaming_response_status(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = await response.parse() - assert_matches_type(Optional[CacheReserveStatusResponse], cache_reserve, path=["response"]) + assert_matches_type(CacheReserveStatusResponse, cache_reserve, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/cache/test_regional_tiered_cache.py b/tests/api_resources/cache/test_regional_tiered_cache.py index 98deff2adf5..ec3ddfeb861 100644 --- a/tests/api_resources/cache/test_regional_tiered_cache.py +++ b/tests/api_resources/cache/test_regional_tiered_cache.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest @@ -26,7 +26,7 @@ def test_method_edit(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", value="on", ) - assert_matches_type(Optional[RegionalTieredCacheEditResponse], regional_tiered_cache, path=["response"]) + assert_matches_type(RegionalTieredCacheEditResponse, regional_tiered_cache, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: @@ -38,7 +38,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" regional_tiered_cache = response.parse() - assert_matches_type(Optional[RegionalTieredCacheEditResponse], regional_tiered_cache, path=["response"]) + assert_matches_type(RegionalTieredCacheEditResponse, regional_tiered_cache, path=["response"]) @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: @@ -50,7 +50,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" regional_tiered_cache = response.parse() - assert_matches_type(Optional[RegionalTieredCacheEditResponse], regional_tiered_cache, path=["response"]) + assert_matches_type(RegionalTieredCacheEditResponse, regional_tiered_cache, path=["response"]) assert cast(Any, response.is_closed) is True @@ -67,7 +67,7 @@ def test_method_get(self, client: Cloudflare) -> None: regional_tiered_cache = client.cache.regional_tiered_cache.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RegionalTieredCacheGetResponse], regional_tiered_cache, path=["response"]) + assert_matches_type(RegionalTieredCacheGetResponse, regional_tiered_cache, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -78,7 +78,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" regional_tiered_cache = response.parse() - assert_matches_type(Optional[RegionalTieredCacheGetResponse], regional_tiered_cache, path=["response"]) + assert_matches_type(RegionalTieredCacheGetResponse, regional_tiered_cache, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -89,7 +89,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" regional_tiered_cache = response.parse() - assert_matches_type(Optional[RegionalTieredCacheGetResponse], regional_tiered_cache, path=["response"]) + assert_matches_type(RegionalTieredCacheGetResponse, regional_tiered_cache, path=["response"]) assert cast(Any, response.is_closed) is True @@ -110,7 +110,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", value="on", ) - assert_matches_type(Optional[RegionalTieredCacheEditResponse], regional_tiered_cache, path=["response"]) + assert_matches_type(RegionalTieredCacheEditResponse, regional_tiered_cache, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -122,7 +122,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" regional_tiered_cache = await response.parse() - assert_matches_type(Optional[RegionalTieredCacheEditResponse], regional_tiered_cache, path=["response"]) + assert_matches_type(RegionalTieredCacheEditResponse, regional_tiered_cache, path=["response"]) @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -134,7 +134,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" regional_tiered_cache = await response.parse() - assert_matches_type(Optional[RegionalTieredCacheEditResponse], regional_tiered_cache, path=["response"]) + assert_matches_type(RegionalTieredCacheEditResponse, regional_tiered_cache, path=["response"]) assert cast(Any, response.is_closed) is True @@ -151,7 +151,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: regional_tiered_cache = await async_client.cache.regional_tiered_cache.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RegionalTieredCacheGetResponse], regional_tiered_cache, path=["response"]) + assert_matches_type(RegionalTieredCacheGetResponse, regional_tiered_cache, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -162,7 +162,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" regional_tiered_cache = await response.parse() - assert_matches_type(Optional[RegionalTieredCacheGetResponse], regional_tiered_cache, path=["response"]) + assert_matches_type(RegionalTieredCacheGetResponse, regional_tiered_cache, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -173,7 +173,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" regional_tiered_cache = await response.parse() - assert_matches_type(Optional[RegionalTieredCacheGetResponse], regional_tiered_cache, path=["response"]) + assert_matches_type(RegionalTieredCacheGetResponse, regional_tiered_cache, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/cache/test_smart_tiered_cache.py b/tests/api_resources/cache/test_smart_tiered_cache.py index 4502fff107d..b683f9fc4dc 100644 --- a/tests/api_resources/cache/test_smart_tiered_cache.py +++ b/tests/api_resources/cache/test_smart_tiered_cache.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest @@ -26,7 +26,7 @@ def test_method_delete(self, client: Cloudflare) -> None: smart_tiered_cache = client.cache.smart_tiered_cache.delete( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[SmartTieredCacheDeleteResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheDeleteResponse, smart_tiered_cache, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -37,7 +37,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" smart_tiered_cache = response.parse() - assert_matches_type(Optional[SmartTieredCacheDeleteResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheDeleteResponse, smart_tiered_cache, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -48,7 +48,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" smart_tiered_cache = response.parse() - assert_matches_type(Optional[SmartTieredCacheDeleteResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheDeleteResponse, smart_tiered_cache, path=["response"]) assert cast(Any, response.is_closed) is True @@ -65,7 +65,7 @@ def test_method_edit(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", value="on", ) - assert_matches_type(Optional[SmartTieredCacheEditResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheEditResponse, smart_tiered_cache, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: @@ -77,7 +77,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" smart_tiered_cache = response.parse() - assert_matches_type(Optional[SmartTieredCacheEditResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheEditResponse, smart_tiered_cache, path=["response"]) @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: @@ -89,7 +89,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" smart_tiered_cache = response.parse() - assert_matches_type(Optional[SmartTieredCacheEditResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheEditResponse, smart_tiered_cache, path=["response"]) assert cast(Any, response.is_closed) is True @@ -106,7 +106,7 @@ def test_method_get(self, client: Cloudflare) -> None: smart_tiered_cache = client.cache.smart_tiered_cache.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[SmartTieredCacheGetResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheGetResponse, smart_tiered_cache, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -117,7 +117,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" smart_tiered_cache = response.parse() - assert_matches_type(Optional[SmartTieredCacheGetResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheGetResponse, smart_tiered_cache, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -128,7 +128,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" smart_tiered_cache = response.parse() - assert_matches_type(Optional[SmartTieredCacheGetResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheGetResponse, smart_tiered_cache, path=["response"]) assert cast(Any, response.is_closed) is True @@ -148,7 +148,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: smart_tiered_cache = await async_client.cache.smart_tiered_cache.delete( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[SmartTieredCacheDeleteResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheDeleteResponse, smart_tiered_cache, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -159,7 +159,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" smart_tiered_cache = await response.parse() - assert_matches_type(Optional[SmartTieredCacheDeleteResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheDeleteResponse, smart_tiered_cache, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -170,7 +170,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" smart_tiered_cache = await response.parse() - assert_matches_type(Optional[SmartTieredCacheDeleteResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheDeleteResponse, smart_tiered_cache, path=["response"]) assert cast(Any, response.is_closed) is True @@ -187,7 +187,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", value="on", ) - assert_matches_type(Optional[SmartTieredCacheEditResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheEditResponse, smart_tiered_cache, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -199,7 +199,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" smart_tiered_cache = await response.parse() - assert_matches_type(Optional[SmartTieredCacheEditResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheEditResponse, smart_tiered_cache, path=["response"]) @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -211,7 +211,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" smart_tiered_cache = await response.parse() - assert_matches_type(Optional[SmartTieredCacheEditResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheEditResponse, smart_tiered_cache, path=["response"]) assert cast(Any, response.is_closed) is True @@ -228,7 +228,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: smart_tiered_cache = await async_client.cache.smart_tiered_cache.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[SmartTieredCacheGetResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheGetResponse, smart_tiered_cache, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -239,7 +239,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" smart_tiered_cache = await response.parse() - assert_matches_type(Optional[SmartTieredCacheGetResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheGetResponse, smart_tiered_cache, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -250,7 +250,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" smart_tiered_cache = await response.parse() - assert_matches_type(Optional[SmartTieredCacheGetResponse], smart_tiered_cache, path=["response"]) + assert_matches_type(SmartTieredCacheGetResponse, smart_tiered_cache, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/cache/test_variants.py b/tests/api_resources/cache/test_variants.py index 9cb7356c449..c46c601fbb8 100644 --- a/tests/api_resources/cache/test_variants.py +++ b/tests/api_resources/cache/test_variants.py @@ -3,13 +3,13 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.cache import VariantGetResponse, VariantEditResponse, VariantDeleteResponse +from cloudflare.types.cache import CacheVariant, VariantGetResponse, VariantEditResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -22,7 +22,7 @@ def test_method_delete(self, client: Cloudflare) -> None: variant = client.cache.variants.delete( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[VariantDeleteResponse], variant, path=["response"]) + assert_matches_type(CacheVariant, variant, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -33,7 +33,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = response.parse() - assert_matches_type(Optional[VariantDeleteResponse], variant, path=["response"]) + assert_matches_type(CacheVariant, variant, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -44,7 +44,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = response.parse() - assert_matches_type(Optional[VariantDeleteResponse], variant, path=["response"]) + assert_matches_type(CacheVariant, variant, path=["response"]) assert cast(Any, response.is_closed) is True @@ -55,16 +55,14 @@ def test_path_params_delete(self, client: Cloudflare) -> None: zone_id="", ) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_method_edit(self, client: Cloudflare) -> None: variant = client.cache.variants.edit( zone_id="023e105f4ecef8ad9ca31a8372d0c353", value={}, ) - assert_matches_type(Optional[VariantEditResponse], variant, path=["response"]) + assert_matches_type(VariantEditResponse, variant, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_method_edit_with_all_params(self, client: Cloudflare) -> None: variant = client.cache.variants.edit( @@ -83,9 +81,8 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: "webp": ["image/jpeg", "image/avif"], }, ) - assert_matches_type(Optional[VariantEditResponse], variant, path=["response"]) + assert_matches_type(VariantEditResponse, variant, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: response = client.cache.variants.with_raw_response.edit( @@ -96,9 +93,8 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = response.parse() - assert_matches_type(Optional[VariantEditResponse], variant, path=["response"]) + assert_matches_type(VariantEditResponse, variant, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: with client.cache.variants.with_streaming_response.edit( @@ -109,11 +105,10 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = response.parse() - assert_matches_type(Optional[VariantEditResponse], variant, path=["response"]) + assert_matches_type(VariantEditResponse, variant, path=["response"]) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_path_params_edit(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): @@ -122,15 +117,13 @@ def test_path_params_edit(self, client: Cloudflare) -> None: value={}, ) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_method_get(self, client: Cloudflare) -> None: variant = client.cache.variants.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[VariantGetResponse], variant, path=["response"]) + assert_matches_type(VariantGetResponse, variant, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: response = client.cache.variants.with_raw_response.get( @@ -140,9 +133,8 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = response.parse() - assert_matches_type(Optional[VariantGetResponse], variant, path=["response"]) + assert_matches_type(VariantGetResponse, variant, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: with client.cache.variants.with_streaming_response.get( @@ -152,11 +144,10 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = response.parse() - assert_matches_type(Optional[VariantGetResponse], variant, path=["response"]) + assert_matches_type(VariantGetResponse, variant, path=["response"]) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): @@ -173,7 +164,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: variant = await async_client.cache.variants.delete( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[VariantDeleteResponse], variant, path=["response"]) + assert_matches_type(CacheVariant, variant, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -184,7 +175,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = await response.parse() - assert_matches_type(Optional[VariantDeleteResponse], variant, path=["response"]) + assert_matches_type(CacheVariant, variant, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -195,7 +186,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = await response.parse() - assert_matches_type(Optional[VariantDeleteResponse], variant, path=["response"]) + assert_matches_type(CacheVariant, variant, path=["response"]) assert cast(Any, response.is_closed) is True @@ -206,16 +197,14 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: zone_id="", ) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_method_edit(self, async_client: AsyncCloudflare) -> None: variant = await async_client.cache.variants.edit( zone_id="023e105f4ecef8ad9ca31a8372d0c353", value={}, ) - assert_matches_type(Optional[VariantEditResponse], variant, path=["response"]) + assert_matches_type(VariantEditResponse, variant, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: variant = await async_client.cache.variants.edit( @@ -234,9 +223,8 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) "webp": ["image/jpeg", "image/avif"], }, ) - assert_matches_type(Optional[VariantEditResponse], variant, path=["response"]) + assert_matches_type(VariantEditResponse, variant, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: response = await async_client.cache.variants.with_raw_response.edit( @@ -247,9 +235,8 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = await response.parse() - assert_matches_type(Optional[VariantEditResponse], variant, path=["response"]) + assert_matches_type(VariantEditResponse, variant, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: async with async_client.cache.variants.with_streaming_response.edit( @@ -260,11 +247,10 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = await response.parse() - assert_matches_type(Optional[VariantEditResponse], variant, path=["response"]) + assert_matches_type(VariantEditResponse, variant, path=["response"]) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): @@ -273,15 +259,13 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: value={}, ) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: variant = await async_client.cache.variants.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[VariantGetResponse], variant, path=["response"]) + assert_matches_type(VariantGetResponse, variant, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.cache.variants.with_raw_response.get( @@ -291,9 +275,8 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = await response.parse() - assert_matches_type(Optional[VariantGetResponse], variant, path=["response"]) + assert_matches_type(VariantGetResponse, variant, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.cache.variants.with_streaming_response.get( @@ -303,11 +286,10 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = await response.parse() - assert_matches_type(Optional[VariantGetResponse], variant, path=["response"]) + assert_matches_type(VariantGetResponse, variant, path=["response"]) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): diff --git a/tests/api_resources/cloud_connector/test_rules.py b/tests/api_resources/cloud_connector/test_rules.py index 4c8dbcafd19..3516a2e2848 100644 --- a/tests/api_resources/cloud_connector/test_rules.py +++ b/tests/api_resources/cloud_connector/test_rules.py @@ -22,7 +22,7 @@ class TestRules: def test_method_update(self, client: Cloudflare) -> None: rule = client.cloud_connector.rules.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - rules=[{}], + body=[{}], ) assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) @@ -30,7 +30,7 @@ def test_method_update(self, client: Cloudflare) -> None: def test_raw_response_update(self, client: Cloudflare) -> None: response = client.cloud_connector.rules.with_raw_response.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - rules=[{}], + body=[{}], ) assert response.is_closed is True @@ -42,7 +42,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: def test_streaming_response_update(self, client: Cloudflare) -> None: with client.cloud_connector.rules.with_streaming_response.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - rules=[{}], + body=[{}], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -57,7 +57,7 @@ def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.cloud_connector.rules.with_raw_response.update( zone_id="", - rules=[{}], + body=[{}], ) @parametrize @@ -106,7 +106,7 @@ class TestAsyncRules: async def test_method_update(self, async_client: AsyncCloudflare) -> None: rule = await async_client.cloud_connector.rules.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - rules=[{}], + body=[{}], ) assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) @@ -114,7 +114,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloud_connector.rules.with_raw_response.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - rules=[{}], + body=[{}], ) assert response.is_closed is True @@ -126,7 +126,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.cloud_connector.rules.with_streaming_response.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - rules=[{}], + body=[{}], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -141,7 +141,7 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.cloud_connector.rules.with_raw_response.update( zone_id="", - rules=[{}], + body=[{}], ) @parametrize diff --git a/tests/api_resources/dns/test_records.py b/tests/api_resources/dns/test_records.py index d66e3f1af77..aa64f3c8ac3 100644 --- a/tests/api_resources/dns/test_records.py +++ b/tests/api_resources/dns/test_records.py @@ -10,11 +10,15 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types.dns import ( - RecordResponse, + RecordGetResponse, + RecordEditResponse, + RecordListResponse, RecordScanResponse, RecordBatchResponse, + RecordCreateResponse, RecordDeleteResponse, RecordImportResponse, + RecordUpdateResponse, ) from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray @@ -30,7 +34,7 @@ def test_method_create_overload_1(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -41,15 +45,11 @@ def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> N content="198.51.100.4", name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="A", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -61,7 +61,7 @@ def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -73,7 +73,7 @@ def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -91,7 +91,7 @@ def test_method_create_overload_2(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -102,15 +102,11 @@ def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> N content="2400:cb00:2049::1", name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="AAAA", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -122,7 +118,7 @@ def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -134,7 +130,7 @@ def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -152,7 +148,7 @@ def test_method_create_overload_3(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -167,15 +163,11 @@ def test_method_create_with_all_params_overload_3(self, client: Cloudflare) -> N }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="CAA", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -187,7 +179,7 @@ def test_raw_response_create_overload_3(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -199,7 +191,7 @@ def test_streaming_response_create_overload_3(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -217,7 +209,7 @@ def test_method_create_overload_4(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -233,15 +225,11 @@ def test_method_create_with_all_params_overload_4(self, client: Cloudflare) -> N }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="CERT", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -253,7 +241,7 @@ def test_raw_response_create_overload_4(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -265,7 +253,7 @@ def test_streaming_response_create_overload_4(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -283,7 +271,7 @@ def test_method_create_overload_5(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -294,16 +282,12 @@ def test_method_create_with_all_params_overload_5(self, client: Cloudflare) -> N content="content", name="example.com", proxied=True, - settings={ - "flatten_cname": True, - "ipv4_only": True, - "ipv6_only": True, - }, + settings={"flatten_cname": True}, tags=["owner:dns-team"], ttl=3600, type="CNAME", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -315,7 +299,7 @@ def test_raw_response_create_overload_5(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -327,7 +311,7 @@ def test_streaming_response_create_overload_5(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -345,7 +329,7 @@ def test_method_create_overload_6(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -361,15 +345,11 @@ def test_method_create_with_all_params_overload_6(self, client: Cloudflare) -> N }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="DNSKEY", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -381,7 +361,7 @@ def test_raw_response_create_overload_6(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -393,7 +373,7 @@ def test_streaming_response_create_overload_6(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -411,7 +391,7 @@ def test_method_create_overload_7(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -427,15 +407,11 @@ def test_method_create_with_all_params_overload_7(self, client: Cloudflare) -> N }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="DS", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -447,7 +423,7 @@ def test_raw_response_create_overload_7(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -459,7 +435,7 @@ def test_streaming_response_create_overload_7(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -477,7 +453,7 @@ def test_method_create_overload_8(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -492,15 +468,11 @@ def test_method_create_with_all_params_overload_8(self, client: Cloudflare) -> N }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="HTTPS", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -512,7 +484,7 @@ def test_raw_response_create_overload_8(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -524,7 +496,7 @@ def test_streaming_response_create_overload_8(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -542,7 +514,7 @@ def test_method_create_overload_9(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -566,15 +538,11 @@ def test_method_create_with_all_params_overload_9(self, client: Cloudflare) -> N }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="LOC", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -586,7 +554,7 @@ def test_raw_response_create_overload_9(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -598,7 +566,7 @@ def test_streaming_response_create_overload_9(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -616,7 +584,7 @@ def test_method_create_overload_10(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -628,15 +596,11 @@ def test_method_create_with_all_params_overload_10(self, client: Cloudflare) -> name="example.com", priority=10, proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="MX", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -648,7 +612,7 @@ def test_raw_response_create_overload_10(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -660,7 +624,7 @@ def test_streaming_response_create_overload_10(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -678,7 +642,7 @@ def test_method_create_overload_11(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -696,15 +660,11 @@ def test_method_create_with_all_params_overload_11(self, client: Cloudflare) -> }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="NAPTR", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -716,7 +676,7 @@ def test_raw_response_create_overload_11(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -728,7 +688,7 @@ def test_streaming_response_create_overload_11(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -746,7 +706,7 @@ def test_method_create_overload_12(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -757,15 +717,11 @@ def test_method_create_with_all_params_overload_12(self, client: Cloudflare) -> content="ns1.example.com", name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="NS", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -777,7 +733,7 @@ def test_raw_response_create_overload_12(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -789,7 +745,7 @@ def test_streaming_response_create_overload_12(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -807,7 +763,7 @@ def test_method_create_overload_13(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -818,15 +774,11 @@ def test_method_create_with_all_params_overload_13(self, client: Cloudflare) -> content="content", name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="OPENPGPKEY", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -838,7 +790,7 @@ def test_raw_response_create_overload_13(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -850,7 +802,7 @@ def test_streaming_response_create_overload_13(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -868,7 +820,7 @@ def test_method_create_overload_14(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -879,15 +831,11 @@ def test_method_create_with_all_params_overload_14(self, client: Cloudflare) -> content="example.com", name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="PTR", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -899,7 +847,7 @@ def test_raw_response_create_overload_14(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -911,7 +859,7 @@ def test_streaming_response_create_overload_14(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -929,7 +877,7 @@ def test_method_create_overload_15(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -945,15 +893,11 @@ def test_method_create_with_all_params_overload_15(self, client: Cloudflare) -> }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="SMIMEA", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -965,7 +909,7 @@ def test_raw_response_create_overload_15(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -977,7 +921,7 @@ def test_streaming_response_create_overload_15(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -995,7 +939,7 @@ def test_method_create_overload_16(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1011,15 +955,11 @@ def test_method_create_with_all_params_overload_16(self, client: Cloudflare) -> }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="SRV", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1031,7 +971,7 @@ def test_raw_response_create_overload_16(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1043,7 +983,7 @@ def test_streaming_response_create_overload_16(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1061,7 +1001,7 @@ def test_method_create_overload_17(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1076,15 +1016,11 @@ def test_method_create_with_all_params_overload_17(self, client: Cloudflare) -> }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="SSHFP", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1096,7 +1032,7 @@ def test_raw_response_create_overload_17(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1108,7 +1044,7 @@ def test_streaming_response_create_overload_17(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1126,7 +1062,7 @@ def test_method_create_overload_18(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1141,15 +1077,11 @@ def test_method_create_with_all_params_overload_18(self, client: Cloudflare) -> }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="SVCB", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1161,7 +1093,7 @@ def test_raw_response_create_overload_18(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1173,7 +1105,7 @@ def test_streaming_response_create_overload_18(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1191,7 +1123,7 @@ def test_method_create_overload_19(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1207,15 +1139,11 @@ def test_method_create_with_all_params_overload_19(self, client: Cloudflare) -> }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="TLSA", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1227,7 +1155,7 @@ def test_raw_response_create_overload_19(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1239,7 +1167,7 @@ def test_streaming_response_create_overload_19(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1257,7 +1185,7 @@ def test_method_create_overload_20(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1268,15 +1196,11 @@ def test_method_create_with_all_params_overload_20(self, client: Cloudflare) -> content='"v=spf1 include:example.com -all"', name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="TXT", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1288,7 +1212,7 @@ def test_raw_response_create_overload_20(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1300,7 +1224,7 @@ def test_streaming_response_create_overload_20(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1318,7 +1242,7 @@ def test_method_create_overload_21(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1333,15 +1257,11 @@ def test_method_create_with_all_params_overload_21(self, client: Cloudflare) -> name="example.com", priority=10, proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="URI", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1353,7 +1273,7 @@ def test_raw_response_create_overload_21(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1365,7 +1285,7 @@ def test_streaming_response_create_overload_21(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1384,7 +1304,7 @@ def test_method_update_overload_1(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1396,15 +1316,11 @@ def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> N content="198.51.100.4", name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="A", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1417,7 +1333,7 @@ def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1430,7 +1346,7 @@ def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1456,7 +1372,7 @@ def test_method_update_overload_2(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1468,15 +1384,11 @@ def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> N content="2400:cb00:2049::1", name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="AAAA", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1489,7 +1401,7 @@ def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1502,7 +1414,7 @@ def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1528,7 +1440,7 @@ def test_method_update_overload_3(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1544,15 +1456,11 @@ def test_method_update_with_all_params_overload_3(self, client: Cloudflare) -> N }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="CAA", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1565,7 +1473,7 @@ def test_raw_response_update_overload_3(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1578,7 +1486,7 @@ def test_streaming_response_update_overload_3(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1604,7 +1512,7 @@ def test_method_update_overload_4(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1621,15 +1529,11 @@ def test_method_update_with_all_params_overload_4(self, client: Cloudflare) -> N }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="CERT", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1642,7 +1546,7 @@ def test_raw_response_update_overload_4(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1655,7 +1559,7 @@ def test_streaming_response_update_overload_4(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1681,7 +1585,7 @@ def test_method_update_overload_5(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1693,16 +1597,12 @@ def test_method_update_with_all_params_overload_5(self, client: Cloudflare) -> N content="content", name="example.com", proxied=True, - settings={ - "flatten_cname": True, - "ipv4_only": True, - "ipv6_only": True, - }, + settings={"flatten_cname": True}, tags=["owner:dns-team"], ttl=3600, type="CNAME", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1715,7 +1615,7 @@ def test_raw_response_update_overload_5(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1728,7 +1628,7 @@ def test_streaming_response_update_overload_5(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1754,7 +1654,7 @@ def test_method_update_overload_6(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1771,15 +1671,11 @@ def test_method_update_with_all_params_overload_6(self, client: Cloudflare) -> N }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="DNSKEY", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1792,7 +1688,7 @@ def test_raw_response_update_overload_6(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1805,7 +1701,7 @@ def test_streaming_response_update_overload_6(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1831,7 +1727,7 @@ def test_method_update_overload_7(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1848,15 +1744,11 @@ def test_method_update_with_all_params_overload_7(self, client: Cloudflare) -> N }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="DS", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1869,7 +1761,7 @@ def test_raw_response_update_overload_7(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1882,7 +1774,7 @@ def test_streaming_response_update_overload_7(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1908,7 +1800,7 @@ def test_method_update_overload_8(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1924,15 +1816,11 @@ def test_method_update_with_all_params_overload_8(self, client: Cloudflare) -> N }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="HTTPS", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1945,7 +1833,7 @@ def test_raw_response_update_overload_8(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1958,7 +1846,7 @@ def test_streaming_response_update_overload_8(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1984,7 +1872,7 @@ def test_method_update_overload_9(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2009,15 +1897,11 @@ def test_method_update_with_all_params_overload_9(self, client: Cloudflare) -> N }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="LOC", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2030,7 +1914,7 @@ def test_raw_response_update_overload_9(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2043,7 +1927,7 @@ def test_streaming_response_update_overload_9(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2069,7 +1953,7 @@ def test_method_update_overload_10(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2082,15 +1966,11 @@ def test_method_update_with_all_params_overload_10(self, client: Cloudflare) -> name="example.com", priority=10, proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="MX", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2103,7 +1983,7 @@ def test_raw_response_update_overload_10(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2116,7 +1996,7 @@ def test_streaming_response_update_overload_10(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2142,7 +2022,7 @@ def test_method_update_overload_11(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2161,15 +2041,11 @@ def test_method_update_with_all_params_overload_11(self, client: Cloudflare) -> }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="NAPTR", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2182,7 +2058,7 @@ def test_raw_response_update_overload_11(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2195,7 +2071,7 @@ def test_streaming_response_update_overload_11(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2221,7 +2097,7 @@ def test_method_update_overload_12(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2233,15 +2109,11 @@ def test_method_update_with_all_params_overload_12(self, client: Cloudflare) -> content="ns1.example.com", name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="NS", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2254,7 +2126,7 @@ def test_raw_response_update_overload_12(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2267,7 +2139,7 @@ def test_streaming_response_update_overload_12(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2293,7 +2165,7 @@ def test_method_update_overload_13(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2305,15 +2177,11 @@ def test_method_update_with_all_params_overload_13(self, client: Cloudflare) -> content="content", name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="OPENPGPKEY", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2326,7 +2194,7 @@ def test_raw_response_update_overload_13(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2339,7 +2207,7 @@ def test_streaming_response_update_overload_13(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2365,7 +2233,7 @@ def test_method_update_overload_14(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2377,15 +2245,11 @@ def test_method_update_with_all_params_overload_14(self, client: Cloudflare) -> content="example.com", name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="PTR", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2398,7 +2262,7 @@ def test_raw_response_update_overload_14(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2411,7 +2275,7 @@ def test_streaming_response_update_overload_14(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2437,7 +2301,7 @@ def test_method_update_overload_15(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2454,15 +2318,11 @@ def test_method_update_with_all_params_overload_15(self, client: Cloudflare) -> }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="SMIMEA", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2475,7 +2335,7 @@ def test_raw_response_update_overload_15(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2488,7 +2348,7 @@ def test_streaming_response_update_overload_15(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2514,7 +2374,7 @@ def test_method_update_overload_16(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2531,15 +2391,11 @@ def test_method_update_with_all_params_overload_16(self, client: Cloudflare) -> }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="SRV", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2552,7 +2408,7 @@ def test_raw_response_update_overload_16(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2565,7 +2421,7 @@ def test_streaming_response_update_overload_16(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2591,7 +2447,7 @@ def test_method_update_overload_17(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2607,15 +2463,11 @@ def test_method_update_with_all_params_overload_17(self, client: Cloudflare) -> }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="SSHFP", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2628,7 +2480,7 @@ def test_raw_response_update_overload_17(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2641,7 +2493,7 @@ def test_streaming_response_update_overload_17(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2667,7 +2519,7 @@ def test_method_update_overload_18(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2683,15 +2535,11 @@ def test_method_update_with_all_params_overload_18(self, client: Cloudflare) -> }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="SVCB", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2704,7 +2552,7 @@ def test_raw_response_update_overload_18(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2717,7 +2565,7 @@ def test_streaming_response_update_overload_18(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2743,7 +2591,7 @@ def test_method_update_overload_19(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2760,15 +2608,11 @@ def test_method_update_with_all_params_overload_19(self, client: Cloudflare) -> }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="TLSA", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2781,7 +2625,7 @@ def test_raw_response_update_overload_19(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2794,7 +2638,7 @@ def test_streaming_response_update_overload_19(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2820,7 +2664,7 @@ def test_method_update_overload_20(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2832,15 +2676,11 @@ def test_method_update_with_all_params_overload_20(self, client: Cloudflare) -> content='"v=spf1 include:example.com -all"', name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="TXT", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2853,7 +2693,7 @@ def test_raw_response_update_overload_20(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2866,7 +2706,7 @@ def test_streaming_response_update_overload_20(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2892,7 +2732,7 @@ def test_method_update_overload_21(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2908,15 +2748,11 @@ def test_method_update_with_all_params_overload_21(self, client: Cloudflare) -> name="example.com", priority=10, proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="URI", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2929,7 +2765,7 @@ def test_raw_response_update_overload_21(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2942,7 +2778,7 @@ def test_streaming_response_update_overload_21(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2961,15 +2797,13 @@ def test_path_params_update_overload_21(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - @pytest.mark.skip(reason="mock server returns invalid data") @parametrize def test_method_list(self, client: Cloudflare) -> None: record = client.dns.records.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncV4PagePaginationArray[RecordResponse], record, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[RecordListResponse], record, path=["response"]) - @pytest.mark.skip(reason="mock server returns invalid data") @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: record = client.dns.records.list( @@ -3012,9 +2846,8 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: tag_match="any", type="A", ) - assert_matches_type(SyncV4PagePaginationArray[RecordResponse], record, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[RecordListResponse], record, path=["response"]) - @pytest.mark.skip(reason="mock server returns invalid data") @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.list( @@ -3024,9 +2857,8 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(SyncV4PagePaginationArray[RecordResponse], record, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[RecordListResponse], record, path=["response"]) - @pytest.mark.skip(reason="mock server returns invalid data") @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.list( @@ -3036,11 +2868,10 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(SyncV4PagePaginationArray[RecordResponse], record, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[RecordListResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="mock server returns invalid data") @parametrize def test_path_params_list(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): @@ -3116,10 +2947,6 @@ def test_method_batch_with_all_params(self, client: Cloudflare) -> None: "content": "198.51.100.4", "name": "example.com", "proxied": True, - "settings": { - "ipv4_only": True, - "ipv6_only": True, - }, "tags": ["owner:dns-team"], "ttl": 3600, "type": "A", @@ -3132,10 +2959,6 @@ def test_method_batch_with_all_params(self, client: Cloudflare) -> None: "content": "198.51.100.4", "name": "example.com", "proxied": True, - "settings": { - "ipv4_only": True, - "ipv6_only": True, - }, "tags": ["owner:dns-team"], "ttl": 3600, "type": "A", @@ -3147,10 +2970,6 @@ def test_method_batch_with_all_params(self, client: Cloudflare) -> None: "content": "198.51.100.4", "name": "example.com", "proxied": True, - "settings": { - "ipv4_only": True, - "ipv6_only": True, - }, "tags": ["owner:dns-team"], "ttl": 3600, "type": "A", @@ -3201,7 +3020,7 @@ def test_method_edit_overload_1(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3213,15 +3032,11 @@ def test_method_edit_with_all_params_overload_1(self, client: Cloudflare) -> Non content="198.51.100.4", name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="A", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3234,7 +3049,7 @@ def test_raw_response_edit_overload_1(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3247,7 +3062,7 @@ def test_streaming_response_edit_overload_1(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3273,7 +3088,7 @@ def test_method_edit_overload_2(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3285,15 +3100,11 @@ def test_method_edit_with_all_params_overload_2(self, client: Cloudflare) -> Non content="2400:cb00:2049::1", name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="AAAA", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3306,7 +3117,7 @@ def test_raw_response_edit_overload_2(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3319,7 +3130,7 @@ def test_streaming_response_edit_overload_2(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3345,7 +3156,7 @@ def test_method_edit_overload_3(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3361,15 +3172,11 @@ def test_method_edit_with_all_params_overload_3(self, client: Cloudflare) -> Non }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="CAA", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3382,7 +3189,7 @@ def test_raw_response_edit_overload_3(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3395,7 +3202,7 @@ def test_streaming_response_edit_overload_3(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3421,7 +3228,7 @@ def test_method_edit_overload_4(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3438,15 +3245,11 @@ def test_method_edit_with_all_params_overload_4(self, client: Cloudflare) -> Non }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="CERT", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3459,7 +3262,7 @@ def test_raw_response_edit_overload_4(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3472,7 +3275,7 @@ def test_streaming_response_edit_overload_4(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3498,7 +3301,7 @@ def test_method_edit_overload_5(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3510,16 +3313,12 @@ def test_method_edit_with_all_params_overload_5(self, client: Cloudflare) -> Non content="content", name="example.com", proxied=True, - settings={ - "flatten_cname": True, - "ipv4_only": True, - "ipv6_only": True, - }, + settings={"flatten_cname": True}, tags=["owner:dns-team"], ttl=3600, type="CNAME", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3532,7 +3331,7 @@ def test_raw_response_edit_overload_5(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3545,7 +3344,7 @@ def test_streaming_response_edit_overload_5(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3571,7 +3370,7 @@ def test_method_edit_overload_6(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3588,15 +3387,11 @@ def test_method_edit_with_all_params_overload_6(self, client: Cloudflare) -> Non }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="DNSKEY", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3609,7 +3404,7 @@ def test_raw_response_edit_overload_6(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3622,7 +3417,7 @@ def test_streaming_response_edit_overload_6(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3648,7 +3443,7 @@ def test_method_edit_overload_7(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3665,15 +3460,11 @@ def test_method_edit_with_all_params_overload_7(self, client: Cloudflare) -> Non }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="DS", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3686,7 +3477,7 @@ def test_raw_response_edit_overload_7(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3699,7 +3490,7 @@ def test_streaming_response_edit_overload_7(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3725,7 +3516,7 @@ def test_method_edit_overload_8(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3741,15 +3532,11 @@ def test_method_edit_with_all_params_overload_8(self, client: Cloudflare) -> Non }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="HTTPS", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3762,7 +3549,7 @@ def test_raw_response_edit_overload_8(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3775,7 +3562,7 @@ def test_streaming_response_edit_overload_8(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3801,7 +3588,7 @@ def test_method_edit_overload_9(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3826,15 +3613,11 @@ def test_method_edit_with_all_params_overload_9(self, client: Cloudflare) -> Non }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="LOC", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3847,7 +3630,7 @@ def test_raw_response_edit_overload_9(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3860,7 +3643,7 @@ def test_streaming_response_edit_overload_9(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3886,7 +3669,7 @@ def test_method_edit_overload_10(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3899,15 +3682,11 @@ def test_method_edit_with_all_params_overload_10(self, client: Cloudflare) -> No name="example.com", priority=10, proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="MX", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3920,7 +3699,7 @@ def test_raw_response_edit_overload_10(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3933,7 +3712,7 @@ def test_streaming_response_edit_overload_10(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3959,7 +3738,7 @@ def test_method_edit_overload_11(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3978,15 +3757,11 @@ def test_method_edit_with_all_params_overload_11(self, client: Cloudflare) -> No }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="NAPTR", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3999,7 +3774,7 @@ def test_raw_response_edit_overload_11(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4012,7 +3787,7 @@ def test_streaming_response_edit_overload_11(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4038,7 +3813,7 @@ def test_method_edit_overload_12(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4050,15 +3825,11 @@ def test_method_edit_with_all_params_overload_12(self, client: Cloudflare) -> No content="ns1.example.com", name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="NS", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4071,7 +3842,7 @@ def test_raw_response_edit_overload_12(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4084,7 +3855,7 @@ def test_streaming_response_edit_overload_12(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4110,7 +3881,7 @@ def test_method_edit_overload_13(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4122,15 +3893,11 @@ def test_method_edit_with_all_params_overload_13(self, client: Cloudflare) -> No content="content", name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="OPENPGPKEY", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4143,7 +3910,7 @@ def test_raw_response_edit_overload_13(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4156,7 +3923,7 @@ def test_streaming_response_edit_overload_13(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4182,7 +3949,7 @@ def test_method_edit_overload_14(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4194,15 +3961,11 @@ def test_method_edit_with_all_params_overload_14(self, client: Cloudflare) -> No content="example.com", name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="PTR", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4215,7 +3978,7 @@ def test_raw_response_edit_overload_14(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4228,7 +3991,7 @@ def test_streaming_response_edit_overload_14(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4254,7 +4017,7 @@ def test_method_edit_overload_15(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4271,15 +4034,11 @@ def test_method_edit_with_all_params_overload_15(self, client: Cloudflare) -> No }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="SMIMEA", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4292,7 +4051,7 @@ def test_raw_response_edit_overload_15(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4305,7 +4064,7 @@ def test_streaming_response_edit_overload_15(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4331,7 +4090,7 @@ def test_method_edit_overload_16(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4348,15 +4107,11 @@ def test_method_edit_with_all_params_overload_16(self, client: Cloudflare) -> No }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="SRV", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4369,7 +4124,7 @@ def test_raw_response_edit_overload_16(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4382,7 +4137,7 @@ def test_streaming_response_edit_overload_16(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4408,7 +4163,7 @@ def test_method_edit_overload_17(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4424,15 +4179,11 @@ def test_method_edit_with_all_params_overload_17(self, client: Cloudflare) -> No }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="SSHFP", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4445,7 +4196,7 @@ def test_raw_response_edit_overload_17(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4458,7 +4209,7 @@ def test_streaming_response_edit_overload_17(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4484,7 +4235,7 @@ def test_method_edit_overload_18(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4500,15 +4251,11 @@ def test_method_edit_with_all_params_overload_18(self, client: Cloudflare) -> No }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="SVCB", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4521,7 +4268,7 @@ def test_raw_response_edit_overload_18(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4534,7 +4281,7 @@ def test_streaming_response_edit_overload_18(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4560,7 +4307,7 @@ def test_method_edit_overload_19(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4577,15 +4324,11 @@ def test_method_edit_with_all_params_overload_19(self, client: Cloudflare) -> No }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="TLSA", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4598,7 +4341,7 @@ def test_raw_response_edit_overload_19(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4611,7 +4354,7 @@ def test_streaming_response_edit_overload_19(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4637,7 +4380,7 @@ def test_method_edit_overload_20(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4649,15 +4392,11 @@ def test_method_edit_with_all_params_overload_20(self, client: Cloudflare) -> No content='"v=spf1 include:example.com -all"', name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="TXT", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4670,7 +4409,7 @@ def test_raw_response_edit_overload_20(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4683,7 +4422,7 @@ def test_streaming_response_edit_overload_20(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4709,7 +4448,7 @@ def test_method_edit_overload_21(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4725,15 +4464,11 @@ def test_method_edit_with_all_params_overload_21(self, client: Cloudflare) -> No name="example.com", priority=10, proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="URI", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4746,7 +4481,7 @@ def test_raw_response_edit_overload_21(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4759,7 +4494,7 @@ def test_streaming_response_edit_overload_21(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4816,16 +4551,14 @@ def test_path_params_export(self, client: Cloudflare) -> None: zone_id="", ) - @pytest.mark.skip(reason="mock server returns invalid data") @parametrize def test_method_get(self, client: Cloudflare) -> None: record = client.dns.records.get( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordGetResponse], record, path=["response"]) - @pytest.mark.skip(reason="mock server returns invalid data") @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.get( @@ -4836,9 +4569,8 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordGetResponse], record, path=["response"]) - @pytest.mark.skip(reason="mock server returns invalid data") @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.get( @@ -4849,11 +4581,10 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordGetResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="mock server returns invalid data") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): @@ -4976,7 +4707,7 @@ async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4987,15 +4718,11 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn content="198.51.100.4", name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="A", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5007,7 +4734,7 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5019,7 +4746,7 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5037,7 +4764,7 @@ async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5048,15 +4775,11 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn content="2400:cb00:2049::1", name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="AAAA", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5068,7 +4791,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5080,7 +4803,7 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5098,7 +4821,7 @@ async def test_method_create_overload_3(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5113,15 +4836,11 @@ async def test_method_create_with_all_params_overload_3(self, async_client: Asyn }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="CAA", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5133,7 +4852,7 @@ async def test_raw_response_create_overload_3(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5145,7 +4864,7 @@ async def test_streaming_response_create_overload_3(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5163,7 +4882,7 @@ async def test_method_create_overload_4(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5179,15 +4898,11 @@ async def test_method_create_with_all_params_overload_4(self, async_client: Asyn }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="CERT", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5199,7 +4914,7 @@ async def test_raw_response_create_overload_4(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5211,7 +4926,7 @@ async def test_streaming_response_create_overload_4(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5229,7 +4944,7 @@ async def test_method_create_overload_5(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5240,16 +4955,12 @@ async def test_method_create_with_all_params_overload_5(self, async_client: Asyn content="content", name="example.com", proxied=True, - settings={ - "flatten_cname": True, - "ipv4_only": True, - "ipv6_only": True, - }, + settings={"flatten_cname": True}, tags=["owner:dns-team"], ttl=3600, type="CNAME", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5261,7 +4972,7 @@ async def test_raw_response_create_overload_5(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5273,7 +4984,7 @@ async def test_streaming_response_create_overload_5(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5291,7 +5002,7 @@ async def test_method_create_overload_6(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5307,15 +5018,11 @@ async def test_method_create_with_all_params_overload_6(self, async_client: Asyn }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="DNSKEY", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5327,7 +5034,7 @@ async def test_raw_response_create_overload_6(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5339,7 +5046,7 @@ async def test_streaming_response_create_overload_6(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5357,7 +5064,7 @@ async def test_method_create_overload_7(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5373,15 +5080,11 @@ async def test_method_create_with_all_params_overload_7(self, async_client: Asyn }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="DS", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5393,7 +5096,7 @@ async def test_raw_response_create_overload_7(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5405,7 +5108,7 @@ async def test_streaming_response_create_overload_7(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5423,7 +5126,7 @@ async def test_method_create_overload_8(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5438,15 +5141,11 @@ async def test_method_create_with_all_params_overload_8(self, async_client: Asyn }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="HTTPS", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5458,7 +5157,7 @@ async def test_raw_response_create_overload_8(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5470,7 +5169,7 @@ async def test_streaming_response_create_overload_8(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5488,7 +5187,7 @@ async def test_method_create_overload_9(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5512,15 +5211,11 @@ async def test_method_create_with_all_params_overload_9(self, async_client: Asyn }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="LOC", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5532,7 +5227,7 @@ async def test_raw_response_create_overload_9(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5544,7 +5239,7 @@ async def test_streaming_response_create_overload_9(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5562,7 +5257,7 @@ async def test_method_create_overload_10(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5574,15 +5269,11 @@ async def test_method_create_with_all_params_overload_10(self, async_client: Asy name="example.com", priority=10, proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="MX", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5594,7 +5285,7 @@ async def test_raw_response_create_overload_10(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5606,7 +5297,7 @@ async def test_streaming_response_create_overload_10(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5624,7 +5315,7 @@ async def test_method_create_overload_11(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5642,15 +5333,11 @@ async def test_method_create_with_all_params_overload_11(self, async_client: Asy }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="NAPTR", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5662,7 +5349,7 @@ async def test_raw_response_create_overload_11(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5674,7 +5361,7 @@ async def test_streaming_response_create_overload_11(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5692,7 +5379,7 @@ async def test_method_create_overload_12(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5703,15 +5390,11 @@ async def test_method_create_with_all_params_overload_12(self, async_client: Asy content="ns1.example.com", name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="NS", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5723,7 +5406,7 @@ async def test_raw_response_create_overload_12(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5735,7 +5418,7 @@ async def test_streaming_response_create_overload_12(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5753,7 +5436,7 @@ async def test_method_create_overload_13(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5764,15 +5447,11 @@ async def test_method_create_with_all_params_overload_13(self, async_client: Asy content="content", name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="OPENPGPKEY", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5784,7 +5463,7 @@ async def test_raw_response_create_overload_13(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5796,7 +5475,7 @@ async def test_streaming_response_create_overload_13(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5814,7 +5493,7 @@ async def test_method_create_overload_14(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5825,15 +5504,11 @@ async def test_method_create_with_all_params_overload_14(self, async_client: Asy content="example.com", name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="PTR", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5845,7 +5520,7 @@ async def test_raw_response_create_overload_14(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5857,7 +5532,7 @@ async def test_streaming_response_create_overload_14(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5875,7 +5550,7 @@ async def test_method_create_overload_15(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5891,15 +5566,11 @@ async def test_method_create_with_all_params_overload_15(self, async_client: Asy }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="SMIMEA", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5911,7 +5582,7 @@ async def test_raw_response_create_overload_15(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5923,7 +5594,7 @@ async def test_streaming_response_create_overload_15(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5941,7 +5612,7 @@ async def test_method_create_overload_16(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5957,15 +5628,11 @@ async def test_method_create_with_all_params_overload_16(self, async_client: Asy }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="SRV", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5977,7 +5644,7 @@ async def test_raw_response_create_overload_16(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5989,7 +5656,7 @@ async def test_streaming_response_create_overload_16(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -6007,7 +5674,7 @@ async def test_method_create_overload_17(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6022,15 +5689,11 @@ async def test_method_create_with_all_params_overload_17(self, async_client: Asy }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="SSHFP", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6042,7 +5705,7 @@ async def test_raw_response_create_overload_17(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6054,7 +5717,7 @@ async def test_streaming_response_create_overload_17(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -6072,7 +5735,7 @@ async def test_method_create_overload_18(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6087,15 +5750,11 @@ async def test_method_create_with_all_params_overload_18(self, async_client: Asy }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="SVCB", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6107,7 +5766,7 @@ async def test_raw_response_create_overload_18(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6119,7 +5778,7 @@ async def test_streaming_response_create_overload_18(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -6137,7 +5796,7 @@ async def test_method_create_overload_19(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6153,15 +5812,11 @@ async def test_method_create_with_all_params_overload_19(self, async_client: Asy }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="TLSA", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6173,7 +5828,7 @@ async def test_raw_response_create_overload_19(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6185,7 +5840,7 @@ async def test_streaming_response_create_overload_19(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -6203,7 +5858,7 @@ async def test_method_create_overload_20(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6214,15 +5869,11 @@ async def test_method_create_with_all_params_overload_20(self, async_client: Asy content='"v=spf1 include:example.com -all"', name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="TXT", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6234,7 +5885,7 @@ async def test_raw_response_create_overload_20(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6246,7 +5897,7 @@ async def test_streaming_response_create_overload_20(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -6264,7 +5915,7 @@ async def test_method_create_overload_21(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6279,15 +5930,11 @@ async def test_method_create_with_all_params_overload_21(self, async_client: Asy name="example.com", priority=10, proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="URI", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6299,7 +5946,7 @@ async def test_raw_response_create_overload_21(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6311,7 +5958,7 @@ async def test_streaming_response_create_overload_21(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -6330,7 +5977,7 @@ async def test_method_update_overload_1(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6342,15 +5989,11 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn content="198.51.100.4", name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="A", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6363,7 +6006,7 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6376,7 +6019,7 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -6402,7 +6045,7 @@ async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6414,15 +6057,11 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn content="2400:cb00:2049::1", name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="AAAA", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6435,7 +6074,7 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6448,7 +6087,7 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -6474,7 +6113,7 @@ async def test_method_update_overload_3(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6490,15 +6129,11 @@ async def test_method_update_with_all_params_overload_3(self, async_client: Asyn }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="CAA", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6511,7 +6146,7 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6524,7 +6159,7 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -6550,7 +6185,7 @@ async def test_method_update_overload_4(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6567,15 +6202,11 @@ async def test_method_update_with_all_params_overload_4(self, async_client: Asyn }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="CERT", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6588,7 +6219,7 @@ async def test_raw_response_update_overload_4(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6601,7 +6232,7 @@ async def test_streaming_response_update_overload_4(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -6627,7 +6258,7 @@ async def test_method_update_overload_5(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6639,16 +6270,12 @@ async def test_method_update_with_all_params_overload_5(self, async_client: Asyn content="content", name="example.com", proxied=True, - settings={ - "flatten_cname": True, - "ipv4_only": True, - "ipv6_only": True, - }, + settings={"flatten_cname": True}, tags=["owner:dns-team"], ttl=3600, type="CNAME", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6661,7 +6288,7 @@ async def test_raw_response_update_overload_5(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6674,7 +6301,7 @@ async def test_streaming_response_update_overload_5(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -6700,7 +6327,7 @@ async def test_method_update_overload_6(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6717,15 +6344,11 @@ async def test_method_update_with_all_params_overload_6(self, async_client: Asyn }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="DNSKEY", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6738,7 +6361,7 @@ async def test_raw_response_update_overload_6(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6751,7 +6374,7 @@ async def test_streaming_response_update_overload_6(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -6777,7 +6400,7 @@ async def test_method_update_overload_7(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6794,15 +6417,11 @@ async def test_method_update_with_all_params_overload_7(self, async_client: Asyn }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="DS", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6815,7 +6434,7 @@ async def test_raw_response_update_overload_7(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6828,7 +6447,7 @@ async def test_streaming_response_update_overload_7(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -6854,7 +6473,7 @@ async def test_method_update_overload_8(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6870,15 +6489,11 @@ async def test_method_update_with_all_params_overload_8(self, async_client: Asyn }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="HTTPS", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6891,7 +6506,7 @@ async def test_raw_response_update_overload_8(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6904,7 +6519,7 @@ async def test_streaming_response_update_overload_8(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -6930,7 +6545,7 @@ async def test_method_update_overload_9(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6955,15 +6570,11 @@ async def test_method_update_with_all_params_overload_9(self, async_client: Asyn }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="LOC", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6976,7 +6587,7 @@ async def test_raw_response_update_overload_9(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6989,7 +6600,7 @@ async def test_streaming_response_update_overload_9(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -7015,7 +6626,7 @@ async def test_method_update_overload_10(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7028,15 +6639,11 @@ async def test_method_update_with_all_params_overload_10(self, async_client: Asy name="example.com", priority=10, proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="MX", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7049,7 +6656,7 @@ async def test_raw_response_update_overload_10(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7062,7 +6669,7 @@ async def test_streaming_response_update_overload_10(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -7088,7 +6695,7 @@ async def test_method_update_overload_11(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7107,15 +6714,11 @@ async def test_method_update_with_all_params_overload_11(self, async_client: Asy }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="NAPTR", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7128,7 +6731,7 @@ async def test_raw_response_update_overload_11(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7141,7 +6744,7 @@ async def test_streaming_response_update_overload_11(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -7167,7 +6770,7 @@ async def test_method_update_overload_12(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7179,15 +6782,11 @@ async def test_method_update_with_all_params_overload_12(self, async_client: Asy content="ns1.example.com", name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="NS", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7200,7 +6799,7 @@ async def test_raw_response_update_overload_12(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7213,7 +6812,7 @@ async def test_streaming_response_update_overload_12(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -7239,7 +6838,7 @@ async def test_method_update_overload_13(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7251,15 +6850,11 @@ async def test_method_update_with_all_params_overload_13(self, async_client: Asy content="content", name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="OPENPGPKEY", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7272,7 +6867,7 @@ async def test_raw_response_update_overload_13(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7285,7 +6880,7 @@ async def test_streaming_response_update_overload_13(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -7311,7 +6906,7 @@ async def test_method_update_overload_14(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7323,15 +6918,11 @@ async def test_method_update_with_all_params_overload_14(self, async_client: Asy content="example.com", name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="PTR", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7344,7 +6935,7 @@ async def test_raw_response_update_overload_14(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7357,7 +6948,7 @@ async def test_streaming_response_update_overload_14(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -7383,7 +6974,7 @@ async def test_method_update_overload_15(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7400,15 +6991,11 @@ async def test_method_update_with_all_params_overload_15(self, async_client: Asy }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="SMIMEA", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7421,7 +7008,7 @@ async def test_raw_response_update_overload_15(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7434,7 +7021,7 @@ async def test_streaming_response_update_overload_15(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -7460,7 +7047,7 @@ async def test_method_update_overload_16(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7477,15 +7064,11 @@ async def test_method_update_with_all_params_overload_16(self, async_client: Asy }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="SRV", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7498,7 +7081,7 @@ async def test_raw_response_update_overload_16(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7511,7 +7094,7 @@ async def test_streaming_response_update_overload_16(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -7537,7 +7120,7 @@ async def test_method_update_overload_17(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7553,15 +7136,11 @@ async def test_method_update_with_all_params_overload_17(self, async_client: Asy }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="SSHFP", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7574,7 +7153,7 @@ async def test_raw_response_update_overload_17(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7587,7 +7166,7 @@ async def test_streaming_response_update_overload_17(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -7613,7 +7192,7 @@ async def test_method_update_overload_18(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7629,15 +7208,11 @@ async def test_method_update_with_all_params_overload_18(self, async_client: Asy }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="SVCB", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7650,7 +7225,7 @@ async def test_raw_response_update_overload_18(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7663,7 +7238,7 @@ async def test_streaming_response_update_overload_18(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -7689,7 +7264,7 @@ async def test_method_update_overload_19(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7706,15 +7281,11 @@ async def test_method_update_with_all_params_overload_19(self, async_client: Asy }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="TLSA", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7727,7 +7298,7 @@ async def test_raw_response_update_overload_19(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7740,7 +7311,7 @@ async def test_streaming_response_update_overload_19(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -7766,7 +7337,7 @@ async def test_method_update_overload_20(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7778,15 +7349,11 @@ async def test_method_update_with_all_params_overload_20(self, async_client: Asy content='"v=spf1 include:example.com -all"', name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="TXT", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7799,7 +7366,7 @@ async def test_raw_response_update_overload_20(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7812,7 +7379,7 @@ async def test_streaming_response_update_overload_20(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -7838,7 +7405,7 @@ async def test_method_update_overload_21(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7854,15 +7421,11 @@ async def test_method_update_with_all_params_overload_21(self, async_client: Asy name="example.com", priority=10, proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="URI", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7875,7 +7438,7 @@ async def test_raw_response_update_overload_21(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7888,7 +7451,7 @@ async def test_streaming_response_update_overload_21(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -7907,15 +7470,13 @@ async def test_path_params_update_overload_21(self, async_client: AsyncCloudflar zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - @pytest.mark.skip(reason="mock server returns invalid data") @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncV4PagePaginationArray[RecordResponse], record, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[RecordListResponse], record, path=["response"]) - @pytest.mark.skip(reason="mock server returns invalid data") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.list( @@ -7958,9 +7519,8 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) tag_match="any", type="A", ) - assert_matches_type(AsyncV4PagePaginationArray[RecordResponse], record, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[RecordListResponse], record, path=["response"]) - @pytest.mark.skip(reason="mock server returns invalid data") @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns.records.with_raw_response.list( @@ -7970,9 +7530,8 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[RecordResponse], record, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[RecordListResponse], record, path=["response"]) - @pytest.mark.skip(reason="mock server returns invalid data") @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.dns.records.with_streaming_response.list( @@ -7982,11 +7541,10 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[RecordResponse], record, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[RecordListResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="mock server returns invalid data") @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): @@ -8062,10 +7620,6 @@ async def test_method_batch_with_all_params(self, async_client: AsyncCloudflare) "content": "198.51.100.4", "name": "example.com", "proxied": True, - "settings": { - "ipv4_only": True, - "ipv6_only": True, - }, "tags": ["owner:dns-team"], "ttl": 3600, "type": "A", @@ -8078,10 +7632,6 @@ async def test_method_batch_with_all_params(self, async_client: AsyncCloudflare) "content": "198.51.100.4", "name": "example.com", "proxied": True, - "settings": { - "ipv4_only": True, - "ipv6_only": True, - }, "tags": ["owner:dns-team"], "ttl": 3600, "type": "A", @@ -8093,10 +7643,6 @@ async def test_method_batch_with_all_params(self, async_client: AsyncCloudflare) "content": "198.51.100.4", "name": "example.com", "proxied": True, - "settings": { - "ipv4_only": True, - "ipv6_only": True, - }, "tags": ["owner:dns-team"], "ttl": 3600, "type": "A", @@ -8147,7 +7693,7 @@ async def test_method_edit_overload_1(self, async_client: AsyncCloudflare) -> No dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8159,15 +7705,11 @@ async def test_method_edit_with_all_params_overload_1(self, async_client: AsyncC content="198.51.100.4", name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="A", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8180,7 +7722,7 @@ async def test_raw_response_edit_overload_1(self, async_client: AsyncCloudflare) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8193,7 +7735,7 @@ async def test_streaming_response_edit_overload_1(self, async_client: AsyncCloud assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -8219,7 +7761,7 @@ async def test_method_edit_overload_2(self, async_client: AsyncCloudflare) -> No dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8231,15 +7773,11 @@ async def test_method_edit_with_all_params_overload_2(self, async_client: AsyncC content="2400:cb00:2049::1", name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="AAAA", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8252,7 +7790,7 @@ async def test_raw_response_edit_overload_2(self, async_client: AsyncCloudflare) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8265,7 +7803,7 @@ async def test_streaming_response_edit_overload_2(self, async_client: AsyncCloud assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -8291,7 +7829,7 @@ async def test_method_edit_overload_3(self, async_client: AsyncCloudflare) -> No dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8307,15 +7845,11 @@ async def test_method_edit_with_all_params_overload_3(self, async_client: AsyncC }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="CAA", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8328,7 +7862,7 @@ async def test_raw_response_edit_overload_3(self, async_client: AsyncCloudflare) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8341,7 +7875,7 @@ async def test_streaming_response_edit_overload_3(self, async_client: AsyncCloud assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -8367,7 +7901,7 @@ async def test_method_edit_overload_4(self, async_client: AsyncCloudflare) -> No dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8384,15 +7918,11 @@ async def test_method_edit_with_all_params_overload_4(self, async_client: AsyncC }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="CERT", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8405,7 +7935,7 @@ async def test_raw_response_edit_overload_4(self, async_client: AsyncCloudflare) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8418,7 +7948,7 @@ async def test_streaming_response_edit_overload_4(self, async_client: AsyncCloud assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -8444,7 +7974,7 @@ async def test_method_edit_overload_5(self, async_client: AsyncCloudflare) -> No dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8456,16 +7986,12 @@ async def test_method_edit_with_all_params_overload_5(self, async_client: AsyncC content="content", name="example.com", proxied=True, - settings={ - "flatten_cname": True, - "ipv4_only": True, - "ipv6_only": True, - }, + settings={"flatten_cname": True}, tags=["owner:dns-team"], ttl=3600, type="CNAME", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8478,7 +8004,7 @@ async def test_raw_response_edit_overload_5(self, async_client: AsyncCloudflare) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8491,7 +8017,7 @@ async def test_streaming_response_edit_overload_5(self, async_client: AsyncCloud assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -8517,7 +8043,7 @@ async def test_method_edit_overload_6(self, async_client: AsyncCloudflare) -> No dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8534,15 +8060,11 @@ async def test_method_edit_with_all_params_overload_6(self, async_client: AsyncC }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="DNSKEY", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8555,7 +8077,7 @@ async def test_raw_response_edit_overload_6(self, async_client: AsyncCloudflare) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8568,7 +8090,7 @@ async def test_streaming_response_edit_overload_6(self, async_client: AsyncCloud assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -8594,7 +8116,7 @@ async def test_method_edit_overload_7(self, async_client: AsyncCloudflare) -> No dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8611,15 +8133,11 @@ async def test_method_edit_with_all_params_overload_7(self, async_client: AsyncC }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="DS", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8632,7 +8150,7 @@ async def test_raw_response_edit_overload_7(self, async_client: AsyncCloudflare) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8645,7 +8163,7 @@ async def test_streaming_response_edit_overload_7(self, async_client: AsyncCloud assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -8671,7 +8189,7 @@ async def test_method_edit_overload_8(self, async_client: AsyncCloudflare) -> No dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8687,15 +8205,11 @@ async def test_method_edit_with_all_params_overload_8(self, async_client: AsyncC }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="HTTPS", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8708,7 +8222,7 @@ async def test_raw_response_edit_overload_8(self, async_client: AsyncCloudflare) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8721,7 +8235,7 @@ async def test_streaming_response_edit_overload_8(self, async_client: AsyncCloud assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -8747,7 +8261,7 @@ async def test_method_edit_overload_9(self, async_client: AsyncCloudflare) -> No dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8772,15 +8286,11 @@ async def test_method_edit_with_all_params_overload_9(self, async_client: AsyncC }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="LOC", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8793,7 +8303,7 @@ async def test_raw_response_edit_overload_9(self, async_client: AsyncCloudflare) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8806,7 +8316,7 @@ async def test_streaming_response_edit_overload_9(self, async_client: AsyncCloud assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -8832,7 +8342,7 @@ async def test_method_edit_overload_10(self, async_client: AsyncCloudflare) -> N dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8845,15 +8355,11 @@ async def test_method_edit_with_all_params_overload_10(self, async_client: Async name="example.com", priority=10, proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="MX", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8866,7 +8372,7 @@ async def test_raw_response_edit_overload_10(self, async_client: AsyncCloudflare assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8879,7 +8385,7 @@ async def test_streaming_response_edit_overload_10(self, async_client: AsyncClou assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -8905,7 +8411,7 @@ async def test_method_edit_overload_11(self, async_client: AsyncCloudflare) -> N dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8924,15 +8430,11 @@ async def test_method_edit_with_all_params_overload_11(self, async_client: Async }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="NAPTR", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8945,7 +8447,7 @@ async def test_raw_response_edit_overload_11(self, async_client: AsyncCloudflare assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8958,7 +8460,7 @@ async def test_streaming_response_edit_overload_11(self, async_client: AsyncClou assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -8984,7 +8486,7 @@ async def test_method_edit_overload_12(self, async_client: AsyncCloudflare) -> N dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8996,15 +8498,11 @@ async def test_method_edit_with_all_params_overload_12(self, async_client: Async content="ns1.example.com", name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="NS", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9017,7 +8515,7 @@ async def test_raw_response_edit_overload_12(self, async_client: AsyncCloudflare assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9030,7 +8528,7 @@ async def test_streaming_response_edit_overload_12(self, async_client: AsyncClou assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -9056,7 +8554,7 @@ async def test_method_edit_overload_13(self, async_client: AsyncCloudflare) -> N dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9068,15 +8566,11 @@ async def test_method_edit_with_all_params_overload_13(self, async_client: Async content="content", name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="OPENPGPKEY", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9089,7 +8583,7 @@ async def test_raw_response_edit_overload_13(self, async_client: AsyncCloudflare assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9102,7 +8596,7 @@ async def test_streaming_response_edit_overload_13(self, async_client: AsyncClou assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -9128,7 +8622,7 @@ async def test_method_edit_overload_14(self, async_client: AsyncCloudflare) -> N dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9140,15 +8634,11 @@ async def test_method_edit_with_all_params_overload_14(self, async_client: Async content="example.com", name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="PTR", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9161,7 +8651,7 @@ async def test_raw_response_edit_overload_14(self, async_client: AsyncCloudflare assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9174,7 +8664,7 @@ async def test_streaming_response_edit_overload_14(self, async_client: AsyncClou assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -9200,7 +8690,7 @@ async def test_method_edit_overload_15(self, async_client: AsyncCloudflare) -> N dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9217,15 +8707,11 @@ async def test_method_edit_with_all_params_overload_15(self, async_client: Async }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="SMIMEA", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9238,7 +8724,7 @@ async def test_raw_response_edit_overload_15(self, async_client: AsyncCloudflare assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9251,7 +8737,7 @@ async def test_streaming_response_edit_overload_15(self, async_client: AsyncClou assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -9277,7 +8763,7 @@ async def test_method_edit_overload_16(self, async_client: AsyncCloudflare) -> N dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9294,15 +8780,11 @@ async def test_method_edit_with_all_params_overload_16(self, async_client: Async }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="SRV", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9315,7 +8797,7 @@ async def test_raw_response_edit_overload_16(self, async_client: AsyncCloudflare assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9328,7 +8810,7 @@ async def test_streaming_response_edit_overload_16(self, async_client: AsyncClou assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -9354,7 +8836,7 @@ async def test_method_edit_overload_17(self, async_client: AsyncCloudflare) -> N dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9370,15 +8852,11 @@ async def test_method_edit_with_all_params_overload_17(self, async_client: Async }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="SSHFP", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9391,7 +8869,7 @@ async def test_raw_response_edit_overload_17(self, async_client: AsyncCloudflare assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9404,7 +8882,7 @@ async def test_streaming_response_edit_overload_17(self, async_client: AsyncClou assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -9430,7 +8908,7 @@ async def test_method_edit_overload_18(self, async_client: AsyncCloudflare) -> N dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9446,15 +8924,11 @@ async def test_method_edit_with_all_params_overload_18(self, async_client: Async }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="SVCB", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9467,7 +8941,7 @@ async def test_raw_response_edit_overload_18(self, async_client: AsyncCloudflare assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9480,7 +8954,7 @@ async def test_streaming_response_edit_overload_18(self, async_client: AsyncClou assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -9506,7 +8980,7 @@ async def test_method_edit_overload_19(self, async_client: AsyncCloudflare) -> N dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9523,15 +8997,11 @@ async def test_method_edit_with_all_params_overload_19(self, async_client: Async }, name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="TLSA", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9544,7 +9014,7 @@ async def test_raw_response_edit_overload_19(self, async_client: AsyncCloudflare assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9557,7 +9027,7 @@ async def test_streaming_response_edit_overload_19(self, async_client: AsyncClou assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -9583,7 +9053,7 @@ async def test_method_edit_overload_20(self, async_client: AsyncCloudflare) -> N dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9595,15 +9065,11 @@ async def test_method_edit_with_all_params_overload_20(self, async_client: Async content='"v=spf1 include:example.com -all"', name="example.com", proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="TXT", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9616,7 +9082,7 @@ async def test_raw_response_edit_overload_20(self, async_client: AsyncCloudflare assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9629,7 +9095,7 @@ async def test_streaming_response_edit_overload_20(self, async_client: AsyncClou assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -9655,7 +9121,7 @@ async def test_method_edit_overload_21(self, async_client: AsyncCloudflare) -> N dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9671,15 +9137,11 @@ async def test_method_edit_with_all_params_overload_21(self, async_client: Async name="example.com", priority=10, proxied=True, - settings={ - "ipv4_only": True, - "ipv6_only": True, - }, tags=["owner:dns-team"], ttl=3600, type="URI", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9692,7 +9154,7 @@ async def test_raw_response_edit_overload_21(self, async_client: AsyncCloudflare assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9705,7 +9167,7 @@ async def test_streaming_response_edit_overload_21(self, async_client: AsyncClou assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -9762,16 +9224,14 @@ async def test_path_params_export(self, async_client: AsyncCloudflare) -> None: zone_id="", ) - @pytest.mark.skip(reason="mock server returns invalid data") @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.get( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordGetResponse], record, path=["response"]) - @pytest.mark.skip(reason="mock server returns invalid data") @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns.records.with_raw_response.get( @@ -9782,9 +9242,8 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordGetResponse], record, path=["response"]) - @pytest.mark.skip(reason="mock server returns invalid data") @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.dns.records.with_streaming_response.get( @@ -9795,11 +9254,10 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordResponse], record, path=["response"]) + assert_matches_type(Optional[RecordGetResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="mock server returns invalid data") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): diff --git a/tests/api_resources/email_security/settings/test_block_senders.py b/tests/api_resources/email_security/settings/test_block_senders.py index e6bb0a56223..27fc016dbbe 100644 --- a/tests/api_resources/email_security/settings/test_block_senders.py +++ b/tests/api_resources/email_security/settings/test_block_senders.py @@ -25,7 +25,7 @@ class TestBlockSenders: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize - def test_method_create(self, client: Cloudflare) -> None: + def test_method_create_overload_1(self, client: Cloudflare) -> None: block_sender = client.email_security.settings.block_senders.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", is_regex=False, @@ -35,7 +35,7 @@ def test_method_create(self, client: Cloudflare) -> None: assert_matches_type(BlockSenderCreateResponse, block_sender, path=["response"]) @parametrize - def test_method_create_with_all_params(self, client: Cloudflare) -> None: + def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> None: block_sender = client.email_security.settings.block_senders.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", is_regex=False, @@ -46,7 +46,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: assert_matches_type(BlockSenderCreateResponse, block_sender, path=["response"]) @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: + def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: response = client.email_security.settings.block_senders.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", is_regex=False, @@ -60,7 +60,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert_matches_type(BlockSenderCreateResponse, block_sender, path=["response"]) @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: + def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: with client.email_security.settings.block_senders.with_streaming_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", is_regex=False, @@ -76,7 +76,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: + def test_path_params_create_overload_1(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.email_security.settings.block_senders.with_raw_response.create( account_id="", @@ -85,6 +85,72 @@ def test_path_params_create(self, client: Cloudflare) -> None: pattern_type="EMAIL", ) + @parametrize + def test_method_create_overload_2(self, client: Cloudflare) -> None: + block_sender = client.email_security.settings.block_senders.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[ + { + "is_regex": False, + "pattern": "test@example.com", + "pattern_type": "EMAIL", + } + ], + ) + assert_matches_type(BlockSenderCreateResponse, block_sender, path=["response"]) + + @parametrize + def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: + response = client.email_security.settings.block_senders.with_raw_response.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[ + { + "is_regex": False, + "pattern": "test@example.com", + "pattern_type": "EMAIL", + } + ], + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + block_sender = response.parse() + assert_matches_type(BlockSenderCreateResponse, block_sender, path=["response"]) + + @parametrize + def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: + with client.email_security.settings.block_senders.with_streaming_response.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[ + { + "is_regex": False, + "pattern": "test@example.com", + "pattern_type": "EMAIL", + } + ], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + block_sender = response.parse() + assert_matches_type(BlockSenderCreateResponse, block_sender, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_create_overload_2(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.email_security.settings.block_senders.with_raw_response.create( + account_id="", + body=[ + { + "is_regex": False, + "pattern": "test@example.com", + "pattern_type": "EMAIL", + } + ], + ) + @parametrize def test_method_list(self, client: Cloudflare) -> None: block_sender = client.email_security.settings.block_senders.list( @@ -279,7 +345,7 @@ class TestAsyncBlockSenders: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: + async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> None: block_sender = await async_client.email_security.settings.block_senders.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", is_regex=False, @@ -289,7 +355,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: assert_matches_type(BlockSenderCreateResponse, block_sender, path=["response"]) @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: + async def test_method_create_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: block_sender = await async_client.email_security.settings.block_senders.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", is_regex=False, @@ -300,7 +366,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare assert_matches_type(BlockSenderCreateResponse, block_sender, path=["response"]) @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: response = await async_client.email_security.settings.block_senders.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", is_regex=False, @@ -314,7 +380,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert_matches_type(BlockSenderCreateResponse, block_sender, path=["response"]) @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: async with async_client.email_security.settings.block_senders.with_streaming_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", is_regex=False, @@ -330,7 +396,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_create_overload_1(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.email_security.settings.block_senders.with_raw_response.create( account_id="", @@ -339,6 +405,72 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: pattern_type="EMAIL", ) + @parametrize + async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> None: + block_sender = await async_client.email_security.settings.block_senders.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[ + { + "is_regex": False, + "pattern": "test@example.com", + "pattern_type": "EMAIL", + } + ], + ) + assert_matches_type(BlockSenderCreateResponse, block_sender, path=["response"]) + + @parametrize + async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: + response = await async_client.email_security.settings.block_senders.with_raw_response.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[ + { + "is_regex": False, + "pattern": "test@example.com", + "pattern_type": "EMAIL", + } + ], + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + block_sender = await response.parse() + assert_matches_type(BlockSenderCreateResponse, block_sender, path=["response"]) + + @parametrize + async def test_streaming_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: + async with async_client.email_security.settings.block_senders.with_streaming_response.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[ + { + "is_regex": False, + "pattern": "test@example.com", + "pattern_type": "EMAIL", + } + ], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + block_sender = await response.parse() + assert_matches_type(BlockSenderCreateResponse, block_sender, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_create_overload_2(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.email_security.settings.block_senders.with_raw_response.create( + account_id="", + body=[ + { + "is_regex": False, + "pattern": "test@example.com", + "pattern_type": "EMAIL", + } + ], + ) + @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: block_sender = await async_client.email_security.settings.block_senders.list( diff --git a/tests/api_resources/email_security/settings/test_impersonation_registry.py b/tests/api_resources/email_security/settings/test_impersonation_registry.py index 166def7dd1e..8a4ad4fbe92 100644 --- a/tests/api_resources/email_security/settings/test_impersonation_registry.py +++ b/tests/api_resources/email_security/settings/test_impersonation_registry.py @@ -25,7 +25,7 @@ class TestImpersonationRegistry: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize - def test_method_create(self, client: Cloudflare) -> None: + def test_method_create_overload_1(self, client: Cloudflare) -> None: impersonation_registry = client.email_security.settings.impersonation_registry.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", email="email", @@ -35,7 +35,7 @@ def test_method_create(self, client: Cloudflare) -> None: assert_matches_type(ImpersonationRegistryCreateResponse, impersonation_registry, path=["response"]) @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: + def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: response = client.email_security.settings.impersonation_registry.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", email="email", @@ -49,7 +49,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert_matches_type(ImpersonationRegistryCreateResponse, impersonation_registry, path=["response"]) @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: + def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: with client.email_security.settings.impersonation_registry.with_streaming_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", email="email", @@ -65,7 +65,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: + def test_path_params_create_overload_1(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.email_security.settings.impersonation_registry.with_raw_response.create( account_id="", @@ -74,6 +74,72 @@ def test_path_params_create(self, client: Cloudflare) -> None: name="name", ) + @parametrize + def test_method_create_overload_2(self, client: Cloudflare) -> None: + impersonation_registry = client.email_security.settings.impersonation_registry.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[ + { + "email": "email", + "is_email_regex": True, + "name": "name", + } + ], + ) + assert_matches_type(ImpersonationRegistryCreateResponse, impersonation_registry, path=["response"]) + + @parametrize + def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: + response = client.email_security.settings.impersonation_registry.with_raw_response.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[ + { + "email": "email", + "is_email_regex": True, + "name": "name", + } + ], + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + impersonation_registry = response.parse() + assert_matches_type(ImpersonationRegistryCreateResponse, impersonation_registry, path=["response"]) + + @parametrize + def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: + with client.email_security.settings.impersonation_registry.with_streaming_response.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[ + { + "email": "email", + "is_email_regex": True, + "name": "name", + } + ], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + impersonation_registry = response.parse() + assert_matches_type(ImpersonationRegistryCreateResponse, impersonation_registry, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_create_overload_2(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.email_security.settings.impersonation_registry.with_raw_response.create( + account_id="", + body=[ + { + "email": "email", + "is_email_regex": True, + "name": "name", + } + ], + ) + @parametrize def test_method_list(self, client: Cloudflare) -> None: impersonation_registry = client.email_security.settings.impersonation_registry.list( @@ -275,7 +341,7 @@ class TestAsyncImpersonationRegistry: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: + async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> None: impersonation_registry = await async_client.email_security.settings.impersonation_registry.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", email="email", @@ -285,7 +351,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: assert_matches_type(ImpersonationRegistryCreateResponse, impersonation_registry, path=["response"]) @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: response = await async_client.email_security.settings.impersonation_registry.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", email="email", @@ -299,7 +365,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert_matches_type(ImpersonationRegistryCreateResponse, impersonation_registry, path=["response"]) @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: async with async_client.email_security.settings.impersonation_registry.with_streaming_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", email="email", @@ -315,7 +381,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_create_overload_1(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.email_security.settings.impersonation_registry.with_raw_response.create( account_id="", @@ -324,6 +390,72 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: name="name", ) + @parametrize + async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> None: + impersonation_registry = await async_client.email_security.settings.impersonation_registry.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[ + { + "email": "email", + "is_email_regex": True, + "name": "name", + } + ], + ) + assert_matches_type(ImpersonationRegistryCreateResponse, impersonation_registry, path=["response"]) + + @parametrize + async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: + response = await async_client.email_security.settings.impersonation_registry.with_raw_response.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[ + { + "email": "email", + "is_email_regex": True, + "name": "name", + } + ], + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + impersonation_registry = await response.parse() + assert_matches_type(ImpersonationRegistryCreateResponse, impersonation_registry, path=["response"]) + + @parametrize + async def test_streaming_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: + async with async_client.email_security.settings.impersonation_registry.with_streaming_response.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[ + { + "email": "email", + "is_email_regex": True, + "name": "name", + } + ], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + impersonation_registry = await response.parse() + assert_matches_type(ImpersonationRegistryCreateResponse, impersonation_registry, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_create_overload_2(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.email_security.settings.impersonation_registry.with_raw_response.create( + account_id="", + body=[ + { + "email": "email", + "is_email_regex": True, + "name": "name", + } + ], + ) + @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: impersonation_registry = await async_client.email_security.settings.impersonation_registry.list( diff --git a/tests/api_resources/email_security/settings/test_trusted_domains.py b/tests/api_resources/email_security/settings/test_trusted_domains.py index 33d602bb1a4..643f33b595d 100644 --- a/tests/api_resources/email_security/settings/test_trusted_domains.py +++ b/tests/api_resources/email_security/settings/test_trusted_domains.py @@ -24,7 +24,6 @@ class TestTrustedDomains: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_method_create_overload_1(self, client: Cloudflare) -> None: trusted_domain = client.email_security.settings.trusted_domains.create( @@ -36,7 +35,6 @@ def test_method_create_overload_1(self, client: Cloudflare) -> None: ) assert_matches_type(TrustedDomainCreateResponse, trusted_domain, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> None: trusted_domain = client.email_security.settings.trusted_domains.create( @@ -49,7 +47,6 @@ def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> N ) assert_matches_type(TrustedDomainCreateResponse, trusted_domain, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: response = client.email_security.settings.trusted_domains.with_raw_response.create( @@ -65,7 +62,6 @@ def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: trusted_domain = response.parse() assert_matches_type(TrustedDomainCreateResponse, trusted_domain, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: with client.email_security.settings.trusted_domains.with_streaming_response.create( @@ -83,7 +79,6 @@ def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_path_params_create_overload_1(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -95,7 +90,6 @@ def test_path_params_create_overload_1(self, client: Cloudflare) -> None: pattern="example.com", ) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_method_create_overload_2(self, client: Cloudflare) -> None: trusted_domain = client.email_security.settings.trusted_domains.create( @@ -111,7 +105,6 @@ def test_method_create_overload_2(self, client: Cloudflare) -> None: ) assert_matches_type(TrustedDomainCreateResponse, trusted_domain, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: response = client.email_security.settings.trusted_domains.with_raw_response.create( @@ -131,7 +124,6 @@ def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: trusted_domain = response.parse() assert_matches_type(TrustedDomainCreateResponse, trusted_domain, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: with client.email_security.settings.trusted_domains.with_streaming_response.create( @@ -153,7 +145,6 @@ def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_path_params_create_overload_2(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -364,7 +355,6 @@ def test_path_params_get(self, client: Cloudflare) -> None: class TestAsyncTrustedDomains: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> None: trusted_domain = await async_client.email_security.settings.trusted_domains.create( @@ -376,7 +366,6 @@ async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> ) assert_matches_type(TrustedDomainCreateResponse, trusted_domain, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_method_create_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: trusted_domain = await async_client.email_security.settings.trusted_domains.create( @@ -389,7 +378,6 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn ) assert_matches_type(TrustedDomainCreateResponse, trusted_domain, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: response = await async_client.email_security.settings.trusted_domains.with_raw_response.create( @@ -405,7 +393,6 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflar trusted_domain = await response.parse() assert_matches_type(TrustedDomainCreateResponse, trusted_domain, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_streaming_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: async with async_client.email_security.settings.trusted_domains.with_streaming_response.create( @@ -423,7 +410,6 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncClo assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_path_params_create_overload_1(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -435,7 +421,6 @@ async def test_path_params_create_overload_1(self, async_client: AsyncCloudflare pattern="example.com", ) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> None: trusted_domain = await async_client.email_security.settings.trusted_domains.create( @@ -451,7 +436,6 @@ async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> ) assert_matches_type(TrustedDomainCreateResponse, trusted_domain, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: response = await async_client.email_security.settings.trusted_domains.with_raw_response.create( @@ -471,7 +455,6 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflar trusted_domain = await response.parse() assert_matches_type(TrustedDomainCreateResponse, trusted_domain, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_streaming_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: async with async_client.email_security.settings.trusted_domains.with_streaming_response.create( @@ -493,7 +476,6 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncClo assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_path_params_create_overload_2(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): diff --git a/tests/api_resources/logpush/test_jobs.py b/tests/api_resources/logpush/test_jobs.py index 0674d1ec883..a35edd8c19e 100644 --- a/tests/api_resources/logpush/test_jobs.py +++ b/tests/api_resources/logpush/test_jobs.py @@ -126,7 +126,6 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: max_upload_bytes=5000000, max_upload_interval_seconds=30, max_upload_records=1000, - name="example.com", output_options={ "batch_prefix": "batch_prefix", "batch_suffix": "batch_suffix", @@ -477,7 +476,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare max_upload_bytes=5000000, max_upload_interval_seconds=30, max_upload_records=1000, - name="example.com", output_options={ "batch_prefix": "batch_prefix", "batch_suffix": "batch_suffix", diff --git a/tests/api_resources/magic_transit/sites/test_acls.py b/tests/api_resources/magic_transit/sites/test_acls.py index 151e289d692..e14f6ccb449 100644 --- a/tests/api_resources/magic_transit/sites/test_acls.py +++ b/tests/api_resources/magic_transit/sites/test_acls.py @@ -52,7 +52,6 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: description="Allows local traffic between PIN pads and cash register.", forward_locally=True, protocols=["tcp"], - unidirectional=True, ) assert_matches_type(ACL, acl, path=["response"]) @@ -139,7 +138,6 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: }, name="PIN Pad - Cash Register", protocols=["tcp"], - unidirectional=True, ) assert_matches_type(ACL, acl, path=["response"]) @@ -333,7 +331,6 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: }, name="PIN Pad - Cash Register", protocols=["tcp"], - unidirectional=True, ) assert_matches_type(ACL, acl, path=["response"]) @@ -484,7 +481,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare description="Allows local traffic between PIN pads and cash register.", forward_locally=True, protocols=["tcp"], - unidirectional=True, ) assert_matches_type(ACL, acl, path=["response"]) @@ -571,7 +567,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare }, name="PIN Pad - Cash Register", protocols=["tcp"], - unidirectional=True, ) assert_matches_type(ACL, acl, path=["response"]) @@ -765,7 +760,6 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) }, name="PIN Pad - Cash Register", protocols=["tcp"], - unidirectional=True, ) assert_matches_type(ACL, acl, path=["response"]) diff --git a/tests/api_resources/r2/buckets/domains/test_custom.py b/tests/api_resources/r2/buckets/domains/test_custom.py index 87e7d3ccb1f..3770f95c3f3 100644 --- a/tests/api_resources/r2/buckets/domains/test_custom.py +++ b/tests/api_resources/r2/buckets/domains/test_custom.py @@ -45,7 +45,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: enabled=True, zone_id="36ca64a6d92827b8a6b90be344bb1bfd", min_tls="1.0", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(CustomCreateResponse, custom, path=["response"]) @@ -123,7 +123,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: bucket_name="example-bucket", enabled=True, min_tls="1.0", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(CustomUpdateResponse, custom, path=["response"]) @@ -196,7 +196,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: custom = client.r2.buckets.domains.custom.list( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(CustomListResponse, custom, path=["response"]) @@ -260,7 +260,7 @@ def test_method_delete_with_all_params(self, client: Cloudflare) -> None: domain_name="example-domain/custom-domain.com", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="example-bucket", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(CustomDeleteResponse, custom, path=["response"]) @@ -335,7 +335,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: domain_name="example-domain/custom-domain.com", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="example-bucket", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(CustomGetResponse, custom, path=["response"]) @@ -419,7 +419,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare enabled=True, zone_id="36ca64a6d92827b8a6b90be344bb1bfd", min_tls="1.0", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(CustomCreateResponse, custom, path=["response"]) @@ -497,7 +497,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare bucket_name="example-bucket", enabled=True, min_tls="1.0", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(CustomUpdateResponse, custom, path=["response"]) @@ -570,7 +570,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) custom = await async_client.r2.buckets.domains.custom.list( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(CustomListResponse, custom, path=["response"]) @@ -634,7 +634,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare domain_name="example-domain/custom-domain.com", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="example-bucket", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(CustomDeleteResponse, custom, path=["response"]) @@ -709,7 +709,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - domain_name="example-domain/custom-domain.com", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="example-bucket", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(CustomGetResponse, custom, path=["response"]) diff --git a/tests/api_resources/r2/buckets/domains/test_managed.py b/tests/api_resources/r2/buckets/domains/test_managed.py index 2d574c1b72a..a1c8f3bc5b0 100644 --- a/tests/api_resources/r2/buckets/domains/test_managed.py +++ b/tests/api_resources/r2/buckets/domains/test_managed.py @@ -34,7 +34,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", enabled=True, - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(ManagedUpdateResponse, managed, path=["response"]) @@ -100,7 +100,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: managed = client.r2.buckets.domains.managed.list( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(ManagedListResponse, managed, path=["response"]) @@ -168,7 +168,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", enabled=True, - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(ManagedUpdateResponse, managed, path=["response"]) @@ -234,7 +234,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) managed = await async_client.r2.buckets.domains.managed.list( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(ManagedListResponse, managed, path=["response"]) diff --git a/tests/api_resources/r2/buckets/event_notifications/configuration/test_queues.py b/tests/api_resources/r2/buckets/event_notifications/configuration/test_queues.py index 8a8fa2a2102..870412e34cc 100644 --- a/tests/api_resources/r2/buckets/event_notifications/configuration/test_queues.py +++ b/tests/api_resources/r2/buckets/event_notifications/configuration/test_queues.py @@ -41,7 +41,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "suffix": ".jpeg", } ], - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(object, queue, path=["response"]) @@ -116,7 +116,7 @@ def test_method_delete_with_all_params(self, client: Cloudflare) -> None: queue_id="queue_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="example-bucket", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(object, queue, path=["response"]) @@ -203,7 +203,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "suffix": ".jpeg", } ], - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(object, queue, path=["response"]) @@ -278,7 +278,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare queue_id="queue_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="example-bucket", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(object, queue, path=["response"]) diff --git a/tests/api_resources/r2/buckets/event_notifications/test_configuration.py b/tests/api_resources/r2/buckets/event_notifications/test_configuration.py index 48c14e93942..beb978137e8 100644 --- a/tests/api_resources/r2/buckets/event_notifications/test_configuration.py +++ b/tests/api_resources/r2/buckets/event_notifications/test_configuration.py @@ -32,7 +32,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: configuration = client.r2.buckets.event_notifications.configuration.get( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(ConfigurationGetResponse, configuration, path=["response"]) @@ -98,7 +98,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - configuration = await async_client.r2.buckets.event_notifications.configuration.get( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(ConfigurationGetResponse, configuration, path=["response"]) diff --git a/tests/api_resources/r2/buckets/test_cors.py b/tests/api_resources/r2/buckets/test_cors.py index 4c978af07d5..c64f885d196 100644 --- a/tests/api_resources/r2/buckets/test_cors.py +++ b/tests/api_resources/r2/buckets/test_cors.py @@ -44,7 +44,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "max_age_seconds": 3600, } ], - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(object, cors, path=["response"]) @@ -106,7 +106,7 @@ def test_method_delete_with_all_params(self, client: Cloudflare) -> None: cors = client.r2.buckets.cors.delete( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(object, cors, path=["response"]) @@ -168,7 +168,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: cors = client.r2.buckets.cors.get( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(CORSGetResponse, cors, path=["response"]) @@ -246,7 +246,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "max_age_seconds": 3600, } ], - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(object, cors, path=["response"]) @@ -308,7 +308,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare cors = await async_client.r2.buckets.cors.delete( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(object, cors, path=["response"]) @@ -370,7 +370,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - cors = await async_client.r2.buckets.cors.get( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(CORSGetResponse, cors, path=["response"]) diff --git a/tests/api_resources/r2/buckets/test_lifecycle.py b/tests/api_resources/r2/buckets/test_lifecycle.py index f377344330f..a8d7d965613 100644 --- a/tests/api_resources/r2/buckets/test_lifecycle.py +++ b/tests/api_resources/r2/buckets/test_lifecycle.py @@ -60,7 +60,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: ], } ], - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(object, lifecycle, path=["response"]) @@ -122,7 +122,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: lifecycle = client.r2.buckets.lifecycle.get( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(LifecycleGetResponse, lifecycle, path=["response"]) @@ -216,7 +216,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare ], } ], - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(object, lifecycle, path=["response"]) @@ -278,7 +278,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - lifecycle = await async_client.r2.buckets.lifecycle.get( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(LifecycleGetResponse, lifecycle, path=["response"]) diff --git a/tests/api_resources/r2/buckets/test_sippy.py b/tests/api_resources/r2/buckets/test_sippy.py index 6e67aca418d..3fdc3bec704 100644 --- a/tests/api_resources/r2/buckets/test_sippy.py +++ b/tests/api_resources/r2/buckets/test_sippy.py @@ -44,7 +44,7 @@ def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> N "region": "region", "secret_access_key": "secretAccessKey", }, - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(Sippy, sippy, path=["response"]) @@ -117,7 +117,7 @@ def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> N "private_key": "privateKey", "provider": "gcs", }, - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(Sippy, sippy, path=["response"]) @@ -179,7 +179,7 @@ def test_method_delete_with_all_params(self, client: Cloudflare) -> None: sippy = client.r2.buckets.sippy.delete( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(SippyDeleteResponse, sippy, path=["response"]) @@ -241,7 +241,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: sippy = client.r2.buckets.sippy.get( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(Sippy, sippy, path=["response"]) @@ -319,7 +319,7 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn "region": "region", "secret_access_key": "secretAccessKey", }, - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(Sippy, sippy, path=["response"]) @@ -392,7 +392,7 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn "private_key": "privateKey", "provider": "gcs", }, - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(Sippy, sippy, path=["response"]) @@ -454,7 +454,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare sippy = await async_client.r2.buckets.sippy.delete( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(SippyDeleteResponse, sippy, path=["response"]) @@ -516,7 +516,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - sippy = await async_client.r2.buckets.sippy.get( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(Sippy, sippy, path=["response"]) diff --git a/tests/api_resources/r2/test_buckets.py b/tests/api_resources/r2/test_buckets.py index 78d22d35f70..e1713e18824 100644 --- a/tests/api_resources/r2/test_buckets.py +++ b/tests/api_resources/r2/test_buckets.py @@ -34,7 +34,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: name="example-bucket", location_hint="apac", storage_class="Standard", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(Bucket, bucket, path=["response"]) @@ -94,7 +94,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: order="name", per_page=1, start_after="my-bucket", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(BucketListResponse, bucket, path=["response"]) @@ -147,7 +147,7 @@ def test_method_delete_with_all_params(self, client: Cloudflare) -> None: bucket = client.r2.buckets.delete( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(object, bucket, path=["response"]) @@ -209,7 +209,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: bucket = client.r2.buckets.get( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(Bucket, bucket, path=["response"]) @@ -277,7 +277,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare name="example-bucket", location_hint="apac", storage_class="Standard", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(Bucket, bucket, path=["response"]) @@ -337,7 +337,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) order="name", per_page=1, start_after="my-bucket", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(BucketListResponse, bucket, path=["response"]) @@ -390,7 +390,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare bucket = await async_client.r2.buckets.delete( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(object, bucket, path=["response"]) @@ -452,7 +452,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - bucket = await async_client.r2.buckets.get( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - jurisdiction="default", + cf_r2_jurisdiction="default", ) assert_matches_type(Bucket, bucket, path=["response"]) diff --git a/tests/api_resources/radar/ai/bots/test_summary.py b/tests/api_resources/radar/ai/bots/test_summary.py index ca5d4e987c0..a9d3715f712 100644 --- a/tests/api_resources/radar/ai/bots/test_summary.py +++ b/tests/api_resources/radar/ai/bots/test_summary.py @@ -32,7 +32,6 @@ def test_method_user_agent_with_all_params(self, client: Cloudflare) -> None: date_range=["7d"], date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", - limit_per_group=10, location=["string"], name=["string"], ) @@ -76,7 +75,6 @@ async def test_method_user_agent_with_all_params(self, async_client: AsyncCloudf date_range=["7d"], date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", - limit_per_group=10, location=["string"], name=["string"], ) diff --git a/tests/api_resources/radar/ai/test_timeseries_groups.py b/tests/api_resources/radar/ai/test_timeseries_groups.py index 94ccc123297..51184d25d05 100644 --- a/tests/api_resources/radar/ai/test_timeseries_groups.py +++ b/tests/api_resources/radar/ai/test_timeseries_groups.py @@ -33,7 +33,7 @@ def test_method_user_agent_with_all_params(self, client: Cloudflare) -> None: date_range=["7d"], date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", - limit_per_group=10, + limit_per_group=4, location=["string"], name=["string"], ) @@ -78,7 +78,7 @@ async def test_method_user_agent_with_all_params(self, async_client: AsyncCloudf date_range=["7d"], date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", - limit_per_group=10, + limit_per_group=4, location=["string"], name=["string"], ) diff --git a/tests/api_resources/radar/as112/test_summary.py b/tests/api_resources/radar/as112/test_summary.py index d5956baed72..caffb58e7bb 100644 --- a/tests/api_resources/radar/as112/test_summary.py +++ b/tests/api_resources/radar/as112/test_summary.py @@ -195,7 +195,6 @@ def test_method_query_type_with_all_params(self, client: Cloudflare) -> None: date_range=["7d"], date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", - limit_per_group=10, location=["string"], name=["string"], ) @@ -235,7 +234,6 @@ def test_method_response_codes_with_all_params(self, client: Cloudflare) -> None date_range=["7d"], date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", - limit_per_group=10, location=["string"], name=["string"], ) @@ -435,7 +433,6 @@ async def test_method_query_type_with_all_params(self, async_client: AsyncCloudf date_range=["7d"], date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", - limit_per_group=10, location=["string"], name=["string"], ) @@ -475,7 +472,6 @@ async def test_method_response_codes_with_all_params(self, async_client: AsyncCl date_range=["7d"], date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", - limit_per_group=10, location=["string"], name=["string"], ) diff --git a/tests/api_resources/radar/as112/test_timeseries_groups.py b/tests/api_resources/radar/as112/test_timeseries_groups.py index 26adfcf7eab..703a7fd254f 100644 --- a/tests/api_resources/radar/as112/test_timeseries_groups.py +++ b/tests/api_resources/radar/as112/test_timeseries_groups.py @@ -200,7 +200,6 @@ def test_method_query_type_with_all_params(self, client: Cloudflare) -> None: date_range=["7d"], date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", - limit_per_group=10, location=["string"], name=["string"], ) @@ -241,7 +240,6 @@ def test_method_response_codes_with_all_params(self, client: Cloudflare) -> None date_range=["7d"], date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", - limit_per_group=10, location=["string"], name=["string"], ) @@ -446,7 +444,6 @@ async def test_method_query_type_with_all_params(self, async_client: AsyncCloudf date_range=["7d"], date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", - limit_per_group=10, location=["string"], name=["string"], ) @@ -487,7 +484,6 @@ async def test_method_response_codes_with_all_params(self, async_client: AsyncCl date_range=["7d"], date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", - limit_per_group=10, location=["string"], name=["string"], ) diff --git a/tests/api_resources/radar/attacks/layer3/test_summary.py b/tests/api_resources/radar/attacks/layer3/test_summary.py index 6e0d57be6a1..dd0ffe08b6c 100644 --- a/tests/api_resources/radar/attacks/layer3/test_summary.py +++ b/tests/api_resources/radar/attacks/layer3/test_summary.py @@ -241,7 +241,6 @@ def test_method_vector_with_all_params(self, client: Cloudflare) -> None: direction="ORIGIN", format="JSON", ip_version=["IPv4"], - limit_per_group=10, location=["string"], name=["string"], protocol=["UDP"], @@ -488,7 +487,6 @@ async def test_method_vector_with_all_params(self, async_client: AsyncCloudflare direction="ORIGIN", format="JSON", ip_version=["IPv4"], - limit_per_group=10, location=["string"], name=["string"], protocol=["UDP"], diff --git a/tests/api_resources/radar/attacks/layer3/test_timeseries_groups.py b/tests/api_resources/radar/attacks/layer3/test_timeseries_groups.py index 258338056b5..0fd0a3e6c90 100644 --- a/tests/api_resources/radar/attacks/layer3/test_timeseries_groups.py +++ b/tests/api_resources/radar/attacks/layer3/test_timeseries_groups.py @@ -169,7 +169,7 @@ def test_method_industry_with_all_params(self, client: Cloudflare) -> None: direction="ORIGIN", format="JSON", ip_version=["IPv4"], - limit_per_group=10, + limit_per_group=4, location=["string"], name=["string"], normalization="PERCENTAGE", @@ -297,7 +297,7 @@ def test_method_vector_with_all_params(self, client: Cloudflare) -> None: direction="ORIGIN", format="JSON", ip_version=["IPv4"], - limit_per_group=10, + limit_per_group=4, location=["string"], name=["string"], normalization="PERCENTAGE", @@ -341,7 +341,7 @@ def test_method_vertical_with_all_params(self, client: Cloudflare) -> None: direction="ORIGIN", format="JSON", ip_version=["IPv4"], - limit_per_group=10, + limit_per_group=4, location=["string"], name=["string"], normalization="PERCENTAGE", @@ -515,7 +515,7 @@ async def test_method_industry_with_all_params(self, async_client: AsyncCloudfla direction="ORIGIN", format="JSON", ip_version=["IPv4"], - limit_per_group=10, + limit_per_group=4, location=["string"], name=["string"], normalization="PERCENTAGE", @@ -643,7 +643,7 @@ async def test_method_vector_with_all_params(self, async_client: AsyncCloudflare direction="ORIGIN", format="JSON", ip_version=["IPv4"], - limit_per_group=10, + limit_per_group=4, location=["string"], name=["string"], normalization="PERCENTAGE", @@ -687,7 +687,7 @@ async def test_method_vertical_with_all_params(self, async_client: AsyncCloudfla direction="ORIGIN", format="JSON", ip_version=["IPv4"], - limit_per_group=10, + limit_per_group=4, location=["string"], name=["string"], normalization="PERCENTAGE", diff --git a/tests/api_resources/radar/attacks/layer7/test_summary.py b/tests/api_resources/radar/attacks/layer7/test_summary.py index 694c8f4497c..64b5d969caf 100644 --- a/tests/api_resources/radar/attacks/layer7/test_summary.py +++ b/tests/api_resources/radar/attacks/layer7/test_summary.py @@ -80,7 +80,6 @@ def test_method_http_method_with_all_params(self, client: Cloudflare) -> None: format="JSON", http_version=["HTTPv1"], ip_version=["IPv4"], - limit_per_group=10, location=["string"], mitigation_product=["DDOS"], name=["string"], @@ -208,7 +207,6 @@ def test_method_managed_rules_with_all_params(self, client: Cloudflare) -> None: http_method=["GET"], http_version=["HTTPv1"], ip_version=["IPv4"], - limit_per_group=10, location=["string"], mitigation_product=["DDOS"], name=["string"], @@ -252,7 +250,6 @@ def test_method_mitigation_product_with_all_params(self, client: Cloudflare) -> http_method=["GET"], http_version=["HTTPv1"], ip_version=["IPv4"], - limit_per_group=10, location=["string"], name=["string"], ) @@ -337,7 +334,6 @@ async def test_method_http_method_with_all_params(self, async_client: AsyncCloud format="JSON", http_version=["HTTPv1"], ip_version=["IPv4"], - limit_per_group=10, location=["string"], mitigation_product=["DDOS"], name=["string"], @@ -465,7 +461,6 @@ async def test_method_managed_rules_with_all_params(self, async_client: AsyncClo http_method=["GET"], http_version=["HTTPv1"], ip_version=["IPv4"], - limit_per_group=10, location=["string"], mitigation_product=["DDOS"], name=["string"], @@ -509,7 +504,6 @@ async def test_method_mitigation_product_with_all_params(self, async_client: Asy http_method=["GET"], http_version=["HTTPv1"], ip_version=["IPv4"], - limit_per_group=10, location=["string"], name=["string"], ) diff --git a/tests/api_resources/radar/attacks/layer7/test_timeseries_groups.py b/tests/api_resources/radar/attacks/layer7/test_timeseries_groups.py index 853d11fb63c..54a36ba067e 100644 --- a/tests/api_resources/radar/attacks/layer7/test_timeseries_groups.py +++ b/tests/api_resources/radar/attacks/layer7/test_timeseries_groups.py @@ -84,7 +84,6 @@ def test_method_http_method_with_all_params(self, client: Cloudflare) -> None: format="JSON", http_version=["HTTPv1"], ip_version=["IPv4"], - limit_per_group=10, location=["string"], mitigation_product=["DDOS"], name=["string"], @@ -174,7 +173,7 @@ def test_method_industry_with_all_params(self, client: Cloudflare) -> None: http_method=["GET"], http_version=["HTTPv1"], ip_version=["IPv4"], - limit_per_group=10, + limit_per_group=4, location=["string"], mitigation_product=["DDOS"], name=["string"], @@ -264,7 +263,6 @@ def test_method_managed_rules_with_all_params(self, client: Cloudflare) -> None: http_method=["GET"], http_version=["HTTPv1"], ip_version=["IPv4"], - limit_per_group=10, location=["string"], mitigation_product=["DDOS"], name=["string"], @@ -310,7 +308,6 @@ def test_method_mitigation_product_with_all_params(self, client: Cloudflare) -> http_method=["GET"], http_version=["HTTPv1"], ip_version=["IPv4"], - limit_per_group=10, location=["string"], name=["string"], normalization="PERCENTAGE", @@ -355,7 +352,7 @@ def test_method_vertical_with_all_params(self, client: Cloudflare) -> None: http_method=["GET"], http_version=["HTTPv1"], ip_version=["IPv4"], - limit_per_group=10, + limit_per_group=4, location=["string"], mitigation_product=["DDOS"], name=["string"], @@ -444,7 +441,6 @@ async def test_method_http_method_with_all_params(self, async_client: AsyncCloud format="JSON", http_version=["HTTPv1"], ip_version=["IPv4"], - limit_per_group=10, location=["string"], mitigation_product=["DDOS"], name=["string"], @@ -534,7 +530,7 @@ async def test_method_industry_with_all_params(self, async_client: AsyncCloudfla http_method=["GET"], http_version=["HTTPv1"], ip_version=["IPv4"], - limit_per_group=10, + limit_per_group=4, location=["string"], mitigation_product=["DDOS"], name=["string"], @@ -624,7 +620,6 @@ async def test_method_managed_rules_with_all_params(self, async_client: AsyncClo http_method=["GET"], http_version=["HTTPv1"], ip_version=["IPv4"], - limit_per_group=10, location=["string"], mitigation_product=["DDOS"], name=["string"], @@ -670,7 +665,6 @@ async def test_method_mitigation_product_with_all_params(self, async_client: Asy http_method=["GET"], http_version=["HTTPv1"], ip_version=["IPv4"], - limit_per_group=10, location=["string"], name=["string"], normalization="PERCENTAGE", @@ -715,7 +709,7 @@ async def test_method_vertical_with_all_params(self, async_client: AsyncCloudfla http_method=["GET"], http_version=["HTTPv1"], ip_version=["IPv4"], - limit_per_group=10, + limit_per_group=4, location=["string"], mitigation_product=["DDOS"], name=["string"], diff --git a/tests/api_resources/radar/http/test_timeseries_groups.py b/tests/api_resources/radar/http/test_timeseries_groups.py index 8789e6c61ed..8c0d3decdd5 100644 --- a/tests/api_resources/radar/http/test_timeseries_groups.py +++ b/tests/api_resources/radar/http/test_timeseries_groups.py @@ -95,7 +95,7 @@ def test_method_browser_with_all_params(self, client: Cloudflare) -> None: http_protocol=["HTTP"], http_version=["HTTPv1"], ip_version=["IPv4"], - limit_per_group=10, + limit_per_group=4, location=["string"], name=["string"], os=["WINDOWS"], @@ -143,7 +143,6 @@ def test_method_browser_family_with_all_params(self, client: Cloudflare) -> None http_protocol=["HTTP"], http_version=["HTTPv1"], ip_version=["IPv4"], - limit_per_group=10, location=["string"], name=["string"], os=["WINDOWS"], @@ -564,7 +563,7 @@ async def test_method_browser_with_all_params(self, async_client: AsyncCloudflar http_protocol=["HTTP"], http_version=["HTTPv1"], ip_version=["IPv4"], - limit_per_group=10, + limit_per_group=4, location=["string"], name=["string"], os=["WINDOWS"], @@ -612,7 +611,6 @@ async def test_method_browser_family_with_all_params(self, async_client: AsyncCl http_protocol=["HTTP"], http_version=["HTTPv1"], ip_version=["IPv4"], - limit_per_group=10, location=["string"], name=["string"], os=["WINDOWS"], diff --git a/tests/api_resources/radar/ranking/test_domain.py b/tests/api_resources/radar/ranking/test_domain.py index 26021593dd9..b67fc2b8ad7 100644 --- a/tests/api_resources/radar/ranking/test_domain.py +++ b/tests/api_resources/radar/ranking/test_domain.py @@ -9,7 +9,6 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare._utils import parse_date from cloudflare.types.radar.ranking import DomainGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -29,9 +28,8 @@ def test_method_get(self, client: Cloudflare) -> None: def test_method_get_with_all_params(self, client: Cloudflare) -> None: domain = client.radar.ranking.domain.get( domain="google.com", - date=[parse_date("2019-12-27")], + date=["string"], format="JSON", - include_top_locations=True, limit=5, name=["string"], ranking_type="POPULAR", @@ -84,9 +82,8 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: domain = await async_client.radar.ranking.domain.get( domain="google.com", - date=[parse_date("2019-12-27")], + date=["string"], format="JSON", - include_top_locations=True, limit=5, name=["string"], ranking_type="POPULAR", diff --git a/tests/api_resources/radar/test_ranking.py b/tests/api_resources/radar/test_ranking.py index 6608571dbd3..9e4b188e021 100644 --- a/tests/api_resources/radar/test_ranking.py +++ b/tests/api_resources/radar/test_ranking.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare._utils import parse_date, parse_datetime +from cloudflare._utils import parse_datetime from cloudflare.types.radar import ( RankingTopResponse, RankingTimeseriesGroupsResponse, @@ -69,7 +69,7 @@ def test_method_top(self, client: Cloudflare) -> None: @parametrize def test_method_top_with_all_params(self, client: Cloudflare) -> None: ranking = client.radar.ranking.top( - date=[parse_date("2019-12-27")], + date=["string"], format="JSON", limit=5, location=["string"], @@ -150,7 +150,7 @@ async def test_method_top(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_top_with_all_params(self, async_client: AsyncCloudflare) -> None: ranking = await async_client.radar.ranking.top( - date=[parse_date("2019-12-27")], + date=["string"], format="JSON", limit=5, location=["string"], diff --git a/tests/api_resources/rulesets/test_rules.py b/tests/api_resources/rulesets/test_rules.py index d57aa588aa2..117eee8c295 100644 --- a/tests/api_resources/rulesets/test_rules.py +++ b/tests/api_resources/rulesets/test_rules.py @@ -1411,7 +1411,16 @@ def test_method_create_with_all_params_overload_15(self, client: Cloudflare) -> "include": ["string"], }, "host": {"resolved": True}, - "query_string": {"include": {"list": ["foo", "bar"]}}, + "query_string": { + "exclude": { + "all": True, + "list": ["string"], + }, + "include": { + "all": True, + "list": ["string"], + }, + }, "user": { "device_type": True, "geo": True, @@ -3459,7 +3468,16 @@ def test_method_edit_with_all_params_overload_15(self, client: Cloudflare) -> No "include": ["string"], }, "host": {"resolved": True}, - "query_string": {"include": {"list": ["foo", "bar"]}}, + "query_string": { + "exclude": { + "all": True, + "list": ["string"], + }, + "include": { + "all": True, + "list": ["string"], + }, + }, "user": { "device_type": True, "geo": True, @@ -5286,7 +5304,16 @@ async def test_method_create_with_all_params_overload_15(self, async_client: Asy "include": ["string"], }, "host": {"resolved": True}, - "query_string": {"include": {"list": ["foo", "bar"]}}, + "query_string": { + "exclude": { + "all": True, + "list": ["string"], + }, + "include": { + "all": True, + "list": ["string"], + }, + }, "user": { "device_type": True, "geo": True, @@ -7334,7 +7361,16 @@ async def test_method_edit_with_all_params_overload_15(self, async_client: Async "include": ["string"], }, "host": {"resolved": True}, - "query_string": {"include": {"list": ["foo", "bar"]}}, + "query_string": { + "exclude": { + "all": True, + "list": ["string"], + }, + "include": { + "all": True, + "list": ["string"], + }, + }, "user": { "device_type": True, "geo": True, diff --git a/tests/api_resources/spectrum/test_apps.py b/tests/api_resources/spectrum/test_apps.py index 406363c48d8..a5109d18f6a 100644 --- a/tests/api_resources/spectrum/test_apps.py +++ b/tests/api_resources/spectrum/test_apps.py @@ -383,7 +383,6 @@ def test_path_params_update_overload_2(self, client: Cloudflare) -> None: protocol="tcp/22", ) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_method_list(self, client: Cloudflare) -> None: app = client.spectrum.apps.list( @@ -391,7 +390,6 @@ def test_method_list(self, client: Cloudflare) -> None: ) assert_matches_type(SyncV4PagePaginationArray[Optional[AppListResponse]], app, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: app = client.spectrum.apps.list( @@ -403,7 +401,6 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: ) assert_matches_type(SyncV4PagePaginationArray[Optional[AppListResponse]], app, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.spectrum.apps.with_raw_response.list( @@ -415,7 +412,6 @@ def test_raw_response_list(self, client: Cloudflare) -> None: app = response.parse() assert_matches_type(SyncV4PagePaginationArray[Optional[AppListResponse]], app, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.spectrum.apps.with_streaming_response.list( @@ -429,7 +425,6 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_path_params_list(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): @@ -896,7 +891,6 @@ async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare protocol="tcp/22", ) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: app = await async_client.spectrum.apps.list( @@ -904,7 +898,6 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: ) assert_matches_type(AsyncV4PagePaginationArray[Optional[AppListResponse]], app, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: app = await async_client.spectrum.apps.list( @@ -916,7 +909,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) ) assert_matches_type(AsyncV4PagePaginationArray[Optional[AppListResponse]], app, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.spectrum.apps.with_raw_response.list( @@ -928,7 +920,6 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: app = await response.parse() assert_matches_type(AsyncV4PagePaginationArray[Optional[AppListResponse]], app, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.spectrum.apps.with_streaming_response.list( @@ -942,7 +933,6 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): diff --git a/tests/api_resources/test_abuse_reports.py b/tests/api_resources/test_abuse_reports.py deleted file mode 100644 index ff8d92dee38..00000000000 --- a/tests/api_resources/test_abuse_reports.py +++ /dev/null @@ -1,243 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestAbuseReports: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") - @parametrize - def test_method_create(self, client: Cloudflare) -> None: - abuse_report = client.abuse_reports.create( - report_type="abuse_dmca", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - act="abuse_dmca", - email="email", - email2="email2", - host_notification="send", - ncmec_notification="send", - owner_notification="send", - urls="urls", - ) - assert_matches_type(str, abuse_report, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") - @parametrize - def test_method_create_with_all_params(self, client: Cloudflare) -> None: - abuse_report = client.abuse_reports.create( - report_type="abuse_dmca", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - act="abuse_dmca", - email="email", - email2="email2", - host_notification="send", - ncmec_notification="send", - owner_notification="send", - urls="urls", - address1="x", - agent_name="x", - agree=0, - city="x", - comments="x", - company="x", - country="x", - destination_ips="destination_ips", - justification="x", - name="x", - ncsei_subject_representation=True, - original_work="x", - ports_protocols="ports_protocols", - signature="signature", - source_ips="source_ips", - state="x", - tele="x", - title="x", - trademark_number="x", - trademark_office="x", - trademark_symbol="x", - ) - assert_matches_type(str, abuse_report, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") - @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.abuse_reports.with_raw_response.create( - report_type="abuse_dmca", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - act="abuse_dmca", - email="email", - email2="email2", - host_notification="send", - ncmec_notification="send", - owner_notification="send", - urls="urls", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - abuse_report = response.parse() - assert_matches_type(str, abuse_report, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") - @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.abuse_reports.with_streaming_response.create( - report_type="abuse_dmca", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - act="abuse_dmca", - email="email", - email2="email2", - host_notification="send", - ncmec_notification="send", - owner_notification="send", - urls="urls", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - abuse_report = response.parse() - assert_matches_type(str, abuse_report, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") - @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.abuse_reports.with_raw_response.create( - report_type="abuse_dmca", - account_id="", - act="abuse_dmca", - email="email", - email2="email2", - host_notification="send", - ncmec_notification="send", - owner_notification="send", - urls="urls", - ) - - -class TestAsyncAbuseReports: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") - @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: - abuse_report = await async_client.abuse_reports.create( - report_type="abuse_dmca", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - act="abuse_dmca", - email="email", - email2="email2", - host_notification="send", - ncmec_notification="send", - owner_notification="send", - urls="urls", - ) - assert_matches_type(str, abuse_report, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") - @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: - abuse_report = await async_client.abuse_reports.create( - report_type="abuse_dmca", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - act="abuse_dmca", - email="email", - email2="email2", - host_notification="send", - ncmec_notification="send", - owner_notification="send", - urls="urls", - address1="x", - agent_name="x", - agree=0, - city="x", - comments="x", - company="x", - country="x", - destination_ips="destination_ips", - justification="x", - name="x", - ncsei_subject_representation=True, - original_work="x", - ports_protocols="ports_protocols", - signature="signature", - source_ips="source_ips", - state="x", - tele="x", - title="x", - trademark_number="x", - trademark_office="x", - trademark_symbol="x", - ) - assert_matches_type(str, abuse_report, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") - @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.abuse_reports.with_raw_response.create( - report_type="abuse_dmca", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - act="abuse_dmca", - email="email", - email2="email2", - host_notification="send", - ncmec_notification="send", - owner_notification="send", - urls="urls", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - abuse_report = await response.parse() - assert_matches_type(str, abuse_report, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") - @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.abuse_reports.with_streaming_response.create( - report_type="abuse_dmca", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - act="abuse_dmca", - email="email", - email2="email2", - host_notification="send", - ncmec_notification="send", - owner_notification="send", - urls="urls", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - abuse_report = await response.parse() - assert_matches_type(str, abuse_report, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") - @parametrize - async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.abuse_reports.with_raw_response.create( - report_type="abuse_dmca", - account_id="", - act="abuse_dmca", - email="email", - email2="email2", - host_notification="send", - ncmec_notification="send", - owner_notification="send", - urls="urls", - ) diff --git a/tests/api_resources/test_ai_gateway.py b/tests/api_resources/test_ai_gateway.py index 410c03d585f..8c33ce4e9fa 100644 --- a/tests/api_resources/test_ai_gateway.py +++ b/tests/api_resources/test_ai_gateway.py @@ -211,6 +211,8 @@ def test_method_list(self, client: Cloudflare) -> None: def test_method_list_with_all_params(self, client: Cloudflare) -> None: ai_gateway = client.ai_gateway.list( account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0", + order_by="order_by", + order_by_direction="asc", page=1, per_page=1, search="search", @@ -535,6 +537,8 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: ai_gateway = await async_client.ai_gateway.list( account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0", + order_by="order_by", + order_by_direction="asc", page=1, per_page=1, search="search", diff --git a/tests/api_resources/test_filters.py b/tests/api_resources/test_filters.py index c85398c274e..eb126fb8162 100644 --- a/tests/api_resources/test_filters.py +++ b/tests/api_resources/test_filters.py @@ -293,7 +293,6 @@ def test_path_params_bulk_delete(self, client: Cloudflare) -> None: zone_id="", ) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_method_bulk_update(self, client: Cloudflare) -> None: with pytest.warns(DeprecationWarning): @@ -303,7 +302,6 @@ def test_method_bulk_update(self, client: Cloudflare) -> None: assert_matches_type(Optional[FilterBulkUpdateResponse], filter, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_raw_response_bulk_update(self, client: Cloudflare) -> None: with pytest.warns(DeprecationWarning): @@ -316,7 +314,6 @@ def test_raw_response_bulk_update(self, client: Cloudflare) -> None: filter = response.parse() assert_matches_type(Optional[FilterBulkUpdateResponse], filter, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_streaming_response_bulk_update(self, client: Cloudflare) -> None: with pytest.warns(DeprecationWarning): @@ -331,7 +328,6 @@ def test_streaming_response_bulk_update(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_bulk_update(self, client: Cloudflare) -> None: with pytest.warns(DeprecationWarning): @@ -665,7 +661,6 @@ async def test_path_params_bulk_delete(self, async_client: AsyncCloudflare) -> N zone_id="", ) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_bulk_update(self, async_client: AsyncCloudflare) -> None: with pytest.warns(DeprecationWarning): @@ -675,7 +670,6 @@ async def test_method_bulk_update(self, async_client: AsyncCloudflare) -> None: assert_matches_type(Optional[FilterBulkUpdateResponse], filter, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_raw_response_bulk_update(self, async_client: AsyncCloudflare) -> None: with pytest.warns(DeprecationWarning): @@ -688,7 +682,6 @@ async def test_raw_response_bulk_update(self, async_client: AsyncCloudflare) -> filter = await response.parse() assert_matches_type(Optional[FilterBulkUpdateResponse], filter, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_streaming_response_bulk_update(self, async_client: AsyncCloudflare) -> None: with pytest.warns(DeprecationWarning): @@ -703,7 +696,6 @@ async def test_streaming_response_bulk_update(self, async_client: AsyncCloudflar assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_bulk_update(self, async_client: AsyncCloudflare) -> None: with pytest.warns(DeprecationWarning): diff --git a/tests/api_resources/test_managed_transforms.py b/tests/api_resources/test_managed_transforms.py index f00cf76c8b0..895eb3ee9fa 100644 --- a/tests/api_resources/test_managed_transforms.py +++ b/tests/api_resources/test_managed_transforms.py @@ -20,19 +20,17 @@ class TestManagedTransforms: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize def test_method_list(self, client: Cloudflare) -> None: managed_transform = client.managed_transforms.list( - zone_id="9f1839b6152d298aca64c4e906b6d074", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(ManagedTransformListResponse, managed_transform, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.managed_transforms.with_raw_response.list( - zone_id="9f1839b6152d298aca64c4e906b6d074", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -40,11 +38,10 @@ def test_raw_response_list(self, client: Cloudflare) -> None: managed_transform = response.parse() assert_matches_type(ManagedTransformListResponse, managed_transform, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.managed_transforms.with_streaming_response.list( - zone_id="9f1839b6152d298aca64c4e906b6d074", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -54,7 +51,6 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize def test_path_params_list(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): @@ -62,85 +58,21 @@ def test_path_params_list(self, client: Cloudflare) -> None: zone_id="", ) - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") - @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - managed_transform = client.managed_transforms.delete( - zone_id="9f1839b6152d298aca64c4e906b6d074", - ) - assert managed_transform is None - - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") - @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.managed_transforms.with_raw_response.delete( - zone_id="9f1839b6152d298aca64c4e906b6d074", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - managed_transform = response.parse() - assert managed_transform is None - - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") - @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.managed_transforms.with_streaming_response.delete( - zone_id="9f1839b6152d298aca64c4e906b6d074", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - managed_transform = response.parse() - assert managed_transform is None - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") - @parametrize - def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.managed_transforms.with_raw_response.delete( - zone_id="", - ) - - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize def test_method_edit(self, client: Cloudflare) -> None: managed_transform = client.managed_transforms.edit( - zone_id="9f1839b6152d298aca64c4e906b6d074", - managed_request_headers=[ - { - "id": "add_bot_protection_headers", - "enabled": True, - } - ], - managed_response_headers=[ - { - "id": "add_security_headers", - "enabled": True, - } - ], + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + managed_request_headers=[{}], + managed_response_headers=[{}], ) assert_matches_type(ManagedTransformEditResponse, managed_transform, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: response = client.managed_transforms.with_raw_response.edit( - zone_id="9f1839b6152d298aca64c4e906b6d074", - managed_request_headers=[ - { - "id": "add_bot_protection_headers", - "enabled": True, - } - ], - managed_response_headers=[ - { - "id": "add_security_headers", - "enabled": True, - } - ], + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + managed_request_headers=[{}], + managed_response_headers=[{}], ) assert response.is_closed is True @@ -148,23 +80,12 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: managed_transform = response.parse() assert_matches_type(ManagedTransformEditResponse, managed_transform, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: with client.managed_transforms.with_streaming_response.edit( - zone_id="9f1839b6152d298aca64c4e906b6d074", - managed_request_headers=[ - { - "id": "add_bot_protection_headers", - "enabled": True, - } - ], - managed_response_headers=[ - { - "id": "add_security_headers", - "enabled": True, - } - ], + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + managed_request_headers=[{}], + managed_response_headers=[{}], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -174,43 +95,30 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize def test_path_params_edit(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.managed_transforms.with_raw_response.edit( zone_id="", - managed_request_headers=[ - { - "id": "add_bot_protection_headers", - "enabled": True, - } - ], - managed_response_headers=[ - { - "id": "add_security_headers", - "enabled": True, - } - ], + managed_request_headers=[{}], + managed_response_headers=[{}], ) class TestAsyncManagedTransforms: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: managed_transform = await async_client.managed_transforms.list( - zone_id="9f1839b6152d298aca64c4e906b6d074", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(ManagedTransformListResponse, managed_transform, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.managed_transforms.with_raw_response.list( - zone_id="9f1839b6152d298aca64c4e906b6d074", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -218,11 +126,10 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: managed_transform = await response.parse() assert_matches_type(ManagedTransformListResponse, managed_transform, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.managed_transforms.with_streaming_response.list( - zone_id="9f1839b6152d298aca64c4e906b6d074", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -232,7 +139,6 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): @@ -240,85 +146,21 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: zone_id="", ) - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") - @parametrize - async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - managed_transform = await async_client.managed_transforms.delete( - zone_id="9f1839b6152d298aca64c4e906b6d074", - ) - assert managed_transform is None - - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") - @parametrize - async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.managed_transforms.with_raw_response.delete( - zone_id="9f1839b6152d298aca64c4e906b6d074", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - managed_transform = await response.parse() - assert managed_transform is None - - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") - @parametrize - async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.managed_transforms.with_streaming_response.delete( - zone_id="9f1839b6152d298aca64c4e906b6d074", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - managed_transform = await response.parse() - assert managed_transform is None - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") - @parametrize - async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.managed_transforms.with_raw_response.delete( - zone_id="", - ) - - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize async def test_method_edit(self, async_client: AsyncCloudflare) -> None: managed_transform = await async_client.managed_transforms.edit( - zone_id="9f1839b6152d298aca64c4e906b6d074", - managed_request_headers=[ - { - "id": "add_bot_protection_headers", - "enabled": True, - } - ], - managed_response_headers=[ - { - "id": "add_security_headers", - "enabled": True, - } - ], + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + managed_request_headers=[{}], + managed_response_headers=[{}], ) assert_matches_type(ManagedTransformEditResponse, managed_transform, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: response = await async_client.managed_transforms.with_raw_response.edit( - zone_id="9f1839b6152d298aca64c4e906b6d074", - managed_request_headers=[ - { - "id": "add_bot_protection_headers", - "enabled": True, - } - ], - managed_response_headers=[ - { - "id": "add_security_headers", - "enabled": True, - } - ], + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + managed_request_headers=[{}], + managed_response_headers=[{}], ) assert response.is_closed is True @@ -326,23 +168,12 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: managed_transform = await response.parse() assert_matches_type(ManagedTransformEditResponse, managed_transform, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: async with async_client.managed_transforms.with_streaming_response.edit( - zone_id="9f1839b6152d298aca64c4e906b6d074", - managed_request_headers=[ - { - "id": "add_bot_protection_headers", - "enabled": True, - } - ], - managed_response_headers=[ - { - "id": "add_security_headers", - "enabled": True, - } - ], + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + managed_request_headers=[{}], + managed_response_headers=[{}], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -352,22 +183,11 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.managed_transforms.with_raw_response.edit( zone_id="", - managed_request_headers=[ - { - "id": "add_bot_protection_headers", - "enabled": True, - } - ], - managed_response_headers=[ - { - "id": "add_security_headers", - "enabled": True, - } - ], + managed_request_headers=[{}], + managed_response_headers=[{}], ) diff --git a/tests/api_resources/test_origin_post_quantum_encryption.py b/tests/api_resources/test_origin_post_quantum_encryption.py index 5be62d7556c..7b671649427 100644 --- a/tests/api_resources/test_origin_post_quantum_encryption.py +++ b/tests/api_resources/test_origin_post_quantum_encryption.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest @@ -28,7 +28,7 @@ def test_method_update(self, client: Cloudflare) -> None: value="preferred", ) assert_matches_type( - Optional[OriginPostQuantumEncryptionUpdateResponse], origin_post_quantum_encryption, path=["response"] + OriginPostQuantumEncryptionUpdateResponse, origin_post_quantum_encryption, path=["response"] ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -43,7 +43,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_post_quantum_encryption = response.parse() assert_matches_type( - Optional[OriginPostQuantumEncryptionUpdateResponse], origin_post_quantum_encryption, path=["response"] + OriginPostQuantumEncryptionUpdateResponse, origin_post_quantum_encryption, path=["response"] ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -58,7 +58,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: origin_post_quantum_encryption = response.parse() assert_matches_type( - Optional[OriginPostQuantumEncryptionUpdateResponse], origin_post_quantum_encryption, path=["response"] + OriginPostQuantumEncryptionUpdateResponse, origin_post_quantum_encryption, path=["response"] ) assert cast(Any, response.is_closed) is True @@ -78,9 +78,7 @@ def test_method_get(self, client: Cloudflare) -> None: origin_post_quantum_encryption = client.origin_post_quantum_encryption.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type( - Optional[OriginPostQuantumEncryptionGetResponse], origin_post_quantum_encryption, path=["response"] - ) + assert_matches_type(OriginPostQuantumEncryptionGetResponse, origin_post_quantum_encryption, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -92,9 +90,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_post_quantum_encryption = response.parse() - assert_matches_type( - Optional[OriginPostQuantumEncryptionGetResponse], origin_post_quantum_encryption, path=["response"] - ) + assert_matches_type(OriginPostQuantumEncryptionGetResponse, origin_post_quantum_encryption, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -107,7 +103,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: origin_post_quantum_encryption = response.parse() assert_matches_type( - Optional[OriginPostQuantumEncryptionGetResponse], origin_post_quantum_encryption, path=["response"] + OriginPostQuantumEncryptionGetResponse, origin_post_quantum_encryption, path=["response"] ) assert cast(Any, response.is_closed) is True @@ -132,7 +128,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: value="preferred", ) assert_matches_type( - Optional[OriginPostQuantumEncryptionUpdateResponse], origin_post_quantum_encryption, path=["response"] + OriginPostQuantumEncryptionUpdateResponse, origin_post_quantum_encryption, path=["response"] ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -147,7 +143,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_post_quantum_encryption = await response.parse() assert_matches_type( - Optional[OriginPostQuantumEncryptionUpdateResponse], origin_post_quantum_encryption, path=["response"] + OriginPostQuantumEncryptionUpdateResponse, origin_post_quantum_encryption, path=["response"] ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -162,7 +158,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> origin_post_quantum_encryption = await response.parse() assert_matches_type( - Optional[OriginPostQuantumEncryptionUpdateResponse], origin_post_quantum_encryption, path=["response"] + OriginPostQuantumEncryptionUpdateResponse, origin_post_quantum_encryption, path=["response"] ) assert cast(Any, response.is_closed) is True @@ -182,9 +178,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: origin_post_quantum_encryption = await async_client.origin_post_quantum_encryption.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type( - Optional[OriginPostQuantumEncryptionGetResponse], origin_post_quantum_encryption, path=["response"] - ) + assert_matches_type(OriginPostQuantumEncryptionGetResponse, origin_post_quantum_encryption, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -196,9 +190,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_post_quantum_encryption = await response.parse() - assert_matches_type( - Optional[OriginPostQuantumEncryptionGetResponse], origin_post_quantum_encryption, path=["response"] - ) + assert_matches_type(OriginPostQuantumEncryptionGetResponse, origin_post_quantum_encryption, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -211,7 +203,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No origin_post_quantum_encryption = await response.parse() assert_matches_type( - Optional[OriginPostQuantumEncryptionGetResponse], origin_post_quantum_encryption, path=["response"] + OriginPostQuantumEncryptionGetResponse, origin_post_quantum_encryption, path=["response"] ) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_url_normalization.py b/tests/api_resources/test_url_normalization.py index 961a3f7b78d..bd0ad470a31 100644 --- a/tests/api_resources/test_url_normalization.py +++ b/tests/api_resources/test_url_normalization.py @@ -20,23 +20,26 @@ class TestURLNormalization: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize def test_method_update(self, client: Cloudflare) -> None: url_normalization = client.url_normalization.update( - zone_id="9f1839b6152d298aca64c4e906b6d074", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(URLNormalizationUpdateResponse, url_normalization, path=["response"]) + + @parametrize + def test_method_update_with_all_params(self, client: Cloudflare) -> None: + url_normalization = client.url_normalization.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", scope="incoming", type="cloudflare", ) assert_matches_type(URLNormalizationUpdateResponse, url_normalization, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: response = client.url_normalization.with_raw_response.update( - zone_id="9f1839b6152d298aca64c4e906b6d074", - scope="incoming", - type="cloudflare", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -44,13 +47,10 @@ def test_raw_response_update(self, client: Cloudflare) -> None: url_normalization = response.parse() assert_matches_type(URLNormalizationUpdateResponse, url_normalization, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: with client.url_normalization.with_streaming_response.update( - zone_id="9f1839b6152d298aca64c4e906b6d074", - scope="incoming", - type="cloudflare", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -60,71 +60,24 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.url_normalization.with_raw_response.update( zone_id="", - scope="incoming", - type="cloudflare", - ) - - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") - @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - url_normalization = client.url_normalization.delete( - zone_id="9f1839b6152d298aca64c4e906b6d074", - ) - assert url_normalization is None - - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") - @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.url_normalization.with_raw_response.delete( - zone_id="9f1839b6152d298aca64c4e906b6d074", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - url_normalization = response.parse() - assert url_normalization is None - - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") - @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.url_normalization.with_streaming_response.delete( - zone_id="9f1839b6152d298aca64c4e906b6d074", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - url_normalization = response.parse() - assert url_normalization is None - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") - @parametrize - def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.url_normalization.with_raw_response.delete( - zone_id="", ) - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize def test_method_get(self, client: Cloudflare) -> None: url_normalization = client.url_normalization.get( - zone_id="9f1839b6152d298aca64c4e906b6d074", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(URLNormalizationGetResponse, url_normalization, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: response = client.url_normalization.with_raw_response.get( - zone_id="9f1839b6152d298aca64c4e906b6d074", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -132,11 +85,10 @@ def test_raw_response_get(self, client: Cloudflare) -> None: url_normalization = response.parse() assert_matches_type(URLNormalizationGetResponse, url_normalization, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: with client.url_normalization.with_streaming_response.get( - zone_id="9f1839b6152d298aca64c4e906b6d074", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -146,7 +98,6 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): @@ -158,23 +109,26 @@ def test_path_params_get(self, client: Cloudflare) -> None: class TestAsyncURLNormalization: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize async def test_method_update(self, async_client: AsyncCloudflare) -> None: url_normalization = await async_client.url_normalization.update( - zone_id="9f1839b6152d298aca64c4e906b6d074", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(URLNormalizationUpdateResponse, url_normalization, path=["response"]) + + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: + url_normalization = await async_client.url_normalization.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", scope="incoming", type="cloudflare", ) assert_matches_type(URLNormalizationUpdateResponse, url_normalization, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.url_normalization.with_raw_response.update( - zone_id="9f1839b6152d298aca64c4e906b6d074", - scope="incoming", - type="cloudflare", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -182,13 +136,10 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: url_normalization = await response.parse() assert_matches_type(URLNormalizationUpdateResponse, url_normalization, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.url_normalization.with_streaming_response.update( - zone_id="9f1839b6152d298aca64c4e906b6d074", - scope="incoming", - type="cloudflare", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -198,71 +149,24 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.url_normalization.with_raw_response.update( zone_id="", - scope="incoming", - type="cloudflare", - ) - - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") - @parametrize - async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - url_normalization = await async_client.url_normalization.delete( - zone_id="9f1839b6152d298aca64c4e906b6d074", - ) - assert url_normalization is None - - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") - @parametrize - async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.url_normalization.with_raw_response.delete( - zone_id="9f1839b6152d298aca64c4e906b6d074", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - url_normalization = await response.parse() - assert url_normalization is None - - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") - @parametrize - async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.url_normalization.with_streaming_response.delete( - zone_id="9f1839b6152d298aca64c4e906b6d074", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - url_normalization = await response.parse() - assert url_normalization is None - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") - @parametrize - async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.url_normalization.with_raw_response.delete( - zone_id="", ) - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: url_normalization = await async_client.url_normalization.get( - zone_id="9f1839b6152d298aca64c4e906b6d074", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(URLNormalizationGetResponse, url_normalization, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.url_normalization.with_raw_response.get( - zone_id="9f1839b6152d298aca64c4e906b6d074", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -270,11 +174,10 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: url_normalization = await response.parse() assert_matches_type(URLNormalizationGetResponse, url_normalization, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.url_normalization.with_streaming_response.get( - zone_id="9f1839b6152d298aca64c4e906b6d074", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -284,7 +187,6 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): diff --git a/tests/api_resources/test_waiting_rooms.py b/tests/api_resources/test_waiting_rooms.py index 73949870677..fb3506d55e7 100644 --- a/tests/api_resources/test_waiting_rooms.py +++ b/tests/api_resources/test_waiting_rooms.py @@ -63,8 +63,6 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: queueing_status_code=200, session_duration=1, suspended=True, - turnstile_action="log", - turnstile_mode="off", ) assert_matches_type(WaitingRoom, waiting_room, path=["response"]) @@ -155,8 +153,6 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: queueing_status_code=200, session_duration=1, suspended=True, - turnstile_action="log", - turnstile_mode="off", ) assert_matches_type(WaitingRoom, waiting_room, path=["response"]) @@ -355,8 +351,6 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: queueing_status_code=200, session_duration=1, suspended=True, - turnstile_action="log", - turnstile_mode="off", ) assert_matches_type(WaitingRoom, waiting_room, path=["response"]) @@ -510,8 +504,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare queueing_status_code=200, session_duration=1, suspended=True, - turnstile_action="log", - turnstile_mode="off", ) assert_matches_type(WaitingRoom, waiting_room, path=["response"]) @@ -602,8 +594,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare queueing_status_code=200, session_duration=1, suspended=True, - turnstile_action="log", - turnstile_mode="off", ) assert_matches_type(WaitingRoom, waiting_room, path=["response"]) @@ -802,8 +792,6 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) queueing_status_code=200, session_duration=1, suspended=True, - turnstile_action="log", - turnstile_mode="off", ) assert_matches_type(WaitingRoom, waiting_room, path=["response"]) diff --git a/tests/api_resources/url_scanner/test_responses.py b/tests/api_resources/url_scanner/test_responses.py index 1690ba966df..5fe0f1eb19e 100644 --- a/tests/api_resources/url_scanner/test_responses.py +++ b/tests/api_resources/url_scanner/test_responses.py @@ -19,16 +19,16 @@ class TestResponses: @parametrize def test_method_get(self, client: Cloudflare) -> None: response = client.url_scanner.responses.get( - response_id="response_id", - account_id="account_id", + response_id="responseId", + account_id="accountId", ) assert_matches_type(str, response, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: http_response = client.url_scanner.responses.with_raw_response.get( - response_id="response_id", - account_id="account_id", + response_id="responseId", + account_id="accountId", ) assert http_response.is_closed is True @@ -39,8 +39,8 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: with client.url_scanner.responses.with_streaming_response.get( - response_id="response_id", - account_id="account_id", + response_id="responseId", + account_id="accountId", ) as http_response: assert not http_response.is_closed assert http_response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -54,14 +54,14 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.url_scanner.responses.with_raw_response.get( - response_id="response_id", + response_id="responseId", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `response_id` but received ''"): client.url_scanner.responses.with_raw_response.get( response_id="", - account_id="account_id", + account_id="accountId", ) @@ -71,16 +71,16 @@ class TestAsyncResponses: @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.url_scanner.responses.get( - response_id="response_id", - account_id="account_id", + response_id="responseId", + account_id="accountId", ) assert_matches_type(str, response, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: http_response = await async_client.url_scanner.responses.with_raw_response.get( - response_id="response_id", - account_id="account_id", + response_id="responseId", + account_id="accountId", ) assert http_response.is_closed is True @@ -91,8 +91,8 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.url_scanner.responses.with_streaming_response.get( - response_id="response_id", - account_id="account_id", + response_id="responseId", + account_id="accountId", ) as http_response: assert not http_response.is_closed assert http_response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -106,12 +106,12 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.url_scanner.responses.with_raw_response.get( - response_id="response_id", + response_id="responseId", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `response_id` but received ''"): await async_client.url_scanner.responses.with_raw_response.get( response_id="", - account_id="account_id", + account_id="accountId", ) diff --git a/tests/api_resources/url_scanner/test_scans.py b/tests/api_resources/url_scanner/test_scans.py index aaa1385a9bb..eb8d6e905a9 100644 --- a/tests/api_resources/url_scanner/test_scans.py +++ b/tests/api_resources/url_scanner/test_scans.py @@ -33,7 +33,7 @@ class TestScans: @parametrize def test_method_create(self, client: Cloudflare) -> None: scan = client.url_scanner.scans.create( - account_id="account_id", + account_id="accountId", url="https://www.example.com", ) assert_matches_type(str, scan, path=["response"]) @@ -41,7 +41,7 @@ def test_method_create(self, client: Cloudflare) -> None: @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: scan = client.url_scanner.scans.create( - account_id="account_id", + account_id="accountId", url="https://www.example.com", customagent="customagent", custom_headers={"foo": "string"}, @@ -54,7 +54,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: response = client.url_scanner.scans.with_raw_response.create( - account_id="account_id", + account_id="accountId", url="https://www.example.com", ) @@ -66,7 +66,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: with client.url_scanner.scans.with_streaming_response.create( - account_id="account_id", + account_id="accountId", url="https://www.example.com", ) as response: assert not response.is_closed @@ -88,14 +88,14 @@ def test_path_params_create(self, client: Cloudflare) -> None: @parametrize def test_method_list(self, client: Cloudflare) -> None: scan = client.url_scanner.scans.list( - account_id="account_id", + account_id="accountId", ) assert_matches_type(ScanListResponse, scan, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: scan = client.url_scanner.scans.list( - account_id="account_id", + account_id="accountId", q="q", size=100, ) @@ -104,7 +104,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.url_scanner.scans.with_raw_response.list( - account_id="account_id", + account_id="accountId", ) assert response.is_closed is True @@ -115,7 +115,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.url_scanner.scans.with_streaming_response.list( - account_id="account_id", + account_id="accountId", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -135,7 +135,7 @@ def test_path_params_list(self, client: Cloudflare) -> None: @parametrize def test_method_bulk_create(self, client: Cloudflare) -> None: scan = client.url_scanner.scans.bulk_create( - account_id="account_id", + account_id="accountId", body=[{"url": "https://www.example.com"}], ) assert_matches_type(ScanBulkCreateResponse, scan, path=["response"]) @@ -143,7 +143,7 @@ def test_method_bulk_create(self, client: Cloudflare) -> None: @parametrize def test_raw_response_bulk_create(self, client: Cloudflare) -> None: response = client.url_scanner.scans.with_raw_response.bulk_create( - account_id="account_id", + account_id="accountId", body=[{"url": "https://www.example.com"}], ) @@ -155,7 +155,7 @@ def test_raw_response_bulk_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_bulk_create(self, client: Cloudflare) -> None: with client.url_scanner.scans.with_streaming_response.bulk_create( - account_id="account_id", + account_id="accountId", body=[{"url": "https://www.example.com"}], ) as response: assert not response.is_closed @@ -178,7 +178,7 @@ def test_path_params_bulk_create(self, client: Cloudflare) -> None: def test_method_dom(self, client: Cloudflare) -> None: scan = client.url_scanner.scans.dom( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", + account_id="accountId", ) assert_matches_type(str, scan, path=["response"]) @@ -186,7 +186,7 @@ def test_method_dom(self, client: Cloudflare) -> None: def test_raw_response_dom(self, client: Cloudflare) -> None: response = client.url_scanner.scans.with_raw_response.dom( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", + account_id="accountId", ) assert response.is_closed is True @@ -198,7 +198,7 @@ def test_raw_response_dom(self, client: Cloudflare) -> None: def test_streaming_response_dom(self, client: Cloudflare) -> None: with client.url_scanner.scans.with_streaming_response.dom( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", + account_id="accountId", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -219,24 +219,22 @@ def test_path_params_dom(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `scan_id` but received ''"): client.url_scanner.scans.with_raw_response.dom( scan_id="", - account_id="account_id", + account_id="accountId", ) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_method_get(self, client: Cloudflare) -> None: scan = client.url_scanner.scans.get( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", + account_id="accountId", ) assert_matches_type(ScanGetResponse, scan, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: response = client.url_scanner.scans.with_raw_response.get( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", + account_id="accountId", ) assert response.is_closed is True @@ -244,12 +242,11 @@ def test_raw_response_get(self, client: Cloudflare) -> None: scan = response.parse() assert_matches_type(ScanGetResponse, scan, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: with client.url_scanner.scans.with_streaming_response.get( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", + account_id="accountId", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -259,7 +256,6 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -271,14 +267,14 @@ def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `scan_id` but received ''"): client.url_scanner.scans.with_raw_response.get( scan_id="", - account_id="account_id", + account_id="accountId", ) @parametrize def test_method_har(self, client: Cloudflare) -> None: scan = client.url_scanner.scans.har( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", + account_id="accountId", ) assert_matches_type(ScanHARResponse, scan, path=["response"]) @@ -286,7 +282,7 @@ def test_method_har(self, client: Cloudflare) -> None: def test_raw_response_har(self, client: Cloudflare) -> None: response = client.url_scanner.scans.with_raw_response.har( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", + account_id="accountId", ) assert response.is_closed is True @@ -298,7 +294,7 @@ def test_raw_response_har(self, client: Cloudflare) -> None: def test_streaming_response_har(self, client: Cloudflare) -> None: with client.url_scanner.scans.with_streaming_response.har( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", + account_id="accountId", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -319,18 +315,18 @@ def test_path_params_har(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `scan_id` but received ''"): client.url_scanner.scans.with_raw_response.har( scan_id="", - account_id="account_id", + account_id="accountId", ) @parametrize @pytest.mark.respx(base_url=base_url) def test_method_screenshot(self, client: Cloudflare, respx_mock: MockRouter) -> None: - respx_mock.get("/accounts/account_id/urlscanner/v2/screenshots/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e.png").mock( + respx_mock.get("/accounts/accountId/urlscanner/v2/screenshots/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e.png").mock( return_value=httpx.Response(200, json={"foo": "bar"}) ) scan = client.url_scanner.scans.screenshot( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", + account_id="accountId", ) assert scan.is_closed assert scan.json() == {"foo": "bar"} @@ -340,12 +336,12 @@ def test_method_screenshot(self, client: Cloudflare, respx_mock: MockRouter) -> @parametrize @pytest.mark.respx(base_url=base_url) def test_method_screenshot_with_all_params(self, client: Cloudflare, respx_mock: MockRouter) -> None: - respx_mock.get("/accounts/account_id/urlscanner/v2/screenshots/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e.png").mock( + respx_mock.get("/accounts/accountId/urlscanner/v2/screenshots/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e.png").mock( return_value=httpx.Response(200, json={"foo": "bar"}) ) scan = client.url_scanner.scans.screenshot( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", + account_id="accountId", resolution="desktop", ) assert scan.is_closed @@ -356,13 +352,13 @@ def test_method_screenshot_with_all_params(self, client: Cloudflare, respx_mock: @parametrize @pytest.mark.respx(base_url=base_url) def test_raw_response_screenshot(self, client: Cloudflare, respx_mock: MockRouter) -> None: - respx_mock.get("/accounts/account_id/urlscanner/v2/screenshots/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e.png").mock( + respx_mock.get("/accounts/accountId/urlscanner/v2/screenshots/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e.png").mock( return_value=httpx.Response(200, json={"foo": "bar"}) ) scan = client.url_scanner.scans.with_raw_response.screenshot( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", + account_id="accountId", ) assert scan.is_closed is True @@ -373,12 +369,12 @@ def test_raw_response_screenshot(self, client: Cloudflare, respx_mock: MockRoute @parametrize @pytest.mark.respx(base_url=base_url) def test_streaming_response_screenshot(self, client: Cloudflare, respx_mock: MockRouter) -> None: - respx_mock.get("/accounts/account_id/urlscanner/v2/screenshots/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e.png").mock( + respx_mock.get("/accounts/accountId/urlscanner/v2/screenshots/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e.png").mock( return_value=httpx.Response(200, json={"foo": "bar"}) ) with client.url_scanner.scans.with_streaming_response.screenshot( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", + account_id="accountId", ) as scan: assert not scan.is_closed assert scan.http_request.headers.get("X-Stainless-Lang") == "python" @@ -401,7 +397,7 @@ def test_path_params_screenshot(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `scan_id` but received ''"): client.url_scanner.scans.with_raw_response.screenshot( scan_id="", - account_id="account_id", + account_id="accountId", ) @@ -411,7 +407,7 @@ class TestAsyncScans: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: scan = await async_client.url_scanner.scans.create( - account_id="account_id", + account_id="accountId", url="https://www.example.com", ) assert_matches_type(str, scan, path=["response"]) @@ -419,7 +415,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: scan = await async_client.url_scanner.scans.create( - account_id="account_id", + account_id="accountId", url="https://www.example.com", customagent="customagent", custom_headers={"foo": "string"}, @@ -432,7 +428,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.url_scanner.scans.with_raw_response.create( - account_id="account_id", + account_id="accountId", url="https://www.example.com", ) @@ -444,7 +440,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.url_scanner.scans.with_streaming_response.create( - account_id="account_id", + account_id="accountId", url="https://www.example.com", ) as response: assert not response.is_closed @@ -466,14 +462,14 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: scan = await async_client.url_scanner.scans.list( - account_id="account_id", + account_id="accountId", ) assert_matches_type(ScanListResponse, scan, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: scan = await async_client.url_scanner.scans.list( - account_id="account_id", + account_id="accountId", q="q", size=100, ) @@ -482,7 +478,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.url_scanner.scans.with_raw_response.list( - account_id="account_id", + account_id="accountId", ) assert response.is_closed is True @@ -493,7 +489,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.url_scanner.scans.with_streaming_response.list( - account_id="account_id", + account_id="accountId", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -513,7 +509,7 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_bulk_create(self, async_client: AsyncCloudflare) -> None: scan = await async_client.url_scanner.scans.bulk_create( - account_id="account_id", + account_id="accountId", body=[{"url": "https://www.example.com"}], ) assert_matches_type(ScanBulkCreateResponse, scan, path=["response"]) @@ -521,7 +517,7 @@ async def test_method_bulk_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_bulk_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.url_scanner.scans.with_raw_response.bulk_create( - account_id="account_id", + account_id="accountId", body=[{"url": "https://www.example.com"}], ) @@ -533,7 +529,7 @@ async def test_raw_response_bulk_create(self, async_client: AsyncCloudflare) -> @parametrize async def test_streaming_response_bulk_create(self, async_client: AsyncCloudflare) -> None: async with async_client.url_scanner.scans.with_streaming_response.bulk_create( - account_id="account_id", + account_id="accountId", body=[{"url": "https://www.example.com"}], ) as response: assert not response.is_closed @@ -556,7 +552,7 @@ async def test_path_params_bulk_create(self, async_client: AsyncCloudflare) -> N async def test_method_dom(self, async_client: AsyncCloudflare) -> None: scan = await async_client.url_scanner.scans.dom( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", + account_id="accountId", ) assert_matches_type(str, scan, path=["response"]) @@ -564,7 +560,7 @@ async def test_method_dom(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_dom(self, async_client: AsyncCloudflare) -> None: response = await async_client.url_scanner.scans.with_raw_response.dom( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", + account_id="accountId", ) assert response.is_closed is True @@ -576,7 +572,7 @@ async def test_raw_response_dom(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_dom(self, async_client: AsyncCloudflare) -> None: async with async_client.url_scanner.scans.with_streaming_response.dom( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", + account_id="accountId", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -597,24 +593,22 @@ async def test_path_params_dom(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `scan_id` but received ''"): await async_client.url_scanner.scans.with_raw_response.dom( scan_id="", - account_id="account_id", + account_id="accountId", ) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: scan = await async_client.url_scanner.scans.get( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", + account_id="accountId", ) assert_matches_type(ScanGetResponse, scan, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.url_scanner.scans.with_raw_response.get( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", + account_id="accountId", ) assert response.is_closed is True @@ -622,12 +616,11 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: scan = await response.parse() assert_matches_type(ScanGetResponse, scan, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.url_scanner.scans.with_streaming_response.get( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", + account_id="accountId", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -637,7 +630,6 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -649,14 +641,14 @@ async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `scan_id` but received ''"): await async_client.url_scanner.scans.with_raw_response.get( scan_id="", - account_id="account_id", + account_id="accountId", ) @parametrize async def test_method_har(self, async_client: AsyncCloudflare) -> None: scan = await async_client.url_scanner.scans.har( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", + account_id="accountId", ) assert_matches_type(ScanHARResponse, scan, path=["response"]) @@ -664,7 +656,7 @@ async def test_method_har(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_har(self, async_client: AsyncCloudflare) -> None: response = await async_client.url_scanner.scans.with_raw_response.har( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", + account_id="accountId", ) assert response.is_closed is True @@ -676,7 +668,7 @@ async def test_raw_response_har(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_har(self, async_client: AsyncCloudflare) -> None: async with async_client.url_scanner.scans.with_streaming_response.har( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", + account_id="accountId", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -697,18 +689,18 @@ async def test_path_params_har(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `scan_id` but received ''"): await async_client.url_scanner.scans.with_raw_response.har( scan_id="", - account_id="account_id", + account_id="accountId", ) @parametrize @pytest.mark.respx(base_url=base_url) async def test_method_screenshot(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None: - respx_mock.get("/accounts/account_id/urlscanner/v2/screenshots/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e.png").mock( + respx_mock.get("/accounts/accountId/urlscanner/v2/screenshots/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e.png").mock( return_value=httpx.Response(200, json={"foo": "bar"}) ) scan = await async_client.url_scanner.scans.screenshot( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", + account_id="accountId", ) assert scan.is_closed assert await scan.json() == {"foo": "bar"} @@ -720,12 +712,12 @@ async def test_method_screenshot(self, async_client: AsyncCloudflare, respx_mock async def test_method_screenshot_with_all_params( self, async_client: AsyncCloudflare, respx_mock: MockRouter ) -> None: - respx_mock.get("/accounts/account_id/urlscanner/v2/screenshots/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e.png").mock( + respx_mock.get("/accounts/accountId/urlscanner/v2/screenshots/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e.png").mock( return_value=httpx.Response(200, json={"foo": "bar"}) ) scan = await async_client.url_scanner.scans.screenshot( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", + account_id="accountId", resolution="desktop", ) assert scan.is_closed @@ -736,13 +728,13 @@ async def test_method_screenshot_with_all_params( @parametrize @pytest.mark.respx(base_url=base_url) async def test_raw_response_screenshot(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None: - respx_mock.get("/accounts/account_id/urlscanner/v2/screenshots/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e.png").mock( + respx_mock.get("/accounts/accountId/urlscanner/v2/screenshots/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e.png").mock( return_value=httpx.Response(200, json={"foo": "bar"}) ) scan = await async_client.url_scanner.scans.with_raw_response.screenshot( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", + account_id="accountId", ) assert scan.is_closed is True @@ -753,12 +745,12 @@ async def test_raw_response_screenshot(self, async_client: AsyncCloudflare, resp @parametrize @pytest.mark.respx(base_url=base_url) async def test_streaming_response_screenshot(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None: - respx_mock.get("/accounts/account_id/urlscanner/v2/screenshots/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e.png").mock( + respx_mock.get("/accounts/accountId/urlscanner/v2/screenshots/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e.png").mock( return_value=httpx.Response(200, json={"foo": "bar"}) ) async with async_client.url_scanner.scans.with_streaming_response.screenshot( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", + account_id="accountId", ) as scan: assert not scan.is_closed assert scan.http_request.headers.get("X-Stainless-Lang") == "python" @@ -781,5 +773,5 @@ async def test_path_params_screenshot(self, async_client: AsyncCloudflare) -> No with pytest.raises(ValueError, match=r"Expected a non-empty value for `scan_id` but received ''"): await async_client.url_scanner.scans.with_raw_response.screenshot( scan_id="", - account_id="account_id", + account_id="accountId", ) diff --git a/tests/api_resources/user/test_tokens.py b/tests/api_resources/user/test_tokens.py index 3ad7952d607..81169dc8e56 100644 --- a/tests/api_resources/user/test_tokens.py +++ b/tests/api_resources/user/test_tokens.py @@ -33,10 +33,7 @@ def test_method_create(self, client: Cloudflare) -> None: { "effect": "allow", "permission_groups": [{}, {}], - "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }, + "resources": {}, } ], ) @@ -65,8 +62,8 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: }, ], "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + "resource": "resource", + "scope": "scope", }, } ], @@ -90,10 +87,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: { "effect": "allow", "permission_groups": [{}, {}], - "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }, + "resources": {}, } ], ) @@ -112,10 +106,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: { "effect": "allow", "permission_groups": [{}, {}], - "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }, + "resources": {}, } ], ) as response: @@ -167,8 +158,8 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: }, ], "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + "resource": "resource", + "scope": "scope", }, } ], @@ -373,10 +364,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: { "effect": "allow", "permission_groups": [{}, {}], - "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }, + "resources": {}, } ], ) @@ -405,8 +393,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare }, ], "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + "resource": "resource", + "scope": "scope", }, } ], @@ -430,10 +418,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: { "effect": "allow", "permission_groups": [{}, {}], - "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }, + "resources": {}, } ], ) @@ -452,10 +437,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> { "effect": "allow", "permission_groups": [{}, {}], - "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", - }, + "resources": {}, } ], ) as response: @@ -507,8 +489,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare }, ], "resources": { - "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", - "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + "resource": "resource", + "scope": "scope", }, } ], diff --git a/tests/api_resources/vectorize/test_indexes.py b/tests/api_resources/vectorize/test_indexes.py index 272871b4418..97fe5c1b9e8 100644 --- a/tests/api_resources/vectorize/test_indexes.py +++ b/tests/api_resources/vectorize/test_indexes.py @@ -141,7 +141,7 @@ def test_method_delete(self, client: Cloudflare) -> None: index_name="example-index", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[IndexDeleteResponse], index, path=["response"]) + assert_matches_type(IndexDeleteResponse, index, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -153,7 +153,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" index = response.parse() - assert_matches_type(Optional[IndexDeleteResponse], index, path=["response"]) + assert_matches_type(IndexDeleteResponse, index, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -165,7 +165,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" index = response.parse() - assert_matches_type(Optional[IndexDeleteResponse], index, path=["response"]) + assert_matches_type(IndexDeleteResponse, index, path=["response"]) assert cast(Any, response.is_closed) is True @@ -717,7 +717,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: index_name="example-index", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[IndexDeleteResponse], index, path=["response"]) + assert_matches_type(IndexDeleteResponse, index, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -729,7 +729,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" index = await response.parse() - assert_matches_type(Optional[IndexDeleteResponse], index, path=["response"]) + assert_matches_type(IndexDeleteResponse, index, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -741,7 +741,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" index = await response.parse() - assert_matches_type(Optional[IndexDeleteResponse], index, path=["response"]) + assert_matches_type(IndexDeleteResponse, index, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/ai/finetunes/__init__.py b/tests/api_resources/workers/ai/__init__.py similarity index 100% rename from tests/api_resources/ai/finetunes/__init__.py rename to tests/api_resources/workers/ai/__init__.py diff --git a/tests/api_resources/ai/models/__init__.py b/tests/api_resources/workers/ai/models/__init__.py similarity index 100% rename from tests/api_resources/ai/models/__init__.py rename to tests/api_resources/workers/ai/models/__init__.py diff --git a/tests/api_resources/ai/models/test_schema.py b/tests/api_resources/workers/ai/models/test_schema.py similarity index 85% rename from tests/api_resources/ai/models/test_schema.py rename to tests/api_resources/workers/ai/models/test_schema.py index c2592b98979..a815dc1f7c1 100644 --- a/tests/api_resources/ai/models/test_schema.py +++ b/tests/api_resources/workers/ai/models/test_schema.py @@ -18,7 +18,7 @@ class TestSchema: @parametrize def test_method_get(self, client: Cloudflare) -> None: - schema = client.ai.models.schema.get( + schema = client.workers.ai.models.schema.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", model="model", ) @@ -26,7 +26,7 @@ def test_method_get(self, client: Cloudflare) -> None: @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.ai.models.schema.with_raw_response.get( + response = client.workers.ai.models.schema.with_raw_response.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", model="model", ) @@ -38,7 +38,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.ai.models.schema.with_streaming_response.get( + with client.workers.ai.models.schema.with_streaming_response.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", model="model", ) as response: @@ -53,7 +53,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @parametrize def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.ai.models.schema.with_raw_response.get( + client.workers.ai.models.schema.with_raw_response.get( account_id="", model="model", ) @@ -64,7 +64,7 @@ class TestAsyncSchema: @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: - schema = await async_client.ai.models.schema.get( + schema = await async_client.workers.ai.models.schema.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", model="model", ) @@ -72,7 +72,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.ai.models.schema.with_raw_response.get( + response = await async_client.workers.ai.models.schema.with_raw_response.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", model="model", ) @@ -84,7 +84,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.ai.models.schema.with_streaming_response.get( + async with async_client.workers.ai.models.schema.with_streaming_response.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", model="model", ) as response: @@ -99,7 +99,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.ai.models.schema.with_raw_response.get( + await async_client.workers.ai.models.schema.with_raw_response.get( account_id="", model="model", ) diff --git a/tests/api_resources/workers/scripts/test_content.py b/tests/api_resources/workers/scripts/test_content.py index 9f7629d9227..24a9e4d4cf5 100644 --- a/tests/api_resources/workers/scripts/test_content.py +++ b/tests/api_resources/workers/scripts/test_content.py @@ -31,7 +31,6 @@ def test_method_update(self, client: Cloudflare) -> None: content = client.workers.scripts.content.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", - metadata={}, ) assert_matches_type(Optional[Script], content, path=["response"]) @@ -41,6 +40,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: content = client.workers.scripts.content.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", + any_part_name=[b"raw file contents"], metadata={ "body_part": "worker.js", "main_module": "worker.js", @@ -56,7 +56,6 @@ def test_raw_response_update(self, client: Cloudflare) -> None: response = client.workers.scripts.content.with_raw_response.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", - metadata={}, ) assert response.is_closed is True @@ -70,7 +69,6 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: with client.workers.scripts.content.with_streaming_response.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", - metadata={}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -87,14 +85,12 @@ def test_path_params_update(self, client: Cloudflare) -> None: client.workers.scripts.content.with_raw_response.update( script_name="this-is_my_script-01", account_id="", - metadata={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): client.workers.scripts.content.with_raw_response.update( script_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", - metadata={}, ) @parametrize @@ -173,7 +169,6 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: content = await async_client.workers.scripts.content.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", - metadata={}, ) assert_matches_type(Optional[Script], content, path=["response"]) @@ -183,6 +178,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare content = await async_client.workers.scripts.content.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", + any_part_name=[b"raw file contents"], metadata={ "body_part": "worker.js", "main_module": "worker.js", @@ -198,7 +194,6 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.workers.scripts.content.with_raw_response.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", - metadata={}, ) assert response.is_closed is True @@ -212,7 +207,6 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> async with async_client.workers.scripts.content.with_streaming_response.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", - metadata={}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -229,14 +223,12 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: await async_client.workers.scripts.content.with_raw_response.update( script_name="this-is_my_script-01", account_id="", - metadata={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): await async_client.workers.scripts.content.with_raw_response.update( script_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", - metadata={}, ) @parametrize diff --git a/tests/api_resources/workers/scripts/test_versions.py b/tests/api_resources/workers/scripts/test_versions.py index 5fbc0e71d33..1525f49c746 100644 --- a/tests/api_resources/workers/scripts/test_versions.py +++ b/tests/api_resources/workers/scripts/test_versions.py @@ -28,7 +28,6 @@ def test_method_create(self, client: Cloudflare) -> None: version = client.workers.scripts.versions.create( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", - metadata={"main_module": "worker.js"}, ) assert_matches_type(Optional[VersionCreateResponse], version, path=["response"]) @@ -38,8 +37,8 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: version = client.workers.scripts.versions.create( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", + any_part_name=[b"raw file contents"], metadata={ - "main_module": "worker.js", "annotations": { "workers_message": "Fixed worker code.", "workers_tag": "workers/tag", @@ -47,12 +46,14 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "bindings": [ { "name": "MY_ENV_VAR", + "text": "my_data", "type": "plain_text", } ], - "compatibility_date": "2021-01-01", - "compatibility_flags": ["nodejs_compat"], + "compatibility_date": "2023-07-25", + "compatibility_flags": ["string"], "keep_bindings": ["string"], + "main_module": "worker.js", "usage_model": "standard", }, ) @@ -64,7 +65,6 @@ def test_raw_response_create(self, client: Cloudflare) -> None: response = client.workers.scripts.versions.with_raw_response.create( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", - metadata={"main_module": "worker.js"}, ) assert response.is_closed is True @@ -78,7 +78,6 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: with client.workers.scripts.versions.with_streaming_response.create( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", - metadata={"main_module": "worker.js"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -95,14 +94,12 @@ def test_path_params_create(self, client: Cloudflare) -> None: client.workers.scripts.versions.with_raw_response.create( script_name="this-is_my_script-01", account_id="", - metadata={"main_module": "worker.js"}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): client.workers.scripts.versions.with_raw_response.create( script_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", - metadata={"main_module": "worker.js"}, ) @parametrize @@ -234,7 +231,6 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: version = await async_client.workers.scripts.versions.create( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", - metadata={"main_module": "worker.js"}, ) assert_matches_type(Optional[VersionCreateResponse], version, path=["response"]) @@ -244,8 +240,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare version = await async_client.workers.scripts.versions.create( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", + any_part_name=[b"raw file contents"], metadata={ - "main_module": "worker.js", "annotations": { "workers_message": "Fixed worker code.", "workers_tag": "workers/tag", @@ -253,12 +249,14 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "bindings": [ { "name": "MY_ENV_VAR", + "text": "my_data", "type": "plain_text", } ], - "compatibility_date": "2021-01-01", - "compatibility_flags": ["nodejs_compat"], + "compatibility_date": "2023-07-25", + "compatibility_flags": ["string"], "keep_bindings": ["string"], + "main_module": "worker.js", "usage_model": "standard", }, ) @@ -270,7 +268,6 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.workers.scripts.versions.with_raw_response.create( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", - metadata={"main_module": "worker.js"}, ) assert response.is_closed is True @@ -284,7 +281,6 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> async with async_client.workers.scripts.versions.with_streaming_response.create( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", - metadata={"main_module": "worker.js"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -301,14 +297,12 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: await async_client.workers.scripts.versions.with_raw_response.create( script_name="this-is_my_script-01", account_id="", - metadata={"main_module": "worker.js"}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): await async_client.workers.scripts.versions.with_raw_response.create( script_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", - metadata={"main_module": "worker.js"}, ) @parametrize diff --git a/tests/api_resources/test_ai.py b/tests/api_resources/workers/test_ai.py similarity index 87% rename from tests/api_resources/test_ai.py rename to tests/api_resources/workers/test_ai.py index ab8fa8cc49c..4f9e0996455 100644 --- a/tests/api_resources/test_ai.py +++ b/tests/api_resources/workers/test_ai.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.ai import AIRunResponse +from cloudflare.types.workers import AIRunResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,7 +19,7 @@ class TestAI: @parametrize def test_method_run_overload_1(self, client: Cloudflare) -> None: - ai = client.ai.run( + ai = client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", text="x", @@ -28,7 +28,7 @@ def test_method_run_overload_1(self, client: Cloudflare) -> None: @parametrize def test_raw_response_run_overload_1(self, client: Cloudflare) -> None: - response = client.ai.with_raw_response.run( + response = client.workers.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", text="x", @@ -41,7 +41,7 @@ def test_raw_response_run_overload_1(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_run_overload_1(self, client: Cloudflare) -> None: - with client.ai.with_streaming_response.run( + with client.workers.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", text="x", @@ -57,14 +57,14 @@ def test_streaming_response_run_overload_1(self, client: Cloudflare) -> None: @parametrize def test_path_params_run_overload_1(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.ai.with_raw_response.run( + client.workers.ai.with_raw_response.run( model_name="model_name", account_id="", text="x", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - client.ai.with_raw_response.run( + client.workers.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", text="x", @@ -72,7 +72,7 @@ def test_path_params_run_overload_1(self, client: Cloudflare) -> None: @parametrize def test_method_run_overload_2(self, client: Cloudflare) -> None: - ai = client.ai.run( + ai = client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -81,7 +81,7 @@ def test_method_run_overload_2(self, client: Cloudflare) -> None: @parametrize def test_method_run_with_all_params_overload_2(self, client: Cloudflare) -> None: - ai = client.ai.run( + ai = client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -100,7 +100,7 @@ def test_method_run_with_all_params_overload_2(self, client: Cloudflare) -> None @parametrize def test_raw_response_run_overload_2(self, client: Cloudflare) -> None: - response = client.ai.with_raw_response.run( + response = client.workers.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -113,7 +113,7 @@ def test_raw_response_run_overload_2(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_run_overload_2(self, client: Cloudflare) -> None: - with client.ai.with_streaming_response.run( + with client.workers.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -129,14 +129,14 @@ def test_streaming_response_run_overload_2(self, client: Cloudflare) -> None: @parametrize def test_path_params_run_overload_2(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.ai.with_raw_response.run( + client.workers.ai.with_raw_response.run( model_name="model_name", account_id="", prompt="x", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - client.ai.with_raw_response.run( + client.workers.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -144,7 +144,7 @@ def test_path_params_run_overload_2(self, client: Cloudflare) -> None: @parametrize def test_method_run_overload_3(self, client: Cloudflare) -> None: - ai = client.ai.run( + ai = client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -153,7 +153,7 @@ def test_method_run_overload_3(self, client: Cloudflare) -> None: @parametrize def test_method_run_with_all_params_overload_3(self, client: Cloudflare) -> None: - ai = client.ai.run( + ai = client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -163,7 +163,7 @@ def test_method_run_with_all_params_overload_3(self, client: Cloudflare) -> None @parametrize def test_raw_response_run_overload_3(self, client: Cloudflare) -> None: - response = client.ai.with_raw_response.run( + response = client.workers.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -176,7 +176,7 @@ def test_raw_response_run_overload_3(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_run_overload_3(self, client: Cloudflare) -> None: - with client.ai.with_streaming_response.run( + with client.workers.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -192,14 +192,14 @@ def test_streaming_response_run_overload_3(self, client: Cloudflare) -> None: @parametrize def test_path_params_run_overload_3(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.ai.with_raw_response.run( + client.workers.ai.with_raw_response.run( model_name="model_name", account_id="", prompt="x", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - client.ai.with_raw_response.run( + client.workers.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -207,7 +207,7 @@ def test_path_params_run_overload_3(self, client: Cloudflare) -> None: @parametrize def test_method_run_overload_4(self, client: Cloudflare) -> None: - ai = client.ai.run( + ai = client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", text="x", @@ -216,7 +216,7 @@ def test_method_run_overload_4(self, client: Cloudflare) -> None: @parametrize def test_raw_response_run_overload_4(self, client: Cloudflare) -> None: - response = client.ai.with_raw_response.run( + response = client.workers.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", text="x", @@ -229,7 +229,7 @@ def test_raw_response_run_overload_4(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_run_overload_4(self, client: Cloudflare) -> None: - with client.ai.with_streaming_response.run( + with client.workers.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", text="x", @@ -245,14 +245,14 @@ def test_streaming_response_run_overload_4(self, client: Cloudflare) -> None: @parametrize def test_path_params_run_overload_4(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.ai.with_raw_response.run( + client.workers.ai.with_raw_response.run( model_name="model_name", account_id="", text="x", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - client.ai.with_raw_response.run( + client.workers.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", text="x", @@ -260,7 +260,7 @@ def test_path_params_run_overload_4(self, client: Cloudflare) -> None: @parametrize def test_method_run_overload_5(self, client: Cloudflare) -> None: - ai = client.ai.run( + ai = client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", audio=[0], @@ -269,7 +269,7 @@ def test_method_run_overload_5(self, client: Cloudflare) -> None: @parametrize def test_method_run_with_all_params_overload_5(self, client: Cloudflare) -> None: - ai = client.ai.run( + ai = client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", audio=[0], @@ -280,7 +280,7 @@ def test_method_run_with_all_params_overload_5(self, client: Cloudflare) -> None @parametrize def test_raw_response_run_overload_5(self, client: Cloudflare) -> None: - response = client.ai.with_raw_response.run( + response = client.workers.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", audio=[0], @@ -293,7 +293,7 @@ def test_raw_response_run_overload_5(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_run_overload_5(self, client: Cloudflare) -> None: - with client.ai.with_streaming_response.run( + with client.workers.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", audio=[0], @@ -309,14 +309,14 @@ def test_streaming_response_run_overload_5(self, client: Cloudflare) -> None: @parametrize def test_path_params_run_overload_5(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.ai.with_raw_response.run( + client.workers.ai.with_raw_response.run( model_name="model_name", account_id="", audio=[0], ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - client.ai.with_raw_response.run( + client.workers.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", audio=[0], @@ -324,7 +324,7 @@ def test_path_params_run_overload_5(self, client: Cloudflare) -> None: @parametrize def test_method_run_overload_6(self, client: Cloudflare) -> None: - ai = client.ai.run( + ai = client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -333,7 +333,7 @@ def test_method_run_overload_6(self, client: Cloudflare) -> None: @parametrize def test_raw_response_run_overload_6(self, client: Cloudflare) -> None: - response = client.ai.with_raw_response.run( + response = client.workers.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -346,7 +346,7 @@ def test_raw_response_run_overload_6(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_run_overload_6(self, client: Cloudflare) -> None: - with client.ai.with_streaming_response.run( + with client.workers.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -362,14 +362,14 @@ def test_streaming_response_run_overload_6(self, client: Cloudflare) -> None: @parametrize def test_path_params_run_overload_6(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.ai.with_raw_response.run( + client.workers.ai.with_raw_response.run( model_name="model_name", account_id="", image=[0], ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - client.ai.with_raw_response.run( + client.workers.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -377,7 +377,7 @@ def test_path_params_run_overload_6(self, client: Cloudflare) -> None: @parametrize def test_method_run_overload_7(self, client: Cloudflare) -> None: - ai = client.ai.run( + ai = client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -385,7 +385,7 @@ def test_method_run_overload_7(self, client: Cloudflare) -> None: @parametrize def test_method_run_with_all_params_overload_7(self, client: Cloudflare) -> None: - ai = client.ai.run( + ai = client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -394,7 +394,7 @@ def test_method_run_with_all_params_overload_7(self, client: Cloudflare) -> None @parametrize def test_raw_response_run_overload_7(self, client: Cloudflare) -> None: - response = client.ai.with_raw_response.run( + response = client.workers.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -406,7 +406,7 @@ def test_raw_response_run_overload_7(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_run_overload_7(self, client: Cloudflare) -> None: - with client.ai.with_streaming_response.run( + with client.workers.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -421,20 +421,20 @@ def test_streaming_response_run_overload_7(self, client: Cloudflare) -> None: @parametrize def test_path_params_run_overload_7(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.ai.with_raw_response.run( + client.workers.ai.with_raw_response.run( model_name="model_name", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - client.ai.with_raw_response.run( + client.workers.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @parametrize def test_method_run_overload_8(self, client: Cloudflare) -> None: - ai = client.ai.run( + ai = client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -443,7 +443,7 @@ def test_method_run_overload_8(self, client: Cloudflare) -> None: @parametrize def test_method_run_with_all_params_overload_8(self, client: Cloudflare) -> None: - ai = client.ai.run( + ai = client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -463,7 +463,7 @@ def test_method_run_with_all_params_overload_8(self, client: Cloudflare) -> None @parametrize def test_raw_response_run_overload_8(self, client: Cloudflare) -> None: - response = client.ai.with_raw_response.run( + response = client.workers.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -476,7 +476,7 @@ def test_raw_response_run_overload_8(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_run_overload_8(self, client: Cloudflare) -> None: - with client.ai.with_streaming_response.run( + with client.workers.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -492,14 +492,14 @@ def test_streaming_response_run_overload_8(self, client: Cloudflare) -> None: @parametrize def test_path_params_run_overload_8(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.ai.with_raw_response.run( + client.workers.ai.with_raw_response.run( model_name="model_name", account_id="", prompt="x", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - client.ai.with_raw_response.run( + client.workers.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -507,7 +507,7 @@ def test_path_params_run_overload_8(self, client: Cloudflare) -> None: @parametrize def test_method_run_overload_9(self, client: Cloudflare) -> None: - ai = client.ai.run( + ai = client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", messages=[ @@ -521,7 +521,7 @@ def test_method_run_overload_9(self, client: Cloudflare) -> None: @parametrize def test_method_run_with_all_params_overload_9(self, client: Cloudflare) -> None: - ai = client.ai.run( + ai = client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", messages=[ @@ -566,7 +566,7 @@ def test_method_run_with_all_params_overload_9(self, client: Cloudflare) -> None @parametrize def test_raw_response_run_overload_9(self, client: Cloudflare) -> None: - response = client.ai.with_raw_response.run( + response = client.workers.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", messages=[ @@ -584,7 +584,7 @@ def test_raw_response_run_overload_9(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_run_overload_9(self, client: Cloudflare) -> None: - with client.ai.with_streaming_response.run( + with client.workers.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", messages=[ @@ -605,7 +605,7 @@ def test_streaming_response_run_overload_9(self, client: Cloudflare) -> None: @parametrize def test_path_params_run_overload_9(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.ai.with_raw_response.run( + client.workers.ai.with_raw_response.run( model_name="model_name", account_id="", messages=[ @@ -617,7 +617,7 @@ def test_path_params_run_overload_9(self, client: Cloudflare) -> None: ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - client.ai.with_raw_response.run( + client.workers.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", messages=[ @@ -630,7 +630,7 @@ def test_path_params_run_overload_9(self, client: Cloudflare) -> None: @parametrize def test_method_run_overload_10(self, client: Cloudflare) -> None: - ai = client.ai.run( + ai = client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", target_lang="target_lang", @@ -640,7 +640,7 @@ def test_method_run_overload_10(self, client: Cloudflare) -> None: @parametrize def test_method_run_with_all_params_overload_10(self, client: Cloudflare) -> None: - ai = client.ai.run( + ai = client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", target_lang="target_lang", @@ -651,7 +651,7 @@ def test_method_run_with_all_params_overload_10(self, client: Cloudflare) -> Non @parametrize def test_raw_response_run_overload_10(self, client: Cloudflare) -> None: - response = client.ai.with_raw_response.run( + response = client.workers.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", target_lang="target_lang", @@ -665,7 +665,7 @@ def test_raw_response_run_overload_10(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_run_overload_10(self, client: Cloudflare) -> None: - with client.ai.with_streaming_response.run( + with client.workers.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", target_lang="target_lang", @@ -682,7 +682,7 @@ def test_streaming_response_run_overload_10(self, client: Cloudflare) -> None: @parametrize def test_path_params_run_overload_10(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.ai.with_raw_response.run( + client.workers.ai.with_raw_response.run( model_name="model_name", account_id="", target_lang="target_lang", @@ -690,7 +690,7 @@ def test_path_params_run_overload_10(self, client: Cloudflare) -> None: ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - client.ai.with_raw_response.run( + client.workers.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", target_lang="target_lang", @@ -699,7 +699,7 @@ def test_path_params_run_overload_10(self, client: Cloudflare) -> None: @parametrize def test_method_run_overload_11(self, client: Cloudflare) -> None: - ai = client.ai.run( + ai = client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", input_text="x", @@ -708,7 +708,7 @@ def test_method_run_overload_11(self, client: Cloudflare) -> None: @parametrize def test_method_run_with_all_params_overload_11(self, client: Cloudflare) -> None: - ai = client.ai.run( + ai = client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", input_text="x", @@ -718,7 +718,7 @@ def test_method_run_with_all_params_overload_11(self, client: Cloudflare) -> Non @parametrize def test_raw_response_run_overload_11(self, client: Cloudflare) -> None: - response = client.ai.with_raw_response.run( + response = client.workers.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", input_text="x", @@ -731,7 +731,7 @@ def test_raw_response_run_overload_11(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_run_overload_11(self, client: Cloudflare) -> None: - with client.ai.with_streaming_response.run( + with client.workers.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", input_text="x", @@ -747,14 +747,14 @@ def test_streaming_response_run_overload_11(self, client: Cloudflare) -> None: @parametrize def test_path_params_run_overload_11(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.ai.with_raw_response.run( + client.workers.ai.with_raw_response.run( model_name="model_name", account_id="", input_text="x", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - client.ai.with_raw_response.run( + client.workers.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", input_text="x", @@ -762,7 +762,7 @@ def test_path_params_run_overload_11(self, client: Cloudflare) -> None: @parametrize def test_method_run_overload_12(self, client: Cloudflare) -> None: - ai = client.ai.run( + ai = client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -771,7 +771,7 @@ def test_method_run_overload_12(self, client: Cloudflare) -> None: @parametrize def test_method_run_with_all_params_overload_12(self, client: Cloudflare) -> None: - ai = client.ai.run( + ai = client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -784,7 +784,7 @@ def test_method_run_with_all_params_overload_12(self, client: Cloudflare) -> Non @parametrize def test_raw_response_run_overload_12(self, client: Cloudflare) -> None: - response = client.ai.with_raw_response.run( + response = client.workers.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -797,7 +797,7 @@ def test_raw_response_run_overload_12(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_run_overload_12(self, client: Cloudflare) -> None: - with client.ai.with_streaming_response.run( + with client.workers.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -813,14 +813,14 @@ def test_streaming_response_run_overload_12(self, client: Cloudflare) -> None: @parametrize def test_path_params_run_overload_12(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.ai.with_raw_response.run( + client.workers.ai.with_raw_response.run( model_name="model_name", account_id="", image=[0], ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - client.ai.with_raw_response.run( + client.workers.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -832,7 +832,7 @@ class TestAsyncAI: @parametrize async def test_method_run_overload_1(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.ai.run( + ai = await async_client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", text="x", @@ -841,7 +841,7 @@ async def test_method_run_overload_1(self, async_client: AsyncCloudflare) -> Non @parametrize async def test_raw_response_run_overload_1(self, async_client: AsyncCloudflare) -> None: - response = await async_client.ai.with_raw_response.run( + response = await async_client.workers.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", text="x", @@ -854,7 +854,7 @@ async def test_raw_response_run_overload_1(self, async_client: AsyncCloudflare) @parametrize async def test_streaming_response_run_overload_1(self, async_client: AsyncCloudflare) -> None: - async with async_client.ai.with_streaming_response.run( + async with async_client.workers.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", text="x", @@ -870,14 +870,14 @@ async def test_streaming_response_run_overload_1(self, async_client: AsyncCloudf @parametrize async def test_path_params_run_overload_1(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.ai.with_raw_response.run( + await async_client.workers.ai.with_raw_response.run( model_name="model_name", account_id="", text="x", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - await async_client.ai.with_raw_response.run( + await async_client.workers.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", text="x", @@ -885,7 +885,7 @@ async def test_path_params_run_overload_1(self, async_client: AsyncCloudflare) - @parametrize async def test_method_run_overload_2(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.ai.run( + ai = await async_client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -894,7 +894,7 @@ async def test_method_run_overload_2(self, async_client: AsyncCloudflare) -> Non @parametrize async def test_method_run_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.ai.run( + ai = await async_client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -913,7 +913,7 @@ async def test_method_run_with_all_params_overload_2(self, async_client: AsyncCl @parametrize async def test_raw_response_run_overload_2(self, async_client: AsyncCloudflare) -> None: - response = await async_client.ai.with_raw_response.run( + response = await async_client.workers.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -926,7 +926,7 @@ async def test_raw_response_run_overload_2(self, async_client: AsyncCloudflare) @parametrize async def test_streaming_response_run_overload_2(self, async_client: AsyncCloudflare) -> None: - async with async_client.ai.with_streaming_response.run( + async with async_client.workers.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -942,14 +942,14 @@ async def test_streaming_response_run_overload_2(self, async_client: AsyncCloudf @parametrize async def test_path_params_run_overload_2(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.ai.with_raw_response.run( + await async_client.workers.ai.with_raw_response.run( model_name="model_name", account_id="", prompt="x", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - await async_client.ai.with_raw_response.run( + await async_client.workers.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -957,7 +957,7 @@ async def test_path_params_run_overload_2(self, async_client: AsyncCloudflare) - @parametrize async def test_method_run_overload_3(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.ai.run( + ai = await async_client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -966,7 +966,7 @@ async def test_method_run_overload_3(self, async_client: AsyncCloudflare) -> Non @parametrize async def test_method_run_with_all_params_overload_3(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.ai.run( + ai = await async_client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -976,7 +976,7 @@ async def test_method_run_with_all_params_overload_3(self, async_client: AsyncCl @parametrize async def test_raw_response_run_overload_3(self, async_client: AsyncCloudflare) -> None: - response = await async_client.ai.with_raw_response.run( + response = await async_client.workers.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -989,7 +989,7 @@ async def test_raw_response_run_overload_3(self, async_client: AsyncCloudflare) @parametrize async def test_streaming_response_run_overload_3(self, async_client: AsyncCloudflare) -> None: - async with async_client.ai.with_streaming_response.run( + async with async_client.workers.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -1005,14 +1005,14 @@ async def test_streaming_response_run_overload_3(self, async_client: AsyncCloudf @parametrize async def test_path_params_run_overload_3(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.ai.with_raw_response.run( + await async_client.workers.ai.with_raw_response.run( model_name="model_name", account_id="", prompt="x", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - await async_client.ai.with_raw_response.run( + await async_client.workers.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -1020,7 +1020,7 @@ async def test_path_params_run_overload_3(self, async_client: AsyncCloudflare) - @parametrize async def test_method_run_overload_4(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.ai.run( + ai = await async_client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", text="x", @@ -1029,7 +1029,7 @@ async def test_method_run_overload_4(self, async_client: AsyncCloudflare) -> Non @parametrize async def test_raw_response_run_overload_4(self, async_client: AsyncCloudflare) -> None: - response = await async_client.ai.with_raw_response.run( + response = await async_client.workers.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", text="x", @@ -1042,7 +1042,7 @@ async def test_raw_response_run_overload_4(self, async_client: AsyncCloudflare) @parametrize async def test_streaming_response_run_overload_4(self, async_client: AsyncCloudflare) -> None: - async with async_client.ai.with_streaming_response.run( + async with async_client.workers.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", text="x", @@ -1058,14 +1058,14 @@ async def test_streaming_response_run_overload_4(self, async_client: AsyncCloudf @parametrize async def test_path_params_run_overload_4(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.ai.with_raw_response.run( + await async_client.workers.ai.with_raw_response.run( model_name="model_name", account_id="", text="x", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - await async_client.ai.with_raw_response.run( + await async_client.workers.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", text="x", @@ -1073,7 +1073,7 @@ async def test_path_params_run_overload_4(self, async_client: AsyncCloudflare) - @parametrize async def test_method_run_overload_5(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.ai.run( + ai = await async_client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", audio=[0], @@ -1082,7 +1082,7 @@ async def test_method_run_overload_5(self, async_client: AsyncCloudflare) -> Non @parametrize async def test_method_run_with_all_params_overload_5(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.ai.run( + ai = await async_client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", audio=[0], @@ -1093,7 +1093,7 @@ async def test_method_run_with_all_params_overload_5(self, async_client: AsyncCl @parametrize async def test_raw_response_run_overload_5(self, async_client: AsyncCloudflare) -> None: - response = await async_client.ai.with_raw_response.run( + response = await async_client.workers.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", audio=[0], @@ -1106,7 +1106,7 @@ async def test_raw_response_run_overload_5(self, async_client: AsyncCloudflare) @parametrize async def test_streaming_response_run_overload_5(self, async_client: AsyncCloudflare) -> None: - async with async_client.ai.with_streaming_response.run( + async with async_client.workers.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", audio=[0], @@ -1122,14 +1122,14 @@ async def test_streaming_response_run_overload_5(self, async_client: AsyncCloudf @parametrize async def test_path_params_run_overload_5(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.ai.with_raw_response.run( + await async_client.workers.ai.with_raw_response.run( model_name="model_name", account_id="", audio=[0], ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - await async_client.ai.with_raw_response.run( + await async_client.workers.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", audio=[0], @@ -1137,7 +1137,7 @@ async def test_path_params_run_overload_5(self, async_client: AsyncCloudflare) - @parametrize async def test_method_run_overload_6(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.ai.run( + ai = await async_client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -1146,7 +1146,7 @@ async def test_method_run_overload_6(self, async_client: AsyncCloudflare) -> Non @parametrize async def test_raw_response_run_overload_6(self, async_client: AsyncCloudflare) -> None: - response = await async_client.ai.with_raw_response.run( + response = await async_client.workers.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -1159,7 +1159,7 @@ async def test_raw_response_run_overload_6(self, async_client: AsyncCloudflare) @parametrize async def test_streaming_response_run_overload_6(self, async_client: AsyncCloudflare) -> None: - async with async_client.ai.with_streaming_response.run( + async with async_client.workers.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -1175,14 +1175,14 @@ async def test_streaming_response_run_overload_6(self, async_client: AsyncCloudf @parametrize async def test_path_params_run_overload_6(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.ai.with_raw_response.run( + await async_client.workers.ai.with_raw_response.run( model_name="model_name", account_id="", image=[0], ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - await async_client.ai.with_raw_response.run( + await async_client.workers.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -1190,7 +1190,7 @@ async def test_path_params_run_overload_6(self, async_client: AsyncCloudflare) - @parametrize async def test_method_run_overload_7(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.ai.run( + ai = await async_client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -1198,7 +1198,7 @@ async def test_method_run_overload_7(self, async_client: AsyncCloudflare) -> Non @parametrize async def test_method_run_with_all_params_overload_7(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.ai.run( + ai = await async_client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -1207,7 +1207,7 @@ async def test_method_run_with_all_params_overload_7(self, async_client: AsyncCl @parametrize async def test_raw_response_run_overload_7(self, async_client: AsyncCloudflare) -> None: - response = await async_client.ai.with_raw_response.run( + response = await async_client.workers.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -1219,7 +1219,7 @@ async def test_raw_response_run_overload_7(self, async_client: AsyncCloudflare) @parametrize async def test_streaming_response_run_overload_7(self, async_client: AsyncCloudflare) -> None: - async with async_client.ai.with_streaming_response.run( + async with async_client.workers.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -1234,20 +1234,20 @@ async def test_streaming_response_run_overload_7(self, async_client: AsyncCloudf @parametrize async def test_path_params_run_overload_7(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.ai.with_raw_response.run( + await async_client.workers.ai.with_raw_response.run( model_name="model_name", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - await async_client.ai.with_raw_response.run( + await async_client.workers.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @parametrize async def test_method_run_overload_8(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.ai.run( + ai = await async_client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -1256,7 +1256,7 @@ async def test_method_run_overload_8(self, async_client: AsyncCloudflare) -> Non @parametrize async def test_method_run_with_all_params_overload_8(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.ai.run( + ai = await async_client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -1276,7 +1276,7 @@ async def test_method_run_with_all_params_overload_8(self, async_client: AsyncCl @parametrize async def test_raw_response_run_overload_8(self, async_client: AsyncCloudflare) -> None: - response = await async_client.ai.with_raw_response.run( + response = await async_client.workers.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -1289,7 +1289,7 @@ async def test_raw_response_run_overload_8(self, async_client: AsyncCloudflare) @parametrize async def test_streaming_response_run_overload_8(self, async_client: AsyncCloudflare) -> None: - async with async_client.ai.with_streaming_response.run( + async with async_client.workers.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -1305,14 +1305,14 @@ async def test_streaming_response_run_overload_8(self, async_client: AsyncCloudf @parametrize async def test_path_params_run_overload_8(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.ai.with_raw_response.run( + await async_client.workers.ai.with_raw_response.run( model_name="model_name", account_id="", prompt="x", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - await async_client.ai.with_raw_response.run( + await async_client.workers.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -1320,7 +1320,7 @@ async def test_path_params_run_overload_8(self, async_client: AsyncCloudflare) - @parametrize async def test_method_run_overload_9(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.ai.run( + ai = await async_client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", messages=[ @@ -1334,7 +1334,7 @@ async def test_method_run_overload_9(self, async_client: AsyncCloudflare) -> Non @parametrize async def test_method_run_with_all_params_overload_9(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.ai.run( + ai = await async_client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", messages=[ @@ -1379,7 +1379,7 @@ async def test_method_run_with_all_params_overload_9(self, async_client: AsyncCl @parametrize async def test_raw_response_run_overload_9(self, async_client: AsyncCloudflare) -> None: - response = await async_client.ai.with_raw_response.run( + response = await async_client.workers.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", messages=[ @@ -1397,7 +1397,7 @@ async def test_raw_response_run_overload_9(self, async_client: AsyncCloudflare) @parametrize async def test_streaming_response_run_overload_9(self, async_client: AsyncCloudflare) -> None: - async with async_client.ai.with_streaming_response.run( + async with async_client.workers.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", messages=[ @@ -1418,7 +1418,7 @@ async def test_streaming_response_run_overload_9(self, async_client: AsyncCloudf @parametrize async def test_path_params_run_overload_9(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.ai.with_raw_response.run( + await async_client.workers.ai.with_raw_response.run( model_name="model_name", account_id="", messages=[ @@ -1430,7 +1430,7 @@ async def test_path_params_run_overload_9(self, async_client: AsyncCloudflare) - ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - await async_client.ai.with_raw_response.run( + await async_client.workers.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", messages=[ @@ -1443,7 +1443,7 @@ async def test_path_params_run_overload_9(self, async_client: AsyncCloudflare) - @parametrize async def test_method_run_overload_10(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.ai.run( + ai = await async_client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", target_lang="target_lang", @@ -1453,7 +1453,7 @@ async def test_method_run_overload_10(self, async_client: AsyncCloudflare) -> No @parametrize async def test_method_run_with_all_params_overload_10(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.ai.run( + ai = await async_client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", target_lang="target_lang", @@ -1464,7 +1464,7 @@ async def test_method_run_with_all_params_overload_10(self, async_client: AsyncC @parametrize async def test_raw_response_run_overload_10(self, async_client: AsyncCloudflare) -> None: - response = await async_client.ai.with_raw_response.run( + response = await async_client.workers.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", target_lang="target_lang", @@ -1478,7 +1478,7 @@ async def test_raw_response_run_overload_10(self, async_client: AsyncCloudflare) @parametrize async def test_streaming_response_run_overload_10(self, async_client: AsyncCloudflare) -> None: - async with async_client.ai.with_streaming_response.run( + async with async_client.workers.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", target_lang="target_lang", @@ -1495,7 +1495,7 @@ async def test_streaming_response_run_overload_10(self, async_client: AsyncCloud @parametrize async def test_path_params_run_overload_10(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.ai.with_raw_response.run( + await async_client.workers.ai.with_raw_response.run( model_name="model_name", account_id="", target_lang="target_lang", @@ -1503,7 +1503,7 @@ async def test_path_params_run_overload_10(self, async_client: AsyncCloudflare) ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - await async_client.ai.with_raw_response.run( + await async_client.workers.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", target_lang="target_lang", @@ -1512,7 +1512,7 @@ async def test_path_params_run_overload_10(self, async_client: AsyncCloudflare) @parametrize async def test_method_run_overload_11(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.ai.run( + ai = await async_client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", input_text="x", @@ -1521,7 +1521,7 @@ async def test_method_run_overload_11(self, async_client: AsyncCloudflare) -> No @parametrize async def test_method_run_with_all_params_overload_11(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.ai.run( + ai = await async_client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", input_text="x", @@ -1531,7 +1531,7 @@ async def test_method_run_with_all_params_overload_11(self, async_client: AsyncC @parametrize async def test_raw_response_run_overload_11(self, async_client: AsyncCloudflare) -> None: - response = await async_client.ai.with_raw_response.run( + response = await async_client.workers.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", input_text="x", @@ -1544,7 +1544,7 @@ async def test_raw_response_run_overload_11(self, async_client: AsyncCloudflare) @parametrize async def test_streaming_response_run_overload_11(self, async_client: AsyncCloudflare) -> None: - async with async_client.ai.with_streaming_response.run( + async with async_client.workers.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", input_text="x", @@ -1560,14 +1560,14 @@ async def test_streaming_response_run_overload_11(self, async_client: AsyncCloud @parametrize async def test_path_params_run_overload_11(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.ai.with_raw_response.run( + await async_client.workers.ai.with_raw_response.run( model_name="model_name", account_id="", input_text="x", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - await async_client.ai.with_raw_response.run( + await async_client.workers.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", input_text="x", @@ -1575,7 +1575,7 @@ async def test_path_params_run_overload_11(self, async_client: AsyncCloudflare) @parametrize async def test_method_run_overload_12(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.ai.run( + ai = await async_client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -1584,7 +1584,7 @@ async def test_method_run_overload_12(self, async_client: AsyncCloudflare) -> No @parametrize async def test_method_run_with_all_params_overload_12(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.ai.run( + ai = await async_client.workers.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -1597,7 +1597,7 @@ async def test_method_run_with_all_params_overload_12(self, async_client: AsyncC @parametrize async def test_raw_response_run_overload_12(self, async_client: AsyncCloudflare) -> None: - response = await async_client.ai.with_raw_response.run( + response = await async_client.workers.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -1610,7 +1610,7 @@ async def test_raw_response_run_overload_12(self, async_client: AsyncCloudflare) @parametrize async def test_streaming_response_run_overload_12(self, async_client: AsyncCloudflare) -> None: - async with async_client.ai.with_streaming_response.run( + async with async_client.workers.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -1626,14 +1626,14 @@ async def test_streaming_response_run_overload_12(self, async_client: AsyncCloud @parametrize async def test_path_params_run_overload_12(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.ai.with_raw_response.run( + await async_client.workers.ai.with_raw_response.run( model_name="model_name", account_id="", image=[0], ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - await async_client.ai.with_raw_response.run( + await async_client.workers.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], diff --git a/tests/api_resources/workers/test_routes.py b/tests/api_resources/workers/test_routes.py deleted file mode 100644 index 86895a348ba..00000000000 --- a/tests/api_resources/workers/test_routes.py +++ /dev/null @@ -1,525 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, Optional, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.workers import ( - RouteGetResponse, - RouteListResponse, - RouteCreateResponse, - RouteDeleteResponse, - RouteUpdateResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestRoutes: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_create(self, client: Cloudflare) -> None: - route = client.workers.routes.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - pattern="example.net/*", - ) - assert_matches_type(RouteCreateResponse, route, path=["response"]) - - @parametrize - def test_method_create_with_all_params(self, client: Cloudflare) -> None: - route = client.workers.routes.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - pattern="example.net/*", - script="this-is_my_script-01", - ) - assert_matches_type(RouteCreateResponse, route, path=["response"]) - - @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.workers.routes.with_raw_response.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - pattern="example.net/*", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - route = response.parse() - assert_matches_type(RouteCreateResponse, route, path=["response"]) - - @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.workers.routes.with_streaming_response.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - pattern="example.net/*", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - route = response.parse() - assert_matches_type(RouteCreateResponse, route, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.workers.routes.with_raw_response.create( - zone_id="", - pattern="example.net/*", - ) - - @parametrize - def test_method_update(self, client: Cloudflare) -> None: - route = client.workers.routes.update( - route_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - pattern="example.net/*", - ) - assert_matches_type(Optional[RouteUpdateResponse], route, path=["response"]) - - @parametrize - def test_method_update_with_all_params(self, client: Cloudflare) -> None: - route = client.workers.routes.update( - route_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - pattern="example.net/*", - script="this-is_my_script-01", - ) - assert_matches_type(Optional[RouteUpdateResponse], route, path=["response"]) - - @parametrize - def test_raw_response_update(self, client: Cloudflare) -> None: - response = client.workers.routes.with_raw_response.update( - route_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - pattern="example.net/*", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - route = response.parse() - assert_matches_type(Optional[RouteUpdateResponse], route, path=["response"]) - - @parametrize - def test_streaming_response_update(self, client: Cloudflare) -> None: - with client.workers.routes.with_streaming_response.update( - route_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - pattern="example.net/*", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - route = response.parse() - assert_matches_type(Optional[RouteUpdateResponse], route, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.workers.routes.with_raw_response.update( - route_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="", - pattern="example.net/*", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `route_id` but received ''"): - client.workers.routes.with_raw_response.update( - route_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - pattern="example.net/*", - ) - - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - route = client.workers.routes.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(SyncSinglePage[RouteListResponse], route, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.workers.routes.with_raw_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - route = response.parse() - assert_matches_type(SyncSinglePage[RouteListResponse], route, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.workers.routes.with_streaming_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - route = response.parse() - assert_matches_type(SyncSinglePage[RouteListResponse], route, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.workers.routes.with_raw_response.list( - zone_id="", - ) - - @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - route = client.workers.routes.delete( - route_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(RouteDeleteResponse, route, path=["response"]) - - @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.workers.routes.with_raw_response.delete( - route_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - route = response.parse() - assert_matches_type(RouteDeleteResponse, route, path=["response"]) - - @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.workers.routes.with_streaming_response.delete( - route_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - route = response.parse() - assert_matches_type(RouteDeleteResponse, route, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.workers.routes.with_raw_response.delete( - route_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `route_id` but received ''"): - client.workers.routes.with_raw_response.delete( - route_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @parametrize - def test_method_get(self, client: Cloudflare) -> None: - route = client.workers.routes.get( - route_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[RouteGetResponse], route, path=["response"]) - - @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.workers.routes.with_raw_response.get( - route_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - route = response.parse() - assert_matches_type(Optional[RouteGetResponse], route, path=["response"]) - - @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.workers.routes.with_streaming_response.get( - route_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - route = response.parse() - assert_matches_type(Optional[RouteGetResponse], route, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.workers.routes.with_raw_response.get( - route_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `route_id` but received ''"): - client.workers.routes.with_raw_response.get( - route_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - -class TestAsyncRoutes: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: - route = await async_client.workers.routes.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - pattern="example.net/*", - ) - assert_matches_type(RouteCreateResponse, route, path=["response"]) - - @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: - route = await async_client.workers.routes.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - pattern="example.net/*", - script="this-is_my_script-01", - ) - assert_matches_type(RouteCreateResponse, route, path=["response"]) - - @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.workers.routes.with_raw_response.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - pattern="example.net/*", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - route = await response.parse() - assert_matches_type(RouteCreateResponse, route, path=["response"]) - - @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.workers.routes.with_streaming_response.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - pattern="example.net/*", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - route = await response.parse() - assert_matches_type(RouteCreateResponse, route, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.workers.routes.with_raw_response.create( - zone_id="", - pattern="example.net/*", - ) - - @parametrize - async def test_method_update(self, async_client: AsyncCloudflare) -> None: - route = await async_client.workers.routes.update( - route_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - pattern="example.net/*", - ) - assert_matches_type(Optional[RouteUpdateResponse], route, path=["response"]) - - @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: - route = await async_client.workers.routes.update( - route_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - pattern="example.net/*", - script="this-is_my_script-01", - ) - assert_matches_type(Optional[RouteUpdateResponse], route, path=["response"]) - - @parametrize - async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: - response = await async_client.workers.routes.with_raw_response.update( - route_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - pattern="example.net/*", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - route = await response.parse() - assert_matches_type(Optional[RouteUpdateResponse], route, path=["response"]) - - @parametrize - async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: - async with async_client.workers.routes.with_streaming_response.update( - route_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - pattern="example.net/*", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - route = await response.parse() - assert_matches_type(Optional[RouteUpdateResponse], route, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.workers.routes.with_raw_response.update( - route_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="", - pattern="example.net/*", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `route_id` but received ''"): - await async_client.workers.routes.with_raw_response.update( - route_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - pattern="example.net/*", - ) - - @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - route = await async_client.workers.routes.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(AsyncSinglePage[RouteListResponse], route, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.workers.routes.with_raw_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - route = await response.parse() - assert_matches_type(AsyncSinglePage[RouteListResponse], route, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.workers.routes.with_streaming_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - route = await response.parse() - assert_matches_type(AsyncSinglePage[RouteListResponse], route, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.workers.routes.with_raw_response.list( - zone_id="", - ) - - @parametrize - async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - route = await async_client.workers.routes.delete( - route_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(RouteDeleteResponse, route, path=["response"]) - - @parametrize - async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.workers.routes.with_raw_response.delete( - route_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - route = await response.parse() - assert_matches_type(RouteDeleteResponse, route, path=["response"]) - - @parametrize - async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.workers.routes.with_streaming_response.delete( - route_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - route = await response.parse() - assert_matches_type(RouteDeleteResponse, route, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.workers.routes.with_raw_response.delete( - route_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `route_id` but received ''"): - await async_client.workers.routes.with_raw_response.delete( - route_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - route = await async_client.workers.routes.get( - route_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[RouteGetResponse], route, path=["response"]) - - @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.workers.routes.with_raw_response.get( - route_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - route = await response.parse() - assert_matches_type(Optional[RouteGetResponse], route, path=["response"]) - - @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.workers.routes.with_streaming_response.get( - route_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - route = await response.parse() - assert_matches_type(Optional[RouteGetResponse], route, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.workers.routes.with_raw_response.get( - route_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `route_id` but received ''"): - await async_client.workers.routes.with_raw_response.get( - route_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) diff --git a/tests/api_resources/workers/test_scripts.py b/tests/api_resources/workers/test_scripts.py index 342dd8c9531..f031908950b 100644 --- a/tests/api_resources/workers/test_scripts.py +++ b/tests/api_resources/workers/test_scripts.py @@ -5,15 +5,20 @@ import os from typing import Any, Optional, cast +import httpx import pytest +from respx import MockRouter from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.workers import ( - Script, - ScriptUpdateResponse, +from cloudflare._response import ( + BinaryAPIResponse, + AsyncBinaryAPIResponse, + StreamedBinaryAPIResponse, + AsyncStreamedBinaryAPIResponse, ) +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.workers import Script, ScriptUpdateResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,20 +28,21 @@ class TestScripts: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_update(self, client: Cloudflare) -> None: + def test_method_update_overload_1(self, client: Cloudflare) -> None: script = client.workers.scripts.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", - metadata={}, ) assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_update_with_all_params(self, client: Cloudflare) -> None: + def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> None: script = client.workers.scripts.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", + rollback_to="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + any_part_name=[b"raw file contents"], metadata={ "assets": { "config": { @@ -53,8 +59,8 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: } ], "body_part": "worker.js", - "compatibility_date": "2021-01-01", - "compatibility_flags": ["nodejs_compat"], + "compatibility_date": "2023-07-25", + "compatibility_flags": ["string"], "keep_assets": False, "keep_bindings": ["string"], "logpush": False, @@ -92,18 +98,18 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "namespace": "my-namespace", } ], - "usage_model": "standard", + "usage_model": "bundled", + "version_tags": {"foo": "string"}, }, ) assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_raw_response_update(self, client: Cloudflare) -> None: + def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: response = client.workers.scripts.with_raw_response.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", - metadata={}, ) assert response.is_closed is True @@ -113,11 +119,10 @@ def test_raw_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_streaming_response_update(self, client: Cloudflare) -> None: + def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: with client.workers.scripts.with_streaming_response.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", - metadata={}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -129,19 +134,80 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_path_params_update(self, client: Cloudflare) -> None: + def test_path_params_update_overload_1(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.workers.scripts.with_raw_response.update( + script_name="this-is_my_script-01", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): + client.workers.scripts.with_raw_response.update( + script_name="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_method_update_overload_2(self, client: Cloudflare) -> None: + script = client.workers.scripts.update( + script_name="this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> None: + script = client.workers.scripts.update( + script_name="this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + rollback_to="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + message="message", + ) + assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: + response = client.workers.scripts.with_raw_response.update( + script_name="this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + script = response.parse() + assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: + with client.workers.scripts.with_streaming_response.update( + script_name="this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + script = response.parse() + assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_path_params_update_overload_2(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.workers.scripts.with_raw_response.update( script_name="this-is_my_script-01", account_id="", - metadata={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): client.workers.scripts.with_raw_response.update( script_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", - metadata={}, ) @parametrize @@ -240,40 +306,58 @@ def test_path_params_delete(self, client: Cloudflare) -> None: ) @parametrize - def test_method_get(self, client: Cloudflare) -> None: + @pytest.mark.respx(base_url=base_url) + def test_method_get(self, client: Cloudflare, respx_mock: MockRouter) -> None: + respx_mock.get("/accounts/023e105f4ecef8ad9ca31a8372d0c353/workers/scripts/this-is_my_script-01").mock( + return_value=httpx.Response(200, json={"foo": "bar"}) + ) script = client.workers.scripts.get( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(str, script, path=["response"]) + assert script.is_closed + assert script.json() == {"foo": "bar"} + assert cast(Any, script.is_closed) is True + assert isinstance(script, BinaryAPIResponse) @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.workers.scripts.with_raw_response.get( + @pytest.mark.respx(base_url=base_url) + def test_raw_response_get(self, client: Cloudflare, respx_mock: MockRouter) -> None: + respx_mock.get("/accounts/023e105f4ecef8ad9ca31a8372d0c353/workers/scripts/this-is_my_script-01").mock( + return_value=httpx.Response(200, json={"foo": "bar"}) + ) + + script = client.workers.scripts.with_raw_response.get( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - script = response.parse() - assert_matches_type(str, script, path=["response"]) + assert script.is_closed is True + assert script.http_request.headers.get("X-Stainless-Lang") == "python" + assert script.json() == {"foo": "bar"} + assert isinstance(script, BinaryAPIResponse) @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: + @pytest.mark.respx(base_url=base_url) + def test_streaming_response_get(self, client: Cloudflare, respx_mock: MockRouter) -> None: + respx_mock.get("/accounts/023e105f4ecef8ad9ca31a8372d0c353/workers/scripts/this-is_my_script-01").mock( + return_value=httpx.Response(200, json={"foo": "bar"}) + ) with client.workers.scripts.with_streaming_response.get( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ) as script: + assert not script.is_closed + assert script.http_request.headers.get("X-Stainless-Lang") == "python" - script = response.parse() - assert_matches_type(str, script, path=["response"]) + assert script.json() == {"foo": "bar"} + assert cast(Any, script.is_closed) is True + assert isinstance(script, StreamedBinaryAPIResponse) - assert cast(Any, response.is_closed) is True + assert cast(Any, script.is_closed) is True @parametrize + @pytest.mark.respx(base_url=base_url) def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.workers.scripts.with_raw_response.get( @@ -293,20 +377,21 @@ class TestAsyncScripts: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_method_update(self, async_client: AsyncCloudflare) -> None: + async def test_method_update_overload_1(self, async_client: AsyncCloudflare) -> None: script = await async_client.workers.scripts.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", - metadata={}, ) assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: + async def test_method_update_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: script = await async_client.workers.scripts.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", + rollback_to="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + any_part_name=[b"raw file contents"], metadata={ "assets": { "config": { @@ -323,8 +408,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare } ], "body_part": "worker.js", - "compatibility_date": "2021-01-01", - "compatibility_flags": ["nodejs_compat"], + "compatibility_date": "2023-07-25", + "compatibility_flags": ["string"], "keep_assets": False, "keep_bindings": ["string"], "logpush": False, @@ -362,18 +447,18 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "namespace": "my-namespace", } ], - "usage_model": "standard", + "usage_model": "bundled", + "version_tags": {"foo": "string"}, }, ) assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: response = await async_client.workers.scripts.with_raw_response.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", - metadata={}, ) assert response.is_closed is True @@ -383,11 +468,10 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: async with async_client.workers.scripts.with_streaming_response.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", - metadata={}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -399,19 +483,80 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_update_overload_1(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.workers.scripts.with_raw_response.update( + script_name="this-is_my_script-01", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): + await async_client.workers.scripts.with_raw_response.update( + script_name="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> None: + script = await async_client.workers.scripts.update( + script_name="this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: + script = await async_client.workers.scripts.update( + script_name="this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + rollback_to="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + message="message", + ) + assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.scripts.with_raw_response.update( + script_name="this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + script = await response.parse() + assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_streaming_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.scripts.with_streaming_response.update( + script_name="this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + script = await response.parse() + assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.workers.scripts.with_raw_response.update( script_name="this-is_my_script-01", account_id="", - metadata={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): await async_client.workers.scripts.with_raw_response.update( script_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", - metadata={}, ) @parametrize @@ -510,40 +655,58 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: ) @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: + @pytest.mark.respx(base_url=base_url) + async def test_method_get(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None: + respx_mock.get("/accounts/023e105f4ecef8ad9ca31a8372d0c353/workers/scripts/this-is_my_script-01").mock( + return_value=httpx.Response(200, json={"foo": "bar"}) + ) script = await async_client.workers.scripts.get( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(str, script, path=["response"]) + assert script.is_closed + assert await script.json() == {"foo": "bar"} + assert cast(Any, script.is_closed) is True + assert isinstance(script, AsyncBinaryAPIResponse) @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.workers.scripts.with_raw_response.get( + @pytest.mark.respx(base_url=base_url) + async def test_raw_response_get(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None: + respx_mock.get("/accounts/023e105f4ecef8ad9ca31a8372d0c353/workers/scripts/this-is_my_script-01").mock( + return_value=httpx.Response(200, json={"foo": "bar"}) + ) + + script = await async_client.workers.scripts.with_raw_response.get( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - script = await response.parse() - assert_matches_type(str, script, path=["response"]) + assert script.is_closed is True + assert script.http_request.headers.get("X-Stainless-Lang") == "python" + assert await script.json() == {"foo": "bar"} + assert isinstance(script, AsyncBinaryAPIResponse) @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + @pytest.mark.respx(base_url=base_url) + async def test_streaming_response_get(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None: + respx_mock.get("/accounts/023e105f4ecef8ad9ca31a8372d0c353/workers/scripts/this-is_my_script-01").mock( + return_value=httpx.Response(200, json={"foo": "bar"}) + ) async with async_client.workers.scripts.with_streaming_response.get( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ) as script: + assert not script.is_closed + assert script.http_request.headers.get("X-Stainless-Lang") == "python" - script = await response.parse() - assert_matches_type(str, script, path=["response"]) + assert await script.json() == {"foo": "bar"} + assert cast(Any, script.is_closed) is True + assert isinstance(script, AsyncStreamedBinaryAPIResponse) - assert cast(Any, response.is_closed) is True + assert cast(Any, script.is_closed) is True @parametrize + @pytest.mark.respx(base_url=base_url) async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.workers.scripts.with_raw_response.get( diff --git a/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_asset_upload.py b/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_asset_upload.py deleted file mode 100644 index e709c6dc236..00000000000 --- a/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_asset_upload.py +++ /dev/null @@ -1,176 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, Optional, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.types.workers_for_platforms.dispatch.namespaces.scripts import ( - AssetUploadCreateResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestAssetUpload: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_create(self, client: Cloudflare) -> None: - asset_upload = client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.create( - script_name="this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dispatch_namespace="my-dispatch-namespace", - ) - assert_matches_type(Optional[AssetUploadCreateResponse], asset_upload, path=["response"]) - - @parametrize - def test_method_create_with_all_params(self, client: Cloudflare) -> None: - asset_upload = client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.create( - script_name="this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dispatch_namespace="my-dispatch-namespace", - manifest={ - "foo": { - "hash": "hash", - "size": 0, - } - }, - ) - assert_matches_type(Optional[AssetUploadCreateResponse], asset_upload, path=["response"]) - - @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.with_raw_response.create( - script_name="this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dispatch_namespace="my-dispatch-namespace", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - asset_upload = response.parse() - assert_matches_type(Optional[AssetUploadCreateResponse], asset_upload, path=["response"]) - - @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.with_streaming_response.create( - script_name="this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dispatch_namespace="my-dispatch-namespace", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - asset_upload = response.parse() - assert_matches_type(Optional[AssetUploadCreateResponse], asset_upload, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.with_raw_response.create( - script_name="this-is_my_script-01", - account_id="", - dispatch_namespace="my-dispatch-namespace", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `dispatch_namespace` but received ''"): - client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.with_raw_response.create( - script_name="this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dispatch_namespace="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): - client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.with_raw_response.create( - script_name="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dispatch_namespace="my-dispatch-namespace", - ) - - -class TestAsyncAssetUpload: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: - asset_upload = await async_client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.create( - script_name="this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dispatch_namespace="my-dispatch-namespace", - ) - assert_matches_type(Optional[AssetUploadCreateResponse], asset_upload, path=["response"]) - - @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: - asset_upload = await async_client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.create( - script_name="this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dispatch_namespace="my-dispatch-namespace", - manifest={ - "foo": { - "hash": "hash", - "size": 0, - } - }, - ) - assert_matches_type(Optional[AssetUploadCreateResponse], asset_upload, path=["response"]) - - @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = ( - await async_client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.with_raw_response.create( - script_name="this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dispatch_namespace="my-dispatch-namespace", - ) - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - asset_upload = await response.parse() - assert_matches_type(Optional[AssetUploadCreateResponse], asset_upload, path=["response"]) - - @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.with_streaming_response.create( - script_name="this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dispatch_namespace="my-dispatch-namespace", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - asset_upload = await response.parse() - assert_matches_type(Optional[AssetUploadCreateResponse], asset_upload, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.with_raw_response.create( - script_name="this-is_my_script-01", - account_id="", - dispatch_namespace="my-dispatch-namespace", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `dispatch_namespace` but received ''"): - await async_client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.with_raw_response.create( - script_name="this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dispatch_namespace="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): - await async_client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.with_raw_response.create( - script_name="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dispatch_namespace="my-dispatch-namespace", - ) diff --git a/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_content.py b/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_content.py index 822e7f80d7a..b869d42a76e 100644 --- a/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_content.py +++ b/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_content.py @@ -32,7 +32,6 @@ def test_method_update(self, client: Cloudflare) -> None: script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", - metadata={}, ) assert_matches_type(Optional[Script], content, path=["response"]) @@ -43,6 +42,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", + any_part_name=[b"raw file contents"], metadata={ "body_part": "worker.js", "main_module": "worker.js", @@ -59,7 +59,6 @@ def test_raw_response_update(self, client: Cloudflare) -> None: script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", - metadata={}, ) assert response.is_closed is True @@ -74,7 +73,6 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", - metadata={}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -92,7 +90,6 @@ def test_path_params_update(self, client: Cloudflare) -> None: script_name="this-is_my_script-01", account_id="", dispatch_namespace="my-dispatch-namespace", - metadata={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dispatch_namespace` but received ''"): @@ -100,7 +97,6 @@ def test_path_params_update(self, client: Cloudflare) -> None: script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="", - metadata={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): @@ -108,7 +104,6 @@ def test_path_params_update(self, client: Cloudflare) -> None: script_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", - metadata={}, ) @parametrize @@ -200,7 +195,6 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", - metadata={}, ) assert_matches_type(Optional[Script], content, path=["response"]) @@ -211,6 +205,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", + any_part_name=[b"raw file contents"], metadata={ "body_part": "worker.js", "main_module": "worker.js", @@ -228,7 +223,6 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", - metadata={}, ) ) @@ -244,7 +238,6 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", - metadata={}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -262,7 +255,6 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: script_name="this-is_my_script-01", account_id="", dispatch_namespace="my-dispatch-namespace", - metadata={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dispatch_namespace` but received ''"): @@ -270,7 +262,6 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="", - metadata={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): @@ -278,7 +269,6 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: script_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", - metadata={}, ) @parametrize diff --git a/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_settings.py b/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_settings.py index b3a2e96a5d1..50a6f309b63 100644 --- a/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_settings.py +++ b/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_settings.py @@ -38,14 +38,9 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", settings={ - "bindings": [ - { - "name": "MY_ENV_VAR", - "type": "plain_text", - } - ], - "compatibility_date": "2021-01-01", - "compatibility_flags": ["nodejs_compat"], + "bindings": [{"type": "kv_namespace"}], + "compatibility_date": "2022-04-05", + "compatibility_flags": ["formdata_parser_supports_files"], "limits": {"cpu_ms": 50}, "logpush": False, "migrations": { @@ -81,7 +76,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: "namespace": "my-namespace", } ], - "usage_model": "standard", + "usage_model": "unbound", }, ) assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @@ -222,14 +217,9 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", settings={ - "bindings": [ - { - "name": "MY_ENV_VAR", - "type": "plain_text", - } - ], - "compatibility_date": "2021-01-01", - "compatibility_flags": ["nodejs_compat"], + "bindings": [{"type": "kv_namespace"}], + "compatibility_date": "2022-04-05", + "compatibility_flags": ["formdata_parser_supports_files"], "limits": {"cpu_ms": 50}, "logpush": False, "migrations": { @@ -265,7 +255,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) "namespace": "my-namespace", } ], - "usage_model": "standard", + "usage_model": "unbound", }, ) assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) diff --git a/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py b/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py index cfec51aadc0..c5c287cfdab 100644 --- a/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py +++ b/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py @@ -22,22 +22,22 @@ class TestScripts: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_update(self, client: Cloudflare) -> None: + def test_method_update_overload_1(self, client: Cloudflare) -> None: script = client.workers_for_platforms.dispatch.namespaces.scripts.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", - metadata={}, ) assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_update_with_all_params(self, client: Cloudflare) -> None: + def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> None: script = client.workers_for_platforms.dispatch.namespaces.scripts.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", + any_part_name=[b"raw file contents"], metadata={ "assets": { "config": { @@ -54,8 +54,8 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: } ], "body_part": "worker.js", - "compatibility_date": "2021-01-01", - "compatibility_flags": ["nodejs_compat"], + "compatibility_date": "2023-07-25", + "compatibility_flags": ["string"], "keep_assets": False, "keep_bindings": ["string"], "logpush": False, @@ -93,19 +93,19 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "namespace": "my-namespace", } ], - "usage_model": "standard", + "usage_model": "bundled", + "version_tags": {"foo": "string"}, }, ) assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_raw_response_update(self, client: Cloudflare) -> None: + def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: response = client.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", - metadata={}, ) assert response.is_closed is True @@ -115,12 +115,11 @@ def test_raw_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_streaming_response_update(self, client: Cloudflare) -> None: + def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: with client.workers_for_platforms.dispatch.namespaces.scripts.with_streaming_response.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", - metadata={}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -132,13 +131,87 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_path_params_update(self, client: Cloudflare) -> None: + def test_path_params_update_overload_1(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( + script_name="this-is_my_script-01", + account_id="", + dispatch_namespace="my-dispatch-namespace", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dispatch_namespace` but received ''"): + client.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( + script_name="this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): + client.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( + script_name="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + ) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_method_update_overload_2(self, client: Cloudflare) -> None: + script = client.workers_for_platforms.dispatch.namespaces.scripts.update( + script_name="this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + ) + assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> None: + script = client.workers_for_platforms.dispatch.namespaces.scripts.update( + script_name="this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + message="message", + ) + assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: + response = client.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( + script_name="this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + script = response.parse() + assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: + with client.workers_for_platforms.dispatch.namespaces.scripts.with_streaming_response.update( + script_name="this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + script = response.parse() + assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_path_params_update_overload_2(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( script_name="this-is_my_script-01", account_id="", dispatch_namespace="my-dispatch-namespace", - metadata={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dispatch_namespace` but received ''"): @@ -146,7 +219,6 @@ def test_path_params_update(self, client: Cloudflare) -> None: script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="", - metadata={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): @@ -154,7 +226,6 @@ def test_path_params_update(self, client: Cloudflare) -> None: script_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", - metadata={}, ) @parametrize @@ -293,22 +364,22 @@ class TestAsyncScripts: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_method_update(self, async_client: AsyncCloudflare) -> None: + async def test_method_update_overload_1(self, async_client: AsyncCloudflare) -> None: script = await async_client.workers_for_platforms.dispatch.namespaces.scripts.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", - metadata={}, ) assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: + async def test_method_update_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: script = await async_client.workers_for_platforms.dispatch.namespaces.scripts.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", + any_part_name=[b"raw file contents"], metadata={ "assets": { "config": { @@ -325,8 +396,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare } ], "body_part": "worker.js", - "compatibility_date": "2021-01-01", - "compatibility_flags": ["nodejs_compat"], + "compatibility_date": "2023-07-25", + "compatibility_flags": ["string"], "keep_assets": False, "keep_bindings": ["string"], "logpush": False, @@ -364,19 +435,94 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "namespace": "my-namespace", } ], - "usage_model": "standard", + "usage_model": "bundled", + "version_tags": {"foo": "string"}, }, ) assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( + script_name="this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + script = await response.parse() + assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_streaming_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers_for_platforms.dispatch.namespaces.scripts.with_streaming_response.update( + script_name="this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + script = await response.parse() + assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_path_params_update_overload_1(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( + script_name="this-is_my_script-01", + account_id="", + dispatch_namespace="my-dispatch-namespace", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dispatch_namespace` but received ''"): + await async_client.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( + script_name="this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): + await async_client.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( + script_name="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + ) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> None: + script = await async_client.workers_for_platforms.dispatch.namespaces.scripts.update( + script_name="this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + ) + assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: + script = await async_client.workers_for_platforms.dispatch.namespaces.scripts.update( + script_name="this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + message="message", + ) + assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: response = await async_client.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", - metadata={}, ) assert response.is_closed is True @@ -386,12 +532,11 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: async with async_client.workers_for_platforms.dispatch.namespaces.scripts.with_streaming_response.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", - metadata={}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -403,13 +548,12 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( script_name="this-is_my_script-01", account_id="", dispatch_namespace="my-dispatch-namespace", - metadata={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dispatch_namespace` but received ''"): @@ -417,7 +561,6 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="", - metadata={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): @@ -425,7 +568,6 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: script_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", - metadata={}, ) @parametrize diff --git a/tests/api_resources/zero_trust/access/infrastructure/test_targets.py b/tests/api_resources/zero_trust/access/infrastructure/test_targets.py index 263003e2c00..6d6fec64674 100644 --- a/tests/api_resources/zero_trust/access/infrastructure/test_targets.py +++ b/tests/api_resources/zero_trust/access/infrastructure/test_targets.py @@ -178,16 +178,11 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: target = client.zero_trust.access.infrastructure.targets.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", created_after=parse_datetime("2019-12-27T18:11:19.117Z"), - created_before=parse_datetime("2019-12-27T18:11:19.117Z"), - direction="asc", hostname="hostname", hostname_contains="hostname_contains", ip_v4="ip_v4", ip_v6="ip_v6", - ips=["string"], modified_after=parse_datetime("2019-12-27T18:11:19.117Z"), - modified_before=parse_datetime("2019-12-27T18:11:19.117Z"), - order="hostname", page=1, per_page=1, virtual_network_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", @@ -578,16 +573,11 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) target = await async_client.zero_trust.access.infrastructure.targets.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", created_after=parse_datetime("2019-12-27T18:11:19.117Z"), - created_before=parse_datetime("2019-12-27T18:11:19.117Z"), - direction="asc", hostname="hostname", hostname_contains="hostname_contains", ip_v4="ip_v4", ip_v6="ip_v6", - ips=["string"], modified_after=parse_datetime("2019-12-27T18:11:19.117Z"), - modified_before=parse_datetime("2019-12-27T18:11:19.117Z"), - order="hostname", page=1, per_page=1, virtual_network_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", diff --git a/tests/api_resources/zero_trust/access/test_applications.py b/tests/api_resources/zero_trust/access/test_applications.py index 3b041b0653f..17ca2921b84 100644 --- a/tests/api_resources/zero_trust/access/test_applications.py +++ b/tests/api_resources/zero_trust/access/test_applications.py @@ -69,28 +69,16 @@ def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> N "uri": "test.anotherexample.com/staff", }, { - "cidr": "10.5.0.0/24", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80-90", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.2", }, { - "cidr": "10.5.0.3/32", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.3/32:1234-4321", }, { - "cidr": "cidr", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "port_range", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "private-sni.example.com", }, ], enable_binding_cookie=True, @@ -352,28 +340,16 @@ def test_method_create_with_all_params_overload_3(self, client: Cloudflare) -> N "uri": "test.anotherexample.com/staff", }, { - "cidr": "10.5.0.0/24", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80-90", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.2", }, { - "cidr": "10.5.0.3/32", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.3/32:1234-4321", }, { - "cidr": "cidr", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "port_range", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "private-sni.example.com", }, ], enable_binding_cookie=True, @@ -514,28 +490,16 @@ def test_method_create_with_all_params_overload_4(self, client: Cloudflare) -> N "uri": "test.anotherexample.com/staff", }, { - "cidr": "10.5.0.0/24", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80-90", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.2", }, { - "cidr": "10.5.0.3/32", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.3/32:1234-4321", }, { - "cidr": "cidr", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "port_range", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "private-sni.example.com", }, ], enable_binding_cookie=True, @@ -1219,28 +1183,16 @@ def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> N "uri": "test.anotherexample.com/staff", }, { - "cidr": "10.5.0.0/24", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80-90", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.2", }, { - "cidr": "10.5.0.3/32", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.3/32:1234-4321", }, { - "cidr": "cidr", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "port_range", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "private-sni.example.com", }, ], enable_binding_cookie=True, @@ -1528,28 +1480,16 @@ def test_method_update_with_all_params_overload_3(self, client: Cloudflare) -> N "uri": "test.anotherexample.com/staff", }, { - "cidr": "10.5.0.0/24", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80-90", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.2", }, { - "cidr": "10.5.0.3/32", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.3/32:1234-4321", }, { - "cidr": "cidr", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "port_range", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "private-sni.example.com", }, ], enable_binding_cookie=True, @@ -1704,28 +1644,16 @@ def test_method_update_with_all_params_overload_4(self, client: Cloudflare) -> N "uri": "test.anotherexample.com/staff", }, { - "cidr": "10.5.0.0/24", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80-90", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.2", }, { - "cidr": "10.5.0.3/32", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.3/32:1234-4321", }, { - "cidr": "cidr", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "port_range", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "private-sni.example.com", }, ], enable_binding_cookie=True, @@ -2754,28 +2682,16 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn "uri": "test.anotherexample.com/staff", }, { - "cidr": "10.5.0.0/24", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80-90", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.2", }, { - "cidr": "10.5.0.3/32", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.3/32:1234-4321", }, { - "cidr": "cidr", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "port_range", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "private-sni.example.com", }, ], enable_binding_cookie=True, @@ -3037,28 +2953,16 @@ async def test_method_create_with_all_params_overload_3(self, async_client: Asyn "uri": "test.anotherexample.com/staff", }, { - "cidr": "10.5.0.0/24", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80-90", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.2", }, { - "cidr": "10.5.0.3/32", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.3/32:1234-4321", }, { - "cidr": "cidr", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "port_range", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "private-sni.example.com", }, ], enable_binding_cookie=True, @@ -3199,28 +3103,16 @@ async def test_method_create_with_all_params_overload_4(self, async_client: Asyn "uri": "test.anotherexample.com/staff", }, { - "cidr": "10.5.0.0/24", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80-90", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.2", }, { - "cidr": "10.5.0.3/32", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.3/32:1234-4321", }, { - "cidr": "cidr", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "port_range", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "private-sni.example.com", }, ], enable_binding_cookie=True, @@ -3904,28 +3796,16 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn "uri": "test.anotherexample.com/staff", }, { - "cidr": "10.5.0.0/24", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80-90", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.2", }, { - "cidr": "10.5.0.3/32", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.3/32:1234-4321", }, { - "cidr": "cidr", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "port_range", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "private-sni.example.com", }, ], enable_binding_cookie=True, @@ -4213,28 +4093,16 @@ async def test_method_update_with_all_params_overload_3(self, async_client: Asyn "uri": "test.anotherexample.com/staff", }, { - "cidr": "10.5.0.0/24", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80-90", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.2", }, { - "cidr": "10.5.0.3/32", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.3/32:1234-4321", }, { - "cidr": "cidr", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "port_range", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "private-sni.example.com", }, ], enable_binding_cookie=True, @@ -4389,28 +4257,16 @@ async def test_method_update_with_all_params_overload_4(self, async_client: Asyn "uri": "test.anotherexample.com/staff", }, { - "cidr": "10.5.0.0/24", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80-90", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.2", }, { - "cidr": "10.5.0.3/32", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "10.5.0.3/32:1234-4321", }, { - "cidr": "cidr", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "port_range", - "type": "private", - "vnet_id": "vnet_id", + "type": "public", + "uri": "private-sni.example.com", }, ], enable_binding_cookie=True, diff --git a/tests/api_resources/zero_trust/access/test_gateway_ca.py b/tests/api_resources/zero_trust/access/test_gateway_ca.py deleted file mode 100644 index 723be698029..00000000000 --- a/tests/api_resources/zero_trust/access/test_gateway_ca.py +++ /dev/null @@ -1,271 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, Optional, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.zero_trust.access import GatewayCAListResponse, GatewayCACreateResponse, GatewayCADeleteResponse - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestGatewayCA: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_create(self, client: Cloudflare) -> None: - gateway_ca = client.zero_trust.access.gateway_ca.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[GatewayCACreateResponse], gateway_ca, path=["response"]) - - @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.zero_trust.access.gateway_ca.with_raw_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - gateway_ca = response.parse() - assert_matches_type(Optional[GatewayCACreateResponse], gateway_ca, path=["response"]) - - @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.zero_trust.access.gateway_ca.with_streaming_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - gateway_ca = response.parse() - assert_matches_type(Optional[GatewayCACreateResponse], gateway_ca, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.access.gateway_ca.with_raw_response.create( - account_id="", - ) - - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - gateway_ca = client.zero_trust.access.gateway_ca.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(SyncSinglePage[GatewayCAListResponse], gateway_ca, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.zero_trust.access.gateway_ca.with_raw_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - gateway_ca = response.parse() - assert_matches_type(SyncSinglePage[GatewayCAListResponse], gateway_ca, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.zero_trust.access.gateway_ca.with_streaming_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - gateway_ca = response.parse() - assert_matches_type(SyncSinglePage[GatewayCAListResponse], gateway_ca, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.access.gateway_ca.with_raw_response.list( - account_id="", - ) - - @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - gateway_ca = client.zero_trust.access.gateway_ca.delete( - certificate_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[GatewayCADeleteResponse], gateway_ca, path=["response"]) - - @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.zero_trust.access.gateway_ca.with_raw_response.delete( - certificate_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - gateway_ca = response.parse() - assert_matches_type(Optional[GatewayCADeleteResponse], gateway_ca, path=["response"]) - - @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.zero_trust.access.gateway_ca.with_streaming_response.delete( - certificate_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - gateway_ca = response.parse() - assert_matches_type(Optional[GatewayCADeleteResponse], gateway_ca, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.access.gateway_ca.with_raw_response.delete( - certificate_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `certificate_id` but received ''"): - client.zero_trust.access.gateway_ca.with_raw_response.delete( - certificate_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - -class TestAsyncGatewayCA: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: - gateway_ca = await async_client.zero_trust.access.gateway_ca.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[GatewayCACreateResponse], gateway_ca, path=["response"]) - - @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.access.gateway_ca.with_raw_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - gateway_ca = await response.parse() - assert_matches_type(Optional[GatewayCACreateResponse], gateway_ca, path=["response"]) - - @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.access.gateway_ca.with_streaming_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - gateway_ca = await response.parse() - assert_matches_type(Optional[GatewayCACreateResponse], gateway_ca, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.access.gateway_ca.with_raw_response.create( - account_id="", - ) - - @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - gateway_ca = await async_client.zero_trust.access.gateway_ca.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(AsyncSinglePage[GatewayCAListResponse], gateway_ca, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.access.gateway_ca.with_raw_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - gateway_ca = await response.parse() - assert_matches_type(AsyncSinglePage[GatewayCAListResponse], gateway_ca, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.access.gateway_ca.with_streaming_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - gateway_ca = await response.parse() - assert_matches_type(AsyncSinglePage[GatewayCAListResponse], gateway_ca, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.access.gateway_ca.with_raw_response.list( - account_id="", - ) - - @parametrize - async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - gateway_ca = await async_client.zero_trust.access.gateway_ca.delete( - certificate_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[GatewayCADeleteResponse], gateway_ca, path=["response"]) - - @parametrize - async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.access.gateway_ca.with_raw_response.delete( - certificate_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - gateway_ca = await response.parse() - assert_matches_type(Optional[GatewayCADeleteResponse], gateway_ca, path=["response"]) - - @parametrize - async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.access.gateway_ca.with_streaming_response.delete( - certificate_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - gateway_ca = await response.parse() - assert_matches_type(Optional[GatewayCADeleteResponse], gateway_ca, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.access.gateway_ca.with_raw_response.delete( - certificate_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `certificate_id` but received ''"): - await async_client.zero_trust.access.gateway_ca.with_raw_response.delete( - certificate_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) diff --git a/tests/api_resources/zero_trust/devices/policies/default/test_certificates.py b/tests/api_resources/zero_trust/devices/policies/default/test_certificates.py index b94cf6d8191..f616978a857 100644 --- a/tests/api_resources/zero_trust/devices/policies/default/test_certificates.py +++ b/tests/api_resources/zero_trust/devices/policies/default/test_certificates.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest @@ -26,7 +26,7 @@ def test_method_edit(self, client: Cloudflare) -> None: zone_id="699d98642c564d2e855e9661899b7252", enabled=True, ) - assert_matches_type(Optional[CertificateEditResponse], certificate, path=["response"]) + assert_matches_type(CertificateEditResponse, certificate, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: @@ -38,7 +38,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = response.parse() - assert_matches_type(Optional[CertificateEditResponse], certificate, path=["response"]) + assert_matches_type(CertificateEditResponse, certificate, path=["response"]) @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: @@ -50,7 +50,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = response.parse() - assert_matches_type(Optional[CertificateEditResponse], certificate, path=["response"]) + assert_matches_type(CertificateEditResponse, certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -67,7 +67,7 @@ def test_method_get(self, client: Cloudflare) -> None: certificate = client.zero_trust.devices.policies.default.certificates.get( zone_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[CertificateGetResponse], certificate, path=["response"]) + assert_matches_type(CertificateGetResponse, certificate, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -78,7 +78,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = response.parse() - assert_matches_type(Optional[CertificateGetResponse], certificate, path=["response"]) + assert_matches_type(CertificateGetResponse, certificate, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -89,7 +89,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = response.parse() - assert_matches_type(Optional[CertificateGetResponse], certificate, path=["response"]) + assert_matches_type(CertificateGetResponse, certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -110,7 +110,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: zone_id="699d98642c564d2e855e9661899b7252", enabled=True, ) - assert_matches_type(Optional[CertificateEditResponse], certificate, path=["response"]) + assert_matches_type(CertificateEditResponse, certificate, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -122,7 +122,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = await response.parse() - assert_matches_type(Optional[CertificateEditResponse], certificate, path=["response"]) + assert_matches_type(CertificateEditResponse, certificate, path=["response"]) @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -134,7 +134,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = await response.parse() - assert_matches_type(Optional[CertificateEditResponse], certificate, path=["response"]) + assert_matches_type(CertificateEditResponse, certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -151,7 +151,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: certificate = await async_client.zero_trust.devices.policies.default.certificates.get( zone_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[CertificateGetResponse], certificate, path=["response"]) + assert_matches_type(CertificateGetResponse, certificate, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -162,7 +162,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = await response.parse() - assert_matches_type(Optional[CertificateGetResponse], certificate, path=["response"]) + assert_matches_type(CertificateGetResponse, certificate, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -173,7 +173,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = await response.parse() - assert_matches_type(Optional[CertificateGetResponse], certificate, path=["response"]) + assert_matches_type(CertificateGetResponse, certificate, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/devices/posture/test_integrations.py b/tests/api_resources/zero_trust/devices/posture/test_integrations.py index 35efacf4282..6ad1c0fabd0 100644 --- a/tests/api_resources/zero_trust/devices/posture/test_integrations.py +++ b/tests/api_resources/zero_trust/devices/posture/test_integrations.py @@ -155,7 +155,7 @@ def test_method_delete(self, client: Cloudflare) -> None: integration_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[IntegrationDeleteResponse], integration, path=["response"]) + assert_matches_type(IntegrationDeleteResponse, integration, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -167,7 +167,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" integration = response.parse() - assert_matches_type(Optional[IntegrationDeleteResponse], integration, path=["response"]) + assert_matches_type(IntegrationDeleteResponse, integration, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -179,7 +179,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" integration = response.parse() - assert_matches_type(Optional[IntegrationDeleteResponse], integration, path=["response"]) + assert_matches_type(IntegrationDeleteResponse, integration, path=["response"]) assert cast(Any, response.is_closed) is True @@ -448,7 +448,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: integration_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[IntegrationDeleteResponse], integration, path=["response"]) + assert_matches_type(IntegrationDeleteResponse, integration, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -460,7 +460,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" integration = await response.parse() - assert_matches_type(Optional[IntegrationDeleteResponse], integration, path=["response"]) + assert_matches_type(IntegrationDeleteResponse, integration, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -472,7 +472,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" integration = await response.parse() - assert_matches_type(Optional[IntegrationDeleteResponse], integration, path=["response"]) + assert_matches_type(IntegrationDeleteResponse, integration, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/devices/test_revoke.py b/tests/api_resources/zero_trust/devices/test_revoke.py index d093db0d2e7..abfc42857d4 100644 --- a/tests/api_resources/zero_trust/devices/test_revoke.py +++ b/tests/api_resources/zero_trust/devices/test_revoke.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest @@ -23,7 +23,7 @@ def test_method_create(self, client: Cloudflare) -> None: account_id="699d98642c564d2e855e9661899b7252", body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], ) - assert_matches_type(Optional[RevokeCreateResponse], revoke, path=["response"]) + assert_matches_type(RevokeCreateResponse, revoke, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -35,7 +35,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" revoke = response.parse() - assert_matches_type(Optional[RevokeCreateResponse], revoke, path=["response"]) + assert_matches_type(RevokeCreateResponse, revoke, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -47,7 +47,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" revoke = response.parse() - assert_matches_type(Optional[RevokeCreateResponse], revoke, path=["response"]) + assert_matches_type(RevokeCreateResponse, revoke, path=["response"]) assert cast(Any, response.is_closed) is True @@ -69,7 +69,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: account_id="699d98642c564d2e855e9661899b7252", body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], ) - assert_matches_type(Optional[RevokeCreateResponse], revoke, path=["response"]) + assert_matches_type(RevokeCreateResponse, revoke, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -81,7 +81,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" revoke = await response.parse() - assert_matches_type(Optional[RevokeCreateResponse], revoke, path=["response"]) + assert_matches_type(RevokeCreateResponse, revoke, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -93,7 +93,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" revoke = await response.parse() - assert_matches_type(Optional[RevokeCreateResponse], revoke, path=["response"]) + assert_matches_type(RevokeCreateResponse, revoke, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/devices/test_unrevoke.py b/tests/api_resources/zero_trust/devices/test_unrevoke.py index 9196cb931f8..1c0bc2acdf5 100644 --- a/tests/api_resources/zero_trust/devices/test_unrevoke.py +++ b/tests/api_resources/zero_trust/devices/test_unrevoke.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest @@ -23,7 +23,7 @@ def test_method_create(self, client: Cloudflare) -> None: account_id="699d98642c564d2e855e9661899b7252", body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], ) - assert_matches_type(Optional[UnrevokeCreateResponse], unrevoke, path=["response"]) + assert_matches_type(UnrevokeCreateResponse, unrevoke, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -35,7 +35,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" unrevoke = response.parse() - assert_matches_type(Optional[UnrevokeCreateResponse], unrevoke, path=["response"]) + assert_matches_type(UnrevokeCreateResponse, unrevoke, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -47,7 +47,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" unrevoke = response.parse() - assert_matches_type(Optional[UnrevokeCreateResponse], unrevoke, path=["response"]) + assert_matches_type(UnrevokeCreateResponse, unrevoke, path=["response"]) assert cast(Any, response.is_closed) is True @@ -69,7 +69,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: account_id="699d98642c564d2e855e9661899b7252", body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], ) - assert_matches_type(Optional[UnrevokeCreateResponse], unrevoke, path=["response"]) + assert_matches_type(UnrevokeCreateResponse, unrevoke, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -81,7 +81,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" unrevoke = await response.parse() - assert_matches_type(Optional[UnrevokeCreateResponse], unrevoke, path=["response"]) + assert_matches_type(UnrevokeCreateResponse, unrevoke, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -93,7 +93,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" unrevoke = await response.parse() - assert_matches_type(Optional[UnrevokeCreateResponse], unrevoke, path=["response"]) + assert_matches_type(UnrevokeCreateResponse, unrevoke, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/dex/commands/test_devices.py b/tests/api_resources/zero_trust/dex/commands/test_devices.py deleted file mode 100644 index be6707c9e2a..00000000000 --- a/tests/api_resources/zero_trust/dex/commands/test_devices.py +++ /dev/null @@ -1,135 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, Optional, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.pagination import SyncV4PagePagination, AsyncV4PagePagination -from cloudflare.types.zero_trust.dex.commands import DeviceListResponse - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestDevices: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - device = client.zero_trust.dex.commands.devices.list( - account_id="01a7362d577a6c3019a474fd6f485823", - page=1, - per_page=1, - ) - assert_matches_type(SyncV4PagePagination[Optional[DeviceListResponse]], device, path=["response"]) - - @parametrize - def test_method_list_with_all_params(self, client: Cloudflare) -> None: - device = client.zero_trust.dex.commands.devices.list( - account_id="01a7362d577a6c3019a474fd6f485823", - page=1, - per_page=1, - search="search", - ) - assert_matches_type(SyncV4PagePagination[Optional[DeviceListResponse]], device, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.zero_trust.dex.commands.devices.with_raw_response.list( - account_id="01a7362d577a6c3019a474fd6f485823", - page=1, - per_page=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - device = response.parse() - assert_matches_type(SyncV4PagePagination[Optional[DeviceListResponse]], device, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.zero_trust.dex.commands.devices.with_streaming_response.list( - account_id="01a7362d577a6c3019a474fd6f485823", - page=1, - per_page=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - device = response.parse() - assert_matches_type(SyncV4PagePagination[Optional[DeviceListResponse]], device, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.dex.commands.devices.with_raw_response.list( - account_id="", - page=1, - per_page=1, - ) - - -class TestAsyncDevices: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - device = await async_client.zero_trust.dex.commands.devices.list( - account_id="01a7362d577a6c3019a474fd6f485823", - page=1, - per_page=1, - ) - assert_matches_type(AsyncV4PagePagination[Optional[DeviceListResponse]], device, path=["response"]) - - @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: - device = await async_client.zero_trust.dex.commands.devices.list( - account_id="01a7362d577a6c3019a474fd6f485823", - page=1, - per_page=1, - search="search", - ) - assert_matches_type(AsyncV4PagePagination[Optional[DeviceListResponse]], device, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.dex.commands.devices.with_raw_response.list( - account_id="01a7362d577a6c3019a474fd6f485823", - page=1, - per_page=1, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - device = await response.parse() - assert_matches_type(AsyncV4PagePagination[Optional[DeviceListResponse]], device, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.dex.commands.devices.with_streaming_response.list( - account_id="01a7362d577a6c3019a474fd6f485823", - page=1, - per_page=1, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - device = await response.parse() - assert_matches_type(AsyncV4PagePagination[Optional[DeviceListResponse]], device, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.dex.commands.devices.with_raw_response.list( - account_id="", - page=1, - per_page=1, - ) diff --git a/tests/api_resources/zero_trust/dex/commands/test_downloads.py b/tests/api_resources/zero_trust/dex/commands/test_downloads.py index 66711dbdd5a..b2a9133f988 100644 --- a/tests/api_resources/zero_trust/dex/commands/test_downloads.py +++ b/tests/api_resources/zero_trust/dex/commands/test_downloads.py @@ -27,7 +27,7 @@ class TestDownloads: @pytest.mark.respx(base_url=base_url) def test_method_get(self, client: Cloudflare, respx_mock: MockRouter) -> None: respx_mock.get( - "/accounts/01a7362d577a6c3019a474fd6f485823/dex/commands/5758fefe-ae7e-4538-a39b-1fef6abcb909/downloads/filename" + "/accounts/01a7362d577a6c3019a474fd6f485823/commands/5758fefe-ae7e-4538-a39b-1fef6abcb909/downloads/filename" ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) download = client.zero_trust.dex.commands.downloads.get( filename="filename", @@ -43,7 +43,7 @@ def test_method_get(self, client: Cloudflare, respx_mock: MockRouter) -> None: @pytest.mark.respx(base_url=base_url) def test_raw_response_get(self, client: Cloudflare, respx_mock: MockRouter) -> None: respx_mock.get( - "/accounts/01a7362d577a6c3019a474fd6f485823/dex/commands/5758fefe-ae7e-4538-a39b-1fef6abcb909/downloads/filename" + "/accounts/01a7362d577a6c3019a474fd6f485823/commands/5758fefe-ae7e-4538-a39b-1fef6abcb909/downloads/filename" ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) download = client.zero_trust.dex.commands.downloads.with_raw_response.get( @@ -61,7 +61,7 @@ def test_raw_response_get(self, client: Cloudflare, respx_mock: MockRouter) -> N @pytest.mark.respx(base_url=base_url) def test_streaming_response_get(self, client: Cloudflare, respx_mock: MockRouter) -> None: respx_mock.get( - "/accounts/01a7362d577a6c3019a474fd6f485823/dex/commands/5758fefe-ae7e-4538-a39b-1fef6abcb909/downloads/filename" + "/accounts/01a7362d577a6c3019a474fd6f485823/commands/5758fefe-ae7e-4538-a39b-1fef6abcb909/downloads/filename" ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) with client.zero_trust.dex.commands.downloads.with_streaming_response.get( filename="filename", @@ -109,7 +109,7 @@ class TestAsyncDownloads: @pytest.mark.respx(base_url=base_url) async def test_method_get(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None: respx_mock.get( - "/accounts/01a7362d577a6c3019a474fd6f485823/dex/commands/5758fefe-ae7e-4538-a39b-1fef6abcb909/downloads/filename" + "/accounts/01a7362d577a6c3019a474fd6f485823/commands/5758fefe-ae7e-4538-a39b-1fef6abcb909/downloads/filename" ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) download = await async_client.zero_trust.dex.commands.downloads.get( filename="filename", @@ -125,7 +125,7 @@ async def test_method_get(self, async_client: AsyncCloudflare, respx_mock: MockR @pytest.mark.respx(base_url=base_url) async def test_raw_response_get(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None: respx_mock.get( - "/accounts/01a7362d577a6c3019a474fd6f485823/dex/commands/5758fefe-ae7e-4538-a39b-1fef6abcb909/downloads/filename" + "/accounts/01a7362d577a6c3019a474fd6f485823/commands/5758fefe-ae7e-4538-a39b-1fef6abcb909/downloads/filename" ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) download = await async_client.zero_trust.dex.commands.downloads.with_raw_response.get( @@ -143,7 +143,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare, respx_mock: @pytest.mark.respx(base_url=base_url) async def test_streaming_response_get(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None: respx_mock.get( - "/accounts/01a7362d577a6c3019a474fd6f485823/dex/commands/5758fefe-ae7e-4538-a39b-1fef6abcb909/downloads/filename" + "/accounts/01a7362d577a6c3019a474fd6f485823/commands/5758fefe-ae7e-4538-a39b-1fef6abcb909/downloads/filename" ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) async with async_client.zero_trust.dex.commands.downloads.with_streaming_response.get( filename="filename", diff --git a/tests/api_resources/zero_trust/dex/commands/test_users.py b/tests/api_resources/zero_trust/dex/commands/test_users.py deleted file mode 100644 index 0f8b674a2d6..00000000000 --- a/tests/api_resources/zero_trust/dex/commands/test_users.py +++ /dev/null @@ -1,114 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, Optional, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.types.zero_trust.dex.commands import UserListResponse - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestUsers: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - user = client.zero_trust.dex.commands.users.list( - account_id="01a7362d577a6c3019a474fd6f485823", - ) - assert_matches_type(Optional[UserListResponse], user, path=["response"]) - - @parametrize - def test_method_list_with_all_params(self, client: Cloudflare) -> None: - user = client.zero_trust.dex.commands.users.list( - account_id="01a7362d577a6c3019a474fd6f485823", - search="search", - ) - assert_matches_type(Optional[UserListResponse], user, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.zero_trust.dex.commands.users.with_raw_response.list( - account_id="01a7362d577a6c3019a474fd6f485823", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - user = response.parse() - assert_matches_type(Optional[UserListResponse], user, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.zero_trust.dex.commands.users.with_streaming_response.list( - account_id="01a7362d577a6c3019a474fd6f485823", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - user = response.parse() - assert_matches_type(Optional[UserListResponse], user, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.dex.commands.users.with_raw_response.list( - account_id="", - ) - - -class TestAsyncUsers: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - user = await async_client.zero_trust.dex.commands.users.list( - account_id="01a7362d577a6c3019a474fd6f485823", - ) - assert_matches_type(Optional[UserListResponse], user, path=["response"]) - - @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: - user = await async_client.zero_trust.dex.commands.users.list( - account_id="01a7362d577a6c3019a474fd6f485823", - search="search", - ) - assert_matches_type(Optional[UserListResponse], user, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.dex.commands.users.with_raw_response.list( - account_id="01a7362d577a6c3019a474fd6f485823", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - user = await response.parse() - assert_matches_type(Optional[UserListResponse], user, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.dex.commands.users.with_streaming_response.list( - account_id="01a7362d577a6c3019a474fd6f485823", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - user = await response.parse() - assert_matches_type(Optional[UserListResponse], user, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.dex.commands.users.with_raw_response.list( - account_id="", - ) diff --git a/tests/api_resources/zero_trust/dlp/datasets/test_versions.py b/tests/api_resources/zero_trust/dlp/datasets/test_versions.py index c37528d256f..423c366940d 100755 --- a/tests/api_resources/zero_trust/dlp/datasets/test_versions.py +++ b/tests/api_resources/zero_trust/dlp/datasets/test_versions.py @@ -17,7 +17,6 @@ class TestVersions: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_method_create(self, client: Cloudflare) -> None: version = client.zero_trust.dlp.datasets.versions.create( @@ -28,7 +27,6 @@ def test_method_create(self, client: Cloudflare) -> None: ) assert_matches_type(Optional[VersionCreateResponse], version, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: response = client.zero_trust.dlp.datasets.versions.with_raw_response.create( @@ -43,7 +41,6 @@ def test_raw_response_create(self, client: Cloudflare) -> None: version = response.parse() assert_matches_type(Optional[VersionCreateResponse], version, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: with client.zero_trust.dlp.datasets.versions.with_streaming_response.create( @@ -60,7 +57,6 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -83,7 +79,6 @@ def test_path_params_create(self, client: Cloudflare) -> None: class TestAsyncVersions: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: version = await async_client.zero_trust.dlp.datasets.versions.create( @@ -94,7 +89,6 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: ) assert_matches_type(Optional[VersionCreateResponse], version, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.dlp.datasets.versions.with_raw_response.create( @@ -109,7 +103,6 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: version = await response.parse() assert_matches_type(Optional[VersionCreateResponse], version, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.dlp.datasets.versions.with_streaming_response.create( @@ -126,7 +119,6 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): diff --git a/tests/api_resources/zero_trust/dlp/email/test_account_mapping.py b/tests/api_resources/zero_trust/dlp/email/test_account_mapping.py deleted file mode 100644 index 8c0e9f1aaad..00000000000 --- a/tests/api_resources/zero_trust/dlp/email/test_account_mapping.py +++ /dev/null @@ -1,225 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, Optional, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.types.zero_trust.dlp.email import ( - AccountMappingGetResponse, - AccountMappingCreateResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestAccountMapping: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - def test_method_create(self, client: Cloudflare) -> None: - account_mapping = client.zero_trust.dlp.email.account_mapping.create( - account_id="account_id", - auth_requirements={ - "allowed_microsoft_organizations": ["string"], - "type": "Org", - }, - ) - assert_matches_type(Optional[AccountMappingCreateResponse], account_mapping, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.zero_trust.dlp.email.account_mapping.with_raw_response.create( - account_id="account_id", - auth_requirements={ - "allowed_microsoft_organizations": ["string"], - "type": "Org", - }, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - account_mapping = response.parse() - assert_matches_type(Optional[AccountMappingCreateResponse], account_mapping, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.zero_trust.dlp.email.account_mapping.with_streaming_response.create( - account_id="account_id", - auth_requirements={ - "allowed_microsoft_organizations": ["string"], - "type": "Org", - }, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - account_mapping = response.parse() - assert_matches_type(Optional[AccountMappingCreateResponse], account_mapping, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.dlp.email.account_mapping.with_raw_response.create( - account_id="", - auth_requirements={ - "allowed_microsoft_organizations": ["string"], - "type": "Org", - }, - ) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - def test_method_get(self, client: Cloudflare) -> None: - account_mapping = client.zero_trust.dlp.email.account_mapping.get( - account_id="account_id", - ) - assert_matches_type(Optional[AccountMappingGetResponse], account_mapping, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.zero_trust.dlp.email.account_mapping.with_raw_response.get( - account_id="account_id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - account_mapping = response.parse() - assert_matches_type(Optional[AccountMappingGetResponse], account_mapping, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.zero_trust.dlp.email.account_mapping.with_streaming_response.get( - account_id="account_id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - account_mapping = response.parse() - assert_matches_type(Optional[AccountMappingGetResponse], account_mapping, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.dlp.email.account_mapping.with_raw_response.get( - account_id="", - ) - - -class TestAsyncAccountMapping: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: - account_mapping = await async_client.zero_trust.dlp.email.account_mapping.create( - account_id="account_id", - auth_requirements={ - "allowed_microsoft_organizations": ["string"], - "type": "Org", - }, - ) - assert_matches_type(Optional[AccountMappingCreateResponse], account_mapping, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.dlp.email.account_mapping.with_raw_response.create( - account_id="account_id", - auth_requirements={ - "allowed_microsoft_organizations": ["string"], - "type": "Org", - }, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - account_mapping = await response.parse() - assert_matches_type(Optional[AccountMappingCreateResponse], account_mapping, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.dlp.email.account_mapping.with_streaming_response.create( - account_id="account_id", - auth_requirements={ - "allowed_microsoft_organizations": ["string"], - "type": "Org", - }, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - account_mapping = await response.parse() - assert_matches_type(Optional[AccountMappingCreateResponse], account_mapping, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.dlp.email.account_mapping.with_raw_response.create( - account_id="", - auth_requirements={ - "allowed_microsoft_organizations": ["string"], - "type": "Org", - }, - ) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - account_mapping = await async_client.zero_trust.dlp.email.account_mapping.get( - account_id="account_id", - ) - assert_matches_type(Optional[AccountMappingGetResponse], account_mapping, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.dlp.email.account_mapping.with_raw_response.get( - account_id="account_id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - account_mapping = await response.parse() - assert_matches_type(Optional[AccountMappingGetResponse], account_mapping, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.dlp.email.account_mapping.with_streaming_response.get( - account_id="account_id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - account_mapping = await response.parse() - assert_matches_type(Optional[AccountMappingGetResponse], account_mapping, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.dlp.email.account_mapping.with_raw_response.get( - account_id="", - ) diff --git a/tests/api_resources/zero_trust/dlp/email/test_rules.py b/tests/api_resources/zero_trust/dlp/email/test_rules.py deleted file mode 100644 index f64c4040aa6..00000000000 --- a/tests/api_resources/zero_trust/dlp/email/test_rules.py +++ /dev/null @@ -1,820 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, Optional, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.zero_trust.dlp.email import ( - RuleGetResponse, - RuleListResponse, - RuleCreateResponse, - RuleDeleteResponse, - RuleUpdateResponse, - RuleBulkEditResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestRules: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_create(self, client: Cloudflare) -> None: - rule = client.zero_trust.dlp.email.rules.create( - account_id="account_id", - action={"action": "Block"}, - conditions=[ - { - "operator": "InList", - "selector": "Recipients", - "value": {}, - } - ], - enabled=True, - name="name", - ) - assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) - - @parametrize - def test_method_create_with_all_params(self, client: Cloudflare) -> None: - rule = client.zero_trust.dlp.email.rules.create( - account_id="account_id", - action={ - "action": "Block", - "message": "message", - }, - conditions=[ - { - "operator": "InList", - "selector": "Recipients", - "value": {}, - } - ], - enabled=True, - name="name", - description="description", - ) - assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) - - @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.zero_trust.dlp.email.rules.with_raw_response.create( - account_id="account_id", - action={"action": "Block"}, - conditions=[ - { - "operator": "InList", - "selector": "Recipients", - "value": {}, - } - ], - enabled=True, - name="name", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - rule = response.parse() - assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) - - @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.zero_trust.dlp.email.rules.with_streaming_response.create( - account_id="account_id", - action={"action": "Block"}, - conditions=[ - { - "operator": "InList", - "selector": "Recipients", - "value": {}, - } - ], - enabled=True, - name="name", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - rule = response.parse() - assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.dlp.email.rules.with_raw_response.create( - account_id="", - action={"action": "Block"}, - conditions=[ - { - "operator": "InList", - "selector": "Recipients", - "value": {}, - } - ], - enabled=True, - name="name", - ) - - @parametrize - def test_method_update(self, client: Cloudflare) -> None: - rule = client.zero_trust.dlp.email.rules.update( - rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", - action={"action": "Block"}, - conditions=[ - { - "operator": "InList", - "selector": "Recipients", - "value": {}, - } - ], - enabled=True, - name="name", - ) - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) - - @parametrize - def test_method_update_with_all_params(self, client: Cloudflare) -> None: - rule = client.zero_trust.dlp.email.rules.update( - rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", - action={ - "action": "Block", - "message": "message", - }, - conditions=[ - { - "operator": "InList", - "selector": "Recipients", - "value": {}, - } - ], - enabled=True, - name="name", - description="description", - ) - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) - - @parametrize - def test_raw_response_update(self, client: Cloudflare) -> None: - response = client.zero_trust.dlp.email.rules.with_raw_response.update( - rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", - action={"action": "Block"}, - conditions=[ - { - "operator": "InList", - "selector": "Recipients", - "value": {}, - } - ], - enabled=True, - name="name", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - rule = response.parse() - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) - - @parametrize - def test_streaming_response_update(self, client: Cloudflare) -> None: - with client.zero_trust.dlp.email.rules.with_streaming_response.update( - rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", - action={"action": "Block"}, - conditions=[ - { - "operator": "InList", - "selector": "Recipients", - "value": {}, - } - ], - enabled=True, - name="name", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - rule = response.parse() - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.dlp.email.rules.with_raw_response.update( - rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="", - action={"action": "Block"}, - conditions=[ - { - "operator": "InList", - "selector": "Recipients", - "value": {}, - } - ], - enabled=True, - name="name", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): - client.zero_trust.dlp.email.rules.with_raw_response.update( - rule_id="", - account_id="account_id", - action={"action": "Block"}, - conditions=[ - { - "operator": "InList", - "selector": "Recipients", - "value": {}, - } - ], - enabled=True, - name="name", - ) - - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - rule = client.zero_trust.dlp.email.rules.list( - account_id="account_id", - ) - assert_matches_type(SyncSinglePage[RuleListResponse], rule, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.zero_trust.dlp.email.rules.with_raw_response.list( - account_id="account_id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - rule = response.parse() - assert_matches_type(SyncSinglePage[RuleListResponse], rule, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.zero_trust.dlp.email.rules.with_streaming_response.list( - account_id="account_id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - rule = response.parse() - assert_matches_type(SyncSinglePage[RuleListResponse], rule, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.dlp.email.rules.with_raw_response.list( - account_id="", - ) - - @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - rule = client.zero_trust.dlp.email.rules.delete( - rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", - ) - assert_matches_type(Optional[RuleDeleteResponse], rule, path=["response"]) - - @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.zero_trust.dlp.email.rules.with_raw_response.delete( - rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - rule = response.parse() - assert_matches_type(Optional[RuleDeleteResponse], rule, path=["response"]) - - @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.zero_trust.dlp.email.rules.with_streaming_response.delete( - rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - rule = response.parse() - assert_matches_type(Optional[RuleDeleteResponse], rule, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.dlp.email.rules.with_raw_response.delete( - rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): - client.zero_trust.dlp.email.rules.with_raw_response.delete( - rule_id="", - account_id="account_id", - ) - - @parametrize - def test_method_bulk_edit(self, client: Cloudflare) -> None: - rule = client.zero_trust.dlp.email.rules.bulk_edit( - account_id="account_id", - new_priorities={"foo": 0}, - ) - assert_matches_type(Optional[RuleBulkEditResponse], rule, path=["response"]) - - @parametrize - def test_raw_response_bulk_edit(self, client: Cloudflare) -> None: - response = client.zero_trust.dlp.email.rules.with_raw_response.bulk_edit( - account_id="account_id", - new_priorities={"foo": 0}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - rule = response.parse() - assert_matches_type(Optional[RuleBulkEditResponse], rule, path=["response"]) - - @parametrize - def test_streaming_response_bulk_edit(self, client: Cloudflare) -> None: - with client.zero_trust.dlp.email.rules.with_streaming_response.bulk_edit( - account_id="account_id", - new_priorities={"foo": 0}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - rule = response.parse() - assert_matches_type(Optional[RuleBulkEditResponse], rule, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_bulk_edit(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.dlp.email.rules.with_raw_response.bulk_edit( - account_id="", - new_priorities={"foo": 0}, - ) - - @parametrize - def test_method_get(self, client: Cloudflare) -> None: - rule = client.zero_trust.dlp.email.rules.get( - rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", - ) - assert_matches_type(Optional[RuleGetResponse], rule, path=["response"]) - - @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.zero_trust.dlp.email.rules.with_raw_response.get( - rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - rule = response.parse() - assert_matches_type(Optional[RuleGetResponse], rule, path=["response"]) - - @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.zero_trust.dlp.email.rules.with_streaming_response.get( - rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - rule = response.parse() - assert_matches_type(Optional[RuleGetResponse], rule, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.dlp.email.rules.with_raw_response.get( - rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): - client.zero_trust.dlp.email.rules.with_raw_response.get( - rule_id="", - account_id="account_id", - ) - - -class TestAsyncRules: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: - rule = await async_client.zero_trust.dlp.email.rules.create( - account_id="account_id", - action={"action": "Block"}, - conditions=[ - { - "operator": "InList", - "selector": "Recipients", - "value": {}, - } - ], - enabled=True, - name="name", - ) - assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) - - @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: - rule = await async_client.zero_trust.dlp.email.rules.create( - account_id="account_id", - action={ - "action": "Block", - "message": "message", - }, - conditions=[ - { - "operator": "InList", - "selector": "Recipients", - "value": {}, - } - ], - enabled=True, - name="name", - description="description", - ) - assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) - - @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.dlp.email.rules.with_raw_response.create( - account_id="account_id", - action={"action": "Block"}, - conditions=[ - { - "operator": "InList", - "selector": "Recipients", - "value": {}, - } - ], - enabled=True, - name="name", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - rule = await response.parse() - assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) - - @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.dlp.email.rules.with_streaming_response.create( - account_id="account_id", - action={"action": "Block"}, - conditions=[ - { - "operator": "InList", - "selector": "Recipients", - "value": {}, - } - ], - enabled=True, - name="name", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - rule = await response.parse() - assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.dlp.email.rules.with_raw_response.create( - account_id="", - action={"action": "Block"}, - conditions=[ - { - "operator": "InList", - "selector": "Recipients", - "value": {}, - } - ], - enabled=True, - name="name", - ) - - @parametrize - async def test_method_update(self, async_client: AsyncCloudflare) -> None: - rule = await async_client.zero_trust.dlp.email.rules.update( - rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", - action={"action": "Block"}, - conditions=[ - { - "operator": "InList", - "selector": "Recipients", - "value": {}, - } - ], - enabled=True, - name="name", - ) - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) - - @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: - rule = await async_client.zero_trust.dlp.email.rules.update( - rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", - action={ - "action": "Block", - "message": "message", - }, - conditions=[ - { - "operator": "InList", - "selector": "Recipients", - "value": {}, - } - ], - enabled=True, - name="name", - description="description", - ) - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) - - @parametrize - async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.dlp.email.rules.with_raw_response.update( - rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", - action={"action": "Block"}, - conditions=[ - { - "operator": "InList", - "selector": "Recipients", - "value": {}, - } - ], - enabled=True, - name="name", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - rule = await response.parse() - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) - - @parametrize - async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.dlp.email.rules.with_streaming_response.update( - rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", - action={"action": "Block"}, - conditions=[ - { - "operator": "InList", - "selector": "Recipients", - "value": {}, - } - ], - enabled=True, - name="name", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - rule = await response.parse() - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.dlp.email.rules.with_raw_response.update( - rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="", - action={"action": "Block"}, - conditions=[ - { - "operator": "InList", - "selector": "Recipients", - "value": {}, - } - ], - enabled=True, - name="name", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): - await async_client.zero_trust.dlp.email.rules.with_raw_response.update( - rule_id="", - account_id="account_id", - action={"action": "Block"}, - conditions=[ - { - "operator": "InList", - "selector": "Recipients", - "value": {}, - } - ], - enabled=True, - name="name", - ) - - @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - rule = await async_client.zero_trust.dlp.email.rules.list( - account_id="account_id", - ) - assert_matches_type(AsyncSinglePage[RuleListResponse], rule, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.dlp.email.rules.with_raw_response.list( - account_id="account_id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - rule = await response.parse() - assert_matches_type(AsyncSinglePage[RuleListResponse], rule, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.dlp.email.rules.with_streaming_response.list( - account_id="account_id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - rule = await response.parse() - assert_matches_type(AsyncSinglePage[RuleListResponse], rule, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.dlp.email.rules.with_raw_response.list( - account_id="", - ) - - @parametrize - async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - rule = await async_client.zero_trust.dlp.email.rules.delete( - rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", - ) - assert_matches_type(Optional[RuleDeleteResponse], rule, path=["response"]) - - @parametrize - async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.dlp.email.rules.with_raw_response.delete( - rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - rule = await response.parse() - assert_matches_type(Optional[RuleDeleteResponse], rule, path=["response"]) - - @parametrize - async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.dlp.email.rules.with_streaming_response.delete( - rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - rule = await response.parse() - assert_matches_type(Optional[RuleDeleteResponse], rule, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.dlp.email.rules.with_raw_response.delete( - rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): - await async_client.zero_trust.dlp.email.rules.with_raw_response.delete( - rule_id="", - account_id="account_id", - ) - - @parametrize - async def test_method_bulk_edit(self, async_client: AsyncCloudflare) -> None: - rule = await async_client.zero_trust.dlp.email.rules.bulk_edit( - account_id="account_id", - new_priorities={"foo": 0}, - ) - assert_matches_type(Optional[RuleBulkEditResponse], rule, path=["response"]) - - @parametrize - async def test_raw_response_bulk_edit(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.dlp.email.rules.with_raw_response.bulk_edit( - account_id="account_id", - new_priorities={"foo": 0}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - rule = await response.parse() - assert_matches_type(Optional[RuleBulkEditResponse], rule, path=["response"]) - - @parametrize - async def test_streaming_response_bulk_edit(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.dlp.email.rules.with_streaming_response.bulk_edit( - account_id="account_id", - new_priorities={"foo": 0}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - rule = await response.parse() - assert_matches_type(Optional[RuleBulkEditResponse], rule, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_bulk_edit(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.dlp.email.rules.with_raw_response.bulk_edit( - account_id="", - new_priorities={"foo": 0}, - ) - - @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - rule = await async_client.zero_trust.dlp.email.rules.get( - rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", - ) - assert_matches_type(Optional[RuleGetResponse], rule, path=["response"]) - - @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.dlp.email.rules.with_raw_response.get( - rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - rule = await response.parse() - assert_matches_type(Optional[RuleGetResponse], rule, path=["response"]) - - @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.dlp.email.rules.with_streaming_response.get( - rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="account_id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - rule = await response.parse() - assert_matches_type(Optional[RuleGetResponse], rule, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.dlp.email.rules.with_raw_response.get( - rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): - await async_client.zero_trust.dlp.email.rules.with_raw_response.get( - rule_id="", - account_id="account_id", - ) diff --git a/tests/api_resources/zero_trust/dlp/test_entries.py b/tests/api_resources/zero_trust/dlp/test_entries.py index d0a651e7f92..cf41c61b9f9 100644 --- a/tests/api_resources/zero_trust/dlp/test_entries.py +++ b/tests/api_resources/zero_trust/dlp/test_entries.py @@ -91,7 +91,6 @@ def test_path_params_create(self, client: Cloudflare) -> None: profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_method_update_overload_1(self, client: Cloudflare) -> None: entry = client.zero_trust.dlp.entries.update( @@ -103,7 +102,6 @@ def test_method_update_overload_1(self, client: Cloudflare) -> None: ) assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> None: entry = client.zero_trust.dlp.entries.update( @@ -119,7 +117,6 @@ def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> N ) assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: response = client.zero_trust.dlp.entries.with_raw_response.update( @@ -135,7 +132,6 @@ def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: entry = response.parse() assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: with client.zero_trust.dlp.entries.with_streaming_response.update( @@ -153,7 +149,6 @@ def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_1(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -174,7 +169,6 @@ def test_path_params_update_overload_1(self, client: Cloudflare) -> None: type="custom", ) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_method_update_overload_2(self, client: Cloudflare) -> None: entry = client.zero_trust.dlp.entries.update( @@ -184,7 +178,6 @@ def test_method_update_overload_2(self, client: Cloudflare) -> None: ) assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> None: entry = client.zero_trust.dlp.entries.update( @@ -195,7 +188,6 @@ def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> N ) assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: response = client.zero_trust.dlp.entries.with_raw_response.update( @@ -209,7 +201,6 @@ def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: entry = response.parse() assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: with client.zero_trust.dlp.entries.with_streaming_response.update( @@ -225,7 +216,6 @@ def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_2(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -242,7 +232,6 @@ def test_path_params_update_overload_2(self, client: Cloudflare) -> None: type="predefined", ) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_method_update_overload_3(self, client: Cloudflare) -> None: entry = client.zero_trust.dlp.entries.update( @@ -252,7 +241,6 @@ def test_method_update_overload_3(self, client: Cloudflare) -> None: ) assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_method_update_with_all_params_overload_3(self, client: Cloudflare) -> None: entry = client.zero_trust.dlp.entries.update( @@ -263,7 +251,6 @@ def test_method_update_with_all_params_overload_3(self, client: Cloudflare) -> N ) assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_raw_response_update_overload_3(self, client: Cloudflare) -> None: response = client.zero_trust.dlp.entries.with_raw_response.update( @@ -277,7 +264,6 @@ def test_raw_response_update_overload_3(self, client: Cloudflare) -> None: entry = response.parse() assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_streaming_response_update_overload_3(self, client: Cloudflare) -> None: with client.zero_trust.dlp.entries.with_streaming_response.update( @@ -293,7 +279,6 @@ def test_streaming_response_update_overload_3(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_3(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -516,7 +501,6 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_update_overload_1(self, async_client: AsyncCloudflare) -> None: entry = await async_client.zero_trust.dlp.entries.update( @@ -528,7 +512,6 @@ async def test_method_update_overload_1(self, async_client: AsyncCloudflare) -> ) assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_update_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: entry = await async_client.zero_trust.dlp.entries.update( @@ -544,7 +527,6 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn ) assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.dlp.entries.with_raw_response.update( @@ -560,7 +542,6 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflar entry = await response.parse() assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_streaming_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.dlp.entries.with_streaming_response.update( @@ -578,7 +559,6 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncClo assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_1(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -599,7 +579,6 @@ async def test_path_params_update_overload_1(self, async_client: AsyncCloudflare type="custom", ) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> None: entry = await async_client.zero_trust.dlp.entries.update( @@ -609,7 +588,6 @@ async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> ) assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_update_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: entry = await async_client.zero_trust.dlp.entries.update( @@ -620,7 +598,6 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn ) assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.dlp.entries.with_raw_response.update( @@ -634,7 +611,6 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflar entry = await response.parse() assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_streaming_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.dlp.entries.with_streaming_response.update( @@ -650,7 +626,6 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncClo assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -667,7 +642,6 @@ async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare type="predefined", ) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_update_overload_3(self, async_client: AsyncCloudflare) -> None: entry = await async_client.zero_trust.dlp.entries.update( @@ -677,7 +651,6 @@ async def test_method_update_overload_3(self, async_client: AsyncCloudflare) -> ) assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_update_with_all_params_overload_3(self, async_client: AsyncCloudflare) -> None: entry = await async_client.zero_trust.dlp.entries.update( @@ -688,7 +661,6 @@ async def test_method_update_with_all_params_overload_3(self, async_client: Asyn ) assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_raw_response_update_overload_3(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.dlp.entries.with_raw_response.update( @@ -702,7 +674,6 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncCloudflar entry = await response.parse() assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_streaming_response_update_overload_3(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.dlp.entries.with_streaming_response.update( @@ -718,7 +689,6 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncClo assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_3(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): diff --git a/tests/api_resources/zero_trust/gateway/test_lists.py b/tests/api_resources/zero_trust/gateway/test_lists.py index 4c81584d3e3..5448c53e5b9 100644 --- a/tests/api_resources/zero_trust/gateway/test_lists.py +++ b/tests/api_resources/zero_trust/gateway/test_lists.py @@ -99,12 +99,6 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: account_id="699d98642c564d2e855e9661899b7252", name="Admin Serial Numbers", description="The serial numbers for administrators", - items=[ - { - "description": "Austin office IP", - "value": "8GE8721REF", - } - ], ) assert_matches_type(Optional[GatewayList], list_, path=["response"]) @@ -439,12 +433,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare account_id="699d98642c564d2e855e9661899b7252", name="Admin Serial Numbers", description="The serial numbers for administrators", - items=[ - { - "description": "Austin office IP", - "value": "8GE8721REF", - } - ], ) assert_matches_type(Optional[GatewayList], list_, path=["response"]) diff --git a/tests/api_resources/zero_trust/gateway/test_rules.py b/tests/api_resources/zero_trust/gateway/test_rules.py index e1ed5506b92..8852212a8b5 100644 --- a/tests/api_resources/zero_trust/gateway/test_rules.py +++ b/tests/api_resources/zero_trust/gateway/test_rules.py @@ -105,10 +105,6 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "override_ips": ["1.1.1.1", "2.2.2.2"], "payload_log": {"enabled": True}, "quarantine": {"file_types": ["exe"]}, - "resolve_dns_internally": { - "fallback": "none", - "view_id": "view_id", - }, "resolve_dns_through_cloudflare": True, "untrusted_cert": {"action": "pass_through"}, }, @@ -249,10 +245,6 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "override_ips": ["1.1.1.1", "2.2.2.2"], "payload_log": {"enabled": True}, "quarantine": {"file_types": ["exe"]}, - "resolve_dns_internally": { - "fallback": "none", - "view_id": "view_id", - }, "resolve_dns_through_cloudflare": True, "untrusted_cert": {"action": "pass_through"}, }, @@ -588,10 +580,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "override_ips": ["1.1.1.1", "2.2.2.2"], "payload_log": {"enabled": True}, "quarantine": {"file_types": ["exe"]}, - "resolve_dns_internally": { - "fallback": "none", - "view_id": "view_id", - }, "resolve_dns_through_cloudflare": True, "untrusted_cert": {"action": "pass_through"}, }, @@ -732,10 +720,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "override_ips": ["1.1.1.1", "2.2.2.2"], "payload_log": {"enabled": True}, "quarantine": {"file_types": ["exe"]}, - "resolve_dns_internally": { - "fallback": "none", - "view_id": "view_id", - }, "resolve_dns_through_cloudflare": True, "untrusted_cert": {"action": "pass_through"}, }, diff --git a/tests/api_resources/zero_trust/organizations/test_doh.py b/tests/api_resources/zero_trust/organizations/test_doh.py index 58ac94ae30a..3b0c04a90dc 100644 --- a/tests/api_resources/zero_trust/organizations/test_doh.py +++ b/tests/api_resources/zero_trust/organizations/test_doh.py @@ -28,7 +28,7 @@ def test_method_update(self, client: Cloudflare) -> None: def test_method_update_with_all_params(self, client: Cloudflare) -> None: doh = client.zero_trust.organizations.doh.update( account_id="023e105f4ecef8ad9ca31a8372d0c353", - doh_jwt_duration="800h", + jwt_duration="800h", service_token_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ) assert_matches_type(Optional[DOHUpdateResponse], doh, path=["response"]) @@ -117,7 +117,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: doh = await async_client.zero_trust.organizations.doh.update( account_id="023e105f4ecef8ad9ca31a8372d0c353", - doh_jwt_duration="800h", + jwt_duration="800h", service_token_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ) assert_matches_type(Optional[DOHUpdateResponse], doh, path=["response"]) diff --git a/tests/api_resources/zero_trust/test_devices.py b/tests/api_resources/zero_trust/test_devices.py index e806fd8d30e..f814c7c80bc 100644 --- a/tests/api_resources/zero_trust/test_devices.py +++ b/tests/api_resources/zero_trust/test_devices.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest @@ -62,7 +62,7 @@ def test_method_get(self, client: Cloudflare) -> None: device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[DeviceGetResponse], device, path=["response"]) + assert_matches_type(DeviceGetResponse, device, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -74,7 +74,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" device = response.parse() - assert_matches_type(Optional[DeviceGetResponse], device, path=["response"]) + assert_matches_type(DeviceGetResponse, device, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -86,7 +86,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" device = response.parse() - assert_matches_type(Optional[DeviceGetResponse], device, path=["response"]) + assert_matches_type(DeviceGetResponse, device, path=["response"]) assert cast(Any, response.is_closed) is True @@ -152,7 +152,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[DeviceGetResponse], device, path=["response"]) + assert_matches_type(DeviceGetResponse, device, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -164,7 +164,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" device = await response.parse() - assert_matches_type(Optional[DeviceGetResponse], device, path=["response"]) + assert_matches_type(DeviceGetResponse, device, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -176,7 +176,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" device = await response.parse() - assert_matches_type(Optional[DeviceGetResponse], device, path=["response"]) + assert_matches_type(DeviceGetResponse, device, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zones/test_holds.py b/tests/api_resources/zones/test_holds.py index b34e5066342..c49066aee53 100644 --- a/tests/api_resources/zones/test_holds.py +++ b/tests/api_resources/zones/test_holds.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -68,7 +68,7 @@ def test_method_delete(self, client: Cloudflare) -> None: hold = client.zones.holds.delete( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ZoneHold, hold, path=["response"]) + assert_matches_type(Optional[ZoneHold], hold, path=["response"]) @parametrize def test_method_delete_with_all_params(self, client: Cloudflare) -> None: @@ -76,7 +76,7 @@ def test_method_delete_with_all_params(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", hold_after="hold_after", ) - assert_matches_type(ZoneHold, hold, path=["response"]) + assert_matches_type(Optional[ZoneHold], hold, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -87,7 +87,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" hold = response.parse() - assert_matches_type(ZoneHold, hold, path=["response"]) + assert_matches_type(Optional[ZoneHold], hold, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -98,7 +98,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" hold = response.parse() - assert_matches_type(ZoneHold, hold, path=["response"]) + assert_matches_type(Optional[ZoneHold], hold, path=["response"]) assert cast(Any, response.is_closed) is True @@ -109,53 +109,6 @@ def test_path_params_delete(self, client: Cloudflare) -> None: zone_id="", ) - @parametrize - def test_method_edit(self, client: Cloudflare) -> None: - hold = client.zones.holds.edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(ZoneHold, hold, path=["response"]) - - @parametrize - def test_method_edit_with_all_params(self, client: Cloudflare) -> None: - hold = client.zones.holds.edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - hold_after="2023-01-31T15:56:36+00:00", - include_subdomains=True, - ) - assert_matches_type(ZoneHold, hold, path=["response"]) - - @parametrize - def test_raw_response_edit(self, client: Cloudflare) -> None: - response = client.zones.holds.with_raw_response.edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - hold = response.parse() - assert_matches_type(ZoneHold, hold, path=["response"]) - - @parametrize - def test_streaming_response_edit(self, client: Cloudflare) -> None: - with client.zones.holds.with_streaming_response.edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - hold = response.parse() - assert_matches_type(ZoneHold, hold, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_edit(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.zones.holds.with_raw_response.edit( - zone_id="", - ) - @parametrize def test_method_get(self, client: Cloudflare) -> None: hold = client.zones.holds.get( @@ -249,7 +202,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: hold = await async_client.zones.holds.delete( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ZoneHold, hold, path=["response"]) + assert_matches_type(Optional[ZoneHold], hold, path=["response"]) @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -257,7 +210,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare zone_id="023e105f4ecef8ad9ca31a8372d0c353", hold_after="hold_after", ) - assert_matches_type(ZoneHold, hold, path=["response"]) + assert_matches_type(Optional[ZoneHold], hold, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -268,7 +221,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" hold = await response.parse() - assert_matches_type(ZoneHold, hold, path=["response"]) + assert_matches_type(Optional[ZoneHold], hold, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -279,7 +232,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" hold = await response.parse() - assert_matches_type(ZoneHold, hold, path=["response"]) + assert_matches_type(Optional[ZoneHold], hold, path=["response"]) assert cast(Any, response.is_closed) is True @@ -290,53 +243,6 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: zone_id="", ) - @parametrize - async def test_method_edit(self, async_client: AsyncCloudflare) -> None: - hold = await async_client.zones.holds.edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(ZoneHold, hold, path=["response"]) - - @parametrize - async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: - hold = await async_client.zones.holds.edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - hold_after="2023-01-31T15:56:36+00:00", - include_subdomains=True, - ) - assert_matches_type(ZoneHold, hold, path=["response"]) - - @parametrize - async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zones.holds.with_raw_response.edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - hold = await response.parse() - assert_matches_type(ZoneHold, hold, path=["response"]) - - @parametrize - async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: - async with async_client.zones.holds.with_streaming_response.edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - hold = await response.parse() - assert_matches_type(ZoneHold, hold, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.zones.holds.with_raw_response.edit( - zone_id="", - ) - @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: hold = await async_client.zones.holds.get( From dfc958a9111626fff0b29fa3215abb4801ad970a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 16 Jan 2025 20:07:04 +0000 Subject: [PATCH 010/358] chore: trigger rebuild (#2368) --- .stats.yml | 4 +- api.md | 434 +++- src/cloudflare/_client.py | 76 + src/cloudflare/resources/abuse_reports.py | 492 ++++ src/cloudflare/resources/accounts/__init__.py | 14 + src/cloudflare/resources/accounts/accounts.py | 32 + .../resources/accounts/logs/__init__.py | 33 + .../resources/accounts/logs/audit.py | 426 +++ .../resources/accounts/logs/logs.py | 102 + .../addressing/address_maps/accounts.py | 16 +- .../addressing/address_maps/address_maps.py | 32 +- .../resources/addressing/address_maps/ips.py | 16 +- .../addressing/address_maps/zones.py | 24 +- .../resources/addressing/addressing.py | 16 +- .../{loa_documents => }/loa_documents.py | 160 +- .../addressing/loa_documents/__init__.py | 33 - .../addressing/loa_documents/downloads.py | 188 -- .../resources/addressing/prefixes/__init__.py | 56 +- .../prefixes/advertisement_status.py | 324 +++ .../addressing/prefixes/bgp/__init__.py | 61 - .../resources/addressing/prefixes/bgp/bgp.py | 166 -- .../{bgp/prefixes.py => bgp_prefixes.py} | 242 +- .../addressing/prefixes/delegations.py | 28 +- .../resources/addressing/prefixes/prefixes.py | 136 +- .../{bgp/bindings.py => service_bindings.py} | 158 +- .../resources/addressing/services.py | 4 +- src/cloudflare/resources/ai/__init__.py | 75 + .../resources/{workers => }/ai/ai.py | 114 +- src/cloudflare/resources/ai/authors.py | 165 ++ .../resources/ai/finetunes/__init__.py | 47 + .../resources/ai/finetunes/assets.py | 217 ++ .../resources/ai/finetunes/finetunes.py | 356 +++ .../resources/ai/finetunes/public.py | 208 ++ .../{workers => }/ai/models/__init__.py | 0 src/cloudflare/resources/ai/models/models.py | 263 ++ .../{workers => }/ai/models/schema.py | 16 +- src/cloudflare/resources/ai/tasks.py | 165 ++ .../resources/ai_gateway/ai_gateway.py | 16 - .../resources/ai_gateway/datasets.py | 17 - .../resources/ai_gateway/evaluations.py | 17 - .../api_gateway/operations/operations.py | 184 +- .../resources/argo/tiered_caching.py | 74 +- .../resources/cache/cache_reserve.py | 50 +- .../resources/cache/regional_tiered_cache.py | 30 +- .../resources/cache/smart_tiered_cache.py | 80 +- src/cloudflare/resources/cache/variants.py | 40 +- .../resources/cloud_connector/rules.py | 12 +- src/cloudflare/resources/dns/records.py | 748 ++++-- .../email_security/settings/block_senders.py | 199 +- .../settings/impersonation_registry.py | 181 +- src/cloudflare/resources/logpush/jobs.py | 12 + src/cloudflare/resources/logpush/validate.py | 149 +- .../resources/magic_transit/sites/acls.py | 36 + .../resources/managed_transforms.py | 142 +- .../origin_post_quantum_encryption.py | 128 +- .../resources/r2/buckets/buckets.py | 64 +- src/cloudflare/resources/r2/buckets/cors.py | 48 +- .../resources/r2/buckets/domains/custom.py | 80 +- .../resources/r2/buckets/domains/managed.py | 32 +- .../configuration/configuration.py | 16 +- .../configuration/queues.py | 32 +- .../resources/r2/buckets/lifecycle.py | 32 +- src/cloudflare/resources/r2/buckets/sippy.py | 60 +- .../resources/radar/ai/bots/summary.py | 10 + .../resources/radar/as112/summary.py | 20 + .../radar/as112/timeseries_groups.py | 20 + .../resources/radar/attacks/layer3/summary.py | 10 + .../resources/radar/attacks/layer7/summary.py | 30 + .../radar/attacks/layer7/timeseries_groups.py | 30 + .../resources/radar/http/timeseries_groups.py | 10 + .../resources/radar/ranking/domain.py | 15 +- .../resources/radar/ranking/ranking.py | 6 +- src/cloudflare/resources/rules/lists/items.py | 52 +- src/cloudflare/resources/url_normalization.py | 142 +- .../resources/url_scanner/responses.py | 4 +- src/cloudflare/resources/url_scanner/scans.py | 56 +- .../resources/vectorize/indexes/indexes.py | 12 +- .../resources/waiting_rooms/waiting_rooms.py | 102 + src/cloudflare/resources/workers/__init__.py | 28 +- .../resources/workers/ai/__init__.py | 33 - .../resources/workers/ai/models/models.py | 102 - .../resources/workers/assets/upload.py | 14 +- src/cloudflare/resources/workers/routes.py | 600 +++++ .../workers/scripts/assets/upload.py | 14 +- .../resources/workers/scripts/content.py | 46 +- .../resources/workers/scripts/scripts.py | 214 +- .../resources/workers/scripts/versions.py | 40 +- src/cloudflare/resources/workers/workers.py | 38 +- .../dispatch/namespaces/scripts/__init__.py | 14 + .../namespaces/scripts/asset_upload.py | 223 ++ .../dispatch/namespaces/scripts/content.py | 46 +- .../dispatch/namespaces/scripts/scripts.py | 196 +- .../resources/zero_trust/access/__init__.py | 14 + .../resources/zero_trust/access/access.py | 32 + .../resources/zero_trust/access/gateway_ca.py | 365 +++ .../access/infrastructure/targets.py | 67 +- .../resources/zero_trust/devices/devices.py | 52 +- .../zero_trust/devices/fleet_status.py | 4 +- .../devices/policies/default/certificates.py | 26 +- .../devices/posture/integrations.py | 12 +- .../resources/zero_trust/devices/revoke.py | 14 +- .../resources/zero_trust/devices/unrevoke.py | 14 +- .../zero_trust/dex/commands/__init__.py | 28 + .../zero_trust/dex/commands/commands.py | 72 +- .../zero_trust/dex/commands/devices.py | 212 ++ .../zero_trust/dex/commands/downloads.py | 4 +- .../zero_trust/dex/commands/quota.py | 4 +- .../zero_trust/dex/commands/users.py | 189 ++ .../resources/zero_trust/dlp/__init__.py | 14 + .../resources/zero_trust/dlp/dlp.py | 32 + .../zero_trust/dlp/email/__init__.py | 47 + .../dlp/email/account_mapping.py} | 168 +- .../resources/zero_trust/dlp/email/email.py | 134 + .../resources/zero_trust/dlp/email/rules.py | 701 +++++ .../gateway/configurations/configurations.py | 8 +- .../zero_trust/gateway/lists/lists.py | 20 +- .../resources/zero_trust/organizations/doh.py | 12 +- src/cloudflare/resources/zones/holds.py | 148 +- .../types/abuse_reports/__init__.py | 6 + .../abuse_report_create_params.py | 140 + .../abuse_report_create_response.py | 7 + .../types/accounts/logs/__init__.py | 6 + .../types/accounts/logs/audit_list_params.py | 115 + .../accounts/logs/audit_list_response.py | 124 + .../types/accounts/token_create_params.py | 2 +- .../types/accounts/token_create_response.py | 2 +- .../types/accounts/token_update_params.py | 2 +- .../types/addressing/address_map.py | 2 +- .../addressing/address_map_create_params.py | 2 +- .../addressing/address_map_create_response.py | 2 +- .../addressing/address_map_edit_params.py | 2 +- .../addressing/address_map_get_response.py | 2 +- .../address_maps/account_update_params.py | 2 +- .../address_maps/ip_update_params.py | 4 +- .../address_maps/zone_update_params.py | 4 +- .../addressing/loa_document_create_params.py | 2 +- .../loa_document_create_response.py | 2 +- .../addressing/loa_documents/__init__.py | 3 - src/cloudflare/types/addressing/prefix.py | 4 +- .../types/addressing/prefix_create_params.py | 2 +- .../types/addressing/prefix_edit_params.py | 2 +- .../types/addressing/prefixes/__init__.py | 9 + .../advertisement_status_edit_params.py | 19 + ... => advertisement_status_edit_response.py} | 12 +- ...y => advertisement_status_get_response.py} | 12 +- .../types/addressing/prefixes/bgp/__init__.py | 12 - .../prefixes/{bgp => }/bgp_prefix.py | 4 +- ..._params.py => bgp_prefix_create_params.py} | 9 +- ...it_params.py => bgp_prefix_edit_params.py} | 8 +- .../prefixes/delegation_create_params.py | 2 +- .../prefixes/delegation_delete_response.py | 2 +- .../types/addressing/prefixes/delegations.py | 4 +- .../prefixes/{bgp => }/service_binding.py | 9 +- .../prefixes/service_binding_create_params.py | 21 + .../service_binding_delete_response.py | 18 + .../types/addressing/service_list_response.py | 5 +- src/cloudflare/types/ai/__init__.py | 10 + .../types/{workers => ai}/ai_run_params.py | 0 .../types/{workers => ai}/ai_run_response.py | 0 .../finetune_create_params.py} | 14 +- .../types/ai/finetune_create_response.py | 24 + .../types/ai/finetune_list_response.py | 22 + src/cloudflare/types/ai/finetunes/__init__.py | 8 + .../types/ai/finetunes/asset_create_params.py | 17 + .../ai/finetunes/asset_create_response.py | 21 + .../types/ai/finetunes/public_list_params.py | 22 + .../ai/finetunes/public_list_response.py | 24 + src/cloudflare/types/ai/model_list_params.py | 30 + .../types/{workers => }/ai/models/__init__.py | 0 .../ai/models/schema_get_params.py | 0 .../ai_gateway/ai_gateway_create_response.py | 6 + .../ai_gateway/ai_gateway_delete_response.py | 6 + .../ai_gateway/ai_gateway_get_response.py | 6 + .../ai_gateway/ai_gateway_list_params.py | 8 +- .../ai_gateway/ai_gateway_list_response.py | 6 + .../ai_gateway/ai_gateway_update_response.py | 6 + .../ai_gateway/dataset_create_response.py | 4 + .../ai_gateway/dataset_delete_response.py | 4 + .../types/ai_gateway/dataset_get_response.py | 4 + .../types/ai_gateway/dataset_list_params.py | 8 +- .../types/ai_gateway/dataset_list_response.py | 4 + .../ai_gateway/dataset_update_response.py | 4 + .../ai_gateway/evaluation_create_response.py | 8 + .../ai_gateway/evaluation_delete_response.py | 8 + .../ai_gateway/evaluation_get_response.py | 8 + .../ai_gateway/evaluation_list_params.py | 8 +- .../ai_gateway/evaluation_list_response.py | 8 + .../types/ai_gateway/log_delete_params.py | 7 + .../types/ai_gateway/log_list_params.py | 7 + src/cloudflare/types/api_gateway/__init__.py | 3 +- .../types/api_gateway/api_shield.py | 227 -- .../operation_bulk_create_params.py | 31 + .../operation_bulk_create_response.py | 239 ++ .../api_gateway/operation_create_params.py | 7 +- .../api_gateway/operation_create_response.py | 227 +- .../user_schemas/operation_list_response.py | 232 +- .../argo/tiered_caching_edit_response.py | 13 +- .../types/argo/tiered_caching_get_response.py | 13 +- src/cloudflare/types/cache/__init__.py | 2 +- .../cache/cache_reserve_clear_response.py | 6 +- .../cache/cache_reserve_edit_response.py | 9 +- .../types/cache/cache_reserve_get_response.py | 9 +- .../cache/cache_reserve_status_response.py | 6 +- .../regional_tiered_cache_edit_response.py | 24 +- .../regional_tiered_cache_get_response.py | 24 +- .../smart_tiered_cache_delete_response.py | 12 +- .../cache/smart_tiered_cache_edit_response.py | 13 +- .../cache/smart_tiered_cache_get_response.py | 13 +- ..._variant.py => variant_delete_response.py} | 9 +- .../types/cache/variant_edit_response.py | 83 +- .../types/cache/variant_get_response.py | 83 +- .../cloud_connector/rule_update_params.py | 10 +- src/cloudflare/types/dns/__init__.py | 9 +- src/cloudflare/types/dns/a_record.py | 23 +- src/cloudflare/types/dns/a_record_param.py | 23 +- src/cloudflare/types/dns/aaaa_record.py | 23 +- src/cloudflare/types/dns/aaaa_record_param.py | 23 +- src/cloudflare/types/dns/batch_patch_param.py | 237 ++ src/cloudflare/types/dns/batch_put_param.py | 237 ++ src/cloudflare/types/dns/caa_record.py | 23 +- src/cloudflare/types/dns/caa_record_param.py | 23 +- src/cloudflare/types/dns/cert_record.py | 23 +- src/cloudflare/types/dns/cert_record_param.py | 23 +- src/cloudflare/types/dns/cname_record.py | 19 +- .../types/dns/cname_record_param.py | 19 +- src/cloudflare/types/dns/dnskey_record.py | 23 +- .../types/dns/dnskey_record_param.py | 23 +- src/cloudflare/types/dns/ds_record.py | 23 +- src/cloudflare/types/dns/ds_record_param.py | 23 +- src/cloudflare/types/dns/https_record.py | 23 +- .../types/dns/https_record_param.py | 23 +- src/cloudflare/types/dns/loc_record.py | 23 +- src/cloudflare/types/dns/loc_record_param.py | 23 +- src/cloudflare/types/dns/mx_record.py | 23 +- src/cloudflare/types/dns/mx_record_param.py | 23 +- src/cloudflare/types/dns/naptr_record.py | 23 +- .../types/dns/naptr_record_param.py | 23 +- src/cloudflare/types/dns/ns_record.py | 23 +- src/cloudflare/types/dns/ns_record_param.py | 23 +- src/cloudflare/types/dns/ptr_record.py | 23 +- src/cloudflare/types/dns/ptr_record_param.py | 23 +- .../types/dns/record_batch_params.py | 403 +-- .../types/dns/record_batch_response.py | 2283 +---------------- .../types/dns/record_create_params.py | 459 +++- .../types/dns/record_create_response.py | 595 ----- .../types/dns/record_edit_params.py | 459 +++- .../types/dns/record_get_response.py | 595 ----- .../types/dns/record_list_response.py | 595 ----- src/cloudflare/types/dns/record_param.py | 27 +- .../types/dns/record_process_timing.py | 19 - ...rd_edit_response.py => record_response.py} | 32 +- .../types/dns/record_update_params.py | 459 +++- .../types/dns/record_update_response.py | 595 ----- src/cloudflare/types/dns/smimea_record.py | 23 +- .../types/dns/smimea_record_param.py | 23 +- src/cloudflare/types/dns/srv_record.py | 23 +- src/cloudflare/types/dns/srv_record_param.py | 23 +- src/cloudflare/types/dns/sshfp_record.py | 23 +- .../types/dns/sshfp_record_param.py | 23 +- src/cloudflare/types/dns/svcb_record.py | 23 +- src/cloudflare/types/dns/svcb_record_param.py | 23 +- src/cloudflare/types/dns/tlsa_record.py | 23 +- src/cloudflare/types/dns/tlsa_record_param.py | 23 +- src/cloudflare/types/dns/txt_record.py | 23 +- src/cloudflare/types/dns/txt_record_param.py | 23 +- src/cloudflare/types/dns/uri_record.py | 23 +- src/cloudflare/types/dns/uri_record_param.py | 23 +- .../investigate/preview_create_response.py | 4 +- .../settings/block_sender_create_params.py | 28 +- .../settings/block_sender_create_response.py | 28 +- .../settings/block_sender_delete_response.py | 1 + .../settings/block_sender_edit_response.py | 1 + .../settings/block_sender_get_response.py | 1 + .../settings/block_sender_list_response.py | 1 + .../impersonation_registry_create_params.py | 25 +- .../impersonation_registry_create_response.py | 36 +- .../impersonation_registry_edit_response.py | 4 +- .../impersonation_registry_get_response.py | 4 +- .../impersonation_registry_list_response.py | 4 +- .../images/v1/variant_delete_response.py | 4 +- .../types/images/v1_delete_response.py | 4 +- src/cloudflare/types/logpush/__init__.py | 2 + .../types/logpush/job_update_params.py | 7 + .../validate_destination_exists_params.py | 22 + .../validate_destination_exists_response.py | 11 + .../logpush/validate_destination_response.py | 4 +- .../types/magic_transit/sites/acl.py | 8 + .../magic_transit/sites/acl_create_params.py | 8 + .../magic_transit/sites/acl_edit_params.py | 8 + .../magic_transit/sites/acl_update_params.py | 8 + .../types/magic_transit/sites/wan.py | 7 + .../types/managed_transforms/__init__.py | 2 - .../managed_transform_edit_params.py | 28 +- .../managed_transform_edit_response.py | 42 +- .../managed_transform_list_response.py | 43 +- .../types/managed_transforms/request_model.py | 15 - .../managed_transforms/request_model_param.py | 15 - ...in_post_quantum_encryption_get_response.py | 21 +- ...post_quantum_encryption_update_response.py | 21 +- src/cloudflare/types/page_rules/page_rule.py | 78 +- .../page_rules/page_rule_create_params.py | 78 +- .../types/page_rules/page_rule_edit_params.py | 78 +- .../page_rules/page_rule_update_params.py | 78 +- .../types/r2/bucket_create_params.py | 2 +- src/cloudflare/types/r2/bucket_list_params.py | 2 +- .../types/r2/buckets/cors_update_params.py | 2 +- .../buckets/domains/custom_create_params.py | 2 +- .../buckets/domains/custom_update_params.py | 2 +- .../buckets/domains/managed_update_params.py | 2 +- .../configuration/queue_update_params.py | 2 +- .../r2/buckets/lifecycle_update_params.py | 2 +- .../types/r2/buckets/sippy_update_params.py | 4 +- .../ai/bots/summary_user_agent_params.py | 6 + .../ai/bots/summary_user_agent_response.py | 2 +- .../radar/as112/summary_query_type_params.py | 6 + .../as112/summary_query_type_response.py | 25 +- .../as112/summary_response_codes_params.py | 6 + .../as112/summary_response_codes_response.py | 11 +- .../timeseries_group_query_type_params.py | 6 + .../timeseries_group_response_codes_params.py | 6 + .../attacks/layer3/summary_vector_params.py | 6 + .../attacks/layer3/summary_vector_response.py | 2 +- .../layer7/summary_http_method_params.py | 6 + .../layer7/summary_http_method_response.py | 19 +- .../layer7/summary_managed_rules_params.py | 6 + .../layer7/summary_managed_rules_response.py | 2 +- .../summary_mitigation_product_params.py | 6 + .../summary_mitigation_product_response.py | 11 +- .../timeseries_group_http_method_params.py | 6 + .../timeseries_group_http_method_response.py | 12 +- .../timeseries_group_http_version_response.py | 4 + .../timeseries_group_managed_rules_params.py | 6 + ...eseries_group_mitigation_product_params.py | 6 + ...eries_group_mitigation_product_response.py | 12 +- .../timeseries_group_browser_family_params.py | 6 + .../types/radar/ranking/domain_get_params.py | 8 +- .../types/radar/ranking_top_params.py | 5 +- ...sets_timeout_timeseries_groups_response.py | 17 - .../types/rules/lists/item_get_response.py | 51 +- .../types/rules/lists/item_list_response.py | 51 +- .../types/rulesets/rule_create_params.py | 85 +- .../types/rulesets/rule_edit_params.py | 85 +- .../types/rulesets/set_cache_settings_rule.py | 85 +- .../rulesets/set_cache_settings_rule_param.py | 85 +- src/cloudflare/types/shared/token.py | 2 +- src/cloudflare/types/shared/token_policy.py | 12 +- .../types/shared_params/token_policy.py | 12 +- .../url_normalization_get_response.py | 6 +- .../url_normalization_update_params.py | 8 +- .../url_normalization_update_response.py | 6 +- .../url_scanner/scan_bulk_create_params.py | 3 + .../types/url_scanner/scan_create_params.py | 3 + .../types/url_scanner/scan_list_params.py | 5 +- .../url_scanner/scan_screenshot_params.py | 8 +- .../types/user/token_create_params.py | 2 +- .../types/user/token_create_response.py | 2 +- .../types/user/token_update_params.py | 2 +- .../types/vectorize/index_delete_response.py | 4 +- .../types/waiting_rooms/waiting_room.py | 19 + .../waiting_room_create_params.py | 19 + .../waiting_rooms/waiting_room_edit_params.py | 19 + .../waiting_room_update_params.py | 19 + src/cloudflare/types/workers/__init__.py | 30 +- src/cloudflare/types/workers/binding.py | 47 - src/cloudflare/types/workers/binding_param.py | 42 - src/cloudflare/types/workers/d1_binding.py | 21 - .../types/workers/d1_binding_param.py | 18 - .../workers/dispatch_namespace_binding.py | 41 - .../dispatch_namespace_binding_param.py | 38 - .../types/workers/durable_object_binding.py | 30 - .../workers/durable_object_binding_param.py | 23 - .../types/workers/kv_namespace_binding.py | 18 - .../workers/kv_namespace_binding_param.py | 12 - .../types/workers/mtls_cert_binding.py | 18 - .../types/workers/mtls_cert_binding_param.py | 15 - .../types/workers/placement_configuration.py | 17 - .../workers/placement_configuration_param.py | 16 - src/cloudflare/types/workers/r2_binding.py | 18 - .../types/workers/r2_binding_param.py | 15 - .../types/workers/route_create_params.py | 17 + .../route_create_response.py} | 8 +- .../types/workers/route_delete_response.py | 18 + .../types/workers/route_get_response.py | 16 + .../types/workers/route_list_response.py | 16 + .../types/workers/route_update_params.py | 17 + .../types/workers/route_update_response.py | 16 + src/cloudflare/types/workers/script.py | 40 +- .../types/workers/script_get_response.py | 7 + .../types/workers/script_update_params.py | 420 ++- .../types/workers/script_update_response.py | 40 +- .../workers/scripts/content_update_params.py | 15 +- .../workers/scripts/version_create_params.py | 335 ++- .../types/workers/service_binding.py | 21 - .../types/workers/service_binding_param.py | 18 - .../types/workers/stepped_migration.py | 22 - .../types/workers/stepped_migration_param.py | 24 - .../namespaces/script_update_params.py | 407 ++- .../namespaces/script_update_response.py | 40 +- .../dispatch/namespaces/scripts/__init__.py | 2 + .../scripts/asset_upload_create_params.py | 30 + .../scripts/asset_upload_create_response.py | 15 + .../scripts/binding_get_response.py | 309 ++- .../scripts/content_update_params.py | 15 +- .../namespaces/scripts/setting_edit_params.py | 364 ++- .../scripts/setting_edit_response.py | 366 ++- .../scripts/setting_get_response.py | 366 ++- .../types/zero_trust/access/__init__.py | 3 + .../access/application_create_params.py | 528 +++- .../access/application_create_response.py | 596 ++++- .../access/application_get_response.py | 596 ++++- .../access/application_list_response.py | 596 ++++- .../access/application_update_params.py | 528 +++- .../access/application_update_response.py | 596 ++++- .../access/gateway_ca_create_response.py | 15 + .../access/gateway_ca_delete_response.py | 12 + .../access/gateway_ca_list_response.py | 15 + .../infrastructure/target_list_params.py | 26 +- .../types/zero_trust/device_get_response.py | 83 +- .../default/certificate_edit_response.py | 4 +- .../default/certificate_get_response.py | 4 +- .../posture/integration_delete_response.py | 4 +- .../devices/revoke_create_response.py | 4 +- .../devices/unrevoke_create_response.py | 4 +- .../types/zero_trust/dex/commands/__init__.py | 4 + .../dex/commands/device_list_params.py | 20 + .../dex/commands/device_list_response.py | 37 + .../dex/commands/user_list_params.py | 14 + .../dex/commands/user_list_response.py | 14 + .../types/zero_trust/dlp/dataset.py | 4 + .../types/zero_trust/dlp/email/__init__.py | 16 + .../email/account_mapping_create_params.py | 27 + .../email/account_mapping_create_response.py | 27 + .../dlp/email/account_mapping_get_response.py | 27 + .../dlp/email/rule_bulk_edit_params.py | 14 + .../dlp/email/rule_bulk_edit_response.py | 44 + .../dlp/email/rule_create_params.py | 37 + .../dlp/email/rule_create_response.py | 44 + .../dlp/email/rule_delete_response.py | 44 + .../zero_trust/dlp/email/rule_get_response.py | 44 + .../dlp/email/rule_list_response.py | 44 + .../dlp/email/rule_update_params.py | 37 + .../dlp/email/rule_update_response.py | 44 + .../gateway/configuration_edit_params.py | 2 +- .../gateway/configuration_edit_response.py | 2 +- .../gateway/configuration_get_response.py | 2 +- .../gateway/configuration_update_params.py | 2 +- .../gateway/configuration_update_response.py | 2 +- .../types/zero_trust/gateway/gateway_rule.py | 3 + .../zero_trust/gateway/list_update_params.py | 6 + .../types/zero_trust/gateway/location.py | 7 + .../types/zero_trust/gateway/rule_setting.py | 32 +- .../zero_trust/gateway/rule_setting_param.py | 32 +- .../identity_provider_scim_config.py | 5 +- .../organizations/doh_get_response.py | 16 +- .../organizations/doh_update_params.py | 2 +- .../organizations/doh_update_response.py | 16 +- src/cloudflare/types/zones/__init__.py | 2 +- .../types/zones/hold_edit_params.py | 29 + .../types/zones/origin_max_http_version.py | 7 - .../logs}/__init__.py | 0 .../api_resources/accounts/logs/test_audit.py | 192 ++ tests/api_resources/accounts/test_tokens.py | 56 +- .../addressing/address_maps/test_accounts.py | 64 +- .../addressing/address_maps/test_ips.py | 80 +- .../addressing/address_maps/test_zones.py | 120 +- .../loa_documents/test_downloads.py | 184 -- .../addressing/prefixes/bgp/test_bindings.py | 475 ---- .../addressing/prefixes/bgp/test_prefixes.py | 379 --- .../addressing/prefixes/bgp/test_statuses.py | 224 -- .../prefixes/test_advertisement_status.py | 227 ++ .../addressing/prefixes/test_bgp_prefixes.py | 493 ++++ .../addressing/prefixes/test_delegations.py | 104 +- .../prefixes/test_service_bindings.py | 478 ++++ .../addressing/test_address_maps.py | 132 +- .../addressing/test_loa_documents.py | 176 +- .../api_resources/addressing/test_prefixes.py | 120 +- .../api_resources/addressing/test_services.py | 12 +- .../prefixes/bgp => ai}/__init__.py | 0 .../{workers/ai => ai/finetunes}/__init__.py | 0 .../api_resources/ai/finetunes/test_assets.py | 138 + .../api_resources/ai/finetunes/test_public.py | 119 + .../{workers => }/ai/models/__init__.py | 0 .../{workers => }/ai/models/test_schema.py | 16 +- tests/api_resources/ai/test_authors.py | 98 + tests/api_resources/ai/test_finetunes.py | 212 ++ tests/api_resources/ai/test_models.py | 126 + tests/api_resources/ai/test_tasks.py | 98 + .../api_resources/ai_gateway/test_datasets.py | 4 - .../ai_gateway/test_evaluations.py | 4 - tests/api_resources/ai_gateway/test_logs.py | 8 +- .../api_gateway/test_operations.py | 213 +- .../api_resources/argo/test_tiered_caching.py | 26 +- .../api_resources/cache/test_cache_reserve.py | 50 +- .../cache/test_regional_tiered_cache.py | 26 +- .../cache/test_smart_tiered_cache.py | 38 +- tests/api_resources/cache/test_variants.py | 62 +- .../cloud_connector/test_rules.py | 16 +- tests/api_resources/dns/test_records.py | 1600 ++++++++---- .../settings/test_block_senders.py | 152 +- .../settings/test_impersonation_registry.py | 148 +- .../settings/test_trusted_domains.py | 18 + tests/api_resources/logpush/test_jobs.py | 2 + tests/api_resources/logpush/test_validate.py | 123 + .../magic_transit/sites/test_acls.py | 6 + .../r2/buckets/domains/test_custom.py | 20 +- .../r2/buckets/domains/test_managed.py | 8 +- .../configuration/test_queues.py | 8 +- .../event_notifications/test_configuration.py | 4 +- tests/api_resources/r2/buckets/test_cors.py | 12 +- .../r2/buckets/test_lifecycle.py | 8 +- tests/api_resources/r2/buckets/test_sippy.py | 16 +- tests/api_resources/r2/test_buckets.py | 16 +- .../radar/ai/bots/test_summary.py | 2 + .../radar/ai/test_timeseries_groups.py | 4 +- .../api_resources/radar/as112/test_summary.py | 4 + .../radar/as112/test_timeseries_groups.py | 4 + .../radar/attacks/layer3/test_summary.py | 2 + .../attacks/layer3/test_timeseries_groups.py | 12 +- .../radar/attacks/layer7/test_summary.py | 6 + .../attacks/layer7/test_timeseries_groups.py | 14 +- .../radar/http/test_timeseries_groups.py | 6 +- .../radar/ranking/test_domain.py | 7 +- tests/api_resources/radar/test_ranking.py | 6 +- tests/api_resources/rulesets/test_rules.py | 44 +- tests/api_resources/spectrum/test_apps.py | 10 + tests/api_resources/test_abuse_reports.py | 243 ++ tests/api_resources/{workers => }/test_ai.py | 278 +- tests/api_resources/test_ai_gateway.py | 4 - tests/api_resources/test_filters.py | 8 + .../api_resources/test_managed_transforms.py | 236 +- .../test_origin_post_quantum_encryption.py | 34 +- tests/api_resources/test_url_normalization.py | 150 +- tests/api_resources/test_waiting_rooms.py | 12 + .../url_scanner/test_responses.py | 32 +- tests/api_resources/url_scanner/test_scans.py | 136 +- tests/api_resources/user/test_tokens.py | 46 +- tests/api_resources/vectorize/test_indexes.py | 12 +- .../workers/scripts/test_content.py | 12 +- .../workers/scripts/test_versions.py | 26 +- tests/api_resources/workers/test_routes.py | 525 ++++ tests/api_resources/workers/test_scripts.py | 283 +- .../namespaces/scripts/test_asset_upload.py | 176 ++ .../namespaces/scripts/test_content.py | 14 +- .../namespaces/scripts/test_settings.py | 26 +- .../dispatch/namespaces/test_scripts.py | 198 +- .../access/infrastructure/test_targets.py | 10 + .../zero_trust/access/test_applications.py | 288 ++- .../zero_trust/access/test_gateway_ca.py | 271 ++ .../policies/default/test_certificates.py | 26 +- .../devices/posture/test_integrations.py | 12 +- .../zero_trust/devices/test_revoke.py | 14 +- .../zero_trust/devices/test_unrevoke.py | 14 +- .../zero_trust/dex/commands/test_devices.py | 135 + .../zero_trust/dex/commands/test_downloads.py | 12 +- .../zero_trust/dex/commands/test_users.py | 114 + .../zero_trust/dlp/datasets/test_versions.py | 8 + .../zero_trust/dlp/email}/__init__.py | 2 - .../dlp/email/test_account_mapping.py | 225 ++ .../zero_trust/dlp/email/test_rules.py | 820 ++++++ .../zero_trust/dlp/test_entries.py | 30 + .../zero_trust/gateway/test_lists.py | 12 + .../zero_trust/gateway/test_rules.py | 16 + .../zero_trust/organizations/test_doh.py | 4 +- .../api_resources/zero_trust/test_devices.py | 14 +- tests/api_resources/zones/test_holds.py | 112 +- 565 files changed, 29279 insertions(+), 13605 deletions(-) create mode 100644 src/cloudflare/resources/abuse_reports.py create mode 100644 src/cloudflare/resources/accounts/logs/__init__.py create mode 100644 src/cloudflare/resources/accounts/logs/audit.py create mode 100644 src/cloudflare/resources/accounts/logs/logs.py rename src/cloudflare/resources/addressing/{loa_documents => }/loa_documents.py (60%) delete mode 100644 src/cloudflare/resources/addressing/loa_documents/__init__.py delete mode 100644 src/cloudflare/resources/addressing/loa_documents/downloads.py create mode 100644 src/cloudflare/resources/addressing/prefixes/advertisement_status.py delete mode 100644 src/cloudflare/resources/addressing/prefixes/bgp/__init__.py delete mode 100644 src/cloudflare/resources/addressing/prefixes/bgp/bgp.py rename src/cloudflare/resources/addressing/prefixes/{bgp/prefixes.py => bgp_prefixes.py} (62%) rename src/cloudflare/resources/addressing/prefixes/{bgp/bindings.py => service_bindings.py} (80%) create mode 100644 src/cloudflare/resources/ai/__init__.py rename src/cloudflare/resources/{workers => }/ai/ai.py (94%) create mode 100644 src/cloudflare/resources/ai/authors.py create mode 100644 src/cloudflare/resources/ai/finetunes/__init__.py create mode 100644 src/cloudflare/resources/ai/finetunes/assets.py create mode 100644 src/cloudflare/resources/ai/finetunes/finetunes.py create mode 100644 src/cloudflare/resources/ai/finetunes/public.py rename src/cloudflare/resources/{workers => }/ai/models/__init__.py (100%) create mode 100644 src/cloudflare/resources/ai/models/models.py rename src/cloudflare/resources/{workers => }/ai/models/schema.py (94%) create mode 100644 src/cloudflare/resources/ai/tasks.py delete mode 100644 src/cloudflare/resources/workers/ai/__init__.py delete mode 100644 src/cloudflare/resources/workers/ai/models/models.py create mode 100644 src/cloudflare/resources/workers/routes.py create mode 100644 src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/asset_upload.py create mode 100644 src/cloudflare/resources/zero_trust/access/gateway_ca.py create mode 100644 src/cloudflare/resources/zero_trust/dex/commands/devices.py create mode 100644 src/cloudflare/resources/zero_trust/dex/commands/users.py create mode 100644 src/cloudflare/resources/zero_trust/dlp/email/__init__.py rename src/cloudflare/resources/{addressing/prefixes/bgp/statuses.py => zero_trust/dlp/email/account_mapping.py} (59%) create mode 100644 src/cloudflare/resources/zero_trust/dlp/email/email.py create mode 100644 src/cloudflare/resources/zero_trust/dlp/email/rules.py create mode 100644 src/cloudflare/types/abuse_reports/__init__.py create mode 100644 src/cloudflare/types/abuse_reports/abuse_report_create_params.py create mode 100644 src/cloudflare/types/abuse_reports/abuse_report_create_response.py create mode 100644 src/cloudflare/types/accounts/logs/__init__.py create mode 100644 src/cloudflare/types/accounts/logs/audit_list_params.py create mode 100644 src/cloudflare/types/accounts/logs/audit_list_response.py delete mode 100644 src/cloudflare/types/addressing/loa_documents/__init__.py create mode 100644 src/cloudflare/types/addressing/prefixes/advertisement_status_edit_params.py rename src/cloudflare/types/addressing/prefixes/{bgp/status_get_response.py => advertisement_status_edit_response.py} (54%) rename src/cloudflare/types/addressing/prefixes/{bgp/status_edit_response.py => advertisement_status_get_response.py} (54%) delete mode 100644 src/cloudflare/types/addressing/prefixes/bgp/__init__.py rename src/cloudflare/types/addressing/prefixes/{bgp => }/bgp_prefix.py (96%) rename src/cloudflare/types/addressing/prefixes/{bgp/binding_create_params.py => bgp_prefix_create_params.py} (65%) rename src/cloudflare/types/addressing/prefixes/{bgp/prefix_edit_params.py => bgp_prefix_edit_params.py} (64%) rename src/cloudflare/types/addressing/prefixes/{bgp => }/service_binding.py (79%) create mode 100644 src/cloudflare/types/addressing/prefixes/service_binding_create_params.py create mode 100644 src/cloudflare/types/addressing/prefixes/service_binding_delete_response.py create mode 100644 src/cloudflare/types/ai/__init__.py rename src/cloudflare/types/{workers => ai}/ai_run_params.py (100%) rename src/cloudflare/types/{workers => ai}/ai_run_response.py (100%) rename src/cloudflare/types/{addressing/prefixes/bgp/status_edit_params.py => ai/finetune_create_params.py} (51%) create mode 100644 src/cloudflare/types/ai/finetune_create_response.py create mode 100644 src/cloudflare/types/ai/finetune_list_response.py create mode 100644 src/cloudflare/types/ai/finetunes/__init__.py create mode 100644 src/cloudflare/types/ai/finetunes/asset_create_params.py create mode 100644 src/cloudflare/types/ai/finetunes/asset_create_response.py create mode 100644 src/cloudflare/types/ai/finetunes/public_list_params.py create mode 100644 src/cloudflare/types/ai/finetunes/public_list_response.py create mode 100644 src/cloudflare/types/ai/model_list_params.py rename src/cloudflare/types/{workers => }/ai/models/__init__.py (100%) rename src/cloudflare/types/{workers => }/ai/models/schema_get_params.py (100%) delete mode 100644 src/cloudflare/types/api_gateway/api_shield.py create mode 100644 src/cloudflare/types/api_gateway/operation_bulk_create_params.py create mode 100644 src/cloudflare/types/api_gateway/operation_bulk_create_response.py rename src/cloudflare/types/cache/{cache_variant.py => variant_delete_response.py} (63%) create mode 100644 src/cloudflare/types/dns/batch_patch_param.py create mode 100644 src/cloudflare/types/dns/batch_put_param.py delete mode 100644 src/cloudflare/types/dns/record_create_response.py delete mode 100644 src/cloudflare/types/dns/record_get_response.py delete mode 100644 src/cloudflare/types/dns/record_list_response.py delete mode 100644 src/cloudflare/types/dns/record_process_timing.py rename src/cloudflare/types/dns/{record_edit_response.py => record_response.py} (94%) delete mode 100644 src/cloudflare/types/dns/record_update_response.py create mode 100644 src/cloudflare/types/logpush/validate_destination_exists_params.py create mode 100644 src/cloudflare/types/logpush/validate_destination_exists_response.py delete mode 100644 src/cloudflare/types/managed_transforms/request_model.py delete mode 100644 src/cloudflare/types/managed_transforms/request_model_param.py delete mode 100644 src/cloudflare/types/workers/binding.py delete mode 100644 src/cloudflare/types/workers/binding_param.py delete mode 100644 src/cloudflare/types/workers/d1_binding.py delete mode 100644 src/cloudflare/types/workers/d1_binding_param.py delete mode 100644 src/cloudflare/types/workers/dispatch_namespace_binding.py delete mode 100644 src/cloudflare/types/workers/dispatch_namespace_binding_param.py delete mode 100644 src/cloudflare/types/workers/durable_object_binding.py delete mode 100644 src/cloudflare/types/workers/durable_object_binding_param.py delete mode 100644 src/cloudflare/types/workers/kv_namespace_binding.py delete mode 100644 src/cloudflare/types/workers/kv_namespace_binding_param.py delete mode 100644 src/cloudflare/types/workers/mtls_cert_binding.py delete mode 100644 src/cloudflare/types/workers/mtls_cert_binding_param.py delete mode 100644 src/cloudflare/types/workers/placement_configuration.py delete mode 100644 src/cloudflare/types/workers/placement_configuration_param.py delete mode 100644 src/cloudflare/types/workers/r2_binding.py delete mode 100644 src/cloudflare/types/workers/r2_binding_param.py create mode 100644 src/cloudflare/types/workers/route_create_params.py rename src/cloudflare/types/{addressing/prefixes/bgp/binding_delete_response.py => workers/route_create_response.py} (64%) create mode 100644 src/cloudflare/types/workers/route_delete_response.py create mode 100644 src/cloudflare/types/workers/route_get_response.py create mode 100644 src/cloudflare/types/workers/route_list_response.py create mode 100644 src/cloudflare/types/workers/route_update_params.py create mode 100644 src/cloudflare/types/workers/route_update_response.py create mode 100644 src/cloudflare/types/workers/script_get_response.py delete mode 100644 src/cloudflare/types/workers/service_binding.py delete mode 100644 src/cloudflare/types/workers/service_binding_param.py delete mode 100644 src/cloudflare/types/workers/stepped_migration.py delete mode 100644 src/cloudflare/types/workers/stepped_migration_param.py create mode 100644 src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/asset_upload_create_params.py create mode 100644 src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/asset_upload_create_response.py create mode 100644 src/cloudflare/types/zero_trust/access/gateway_ca_create_response.py create mode 100644 src/cloudflare/types/zero_trust/access/gateway_ca_delete_response.py create mode 100644 src/cloudflare/types/zero_trust/access/gateway_ca_list_response.py create mode 100644 src/cloudflare/types/zero_trust/dex/commands/device_list_params.py create mode 100644 src/cloudflare/types/zero_trust/dex/commands/device_list_response.py create mode 100644 src/cloudflare/types/zero_trust/dex/commands/user_list_params.py create mode 100644 src/cloudflare/types/zero_trust/dex/commands/user_list_response.py create mode 100644 src/cloudflare/types/zero_trust/dlp/email/__init__.py create mode 100644 src/cloudflare/types/zero_trust/dlp/email/account_mapping_create_params.py create mode 100644 src/cloudflare/types/zero_trust/dlp/email/account_mapping_create_response.py create mode 100644 src/cloudflare/types/zero_trust/dlp/email/account_mapping_get_response.py create mode 100644 src/cloudflare/types/zero_trust/dlp/email/rule_bulk_edit_params.py create mode 100644 src/cloudflare/types/zero_trust/dlp/email/rule_bulk_edit_response.py create mode 100644 src/cloudflare/types/zero_trust/dlp/email/rule_create_params.py create mode 100644 src/cloudflare/types/zero_trust/dlp/email/rule_create_response.py create mode 100644 src/cloudflare/types/zero_trust/dlp/email/rule_delete_response.py create mode 100644 src/cloudflare/types/zero_trust/dlp/email/rule_get_response.py create mode 100644 src/cloudflare/types/zero_trust/dlp/email/rule_list_response.py create mode 100644 src/cloudflare/types/zero_trust/dlp/email/rule_update_params.py create mode 100644 src/cloudflare/types/zero_trust/dlp/email/rule_update_response.py create mode 100644 src/cloudflare/types/zones/hold_edit_params.py delete mode 100644 src/cloudflare/types/zones/origin_max_http_version.py rename tests/api_resources/{addressing/loa_documents => accounts/logs}/__init__.py (100%) create mode 100644 tests/api_resources/accounts/logs/test_audit.py delete mode 100644 tests/api_resources/addressing/loa_documents/test_downloads.py delete mode 100644 tests/api_resources/addressing/prefixes/bgp/test_bindings.py delete mode 100644 tests/api_resources/addressing/prefixes/bgp/test_prefixes.py delete mode 100644 tests/api_resources/addressing/prefixes/bgp/test_statuses.py create mode 100644 tests/api_resources/addressing/prefixes/test_advertisement_status.py create mode 100644 tests/api_resources/addressing/prefixes/test_bgp_prefixes.py create mode 100644 tests/api_resources/addressing/prefixes/test_service_bindings.py rename tests/api_resources/{addressing/prefixes/bgp => ai}/__init__.py (100%) rename tests/api_resources/{workers/ai => ai/finetunes}/__init__.py (100%) create mode 100644 tests/api_resources/ai/finetunes/test_assets.py create mode 100644 tests/api_resources/ai/finetunes/test_public.py rename tests/api_resources/{workers => }/ai/models/__init__.py (100%) rename tests/api_resources/{workers => }/ai/models/test_schema.py (85%) create mode 100644 tests/api_resources/ai/test_authors.py create mode 100644 tests/api_resources/ai/test_finetunes.py create mode 100644 tests/api_resources/ai/test_models.py create mode 100644 tests/api_resources/ai/test_tasks.py create mode 100644 tests/api_resources/test_abuse_reports.py rename tests/api_resources/{workers => }/test_ai.py (87%) create mode 100644 tests/api_resources/workers/test_routes.py create mode 100644 tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_asset_upload.py create mode 100644 tests/api_resources/zero_trust/access/test_gateway_ca.py create mode 100644 tests/api_resources/zero_trust/dex/commands/test_devices.py create mode 100644 tests/api_resources/zero_trust/dex/commands/test_users.py rename {src/cloudflare/types/workers/ai => tests/api_resources/zero_trust/dlp/email}/__init__.py (70%) create mode 100644 tests/api_resources/zero_trust/dlp/email/test_account_mapping.py create mode 100644 tests/api_resources/zero_trust/dlp/email/test_rules.py diff --git a/.stats.yml b/.stats.yml index 9709f00a3ac..3b06a3c53b3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 1460 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6bb90de90ae3ffcac71bd91b9ad7338325a7ca45b28c334b686b427877b4d849.yml +configured_endpoints: 1494 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-817b1412335b2bc367169247bf8a10b29dbadb82b77df71df5ef5f3470fc974b.yml diff --git a/api.md b/api.md index 018bdbfda7a..23c7913ee2d 100644 --- a/api.md +++ b/api.md @@ -123,6 +123,20 @@ Methods: - client.accounts.tokens.value.update(token_id, \*, account_id, \*\*params) -> str +## Logs + +### Audit + +Types: + +```python +from cloudflare.types.accounts.logs import AuditListResponse +``` + +Methods: + +- client.accounts.logs.audit.list(\*, account_id, \*\*params) -> SyncCursorLimitPagination[AuditListResponse] + # OriginCACertificates Types: @@ -334,6 +348,7 @@ Types: ```python from cloudflare.types.zones import ( AdvancedDDoS, + Aegis, AlwaysOnline, AlwaysUseHTTPS, AutomaticHTTPSRewrites, @@ -416,7 +431,8 @@ from cloudflare.types.zones import ZoneHold Methods: - client.zones.holds.create(\*, zone_id, \*\*params) -> ZoneHold -- client.zones.holds.delete(\*, zone_id, \*\*params) -> Optional[ZoneHold] +- client.zones.holds.delete(\*, zone_id, \*\*params) -> ZoneHold +- client.zones.holds.edit(\*, zone_id, \*\*params) -> ZoneHold - client.zones.holds.get(\*, zone_id) -> ZoneHold ## Subscriptions @@ -649,10 +665,10 @@ from cloudflare.types.cache import ( Methods: -- client.cache.cache_reserve.clear(\*, zone_id, \*\*params) -> CacheReserveClearResponse -- client.cache.cache_reserve.edit(\*, zone_id, \*\*params) -> CacheReserveEditResponse -- client.cache.cache_reserve.get(\*, zone_id) -> CacheReserveGetResponse -- client.cache.cache_reserve.status(\*, zone_id) -> CacheReserveStatusResponse +- client.cache.cache_reserve.clear(\*, zone_id, \*\*params) -> Optional[CacheReserveClearResponse] +- client.cache.cache_reserve.edit(\*, zone_id, \*\*params) -> Optional[CacheReserveEditResponse] +- client.cache.cache_reserve.get(\*, zone_id) -> Optional[CacheReserveGetResponse] +- client.cache.cache_reserve.status(\*, zone_id) -> Optional[CacheReserveStatusResponse] ## SmartTieredCache @@ -668,23 +684,28 @@ from cloudflare.types.cache import ( Methods: -- client.cache.smart_tiered_cache.delete(\*, zone_id) -> SmartTieredCacheDeleteResponse -- client.cache.smart_tiered_cache.edit(\*, zone_id, \*\*params) -> SmartTieredCacheEditResponse -- client.cache.smart_tiered_cache.get(\*, zone_id) -> SmartTieredCacheGetResponse +- client.cache.smart_tiered_cache.delete(\*, zone_id) -> Optional[SmartTieredCacheDeleteResponse] +- client.cache.smart_tiered_cache.edit(\*, zone_id, \*\*params) -> Optional[SmartTieredCacheEditResponse] +- client.cache.smart_tiered_cache.get(\*, zone_id) -> Optional[SmartTieredCacheGetResponse] ## Variants Types: ```python -from cloudflare.types.cache import CacheVariant, VariantEditResponse, VariantGetResponse +from cloudflare.types.cache import ( + CacheVariant, + VariantDeleteResponse, + VariantEditResponse, + VariantGetResponse, +) ``` Methods: -- client.cache.variants.delete(\*, zone_id) -> CacheVariant -- client.cache.variants.edit(\*, zone_id, \*\*params) -> VariantEditResponse -- client.cache.variants.get(\*, zone_id) -> VariantGetResponse +- client.cache.variants.delete(\*, zone_id) -> Optional[VariantDeleteResponse] +- client.cache.variants.edit(\*, zone_id, \*\*params) -> Optional[VariantEditResponse] +- client.cache.variants.get(\*, zone_id) -> Optional[VariantGetResponse] ## RegionalTieredCache @@ -700,8 +721,8 @@ from cloudflare.types.cache import ( Methods: -- client.cache.regional_tiered_cache.edit(\*, zone_id, \*\*params) -> RegionalTieredCacheEditResponse -- client.cache.regional_tiered_cache.get(\*, zone_id) -> RegionalTieredCacheGetResponse +- client.cache.regional_tiered_cache.edit(\*, zone_id, \*\*params) -> Optional[RegionalTieredCacheEditResponse] +- client.cache.regional_tiered_cache.get(\*, zone_id) -> Optional[RegionalTieredCacheGetResponse] # SSL @@ -835,8 +856,8 @@ from cloudflare.types.argo import TieredCachingEditResponse, TieredCachingGetRes Methods: -- client.argo.tiered_caching.edit(\*, zone_id, \*\*params) -> TieredCachingEditResponse -- client.argo.tiered_caching.get(\*, zone_id) -> TieredCachingGetResponse +- client.argo.tiered_caching.edit(\*, zone_id, \*\*params) -> Optional[TieredCachingEditResponse] +- client.argo.tiered_caching.get(\*, zone_id) -> Optional[TieredCachingGetResponse] # CertificateAuthorities @@ -1053,6 +1074,8 @@ Types: from cloudflare.types.dns import ( ARecord, AAAARecord, + BatchPatch, + BatchPut, CAARecord, CERTRecord, CNAMERecord, @@ -1065,7 +1088,7 @@ from cloudflare.types.dns import ( NSRecord, PTRRecord, Record, - RecordProcessTiming, + RecordResponse, RecordTags, SMIMEARecord, SRVRecord, @@ -1075,14 +1098,9 @@ from cloudflare.types.dns import ( TTL, TXTRecord, URIRecord, - RecordCreateResponse, - RecordUpdateResponse, - RecordListResponse, RecordDeleteResponse, RecordBatchResponse, - RecordEditResponse, RecordExportResponse, - RecordGetResponse, RecordImportResponse, RecordScanResponse, ) @@ -1090,14 +1108,14 @@ from cloudflare.types.dns import ( Methods: -- client.dns.records.create(\*, zone_id, \*\*params) -> Optional[RecordCreateResponse] -- client.dns.records.update(dns_record_id, \*, zone_id, \*\*params) -> Optional[RecordUpdateResponse] -- client.dns.records.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[RecordListResponse] +- client.dns.records.create(\*, zone_id, \*\*params) -> Optional[RecordResponse] +- client.dns.records.update(dns_record_id, \*, zone_id, \*\*params) -> Optional[RecordResponse] +- client.dns.records.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[RecordResponse] - client.dns.records.delete(dns_record_id, \*, zone_id) -> Optional[RecordDeleteResponse] - client.dns.records.batch(\*, zone_id, \*\*params) -> Optional[RecordBatchResponse] -- client.dns.records.edit(dns_record_id, \*, zone_id, \*\*params) -> Optional[RecordEditResponse] +- client.dns.records.edit(dns_record_id, \*, zone_id, \*\*params) -> Optional[RecordResponse] - client.dns.records.export(\*, zone_id) -> str -- client.dns.records.get(dns_record_id, \*, zone_id) -> Optional[RecordGetResponse] +- client.dns.records.get(dns_record_id, \*, zone_id) -> Optional[RecordResponse] - client.dns.records.import\_(\*, zone_id, \*\*params) -> Optional[RecordImportResponse] - client.dns.records.scan(\*, zone_id, \*\*params) -> Optional[RecordScanResponse] @@ -1912,12 +1930,17 @@ Methods: Types: ```python -from cloudflare.types.logpush import ValidateDestinationResponse, ValidateOriginResponse +from cloudflare.types.logpush import ( + ValidateDestinationResponse, + ValidateDestinationExistsResponse, + ValidateOriginResponse, +) ``` Methods: -- client.logpush.validate.destination(\*, account_id, zone_id, \*\*params) -> Optional[ValidateDestinationResponse] +- client.logpush.validate.destination(\*, account_id, zone_id, \*\*params) -> Optional[ValidateDestinationResponse] +- client.logpush.validate.destination_exists(\*, account_id, zone_id, \*\*params) -> Optional[ValidateDestinationExistsResponse] - client.logpush.validate.origin(\*, account_id, zone_id, \*\*params) -> Optional[ValidateOriginResponse] # Logs @@ -2273,48 +2296,30 @@ Methods: Types: ```python -from cloudflare.types.workers import ( - Binding, - D1Binding, - DispatchNamespaceBinding, - DurableObjectBinding, - KVNamespaceBinding, - MigrationStep, - MTLSCERTBinding, - PlacementConfiguration, - R2Binding, - ServiceBinding, - SingleStepMigration, - SteppedMigration, - WorkerMetadata, -) +from cloudflare.types.workers import MigrationStep, SingleStepMigration, WorkerMetadata ``` -## AI - -Types: - -```python -from cloudflare.types.workers import AIRunResponse -``` - -Methods: - -- client.workers.ai.run(model_name, \*, account_id, \*\*params) -> Optional[AIRunResponse] - -### Models - -#### Schema +## Routes Types: ```python -from cloudflare.types.workers.ai.models import SchemaGetResponse +from cloudflare.types.workers import ( + RouteCreateResponse, + RouteUpdateResponse, + RouteListResponse, + RouteDeleteResponse, + RouteGetResponse, +) ``` Methods: -- client.workers.ai.models.schema.get(\*, account_id, \*\*params) -> object +- client.workers.routes.create(\*, zone_id, \*\*params) -> RouteCreateResponse +- client.workers.routes.update(route_id, \*, zone_id, \*\*params) -> Optional[RouteUpdateResponse] +- client.workers.routes.list(\*, zone_id) -> SyncSinglePage[RouteListResponse] +- client.workers.routes.delete(route_id, \*, zone_id) -> RouteDeleteResponse +- client.workers.routes.get(route_id, \*, zone_id) -> Optional[RouteGetResponse] ## Assets @@ -2335,7 +2340,7 @@ Methods: Types: ```python -from cloudflare.types.workers import Script, ScriptSetting, ScriptUpdateResponse +from cloudflare.types.workers import Script, ScriptSetting, ScriptUpdateResponse, ScriptGetResponse ``` Methods: @@ -2343,7 +2348,7 @@ Methods: - client.workers.scripts.update(script_name, \*, account_id, \*\*params) -> Optional[ScriptUpdateResponse] - client.workers.scripts.list(\*, account_id) -> SyncSinglePage[Script] - client.workers.scripts.delete(script_name, \*, account_id, \*\*params) -> None -- client.workers.scripts.get(script_name, \*, account_id) -> BinaryAPIResponse +- client.workers.scripts.get(script_name, \*, account_id) -> str ### Assets @@ -2692,6 +2697,7 @@ from cloudflare.types.api_gateway import ( OperationCreateResponse, OperationListResponse, OperationDeleteResponse, + OperationBulkCreateResponse, OperationBulkDeleteResponse, OperationGetResponse, ) @@ -2699,9 +2705,10 @@ from cloudflare.types.api_gateway import ( Methods: -- client.api_gateway.operations.create(\*, zone_id, \*\*params) -> OperationCreateResponse +- client.api_gateway.operations.create(\*, zone_id, \*\*params) -> OperationCreateResponse - client.api_gateway.operations.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[OperationListResponse] - client.api_gateway.operations.delete(operation_id, \*, zone_id) -> OperationDeleteResponse +- client.api_gateway.operations.bulk_create(\*, zone_id, \*\*params) -> OperationBulkCreateResponse - client.api_gateway.operations.bulk_delete(\*, zone_id) -> OperationBulkDeleteResponse - client.api_gateway.operations.get(operation_id, \*, zone_id, \*\*params) -> OperationGetResponse @@ -2816,7 +2823,6 @@ Types: ```python from cloudflare.types.managed_transforms import ( - RequestModel, ManagedTransformListResponse, ManagedTransformEditResponse, ) @@ -2825,6 +2831,7 @@ from cloudflare.types.managed_transforms import ( Methods: - client.managed_transforms.list(\*, zone_id) -> ManagedTransformListResponse +- client.managed_transforms.delete(\*, zone_id) -> None - client.managed_transforms.edit(\*, zone_id, \*\*params) -> ManagedTransformEditResponse # PageShield @@ -3016,6 +3023,7 @@ from cloudflare.types.url_normalization import ( Methods: - client.url_normalization.update(\*, zone_id, \*\*params) -> URLNormalizationUpdateResponse +- client.url_normalization.delete(\*, zone_id) -> None - client.url_normalization.get(\*, zone_id) -> URLNormalizationGetResponse # Spectrum @@ -3215,13 +3223,8 @@ from cloudflare.types.addressing import LOADocumentCreateResponse Methods: -- client.addressing.loa_documents.create(\*, account_id, \*\*params) -> Optional[LOADocumentCreateResponse] - -### Downloads - -Methods: - -- client.addressing.loa_documents.downloads.get(loa_document_id, \*, account_id) -> BinaryAPIResponse +- client.addressing.loa_documents.create(\*, account_id, \*\*params) -> Optional[LOADocumentCreateResponse] +- client.addressing.loa_documents.get(loa_document_id, \*, account_id) -> BinaryAPIResponse ## Prefixes @@ -3239,49 +3242,51 @@ Methods: - client.addressing.prefixes.edit(prefix_id, \*, account_id, \*\*params) -> Optional[Prefix] - client.addressing.prefixes.get(prefix_id, \*, account_id) -> Optional[Prefix] -### BGP - -#### Bindings +### ServiceBindings Types: ```python -from cloudflare.types.addressing.prefixes.bgp import ServiceBinding, BindingDeleteResponse +from cloudflare.types.addressing.prefixes import ServiceBinding, ServiceBindingDeleteResponse ``` Methods: -- client.addressing.prefixes.bgp.bindings.create(prefix_id, \*, account_id, \*\*params) -> Optional[ServiceBinding] -- client.addressing.prefixes.bgp.bindings.list(prefix_id, \*, account_id) -> SyncSinglePage[ServiceBinding] -- client.addressing.prefixes.bgp.bindings.delete(binding_id, \*, account_id, prefix_id) -> BindingDeleteResponse -- client.addressing.prefixes.bgp.bindings.get(binding_id, \*, account_id, prefix_id) -> Optional[ServiceBinding] +- client.addressing.prefixes.service_bindings.create(prefix_id, \*, account_id, \*\*params) -> Optional[ServiceBinding] +- client.addressing.prefixes.service_bindings.list(prefix_id, \*, account_id) -> SyncSinglePage[ServiceBinding] +- client.addressing.prefixes.service_bindings.delete(binding_id, \*, account_id, prefix_id) -> ServiceBindingDeleteResponse +- client.addressing.prefixes.service_bindings.get(binding_id, \*, account_id, prefix_id) -> Optional[ServiceBinding] -#### Prefixes +### BGPPrefixes Types: ```python -from cloudflare.types.addressing.prefixes.bgp import BGPPrefix +from cloudflare.types.addressing.prefixes import BGPPrefix ``` Methods: -- client.addressing.prefixes.bgp.prefixes.list(prefix_id, \*, account_id) -> SyncSinglePage[BGPPrefix] -- client.addressing.prefixes.bgp.prefixes.edit(bgp_prefix_id, \*, account_id, prefix_id, \*\*params) -> Optional[BGPPrefix] -- client.addressing.prefixes.bgp.prefixes.get(bgp_prefix_id, \*, account_id, prefix_id) -> Optional[BGPPrefix] +- client.addressing.prefixes.bgp_prefixes.create(prefix_id, \*, account_id, \*\*params) -> Optional[BGPPrefix] +- client.addressing.prefixes.bgp_prefixes.list(prefix_id, \*, account_id) -> SyncSinglePage[BGPPrefix] +- client.addressing.prefixes.bgp_prefixes.edit(bgp_prefix_id, \*, account_id, prefix_id, \*\*params) -> Optional[BGPPrefix] +- client.addressing.prefixes.bgp_prefixes.get(bgp_prefix_id, \*, account_id, prefix_id) -> Optional[BGPPrefix] -#### Statuses +### AdvertisementStatus Types: ```python -from cloudflare.types.addressing.prefixes.bgp import StatusEditResponse, StatusGetResponse +from cloudflare.types.addressing.prefixes import ( + AdvertisementStatusEditResponse, + AdvertisementStatusGetResponse, +) ``` Methods: -- client.addressing.prefixes.bgp.statuses.edit(prefix_id, \*, account_id, \*\*params) -> Optional[StatusEditResponse] -- client.addressing.prefixes.bgp.statuses.get(prefix_id, \*, account_id) -> Optional[StatusGetResponse] +- client.addressing.prefixes.advertisement_status.edit(prefix_id, \*, account_id, \*\*params) -> Optional[AdvertisementStatusEditResponse] +- client.addressing.prefixes.advertisement_status.get(prefix_id, \*, account_id) -> Optional[AdvertisementStatusGetResponse] ### Delegations @@ -4724,6 +4729,20 @@ Methods: - client.workers_for_platforms.dispatch.namespaces.scripts.delete(script_name, \*, account_id, dispatch_namespace, \*\*params) -> None - client.workers_for_platforms.dispatch.namespaces.scripts.get(script_name, \*, account_id, dispatch_namespace) -> Optional[Script] +##### AssetUpload + +Types: + +```python +from cloudflare.types.workers_for_platforms.dispatch.namespaces.scripts import ( + AssetUploadCreateResponse, +) +``` + +Methods: + +- client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.create(script_name, \*, account_id, dispatch_namespace, \*\*params) -> Optional[AssetUploadCreateResponse] + ##### Content Methods: @@ -4809,7 +4828,7 @@ from cloudflare.types.zero_trust import Device, DeviceGetResponse Methods: - client.zero_trust.devices.list(\*, account_id) -> SyncSinglePage[Device] -- client.zero_trust.devices.get(device_id, \*, account_id) -> DeviceGetResponse +- client.zero_trust.devices.get(device_id, \*, account_id) -> Optional[DeviceGetResponse] ### DEXTests @@ -4858,7 +4877,7 @@ from cloudflare.types.zero_trust.devices import FleetStatusGetResponse Methods: -- client.zero_trust.devices.fleet_status.get(device_id, \*, account_id, \*\*params) -> FleetStatusGetResponse +- client.zero_trust.devices.fleet_status.get(device_id, \*, account_id, \*\*params) -> FleetStatusGetResponse ### Policies @@ -4949,8 +4968,8 @@ from cloudflare.types.zero_trust.devices.policies.default import ( Methods: -- client.zero_trust.devices.policies.default.certificates.edit(\*, zone_id, \*\*params) -> CertificateEditResponse -- client.zero_trust.devices.policies.default.certificates.get(\*, zone_id) -> CertificateGetResponse +- client.zero_trust.devices.policies.default.certificates.edit(\*, zone_id, \*\*params) -> Optional[CertificateEditResponse] +- client.zero_trust.devices.policies.default.certificates.get(\*, zone_id) -> Optional[CertificateGetResponse] #### Custom @@ -5064,7 +5083,7 @@ Methods: - client.zero_trust.devices.posture.integrations.create(\*, account_id, \*\*params) -> Optional[Integration] - client.zero_trust.devices.posture.integrations.list(\*, account_id) -> SyncSinglePage[Integration] -- client.zero_trust.devices.posture.integrations.delete(integration_id, \*, account_id) -> IntegrationDeleteResponse +- client.zero_trust.devices.posture.integrations.delete(integration_id, \*, account_id) -> Optional[IntegrationDeleteResponse] - client.zero_trust.devices.posture.integrations.edit(integration_id, \*, account_id, \*\*params) -> Optional[Integration] - client.zero_trust.devices.posture.integrations.get(integration_id, \*, account_id) -> Optional[Integration] @@ -5078,7 +5097,7 @@ from cloudflare.types.zero_trust.devices import RevokeCreateResponse Methods: -- client.zero_trust.devices.revoke.create(\*, account_id, \*\*params) -> RevokeCreateResponse +- client.zero_trust.devices.revoke.create(\*, account_id, \*\*params) -> Optional[RevokeCreateResponse] ### Settings @@ -5104,7 +5123,7 @@ from cloudflare.types.zero_trust.devices import UnrevokeCreateResponse Methods: -- client.zero_trust.devices.unrevoke.create(\*, account_id, \*\*params) -> UnrevokeCreateResponse +- client.zero_trust.devices.unrevoke.create(\*, account_id, \*\*params) -> Optional[UnrevokeCreateResponse] ### OverrideCodes @@ -5211,6 +5230,24 @@ from cloudflare.types.zero_trust import ( ) ``` +### GatewayCA + +Types: + +```python +from cloudflare.types.zero_trust.access import ( + GatewayCACreateResponse, + GatewayCAListResponse, + GatewayCADeleteResponse, +) +``` + +Methods: + +- client.zero_trust.access.gateway_ca.create(\*, account_id) -> Optional[GatewayCACreateResponse] +- client.zero_trust.access.gateway_ca.list(\*, account_id) -> SyncSinglePage[GatewayCAListResponse] +- client.zero_trust.access.gateway_ca.delete(certificate_id, \*, account_id) -> Optional[GatewayCADeleteResponse] + ### Infrastructure #### Targets @@ -5614,14 +5651,38 @@ from cloudflare.types.zero_trust.dex import CommandCreateResponse, CommandListRe Methods: -- client.zero_trust.dex.commands.create(\*, account_id, \*\*params) -> Optional[CommandCreateResponse] -- client.zero_trust.dex.commands.list(\*, account_id, \*\*params) -> SyncV4PagePagination[Optional[CommandListResponse]] +- client.zero_trust.dex.commands.create(\*, account_id, \*\*params) -> Optional[CommandCreateResponse] +- client.zero_trust.dex.commands.list(\*, account_id, \*\*params) -> SyncV4PagePagination[Optional[CommandListResponse]] + +#### Users + +Types: + +```python +from cloudflare.types.zero_trust.dex.commands import UserListResponse +``` + +Methods: + +- client.zero_trust.dex.commands.users.list(\*, account_id, \*\*params) -> Optional[UserListResponse] + +#### Devices + +Types: + +```python +from cloudflare.types.zero_trust.dex.commands import DeviceListResponse +``` + +Methods: + +- client.zero_trust.dex.commands.devices.list(\*, account_id, \*\*params) -> SyncV4PagePagination[Optional[DeviceListResponse]] #### Downloads Methods: -- client.zero_trust.dex.commands.downloads.get(filename, \*, account_id, command_id) -> BinaryAPIResponse +- client.zero_trust.dex.commands.downloads.get(filename, \*, account_id, command_id) -> BinaryAPIResponse #### Quota @@ -5633,7 +5694,7 @@ from cloudflare.types.zero_trust.dex.commands import QuotaGetResponse Methods: -- client.zero_trust.dex.commands.quota.get(\*, account_id) -> Optional[QuotaGetResponse] +- client.zero_trust.dex.commands.quota.get(\*, account_id) -> Optional[QuotaGetResponse] ### Colos @@ -5954,6 +6015,48 @@ Methods: - client.zero_trust.dlp.payload_logs.update(\*, account_id, \*\*params) -> Optional[PayloadLogUpdateResponse] - client.zero_trust.dlp.payload_logs.get(\*, account_id) -> Optional[PayloadLogGetResponse] +### Email + +#### AccountMapping + +Types: + +```python +from cloudflare.types.zero_trust.dlp.email import ( + AccountMappingCreateResponse, + AccountMappingGetResponse, +) +``` + +Methods: + +- client.zero_trust.dlp.email.account_mapping.create(\*, account_id, \*\*params) -> Optional[AccountMappingCreateResponse] +- client.zero_trust.dlp.email.account_mapping.get(\*, account_id) -> Optional[AccountMappingGetResponse] + +#### Rules + +Types: + +```python +from cloudflare.types.zero_trust.dlp.email import ( + RuleCreateResponse, + RuleUpdateResponse, + RuleListResponse, + RuleDeleteResponse, + RuleBulkEditResponse, + RuleGetResponse, +) +``` + +Methods: + +- client.zero_trust.dlp.email.rules.create(\*, account_id, \*\*params) -> Optional[RuleCreateResponse] +- client.zero_trust.dlp.email.rules.update(rule_id, \*, account_id, \*\*params) -> Optional[RuleUpdateResponse] +- client.zero_trust.dlp.email.rules.list(\*, account_id) -> SyncSinglePage[RuleListResponse] +- client.zero_trust.dlp.email.rules.delete(rule_id, \*, account_id) -> Optional[RuleDeleteResponse] +- client.zero_trust.dlp.email.rules.bulk_edit(\*, account_id, \*\*params) -> Optional[RuleBulkEditResponse] +- client.zero_trust.dlp.email.rules.get(rule_id, \*, account_id) -> Optional[RuleGetResponse] + ### Profiles Types: @@ -6495,7 +6598,7 @@ Methods: - client.vectorize.indexes.create(\*, account_id, \*\*params) -> Optional[CreateIndex] - client.vectorize.indexes.list(\*, account_id) -> SyncSinglePage[CreateIndex] -- client.vectorize.indexes.delete(index_name, \*, account_id) -> IndexDeleteResponse +- client.vectorize.indexes.delete(index_name, \*, account_id) -> Optional[IndexDeleteResponse] - client.vectorize.indexes.delete_by_ids(index_name, \*, account_id, \*\*params) -> Optional[IndexDeleteByIDsResponse] - client.vectorize.indexes.get(index_name, \*, account_id) -> Optional[CreateIndex] - client.vectorize.indexes.get_by_ids(index_name, \*, account_id, \*\*params) -> object @@ -6540,7 +6643,7 @@ from cloudflare.types.url_scanner import ResponseGetResponse Methods: -- client.url_scanner.responses.get(response_id, \*, account_id) -> str +- client.url_scanner.responses.get(response_id, \*, account_id) -> str ## Scans @@ -6559,13 +6662,13 @@ from cloudflare.types.url_scanner import ( Methods: -- client.url_scanner.scans.create(account_id, \*\*params) -> str -- client.url_scanner.scans.list(account_id, \*\*params) -> ScanListResponse -- client.url_scanner.scans.bulk_create(account_id, \*\*params) -> ScanBulkCreateResponse -- client.url_scanner.scans.dom(scan_id, \*, account_id) -> str -- client.url_scanner.scans.get(scan_id, \*, account_id) -> ScanGetResponse -- client.url_scanner.scans.har(scan_id, \*, account_id) -> ScanHARResponse -- client.url_scanner.scans.screenshot(scan_id, \*, account_id, \*\*params) -> BinaryAPIResponse +- client.url_scanner.scans.create(\*, account_id, \*\*params) -> str +- client.url_scanner.scans.list(\*, account_id, \*\*params) -> ScanListResponse +- client.url_scanner.scans.bulk_create(\*, account_id, \*\*params) -> ScanBulkCreateResponse +- client.url_scanner.scans.dom(scan_id, \*, account_id) -> str +- client.url_scanner.scans.get(scan_id, \*, account_id) -> ScanGetResponse +- client.url_scanner.scans.har(scan_id, \*, account_id) -> ScanHARResponse +- client.url_scanner.scans.screenshot(scan_id, \*, account_id, \*\*params) -> BinaryAPIResponse # Radar @@ -7740,8 +7843,8 @@ from cloudflare.types.origin_post_quantum_encryption import ( Methods: -- client.origin_post_quantum_encryption.update(\*, zone_id, \*\*params) -> OriginPostQuantumEncryptionUpdateResponse -- client.origin_post_quantum_encryption.get(\*, zone_id) -> OriginPostQuantumEncryptionGetResponse +- client.origin_post_quantum_encryption.update(\*, zone_id, \*\*params) -> Optional[OriginPostQuantumEncryptionUpdateResponse] +- client.origin_post_quantum_encryption.get(\*, zone_id) -> Optional[OriginPostQuantumEncryptionGetResponse] # Speed @@ -8415,3 +8518,112 @@ from cloudflare.types.content_scanning import SettingGetResponse Methods: - client.content_scanning.settings.get(\*, zone_id) -> SettingGetResponse + +# AbuseReports + +Types: + +```python +from cloudflare.types.abuse_reports import AbuseReportCreateResponse +``` + +Methods: + +- client.abuse_reports.create(report_type, \*, account_id, \*\*params) -> str + +# AI + +Types: + +```python +from cloudflare.types.ai import AIRunResponse +``` + +Methods: + +- client.ai.run(model_name, \*, account_id, \*\*params) -> Optional[AIRunResponse] + +## Finetunes + +Types: + +```python +from cloudflare.types.ai import FinetuneCreateResponse, FinetuneListResponse +``` + +Methods: + +- client.ai.finetunes.create(\*, account_id, \*\*params) -> FinetuneCreateResponse +- client.ai.finetunes.list(\*, account_id) -> FinetuneListResponse + +### Assets + +Types: + +```python +from cloudflare.types.ai.finetunes import AssetCreateResponse +``` + +Methods: + +- client.ai.finetunes.assets.create(finetune_id, \*, account_id, \*\*params) -> AssetCreateResponse + +### Public + +Types: + +```python +from cloudflare.types.ai.finetunes import PublicListResponse +``` + +Methods: + +- client.ai.finetunes.public.list(\*, account_id, \*\*params) -> SyncSinglePage[PublicListResponse] + +## Authors + +Types: + +```python +from cloudflare.types.ai import AuthorListResponse +``` + +Methods: + +- client.ai.authors.list(\*, account_id) -> SyncSinglePage[object] + +## Tasks + +Types: + +```python +from cloudflare.types.ai import TaskListResponse +``` + +Methods: + +- client.ai.tasks.list(\*, account_id) -> SyncSinglePage[object] + +## Models + +Types: + +```python +from cloudflare.types.ai import ModelListResponse +``` + +Methods: + +- client.ai.models.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[object] + +### Schema + +Types: + +```python +from cloudflare.types.ai.models import SchemaGetResponse +``` + +Methods: + +- client.ai.models.schema.get(\*, account_id, \*\*params) -> object diff --git a/src/cloudflare/_client.py b/src/cloudflare/_client.py index c3804a44877..f48b5ae2359 100644 --- a/src/cloudflare/_client.py +++ b/src/cloudflare/_client.py @@ -36,6 +36,7 @@ if TYPE_CHECKING: from .resources import ( + ai, d1, kv, r2, @@ -91,6 +92,7 @@ dns_firewall, healthchecks, security_txt, + abuse_reports, email_routing, magic_transit, waiting_rooms, @@ -122,6 +124,7 @@ origin_post_quantum_encryption, ) from .resources.ips import IPsResource, AsyncIPsResource + from .resources.ai.ai import AIResource, AsyncAIResource from .resources.d1.d1 import D1Resource, AsyncD1Resource from .resources.kv.kv import KVResource, AsyncKVResource from .resources.r2.r2 import R2Resource, AsyncR2Resource @@ -148,6 +151,7 @@ from .resources.speed.speed import SpeedResource, AsyncSpeedResource from .resources.zones.zones import ZonesResource, AsyncZonesResource from .resources.security_txt import SecurityTXTResource, AsyncSecurityTXTResource + from .resources.abuse_reports import AbuseReportsResource, AsyncAbuseReportsResource from .resources.images.images import ImagesResource, AsyncImagesResource from .resources.queues.queues import QueuesResource, AsyncQueuesResource from .resources.stream.stream import StreamResource, AsyncStreamResource @@ -816,6 +820,18 @@ def content_scanning(self) -> ContentScanningResource: return ContentScanningResource(self) + @cached_property + def abuse_reports(self) -> AbuseReportsResource: + from .resources.abuse_reports import AbuseReportsResource + + return AbuseReportsResource(self) + + @cached_property + def ai(self) -> AIResource: + from .resources.ai import AIResource + + return AIResource(self) + @cached_property def with_raw_response(self) -> CloudflareWithRawResponse: return CloudflareWithRawResponse(self) @@ -1575,6 +1591,18 @@ def content_scanning(self) -> AsyncContentScanningResource: return AsyncContentScanningResource(self) + @cached_property + def abuse_reports(self) -> AsyncAbuseReportsResource: + from .resources.abuse_reports import AsyncAbuseReportsResource + + return AsyncAbuseReportsResource(self) + + @cached_property + def ai(self) -> AsyncAIResource: + from .resources.ai import AsyncAIResource + + return AsyncAIResource(self) + @cached_property def with_raw_response(self) -> AsyncCloudflareWithRawResponse: return AsyncCloudflareWithRawResponse(self) @@ -2269,6 +2297,18 @@ def content_scanning(self) -> content_scanning.ContentScanningResourceWithRawRes return ContentScanningResourceWithRawResponse(self._client.content_scanning) + @cached_property + def abuse_reports(self) -> abuse_reports.AbuseReportsResourceWithRawResponse: + from .resources.abuse_reports import AbuseReportsResourceWithRawResponse + + return AbuseReportsResourceWithRawResponse(self._client.abuse_reports) + + @cached_property + def ai(self) -> ai.AIResourceWithRawResponse: + from .resources.ai import AIResourceWithRawResponse + + return AIResourceWithRawResponse(self._client.ai) + class AsyncCloudflareWithRawResponse: _client: AsyncCloudflare @@ -2782,6 +2822,18 @@ def content_scanning(self) -> content_scanning.AsyncContentScanningResourceWithR return AsyncContentScanningResourceWithRawResponse(self._client.content_scanning) + @cached_property + def abuse_reports(self) -> abuse_reports.AsyncAbuseReportsResourceWithRawResponse: + from .resources.abuse_reports import AsyncAbuseReportsResourceWithRawResponse + + return AsyncAbuseReportsResourceWithRawResponse(self._client.abuse_reports) + + @cached_property + def ai(self) -> ai.AsyncAIResourceWithRawResponse: + from .resources.ai import AsyncAIResourceWithRawResponse + + return AsyncAIResourceWithRawResponse(self._client.ai) + class CloudflareWithStreamedResponse: _client: Cloudflare @@ -3295,6 +3347,18 @@ def content_scanning(self) -> content_scanning.ContentScanningResourceWithStream return ContentScanningResourceWithStreamingResponse(self._client.content_scanning) + @cached_property + def abuse_reports(self) -> abuse_reports.AbuseReportsResourceWithStreamingResponse: + from .resources.abuse_reports import AbuseReportsResourceWithStreamingResponse + + return AbuseReportsResourceWithStreamingResponse(self._client.abuse_reports) + + @cached_property + def ai(self) -> ai.AIResourceWithStreamingResponse: + from .resources.ai import AIResourceWithStreamingResponse + + return AIResourceWithStreamingResponse(self._client.ai) + class AsyncCloudflareWithStreamedResponse: _client: AsyncCloudflare @@ -3818,6 +3882,18 @@ def content_scanning(self) -> content_scanning.AsyncContentScanningResourceWithS return AsyncContentScanningResourceWithStreamingResponse(self._client.content_scanning) + @cached_property + def abuse_reports(self) -> abuse_reports.AsyncAbuseReportsResourceWithStreamingResponse: + from .resources.abuse_reports import AsyncAbuseReportsResourceWithStreamingResponse + + return AsyncAbuseReportsResourceWithStreamingResponse(self._client.abuse_reports) + + @cached_property + def ai(self) -> ai.AsyncAIResourceWithStreamingResponse: + from .resources.ai import AsyncAIResourceWithStreamingResponse + + return AsyncAIResourceWithStreamingResponse(self._client.ai) + Client = Cloudflare diff --git a/src/cloudflare/resources/abuse_reports.py b/src/cloudflare/resources/abuse_reports.py new file mode 100644 index 00000000000..a81ce3c43a6 --- /dev/null +++ b/src/cloudflare/resources/abuse_reports.py @@ -0,0 +1,492 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, cast +from typing_extensions import Literal + +import httpx + +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import ( + maybe_transform, + async_maybe_transform, +) +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .._wrappers import ResultWrapper +from .._base_client import make_request_options +from ..types.abuse_reports import abuse_report_create_params +from ..types.abuse_reports.abuse_report_create_response import AbuseReportCreateResponse + +__all__ = ["AbuseReportsResource", "AsyncAbuseReportsResource"] + + +class AbuseReportsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> AbuseReportsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AbuseReportsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AbuseReportsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AbuseReportsResourceWithStreamingResponse(self) + + def create( + self, + report_type: Literal[ + "abuse_dmca", + "abuse_trademark", + "abuse_general", + "abuse_phishing", + "abuse_children", + "abuse_threat", + "abuse_registrar_whois", + "abuse_ncsei", + ], + *, + account_id: str, + act: Literal[ + "abuse_dmca", + "abuse_trademark", + "abuse_general", + "abuse_phishing", + "abuse_children", + "abuse_threat", + "abuse_registrar_whois", + "abuse_ncsei", + ], + email: str, + email2: str, + host_notification: Literal["send", "send-anon", "none"], + ncmec_notification: Literal["send", "send-anon", "none"], + owner_notification: Literal["send", "send-anon", "none"], + urls: str, + address1: str | NotGiven = NOT_GIVEN, + agent_name: str | NotGiven = NOT_GIVEN, + agree: Literal[0, 1] | NotGiven = NOT_GIVEN, + city: str | NotGiven = NOT_GIVEN, + comments: str | NotGiven = NOT_GIVEN, + company: str | NotGiven = NOT_GIVEN, + country: str | NotGiven = NOT_GIVEN, + destination_ips: str | NotGiven = NOT_GIVEN, + justification: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + ncsei_subject_representation: bool | NotGiven = NOT_GIVEN, + original_work: str | NotGiven = NOT_GIVEN, + ports_protocols: str | NotGiven = NOT_GIVEN, + signature: str | NotGiven = NOT_GIVEN, + source_ips: str | NotGiven = NOT_GIVEN, + state: str | NotGiven = NOT_GIVEN, + tele: str | NotGiven = NOT_GIVEN, + title: str | NotGiven = NOT_GIVEN, + trademark_number: str | NotGiven = NOT_GIVEN, + trademark_office: str | NotGiven = NOT_GIVEN, + trademark_symbol: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Submit the Abuse Report of a particular type + + Args: + report_type: The abuse report type + + act: The abuse report type + + email: A valid email of the abuse reporter + + email2: Should match the value provided in `email` + + host_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark + reports cannot be anonymous. + + ncmec_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark + reports cannot be anonymous. + + owner_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark + reports cannot be anonymous. + + urls: A list of valid URLs separated by ‘ ’ (new line character). The list of the URLs + should not exceed 250 URLs. All URLs should have the same hostname. Each URL + should be unique + + address1: Text not exceeding 100 characters + + agent_name: The name of the copyright holder. Text not exceeding 60 characters. + + agree: Can be 0 or 1 + + city: Text not exceeding 255 characters + + comments: Any additional comments about the infringement not exceeding 2000 characters + + company: Text not exceeding 100 characters + + country: Text not exceeding 255 characters + + destination_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of + destination IPs should not exceed 30 IP addresses. Each one of the IP addresses + ought to be unique + + justification: A detailed description of the infringement, including any necessary access + details and the exact steps needed to view the content, not exceeding 5000 + characters + + name: Text not exceeding 255 characters + + ncsei_subject_representation: If the submitter is the target of NCSEI in the URLs of the abuse report + + original_work: Text not exceeding 255 characters + + ports_protocols: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. The total + size of the field should not exceed 2000 characters. Each individual + port/protocol should not exceed 100 characters. The list should not have more + than 30 unique ports and protocols. + + signature: Required for DMCA reports, should be same as Name. An affirmation that all + information in the report is true and accurate while agreeing to the policies of + Cloudflare's abuse reports + + source_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of source + IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be + unique + + state: Text not exceeding 255 characters + + tele: Text not exceeding 20 characters + + title: Text not exceeding 255 characters + + trademark_number: Text not exceeding 1000 characters + + trademark_office: Text not exceeding 1000 characters + + trademark_symbol: Text not exceeding 1000 characters + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not report_type: + raise ValueError(f"Expected a non-empty value for `report_type` but received {report_type!r}") + return self._post( + f"/accounts/{account_id}/abuse-reports/{report_type}", + body=maybe_transform( + { + "act": act, + "email": email, + "email2": email2, + "host_notification": host_notification, + "ncmec_notification": ncmec_notification, + "owner_notification": owner_notification, + "urls": urls, + "address1": address1, + "agent_name": agent_name, + "agree": agree, + "city": city, + "comments": comments, + "company": company, + "country": country, + "destination_ips": destination_ips, + "justification": justification, + "name": name, + "ncsei_subject_representation": ncsei_subject_representation, + "original_work": original_work, + "ports_protocols": ports_protocols, + "signature": signature, + "source_ips": source_ips, + "state": state, + "tele": tele, + "title": title, + "trademark_number": trademark_number, + "trademark_office": trademark_office, + "trademark_symbol": trademark_symbol, + }, + abuse_report_create_params.AbuseReportCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[AbuseReportCreateResponse]._unwrapper, + ), + cast_to=cast(Type[str], ResultWrapper[str]), + ) + + +class AsyncAbuseReportsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncAbuseReportsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncAbuseReportsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncAbuseReportsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncAbuseReportsResourceWithStreamingResponse(self) + + async def create( + self, + report_type: Literal[ + "abuse_dmca", + "abuse_trademark", + "abuse_general", + "abuse_phishing", + "abuse_children", + "abuse_threat", + "abuse_registrar_whois", + "abuse_ncsei", + ], + *, + account_id: str, + act: Literal[ + "abuse_dmca", + "abuse_trademark", + "abuse_general", + "abuse_phishing", + "abuse_children", + "abuse_threat", + "abuse_registrar_whois", + "abuse_ncsei", + ], + email: str, + email2: str, + host_notification: Literal["send", "send-anon", "none"], + ncmec_notification: Literal["send", "send-anon", "none"], + owner_notification: Literal["send", "send-anon", "none"], + urls: str, + address1: str | NotGiven = NOT_GIVEN, + agent_name: str | NotGiven = NOT_GIVEN, + agree: Literal[0, 1] | NotGiven = NOT_GIVEN, + city: str | NotGiven = NOT_GIVEN, + comments: str | NotGiven = NOT_GIVEN, + company: str | NotGiven = NOT_GIVEN, + country: str | NotGiven = NOT_GIVEN, + destination_ips: str | NotGiven = NOT_GIVEN, + justification: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + ncsei_subject_representation: bool | NotGiven = NOT_GIVEN, + original_work: str | NotGiven = NOT_GIVEN, + ports_protocols: str | NotGiven = NOT_GIVEN, + signature: str | NotGiven = NOT_GIVEN, + source_ips: str | NotGiven = NOT_GIVEN, + state: str | NotGiven = NOT_GIVEN, + tele: str | NotGiven = NOT_GIVEN, + title: str | NotGiven = NOT_GIVEN, + trademark_number: str | NotGiven = NOT_GIVEN, + trademark_office: str | NotGiven = NOT_GIVEN, + trademark_symbol: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Submit the Abuse Report of a particular type + + Args: + report_type: The abuse report type + + act: The abuse report type + + email: A valid email of the abuse reporter + + email2: Should match the value provided in `email` + + host_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark + reports cannot be anonymous. + + ncmec_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark + reports cannot be anonymous. + + owner_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark + reports cannot be anonymous. + + urls: A list of valid URLs separated by ‘ ’ (new line character). The list of the URLs + should not exceed 250 URLs. All URLs should have the same hostname. Each URL + should be unique + + address1: Text not exceeding 100 characters + + agent_name: The name of the copyright holder. Text not exceeding 60 characters. + + agree: Can be 0 or 1 + + city: Text not exceeding 255 characters + + comments: Any additional comments about the infringement not exceeding 2000 characters + + company: Text not exceeding 100 characters + + country: Text not exceeding 255 characters + + destination_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of + destination IPs should not exceed 30 IP addresses. Each one of the IP addresses + ought to be unique + + justification: A detailed description of the infringement, including any necessary access + details and the exact steps needed to view the content, not exceeding 5000 + characters + + name: Text not exceeding 255 characters + + ncsei_subject_representation: If the submitter is the target of NCSEI in the URLs of the abuse report + + original_work: Text not exceeding 255 characters + + ports_protocols: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. The total + size of the field should not exceed 2000 characters. Each individual + port/protocol should not exceed 100 characters. The list should not have more + than 30 unique ports and protocols. + + signature: Required for DMCA reports, should be same as Name. An affirmation that all + information in the report is true and accurate while agreeing to the policies of + Cloudflare's abuse reports + + source_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of source + IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be + unique + + state: Text not exceeding 255 characters + + tele: Text not exceeding 20 characters + + title: Text not exceeding 255 characters + + trademark_number: Text not exceeding 1000 characters + + trademark_office: Text not exceeding 1000 characters + + trademark_symbol: Text not exceeding 1000 characters + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not report_type: + raise ValueError(f"Expected a non-empty value for `report_type` but received {report_type!r}") + return await self._post( + f"/accounts/{account_id}/abuse-reports/{report_type}", + body=await async_maybe_transform( + { + "act": act, + "email": email, + "email2": email2, + "host_notification": host_notification, + "ncmec_notification": ncmec_notification, + "owner_notification": owner_notification, + "urls": urls, + "address1": address1, + "agent_name": agent_name, + "agree": agree, + "city": city, + "comments": comments, + "company": company, + "country": country, + "destination_ips": destination_ips, + "justification": justification, + "name": name, + "ncsei_subject_representation": ncsei_subject_representation, + "original_work": original_work, + "ports_protocols": ports_protocols, + "signature": signature, + "source_ips": source_ips, + "state": state, + "tele": tele, + "title": title, + "trademark_number": trademark_number, + "trademark_office": trademark_office, + "trademark_symbol": trademark_symbol, + }, + abuse_report_create_params.AbuseReportCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[AbuseReportCreateResponse]._unwrapper, + ), + cast_to=cast(Type[str], ResultWrapper[str]), + ) + + +class AbuseReportsResourceWithRawResponse: + def __init__(self, abuse_reports: AbuseReportsResource) -> None: + self._abuse_reports = abuse_reports + + self.create = to_raw_response_wrapper( + abuse_reports.create, + ) + + +class AsyncAbuseReportsResourceWithRawResponse: + def __init__(self, abuse_reports: AsyncAbuseReportsResource) -> None: + self._abuse_reports = abuse_reports + + self.create = async_to_raw_response_wrapper( + abuse_reports.create, + ) + + +class AbuseReportsResourceWithStreamingResponse: + def __init__(self, abuse_reports: AbuseReportsResource) -> None: + self._abuse_reports = abuse_reports + + self.create = to_streamed_response_wrapper( + abuse_reports.create, + ) + + +class AsyncAbuseReportsResourceWithStreamingResponse: + def __init__(self, abuse_reports: AsyncAbuseReportsResource) -> None: + self._abuse_reports = abuse_reports + + self.create = async_to_streamed_response_wrapper( + abuse_reports.create, + ) diff --git a/src/cloudflare/resources/accounts/__init__.py b/src/cloudflare/resources/accounts/__init__.py index f91d884a2b2..f136ec47000 100644 --- a/src/cloudflare/resources/accounts/__init__.py +++ b/src/cloudflare/resources/accounts/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .logs import ( + LogsResource, + AsyncLogsResource, + LogsResourceWithRawResponse, + AsyncLogsResourceWithRawResponse, + LogsResourceWithStreamingResponse, + AsyncLogsResourceWithStreamingResponse, +) from .roles import ( RolesResource, AsyncRolesResource, @@ -66,6 +74,12 @@ "AsyncTokensResourceWithRawResponse", "TokensResourceWithStreamingResponse", "AsyncTokensResourceWithStreamingResponse", + "LogsResource", + "AsyncLogsResource", + "LogsResourceWithRawResponse", + "AsyncLogsResourceWithRawResponse", + "LogsResourceWithStreamingResponse", + "AsyncLogsResourceWithStreamingResponse", "AccountsResource", "AsyncAccountsResource", "AccountsResourceWithRawResponse", diff --git a/src/cloudflare/resources/accounts/accounts.py b/src/cloudflare/resources/accounts/accounts.py index e6e9d0721a4..eba792cbcc5 100644 --- a/src/cloudflare/resources/accounts/accounts.py +++ b/src/cloudflare/resources/accounts/accounts.py @@ -29,6 +29,14 @@ async_maybe_transform, ) from ..._compat import cached_property +from .logs.logs import ( + LogsResource, + AsyncLogsResource, + LogsResourceWithRawResponse, + AsyncLogsResourceWithRawResponse, + LogsResourceWithStreamingResponse, + AsyncLogsResourceWithStreamingResponse, +) from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( to_raw_response_wrapper, @@ -79,6 +87,10 @@ def subscriptions(self) -> SubscriptionsResource: def tokens(self) -> TokensResource: return TokensResource(self._client) + @cached_property + def logs(self) -> LogsResource: + return LogsResource(self._client) + @cached_property def with_raw_response(self) -> AccountsResourceWithRawResponse: """ @@ -358,6 +370,10 @@ def subscriptions(self) -> AsyncSubscriptionsResource: def tokens(self) -> AsyncTokensResource: return AsyncTokensResource(self._client) + @cached_property + def logs(self) -> AsyncLogsResource: + return AsyncLogsResource(self._client) + @cached_property def with_raw_response(self) -> AsyncAccountsResourceWithRawResponse: """ @@ -656,6 +672,10 @@ def subscriptions(self) -> SubscriptionsResourceWithRawResponse: def tokens(self) -> TokensResourceWithRawResponse: return TokensResourceWithRawResponse(self._accounts.tokens) + @cached_property + def logs(self) -> LogsResourceWithRawResponse: + return LogsResourceWithRawResponse(self._accounts.logs) + class AsyncAccountsResourceWithRawResponse: def __init__(self, accounts: AsyncAccountsResource) -> None: @@ -693,6 +713,10 @@ def subscriptions(self) -> AsyncSubscriptionsResourceWithRawResponse: def tokens(self) -> AsyncTokensResourceWithRawResponse: return AsyncTokensResourceWithRawResponse(self._accounts.tokens) + @cached_property + def logs(self) -> AsyncLogsResourceWithRawResponse: + return AsyncLogsResourceWithRawResponse(self._accounts.logs) + class AccountsResourceWithStreamingResponse: def __init__(self, accounts: AccountsResource) -> None: @@ -730,6 +754,10 @@ def subscriptions(self) -> SubscriptionsResourceWithStreamingResponse: def tokens(self) -> TokensResourceWithStreamingResponse: return TokensResourceWithStreamingResponse(self._accounts.tokens) + @cached_property + def logs(self) -> LogsResourceWithStreamingResponse: + return LogsResourceWithStreamingResponse(self._accounts.logs) + class AsyncAccountsResourceWithStreamingResponse: def __init__(self, accounts: AsyncAccountsResource) -> None: @@ -766,3 +794,7 @@ def subscriptions(self) -> AsyncSubscriptionsResourceWithStreamingResponse: @cached_property def tokens(self) -> AsyncTokensResourceWithStreamingResponse: return AsyncTokensResourceWithStreamingResponse(self._accounts.tokens) + + @cached_property + def logs(self) -> AsyncLogsResourceWithStreamingResponse: + return AsyncLogsResourceWithStreamingResponse(self._accounts.logs) diff --git a/src/cloudflare/resources/accounts/logs/__init__.py b/src/cloudflare/resources/accounts/logs/__init__.py new file mode 100644 index 00000000000..5d5ddcdb7e2 --- /dev/null +++ b/src/cloudflare/resources/accounts/logs/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .logs import ( + LogsResource, + AsyncLogsResource, + LogsResourceWithRawResponse, + AsyncLogsResourceWithRawResponse, + LogsResourceWithStreamingResponse, + AsyncLogsResourceWithStreamingResponse, +) +from .audit import ( + AuditResource, + AsyncAuditResource, + AuditResourceWithRawResponse, + AsyncAuditResourceWithRawResponse, + AuditResourceWithStreamingResponse, + AsyncAuditResourceWithStreamingResponse, +) + +__all__ = [ + "AuditResource", + "AsyncAuditResource", + "AuditResourceWithRawResponse", + "AsyncAuditResourceWithRawResponse", + "AuditResourceWithStreamingResponse", + "AsyncAuditResourceWithStreamingResponse", + "LogsResource", + "AsyncLogsResource", + "LogsResourceWithRawResponse", + "AsyncLogsResourceWithRawResponse", + "LogsResourceWithStreamingResponse", + "AsyncLogsResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/accounts/logs/audit.py b/src/cloudflare/resources/accounts/logs/audit.py new file mode 100644 index 00000000000..7375f4199ec --- /dev/null +++ b/src/cloudflare/resources/accounts/logs/audit.py @@ -0,0 +1,426 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from datetime import date +from typing_extensions import Literal + +import httpx + +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import maybe_transform +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ....pagination import SyncCursorLimitPagination, AsyncCursorLimitPagination +from ...._base_client import AsyncPaginator, make_request_options +from ....types.accounts.logs import audit_list_params +from ....types.accounts.logs.audit_list_response import AuditListResponse + +__all__ = ["AuditResource", "AsyncAuditResource"] + + +class AuditResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> AuditResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AuditResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AuditResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AuditResourceWithStreamingResponse(self) + + def list( + self, + *, + account_id: str, + before: Union[str, date], + since: Union[str, date], + account_name: str | NotGiven = NOT_GIVEN, + action_result: Literal["success", "failure"] | NotGiven = NOT_GIVEN, + action_type: Literal["create", "delete", "view", "update"] | NotGiven = NOT_GIVEN, + actor_context: Literal["api_key", "api_token", "dash", "oauth", "origin_ca_key"] | NotGiven = NOT_GIVEN, + actor_email: str | NotGiven = NOT_GIVEN, + actor_id: str | NotGiven = NOT_GIVEN, + actor_ip_address: str | NotGiven = NOT_GIVEN, + actor_token_id: str | NotGiven = NOT_GIVEN, + actor_token_name: str | NotGiven = NOT_GIVEN, + actor_type: Literal["cloudflare_admin", "account", "user"] | NotGiven = NOT_GIVEN, + audit_log_id: str | NotGiven = NOT_GIVEN, + cursor: str | NotGiven = NOT_GIVEN, + direction: Literal["desc", "asc"] | NotGiven = NOT_GIVEN, + limit: float | NotGiven = NOT_GIVEN, + raw_cf_rayid: str | NotGiven = NOT_GIVEN, + raw_method: str | NotGiven = NOT_GIVEN, + raw_status_code: int | NotGiven = NOT_GIVEN, + raw_uri: str | NotGiven = NOT_GIVEN, + resource_id: str | NotGiven = NOT_GIVEN, + resource_product: str | NotGiven = NOT_GIVEN, + resource_scope: Literal["accounts", "user", "zones"] | NotGiven = NOT_GIVEN, + resource_type: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + zone_name: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncCursorLimitPagination[AuditListResponse]: + """Gets a list of audit logs for an account. + +

This is the beta release + of Audit Logs Version 2. Since this is a beta version, there may be gaps or + missing entries in the available audit logs. Be aware of the following + limitations.
  • Audit logs are available only for the past 30 days. +
  • Error handling is not yet implemented.
+ + Args: + account_id: The unique id that identifies the account. + + before: Filters actions based on a given timestamp in the format yyyy-mm-dd, returning + only logs that occurred on and before the specified date. + + since: Filters actions based on a given timestamp in the format yyyy-mm-dd, returning + only logs that occurred on and after the specified date. + + account_name: Filters by the account name. + + action_result: Whether the action was successful or not. + + action_type: Filters by the action type. + + actor_context: Filters by the actor context. + + actor_email: Filters by the actor's email address. + + actor_id: Filters by the actor ID. This can be either the Account ID or User ID. + + actor_ip_address: The IP address where the action was initiated. + + actor_token_id: Filters by the API token ID when the actor context is an api_token or oauth. + + actor_token_name: Filters by the API token name when the actor context is an api_token or oauth. + + actor_type: Filters by the actor type. + + audit_log_id: Finds a specific log by its ID. + + cursor: The cursor is an opaque token used to paginate through large sets of records. It + indicates the position from which to continue when requesting the next set of + records. A valid cursor value can be obtained from the cursor object in the + result_info structure of a previous response. + + direction: Sets sorting order. + + limit: The number limits the objects to return. The cursor attribute may be used to + iterate over the next batch of objects if there are more than the limit. + + raw_cf_rayid: Filters by the response CF Ray ID. + + raw_method: The HTTP method for the API call. + + raw_status_code: The response status code that was returned. + + raw_uri: Filters by the request URI. + + resource_id: Filters by the resource ID. + + resource_product: Filters audit logs by the Cloudflare product associated with the changed + resource. + + resource_scope: Filters by the resource scope, specifying whether the resource is associated + with an user, an account, or a zone. + + resource_type: Filters audit logs based on the unique type of resource changed by the action. + + zone_id: Filters by the zone ID. + + zone_name: Filters by the zone name associated with the change. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get_api_list( + f"/accounts/{account_id}/logs/audit", + page=SyncCursorLimitPagination[AuditListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "before": before, + "since": since, + "account_name": account_name, + "action_result": action_result, + "action_type": action_type, + "actor_context": actor_context, + "actor_email": actor_email, + "actor_id": actor_id, + "actor_ip_address": actor_ip_address, + "actor_token_id": actor_token_id, + "actor_token_name": actor_token_name, + "actor_type": actor_type, + "audit_log_id": audit_log_id, + "cursor": cursor, + "direction": direction, + "limit": limit, + "raw_cf_rayid": raw_cf_rayid, + "raw_method": raw_method, + "raw_status_code": raw_status_code, + "raw_uri": raw_uri, + "resource_id": resource_id, + "resource_product": resource_product, + "resource_scope": resource_scope, + "resource_type": resource_type, + "zone_id": zone_id, + "zone_name": zone_name, + }, + audit_list_params.AuditListParams, + ), + ), + model=AuditListResponse, + ) + + +class AsyncAuditResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncAuditResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncAuditResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncAuditResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncAuditResourceWithStreamingResponse(self) + + def list( + self, + *, + account_id: str, + before: Union[str, date], + since: Union[str, date], + account_name: str | NotGiven = NOT_GIVEN, + action_result: Literal["success", "failure"] | NotGiven = NOT_GIVEN, + action_type: Literal["create", "delete", "view", "update"] | NotGiven = NOT_GIVEN, + actor_context: Literal["api_key", "api_token", "dash", "oauth", "origin_ca_key"] | NotGiven = NOT_GIVEN, + actor_email: str | NotGiven = NOT_GIVEN, + actor_id: str | NotGiven = NOT_GIVEN, + actor_ip_address: str | NotGiven = NOT_GIVEN, + actor_token_id: str | NotGiven = NOT_GIVEN, + actor_token_name: str | NotGiven = NOT_GIVEN, + actor_type: Literal["cloudflare_admin", "account", "user"] | NotGiven = NOT_GIVEN, + audit_log_id: str | NotGiven = NOT_GIVEN, + cursor: str | NotGiven = NOT_GIVEN, + direction: Literal["desc", "asc"] | NotGiven = NOT_GIVEN, + limit: float | NotGiven = NOT_GIVEN, + raw_cf_rayid: str | NotGiven = NOT_GIVEN, + raw_method: str | NotGiven = NOT_GIVEN, + raw_status_code: int | NotGiven = NOT_GIVEN, + raw_uri: str | NotGiven = NOT_GIVEN, + resource_id: str | NotGiven = NOT_GIVEN, + resource_product: str | NotGiven = NOT_GIVEN, + resource_scope: Literal["accounts", "user", "zones"] | NotGiven = NOT_GIVEN, + resource_type: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + zone_name: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[AuditListResponse, AsyncCursorLimitPagination[AuditListResponse]]: + """Gets a list of audit logs for an account. + +

This is the beta release + of Audit Logs Version 2. Since this is a beta version, there may be gaps or + missing entries in the available audit logs. Be aware of the following + limitations.
  • Audit logs are available only for the past 30 days. +
  • Error handling is not yet implemented.
+ + Args: + account_id: The unique id that identifies the account. + + before: Filters actions based on a given timestamp in the format yyyy-mm-dd, returning + only logs that occurred on and before the specified date. + + since: Filters actions based on a given timestamp in the format yyyy-mm-dd, returning + only logs that occurred on and after the specified date. + + account_name: Filters by the account name. + + action_result: Whether the action was successful or not. + + action_type: Filters by the action type. + + actor_context: Filters by the actor context. + + actor_email: Filters by the actor's email address. + + actor_id: Filters by the actor ID. This can be either the Account ID or User ID. + + actor_ip_address: The IP address where the action was initiated. + + actor_token_id: Filters by the API token ID when the actor context is an api_token or oauth. + + actor_token_name: Filters by the API token name when the actor context is an api_token or oauth. + + actor_type: Filters by the actor type. + + audit_log_id: Finds a specific log by its ID. + + cursor: The cursor is an opaque token used to paginate through large sets of records. It + indicates the position from which to continue when requesting the next set of + records. A valid cursor value can be obtained from the cursor object in the + result_info structure of a previous response. + + direction: Sets sorting order. + + limit: The number limits the objects to return. The cursor attribute may be used to + iterate over the next batch of objects if there are more than the limit. + + raw_cf_rayid: Filters by the response CF Ray ID. + + raw_method: The HTTP method for the API call. + + raw_status_code: The response status code that was returned. + + raw_uri: Filters by the request URI. + + resource_id: Filters by the resource ID. + + resource_product: Filters audit logs by the Cloudflare product associated with the changed + resource. + + resource_scope: Filters by the resource scope, specifying whether the resource is associated + with an user, an account, or a zone. + + resource_type: Filters audit logs based on the unique type of resource changed by the action. + + zone_id: Filters by the zone ID. + + zone_name: Filters by the zone name associated with the change. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get_api_list( + f"/accounts/{account_id}/logs/audit", + page=AsyncCursorLimitPagination[AuditListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "before": before, + "since": since, + "account_name": account_name, + "action_result": action_result, + "action_type": action_type, + "actor_context": actor_context, + "actor_email": actor_email, + "actor_id": actor_id, + "actor_ip_address": actor_ip_address, + "actor_token_id": actor_token_id, + "actor_token_name": actor_token_name, + "actor_type": actor_type, + "audit_log_id": audit_log_id, + "cursor": cursor, + "direction": direction, + "limit": limit, + "raw_cf_rayid": raw_cf_rayid, + "raw_method": raw_method, + "raw_status_code": raw_status_code, + "raw_uri": raw_uri, + "resource_id": resource_id, + "resource_product": resource_product, + "resource_scope": resource_scope, + "resource_type": resource_type, + "zone_id": zone_id, + "zone_name": zone_name, + }, + audit_list_params.AuditListParams, + ), + ), + model=AuditListResponse, + ) + + +class AuditResourceWithRawResponse: + def __init__(self, audit: AuditResource) -> None: + self._audit = audit + + self.list = to_raw_response_wrapper( + audit.list, + ) + + +class AsyncAuditResourceWithRawResponse: + def __init__(self, audit: AsyncAuditResource) -> None: + self._audit = audit + + self.list = async_to_raw_response_wrapper( + audit.list, + ) + + +class AuditResourceWithStreamingResponse: + def __init__(self, audit: AuditResource) -> None: + self._audit = audit + + self.list = to_streamed_response_wrapper( + audit.list, + ) + + +class AsyncAuditResourceWithStreamingResponse: + def __init__(self, audit: AsyncAuditResource) -> None: + self._audit = audit + + self.list = async_to_streamed_response_wrapper( + audit.list, + ) diff --git a/src/cloudflare/resources/accounts/logs/logs.py b/src/cloudflare/resources/accounts/logs/logs.py new file mode 100644 index 00000000000..475921543aa --- /dev/null +++ b/src/cloudflare/resources/accounts/logs/logs.py @@ -0,0 +1,102 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .audit import ( + AuditResource, + AsyncAuditResource, + AuditResourceWithRawResponse, + AsyncAuditResourceWithRawResponse, + AuditResourceWithStreamingResponse, + AsyncAuditResourceWithStreamingResponse, +) +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource + +__all__ = ["LogsResource", "AsyncLogsResource"] + + +class LogsResource(SyncAPIResource): + @cached_property + def audit(self) -> AuditResource: + return AuditResource(self._client) + + @cached_property + def with_raw_response(self) -> LogsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return LogsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LogsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return LogsResourceWithStreamingResponse(self) + + +class AsyncLogsResource(AsyncAPIResource): + @cached_property + def audit(self) -> AsyncAuditResource: + return AsyncAuditResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncLogsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncLogsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLogsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncLogsResourceWithStreamingResponse(self) + + +class LogsResourceWithRawResponse: + def __init__(self, logs: LogsResource) -> None: + self._logs = logs + + @cached_property + def audit(self) -> AuditResourceWithRawResponse: + return AuditResourceWithRawResponse(self._logs.audit) + + +class AsyncLogsResourceWithRawResponse: + def __init__(self, logs: AsyncLogsResource) -> None: + self._logs = logs + + @cached_property + def audit(self) -> AsyncAuditResourceWithRawResponse: + return AsyncAuditResourceWithRawResponse(self._logs.audit) + + +class LogsResourceWithStreamingResponse: + def __init__(self, logs: LogsResource) -> None: + self._logs = logs + + @cached_property + def audit(self) -> AuditResourceWithStreamingResponse: + return AuditResourceWithStreamingResponse(self._logs.audit) + + +class AsyncLogsResourceWithStreamingResponse: + def __init__(self, logs: AsyncLogsResource) -> None: + self._logs = logs + + @cached_property + def audit(self) -> AsyncAuditResourceWithStreamingResponse: + return AsyncAuditResourceWithStreamingResponse(self._logs.audit) diff --git a/src/cloudflare/resources/addressing/address_maps/accounts.py b/src/cloudflare/resources/addressing/address_maps/accounts.py index 38533ca9ce1..a5279ff240c 100644 --- a/src/cloudflare/resources/addressing/address_maps/accounts.py +++ b/src/cloudflare/resources/addressing/address_maps/accounts.py @@ -62,9 +62,9 @@ def update( Add an account as a member of a particular address map. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - address_map_id: Identifier + address_map_id: Identifier of an Address Map. extra_headers: Send extra headers @@ -103,9 +103,9 @@ def delete( Remove an account as a member of a particular address map. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - address_map_id: Identifier + address_map_id: Identifier of an Address Map. extra_headers: Send extra headers @@ -165,9 +165,9 @@ async def update( Add an account as a member of a particular address map. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - address_map_id: Identifier + address_map_id: Identifier of an Address Map. extra_headers: Send extra headers @@ -206,9 +206,9 @@ async def delete( Remove an account as a member of a particular address map. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - address_map_id: Identifier + address_map_id: Identifier of an Address Map. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/addressing/address_maps/address_maps.py b/src/cloudflare/resources/addressing/address_maps/address_maps.py index 34106c3241e..b3a6fda77c9 100644 --- a/src/cloudflare/resources/addressing/address_maps/address_maps.py +++ b/src/cloudflare/resources/addressing/address_maps/address_maps.py @@ -106,7 +106,7 @@ def create( Create a new address map under the account. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. description: An optional description field which may be used to describe the types of IPs or zones on the map. @@ -163,7 +163,7 @@ def list( List all address maps owned by the account. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. extra_headers: Send extra headers @@ -202,9 +202,9 @@ def delete( disabled before it can be deleted. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - address_map_id: Identifier + address_map_id: Identifier of an Address Map. extra_headers: Send extra headers @@ -245,9 +245,9 @@ def edit( Modify properties of an address map owned by the account. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - address_map_id: Identifier + address_map_id: Identifier of an Address Map. default_sni: If you have legacy TLS clients which do not send the TLS server name indicator, then you can specify one default SNI on the map. If Cloudflare receives a TLS @@ -309,9 +309,9 @@ def get( Show a particular address map owned by the account. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - address_map_id: Identifier + address_map_id: Identifier of an Address Map. extra_headers: Send extra headers @@ -389,7 +389,7 @@ async def create( Create a new address map under the account. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. description: An optional description field which may be used to describe the types of IPs or zones on the map. @@ -446,7 +446,7 @@ def list( List all address maps owned by the account. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. extra_headers: Send extra headers @@ -485,9 +485,9 @@ async def delete( disabled before it can be deleted. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - address_map_id: Identifier + address_map_id: Identifier of an Address Map. extra_headers: Send extra headers @@ -528,9 +528,9 @@ async def edit( Modify properties of an address map owned by the account. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - address_map_id: Identifier + address_map_id: Identifier of an Address Map. default_sni: If you have legacy TLS clients which do not send the TLS server name indicator, then you can specify one default SNI on the map. If Cloudflare receives a TLS @@ -592,9 +592,9 @@ async def get( Show a particular address map owned by the account. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - address_map_id: Identifier + address_map_id: Identifier of an Address Map. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/addressing/address_maps/ips.py b/src/cloudflare/resources/addressing/address_maps/ips.py index 77e0d36e133..15c999ab654 100644 --- a/src/cloudflare/resources/addressing/address_maps/ips.py +++ b/src/cloudflare/resources/addressing/address_maps/ips.py @@ -63,9 +63,9 @@ def update( Add an IP from a prefix owned by the account to a particular address map. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - address_map_id: Identifier + address_map_id: Identifier of an Address Map. ip_address: An IPv4 or IPv6 address. @@ -109,9 +109,9 @@ def delete( Remove an IP from a particular address map. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - address_map_id: Identifier + address_map_id: Identifier of an Address Map. ip_address: An IPv4 or IPv6 address. @@ -176,9 +176,9 @@ async def update( Add an IP from a prefix owned by the account to a particular address map. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - address_map_id: Identifier + address_map_id: Identifier of an Address Map. ip_address: An IPv4 or IPv6 address. @@ -222,9 +222,9 @@ async def delete( Remove an IP from a particular address map. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - address_map_id: Identifier + address_map_id: Identifier of an Address Map. ip_address: An IPv4 or IPv6 address. diff --git a/src/cloudflare/resources/addressing/address_maps/zones.py b/src/cloudflare/resources/addressing/address_maps/zones.py index f2a68645e31..d7f859f2617 100644 --- a/src/cloudflare/resources/addressing/address_maps/zones.py +++ b/src/cloudflare/resources/addressing/address_maps/zones.py @@ -63,11 +63,11 @@ def update( Add a zone as a member of a particular address map. Args: - zone_id: Identifier + zone_id: Identifier of a zone. - account_id: Identifier + account_id: Identifier of a Cloudflare account. - address_map_id: Identifier + address_map_id: Identifier of an Address Map. extra_headers: Send extra headers @@ -109,11 +109,11 @@ def delete( Remove a zone as a member of a particular address map. Args: - zone_id: Identifier + zone_id: Identifier of a zone. - account_id: Identifier + account_id: Identifier of a Cloudflare account. - address_map_id: Identifier + address_map_id: Identifier of an Address Map. extra_headers: Send extra headers @@ -176,11 +176,11 @@ async def update( Add a zone as a member of a particular address map. Args: - zone_id: Identifier + zone_id: Identifier of a zone. - account_id: Identifier + account_id: Identifier of a Cloudflare account. - address_map_id: Identifier + address_map_id: Identifier of an Address Map. extra_headers: Send extra headers @@ -222,11 +222,11 @@ async def delete( Remove a zone as a member of a particular address map. Args: - zone_id: Identifier + zone_id: Identifier of a zone. - account_id: Identifier + account_id: Identifier of a Cloudflare account. - address_map_id: Identifier + address_map_id: Identifier of an Address Map. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/addressing/addressing.py b/src/cloudflare/resources/addressing/addressing.py index e5ce952404e..65ac3b59c70 100644 --- a/src/cloudflare/resources/addressing/addressing.py +++ b/src/cloudflare/resources/addressing/addressing.py @@ -12,6 +12,14 @@ ) from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource +from .loa_documents import ( + LOADocumentsResource, + AsyncLOADocumentsResource, + LOADocumentsResourceWithRawResponse, + AsyncLOADocumentsResourceWithRawResponse, + LOADocumentsResourceWithStreamingResponse, + AsyncLOADocumentsResourceWithStreamingResponse, +) from .prefixes.prefixes import ( PrefixesResource, AsyncPrefixesResource, @@ -28,14 +36,6 @@ AddressMapsResourceWithStreamingResponse, AsyncAddressMapsResourceWithStreamingResponse, ) -from .loa_documents.loa_documents import ( - LOADocumentsResource, - AsyncLOADocumentsResource, - LOADocumentsResourceWithRawResponse, - AsyncLOADocumentsResourceWithRawResponse, - LOADocumentsResourceWithStreamingResponse, - AsyncLOADocumentsResourceWithStreamingResponse, -) from .regional_hostnames.regional_hostnames import ( RegionalHostnamesResource, AsyncRegionalHostnamesResource, diff --git a/src/cloudflare/resources/addressing/loa_documents/loa_documents.py b/src/cloudflare/resources/addressing/loa_documents.py similarity index 60% rename from src/cloudflare/resources/addressing/loa_documents/loa_documents.py rename to src/cloudflare/resources/addressing/loa_documents.py index 8e2b78160fa..c4db454b8c2 100644 --- a/src/cloudflare/resources/addressing/loa_documents/loa_documents.py +++ b/src/cloudflare/resources/addressing/loa_documents.py @@ -6,40 +6,36 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import ( +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( maybe_transform, async_maybe_transform, ) -from .downloads import ( - DownloadsResource, - AsyncDownloadsResource, - DownloadsResourceWithRawResponse, - AsyncDownloadsResourceWithRawResponse, - DownloadsResourceWithStreamingResponse, - AsyncDownloadsResourceWithStreamingResponse, -) -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + BinaryAPIResponse, + AsyncBinaryAPIResponse, + StreamedBinaryAPIResponse, + AsyncStreamedBinaryAPIResponse, to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, + to_custom_raw_response_wrapper, async_to_streamed_response_wrapper, + to_custom_streamed_response_wrapper, + async_to_custom_raw_response_wrapper, + async_to_custom_streamed_response_wrapper, ) -from ...._wrappers import ResultWrapper -from ...._base_client import make_request_options -from ....types.addressing import loa_document_create_params -from ....types.addressing.loa_document_create_response import LOADocumentCreateResponse +from ..._wrappers import ResultWrapper +from ..._base_client import make_request_options +from ...types.addressing import loa_document_create_params +from ...types.addressing.loa_document_create_response import LOADocumentCreateResponse __all__ = ["LOADocumentsResource", "AsyncLOADocumentsResource"] class LOADocumentsResource(SyncAPIResource): - @cached_property - def downloads(self) -> DownloadsResource: - return DownloadsResource(self._client) - @cached_property def with_raw_response(self) -> LOADocumentsResourceWithRawResponse: """ @@ -75,7 +71,7 @@ def create( Submit LOA document (pdf format) under the account. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. loa_document: LOA document to upload. @@ -106,12 +102,49 @@ def create( cast_to=cast(Type[Optional[LOADocumentCreateResponse]], ResultWrapper[LOADocumentCreateResponse]), ) + def get( + self, + loa_document_id: Optional[str], + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BinaryAPIResponse: + """ + Download specified LOA document under the account. -class AsyncLOADocumentsResource(AsyncAPIResource): - @cached_property - def downloads(self) -> AsyncDownloadsResource: - return AsyncDownloadsResource(self._client) + Args: + account_id: Identifier of a Cloudflare account. + + loa_document_id: Identifier for the uploaded LOA document. + + extra_headers: Send extra headers + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not loa_document_id: + raise ValueError(f"Expected a non-empty value for `loa_document_id` but received {loa_document_id!r}") + extra_headers = {"Accept": "application/pdf", **(extra_headers or {})} + return self._get( + f"/accounts/{account_id}/addressing/loa_documents/{loa_document_id}/download", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=BinaryAPIResponse, + ) + + +class AsyncLOADocumentsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncLOADocumentsResourceWithRawResponse: """ @@ -147,7 +180,7 @@ async def create( Submit LOA document (pdf format) under the account. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. loa_document: LOA document to upload. @@ -180,6 +213,47 @@ async def create( cast_to=cast(Type[Optional[LOADocumentCreateResponse]], ResultWrapper[LOADocumentCreateResponse]), ) + async def get( + self, + loa_document_id: Optional[str], + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncBinaryAPIResponse: + """ + Download specified LOA document under the account. + + Args: + account_id: Identifier of a Cloudflare account. + + loa_document_id: Identifier for the uploaded LOA document. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not loa_document_id: + raise ValueError(f"Expected a non-empty value for `loa_document_id` but received {loa_document_id!r}") + extra_headers = {"Accept": "application/pdf", **(extra_headers or {})} + return await self._get( + f"/accounts/{account_id}/addressing/loa_documents/{loa_document_id}/download", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AsyncBinaryAPIResponse, + ) + class LOADocumentsResourceWithRawResponse: def __init__(self, loa_documents: LOADocumentsResource) -> None: @@ -188,10 +262,10 @@ def __init__(self, loa_documents: LOADocumentsResource) -> None: self.create = to_raw_response_wrapper( loa_documents.create, ) - - @cached_property - def downloads(self) -> DownloadsResourceWithRawResponse: - return DownloadsResourceWithRawResponse(self._loa_documents.downloads) + self.get = to_custom_raw_response_wrapper( + loa_documents.get, + BinaryAPIResponse, + ) class AsyncLOADocumentsResourceWithRawResponse: @@ -201,10 +275,10 @@ def __init__(self, loa_documents: AsyncLOADocumentsResource) -> None: self.create = async_to_raw_response_wrapper( loa_documents.create, ) - - @cached_property - def downloads(self) -> AsyncDownloadsResourceWithRawResponse: - return AsyncDownloadsResourceWithRawResponse(self._loa_documents.downloads) + self.get = async_to_custom_raw_response_wrapper( + loa_documents.get, + AsyncBinaryAPIResponse, + ) class LOADocumentsResourceWithStreamingResponse: @@ -214,10 +288,10 @@ def __init__(self, loa_documents: LOADocumentsResource) -> None: self.create = to_streamed_response_wrapper( loa_documents.create, ) - - @cached_property - def downloads(self) -> DownloadsResourceWithStreamingResponse: - return DownloadsResourceWithStreamingResponse(self._loa_documents.downloads) + self.get = to_custom_streamed_response_wrapper( + loa_documents.get, + StreamedBinaryAPIResponse, + ) class AsyncLOADocumentsResourceWithStreamingResponse: @@ -227,7 +301,7 @@ def __init__(self, loa_documents: AsyncLOADocumentsResource) -> None: self.create = async_to_streamed_response_wrapper( loa_documents.create, ) - - @cached_property - def downloads(self) -> AsyncDownloadsResourceWithStreamingResponse: - return AsyncDownloadsResourceWithStreamingResponse(self._loa_documents.downloads) + self.get = async_to_custom_streamed_response_wrapper( + loa_documents.get, + AsyncStreamedBinaryAPIResponse, + ) diff --git a/src/cloudflare/resources/addressing/loa_documents/__init__.py b/src/cloudflare/resources/addressing/loa_documents/__init__.py deleted file mode 100644 index 72f6dbba90c..00000000000 --- a/src/cloudflare/resources/addressing/loa_documents/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from .downloads import ( - DownloadsResource, - AsyncDownloadsResource, - DownloadsResourceWithRawResponse, - AsyncDownloadsResourceWithRawResponse, - DownloadsResourceWithStreamingResponse, - AsyncDownloadsResourceWithStreamingResponse, -) -from .loa_documents import ( - LOADocumentsResource, - AsyncLOADocumentsResource, - LOADocumentsResourceWithRawResponse, - AsyncLOADocumentsResourceWithRawResponse, - LOADocumentsResourceWithStreamingResponse, - AsyncLOADocumentsResourceWithStreamingResponse, -) - -__all__ = [ - "DownloadsResource", - "AsyncDownloadsResource", - "DownloadsResourceWithRawResponse", - "AsyncDownloadsResourceWithRawResponse", - "DownloadsResourceWithStreamingResponse", - "AsyncDownloadsResourceWithStreamingResponse", - "LOADocumentsResource", - "AsyncLOADocumentsResource", - "LOADocumentsResourceWithRawResponse", - "AsyncLOADocumentsResourceWithRawResponse", - "LOADocumentsResourceWithStreamingResponse", - "AsyncLOADocumentsResourceWithStreamingResponse", -] diff --git a/src/cloudflare/resources/addressing/loa_documents/downloads.py b/src/cloudflare/resources/addressing/loa_documents/downloads.py deleted file mode 100644 index 9c21fa752b2..00000000000 --- a/src/cloudflare/resources/addressing/loa_documents/downloads.py +++ /dev/null @@ -1,188 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Optional - -import httpx - -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( - BinaryAPIResponse, - AsyncBinaryAPIResponse, - StreamedBinaryAPIResponse, - AsyncStreamedBinaryAPIResponse, - to_custom_raw_response_wrapper, - to_custom_streamed_response_wrapper, - async_to_custom_raw_response_wrapper, - async_to_custom_streamed_response_wrapper, -) -from ...._base_client import make_request_options - -__all__ = ["DownloadsResource", "AsyncDownloadsResource"] - - -class DownloadsResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> DownloadsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return DownloadsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> DownloadsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return DownloadsResourceWithStreamingResponse(self) - - def get( - self, - loa_document_id: Optional[str], - *, - account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BinaryAPIResponse: - """ - Download specified LOA document under the account. - - Args: - account_id: Identifier - - loa_document_id: Identifier for the uploaded LOA document. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not loa_document_id: - raise ValueError(f"Expected a non-empty value for `loa_document_id` but received {loa_document_id!r}") - extra_headers = {"Accept": "application/pdf", **(extra_headers or {})} - return self._get( - f"/accounts/{account_id}/addressing/loa_documents/{loa_document_id}/download", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=BinaryAPIResponse, - ) - - -class AsyncDownloadsResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncDownloadsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncDownloadsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncDownloadsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncDownloadsResourceWithStreamingResponse(self) - - async def get( - self, - loa_document_id: Optional[str], - *, - account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncBinaryAPIResponse: - """ - Download specified LOA document under the account. - - Args: - account_id: Identifier - - loa_document_id: Identifier for the uploaded LOA document. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not loa_document_id: - raise ValueError(f"Expected a non-empty value for `loa_document_id` but received {loa_document_id!r}") - extra_headers = {"Accept": "application/pdf", **(extra_headers or {})} - return await self._get( - f"/accounts/{account_id}/addressing/loa_documents/{loa_document_id}/download", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=AsyncBinaryAPIResponse, - ) - - -class DownloadsResourceWithRawResponse: - def __init__(self, downloads: DownloadsResource) -> None: - self._downloads = downloads - - self.get = to_custom_raw_response_wrapper( - downloads.get, - BinaryAPIResponse, - ) - - -class AsyncDownloadsResourceWithRawResponse: - def __init__(self, downloads: AsyncDownloadsResource) -> None: - self._downloads = downloads - - self.get = async_to_custom_raw_response_wrapper( - downloads.get, - AsyncBinaryAPIResponse, - ) - - -class DownloadsResourceWithStreamingResponse: - def __init__(self, downloads: DownloadsResource) -> None: - self._downloads = downloads - - self.get = to_custom_streamed_response_wrapper( - downloads.get, - StreamedBinaryAPIResponse, - ) - - -class AsyncDownloadsResourceWithStreamingResponse: - def __init__(self, downloads: AsyncDownloadsResource) -> None: - self._downloads = downloads - - self.get = async_to_custom_streamed_response_wrapper( - downloads.get, - AsyncStreamedBinaryAPIResponse, - ) diff --git a/src/cloudflare/resources/addressing/prefixes/__init__.py b/src/cloudflare/resources/addressing/prefixes/__init__.py index baf5dcefd16..89ce6e1fa39 100644 --- a/src/cloudflare/resources/addressing/prefixes/__init__.py +++ b/src/cloudflare/resources/addressing/prefixes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .bgp import ( - BGPResource, - AsyncBGPResource, - BGPResourceWithRawResponse, - AsyncBGPResourceWithRawResponse, - BGPResourceWithStreamingResponse, - AsyncBGPResourceWithStreamingResponse, -) from .prefixes import ( PrefixesResource, AsyncPrefixesResource, @@ -24,14 +16,50 @@ DelegationsResourceWithStreamingResponse, AsyncDelegationsResourceWithStreamingResponse, ) +from .bgp_prefixes import ( + BGPPrefixesResource, + AsyncBGPPrefixesResource, + BGPPrefixesResourceWithRawResponse, + AsyncBGPPrefixesResourceWithRawResponse, + BGPPrefixesResourceWithStreamingResponse, + AsyncBGPPrefixesResourceWithStreamingResponse, +) +from .service_bindings import ( + ServiceBindingsResource, + AsyncServiceBindingsResource, + ServiceBindingsResourceWithRawResponse, + AsyncServiceBindingsResourceWithRawResponse, + ServiceBindingsResourceWithStreamingResponse, + AsyncServiceBindingsResourceWithStreamingResponse, +) +from .advertisement_status import ( + AdvertisementStatusResource, + AsyncAdvertisementStatusResource, + AdvertisementStatusResourceWithRawResponse, + AsyncAdvertisementStatusResourceWithRawResponse, + AdvertisementStatusResourceWithStreamingResponse, + AsyncAdvertisementStatusResourceWithStreamingResponse, +) __all__ = [ - "BGPResource", - "AsyncBGPResource", - "BGPResourceWithRawResponse", - "AsyncBGPResourceWithRawResponse", - "BGPResourceWithStreamingResponse", - "AsyncBGPResourceWithStreamingResponse", + "ServiceBindingsResource", + "AsyncServiceBindingsResource", + "ServiceBindingsResourceWithRawResponse", + "AsyncServiceBindingsResourceWithRawResponse", + "ServiceBindingsResourceWithStreamingResponse", + "AsyncServiceBindingsResourceWithStreamingResponse", + "BGPPrefixesResource", + "AsyncBGPPrefixesResource", + "BGPPrefixesResourceWithRawResponse", + "AsyncBGPPrefixesResourceWithRawResponse", + "BGPPrefixesResourceWithStreamingResponse", + "AsyncBGPPrefixesResourceWithStreamingResponse", + "AdvertisementStatusResource", + "AsyncAdvertisementStatusResource", + "AdvertisementStatusResourceWithRawResponse", + "AsyncAdvertisementStatusResourceWithRawResponse", + "AdvertisementStatusResourceWithStreamingResponse", + "AsyncAdvertisementStatusResourceWithStreamingResponse", "DelegationsResource", "AsyncDelegationsResource", "DelegationsResourceWithRawResponse", diff --git a/src/cloudflare/resources/addressing/prefixes/advertisement_status.py b/src/cloudflare/resources/addressing/prefixes/advertisement_status.py new file mode 100644 index 00000000000..4ca0b677f15 --- /dev/null +++ b/src/cloudflare/resources/addressing/prefixes/advertisement_status.py @@ -0,0 +1,324 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, Optional, cast + +import httpx + +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( + maybe_transform, + async_maybe_transform, +) +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...._wrappers import ResultWrapper +from ...._base_client import make_request_options +from ....types.addressing.prefixes import advertisement_status_edit_params +from ....types.addressing.prefixes.advertisement_status_get_response import AdvertisementStatusGetResponse +from ....types.addressing.prefixes.advertisement_status_edit_response import AdvertisementStatusEditResponse + +__all__ = ["AdvertisementStatusResource", "AsyncAdvertisementStatusResource"] + + +class AdvertisementStatusResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> AdvertisementStatusResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AdvertisementStatusResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AdvertisementStatusResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AdvertisementStatusResourceWithStreamingResponse(self) + + def edit( + self, + prefix_id: str, + *, + account_id: str, + advertised: bool, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[AdvertisementStatusEditResponse]: + """ + Advertise or withdraw the BGP route for a prefix. + + **Deprecated:** Prefer the BGP Prefixes endpoints, which additionally allow for + advertising and withdrawing subnets of an IP prefix. + + Args: + account_id: Identifier of a Cloudflare account. + + prefix_id: Identifier of an IP Prefix. + + advertised: Advertisement status of the prefix. If `true`, the BGP route for the prefix is + advertised to the Internet. If `false`, the BGP route is withdrawn. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not prefix_id: + raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}") + return self._patch( + f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status", + body=maybe_transform( + {"advertised": advertised}, advertisement_status_edit_params.AdvertisementStatusEditParams + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[AdvertisementStatusEditResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[AdvertisementStatusEditResponse]], ResultWrapper[AdvertisementStatusEditResponse] + ), + ) + + def get( + self, + prefix_id: str, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[AdvertisementStatusGetResponse]: + """ + View the current advertisement state for a prefix. + + **Deprecated:** Prefer the BGP Prefixes endpoints, which additionally allow for + advertising and withdrawing subnets of an IP prefix. + + Args: + account_id: Identifier of a Cloudflare account. + + prefix_id: Identifier of an IP Prefix. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not prefix_id: + raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}") + return self._get( + f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[AdvertisementStatusGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[AdvertisementStatusGetResponse]], ResultWrapper[AdvertisementStatusGetResponse]), + ) + + +class AsyncAdvertisementStatusResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncAdvertisementStatusResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncAdvertisementStatusResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncAdvertisementStatusResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncAdvertisementStatusResourceWithStreamingResponse(self) + + async def edit( + self, + prefix_id: str, + *, + account_id: str, + advertised: bool, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[AdvertisementStatusEditResponse]: + """ + Advertise or withdraw the BGP route for a prefix. + + **Deprecated:** Prefer the BGP Prefixes endpoints, which additionally allow for + advertising and withdrawing subnets of an IP prefix. + + Args: + account_id: Identifier of a Cloudflare account. + + prefix_id: Identifier of an IP Prefix. + + advertised: Advertisement status of the prefix. If `true`, the BGP route for the prefix is + advertised to the Internet. If `false`, the BGP route is withdrawn. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not prefix_id: + raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}") + return await self._patch( + f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status", + body=await async_maybe_transform( + {"advertised": advertised}, advertisement_status_edit_params.AdvertisementStatusEditParams + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[AdvertisementStatusEditResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[AdvertisementStatusEditResponse]], ResultWrapper[AdvertisementStatusEditResponse] + ), + ) + + async def get( + self, + prefix_id: str, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[AdvertisementStatusGetResponse]: + """ + View the current advertisement state for a prefix. + + **Deprecated:** Prefer the BGP Prefixes endpoints, which additionally allow for + advertising and withdrawing subnets of an IP prefix. + + Args: + account_id: Identifier of a Cloudflare account. + + prefix_id: Identifier of an IP Prefix. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not prefix_id: + raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}") + return await self._get( + f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[AdvertisementStatusGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[AdvertisementStatusGetResponse]], ResultWrapper[AdvertisementStatusGetResponse]), + ) + + +class AdvertisementStatusResourceWithRawResponse: + def __init__(self, advertisement_status: AdvertisementStatusResource) -> None: + self._advertisement_status = advertisement_status + + self.edit = to_raw_response_wrapper( + advertisement_status.edit, + ) + self.get = to_raw_response_wrapper( + advertisement_status.get, + ) + + +class AsyncAdvertisementStatusResourceWithRawResponse: + def __init__(self, advertisement_status: AsyncAdvertisementStatusResource) -> None: + self._advertisement_status = advertisement_status + + self.edit = async_to_raw_response_wrapper( + advertisement_status.edit, + ) + self.get = async_to_raw_response_wrapper( + advertisement_status.get, + ) + + +class AdvertisementStatusResourceWithStreamingResponse: + def __init__(self, advertisement_status: AdvertisementStatusResource) -> None: + self._advertisement_status = advertisement_status + + self.edit = to_streamed_response_wrapper( + advertisement_status.edit, + ) + self.get = to_streamed_response_wrapper( + advertisement_status.get, + ) + + +class AsyncAdvertisementStatusResourceWithStreamingResponse: + def __init__(self, advertisement_status: AsyncAdvertisementStatusResource) -> None: + self._advertisement_status = advertisement_status + + self.edit = async_to_streamed_response_wrapper( + advertisement_status.edit, + ) + self.get = async_to_streamed_response_wrapper( + advertisement_status.get, + ) diff --git a/src/cloudflare/resources/addressing/prefixes/bgp/__init__.py b/src/cloudflare/resources/addressing/prefixes/bgp/__init__.py deleted file mode 100644 index 8c3709d72cc..00000000000 --- a/src/cloudflare/resources/addressing/prefixes/bgp/__init__.py +++ /dev/null @@ -1,61 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from .bgp import ( - BGPResource, - AsyncBGPResource, - BGPResourceWithRawResponse, - AsyncBGPResourceWithRawResponse, - BGPResourceWithStreamingResponse, - AsyncBGPResourceWithStreamingResponse, -) -from .bindings import ( - BindingsResource, - AsyncBindingsResource, - BindingsResourceWithRawResponse, - AsyncBindingsResourceWithRawResponse, - BindingsResourceWithStreamingResponse, - AsyncBindingsResourceWithStreamingResponse, -) -from .prefixes import ( - PrefixesResource, - AsyncPrefixesResource, - PrefixesResourceWithRawResponse, - AsyncPrefixesResourceWithRawResponse, - PrefixesResourceWithStreamingResponse, - AsyncPrefixesResourceWithStreamingResponse, -) -from .statuses import ( - StatusesResource, - AsyncStatusesResource, - StatusesResourceWithRawResponse, - AsyncStatusesResourceWithRawResponse, - StatusesResourceWithStreamingResponse, - AsyncStatusesResourceWithStreamingResponse, -) - -__all__ = [ - "BindingsResource", - "AsyncBindingsResource", - "BindingsResourceWithRawResponse", - "AsyncBindingsResourceWithRawResponse", - "BindingsResourceWithStreamingResponse", - "AsyncBindingsResourceWithStreamingResponse", - "PrefixesResource", - "AsyncPrefixesResource", - "PrefixesResourceWithRawResponse", - "AsyncPrefixesResourceWithRawResponse", - "PrefixesResourceWithStreamingResponse", - "AsyncPrefixesResourceWithStreamingResponse", - "StatusesResource", - "AsyncStatusesResource", - "StatusesResourceWithRawResponse", - "AsyncStatusesResourceWithRawResponse", - "StatusesResourceWithStreamingResponse", - "AsyncStatusesResourceWithStreamingResponse", - "BGPResource", - "AsyncBGPResource", - "BGPResourceWithRawResponse", - "AsyncBGPResourceWithRawResponse", - "BGPResourceWithStreamingResponse", - "AsyncBGPResourceWithStreamingResponse", -] diff --git a/src/cloudflare/resources/addressing/prefixes/bgp/bgp.py b/src/cloudflare/resources/addressing/prefixes/bgp/bgp.py deleted file mode 100644 index 0aaf8300bf8..00000000000 --- a/src/cloudflare/resources/addressing/prefixes/bgp/bgp.py +++ /dev/null @@ -1,166 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from .bindings import ( - BindingsResource, - AsyncBindingsResource, - BindingsResourceWithRawResponse, - AsyncBindingsResourceWithRawResponse, - BindingsResourceWithStreamingResponse, - AsyncBindingsResourceWithStreamingResponse, -) -from .prefixes import ( - PrefixesResource, - AsyncPrefixesResource, - PrefixesResourceWithRawResponse, - AsyncPrefixesResourceWithRawResponse, - PrefixesResourceWithStreamingResponse, - AsyncPrefixesResourceWithStreamingResponse, -) -from .statuses import ( - StatusesResource, - AsyncStatusesResource, - StatusesResourceWithRawResponse, - AsyncStatusesResourceWithRawResponse, - StatusesResourceWithStreamingResponse, - AsyncStatusesResourceWithStreamingResponse, -) -from ....._compat import cached_property -from ....._resource import SyncAPIResource, AsyncAPIResource - -__all__ = ["BGPResource", "AsyncBGPResource"] - - -class BGPResource(SyncAPIResource): - @cached_property - def bindings(self) -> BindingsResource: - return BindingsResource(self._client) - - @cached_property - def prefixes(self) -> PrefixesResource: - return PrefixesResource(self._client) - - @cached_property - def statuses(self) -> StatusesResource: - return StatusesResource(self._client) - - @cached_property - def with_raw_response(self) -> BGPResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return BGPResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> BGPResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return BGPResourceWithStreamingResponse(self) - - -class AsyncBGPResource(AsyncAPIResource): - @cached_property - def bindings(self) -> AsyncBindingsResource: - return AsyncBindingsResource(self._client) - - @cached_property - def prefixes(self) -> AsyncPrefixesResource: - return AsyncPrefixesResource(self._client) - - @cached_property - def statuses(self) -> AsyncStatusesResource: - return AsyncStatusesResource(self._client) - - @cached_property - def with_raw_response(self) -> AsyncBGPResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncBGPResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncBGPResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncBGPResourceWithStreamingResponse(self) - - -class BGPResourceWithRawResponse: - def __init__(self, bgp: BGPResource) -> None: - self._bgp = bgp - - @cached_property - def bindings(self) -> BindingsResourceWithRawResponse: - return BindingsResourceWithRawResponse(self._bgp.bindings) - - @cached_property - def prefixes(self) -> PrefixesResourceWithRawResponse: - return PrefixesResourceWithRawResponse(self._bgp.prefixes) - - @cached_property - def statuses(self) -> StatusesResourceWithRawResponse: - return StatusesResourceWithRawResponse(self._bgp.statuses) - - -class AsyncBGPResourceWithRawResponse: - def __init__(self, bgp: AsyncBGPResource) -> None: - self._bgp = bgp - - @cached_property - def bindings(self) -> AsyncBindingsResourceWithRawResponse: - return AsyncBindingsResourceWithRawResponse(self._bgp.bindings) - - @cached_property - def prefixes(self) -> AsyncPrefixesResourceWithRawResponse: - return AsyncPrefixesResourceWithRawResponse(self._bgp.prefixes) - - @cached_property - def statuses(self) -> AsyncStatusesResourceWithRawResponse: - return AsyncStatusesResourceWithRawResponse(self._bgp.statuses) - - -class BGPResourceWithStreamingResponse: - def __init__(self, bgp: BGPResource) -> None: - self._bgp = bgp - - @cached_property - def bindings(self) -> BindingsResourceWithStreamingResponse: - return BindingsResourceWithStreamingResponse(self._bgp.bindings) - - @cached_property - def prefixes(self) -> PrefixesResourceWithStreamingResponse: - return PrefixesResourceWithStreamingResponse(self._bgp.prefixes) - - @cached_property - def statuses(self) -> StatusesResourceWithStreamingResponse: - return StatusesResourceWithStreamingResponse(self._bgp.statuses) - - -class AsyncBGPResourceWithStreamingResponse: - def __init__(self, bgp: AsyncBGPResource) -> None: - self._bgp = bgp - - @cached_property - def bindings(self) -> AsyncBindingsResourceWithStreamingResponse: - return AsyncBindingsResourceWithStreamingResponse(self._bgp.bindings) - - @cached_property - def prefixes(self) -> AsyncPrefixesResourceWithStreamingResponse: - return AsyncPrefixesResourceWithStreamingResponse(self._bgp.prefixes) - - @cached_property - def statuses(self) -> AsyncStatusesResourceWithStreamingResponse: - return AsyncStatusesResourceWithStreamingResponse(self._bgp.statuses) diff --git a/src/cloudflare/resources/addressing/prefixes/bgp/prefixes.py b/src/cloudflare/resources/addressing/prefixes/bgp_prefixes.py similarity index 62% rename from src/cloudflare/resources/addressing/prefixes/bgp/prefixes.py rename to src/cloudflare/resources/addressing/prefixes/bgp_prefixes.py index c99139e7d70..3f65acd83ad 100644 --- a/src/cloudflare/resources/addressing/prefixes/bgp/prefixes.py +++ b/src/cloudflare/resources/addressing/prefixes/bgp_prefixes.py @@ -6,47 +6,97 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ....._utils import ( +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( maybe_transform, async_maybe_transform, ) -from ....._compat import cached_property -from ....._resource import SyncAPIResource, AsyncAPIResource -from ....._response import ( +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ....._wrappers import ResultWrapper -from .....pagination import SyncSinglePage, AsyncSinglePage -from ....._base_client import AsyncPaginator, make_request_options -from .....types.addressing.prefixes.bgp import prefix_edit_params -from .....types.addressing.prefixes.bgp.bgp_prefix import BGPPrefix +from ...._wrappers import ResultWrapper +from ....pagination import SyncSinglePage, AsyncSinglePage +from ...._base_client import AsyncPaginator, make_request_options +from ....types.addressing.prefixes import bgp_prefix_edit_params, bgp_prefix_create_params +from ....types.addressing.prefixes.bgp_prefix import BGPPrefix -__all__ = ["PrefixesResource", "AsyncPrefixesResource"] +__all__ = ["BGPPrefixesResource", "AsyncBGPPrefixesResource"] -class PrefixesResource(SyncAPIResource): +class BGPPrefixesResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> PrefixesResourceWithRawResponse: + def with_raw_response(self) -> BGPPrefixesResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers """ - return PrefixesResourceWithRawResponse(self) + return BGPPrefixesResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> PrefixesResourceWithStreamingResponse: + def with_streaming_response(self) -> BGPPrefixesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response """ - return PrefixesResourceWithStreamingResponse(self) + return BGPPrefixesResourceWithStreamingResponse(self) + + def create( + self, + prefix_id: str, + *, + account_id: str, + cidr: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[BGPPrefix]: + """ + Create a BGP prefix, controlling the BGP advertisement status of a specific + subnet. When created, BGP prefixes are initially withdrawn, and can be + advertised with the Update BGP Prefix API. + + Args: + account_id: Identifier of a Cloudflare account. + + prefix_id: Identifier of an IP Prefix. + + cidr: IP Prefix in Classless Inter-Domain Routing format. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not prefix_id: + raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}") + return self._post( + f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes", + body=maybe_transform({"cidr": cidr}, bgp_prefix_create_params.BGPPrefixCreateParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[BGPPrefix]]._unwrapper, + ), + cast_to=cast(Type[Optional[BGPPrefix]], ResultWrapper[BGPPrefix]), + ) def list( self, @@ -68,9 +118,9 @@ def list( Prefixes. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - prefix_id: Identifier + prefix_id: Identifier of an IP Prefix. extra_headers: Send extra headers @@ -99,7 +149,7 @@ def edit( *, account_id: str, prefix_id: str, - on_demand: prefix_edit_params.OnDemand | NotGiven = NOT_GIVEN, + on_demand: bgp_prefix_edit_params.OnDemand | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -112,11 +162,11 @@ def edit( status (advertised or withdrawn). Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - prefix_id: Identifier + prefix_id: Identifier of an IP Prefix. - bgp_prefix_id: Identifier + bgp_prefix_id: Identifier of BGP Prefix. extra_headers: Send extra headers @@ -134,7 +184,7 @@ def edit( raise ValueError(f"Expected a non-empty value for `bgp_prefix_id` but received {bgp_prefix_id!r}") return self._patch( f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes/{bgp_prefix_id}", - body=maybe_transform({"on_demand": on_demand}, prefix_edit_params.PrefixEditParams), + body=maybe_transform({"on_demand": on_demand}, bgp_prefix_edit_params.BGPPrefixEditParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -162,11 +212,11 @@ def get( Retrieve a single BGP Prefix according to its identifier Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - prefix_id: Identifier + prefix_id: Identifier of an IP Prefix. - bgp_prefix_id: Identifier + bgp_prefix_id: Identifier of BGP Prefix. extra_headers: Send extra headers @@ -195,25 +245,75 @@ def get( ) -class AsyncPrefixesResource(AsyncAPIResource): +class AsyncBGPPrefixesResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncPrefixesResourceWithRawResponse: + def with_raw_response(self) -> AsyncBGPPrefixesResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers """ - return AsyncPrefixesResourceWithRawResponse(self) + return AsyncBGPPrefixesResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncPrefixesResourceWithStreamingResponse: + def with_streaming_response(self) -> AsyncBGPPrefixesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response """ - return AsyncPrefixesResourceWithStreamingResponse(self) + return AsyncBGPPrefixesResourceWithStreamingResponse(self) + + async def create( + self, + prefix_id: str, + *, + account_id: str, + cidr: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[BGPPrefix]: + """ + Create a BGP prefix, controlling the BGP advertisement status of a specific + subnet. When created, BGP prefixes are initially withdrawn, and can be + advertised with the Update BGP Prefix API. + + Args: + account_id: Identifier of a Cloudflare account. + + prefix_id: Identifier of an IP Prefix. + + cidr: IP Prefix in Classless Inter-Domain Routing format. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not prefix_id: + raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}") + return await self._post( + f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes", + body=await async_maybe_transform({"cidr": cidr}, bgp_prefix_create_params.BGPPrefixCreateParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[BGPPrefix]]._unwrapper, + ), + cast_to=cast(Type[Optional[BGPPrefix]], ResultWrapper[BGPPrefix]), + ) def list( self, @@ -235,9 +335,9 @@ def list( Prefixes. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - prefix_id: Identifier + prefix_id: Identifier of an IP Prefix. extra_headers: Send extra headers @@ -266,7 +366,7 @@ async def edit( *, account_id: str, prefix_id: str, - on_demand: prefix_edit_params.OnDemand | NotGiven = NOT_GIVEN, + on_demand: bgp_prefix_edit_params.OnDemand | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -279,11 +379,11 @@ async def edit( status (advertised or withdrawn). Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - prefix_id: Identifier + prefix_id: Identifier of an IP Prefix. - bgp_prefix_id: Identifier + bgp_prefix_id: Identifier of BGP Prefix. extra_headers: Send extra headers @@ -301,7 +401,7 @@ async def edit( raise ValueError(f"Expected a non-empty value for `bgp_prefix_id` but received {bgp_prefix_id!r}") return await self._patch( f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes/{bgp_prefix_id}", - body=await async_maybe_transform({"on_demand": on_demand}, prefix_edit_params.PrefixEditParams), + body=await async_maybe_transform({"on_demand": on_demand}, bgp_prefix_edit_params.BGPPrefixEditParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -329,11 +429,11 @@ async def get( Retrieve a single BGP Prefix according to its identifier Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - prefix_id: Identifier + prefix_id: Identifier of an IP Prefix. - bgp_prefix_id: Identifier + bgp_prefix_id: Identifier of BGP Prefix. extra_headers: Send extra headers @@ -362,61 +462,73 @@ async def get( ) -class PrefixesResourceWithRawResponse: - def __init__(self, prefixes: PrefixesResource) -> None: - self._prefixes = prefixes +class BGPPrefixesResourceWithRawResponse: + def __init__(self, bgp_prefixes: BGPPrefixesResource) -> None: + self._bgp_prefixes = bgp_prefixes + self.create = to_raw_response_wrapper( + bgp_prefixes.create, + ) self.list = to_raw_response_wrapper( - prefixes.list, + bgp_prefixes.list, ) self.edit = to_raw_response_wrapper( - prefixes.edit, + bgp_prefixes.edit, ) self.get = to_raw_response_wrapper( - prefixes.get, + bgp_prefixes.get, ) -class AsyncPrefixesResourceWithRawResponse: - def __init__(self, prefixes: AsyncPrefixesResource) -> None: - self._prefixes = prefixes +class AsyncBGPPrefixesResourceWithRawResponse: + def __init__(self, bgp_prefixes: AsyncBGPPrefixesResource) -> None: + self._bgp_prefixes = bgp_prefixes + self.create = async_to_raw_response_wrapper( + bgp_prefixes.create, + ) self.list = async_to_raw_response_wrapper( - prefixes.list, + bgp_prefixes.list, ) self.edit = async_to_raw_response_wrapper( - prefixes.edit, + bgp_prefixes.edit, ) self.get = async_to_raw_response_wrapper( - prefixes.get, + bgp_prefixes.get, ) -class PrefixesResourceWithStreamingResponse: - def __init__(self, prefixes: PrefixesResource) -> None: - self._prefixes = prefixes +class BGPPrefixesResourceWithStreamingResponse: + def __init__(self, bgp_prefixes: BGPPrefixesResource) -> None: + self._bgp_prefixes = bgp_prefixes + self.create = to_streamed_response_wrapper( + bgp_prefixes.create, + ) self.list = to_streamed_response_wrapper( - prefixes.list, + bgp_prefixes.list, ) self.edit = to_streamed_response_wrapper( - prefixes.edit, + bgp_prefixes.edit, ) self.get = to_streamed_response_wrapper( - prefixes.get, + bgp_prefixes.get, ) -class AsyncPrefixesResourceWithStreamingResponse: - def __init__(self, prefixes: AsyncPrefixesResource) -> None: - self._prefixes = prefixes +class AsyncBGPPrefixesResourceWithStreamingResponse: + def __init__(self, bgp_prefixes: AsyncBGPPrefixesResource) -> None: + self._bgp_prefixes = bgp_prefixes + self.create = async_to_streamed_response_wrapper( + bgp_prefixes.create, + ) self.list = async_to_streamed_response_wrapper( - prefixes.list, + bgp_prefixes.list, ) self.edit = async_to_streamed_response_wrapper( - prefixes.edit, + bgp_prefixes.edit, ) self.get = async_to_streamed_response_wrapper( - prefixes.get, + bgp_prefixes.get, ) diff --git a/src/cloudflare/resources/addressing/prefixes/delegations.py b/src/cloudflare/resources/addressing/prefixes/delegations.py index b35f31a2893..93870db9319 100644 --- a/src/cloudflare/resources/addressing/prefixes/delegations.py +++ b/src/cloudflare/resources/addressing/prefixes/delegations.py @@ -67,9 +67,9 @@ def create( Create a new account delegation for a given IP prefix. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - prefix_id: Identifier + prefix_id: Identifier of an IP Prefix. cidr: IP Prefix in Classless Inter-Domain Routing format. @@ -122,9 +122,9 @@ def list( List all delegations for a given account IP prefix. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - prefix_id: Identifier + prefix_id: Identifier of an IP Prefix. extra_headers: Send extra headers @@ -164,11 +164,11 @@ def delete( Delete an account delegation for a given IP prefix. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - prefix_id: Identifier + prefix_id: Identifier of an IP Prefix. - delegation_id: Delegation identifier tag. + delegation_id: Identifier of a Delegation. extra_headers: Send extra headers @@ -235,9 +235,9 @@ async def create( Create a new account delegation for a given IP prefix. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - prefix_id: Identifier + prefix_id: Identifier of an IP Prefix. cidr: IP Prefix in Classless Inter-Domain Routing format. @@ -290,9 +290,9 @@ def list( List all delegations for a given account IP prefix. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - prefix_id: Identifier + prefix_id: Identifier of an IP Prefix. extra_headers: Send extra headers @@ -332,11 +332,11 @@ async def delete( Delete an account delegation for a given IP prefix. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - prefix_id: Identifier + prefix_id: Identifier of an IP Prefix. - delegation_id: Delegation identifier tag. + delegation_id: Identifier of a Delegation. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/addressing/prefixes/prefixes.py b/src/cloudflare/resources/addressing/prefixes/prefixes.py index f22011802f1..b9620460953 100644 --- a/src/cloudflare/resources/addressing/prefixes/prefixes.py +++ b/src/cloudflare/resources/addressing/prefixes/prefixes.py @@ -6,14 +6,6 @@ import httpx -from .bgp.bgp import ( - BGPResource, - AsyncBGPResource, - BGPResourceWithRawResponse, - AsyncBGPResourceWithRawResponse, - BGPResourceWithStreamingResponse, - AsyncBGPResourceWithStreamingResponse, -) from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( maybe_transform, @@ -36,9 +28,33 @@ async_to_streamed_response_wrapper, ) from ...._wrappers import ResultWrapper +from .bgp_prefixes import ( + BGPPrefixesResource, + AsyncBGPPrefixesResource, + BGPPrefixesResourceWithRawResponse, + AsyncBGPPrefixesResourceWithRawResponse, + BGPPrefixesResourceWithStreamingResponse, + AsyncBGPPrefixesResourceWithStreamingResponse, +) from ....pagination import SyncSinglePage, AsyncSinglePage from ...._base_client import AsyncPaginator, make_request_options +from .service_bindings import ( + ServiceBindingsResource, + AsyncServiceBindingsResource, + ServiceBindingsResourceWithRawResponse, + AsyncServiceBindingsResourceWithRawResponse, + ServiceBindingsResourceWithStreamingResponse, + AsyncServiceBindingsResourceWithStreamingResponse, +) from ....types.addressing import prefix_edit_params, prefix_create_params +from .advertisement_status import ( + AdvertisementStatusResource, + AsyncAdvertisementStatusResource, + AdvertisementStatusResourceWithRawResponse, + AsyncAdvertisementStatusResourceWithRawResponse, + AdvertisementStatusResourceWithStreamingResponse, + AsyncAdvertisementStatusResourceWithStreamingResponse, +) from ....types.addressing.prefix import Prefix from ....types.addressing.prefix_delete_response import PrefixDeleteResponse @@ -47,8 +63,16 @@ class PrefixesResource(SyncAPIResource): @cached_property - def bgp(self) -> BGPResource: - return BGPResource(self._client) + def service_bindings(self) -> ServiceBindingsResource: + return ServiceBindingsResource(self._client) + + @cached_property + def bgp_prefixes(self) -> BGPPrefixesResource: + return BGPPrefixesResource(self._client) + + @cached_property + def advertisement_status(self) -> AdvertisementStatusResource: + return AdvertisementStatusResource(self._client) @cached_property def delegations(self) -> DelegationsResource: @@ -91,7 +115,7 @@ def create( Add a new prefix under the account. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. asn: Autonomous System Number (ASN) the prefix will be advertised under. @@ -144,7 +168,7 @@ def list( List all prefixes owned by the account. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. extra_headers: Send extra headers @@ -181,9 +205,9 @@ def delete( Delete an unapproved prefix owned by the account. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - prefix_id: Identifier + prefix_id: Identifier of an IP Prefix. extra_headers: Send extra headers @@ -222,9 +246,9 @@ def edit( Modify the description for a prefix owned by the account. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - prefix_id: Identifier + prefix_id: Identifier of an IP Prefix. description: Description of the prefix. @@ -269,9 +293,9 @@ def get( List a particular prefix owned by the account. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - prefix_id: Identifier + prefix_id: Identifier of an IP Prefix. extra_headers: Send extra headers @@ -300,8 +324,16 @@ def get( class AsyncPrefixesResource(AsyncAPIResource): @cached_property - def bgp(self) -> AsyncBGPResource: - return AsyncBGPResource(self._client) + def service_bindings(self) -> AsyncServiceBindingsResource: + return AsyncServiceBindingsResource(self._client) + + @cached_property + def bgp_prefixes(self) -> AsyncBGPPrefixesResource: + return AsyncBGPPrefixesResource(self._client) + + @cached_property + def advertisement_status(self) -> AsyncAdvertisementStatusResource: + return AsyncAdvertisementStatusResource(self._client) @cached_property def delegations(self) -> AsyncDelegationsResource: @@ -344,7 +376,7 @@ async def create( Add a new prefix under the account. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. asn: Autonomous System Number (ASN) the prefix will be advertised under. @@ -397,7 +429,7 @@ def list( List all prefixes owned by the account. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. extra_headers: Send extra headers @@ -434,9 +466,9 @@ async def delete( Delete an unapproved prefix owned by the account. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - prefix_id: Identifier + prefix_id: Identifier of an IP Prefix. extra_headers: Send extra headers @@ -475,9 +507,9 @@ async def edit( Modify the description for a prefix owned by the account. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - prefix_id: Identifier + prefix_id: Identifier of an IP Prefix. description: Description of the prefix. @@ -522,9 +554,9 @@ async def get( List a particular prefix owned by the account. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - prefix_id: Identifier + prefix_id: Identifier of an IP Prefix. extra_headers: Send extra headers @@ -572,8 +604,16 @@ def __init__(self, prefixes: PrefixesResource) -> None: ) @cached_property - def bgp(self) -> BGPResourceWithRawResponse: - return BGPResourceWithRawResponse(self._prefixes.bgp) + def service_bindings(self) -> ServiceBindingsResourceWithRawResponse: + return ServiceBindingsResourceWithRawResponse(self._prefixes.service_bindings) + + @cached_property + def bgp_prefixes(self) -> BGPPrefixesResourceWithRawResponse: + return BGPPrefixesResourceWithRawResponse(self._prefixes.bgp_prefixes) + + @cached_property + def advertisement_status(self) -> AdvertisementStatusResourceWithRawResponse: + return AdvertisementStatusResourceWithRawResponse(self._prefixes.advertisement_status) @cached_property def delegations(self) -> DelegationsResourceWithRawResponse: @@ -601,8 +641,16 @@ def __init__(self, prefixes: AsyncPrefixesResource) -> None: ) @cached_property - def bgp(self) -> AsyncBGPResourceWithRawResponse: - return AsyncBGPResourceWithRawResponse(self._prefixes.bgp) + def service_bindings(self) -> AsyncServiceBindingsResourceWithRawResponse: + return AsyncServiceBindingsResourceWithRawResponse(self._prefixes.service_bindings) + + @cached_property + def bgp_prefixes(self) -> AsyncBGPPrefixesResourceWithRawResponse: + return AsyncBGPPrefixesResourceWithRawResponse(self._prefixes.bgp_prefixes) + + @cached_property + def advertisement_status(self) -> AsyncAdvertisementStatusResourceWithRawResponse: + return AsyncAdvertisementStatusResourceWithRawResponse(self._prefixes.advertisement_status) @cached_property def delegations(self) -> AsyncDelegationsResourceWithRawResponse: @@ -630,8 +678,16 @@ def __init__(self, prefixes: PrefixesResource) -> None: ) @cached_property - def bgp(self) -> BGPResourceWithStreamingResponse: - return BGPResourceWithStreamingResponse(self._prefixes.bgp) + def service_bindings(self) -> ServiceBindingsResourceWithStreamingResponse: + return ServiceBindingsResourceWithStreamingResponse(self._prefixes.service_bindings) + + @cached_property + def bgp_prefixes(self) -> BGPPrefixesResourceWithStreamingResponse: + return BGPPrefixesResourceWithStreamingResponse(self._prefixes.bgp_prefixes) + + @cached_property + def advertisement_status(self) -> AdvertisementStatusResourceWithStreamingResponse: + return AdvertisementStatusResourceWithStreamingResponse(self._prefixes.advertisement_status) @cached_property def delegations(self) -> DelegationsResourceWithStreamingResponse: @@ -659,8 +715,16 @@ def __init__(self, prefixes: AsyncPrefixesResource) -> None: ) @cached_property - def bgp(self) -> AsyncBGPResourceWithStreamingResponse: - return AsyncBGPResourceWithStreamingResponse(self._prefixes.bgp) + def service_bindings(self) -> AsyncServiceBindingsResourceWithStreamingResponse: + return AsyncServiceBindingsResourceWithStreamingResponse(self._prefixes.service_bindings) + + @cached_property + def bgp_prefixes(self) -> AsyncBGPPrefixesResourceWithStreamingResponse: + return AsyncBGPPrefixesResourceWithStreamingResponse(self._prefixes.bgp_prefixes) + + @cached_property + def advertisement_status(self) -> AsyncAdvertisementStatusResourceWithStreamingResponse: + return AsyncAdvertisementStatusResourceWithStreamingResponse(self._prefixes.advertisement_status) @cached_property def delegations(self) -> AsyncDelegationsResourceWithStreamingResponse: diff --git a/src/cloudflare/resources/addressing/prefixes/bgp/bindings.py b/src/cloudflare/resources/addressing/prefixes/service_bindings.py similarity index 80% rename from src/cloudflare/resources/addressing/prefixes/bgp/bindings.py rename to src/cloudflare/resources/addressing/prefixes/service_bindings.py index 32a3c303168..c5be5b730ca 100644 --- a/src/cloudflare/resources/addressing/prefixes/bgp/bindings.py +++ b/src/cloudflare/resources/addressing/prefixes/service_bindings.py @@ -6,48 +6,48 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ....._utils import ( +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( maybe_transform, async_maybe_transform, ) -from ....._compat import cached_property -from ....._resource import SyncAPIResource, AsyncAPIResource -from ....._response import ( +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ....._wrappers import ResultWrapper -from .....pagination import SyncSinglePage, AsyncSinglePage -from ....._base_client import AsyncPaginator, make_request_options -from .....types.addressing.prefixes.bgp import binding_create_params -from .....types.addressing.prefixes.bgp.service_binding import ServiceBinding -from .....types.addressing.prefixes.bgp.binding_delete_response import BindingDeleteResponse +from ...._wrappers import ResultWrapper +from ....pagination import SyncSinglePage, AsyncSinglePage +from ...._base_client import AsyncPaginator, make_request_options +from ....types.addressing.prefixes import service_binding_create_params +from ....types.addressing.prefixes.service_binding import ServiceBinding +from ....types.addressing.prefixes.service_binding_delete_response import ServiceBindingDeleteResponse -__all__ = ["BindingsResource", "AsyncBindingsResource"] +__all__ = ["ServiceBindingsResource", "AsyncServiceBindingsResource"] -class BindingsResource(SyncAPIResource): +class ServiceBindingsResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> BindingsResourceWithRawResponse: + def with_raw_response(self) -> ServiceBindingsResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers """ - return BindingsResourceWithRawResponse(self) + return ServiceBindingsResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> BindingsResourceWithStreamingResponse: + def with_streaming_response(self) -> ServiceBindingsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response """ - return BindingsResourceWithStreamingResponse(self) + return ServiceBindingsResourceWithStreamingResponse(self) def create( self, @@ -70,13 +70,14 @@ def create( allows creating service bindings for the Cloudflare CDN or Cloudflare Spectrum. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - prefix_id: Identifier + prefix_id: Identifier of an IP Prefix. cidr: IP Prefix in Classless Inter-Domain Routing format. - service_id: Identifier + service_id: Identifier of a Service on the Cloudflare network. Available services and their + IDs may be found in the **List Services** endpoint. extra_headers: Send extra headers @@ -97,7 +98,7 @@ def create( "cidr": cidr, "service_id": service_id, }, - binding_create_params.BindingCreateParams, + service_binding_create_params.ServiceBindingCreateParams, ), options=make_request_options( extra_headers=extra_headers, @@ -131,9 +132,9 @@ def list( IPs in the prefix to Cloudflare Magic Transit. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - prefix_id: Identifier + prefix_id: Identifier of an IP Prefix. extra_headers: Send extra headers @@ -168,16 +169,16 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BindingDeleteResponse: + ) -> ServiceBindingDeleteResponse: """ Delete a Service Binding Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - prefix_id: Identifier + prefix_id: Identifier of an IP Prefix. - binding_id: Identifier + binding_id: Identifier of a Service Binding. extra_headers: Send extra headers @@ -198,7 +199,7 @@ def delete( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=BindingDeleteResponse, + cast_to=ServiceBindingDeleteResponse, ) def get( @@ -218,11 +219,11 @@ def get( Fetch a single Service Binding Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - prefix_id: Identifier + prefix_id: Identifier of an IP Prefix. - binding_id: Identifier + binding_id: Identifier of a Service Binding. extra_headers: Send extra headers @@ -251,25 +252,25 @@ def get( ) -class AsyncBindingsResource(AsyncAPIResource): +class AsyncServiceBindingsResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncBindingsResourceWithRawResponse: + def with_raw_response(self) -> AsyncServiceBindingsResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers """ - return AsyncBindingsResourceWithRawResponse(self) + return AsyncServiceBindingsResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncBindingsResourceWithStreamingResponse: + def with_streaming_response(self) -> AsyncServiceBindingsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response """ - return AsyncBindingsResourceWithStreamingResponse(self) + return AsyncServiceBindingsResourceWithStreamingResponse(self) async def create( self, @@ -292,13 +293,14 @@ async def create( allows creating service bindings for the Cloudflare CDN or Cloudflare Spectrum. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - prefix_id: Identifier + prefix_id: Identifier of an IP Prefix. cidr: IP Prefix in Classless Inter-Domain Routing format. - service_id: Identifier + service_id: Identifier of a Service on the Cloudflare network. Available services and their + IDs may be found in the **List Services** endpoint. extra_headers: Send extra headers @@ -319,7 +321,7 @@ async def create( "cidr": cidr, "service_id": service_id, }, - binding_create_params.BindingCreateParams, + service_binding_create_params.ServiceBindingCreateParams, ), options=make_request_options( extra_headers=extra_headers, @@ -353,9 +355,9 @@ def list( IPs in the prefix to Cloudflare Magic Transit. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - prefix_id: Identifier + prefix_id: Identifier of an IP Prefix. extra_headers: Send extra headers @@ -390,16 +392,16 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BindingDeleteResponse: + ) -> ServiceBindingDeleteResponse: """ Delete a Service Binding Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - prefix_id: Identifier + prefix_id: Identifier of an IP Prefix. - binding_id: Identifier + binding_id: Identifier of a Service Binding. extra_headers: Send extra headers @@ -420,7 +422,7 @@ async def delete( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=BindingDeleteResponse, + cast_to=ServiceBindingDeleteResponse, ) async def get( @@ -440,11 +442,11 @@ async def get( Fetch a single Service Binding Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. - prefix_id: Identifier + prefix_id: Identifier of an IP Prefix. - binding_id: Identifier + binding_id: Identifier of a Service Binding. extra_headers: Send extra headers @@ -473,73 +475,73 @@ async def get( ) -class BindingsResourceWithRawResponse: - def __init__(self, bindings: BindingsResource) -> None: - self._bindings = bindings +class ServiceBindingsResourceWithRawResponse: + def __init__(self, service_bindings: ServiceBindingsResource) -> None: + self._service_bindings = service_bindings self.create = to_raw_response_wrapper( - bindings.create, + service_bindings.create, ) self.list = to_raw_response_wrapper( - bindings.list, + service_bindings.list, ) self.delete = to_raw_response_wrapper( - bindings.delete, + service_bindings.delete, ) self.get = to_raw_response_wrapper( - bindings.get, + service_bindings.get, ) -class AsyncBindingsResourceWithRawResponse: - def __init__(self, bindings: AsyncBindingsResource) -> None: - self._bindings = bindings +class AsyncServiceBindingsResourceWithRawResponse: + def __init__(self, service_bindings: AsyncServiceBindingsResource) -> None: + self._service_bindings = service_bindings self.create = async_to_raw_response_wrapper( - bindings.create, + service_bindings.create, ) self.list = async_to_raw_response_wrapper( - bindings.list, + service_bindings.list, ) self.delete = async_to_raw_response_wrapper( - bindings.delete, + service_bindings.delete, ) self.get = async_to_raw_response_wrapper( - bindings.get, + service_bindings.get, ) -class BindingsResourceWithStreamingResponse: - def __init__(self, bindings: BindingsResource) -> None: - self._bindings = bindings +class ServiceBindingsResourceWithStreamingResponse: + def __init__(self, service_bindings: ServiceBindingsResource) -> None: + self._service_bindings = service_bindings self.create = to_streamed_response_wrapper( - bindings.create, + service_bindings.create, ) self.list = to_streamed_response_wrapper( - bindings.list, + service_bindings.list, ) self.delete = to_streamed_response_wrapper( - bindings.delete, + service_bindings.delete, ) self.get = to_streamed_response_wrapper( - bindings.get, + service_bindings.get, ) -class AsyncBindingsResourceWithStreamingResponse: - def __init__(self, bindings: AsyncBindingsResource) -> None: - self._bindings = bindings +class AsyncServiceBindingsResourceWithStreamingResponse: + def __init__(self, service_bindings: AsyncServiceBindingsResource) -> None: + self._service_bindings = service_bindings self.create = async_to_streamed_response_wrapper( - bindings.create, + service_bindings.create, ) self.list = async_to_streamed_response_wrapper( - bindings.list, + service_bindings.list, ) self.delete = async_to_streamed_response_wrapper( - bindings.delete, + service_bindings.delete, ) self.get = async_to_streamed_response_wrapper( - bindings.get, + service_bindings.get, ) diff --git a/src/cloudflare/resources/addressing/services.py b/src/cloudflare/resources/addressing/services.py index 56fe70d70b9..e73f0c62298 100644 --- a/src/cloudflare/resources/addressing/services.py +++ b/src/cloudflare/resources/addressing/services.py @@ -58,7 +58,7 @@ def list( the Cloudflare network, and their service IDs. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. extra_headers: Send extra headers @@ -118,7 +118,7 @@ def list( the Cloudflare network, and their service IDs. Args: - account_id: Identifier + account_id: Identifier of a Cloudflare account. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/ai/__init__.py b/src/cloudflare/resources/ai/__init__.py new file mode 100644 index 00000000000..26c6c71d160 --- /dev/null +++ b/src/cloudflare/resources/ai/__init__.py @@ -0,0 +1,75 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .ai import ( + AIResource, + AsyncAIResource, + AIResourceWithRawResponse, + AsyncAIResourceWithRawResponse, + AIResourceWithStreamingResponse, + AsyncAIResourceWithStreamingResponse, +) +from .tasks import ( + TasksResource, + AsyncTasksResource, + TasksResourceWithRawResponse, + AsyncTasksResourceWithRawResponse, + TasksResourceWithStreamingResponse, + AsyncTasksResourceWithStreamingResponse, +) +from .models import ( + ModelsResource, + AsyncModelsResource, + ModelsResourceWithRawResponse, + AsyncModelsResourceWithRawResponse, + ModelsResourceWithStreamingResponse, + AsyncModelsResourceWithStreamingResponse, +) +from .authors import ( + AuthorsResource, + AsyncAuthorsResource, + AuthorsResourceWithRawResponse, + AsyncAuthorsResourceWithRawResponse, + AuthorsResourceWithStreamingResponse, + AsyncAuthorsResourceWithStreamingResponse, +) +from .finetunes import ( + FinetunesResource, + AsyncFinetunesResource, + FinetunesResourceWithRawResponse, + AsyncFinetunesResourceWithRawResponse, + FinetunesResourceWithStreamingResponse, + AsyncFinetunesResourceWithStreamingResponse, +) + +__all__ = [ + "FinetunesResource", + "AsyncFinetunesResource", + "FinetunesResourceWithRawResponse", + "AsyncFinetunesResourceWithRawResponse", + "FinetunesResourceWithStreamingResponse", + "AsyncFinetunesResourceWithStreamingResponse", + "AuthorsResource", + "AsyncAuthorsResource", + "AuthorsResourceWithRawResponse", + "AsyncAuthorsResourceWithRawResponse", + "AuthorsResourceWithStreamingResponse", + "AsyncAuthorsResourceWithStreamingResponse", + "TasksResource", + "AsyncTasksResource", + "TasksResourceWithRawResponse", + "AsyncTasksResourceWithRawResponse", + "TasksResourceWithStreamingResponse", + "AsyncTasksResourceWithStreamingResponse", + "ModelsResource", + "AsyncModelsResource", + "ModelsResourceWithRawResponse", + "AsyncModelsResourceWithRawResponse", + "ModelsResourceWithStreamingResponse", + "AsyncModelsResourceWithStreamingResponse", + "AIResource", + "AsyncAIResource", + "AIResourceWithRawResponse", + "AsyncAIResourceWithRawResponse", + "AIResourceWithStreamingResponse", + "AsyncAIResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/workers/ai/ai.py b/src/cloudflare/resources/ai/ai.py similarity index 94% rename from src/cloudflare/resources/workers/ai/ai.py rename to src/cloudflare/resources/ai/ai.py index 91012966858..396a1360fe9 100644 --- a/src/cloudflare/resources/workers/ai/ai.py +++ b/src/cloudflare/resources/ai/ai.py @@ -7,21 +7,38 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import ( +from .tasks import ( + TasksResource, + AsyncTasksResource, + TasksResourceWithRawResponse, + AsyncTasksResourceWithRawResponse, + TasksResourceWithStreamingResponse, + AsyncTasksResourceWithStreamingResponse, +) +from .authors import ( + AuthorsResource, + AsyncAuthorsResource, + AuthorsResourceWithRawResponse, + AsyncAuthorsResourceWithRawResponse, + AuthorsResourceWithStreamingResponse, + AsyncAuthorsResourceWithStreamingResponse, +) +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( required_args, maybe_transform, async_maybe_transform, ) -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( +from ..._compat import cached_property +from ...types.ai import ai_run_params +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...._wrappers import ResultWrapper +from ..._wrappers import ResultWrapper from .models.models import ( ModelsResource, AsyncModelsResource, @@ -30,14 +47,33 @@ ModelsResourceWithStreamingResponse, AsyncModelsResourceWithStreamingResponse, ) -from ...._base_client import make_request_options -from ....types.workers import ai_run_params -from ....types.workers.ai_run_response import AIRunResponse +from ..._base_client import make_request_options +from .finetunes.finetunes import ( + FinetunesResource, + AsyncFinetunesResource, + FinetunesResourceWithRawResponse, + AsyncFinetunesResourceWithRawResponse, + FinetunesResourceWithStreamingResponse, + AsyncFinetunesResourceWithStreamingResponse, +) +from ...types.ai.ai_run_response import AIRunResponse __all__ = ["AIResource", "AsyncAIResource"] class AIResource(SyncAPIResource): + @cached_property + def finetunes(self) -> FinetunesResource: + return FinetunesResource(self._client) + + @cached_property + def authors(self) -> AuthorsResource: + return AuthorsResource(self._client) + + @cached_property + def tasks(self) -> TasksResource: + return TasksResource(self._client) + @cached_property def models(self) -> ModelsResource: return ModelsResource(self._client) @@ -778,6 +814,18 @@ def run( class AsyncAIResource(AsyncAPIResource): + @cached_property + def finetunes(self) -> AsyncFinetunesResource: + return AsyncFinetunesResource(self._client) + + @cached_property + def authors(self) -> AsyncAuthorsResource: + return AsyncAuthorsResource(self._client) + + @cached_property + def tasks(self) -> AsyncTasksResource: + return AsyncTasksResource(self._client) + @cached_property def models(self) -> AsyncModelsResource: return AsyncModelsResource(self._client) @@ -1525,6 +1573,18 @@ def __init__(self, ai: AIResource) -> None: ai.run, ) + @cached_property + def finetunes(self) -> FinetunesResourceWithRawResponse: + return FinetunesResourceWithRawResponse(self._ai.finetunes) + + @cached_property + def authors(self) -> AuthorsResourceWithRawResponse: + return AuthorsResourceWithRawResponse(self._ai.authors) + + @cached_property + def tasks(self) -> TasksResourceWithRawResponse: + return TasksResourceWithRawResponse(self._ai.tasks) + @cached_property def models(self) -> ModelsResourceWithRawResponse: return ModelsResourceWithRawResponse(self._ai.models) @@ -1538,6 +1598,18 @@ def __init__(self, ai: AsyncAIResource) -> None: ai.run, ) + @cached_property + def finetunes(self) -> AsyncFinetunesResourceWithRawResponse: + return AsyncFinetunesResourceWithRawResponse(self._ai.finetunes) + + @cached_property + def authors(self) -> AsyncAuthorsResourceWithRawResponse: + return AsyncAuthorsResourceWithRawResponse(self._ai.authors) + + @cached_property + def tasks(self) -> AsyncTasksResourceWithRawResponse: + return AsyncTasksResourceWithRawResponse(self._ai.tasks) + @cached_property def models(self) -> AsyncModelsResourceWithRawResponse: return AsyncModelsResourceWithRawResponse(self._ai.models) @@ -1551,6 +1623,18 @@ def __init__(self, ai: AIResource) -> None: ai.run, ) + @cached_property + def finetunes(self) -> FinetunesResourceWithStreamingResponse: + return FinetunesResourceWithStreamingResponse(self._ai.finetunes) + + @cached_property + def authors(self) -> AuthorsResourceWithStreamingResponse: + return AuthorsResourceWithStreamingResponse(self._ai.authors) + + @cached_property + def tasks(self) -> TasksResourceWithStreamingResponse: + return TasksResourceWithStreamingResponse(self._ai.tasks) + @cached_property def models(self) -> ModelsResourceWithStreamingResponse: return ModelsResourceWithStreamingResponse(self._ai.models) @@ -1564,6 +1648,18 @@ def __init__(self, ai: AsyncAIResource) -> None: ai.run, ) + @cached_property + def finetunes(self) -> AsyncFinetunesResourceWithStreamingResponse: + return AsyncFinetunesResourceWithStreamingResponse(self._ai.finetunes) + + @cached_property + def authors(self) -> AsyncAuthorsResourceWithStreamingResponse: + return AsyncAuthorsResourceWithStreamingResponse(self._ai.authors) + + @cached_property + def tasks(self) -> AsyncTasksResourceWithStreamingResponse: + return AsyncTasksResourceWithStreamingResponse(self._ai.tasks) + @cached_property def models(self) -> AsyncModelsResourceWithStreamingResponse: return AsyncModelsResourceWithStreamingResponse(self._ai.models) diff --git a/src/cloudflare/resources/ai/authors.py b/src/cloudflare/resources/ai/authors.py new file mode 100644 index 00000000000..ecf213ff048 --- /dev/null +++ b/src/cloudflare/resources/ai/authors.py @@ -0,0 +1,165 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...pagination import SyncSinglePage, AsyncSinglePage +from ..._base_client import AsyncPaginator, make_request_options + +__all__ = ["AuthorsResource", "AsyncAuthorsResource"] + + +class AuthorsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> AuthorsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AuthorsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AuthorsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AuthorsResourceWithStreamingResponse(self) + + def list( + self, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncSinglePage[object]: + """ + Author Search + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get_api_list( + f"/accounts/{account_id}/ai/authors/search", + page=SyncSinglePage[object], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=object, + ) + + +class AsyncAuthorsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncAuthorsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncAuthorsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncAuthorsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncAuthorsResourceWithStreamingResponse(self) + + def list( + self, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[object, AsyncSinglePage[object]]: + """ + Author Search + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get_api_list( + f"/accounts/{account_id}/ai/authors/search", + page=AsyncSinglePage[object], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=object, + ) + + +class AuthorsResourceWithRawResponse: + def __init__(self, authors: AuthorsResource) -> None: + self._authors = authors + + self.list = to_raw_response_wrapper( + authors.list, + ) + + +class AsyncAuthorsResourceWithRawResponse: + def __init__(self, authors: AsyncAuthorsResource) -> None: + self._authors = authors + + self.list = async_to_raw_response_wrapper( + authors.list, + ) + + +class AuthorsResourceWithStreamingResponse: + def __init__(self, authors: AuthorsResource) -> None: + self._authors = authors + + self.list = to_streamed_response_wrapper( + authors.list, + ) + + +class AsyncAuthorsResourceWithStreamingResponse: + def __init__(self, authors: AsyncAuthorsResource) -> None: + self._authors = authors + + self.list = async_to_streamed_response_wrapper( + authors.list, + ) diff --git a/src/cloudflare/resources/ai/finetunes/__init__.py b/src/cloudflare/resources/ai/finetunes/__init__.py new file mode 100644 index 00000000000..57d977a86f3 --- /dev/null +++ b/src/cloudflare/resources/ai/finetunes/__init__.py @@ -0,0 +1,47 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .assets import ( + AssetsResource, + AsyncAssetsResource, + AssetsResourceWithRawResponse, + AsyncAssetsResourceWithRawResponse, + AssetsResourceWithStreamingResponse, + AsyncAssetsResourceWithStreamingResponse, +) +from .public import ( + PublicResource, + AsyncPublicResource, + PublicResourceWithRawResponse, + AsyncPublicResourceWithRawResponse, + PublicResourceWithStreamingResponse, + AsyncPublicResourceWithStreamingResponse, +) +from .finetunes import ( + FinetunesResource, + AsyncFinetunesResource, + FinetunesResourceWithRawResponse, + AsyncFinetunesResourceWithRawResponse, + FinetunesResourceWithStreamingResponse, + AsyncFinetunesResourceWithStreamingResponse, +) + +__all__ = [ + "AssetsResource", + "AsyncAssetsResource", + "AssetsResourceWithRawResponse", + "AsyncAssetsResourceWithRawResponse", + "AssetsResourceWithStreamingResponse", + "AsyncAssetsResourceWithStreamingResponse", + "PublicResource", + "AsyncPublicResource", + "PublicResourceWithRawResponse", + "AsyncPublicResourceWithRawResponse", + "PublicResourceWithStreamingResponse", + "AsyncPublicResourceWithStreamingResponse", + "FinetunesResource", + "AsyncFinetunesResource", + "FinetunesResourceWithRawResponse", + "AsyncFinetunesResourceWithRawResponse", + "FinetunesResourceWithStreamingResponse", + "AsyncFinetunesResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/ai/finetunes/assets.py b/src/cloudflare/resources/ai/finetunes/assets.py new file mode 100644 index 00000000000..dfeb072ae01 --- /dev/null +++ b/src/cloudflare/resources/ai/finetunes/assets.py @@ -0,0 +1,217 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, Mapping, cast + +import httpx + +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes +from ...._utils import ( + extract_files, + maybe_transform, + deepcopy_minimal, + async_maybe_transform, +) +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...._wrappers import ResultWrapper +from ...._base_client import make_request_options +from ....types.ai.finetunes import asset_create_params +from ....types.ai.finetunes.asset_create_response import AssetCreateResponse + +__all__ = ["AssetsResource", "AsyncAssetsResource"] + + +class AssetsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> AssetsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AssetsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AssetsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AssetsResourceWithStreamingResponse(self) + + def create( + self, + finetune_id: str, + *, + account_id: str, + file: FileTypes | NotGiven = NOT_GIVEN, + file_name: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AssetCreateResponse: + """ + Upload a Finetune Asset + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not finetune_id: + raise ValueError(f"Expected a non-empty value for `finetune_id` but received {finetune_id!r}") + body = deepcopy_minimal( + { + "file": file, + "file_name": file_name, + } + ) + files = extract_files(cast(Mapping[str, object], body), paths=[["file"]]) + # It should be noted that the actual Content-Type header that will be + # sent to the server will contain a `boundary` parameter, e.g. + # multipart/form-data; boundary=---abc-- + extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} + return self._post( + f"/accounts/{account_id}/ai/finetunes/{finetune_id}/finetune-assets", + body=maybe_transform(body, asset_create_params.AssetCreateParams), + files=files, + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[AssetCreateResponse]._unwrapper, + ), + cast_to=cast(Type[AssetCreateResponse], ResultWrapper[AssetCreateResponse]), + ) + + +class AsyncAssetsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncAssetsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncAssetsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncAssetsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncAssetsResourceWithStreamingResponse(self) + + async def create( + self, + finetune_id: str, + *, + account_id: str, + file: FileTypes | NotGiven = NOT_GIVEN, + file_name: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AssetCreateResponse: + """ + Upload a Finetune Asset + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not finetune_id: + raise ValueError(f"Expected a non-empty value for `finetune_id` but received {finetune_id!r}") + body = deepcopy_minimal( + { + "file": file, + "file_name": file_name, + } + ) + files = extract_files(cast(Mapping[str, object], body), paths=[["file"]]) + # It should be noted that the actual Content-Type header that will be + # sent to the server will contain a `boundary` parameter, e.g. + # multipart/form-data; boundary=---abc-- + extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} + return await self._post( + f"/accounts/{account_id}/ai/finetunes/{finetune_id}/finetune-assets", + body=await async_maybe_transform(body, asset_create_params.AssetCreateParams), + files=files, + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[AssetCreateResponse]._unwrapper, + ), + cast_to=cast(Type[AssetCreateResponse], ResultWrapper[AssetCreateResponse]), + ) + + +class AssetsResourceWithRawResponse: + def __init__(self, assets: AssetsResource) -> None: + self._assets = assets + + self.create = to_raw_response_wrapper( + assets.create, + ) + + +class AsyncAssetsResourceWithRawResponse: + def __init__(self, assets: AsyncAssetsResource) -> None: + self._assets = assets + + self.create = async_to_raw_response_wrapper( + assets.create, + ) + + +class AssetsResourceWithStreamingResponse: + def __init__(self, assets: AssetsResource) -> None: + self._assets = assets + + self.create = to_streamed_response_wrapper( + assets.create, + ) + + +class AsyncAssetsResourceWithStreamingResponse: + def __init__(self, assets: AsyncAssetsResource) -> None: + self._assets = assets + + self.create = async_to_streamed_response_wrapper( + assets.create, + ) diff --git a/src/cloudflare/resources/ai/finetunes/finetunes.py b/src/cloudflare/resources/ai/finetunes/finetunes.py new file mode 100644 index 00000000000..1cdef4efc51 --- /dev/null +++ b/src/cloudflare/resources/ai/finetunes/finetunes.py @@ -0,0 +1,356 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, cast + +import httpx + +from .assets import ( + AssetsResource, + AsyncAssetsResource, + AssetsResourceWithRawResponse, + AsyncAssetsResourceWithRawResponse, + AssetsResourceWithStreamingResponse, + AsyncAssetsResourceWithStreamingResponse, +) +from .public import ( + PublicResource, + AsyncPublicResource, + PublicResourceWithRawResponse, + AsyncPublicResourceWithRawResponse, + PublicResourceWithStreamingResponse, + AsyncPublicResourceWithStreamingResponse, +) +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( + maybe_transform, + async_maybe_transform, +) +from ...._compat import cached_property +from ....types.ai import finetune_create_params +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...._wrappers import ResultWrapper +from ...._base_client import make_request_options +from ....types.ai.finetune_list_response import FinetuneListResponse +from ....types.ai.finetune_create_response import FinetuneCreateResponse + +__all__ = ["FinetunesResource", "AsyncFinetunesResource"] + + +class FinetunesResource(SyncAPIResource): + @cached_property + def assets(self) -> AssetsResource: + return AssetsResource(self._client) + + @cached_property + def public(self) -> PublicResource: + return PublicResource(self._client) + + @cached_property + def with_raw_response(self) -> FinetunesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return FinetunesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> FinetunesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return FinetunesResourceWithStreamingResponse(self) + + def create( + self, + *, + account_id: str, + model: str, + name: str, + description: str | NotGiven = NOT_GIVEN, + public: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FinetuneCreateResponse: + """ + Create a new Finetune + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._post( + f"/accounts/{account_id}/ai/finetunes", + body=maybe_transform( + { + "model": model, + "name": name, + "description": description, + "public": public, + }, + finetune_create_params.FinetuneCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[FinetuneCreateResponse]._unwrapper, + ), + cast_to=cast(Type[FinetuneCreateResponse], ResultWrapper[FinetuneCreateResponse]), + ) + + def list( + self, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FinetuneListResponse: + """ + List Finetunes + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get( + f"/accounts/{account_id}/ai/finetunes", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[FinetuneListResponse]._unwrapper, + ), + cast_to=cast(Type[FinetuneListResponse], ResultWrapper[FinetuneListResponse]), + ) + + +class AsyncFinetunesResource(AsyncAPIResource): + @cached_property + def assets(self) -> AsyncAssetsResource: + return AsyncAssetsResource(self._client) + + @cached_property + def public(self) -> AsyncPublicResource: + return AsyncPublicResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncFinetunesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncFinetunesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncFinetunesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncFinetunesResourceWithStreamingResponse(self) + + async def create( + self, + *, + account_id: str, + model: str, + name: str, + description: str | NotGiven = NOT_GIVEN, + public: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FinetuneCreateResponse: + """ + Create a new Finetune + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return await self._post( + f"/accounts/{account_id}/ai/finetunes", + body=await async_maybe_transform( + { + "model": model, + "name": name, + "description": description, + "public": public, + }, + finetune_create_params.FinetuneCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[FinetuneCreateResponse]._unwrapper, + ), + cast_to=cast(Type[FinetuneCreateResponse], ResultWrapper[FinetuneCreateResponse]), + ) + + async def list( + self, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FinetuneListResponse: + """ + List Finetunes + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return await self._get( + f"/accounts/{account_id}/ai/finetunes", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[FinetuneListResponse]._unwrapper, + ), + cast_to=cast(Type[FinetuneListResponse], ResultWrapper[FinetuneListResponse]), + ) + + +class FinetunesResourceWithRawResponse: + def __init__(self, finetunes: FinetunesResource) -> None: + self._finetunes = finetunes + + self.create = to_raw_response_wrapper( + finetunes.create, + ) + self.list = to_raw_response_wrapper( + finetunes.list, + ) + + @cached_property + def assets(self) -> AssetsResourceWithRawResponse: + return AssetsResourceWithRawResponse(self._finetunes.assets) + + @cached_property + def public(self) -> PublicResourceWithRawResponse: + return PublicResourceWithRawResponse(self._finetunes.public) + + +class AsyncFinetunesResourceWithRawResponse: + def __init__(self, finetunes: AsyncFinetunesResource) -> None: + self._finetunes = finetunes + + self.create = async_to_raw_response_wrapper( + finetunes.create, + ) + self.list = async_to_raw_response_wrapper( + finetunes.list, + ) + + @cached_property + def assets(self) -> AsyncAssetsResourceWithRawResponse: + return AsyncAssetsResourceWithRawResponse(self._finetunes.assets) + + @cached_property + def public(self) -> AsyncPublicResourceWithRawResponse: + return AsyncPublicResourceWithRawResponse(self._finetunes.public) + + +class FinetunesResourceWithStreamingResponse: + def __init__(self, finetunes: FinetunesResource) -> None: + self._finetunes = finetunes + + self.create = to_streamed_response_wrapper( + finetunes.create, + ) + self.list = to_streamed_response_wrapper( + finetunes.list, + ) + + @cached_property + def assets(self) -> AssetsResourceWithStreamingResponse: + return AssetsResourceWithStreamingResponse(self._finetunes.assets) + + @cached_property + def public(self) -> PublicResourceWithStreamingResponse: + return PublicResourceWithStreamingResponse(self._finetunes.public) + + +class AsyncFinetunesResourceWithStreamingResponse: + def __init__(self, finetunes: AsyncFinetunesResource) -> None: + self._finetunes = finetunes + + self.create = async_to_streamed_response_wrapper( + finetunes.create, + ) + self.list = async_to_streamed_response_wrapper( + finetunes.list, + ) + + @cached_property + def assets(self) -> AsyncAssetsResourceWithStreamingResponse: + return AsyncAssetsResourceWithStreamingResponse(self._finetunes.assets) + + @cached_property + def public(self) -> AsyncPublicResourceWithStreamingResponse: + return AsyncPublicResourceWithStreamingResponse(self._finetunes.public) diff --git a/src/cloudflare/resources/ai/finetunes/public.py b/src/cloudflare/resources/ai/finetunes/public.py new file mode 100644 index 00000000000..74c49e747fa --- /dev/null +++ b/src/cloudflare/resources/ai/finetunes/public.py @@ -0,0 +1,208 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import maybe_transform +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ....pagination import SyncSinglePage, AsyncSinglePage +from ...._base_client import AsyncPaginator, make_request_options +from ....types.ai.finetunes import public_list_params +from ....types.ai.finetunes.public_list_response import PublicListResponse + +__all__ = ["PublicResource", "AsyncPublicResource"] + + +class PublicResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> PublicResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return PublicResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> PublicResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return PublicResourceWithStreamingResponse(self) + + def list( + self, + *, + account_id: str, + limit: float | NotGiven = NOT_GIVEN, + offset: float | NotGiven = NOT_GIVEN, + order_by: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncSinglePage[PublicListResponse]: + """ + List Public Finetunes + + Args: + limit: Pagination Limit + + offset: Pagination Offset + + order_by: Order By Column Name + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get_api_list( + f"/accounts/{account_id}/ai/finetunes/public", + page=SyncSinglePage[PublicListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "offset": offset, + "order_by": order_by, + }, + public_list_params.PublicListParams, + ), + ), + model=PublicListResponse, + ) + + +class AsyncPublicResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncPublicResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncPublicResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncPublicResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncPublicResourceWithStreamingResponse(self) + + def list( + self, + *, + account_id: str, + limit: float | NotGiven = NOT_GIVEN, + offset: float | NotGiven = NOT_GIVEN, + order_by: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[PublicListResponse, AsyncSinglePage[PublicListResponse]]: + """ + List Public Finetunes + + Args: + limit: Pagination Limit + + offset: Pagination Offset + + order_by: Order By Column Name + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get_api_list( + f"/accounts/{account_id}/ai/finetunes/public", + page=AsyncSinglePage[PublicListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "offset": offset, + "order_by": order_by, + }, + public_list_params.PublicListParams, + ), + ), + model=PublicListResponse, + ) + + +class PublicResourceWithRawResponse: + def __init__(self, public: PublicResource) -> None: + self._public = public + + self.list = to_raw_response_wrapper( + public.list, + ) + + +class AsyncPublicResourceWithRawResponse: + def __init__(self, public: AsyncPublicResource) -> None: + self._public = public + + self.list = async_to_raw_response_wrapper( + public.list, + ) + + +class PublicResourceWithStreamingResponse: + def __init__(self, public: PublicResource) -> None: + self._public = public + + self.list = to_streamed_response_wrapper( + public.list, + ) + + +class AsyncPublicResourceWithStreamingResponse: + def __init__(self, public: AsyncPublicResource) -> None: + self._public = public + + self.list = async_to_streamed_response_wrapper( + public.list, + ) diff --git a/src/cloudflare/resources/workers/ai/models/__init__.py b/src/cloudflare/resources/ai/models/__init__.py similarity index 100% rename from src/cloudflare/resources/workers/ai/models/__init__.py rename to src/cloudflare/resources/ai/models/__init__.py diff --git a/src/cloudflare/resources/ai/models/models.py b/src/cloudflare/resources/ai/models/models.py new file mode 100644 index 00000000000..66a2394f641 --- /dev/null +++ b/src/cloudflare/resources/ai/models/models.py @@ -0,0 +1,263 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from .schema import ( + SchemaResource, + AsyncSchemaResource, + SchemaResourceWithRawResponse, + AsyncSchemaResourceWithRawResponse, + SchemaResourceWithStreamingResponse, + AsyncSchemaResourceWithStreamingResponse, +) +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import maybe_transform +from ...._compat import cached_property +from ....types.ai import model_list_params +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray +from ...._base_client import AsyncPaginator, make_request_options + +__all__ = ["ModelsResource", "AsyncModelsResource"] + + +class ModelsResource(SyncAPIResource): + @cached_property + def schema(self) -> SchemaResource: + return SchemaResource(self._client) + + @cached_property + def with_raw_response(self) -> ModelsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return ModelsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ModelsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return ModelsResourceWithStreamingResponse(self) + + def list( + self, + *, + account_id: str, + author: str | NotGiven = NOT_GIVEN, + hide_experimental: bool | NotGiven = NOT_GIVEN, + page: int | NotGiven = NOT_GIVEN, + per_page: int | NotGiven = NOT_GIVEN, + search: str | NotGiven = NOT_GIVEN, + source: float | NotGiven = NOT_GIVEN, + task: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncV4PagePaginationArray[object]: + """ + Model Search + + Args: + author: Filter by Author + + hide_experimental: Filter to hide experimental models + + search: Search + + source: Filter by Source Id + + task: Filter by Task Name + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get_api_list( + f"/accounts/{account_id}/ai/models/search", + page=SyncV4PagePaginationArray[object], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "author": author, + "hide_experimental": hide_experimental, + "page": page, + "per_page": per_page, + "search": search, + "source": source, + "task": task, + }, + model_list_params.ModelListParams, + ), + ), + model=object, + ) + + +class AsyncModelsResource(AsyncAPIResource): + @cached_property + def schema(self) -> AsyncSchemaResource: + return AsyncSchemaResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncModelsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncModelsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncModelsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncModelsResourceWithStreamingResponse(self) + + def list( + self, + *, + account_id: str, + author: str | NotGiven = NOT_GIVEN, + hide_experimental: bool | NotGiven = NOT_GIVEN, + page: int | NotGiven = NOT_GIVEN, + per_page: int | NotGiven = NOT_GIVEN, + search: str | NotGiven = NOT_GIVEN, + source: float | NotGiven = NOT_GIVEN, + task: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[object, AsyncV4PagePaginationArray[object]]: + """ + Model Search + + Args: + author: Filter by Author + + hide_experimental: Filter to hide experimental models + + search: Search + + source: Filter by Source Id + + task: Filter by Task Name + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get_api_list( + f"/accounts/{account_id}/ai/models/search", + page=AsyncV4PagePaginationArray[object], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "author": author, + "hide_experimental": hide_experimental, + "page": page, + "per_page": per_page, + "search": search, + "source": source, + "task": task, + }, + model_list_params.ModelListParams, + ), + ), + model=object, + ) + + +class ModelsResourceWithRawResponse: + def __init__(self, models: ModelsResource) -> None: + self._models = models + + self.list = to_raw_response_wrapper( + models.list, + ) + + @cached_property + def schema(self) -> SchemaResourceWithRawResponse: + return SchemaResourceWithRawResponse(self._models.schema) + + +class AsyncModelsResourceWithRawResponse: + def __init__(self, models: AsyncModelsResource) -> None: + self._models = models + + self.list = async_to_raw_response_wrapper( + models.list, + ) + + @cached_property + def schema(self) -> AsyncSchemaResourceWithRawResponse: + return AsyncSchemaResourceWithRawResponse(self._models.schema) + + +class ModelsResourceWithStreamingResponse: + def __init__(self, models: ModelsResource) -> None: + self._models = models + + self.list = to_streamed_response_wrapper( + models.list, + ) + + @cached_property + def schema(self) -> SchemaResourceWithStreamingResponse: + return SchemaResourceWithStreamingResponse(self._models.schema) + + +class AsyncModelsResourceWithStreamingResponse: + def __init__(self, models: AsyncModelsResource) -> None: + self._models = models + + self.list = async_to_streamed_response_wrapper( + models.list, + ) + + @cached_property + def schema(self) -> AsyncSchemaResourceWithStreamingResponse: + return AsyncSchemaResourceWithStreamingResponse(self._models.schema) diff --git a/src/cloudflare/resources/workers/ai/models/schema.py b/src/cloudflare/resources/ai/models/schema.py similarity index 94% rename from src/cloudflare/resources/workers/ai/models/schema.py rename to src/cloudflare/resources/ai/models/schema.py index 93f1363a597..be4afa7007f 100644 --- a/src/cloudflare/resources/workers/ai/models/schema.py +++ b/src/cloudflare/resources/ai/models/schema.py @@ -6,22 +6,22 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ....._utils import ( +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( maybe_transform, async_maybe_transform, ) -from ....._compat import cached_property -from ....._resource import SyncAPIResource, AsyncAPIResource -from ....._response import ( +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ....._wrappers import ResultWrapper -from ....._base_client import make_request_options -from .....types.workers.ai.models import schema_get_params +from ...._wrappers import ResultWrapper +from ...._base_client import make_request_options +from ....types.ai.models import schema_get_params __all__ = ["SchemaResource", "AsyncSchemaResource"] diff --git a/src/cloudflare/resources/ai/tasks.py b/src/cloudflare/resources/ai/tasks.py new file mode 100644 index 00000000000..c2b6cae396a --- /dev/null +++ b/src/cloudflare/resources/ai/tasks.py @@ -0,0 +1,165 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...pagination import SyncSinglePage, AsyncSinglePage +from ..._base_client import AsyncPaginator, make_request_options + +__all__ = ["TasksResource", "AsyncTasksResource"] + + +class TasksResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> TasksResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return TasksResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> TasksResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return TasksResourceWithStreamingResponse(self) + + def list( + self, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncSinglePage[object]: + """ + Task Search + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get_api_list( + f"/accounts/{account_id}/ai/tasks/search", + page=SyncSinglePage[object], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=object, + ) + + +class AsyncTasksResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncTasksResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncTasksResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncTasksResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncTasksResourceWithStreamingResponse(self) + + def list( + self, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[object, AsyncSinglePage[object]]: + """ + Task Search + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get_api_list( + f"/accounts/{account_id}/ai/tasks/search", + page=AsyncSinglePage[object], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=object, + ) + + +class TasksResourceWithRawResponse: + def __init__(self, tasks: TasksResource) -> None: + self._tasks = tasks + + self.list = to_raw_response_wrapper( + tasks.list, + ) + + +class AsyncTasksResourceWithRawResponse: + def __init__(self, tasks: AsyncTasksResource) -> None: + self._tasks = tasks + + self.list = async_to_raw_response_wrapper( + tasks.list, + ) + + +class TasksResourceWithStreamingResponse: + def __init__(self, tasks: TasksResource) -> None: + self._tasks = tasks + + self.list = to_streamed_response_wrapper( + tasks.list, + ) + + +class AsyncTasksResourceWithStreamingResponse: + def __init__(self, tasks: AsyncTasksResource) -> None: + self._tasks = tasks + + self.list = async_to_streamed_response_wrapper( + tasks.list, + ) diff --git a/src/cloudflare/resources/ai_gateway/ai_gateway.py b/src/cloudflare/resources/ai_gateway/ai_gateway.py index c10d86e5d9c..ebbaa17ba8b 100644 --- a/src/cloudflare/resources/ai_gateway/ai_gateway.py +++ b/src/cloudflare/resources/ai_gateway/ai_gateway.py @@ -230,8 +230,6 @@ def list( self, *, account_id: str, - order_by: str | NotGiven = NOT_GIVEN, - order_by_direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, page: int | NotGiven = NOT_GIVEN, per_page: int | NotGiven = NOT_GIVEN, search: str | NotGiven = NOT_GIVEN, @@ -246,10 +244,6 @@ def list( List Gateways Args: - order_by: Order By Column Name - - order_by_direction: Order By Direction - search: Search by id extra_headers: Send extra headers @@ -272,8 +266,6 @@ def list( timeout=timeout, query=maybe_transform( { - "order_by": order_by, - "order_by_direction": order_by_direction, "page": page, "per_page": per_page, "search": search, @@ -534,8 +526,6 @@ def list( self, *, account_id: str, - order_by: str | NotGiven = NOT_GIVEN, - order_by_direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, page: int | NotGiven = NOT_GIVEN, per_page: int | NotGiven = NOT_GIVEN, search: str | NotGiven = NOT_GIVEN, @@ -550,10 +540,6 @@ def list( List Gateways Args: - order_by: Order By Column Name - - order_by_direction: Order By Direction - search: Search by id extra_headers: Send extra headers @@ -576,8 +562,6 @@ def list( timeout=timeout, query=maybe_transform( { - "order_by": order_by, - "order_by_direction": order_by_direction, "page": page, "per_page": per_page, "search": search, diff --git a/src/cloudflare/resources/ai_gateway/datasets.py b/src/cloudflare/resources/ai_gateway/datasets.py index 855cad685de..3d58ec297b4 100644 --- a/src/cloudflare/resources/ai_gateway/datasets.py +++ b/src/cloudflare/resources/ai_gateway/datasets.py @@ -3,7 +3,6 @@ from __future__ import annotations from typing import Type, Iterable, cast -from typing_extensions import Literal import httpx @@ -169,8 +168,6 @@ def list( account_id: str, enable: bool | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, - order_by: str | NotGiven = NOT_GIVEN, - order_by_direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, page: int | NotGiven = NOT_GIVEN, per_page: int | NotGiven = NOT_GIVEN, search: str | NotGiven = NOT_GIVEN, @@ -187,10 +184,6 @@ def list( Args: gateway_id: gateway id - order_by: Order By Column Name - - order_by_direction: Order By Direction - search: Search by id, name, filters extra_headers: Send extra headers @@ -217,8 +210,6 @@ def list( { "enable": enable, "name": name, - "order_by": order_by, - "order_by_direction": order_by_direction, "page": page, "per_page": per_page, "search": search, @@ -456,8 +447,6 @@ def list( account_id: str, enable: bool | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, - order_by: str | NotGiven = NOT_GIVEN, - order_by_direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, page: int | NotGiven = NOT_GIVEN, per_page: int | NotGiven = NOT_GIVEN, search: str | NotGiven = NOT_GIVEN, @@ -474,10 +463,6 @@ def list( Args: gateway_id: gateway id - order_by: Order By Column Name - - order_by_direction: Order By Direction - search: Search by id, name, filters extra_headers: Send extra headers @@ -504,8 +489,6 @@ def list( { "enable": enable, "name": name, - "order_by": order_by, - "order_by_direction": order_by_direction, "page": page, "per_page": per_page, "search": search, diff --git a/src/cloudflare/resources/ai_gateway/evaluations.py b/src/cloudflare/resources/ai_gateway/evaluations.py index d0a00012074..5dbccd8f358 100644 --- a/src/cloudflare/resources/ai_gateway/evaluations.py +++ b/src/cloudflare/resources/ai_gateway/evaluations.py @@ -3,7 +3,6 @@ from __future__ import annotations from typing import List, Type, cast -from typing_extensions import Literal import httpx @@ -111,8 +110,6 @@ def list( *, account_id: str, name: str | NotGiven = NOT_GIVEN, - order_by: str | NotGiven = NOT_GIVEN, - order_by_direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, page: int | NotGiven = NOT_GIVEN, per_page: int | NotGiven = NOT_GIVEN, processed: bool | NotGiven = NOT_GIVEN, @@ -130,10 +127,6 @@ def list( Args: gateway_id: gateway id - order_by: Order By Column Name - - order_by_direction: Order By Direction - search: Search by id, name extra_headers: Send extra headers @@ -159,8 +152,6 @@ def list( query=maybe_transform( { "name": name, - "order_by": order_by, - "order_by_direction": order_by_direction, "page": page, "per_page": per_page, "processed": processed, @@ -342,8 +333,6 @@ def list( *, account_id: str, name: str | NotGiven = NOT_GIVEN, - order_by: str | NotGiven = NOT_GIVEN, - order_by_direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, page: int | NotGiven = NOT_GIVEN, per_page: int | NotGiven = NOT_GIVEN, processed: bool | NotGiven = NOT_GIVEN, @@ -361,10 +350,6 @@ def list( Args: gateway_id: gateway id - order_by: Order By Column Name - - order_by_direction: Order By Direction - search: Search by id, name extra_headers: Send extra headers @@ -390,8 +375,6 @@ def list( query=maybe_transform( { "name": name, - "order_by": order_by, - "order_by_direction": order_by_direction, "page": page, "per_page": per_page, "processed": processed, diff --git a/src/cloudflare/resources/api_gateway/operations/operations.py b/src/cloudflare/resources/api_gateway/operations/operations.py index 4e2c044805e..2681b95f944 100644 --- a/src/cloudflare/resources/api_gateway/operations/operations.py +++ b/src/cloudflare/resources/api_gateway/operations/operations.py @@ -31,11 +31,17 @@ SchemaValidationResourceWithStreamingResponse, AsyncSchemaValidationResourceWithStreamingResponse, ) -from ....types.api_gateway import operation_get_params, operation_list_params, operation_create_params +from ....types.api_gateway import ( + operation_get_params, + operation_list_params, + operation_create_params, + operation_bulk_create_params, +) from ....types.api_gateway.operation_get_response import OperationGetResponse from ....types.api_gateway.operation_list_response import OperationListResponse from ....types.api_gateway.operation_create_response import OperationCreateResponse from ....types.api_gateway.operation_delete_response import OperationDeleteResponse +from ....types.api_gateway.operation_bulk_create_response import OperationBulkCreateResponse from ....types.api_gateway.operation_bulk_delete_response import OperationBulkDeleteResponse __all__ = ["OperationsResource", "AsyncOperationsResource"] @@ -69,7 +75,9 @@ def create( self, *, zone_id: str, - body: Iterable[operation_create_params.Body], + endpoint: str, + host: str, + method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -77,17 +85,26 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> OperationCreateResponse: - """Add one or more operations to a zone. + """Add one operation to a zone. - Endpoints can contain path variables. - Host, method, endpoint will be normalized to a canoncial form when creating an - operation and must be unique on the zone. Inserting an operation that matches an - existing one will return the record of the already existing operation and update - its last_updated date. + Endpoints can contain path variables. Host, method, + endpoint will be normalized to a canoncial form when creating an operation and + must be unique on the zone. Inserting an operation that matches an existing one + will return the record of the already existing operation and update its + last_updated date. Args: zone_id: Identifier + endpoint: The endpoint which can contain path parameter templates in curly braces, each + will be replaced from left to right with {varN}, starting with {var1}, during + insertion. This will further be Cloudflare-normalized upon insertion. See: + https://developers.cloudflare.com/rules/normalization/how-it-works/. + + host: RFC3986-compliant host. + + method: The HTTP method used to access the endpoint. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -99,8 +116,15 @@ def create( if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( - f"/zones/{zone_id}/api_gateway/operations", - body=maybe_transform(body, Iterable[operation_create_params.Body]), + f"/zones/{zone_id}/api_gateway/operations/item", + body=maybe_transform( + { + "endpoint": endpoint, + "host": host, + "method": method, + }, + operation_create_params.OperationCreateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -230,6 +254,52 @@ def delete( cast_to=OperationDeleteResponse, ) + def bulk_create( + self, + *, + zone_id: str, + body: Iterable[operation_bulk_create_params.Body], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> OperationBulkCreateResponse: + """Add one or more operations to a zone. + + Endpoints can contain path variables. + Host, method, endpoint will be normalized to a canoncial form when creating an + operation and must be unique on the zone. Inserting an operation that matches an + existing one will return the record of the already existing operation and update + its last_updated date. + + Args: + zone_id: Identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return self._post( + f"/zones/{zone_id}/api_gateway/operations", + body=maybe_transform(body, Iterable[operation_bulk_create_params.Body]), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[OperationBulkCreateResponse]._unwrapper, + ), + cast_to=cast(Type[OperationBulkCreateResponse], ResultWrapper[OperationBulkCreateResponse]), + ) + def bulk_delete( self, *, @@ -344,7 +414,9 @@ async def create( self, *, zone_id: str, - body: Iterable[operation_create_params.Body], + endpoint: str, + host: str, + method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -352,17 +424,26 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> OperationCreateResponse: - """Add one or more operations to a zone. + """Add one operation to a zone. - Endpoints can contain path variables. - Host, method, endpoint will be normalized to a canoncial form when creating an - operation and must be unique on the zone. Inserting an operation that matches an - existing one will return the record of the already existing operation and update - its last_updated date. + Endpoints can contain path variables. Host, method, + endpoint will be normalized to a canoncial form when creating an operation and + must be unique on the zone. Inserting an operation that matches an existing one + will return the record of the already existing operation and update its + last_updated date. Args: zone_id: Identifier + endpoint: The endpoint which can contain path parameter templates in curly braces, each + will be replaced from left to right with {varN}, starting with {var1}, during + insertion. This will further be Cloudflare-normalized upon insertion. See: + https://developers.cloudflare.com/rules/normalization/how-it-works/. + + host: RFC3986-compliant host. + + method: The HTTP method used to access the endpoint. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -374,8 +455,15 @@ async def create( if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( - f"/zones/{zone_id}/api_gateway/operations", - body=await async_maybe_transform(body, Iterable[operation_create_params.Body]), + f"/zones/{zone_id}/api_gateway/operations/item", + body=await async_maybe_transform( + { + "endpoint": endpoint, + "host": host, + "method": method, + }, + operation_create_params.OperationCreateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -505,6 +593,52 @@ async def delete( cast_to=OperationDeleteResponse, ) + async def bulk_create( + self, + *, + zone_id: str, + body: Iterable[operation_bulk_create_params.Body], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> OperationBulkCreateResponse: + """Add one or more operations to a zone. + + Endpoints can contain path variables. + Host, method, endpoint will be normalized to a canoncial form when creating an + operation and must be unique on the zone. Inserting an operation that matches an + existing one will return the record of the already existing operation and update + its last_updated date. + + Args: + zone_id: Identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return await self._post( + f"/zones/{zone_id}/api_gateway/operations", + body=await async_maybe_transform(body, Iterable[operation_bulk_create_params.Body]), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[OperationBulkCreateResponse]._unwrapper, + ), + cast_to=cast(Type[OperationBulkCreateResponse], ResultWrapper[OperationBulkCreateResponse]), + ) + async def bulk_delete( self, *, @@ -604,6 +738,9 @@ def __init__(self, operations: OperationsResource) -> None: self.delete = to_raw_response_wrapper( operations.delete, ) + self.bulk_create = to_raw_response_wrapper( + operations.bulk_create, + ) self.bulk_delete = to_raw_response_wrapper( operations.bulk_delete, ) @@ -629,6 +766,9 @@ def __init__(self, operations: AsyncOperationsResource) -> None: self.delete = async_to_raw_response_wrapper( operations.delete, ) + self.bulk_create = async_to_raw_response_wrapper( + operations.bulk_create, + ) self.bulk_delete = async_to_raw_response_wrapper( operations.bulk_delete, ) @@ -654,6 +794,9 @@ def __init__(self, operations: OperationsResource) -> None: self.delete = to_streamed_response_wrapper( operations.delete, ) + self.bulk_create = to_streamed_response_wrapper( + operations.bulk_create, + ) self.bulk_delete = to_streamed_response_wrapper( operations.bulk_delete, ) @@ -679,6 +822,9 @@ def __init__(self, operations: AsyncOperationsResource) -> None: self.delete = async_to_streamed_response_wrapper( operations.delete, ) + self.bulk_create = async_to_streamed_response_wrapper( + operations.bulk_create, + ) self.bulk_delete = async_to_streamed_response_wrapper( operations.bulk_delete, ) diff --git a/src/cloudflare/resources/argo/tiered_caching.py b/src/cloudflare/resources/argo/tiered_caching.py index 46fb96c1e31..066b5a75b53 100644 --- a/src/cloudflare/resources/argo/tiered_caching.py +++ b/src/cloudflare/resources/argo/tiered_caching.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, cast +from typing import Type, Optional, cast from typing_extensions import Literal import httpx @@ -60,9 +60,19 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TieredCachingEditResponse: + ) -> Optional[TieredCachingEditResponse]: """ - Updates enablement of Tiered Caching + Tiered Cache works by dividing Cloudflare's data centers into a hierarchy of + lower-tiers and upper-tiers. If content is not cached in lower-tier data centers + (generally the ones closest to a visitor), the lower-tier must ask an upper-tier + to see if it has the content. If the upper-tier does not have the content, only + the upper-tier can ask the origin for content. This practice improves bandwidth + efficiency by limiting the number of data centers that can ask the origin for + content, which reduces origin load and makes websites more cost-effective to + operate. Additionally, Tiered Cache concentrates connections to origin servers + so they come from a small number of data centers rather than the full set of + network locations. This results in fewer open connections using server + resources. Args: zone_id: Identifier @@ -87,9 +97,9 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[TieredCachingEditResponse]._unwrapper, + post_parser=ResultWrapper[Optional[TieredCachingEditResponse]]._unwrapper, ), - cast_to=cast(Type[TieredCachingEditResponse], ResultWrapper[TieredCachingEditResponse]), + cast_to=cast(Type[Optional[TieredCachingEditResponse]], ResultWrapper[TieredCachingEditResponse]), ) def get( @@ -102,9 +112,19 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TieredCachingGetResponse: + ) -> Optional[TieredCachingGetResponse]: """ - Get Tiered Caching setting + Tiered Cache works by dividing Cloudflare's data centers into a hierarchy of + lower-tiers and upper-tiers. If content is not cached in lower-tier data centers + (generally the ones closest to a visitor), the lower-tier must ask an upper-tier + to see if it has the content. If the upper-tier does not have the content, only + the upper-tier can ask the origin for content. This practice improves bandwidth + efficiency by limiting the number of data centers that can ask the origin for + content, which reduces origin load and makes websites more cost-effective to + operate. Additionally, Tiered Cache concentrates connections to origin servers + so they come from a small number of data centers rather than the full set of + network locations. This results in fewer open connections using server + resources. Args: zone_id: Identifier @@ -126,9 +146,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[TieredCachingGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[TieredCachingGetResponse]]._unwrapper, ), - cast_to=cast(Type[TieredCachingGetResponse], ResultWrapper[TieredCachingGetResponse]), + cast_to=cast(Type[Optional[TieredCachingGetResponse]], ResultWrapper[TieredCachingGetResponse]), ) @@ -163,9 +183,19 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TieredCachingEditResponse: + ) -> Optional[TieredCachingEditResponse]: """ - Updates enablement of Tiered Caching + Tiered Cache works by dividing Cloudflare's data centers into a hierarchy of + lower-tiers and upper-tiers. If content is not cached in lower-tier data centers + (generally the ones closest to a visitor), the lower-tier must ask an upper-tier + to see if it has the content. If the upper-tier does not have the content, only + the upper-tier can ask the origin for content. This practice improves bandwidth + efficiency by limiting the number of data centers that can ask the origin for + content, which reduces origin load and makes websites more cost-effective to + operate. Additionally, Tiered Cache concentrates connections to origin servers + so they come from a small number of data centers rather than the full set of + network locations. This results in fewer open connections using server + resources. Args: zone_id: Identifier @@ -190,9 +220,9 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[TieredCachingEditResponse]._unwrapper, + post_parser=ResultWrapper[Optional[TieredCachingEditResponse]]._unwrapper, ), - cast_to=cast(Type[TieredCachingEditResponse], ResultWrapper[TieredCachingEditResponse]), + cast_to=cast(Type[Optional[TieredCachingEditResponse]], ResultWrapper[TieredCachingEditResponse]), ) async def get( @@ -205,9 +235,19 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TieredCachingGetResponse: + ) -> Optional[TieredCachingGetResponse]: """ - Get Tiered Caching setting + Tiered Cache works by dividing Cloudflare's data centers into a hierarchy of + lower-tiers and upper-tiers. If content is not cached in lower-tier data centers + (generally the ones closest to a visitor), the lower-tier must ask an upper-tier + to see if it has the content. If the upper-tier does not have the content, only + the upper-tier can ask the origin for content. This practice improves bandwidth + efficiency by limiting the number of data centers that can ask the origin for + content, which reduces origin load and makes websites more cost-effective to + operate. Additionally, Tiered Cache concentrates connections to origin servers + so they come from a small number of data centers rather than the full set of + network locations. This results in fewer open connections using server + resources. Args: zone_id: Identifier @@ -229,9 +269,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[TieredCachingGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[TieredCachingGetResponse]]._unwrapper, ), - cast_to=cast(Type[TieredCachingGetResponse], ResultWrapper[TieredCachingGetResponse]), + cast_to=cast(Type[Optional[TieredCachingGetResponse]], ResultWrapper[TieredCachingGetResponse]), ) diff --git a/src/cloudflare/resources/cache/cache_reserve.py b/src/cloudflare/resources/cache/cache_reserve.py index 9116ecc0307..df5c9f28ccf 100644 --- a/src/cloudflare/resources/cache/cache_reserve.py +++ b/src/cloudflare/resources/cache/cache_reserve.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, cast +from typing import Type, Optional, cast from typing_extensions import Literal import httpx @@ -62,7 +62,7 @@ def clear( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CacheReserveClearResponse: + ) -> Optional[CacheReserveClearResponse]: """ You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. @@ -90,9 +90,9 @@ def clear( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CacheReserveClearResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CacheReserveClearResponse]]._unwrapper, ), - cast_to=cast(Type[CacheReserveClearResponse], ResultWrapper[CacheReserveClearResponse]), + cast_to=cast(Type[Optional[CacheReserveClearResponse]], ResultWrapper[CacheReserveClearResponse]), ) def edit( @@ -106,7 +106,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CacheReserveEditResponse: + ) -> Optional[CacheReserveEditResponse]: """ Increase cache lifetimes by automatically storing all cacheable files into Cloudflare's persistent object storage buckets. Requires Cache Reserve @@ -138,9 +138,9 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CacheReserveEditResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CacheReserveEditResponse]]._unwrapper, ), - cast_to=cast(Type[CacheReserveEditResponse], ResultWrapper[CacheReserveEditResponse]), + cast_to=cast(Type[Optional[CacheReserveEditResponse]], ResultWrapper[CacheReserveEditResponse]), ) def get( @@ -153,7 +153,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CacheReserveGetResponse: + ) -> Optional[CacheReserveGetResponse]: """ Increase cache lifetimes by automatically storing all cacheable files into Cloudflare's persistent object storage buckets. Requires Cache Reserve @@ -182,9 +182,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CacheReserveGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CacheReserveGetResponse]]._unwrapper, ), - cast_to=cast(Type[CacheReserveGetResponse], ResultWrapper[CacheReserveGetResponse]), + cast_to=cast(Type[Optional[CacheReserveGetResponse]], ResultWrapper[CacheReserveGetResponse]), ) def status( @@ -197,7 +197,7 @@ def status( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CacheReserveStatusResponse: + ) -> Optional[CacheReserveStatusResponse]: """ You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. @@ -224,9 +224,9 @@ def status( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CacheReserveStatusResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CacheReserveStatusResponse]]._unwrapper, ), - cast_to=cast(Type[CacheReserveStatusResponse], ResultWrapper[CacheReserveStatusResponse]), + cast_to=cast(Type[Optional[CacheReserveStatusResponse]], ResultWrapper[CacheReserveStatusResponse]), ) @@ -261,7 +261,7 @@ async def clear( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CacheReserveClearResponse: + ) -> Optional[CacheReserveClearResponse]: """ You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. @@ -289,9 +289,9 @@ async def clear( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CacheReserveClearResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CacheReserveClearResponse]]._unwrapper, ), - cast_to=cast(Type[CacheReserveClearResponse], ResultWrapper[CacheReserveClearResponse]), + cast_to=cast(Type[Optional[CacheReserveClearResponse]], ResultWrapper[CacheReserveClearResponse]), ) async def edit( @@ -305,7 +305,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CacheReserveEditResponse: + ) -> Optional[CacheReserveEditResponse]: """ Increase cache lifetimes by automatically storing all cacheable files into Cloudflare's persistent object storage buckets. Requires Cache Reserve @@ -337,9 +337,9 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CacheReserveEditResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CacheReserveEditResponse]]._unwrapper, ), - cast_to=cast(Type[CacheReserveEditResponse], ResultWrapper[CacheReserveEditResponse]), + cast_to=cast(Type[Optional[CacheReserveEditResponse]], ResultWrapper[CacheReserveEditResponse]), ) async def get( @@ -352,7 +352,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CacheReserveGetResponse: + ) -> Optional[CacheReserveGetResponse]: """ Increase cache lifetimes by automatically storing all cacheable files into Cloudflare's persistent object storage buckets. Requires Cache Reserve @@ -381,9 +381,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CacheReserveGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CacheReserveGetResponse]]._unwrapper, ), - cast_to=cast(Type[CacheReserveGetResponse], ResultWrapper[CacheReserveGetResponse]), + cast_to=cast(Type[Optional[CacheReserveGetResponse]], ResultWrapper[CacheReserveGetResponse]), ) async def status( @@ -396,7 +396,7 @@ async def status( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CacheReserveStatusResponse: + ) -> Optional[CacheReserveStatusResponse]: """ You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. @@ -423,9 +423,9 @@ async def status( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CacheReserveStatusResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CacheReserveStatusResponse]]._unwrapper, ), - cast_to=cast(Type[CacheReserveStatusResponse], ResultWrapper[CacheReserveStatusResponse]), + cast_to=cast(Type[Optional[CacheReserveStatusResponse]], ResultWrapper[CacheReserveStatusResponse]), ) diff --git a/src/cloudflare/resources/cache/regional_tiered_cache.py b/src/cloudflare/resources/cache/regional_tiered_cache.py index e2d101b0154..69889f46644 100644 --- a/src/cloudflare/resources/cache/regional_tiered_cache.py +++ b/src/cloudflare/resources/cache/regional_tiered_cache.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, cast +from typing import Type, Optional, cast from typing_extensions import Literal import httpx @@ -60,7 +60,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RegionalTieredCacheEditResponse: + ) -> Optional[RegionalTieredCacheEditResponse]: """ Instructs Cloudflare to check a regional hub data center on the way to your upper tier. This can help improve performance for smart and custom tiered cache @@ -89,9 +89,11 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[RegionalTieredCacheEditResponse]._unwrapper, + post_parser=ResultWrapper[Optional[RegionalTieredCacheEditResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[RegionalTieredCacheEditResponse]], ResultWrapper[RegionalTieredCacheEditResponse] ), - cast_to=cast(Type[RegionalTieredCacheEditResponse], ResultWrapper[RegionalTieredCacheEditResponse]), ) def get( @@ -104,7 +106,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RegionalTieredCacheGetResponse: + ) -> Optional[RegionalTieredCacheGetResponse]: """ Instructs Cloudflare to check a regional hub data center on the way to your upper tier. This can help improve performance for smart and custom tiered cache @@ -130,9 +132,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[RegionalTieredCacheGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[RegionalTieredCacheGetResponse]]._unwrapper, ), - cast_to=cast(Type[RegionalTieredCacheGetResponse], ResultWrapper[RegionalTieredCacheGetResponse]), + cast_to=cast(Type[Optional[RegionalTieredCacheGetResponse]], ResultWrapper[RegionalTieredCacheGetResponse]), ) @@ -167,7 +169,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RegionalTieredCacheEditResponse: + ) -> Optional[RegionalTieredCacheEditResponse]: """ Instructs Cloudflare to check a regional hub data center on the way to your upper tier. This can help improve performance for smart and custom tiered cache @@ -198,9 +200,11 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[RegionalTieredCacheEditResponse]._unwrapper, + post_parser=ResultWrapper[Optional[RegionalTieredCacheEditResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[RegionalTieredCacheEditResponse]], ResultWrapper[RegionalTieredCacheEditResponse] ), - cast_to=cast(Type[RegionalTieredCacheEditResponse], ResultWrapper[RegionalTieredCacheEditResponse]), ) async def get( @@ -213,7 +217,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RegionalTieredCacheGetResponse: + ) -> Optional[RegionalTieredCacheGetResponse]: """ Instructs Cloudflare to check a regional hub data center on the way to your upper tier. This can help improve performance for smart and custom tiered cache @@ -239,9 +243,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[RegionalTieredCacheGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[RegionalTieredCacheGetResponse]]._unwrapper, ), - cast_to=cast(Type[RegionalTieredCacheGetResponse], ResultWrapper[RegionalTieredCacheGetResponse]), + cast_to=cast(Type[Optional[RegionalTieredCacheGetResponse]], ResultWrapper[RegionalTieredCacheGetResponse]), ) diff --git a/src/cloudflare/resources/cache/smart_tiered_cache.py b/src/cloudflare/resources/cache/smart_tiered_cache.py index abd3127ed38..93a2f3510cf 100644 --- a/src/cloudflare/resources/cache/smart_tiered_cache.py +++ b/src/cloudflare/resources/cache/smart_tiered_cache.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, cast +from typing import Type, Optional, cast from typing_extensions import Literal import httpx @@ -60,9 +60,14 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SmartTieredCacheDeleteResponse: + ) -> Optional[SmartTieredCacheDeleteResponse]: """ - Remvoves enablement of Smart Tiered Cache + Smart Tiered Cache dynamically selects the single closest upper tier for each of + your website’s origins with no configuration required, using our in-house + performance and routing data. Cloudflare collects latency data for each request + to an origin, and uses the latency data to determine how well any upper-tier + data center is connected with an origin. As a result, Cloudflare can select the + data center with the lowest latency to be the upper-tier for an origin. Args: zone_id: Identifier @@ -84,9 +89,9 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[SmartTieredCacheDeleteResponse]._unwrapper, + post_parser=ResultWrapper[Optional[SmartTieredCacheDeleteResponse]]._unwrapper, ), - cast_to=cast(Type[SmartTieredCacheDeleteResponse], ResultWrapper[SmartTieredCacheDeleteResponse]), + cast_to=cast(Type[Optional[SmartTieredCacheDeleteResponse]], ResultWrapper[SmartTieredCacheDeleteResponse]), ) def edit( @@ -100,9 +105,14 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SmartTieredCacheEditResponse: + ) -> Optional[SmartTieredCacheEditResponse]: """ - Updates enablement of Tiered Cache + Smart Tiered Cache dynamically selects the single closest upper tier for each of + your website’s origins with no configuration required, using our in-house + performance and routing data. Cloudflare collects latency data for each request + to an origin, and uses the latency data to determine how well any upper-tier + data center is connected with an origin. As a result, Cloudflare can select the + data center with the lowest latency to be the upper-tier for an origin. Args: zone_id: Identifier @@ -127,9 +137,9 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[SmartTieredCacheEditResponse]._unwrapper, + post_parser=ResultWrapper[Optional[SmartTieredCacheEditResponse]]._unwrapper, ), - cast_to=cast(Type[SmartTieredCacheEditResponse], ResultWrapper[SmartTieredCacheEditResponse]), + cast_to=cast(Type[Optional[SmartTieredCacheEditResponse]], ResultWrapper[SmartTieredCacheEditResponse]), ) def get( @@ -142,9 +152,14 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SmartTieredCacheGetResponse: + ) -> Optional[SmartTieredCacheGetResponse]: """ - Get Smart Tiered Cache setting + Smart Tiered Cache dynamically selects the single closest upper tier for each of + your website’s origins with no configuration required, using our in-house + performance and routing data. Cloudflare collects latency data for each request + to an origin, and uses the latency data to determine how well any upper-tier + data center is connected with an origin. As a result, Cloudflare can select the + data center with the lowest latency to be the upper-tier for an origin. Args: zone_id: Identifier @@ -166,9 +181,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[SmartTieredCacheGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[SmartTieredCacheGetResponse]]._unwrapper, ), - cast_to=cast(Type[SmartTieredCacheGetResponse], ResultWrapper[SmartTieredCacheGetResponse]), + cast_to=cast(Type[Optional[SmartTieredCacheGetResponse]], ResultWrapper[SmartTieredCacheGetResponse]), ) @@ -202,9 +217,14 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SmartTieredCacheDeleteResponse: + ) -> Optional[SmartTieredCacheDeleteResponse]: """ - Remvoves enablement of Smart Tiered Cache + Smart Tiered Cache dynamically selects the single closest upper tier for each of + your website’s origins with no configuration required, using our in-house + performance and routing data. Cloudflare collects latency data for each request + to an origin, and uses the latency data to determine how well any upper-tier + data center is connected with an origin. As a result, Cloudflare can select the + data center with the lowest latency to be the upper-tier for an origin. Args: zone_id: Identifier @@ -226,9 +246,9 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[SmartTieredCacheDeleteResponse]._unwrapper, + post_parser=ResultWrapper[Optional[SmartTieredCacheDeleteResponse]]._unwrapper, ), - cast_to=cast(Type[SmartTieredCacheDeleteResponse], ResultWrapper[SmartTieredCacheDeleteResponse]), + cast_to=cast(Type[Optional[SmartTieredCacheDeleteResponse]], ResultWrapper[SmartTieredCacheDeleteResponse]), ) async def edit( @@ -242,9 +262,14 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SmartTieredCacheEditResponse: + ) -> Optional[SmartTieredCacheEditResponse]: """ - Updates enablement of Tiered Cache + Smart Tiered Cache dynamically selects the single closest upper tier for each of + your website’s origins with no configuration required, using our in-house + performance and routing data. Cloudflare collects latency data for each request + to an origin, and uses the latency data to determine how well any upper-tier + data center is connected with an origin. As a result, Cloudflare can select the + data center with the lowest latency to be the upper-tier for an origin. Args: zone_id: Identifier @@ -271,9 +296,9 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[SmartTieredCacheEditResponse]._unwrapper, + post_parser=ResultWrapper[Optional[SmartTieredCacheEditResponse]]._unwrapper, ), - cast_to=cast(Type[SmartTieredCacheEditResponse], ResultWrapper[SmartTieredCacheEditResponse]), + cast_to=cast(Type[Optional[SmartTieredCacheEditResponse]], ResultWrapper[SmartTieredCacheEditResponse]), ) async def get( @@ -286,9 +311,14 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SmartTieredCacheGetResponse: + ) -> Optional[SmartTieredCacheGetResponse]: """ - Get Smart Tiered Cache setting + Smart Tiered Cache dynamically selects the single closest upper tier for each of + your website’s origins with no configuration required, using our in-house + performance and routing data. Cloudflare collects latency data for each request + to an origin, and uses the latency data to determine how well any upper-tier + data center is connected with an origin. As a result, Cloudflare can select the + data center with the lowest latency to be the upper-tier for an origin. Args: zone_id: Identifier @@ -310,9 +340,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[SmartTieredCacheGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[SmartTieredCacheGetResponse]]._unwrapper, ), - cast_to=cast(Type[SmartTieredCacheGetResponse], ResultWrapper[SmartTieredCacheGetResponse]), + cast_to=cast(Type[Optional[SmartTieredCacheGetResponse]], ResultWrapper[SmartTieredCacheGetResponse]), ) diff --git a/src/cloudflare/resources/cache/variants.py b/src/cloudflare/resources/cache/variants.py index 254dbf3eb20..04b84159e3b 100644 --- a/src/cloudflare/resources/cache/variants.py +++ b/src/cloudflare/resources/cache/variants.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, cast +from typing import Type, Optional, cast import httpx @@ -22,9 +22,9 @@ from ..._wrappers import ResultWrapper from ...types.cache import variant_edit_params from ..._base_client import make_request_options -from ...types.cache.cache_variant import CacheVariant from ...types.cache.variant_get_response import VariantGetResponse from ...types.cache.variant_edit_response import VariantEditResponse +from ...types.cache.variant_delete_response import VariantDeleteResponse __all__ = ["VariantsResource", "AsyncVariantsResource"] @@ -59,7 +59,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CacheVariant: + ) -> Optional[VariantDeleteResponse]: """ Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the @@ -87,9 +87,9 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CacheVariant]._unwrapper, + post_parser=ResultWrapper[Optional[VariantDeleteResponse]]._unwrapper, ), - cast_to=cast(Type[CacheVariant], ResultWrapper[CacheVariant]), + cast_to=cast(Type[Optional[VariantDeleteResponse]], ResultWrapper[VariantDeleteResponse]), ) def edit( @@ -103,7 +103,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> VariantEditResponse: + ) -> Optional[VariantEditResponse]: """ Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the @@ -134,9 +134,9 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[VariantEditResponse]._unwrapper, + post_parser=ResultWrapper[Optional[VariantEditResponse]]._unwrapper, ), - cast_to=cast(Type[VariantEditResponse], ResultWrapper[VariantEditResponse]), + cast_to=cast(Type[Optional[VariantEditResponse]], ResultWrapper[VariantEditResponse]), ) def get( @@ -149,7 +149,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> VariantGetResponse: + ) -> Optional[VariantGetResponse]: """ Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the @@ -177,9 +177,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[VariantGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[VariantGetResponse]]._unwrapper, ), - cast_to=cast(Type[VariantGetResponse], ResultWrapper[VariantGetResponse]), + cast_to=cast(Type[Optional[VariantGetResponse]], ResultWrapper[VariantGetResponse]), ) @@ -213,7 +213,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CacheVariant: + ) -> Optional[VariantDeleteResponse]: """ Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the @@ -241,9 +241,9 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CacheVariant]._unwrapper, + post_parser=ResultWrapper[Optional[VariantDeleteResponse]]._unwrapper, ), - cast_to=cast(Type[CacheVariant], ResultWrapper[CacheVariant]), + cast_to=cast(Type[Optional[VariantDeleteResponse]], ResultWrapper[VariantDeleteResponse]), ) async def edit( @@ -257,7 +257,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> VariantEditResponse: + ) -> Optional[VariantEditResponse]: """ Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the @@ -288,9 +288,9 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[VariantEditResponse]._unwrapper, + post_parser=ResultWrapper[Optional[VariantEditResponse]]._unwrapper, ), - cast_to=cast(Type[VariantEditResponse], ResultWrapper[VariantEditResponse]), + cast_to=cast(Type[Optional[VariantEditResponse]], ResultWrapper[VariantEditResponse]), ) async def get( @@ -303,7 +303,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> VariantGetResponse: + ) -> Optional[VariantGetResponse]: """ Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the @@ -331,9 +331,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[VariantGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[VariantGetResponse]]._unwrapper, ), - cast_to=cast(Type[VariantGetResponse], ResultWrapper[VariantGetResponse]), + cast_to=cast(Type[Optional[VariantGetResponse]], ResultWrapper[VariantGetResponse]), ) diff --git a/src/cloudflare/resources/cloud_connector/rules.py b/src/cloudflare/resources/cloud_connector/rules.py index 2a80d122319..d067255d0ee 100644 --- a/src/cloudflare/resources/cloud_connector/rules.py +++ b/src/cloudflare/resources/cloud_connector/rules.py @@ -53,7 +53,7 @@ def update( self, *, zone_id: str, - body: Iterable[rule_update_params.Body], + rules: Iterable[rule_update_params.Rule], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -67,7 +67,7 @@ def update( Args: zone_id: Identifier - body: List of Cloud Connector rules + rules: List of Cloud Connector rules extra_headers: Send extra headers @@ -81,7 +81,7 @@ def update( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._put( f"/zones/{zone_id}/cloud_connector/rules", - body=maybe_transform(body, Iterable[rule_update_params.Body]), + body=maybe_transform(rules, Iterable[rule_update_params.Rule]), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -153,7 +153,7 @@ async def update( self, *, zone_id: str, - body: Iterable[rule_update_params.Body], + rules: Iterable[rule_update_params.Rule], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -167,7 +167,7 @@ async def update( Args: zone_id: Identifier - body: List of Cloud Connector rules + rules: List of Cloud Connector rules extra_headers: Send extra headers @@ -181,7 +181,7 @@ async def update( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._put( f"/zones/{zone_id}/cloud_connector/rules", - body=await async_maybe_transform(body, Iterable[rule_update_params.Body]), + body=await async_maybe_transform(rules, Iterable[rule_update_params.Rule]), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/cloudflare/resources/dns/records.py b/src/cloudflare/resources/dns/records.py index 9ef6762d58f..61a0e3e043d 100644 --- a/src/cloudflare/resources/dns/records.py +++ b/src/cloudflare/resources/dns/records.py @@ -36,16 +36,14 @@ from ...types.dns.ttl_param import TTLParam from ...types.dns.record_tags import RecordTags from ...types.dns.record_param import RecordParam +from ...types.dns.batch_put_param import BatchPutParam +from ...types.dns.record_response import RecordResponse +from ...types.dns.batch_patch_param import BatchPatchParam from ...types.shared.sort_direction import SortDirection -from ...types.dns.record_get_response import RecordGetResponse -from ...types.dns.record_edit_response import RecordEditResponse -from ...types.dns.record_list_response import RecordListResponse from ...types.dns.record_scan_response import RecordScanResponse from ...types.dns.record_batch_response import RecordBatchResponse -from ...types.dns.record_create_response import RecordCreateResponse from ...types.dns.record_delete_response import RecordDeleteResponse from ...types.dns.record_import_response import RecordImportResponse -from ...types.dns.record_update_response import RecordUpdateResponse __all__ = ["RecordsResource", "AsyncRecordsResource"] @@ -79,6 +77,7 @@ def create( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.ARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["A"] | NotGiven = NOT_GIVEN, @@ -88,7 +87,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -112,6 +111,8 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -139,6 +140,7 @@ def create( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.AAAARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["AAAA"] | NotGiven = NOT_GIVEN, @@ -148,7 +150,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -172,6 +174,8 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -199,6 +203,7 @@ def create( data: record_create_params.CAARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.CAARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["CAA"] | NotGiven = NOT_GIVEN, @@ -208,7 +213,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -232,6 +237,8 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -259,6 +266,7 @@ def create( data: record_create_params.CERTRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.CERTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["CERT"] | NotGiven = NOT_GIVEN, @@ -268,7 +276,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -292,6 +300,8 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -329,7 +339,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -353,6 +363,8 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -380,6 +392,7 @@ def create( data: record_create_params.DNSKEYRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.DNSKEYRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["DNSKEY"] | NotGiven = NOT_GIVEN, @@ -389,7 +402,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -413,6 +426,8 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -440,6 +455,7 @@ def create( data: record_create_params.DSRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.DSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["DS"] | NotGiven = NOT_GIVEN, @@ -449,7 +465,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -473,6 +489,8 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -500,6 +518,7 @@ def create( data: record_create_params.HTTPSRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.HTTPSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["HTTPS"] | NotGiven = NOT_GIVEN, @@ -509,7 +528,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -533,6 +552,8 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -560,6 +581,7 @@ def create( data: record_create_params.LOCRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.LOCRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["LOC"] | NotGiven = NOT_GIVEN, @@ -569,7 +591,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -593,6 +615,8 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -621,6 +645,7 @@ def create( name: str | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.MXRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["MX"] | NotGiven = NOT_GIVEN, @@ -630,7 +655,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -657,6 +682,8 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -684,6 +711,7 @@ def create( data: record_create_params.NAPTRRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.NAPTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["NAPTR"] | NotGiven = NOT_GIVEN, @@ -693,7 +721,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -717,6 +745,8 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -744,6 +774,7 @@ def create( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.NSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["NS"] | NotGiven = NOT_GIVEN, @@ -753,7 +784,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -777,6 +808,8 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -804,6 +837,7 @@ def create( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.DNSRecordsOpenpgpkeyRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["OPENPGPKEY"] | NotGiven = NOT_GIVEN, @@ -813,7 +847,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -837,6 +871,8 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -864,6 +900,7 @@ def create( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.PTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["PTR"] | NotGiven = NOT_GIVEN, @@ -873,7 +910,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -897,6 +934,8 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -924,6 +963,7 @@ def create( data: record_create_params.SMIMEARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.SMIMEARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SMIMEA"] | NotGiven = NOT_GIVEN, @@ -933,7 +973,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -957,6 +997,8 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -984,6 +1026,7 @@ def create( data: record_create_params.SRVRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.SRVRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SRV"] | NotGiven = NOT_GIVEN, @@ -993,7 +1036,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -1017,6 +1060,8 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -1044,6 +1089,7 @@ def create( data: record_create_params.SSHFPRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.SSHFPRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SSHFP"] | NotGiven = NOT_GIVEN, @@ -1053,7 +1099,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -1077,6 +1123,8 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -1104,6 +1152,7 @@ def create( data: record_create_params.SVCBRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.SVCBRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SVCB"] | NotGiven = NOT_GIVEN, @@ -1113,7 +1162,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -1137,6 +1186,8 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -1164,6 +1215,7 @@ def create( data: record_create_params.TLSARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.TLSARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["TLSA"] | NotGiven = NOT_GIVEN, @@ -1173,7 +1225,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -1197,6 +1249,8 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -1224,6 +1278,7 @@ def create( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.TXTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["TXT"] | NotGiven = NOT_GIVEN, @@ -1233,7 +1288,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -1262,6 +1317,8 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -1290,6 +1347,7 @@ def create( name: str | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.URIRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["URI"] | NotGiven = NOT_GIVEN, @@ -1299,7 +1357,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -1326,6 +1384,8 @@ def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -1353,6 +1413,9 @@ def create( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.ARecordSettings + | record_create_params.CNAMERecordSettings + | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["A"] @@ -1389,7 +1452,6 @@ def create( | record_create_params.SSHFPRecordData | record_create_params.URIRecordData | NotGiven = NOT_GIVEN, - settings: record_create_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1397,11 +1459,11 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( - Optional[RecordCreateResponse], + Optional[RecordResponse], self._post( f"/zones/{zone_id}/dns_records", body=maybe_transform( @@ -1410,11 +1472,11 @@ def create( "content": content, "name": name, "proxied": proxied, + "settings": settings, "tags": tags, "ttl": ttl, "type": type, "data": data, - "settings": settings, "priority": priority, }, record_create_params.RecordCreateParams, @@ -1424,10 +1486,10 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RecordCreateResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[RecordResponse]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[RecordCreateResponse] + Any, ResultWrapper[RecordResponse] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -1442,6 +1504,7 @@ def update( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.ARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["A"] | NotGiven = NOT_GIVEN, @@ -1451,7 +1514,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -1477,6 +1540,8 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -1505,6 +1570,7 @@ def update( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.AAAARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["AAAA"] | NotGiven = NOT_GIVEN, @@ -1514,7 +1580,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -1540,6 +1606,8 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -1568,6 +1636,7 @@ def update( data: record_update_params.CAARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.CAARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["CAA"] | NotGiven = NOT_GIVEN, @@ -1577,7 +1646,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -1603,6 +1672,8 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -1631,6 +1702,7 @@ def update( data: record_update_params.CERTRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.CERTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["CERT"] | NotGiven = NOT_GIVEN, @@ -1640,7 +1712,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -1666,6 +1738,8 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -1704,7 +1778,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -1730,6 +1804,8 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -1758,6 +1834,7 @@ def update( data: record_update_params.DNSKEYRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.DNSKEYRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["DNSKEY"] | NotGiven = NOT_GIVEN, @@ -1767,7 +1844,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -1793,6 +1870,8 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -1821,6 +1900,7 @@ def update( data: record_update_params.DSRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.DSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["DS"] | NotGiven = NOT_GIVEN, @@ -1830,7 +1910,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -1856,6 +1936,8 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -1884,6 +1966,7 @@ def update( data: record_update_params.HTTPSRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.HTTPSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["HTTPS"] | NotGiven = NOT_GIVEN, @@ -1893,7 +1976,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -1919,6 +2002,8 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -1947,6 +2032,7 @@ def update( data: record_update_params.LOCRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.LOCRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["LOC"] | NotGiven = NOT_GIVEN, @@ -1956,7 +2042,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -1982,6 +2068,8 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -2011,6 +2099,7 @@ def update( name: str | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.MXRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["MX"] | NotGiven = NOT_GIVEN, @@ -2020,7 +2109,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -2049,6 +2138,8 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -2077,6 +2168,7 @@ def update( data: record_update_params.NAPTRRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.NAPTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["NAPTR"] | NotGiven = NOT_GIVEN, @@ -2086,7 +2178,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -2112,6 +2204,8 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -2140,6 +2234,7 @@ def update( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.NSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["NS"] | NotGiven = NOT_GIVEN, @@ -2149,7 +2244,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -2175,6 +2270,8 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -2203,6 +2300,7 @@ def update( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.DNSRecordsOpenpgpkeyRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["OPENPGPKEY"] | NotGiven = NOT_GIVEN, @@ -2212,7 +2310,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -2238,6 +2336,8 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -2266,6 +2366,7 @@ def update( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.PTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["PTR"] | NotGiven = NOT_GIVEN, @@ -2275,7 +2376,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -2301,6 +2402,8 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -2329,6 +2432,7 @@ def update( data: record_update_params.SMIMEARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.SMIMEARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SMIMEA"] | NotGiven = NOT_GIVEN, @@ -2338,7 +2442,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -2364,6 +2468,8 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -2392,6 +2498,7 @@ def update( data: record_update_params.SRVRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.SRVRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SRV"] | NotGiven = NOT_GIVEN, @@ -2401,7 +2508,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -2427,6 +2534,8 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -2455,6 +2564,7 @@ def update( data: record_update_params.SSHFPRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.SSHFPRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SSHFP"] | NotGiven = NOT_GIVEN, @@ -2464,7 +2574,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -2490,6 +2600,8 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -2518,6 +2630,7 @@ def update( data: record_update_params.SVCBRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.SVCBRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SVCB"] | NotGiven = NOT_GIVEN, @@ -2527,7 +2640,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -2553,6 +2666,8 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -2581,6 +2696,7 @@ def update( data: record_update_params.TLSARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.TLSARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["TLSA"] | NotGiven = NOT_GIVEN, @@ -2590,7 +2706,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -2616,6 +2732,8 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -2644,6 +2762,7 @@ def update( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.TXTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["TXT"] | NotGiven = NOT_GIVEN, @@ -2653,7 +2772,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -2684,6 +2803,8 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -2713,6 +2834,7 @@ def update( name: str | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.URIRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["URI"] | NotGiven = NOT_GIVEN, @@ -2722,7 +2844,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -2751,6 +2873,8 @@ def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -2779,6 +2903,9 @@ def update( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.ARecordSettings + | record_update_params.CNAMERecordSettings + | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["A"] @@ -2815,7 +2942,6 @@ def update( | record_update_params.SSHFPRecordData | record_update_params.URIRecordData | NotGiven = NOT_GIVEN, - settings: record_update_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2823,13 +2949,13 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not dns_record_id: raise ValueError(f"Expected a non-empty value for `dns_record_id` but received {dns_record_id!r}") return cast( - Optional[RecordUpdateResponse], + Optional[RecordResponse], self._put( f"/zones/{zone_id}/dns_records/{dns_record_id}", body=maybe_transform( @@ -2838,11 +2964,11 @@ def update( "content": content, "name": name, "proxied": proxied, + "settings": settings, "tags": tags, "ttl": ttl, "type": type, "data": data, - "settings": settings, "priority": priority, }, record_update_params.RecordUpdateParams, @@ -2852,10 +2978,10 @@ def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RecordUpdateResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[RecordResponse]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[RecordUpdateResponse] + Any, ResultWrapper[RecordResponse] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -2906,7 +3032,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncV4PagePaginationArray[RecordListResponse]: + ) -> SyncV4PagePaginationArray[RecordResponse]: """ List, search, sort, and filter a zones' DNS records. @@ -2954,7 +3080,7 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/dns_records", - page=SyncV4PagePaginationArray[RecordListResponse], + page=SyncV4PagePaginationArray[RecordResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -2979,7 +3105,7 @@ def list( record_list_params.RecordListParams, ), ), - model=cast(Any, RecordListResponse), # Union types cannot be passed in as arguments in the type system + model=cast(Any, RecordResponse), # Union types cannot be passed in as arguments in the type system ) def delete( @@ -3031,9 +3157,9 @@ def batch( *, zone_id: str, deletes: Iterable[record_batch_params.Delete] | NotGiven = NOT_GIVEN, - patches: Iterable[record_batch_params.Patch] | NotGiven = NOT_GIVEN, + patches: Iterable[BatchPatchParam] | NotGiven = NOT_GIVEN, posts: Iterable[RecordParam] | NotGiven = NOT_GIVEN, - puts: Iterable[record_batch_params.Put] | NotGiven = NOT_GIVEN, + puts: Iterable[BatchPutParam] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -3104,6 +3230,7 @@ def edit( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.ARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["A"] | NotGiven = NOT_GIVEN, @@ -3113,7 +3240,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -3139,6 +3266,8 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -3167,6 +3296,7 @@ def edit( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.AAAARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["AAAA"] | NotGiven = NOT_GIVEN, @@ -3176,7 +3306,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -3202,6 +3332,8 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -3230,6 +3362,7 @@ def edit( data: record_edit_params.CAARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.CAARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["CAA"] | NotGiven = NOT_GIVEN, @@ -3239,7 +3372,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -3265,6 +3398,8 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -3293,6 +3428,7 @@ def edit( data: record_edit_params.CERTRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.CERTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["CERT"] | NotGiven = NOT_GIVEN, @@ -3302,7 +3438,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -3328,6 +3464,8 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -3366,7 +3504,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -3392,6 +3530,8 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -3420,6 +3560,7 @@ def edit( data: record_edit_params.DNSKEYRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.DNSKEYRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["DNSKEY"] | NotGiven = NOT_GIVEN, @@ -3429,7 +3570,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -3455,6 +3596,8 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -3483,6 +3626,7 @@ def edit( data: record_edit_params.DSRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.DSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["DS"] | NotGiven = NOT_GIVEN, @@ -3492,7 +3636,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -3518,6 +3662,8 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -3546,6 +3692,7 @@ def edit( data: record_edit_params.HTTPSRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.HTTPSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["HTTPS"] | NotGiven = NOT_GIVEN, @@ -3555,7 +3702,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -3581,6 +3728,8 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -3609,6 +3758,7 @@ def edit( data: record_edit_params.LOCRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.LOCRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["LOC"] | NotGiven = NOT_GIVEN, @@ -3618,7 +3768,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -3644,6 +3794,8 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -3673,6 +3825,7 @@ def edit( name: str | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.MXRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["MX"] | NotGiven = NOT_GIVEN, @@ -3682,7 +3835,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -3711,6 +3864,8 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -3739,6 +3894,7 @@ def edit( data: record_edit_params.NAPTRRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.NAPTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["NAPTR"] | NotGiven = NOT_GIVEN, @@ -3748,7 +3904,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -3774,6 +3930,8 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -3802,6 +3960,7 @@ def edit( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.NSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["NS"] | NotGiven = NOT_GIVEN, @@ -3811,7 +3970,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -3837,6 +3996,8 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -3865,6 +4026,7 @@ def edit( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.DNSRecordsOpenpgpkeyRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["OPENPGPKEY"] | NotGiven = NOT_GIVEN, @@ -3874,7 +4036,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -3900,6 +4062,8 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -3928,6 +4092,7 @@ def edit( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.PTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["PTR"] | NotGiven = NOT_GIVEN, @@ -3937,7 +4102,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -3963,6 +4128,8 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -3991,6 +4158,7 @@ def edit( data: record_edit_params.SMIMEARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.SMIMEARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SMIMEA"] | NotGiven = NOT_GIVEN, @@ -4000,7 +4168,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -4026,6 +4194,8 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -4054,6 +4224,7 @@ def edit( data: record_edit_params.SRVRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.SRVRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SRV"] | NotGiven = NOT_GIVEN, @@ -4063,7 +4234,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -4089,6 +4260,8 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -4117,6 +4290,7 @@ def edit( data: record_edit_params.SSHFPRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.SSHFPRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SSHFP"] | NotGiven = NOT_GIVEN, @@ -4126,7 +4300,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -4152,6 +4326,8 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -4180,6 +4356,7 @@ def edit( data: record_edit_params.SVCBRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.SVCBRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SVCB"] | NotGiven = NOT_GIVEN, @@ -4189,7 +4366,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -4215,6 +4392,8 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -4243,6 +4422,7 @@ def edit( data: record_edit_params.TLSARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.TLSARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["TLSA"] | NotGiven = NOT_GIVEN, @@ -4252,7 +4432,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -4278,6 +4458,8 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -4306,6 +4488,7 @@ def edit( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.TXTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["TXT"] | NotGiven = NOT_GIVEN, @@ -4315,7 +4498,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -4346,6 +4529,8 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -4375,6 +4560,7 @@ def edit( name: str | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.URIRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["URI"] | NotGiven = NOT_GIVEN, @@ -4384,7 +4570,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -4413,6 +4599,8 @@ def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -4441,6 +4629,7 @@ def edit( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.ARecordSettings | record_edit_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["A"] @@ -4477,7 +4666,6 @@ def edit( | record_edit_params.SSHFPRecordData | record_edit_params.URIRecordData | NotGiven = NOT_GIVEN, - settings: record_edit_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4485,13 +4673,13 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not dns_record_id: raise ValueError(f"Expected a non-empty value for `dns_record_id` but received {dns_record_id!r}") return cast( - Optional[RecordEditResponse], + Optional[RecordResponse], self._patch( f"/zones/{zone_id}/dns_records/{dns_record_id}", body=maybe_transform( @@ -4500,11 +4688,11 @@ def edit( "content": content, "name": name, "proxied": proxied, + "settings": settings, "tags": tags, "ttl": ttl, "type": type, "data": data, - "settings": settings, "priority": priority, }, record_edit_params.RecordEditParams, @@ -4514,10 +4702,10 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RecordEditResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[RecordResponse]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[RecordEditResponse] + Any, ResultWrapper[RecordResponse] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -4575,7 +4763,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordGetResponse]: + ) -> Optional[RecordResponse]: """ DNS Record Details @@ -4597,7 +4785,7 @@ def get( if not dns_record_id: raise ValueError(f"Expected a non-empty value for `dns_record_id` but received {dns_record_id!r}") return cast( - Optional[RecordGetResponse], + Optional[RecordResponse], self._get( f"/zones/{zone_id}/dns_records/{dns_record_id}", options=make_request_options( @@ -4605,10 +4793,10 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RecordGetResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[RecordResponse]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[RecordGetResponse] + Any, ResultWrapper[RecordResponse] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -4754,6 +4942,7 @@ async def create( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.ARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["A"] | NotGiven = NOT_GIVEN, @@ -4763,7 +4952,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -4787,6 +4976,8 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -4814,6 +5005,7 @@ async def create( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.AAAARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["AAAA"] | NotGiven = NOT_GIVEN, @@ -4823,7 +5015,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -4847,6 +5039,8 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -4874,6 +5068,7 @@ async def create( data: record_create_params.CAARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.CAARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["CAA"] | NotGiven = NOT_GIVEN, @@ -4883,7 +5078,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -4907,6 +5102,8 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -4934,6 +5131,7 @@ async def create( data: record_create_params.CERTRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.CERTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["CERT"] | NotGiven = NOT_GIVEN, @@ -4943,7 +5141,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -4967,6 +5165,8 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5004,7 +5204,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -5028,6 +5228,8 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5055,6 +5257,7 @@ async def create( data: record_create_params.DNSKEYRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.DNSKEYRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["DNSKEY"] | NotGiven = NOT_GIVEN, @@ -5064,7 +5267,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -5088,6 +5291,8 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5115,6 +5320,7 @@ async def create( data: record_create_params.DSRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.DSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["DS"] | NotGiven = NOT_GIVEN, @@ -5124,7 +5330,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -5148,6 +5354,8 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5175,6 +5383,7 @@ async def create( data: record_create_params.HTTPSRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.HTTPSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["HTTPS"] | NotGiven = NOT_GIVEN, @@ -5184,7 +5393,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -5208,6 +5417,8 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5235,6 +5446,7 @@ async def create( data: record_create_params.LOCRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.LOCRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["LOC"] | NotGiven = NOT_GIVEN, @@ -5244,7 +5456,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -5268,6 +5480,8 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5296,6 +5510,7 @@ async def create( name: str | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.MXRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["MX"] | NotGiven = NOT_GIVEN, @@ -5305,7 +5520,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -5332,6 +5547,8 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5359,6 +5576,7 @@ async def create( data: record_create_params.NAPTRRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.NAPTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["NAPTR"] | NotGiven = NOT_GIVEN, @@ -5368,7 +5586,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -5392,6 +5610,8 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5419,6 +5639,7 @@ async def create( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.NSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["NS"] | NotGiven = NOT_GIVEN, @@ -5428,7 +5649,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -5452,6 +5673,8 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5479,6 +5702,7 @@ async def create( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.DNSRecordsOpenpgpkeyRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["OPENPGPKEY"] | NotGiven = NOT_GIVEN, @@ -5488,7 +5712,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -5512,6 +5736,8 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5539,6 +5765,7 @@ async def create( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.PTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["PTR"] | NotGiven = NOT_GIVEN, @@ -5548,7 +5775,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -5572,6 +5799,8 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5599,6 +5828,7 @@ async def create( data: record_create_params.SMIMEARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.SMIMEARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SMIMEA"] | NotGiven = NOT_GIVEN, @@ -5608,7 +5838,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -5632,6 +5862,8 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5659,6 +5891,7 @@ async def create( data: record_create_params.SRVRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.SRVRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SRV"] | NotGiven = NOT_GIVEN, @@ -5668,7 +5901,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -5692,6 +5925,8 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5719,6 +5954,7 @@ async def create( data: record_create_params.SSHFPRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.SSHFPRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SSHFP"] | NotGiven = NOT_GIVEN, @@ -5728,7 +5964,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -5752,6 +5988,8 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5779,6 +6017,7 @@ async def create( data: record_create_params.SVCBRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.SVCBRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SVCB"] | NotGiven = NOT_GIVEN, @@ -5788,7 +6027,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -5812,6 +6051,8 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5839,6 +6080,7 @@ async def create( data: record_create_params.TLSARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.TLSARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["TLSA"] | NotGiven = NOT_GIVEN, @@ -5848,7 +6090,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -5872,6 +6114,8 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5899,6 +6143,7 @@ async def create( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.TXTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["TXT"] | NotGiven = NOT_GIVEN, @@ -5908,7 +6153,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -5937,6 +6182,8 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -5965,6 +6212,7 @@ async def create( name: str | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.URIRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["URI"] | NotGiven = NOT_GIVEN, @@ -5974,7 +6222,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -6001,6 +6249,8 @@ async def create( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -6028,6 +6278,9 @@ async def create( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_create_params.ARecordSettings + | record_create_params.CNAMERecordSettings + | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["A"] @@ -6064,7 +6317,6 @@ async def create( | record_create_params.SSHFPRecordData | record_create_params.URIRecordData | NotGiven = NOT_GIVEN, - settings: record_create_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -6072,11 +6324,11 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordCreateResponse]: + ) -> Optional[RecordResponse]: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( - Optional[RecordCreateResponse], + Optional[RecordResponse], await self._post( f"/zones/{zone_id}/dns_records", body=await async_maybe_transform( @@ -6085,11 +6337,11 @@ async def create( "content": content, "name": name, "proxied": proxied, + "settings": settings, "tags": tags, "ttl": ttl, "type": type, "data": data, - "settings": settings, "priority": priority, }, record_create_params.RecordCreateParams, @@ -6099,10 +6351,10 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RecordCreateResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[RecordResponse]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[RecordCreateResponse] + Any, ResultWrapper[RecordResponse] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -6117,6 +6369,7 @@ async def update( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.ARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["A"] | NotGiven = NOT_GIVEN, @@ -6126,7 +6379,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -6152,6 +6405,8 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -6180,6 +6435,7 @@ async def update( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.AAAARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["AAAA"] | NotGiven = NOT_GIVEN, @@ -6189,7 +6445,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -6215,6 +6471,8 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -6243,6 +6501,7 @@ async def update( data: record_update_params.CAARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.CAARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["CAA"] | NotGiven = NOT_GIVEN, @@ -6252,7 +6511,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -6278,6 +6537,8 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -6306,6 +6567,7 @@ async def update( data: record_update_params.CERTRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.CERTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["CERT"] | NotGiven = NOT_GIVEN, @@ -6315,7 +6577,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -6341,6 +6603,8 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -6379,7 +6643,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -6405,6 +6669,8 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -6433,6 +6699,7 @@ async def update( data: record_update_params.DNSKEYRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.DNSKEYRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["DNSKEY"] | NotGiven = NOT_GIVEN, @@ -6442,7 +6709,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -6468,6 +6735,8 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -6496,6 +6765,7 @@ async def update( data: record_update_params.DSRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.DSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["DS"] | NotGiven = NOT_GIVEN, @@ -6505,7 +6775,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -6531,6 +6801,8 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -6559,6 +6831,7 @@ async def update( data: record_update_params.HTTPSRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.HTTPSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["HTTPS"] | NotGiven = NOT_GIVEN, @@ -6568,7 +6841,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -6594,6 +6867,8 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -6622,6 +6897,7 @@ async def update( data: record_update_params.LOCRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.LOCRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["LOC"] | NotGiven = NOT_GIVEN, @@ -6631,7 +6907,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -6657,6 +6933,8 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -6686,6 +6964,7 @@ async def update( name: str | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.MXRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["MX"] | NotGiven = NOT_GIVEN, @@ -6695,7 +6974,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -6724,6 +7003,8 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -6752,6 +7033,7 @@ async def update( data: record_update_params.NAPTRRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.NAPTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["NAPTR"] | NotGiven = NOT_GIVEN, @@ -6761,7 +7043,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -6787,6 +7069,8 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -6815,6 +7099,7 @@ async def update( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.NSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["NS"] | NotGiven = NOT_GIVEN, @@ -6824,7 +7109,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -6850,6 +7135,8 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -6878,6 +7165,7 @@ async def update( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.DNSRecordsOpenpgpkeyRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["OPENPGPKEY"] | NotGiven = NOT_GIVEN, @@ -6887,7 +7175,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -6913,6 +7201,8 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -6941,6 +7231,7 @@ async def update( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.PTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["PTR"] | NotGiven = NOT_GIVEN, @@ -6950,7 +7241,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -6976,6 +7267,8 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -7004,6 +7297,7 @@ async def update( data: record_update_params.SMIMEARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.SMIMEARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SMIMEA"] | NotGiven = NOT_GIVEN, @@ -7013,7 +7307,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -7039,6 +7333,8 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -7067,6 +7363,7 @@ async def update( data: record_update_params.SRVRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.SRVRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SRV"] | NotGiven = NOT_GIVEN, @@ -7076,7 +7373,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -7102,6 +7399,8 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -7130,6 +7429,7 @@ async def update( data: record_update_params.SSHFPRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.SSHFPRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SSHFP"] | NotGiven = NOT_GIVEN, @@ -7139,7 +7439,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -7165,6 +7465,8 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -7193,6 +7495,7 @@ async def update( data: record_update_params.SVCBRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.SVCBRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SVCB"] | NotGiven = NOT_GIVEN, @@ -7202,7 +7505,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -7228,6 +7531,8 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -7256,6 +7561,7 @@ async def update( data: record_update_params.TLSARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.TLSARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["TLSA"] | NotGiven = NOT_GIVEN, @@ -7265,7 +7571,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -7291,6 +7597,8 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -7319,6 +7627,7 @@ async def update( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.TXTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["TXT"] | NotGiven = NOT_GIVEN, @@ -7328,7 +7637,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -7359,6 +7668,8 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -7388,6 +7699,7 @@ async def update( name: str | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.URIRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["URI"] | NotGiven = NOT_GIVEN, @@ -7397,7 +7709,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -7426,6 +7738,8 @@ async def update( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -7454,6 +7768,9 @@ async def update( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_update_params.ARecordSettings + | record_update_params.CNAMERecordSettings + | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["A"] @@ -7490,7 +7807,6 @@ async def update( | record_update_params.SSHFPRecordData | record_update_params.URIRecordData | NotGiven = NOT_GIVEN, - settings: record_update_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -7498,13 +7814,13 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordUpdateResponse]: + ) -> Optional[RecordResponse]: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not dns_record_id: raise ValueError(f"Expected a non-empty value for `dns_record_id` but received {dns_record_id!r}") return cast( - Optional[RecordUpdateResponse], + Optional[RecordResponse], await self._put( f"/zones/{zone_id}/dns_records/{dns_record_id}", body=await async_maybe_transform( @@ -7513,11 +7829,11 @@ async def update( "content": content, "name": name, "proxied": proxied, + "settings": settings, "tags": tags, "ttl": ttl, "type": type, "data": data, - "settings": settings, "priority": priority, }, record_update_params.RecordUpdateParams, @@ -7527,10 +7843,10 @@ async def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RecordUpdateResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[RecordResponse]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[RecordUpdateResponse] + Any, ResultWrapper[RecordResponse] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -7581,7 +7897,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[RecordListResponse, AsyncV4PagePaginationArray[RecordListResponse]]: + ) -> AsyncPaginator[RecordResponse, AsyncV4PagePaginationArray[RecordResponse]]: """ List, search, sort, and filter a zones' DNS records. @@ -7629,7 +7945,7 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/dns_records", - page=AsyncV4PagePaginationArray[RecordListResponse], + page=AsyncV4PagePaginationArray[RecordResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -7654,7 +7970,7 @@ def list( record_list_params.RecordListParams, ), ), - model=cast(Any, RecordListResponse), # Union types cannot be passed in as arguments in the type system + model=cast(Any, RecordResponse), # Union types cannot be passed in as arguments in the type system ) async def delete( @@ -7706,9 +8022,9 @@ async def batch( *, zone_id: str, deletes: Iterable[record_batch_params.Delete] | NotGiven = NOT_GIVEN, - patches: Iterable[record_batch_params.Patch] | NotGiven = NOT_GIVEN, + patches: Iterable[BatchPatchParam] | NotGiven = NOT_GIVEN, posts: Iterable[RecordParam] | NotGiven = NOT_GIVEN, - puts: Iterable[record_batch_params.Put] | NotGiven = NOT_GIVEN, + puts: Iterable[BatchPutParam] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -7779,6 +8095,7 @@ async def edit( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.ARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["A"] | NotGiven = NOT_GIVEN, @@ -7788,7 +8105,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -7814,6 +8131,8 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -7842,6 +8161,7 @@ async def edit( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.AAAARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["AAAA"] | NotGiven = NOT_GIVEN, @@ -7851,7 +8171,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -7877,6 +8197,8 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -7905,6 +8227,7 @@ async def edit( data: record_edit_params.CAARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.CAARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["CAA"] | NotGiven = NOT_GIVEN, @@ -7914,7 +8237,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -7940,6 +8263,8 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -7968,6 +8293,7 @@ async def edit( data: record_edit_params.CERTRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.CERTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["CERT"] | NotGiven = NOT_GIVEN, @@ -7977,7 +8303,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -8003,6 +8329,8 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -8041,7 +8369,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -8067,6 +8395,8 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -8095,6 +8425,7 @@ async def edit( data: record_edit_params.DNSKEYRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.DNSKEYRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["DNSKEY"] | NotGiven = NOT_GIVEN, @@ -8104,7 +8435,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -8130,6 +8461,8 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -8158,6 +8491,7 @@ async def edit( data: record_edit_params.DSRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.DSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["DS"] | NotGiven = NOT_GIVEN, @@ -8167,7 +8501,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -8193,6 +8527,8 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -8221,6 +8557,7 @@ async def edit( data: record_edit_params.HTTPSRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.HTTPSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["HTTPS"] | NotGiven = NOT_GIVEN, @@ -8230,7 +8567,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -8256,6 +8593,8 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -8284,6 +8623,7 @@ async def edit( data: record_edit_params.LOCRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.LOCRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["LOC"] | NotGiven = NOT_GIVEN, @@ -8293,7 +8633,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -8319,6 +8659,8 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -8348,6 +8690,7 @@ async def edit( name: str | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.MXRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["MX"] | NotGiven = NOT_GIVEN, @@ -8357,7 +8700,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -8386,6 +8729,8 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -8414,6 +8759,7 @@ async def edit( data: record_edit_params.NAPTRRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.NAPTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["NAPTR"] | NotGiven = NOT_GIVEN, @@ -8423,7 +8769,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -8449,6 +8795,8 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -8477,6 +8825,7 @@ async def edit( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.NSRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["NS"] | NotGiven = NOT_GIVEN, @@ -8486,7 +8835,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -8512,6 +8861,8 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -8540,6 +8891,7 @@ async def edit( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.DNSRecordsOpenpgpkeyRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["OPENPGPKEY"] | NotGiven = NOT_GIVEN, @@ -8549,7 +8901,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -8575,6 +8927,8 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -8603,6 +8957,7 @@ async def edit( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.PTRRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["PTR"] | NotGiven = NOT_GIVEN, @@ -8612,7 +8967,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -8638,6 +8993,8 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -8666,6 +9023,7 @@ async def edit( data: record_edit_params.SMIMEARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.SMIMEARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SMIMEA"] | NotGiven = NOT_GIVEN, @@ -8675,7 +9033,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -8701,6 +9059,8 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -8729,6 +9089,7 @@ async def edit( data: record_edit_params.SRVRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.SRVRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SRV"] | NotGiven = NOT_GIVEN, @@ -8738,7 +9099,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -8764,6 +9125,8 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -8792,6 +9155,7 @@ async def edit( data: record_edit_params.SSHFPRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.SSHFPRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SSHFP"] | NotGiven = NOT_GIVEN, @@ -8801,7 +9165,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -8827,6 +9191,8 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -8855,6 +9221,7 @@ async def edit( data: record_edit_params.SVCBRecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.SVCBRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["SVCB"] | NotGiven = NOT_GIVEN, @@ -8864,7 +9231,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -8890,6 +9257,8 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -8918,6 +9287,7 @@ async def edit( data: record_edit_params.TLSARecordData | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.TLSARecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["TLSA"] | NotGiven = NOT_GIVEN, @@ -8927,7 +9297,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -8953,6 +9323,8 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -8981,6 +9353,7 @@ async def edit( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.TXTRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["TXT"] | NotGiven = NOT_GIVEN, @@ -8990,7 +9363,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -9021,6 +9394,8 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -9050,6 +9425,7 @@ async def edit( name: str | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.URIRecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["URI"] | NotGiven = NOT_GIVEN, @@ -9059,7 +9435,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -9088,6 +9464,8 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. + settings: Settings for the DNS record. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -9116,6 +9494,7 @@ async def edit( content: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, + settings: record_edit_params.ARecordSettings | record_edit_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, tags: List[RecordTags] | NotGiven = NOT_GIVEN, ttl: TTLParam | NotGiven = NOT_GIVEN, type: Literal["A"] @@ -9152,7 +9531,6 @@ async def edit( | record_edit_params.SSHFPRecordData | record_edit_params.URIRecordData | NotGiven = NOT_GIVEN, - settings: record_edit_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -9160,13 +9538,13 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordEditResponse]: + ) -> Optional[RecordResponse]: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not dns_record_id: raise ValueError(f"Expected a non-empty value for `dns_record_id` but received {dns_record_id!r}") return cast( - Optional[RecordEditResponse], + Optional[RecordResponse], await self._patch( f"/zones/{zone_id}/dns_records/{dns_record_id}", body=await async_maybe_transform( @@ -9175,11 +9553,11 @@ async def edit( "content": content, "name": name, "proxied": proxied, + "settings": settings, "tags": tags, "ttl": ttl, "type": type, "data": data, - "settings": settings, "priority": priority, }, record_edit_params.RecordEditParams, @@ -9189,10 +9567,10 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RecordEditResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[RecordResponse]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[RecordEditResponse] + Any, ResultWrapper[RecordResponse] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -9250,7 +9628,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordGetResponse]: + ) -> Optional[RecordResponse]: """ DNS Record Details @@ -9272,7 +9650,7 @@ async def get( if not dns_record_id: raise ValueError(f"Expected a non-empty value for `dns_record_id` but received {dns_record_id!r}") return cast( - Optional[RecordGetResponse], + Optional[RecordResponse], await self._get( f"/zones/{zone_id}/dns_records/{dns_record_id}", options=make_request_options( @@ -9280,10 +9658,10 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RecordGetResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[RecordResponse]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[RecordGetResponse] + Any, ResultWrapper[RecordResponse] ), # Union types cannot be passed in as arguments in the type system ), ) diff --git a/src/cloudflare/resources/email_security/settings/block_senders.py b/src/cloudflare/resources/email_security/settings/block_senders.py index 41d3e4cfd67..d540e200fce 100644 --- a/src/cloudflare/resources/email_security/settings/block_senders.py +++ b/src/cloudflare/resources/email_security/settings/block_senders.py @@ -2,14 +2,13 @@ from __future__ import annotations -from typing import Any, Type, Iterable, Optional, cast -from typing_extensions import Literal, overload +from typing import Type, Optional, cast +from typing_extensions import Literal import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( - required_args, maybe_transform, async_maybe_transform, ) @@ -58,7 +57,6 @@ def with_streaming_response(self) -> BlockSendersResourceWithStreamingResponse: """ return BlockSendersResourceWithStreamingResponse(self) - @overload def create( self, *, @@ -88,81 +86,27 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - def create( - self, - *, - account_id: str, - body: Iterable[block_sender_create_params.Variant1Body], - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BlockSenderCreateResponse: - """ - Create a blocked email sender - - Args: - account_id: Account Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args(["account_id", "is_regex", "pattern", "pattern_type"], ["account_id", "body"]) - def create( - self, - *, - account_id: str, - is_regex: bool | NotGiven = NOT_GIVEN, - pattern: str | NotGiven = NOT_GIVEN, - pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"] | NotGiven = NOT_GIVEN, - comments: Optional[str] | NotGiven = NOT_GIVEN, - body: Iterable[block_sender_create_params.Variant1Body] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BlockSenderCreateResponse: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return cast( - BlockSenderCreateResponse, - self._post( - f"/accounts/{account_id}/email-security/settings/block_senders", - body=maybe_transform( - { - "is_regex": is_regex, - "pattern": pattern, - "pattern_type": pattern_type, - "comments": comments, - "body": body, - }, - block_sender_create_params.BlockSenderCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[BlockSenderCreateResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[BlockSenderCreateResponse] - ), # Union types cannot be passed in as arguments in the type system + return self._post( + f"/accounts/{account_id}/email-security/settings/block_senders", + body=maybe_transform( + { + "is_regex": is_regex, + "pattern": pattern, + "pattern_type": pattern_type, + "comments": comments, + }, + block_sender_create_params.BlockSenderCreateParams, ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[BlockSenderCreateResponse]._unwrapper, + ), + cast_to=cast(Type[BlockSenderCreateResponse], ResultWrapper[BlockSenderCreateResponse]), ) def list( @@ -251,6 +195,8 @@ def delete( Args: account_id: Account Identifier + pattern_id: The unique identifier for the allow policy. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -295,6 +241,8 @@ def edit( Args: account_id: Account Identifier + pattern_id: The unique identifier for the allow policy. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -344,6 +292,8 @@ def get( Args: account_id: Account Identifier + pattern_id: The unique identifier for the allow policy. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -387,7 +337,6 @@ def with_streaming_response(self) -> AsyncBlockSendersResourceWithStreamingRespo """ return AsyncBlockSendersResourceWithStreamingResponse(self) - @overload async def create( self, *, @@ -417,81 +366,27 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - async def create( - self, - *, - account_id: str, - body: Iterable[block_sender_create_params.Variant1Body], - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BlockSenderCreateResponse: - """ - Create a blocked email sender - - Args: - account_id: Account Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args(["account_id", "is_regex", "pattern", "pattern_type"], ["account_id", "body"]) - async def create( - self, - *, - account_id: str, - is_regex: bool | NotGiven = NOT_GIVEN, - pattern: str | NotGiven = NOT_GIVEN, - pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"] | NotGiven = NOT_GIVEN, - comments: Optional[str] | NotGiven = NOT_GIVEN, - body: Iterable[block_sender_create_params.Variant1Body] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BlockSenderCreateResponse: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return cast( - BlockSenderCreateResponse, - await self._post( - f"/accounts/{account_id}/email-security/settings/block_senders", - body=await async_maybe_transform( - { - "is_regex": is_regex, - "pattern": pattern, - "pattern_type": pattern_type, - "comments": comments, - "body": body, - }, - block_sender_create_params.BlockSenderCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[BlockSenderCreateResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[BlockSenderCreateResponse] - ), # Union types cannot be passed in as arguments in the type system + return await self._post( + f"/accounts/{account_id}/email-security/settings/block_senders", + body=await async_maybe_transform( + { + "is_regex": is_regex, + "pattern": pattern, + "pattern_type": pattern_type, + "comments": comments, + }, + block_sender_create_params.BlockSenderCreateParams, ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[BlockSenderCreateResponse]._unwrapper, + ), + cast_to=cast(Type[BlockSenderCreateResponse], ResultWrapper[BlockSenderCreateResponse]), ) def list( @@ -580,6 +475,8 @@ async def delete( Args: account_id: Account Identifier + pattern_id: The unique identifier for the allow policy. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -624,6 +521,8 @@ async def edit( Args: account_id: Account Identifier + pattern_id: The unique identifier for the allow policy. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -673,6 +572,8 @@ async def get( Args: account_id: Account Identifier + pattern_id: The unique identifier for the allow policy. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request diff --git a/src/cloudflare/resources/email_security/settings/impersonation_registry.py b/src/cloudflare/resources/email_security/settings/impersonation_registry.py index bb67428ecff..29b5532a411 100644 --- a/src/cloudflare/resources/email_security/settings/impersonation_registry.py +++ b/src/cloudflare/resources/email_security/settings/impersonation_registry.py @@ -2,14 +2,13 @@ from __future__ import annotations -from typing import Any, Type, Iterable, Optional, cast -from typing_extensions import Literal, overload +from typing import Type, Optional, cast +from typing_extensions import Literal import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( - required_args, maybe_transform, async_maybe_transform, ) @@ -58,7 +57,6 @@ def with_streaming_response(self) -> ImpersonationRegistryResourceWithStreamingR """ return ImpersonationRegistryResourceWithStreamingResponse(self) - @overload def create( self, *, @@ -87,79 +85,26 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - def create( - self, - *, - account_id: str, - body: Iterable[impersonation_registry_create_params.Variant1Body], - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ImpersonationRegistryCreateResponse: - """ - Create an entry in impersonation registry - - Args: - account_id: Account Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args(["account_id", "email", "is_email_regex", "name"], ["account_id", "body"]) - def create( - self, - *, - account_id: str, - email: str | NotGiven = NOT_GIVEN, - is_email_regex: bool | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - body: Iterable[impersonation_registry_create_params.Variant1Body] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ImpersonationRegistryCreateResponse: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return cast( - ImpersonationRegistryCreateResponse, - self._post( - f"/accounts/{account_id}/email-security/settings/impersonation_registry", - body=maybe_transform( - { - "email": email, - "is_email_regex": is_email_regex, - "name": name, - "body": body, - }, - impersonation_registry_create_params.ImpersonationRegistryCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ImpersonationRegistryCreateResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[ImpersonationRegistryCreateResponse] - ), # Union types cannot be passed in as arguments in the type system + return self._post( + f"/accounts/{account_id}/email-security/settings/impersonation_registry", + body=maybe_transform( + { + "email": email, + "is_email_regex": is_email_regex, + "name": name, + }, + impersonation_registry_create_params.ImpersonationRegistryCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ImpersonationRegistryCreateResponse]._unwrapper, ), + cast_to=cast(Type[ImpersonationRegistryCreateResponse], ResultWrapper[ImpersonationRegistryCreateResponse]), ) def list( @@ -383,7 +328,6 @@ def with_streaming_response(self) -> AsyncImpersonationRegistryResourceWithStrea """ return AsyncImpersonationRegistryResourceWithStreamingResponse(self) - @overload async def create( self, *, @@ -412,79 +356,26 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - async def create( - self, - *, - account_id: str, - body: Iterable[impersonation_registry_create_params.Variant1Body], - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ImpersonationRegistryCreateResponse: - """ - Create an entry in impersonation registry - - Args: - account_id: Account Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args(["account_id", "email", "is_email_regex", "name"], ["account_id", "body"]) - async def create( - self, - *, - account_id: str, - email: str | NotGiven = NOT_GIVEN, - is_email_regex: bool | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - body: Iterable[impersonation_registry_create_params.Variant1Body] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ImpersonationRegistryCreateResponse: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return cast( - ImpersonationRegistryCreateResponse, - await self._post( - f"/accounts/{account_id}/email-security/settings/impersonation_registry", - body=await async_maybe_transform( - { - "email": email, - "is_email_regex": is_email_regex, - "name": name, - "body": body, - }, - impersonation_registry_create_params.ImpersonationRegistryCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ImpersonationRegistryCreateResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[ImpersonationRegistryCreateResponse] - ), # Union types cannot be passed in as arguments in the type system + return await self._post( + f"/accounts/{account_id}/email-security/settings/impersonation_registry", + body=await async_maybe_transform( + { + "email": email, + "is_email_regex": is_email_regex, + "name": name, + }, + impersonation_registry_create_params.ImpersonationRegistryCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ImpersonationRegistryCreateResponse]._unwrapper, ), + cast_to=cast(Type[ImpersonationRegistryCreateResponse], ResultWrapper[ImpersonationRegistryCreateResponse]), ) def list( diff --git a/src/cloudflare/resources/logpush/jobs.py b/src/cloudflare/resources/logpush/jobs.py index 59007334df7..76ed1b79c19 100644 --- a/src/cloudflare/resources/logpush/jobs.py +++ b/src/cloudflare/resources/logpush/jobs.py @@ -196,6 +196,7 @@ def update( max_upload_bytes: Optional[int] | NotGiven = NOT_GIVEN, max_upload_interval_seconds: Optional[int] | NotGiven = NOT_GIVEN, max_upload_records: Optional[int] | NotGiven = NOT_GIVEN, + name: Optional[str] | NotGiven = NOT_GIVEN, output_options: Optional[OutputOptionsParam] | NotGiven = NOT_GIVEN, ownership_challenge: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -253,6 +254,10 @@ def update( lines than this. This parameter is not available for jobs with `edge` as its kind. + name: Optional human readable job name. Not unique. Cloudflare suggests that you set + this to a meaningful string, like the domain name, to make it easier to identify + your job. + output_options: The structured replacement for `logpull_options`. When including this field, the `logpull_option` field will be ignored. @@ -290,6 +295,7 @@ def update( "max_upload_bytes": max_upload_bytes, "max_upload_interval_seconds": max_upload_interval_seconds, "max_upload_records": max_upload_records, + "name": name, "output_options": output_options, "ownership_challenge": ownership_challenge, }, @@ -630,6 +636,7 @@ async def update( max_upload_bytes: Optional[int] | NotGiven = NOT_GIVEN, max_upload_interval_seconds: Optional[int] | NotGiven = NOT_GIVEN, max_upload_records: Optional[int] | NotGiven = NOT_GIVEN, + name: Optional[str] | NotGiven = NOT_GIVEN, output_options: Optional[OutputOptionsParam] | NotGiven = NOT_GIVEN, ownership_challenge: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -687,6 +694,10 @@ async def update( lines than this. This parameter is not available for jobs with `edge` as its kind. + name: Optional human readable job name. Not unique. Cloudflare suggests that you set + this to a meaningful string, like the domain name, to make it easier to identify + your job. + output_options: The structured replacement for `logpull_options`. When including this field, the `logpull_option` field will be ignored. @@ -724,6 +735,7 @@ async def update( "max_upload_bytes": max_upload_bytes, "max_upload_interval_seconds": max_upload_interval_seconds, "max_upload_records": max_upload_records, + "name": name, "output_options": output_options, "ownership_challenge": ownership_challenge, }, diff --git a/src/cloudflare/resources/logpush/validate.py b/src/cloudflare/resources/logpush/validate.py index 66e3c1602a8..34d1803113c 100644 --- a/src/cloudflare/resources/logpush/validate.py +++ b/src/cloudflare/resources/logpush/validate.py @@ -21,9 +21,10 @@ ) from ..._wrappers import ResultWrapper from ..._base_client import make_request_options -from ...types.logpush import validate_origin_params, validate_destination_params +from ...types.logpush import validate_origin_params, validate_destination_params, validate_destination_exists_params from ...types.logpush.validate_origin_response import ValidateOriginResponse from ...types.logpush.validate_destination_response import ValidateDestinationResponse +from ...types.logpush.validate_destination_exists_response import ValidateDestinationExistsResponse __all__ = ["ValidateResource", "AsyncValidateResource"] @@ -62,7 +63,7 @@ def destination( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Optional[ValidateDestinationResponse]: """ - Checks if there is an existing job with a destination. + Validates destination. Args: destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. @@ -94,7 +95,7 @@ def destination( account_or_zone = "zones" account_or_zone_id = zone_id return self._post( - f"/{account_or_zone}/{account_or_zone_id}/logpush/validate/destination/exists", + f"/{account_or_zone}/{account_or_zone_id}/logpush/validate/destination", body=maybe_transform( {"destination_conf": destination_conf}, validate_destination_params.ValidateDestinationParams ), @@ -108,6 +109,69 @@ def destination( cast_to=cast(Type[Optional[ValidateDestinationResponse]], ResultWrapper[ValidateDestinationResponse]), ) + def destination_exists( + self, + *, + destination_conf: str, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[ValidateDestinationExistsResponse]: + """ + Checks if there is an existing job with a destination. + + Args: + destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. + Additional configuration parameters supported by the destination may be + included. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if account_id and zone_id: + raise ValueError("You cannot provide both account_id and zone_id") + + if account_id: + account_or_zone = "accounts" + account_or_zone_id = account_id + else: + if not zone_id: + raise ValueError("You must provide either account_id or zone_id") + + account_or_zone = "zones" + account_or_zone_id = zone_id + return self._post( + f"/{account_or_zone}/{account_or_zone_id}/logpush/validate/destination/exists", + body=maybe_transform( + {"destination_conf": destination_conf}, + validate_destination_exists_params.ValidateDestinationExistsParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[ValidateDestinationExistsResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[ValidateDestinationExistsResponse]], ResultWrapper[ValidateDestinationExistsResponse] + ), + ) + def origin( self, *, @@ -203,7 +267,7 @@ async def destination( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Optional[ValidateDestinationResponse]: """ - Checks if there is an existing job with a destination. + Validates destination. Args: destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. @@ -235,7 +299,7 @@ async def destination( account_or_zone = "zones" account_or_zone_id = zone_id return await self._post( - f"/{account_or_zone}/{account_or_zone_id}/logpush/validate/destination/exists", + f"/{account_or_zone}/{account_or_zone_id}/logpush/validate/destination", body=await async_maybe_transform( {"destination_conf": destination_conf}, validate_destination_params.ValidateDestinationParams ), @@ -249,6 +313,69 @@ async def destination( cast_to=cast(Type[Optional[ValidateDestinationResponse]], ResultWrapper[ValidateDestinationResponse]), ) + async def destination_exists( + self, + *, + destination_conf: str, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[ValidateDestinationExistsResponse]: + """ + Checks if there is an existing job with a destination. + + Args: + destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. + Additional configuration parameters supported by the destination may be + included. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if account_id and zone_id: + raise ValueError("You cannot provide both account_id and zone_id") + + if account_id: + account_or_zone = "accounts" + account_or_zone_id = account_id + else: + if not zone_id: + raise ValueError("You must provide either account_id or zone_id") + + account_or_zone = "zones" + account_or_zone_id = zone_id + return await self._post( + f"/{account_or_zone}/{account_or_zone_id}/logpush/validate/destination/exists", + body=await async_maybe_transform( + {"destination_conf": destination_conf}, + validate_destination_exists_params.ValidateDestinationExistsParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[ValidateDestinationExistsResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[ValidateDestinationExistsResponse]], ResultWrapper[ValidateDestinationExistsResponse] + ), + ) + async def origin( self, *, @@ -319,6 +446,9 @@ def __init__(self, validate: ValidateResource) -> None: self.destination = to_raw_response_wrapper( validate.destination, ) + self.destination_exists = to_raw_response_wrapper( + validate.destination_exists, + ) self.origin = to_raw_response_wrapper( validate.origin, ) @@ -331,6 +461,9 @@ def __init__(self, validate: AsyncValidateResource) -> None: self.destination = async_to_raw_response_wrapper( validate.destination, ) + self.destination_exists = async_to_raw_response_wrapper( + validate.destination_exists, + ) self.origin = async_to_raw_response_wrapper( validate.origin, ) @@ -343,6 +476,9 @@ def __init__(self, validate: ValidateResource) -> None: self.destination = to_streamed_response_wrapper( validate.destination, ) + self.destination_exists = to_streamed_response_wrapper( + validate.destination_exists, + ) self.origin = to_streamed_response_wrapper( validate.origin, ) @@ -355,6 +491,9 @@ def __init__(self, validate: AsyncValidateResource) -> None: self.destination = async_to_streamed_response_wrapper( validate.destination, ) + self.destination_exists = async_to_streamed_response_wrapper( + validate.destination_exists, + ) self.origin = async_to_streamed_response_wrapper( validate.origin, ) diff --git a/src/cloudflare/resources/magic_transit/sites/acls.py b/src/cloudflare/resources/magic_transit/sites/acls.py index c8edeccd631..a823a5bc933 100644 --- a/src/cloudflare/resources/magic_transit/sites/acls.py +++ b/src/cloudflare/resources/magic_transit/sites/acls.py @@ -61,6 +61,7 @@ def create( description: str | NotGiven = NOT_GIVEN, forward_locally: bool | NotGiven = NOT_GIVEN, protocols: List[AllowedProtocol] | NotGiven = NOT_GIVEN, + unidirectional: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -85,6 +86,10 @@ def create( traffic locally on the Magic Connector. If not included in request, will default to false. + unidirectional: The desired traffic direction for this ACL policy. If set to "false", the policy + will allow bidirectional traffic. If set to "true", the policy will only allow + traffic in one direction. If not included in request, will default to false. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -107,6 +112,7 @@ def create( "description": description, "forward_locally": forward_locally, "protocols": protocols, + "unidirectional": unidirectional, }, acl_create_params.ACLCreateParams, ), @@ -132,6 +138,7 @@ def update( lan_2: ACLConfigurationParam | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, protocols: List[AllowedProtocol] | NotGiven = NOT_GIVEN, + unidirectional: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -158,6 +165,10 @@ def update( name: The name of the ACL. + unidirectional: The desired traffic direction for this ACL policy. If set to "false", the policy + will allow bidirectional traffic. If set to "true", the policy will only allow + traffic in one direction. If not included in request, will default to false. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -182,6 +193,7 @@ def update( "lan_2": lan_2, "name": name, "protocols": protocols, + "unidirectional": unidirectional, }, acl_update_params.ACLUpdateParams, ), @@ -297,6 +309,7 @@ def edit( lan_2: ACLConfigurationParam | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, protocols: List[AllowedProtocol] | NotGiven = NOT_GIVEN, + unidirectional: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -323,6 +336,10 @@ def edit( name: The name of the ACL. + unidirectional: The desired traffic direction for this ACL policy. If set to "false", the policy + will allow bidirectional traffic. If set to "true", the policy will only allow + traffic in one direction. If not included in request, will default to false. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -347,6 +364,7 @@ def edit( "lan_2": lan_2, "name": name, "protocols": protocols, + "unidirectional": unidirectional, }, acl_edit_params.ACLEditParams, ), @@ -441,6 +459,7 @@ async def create( description: str | NotGiven = NOT_GIVEN, forward_locally: bool | NotGiven = NOT_GIVEN, protocols: List[AllowedProtocol] | NotGiven = NOT_GIVEN, + unidirectional: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -465,6 +484,10 @@ async def create( traffic locally on the Magic Connector. If not included in request, will default to false. + unidirectional: The desired traffic direction for this ACL policy. If set to "false", the policy + will allow bidirectional traffic. If set to "true", the policy will only allow + traffic in one direction. If not included in request, will default to false. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -487,6 +510,7 @@ async def create( "description": description, "forward_locally": forward_locally, "protocols": protocols, + "unidirectional": unidirectional, }, acl_create_params.ACLCreateParams, ), @@ -512,6 +536,7 @@ async def update( lan_2: ACLConfigurationParam | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, protocols: List[AllowedProtocol] | NotGiven = NOT_GIVEN, + unidirectional: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -538,6 +563,10 @@ async def update( name: The name of the ACL. + unidirectional: The desired traffic direction for this ACL policy. If set to "false", the policy + will allow bidirectional traffic. If set to "true", the policy will only allow + traffic in one direction. If not included in request, will default to false. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -562,6 +591,7 @@ async def update( "lan_2": lan_2, "name": name, "protocols": protocols, + "unidirectional": unidirectional, }, acl_update_params.ACLUpdateParams, ), @@ -677,6 +707,7 @@ async def edit( lan_2: ACLConfigurationParam | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, protocols: List[AllowedProtocol] | NotGiven = NOT_GIVEN, + unidirectional: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -703,6 +734,10 @@ async def edit( name: The name of the ACL. + unidirectional: The desired traffic direction for this ACL policy. If set to "false", the policy + will allow bidirectional traffic. If set to "true", the policy will only allow + traffic in one direction. If not included in request, will default to false. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -727,6 +762,7 @@ async def edit( "lan_2": lan_2, "name": name, "protocols": protocols, + "unidirectional": unidirectional, }, acl_edit_params.ACLEditParams, ), diff --git a/src/cloudflare/resources/managed_transforms.py b/src/cloudflare/resources/managed_transforms.py index 9ac119e110b..50bfea9758a 100644 --- a/src/cloudflare/resources/managed_transforms.py +++ b/src/cloudflare/resources/managed_transforms.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing import Iterable +from typing import Type, Iterable, cast import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven from .._utils import ( maybe_transform, async_maybe_transform, @@ -19,9 +19,9 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) +from .._wrappers import ResultWrapper from .._base_client import make_request_options from ..types.managed_transforms import managed_transform_edit_params -from ..types.managed_transforms.request_model_param import RequestModelParam from ..types.managed_transforms.managed_transform_edit_response import ManagedTransformEditResponse from ..types.managed_transforms.managed_transform_list_response import ManagedTransformListResponse @@ -63,7 +63,7 @@ def list( Fetches a list of all Managed Transforms. Args: - zone_id: Identifier + zone_id: The unique ID of the zone. extra_headers: Send extra headers @@ -76,19 +76,59 @@ def list( if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( + f"/zones/{zone_id}/managed_headers", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ManagedTransformListResponse]._unwrapper, + ), + cast_to=cast(Type[ManagedTransformListResponse], ResultWrapper[ManagedTransformListResponse]), + ) + + def delete( + self, + *, + zone_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> None: + """ + Disables all Managed Transforms. + + Args: + zone_id: The unique ID of the zone. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return self._delete( f"/zones/{zone_id}/managed_headers", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=ManagedTransformListResponse, + cast_to=NoneType, ) def edit( self, *, zone_id: str, - managed_request_headers: Iterable[RequestModelParam], - managed_response_headers: Iterable[RequestModelParam], + managed_request_headers: Iterable[managed_transform_edit_params.ManagedRequestHeader], + managed_response_headers: Iterable[managed_transform_edit_params.ManagedResponseHeader], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -100,7 +140,11 @@ def edit( Updates the status of one or more Managed Transforms. Args: - zone_id: Identifier + zone_id: The unique ID of the zone. + + managed_request_headers: The list of Managed Request Transforms. + + managed_response_headers: The list of Managed Response Transforms. extra_headers: Send extra headers @@ -122,9 +166,13 @@ def edit( managed_transform_edit_params.ManagedTransformEditParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ManagedTransformEditResponse]._unwrapper, ), - cast_to=ManagedTransformEditResponse, + cast_to=cast(Type[ManagedTransformEditResponse], ResultWrapper[ManagedTransformEditResponse]), ) @@ -163,7 +211,7 @@ async def list( Fetches a list of all Managed Transforms. Args: - zone_id: Identifier + zone_id: The unique ID of the zone. extra_headers: Send extra headers @@ -176,19 +224,59 @@ async def list( if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( + f"/zones/{zone_id}/managed_headers", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ManagedTransformListResponse]._unwrapper, + ), + cast_to=cast(Type[ManagedTransformListResponse], ResultWrapper[ManagedTransformListResponse]), + ) + + async def delete( + self, + *, + zone_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> None: + """ + Disables all Managed Transforms. + + Args: + zone_id: The unique ID of the zone. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return await self._delete( f"/zones/{zone_id}/managed_headers", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=ManagedTransformListResponse, + cast_to=NoneType, ) async def edit( self, *, zone_id: str, - managed_request_headers: Iterable[RequestModelParam], - managed_response_headers: Iterable[RequestModelParam], + managed_request_headers: Iterable[managed_transform_edit_params.ManagedRequestHeader], + managed_response_headers: Iterable[managed_transform_edit_params.ManagedResponseHeader], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -200,7 +288,11 @@ async def edit( Updates the status of one or more Managed Transforms. Args: - zone_id: Identifier + zone_id: The unique ID of the zone. + + managed_request_headers: The list of Managed Request Transforms. + + managed_response_headers: The list of Managed Response Transforms. extra_headers: Send extra headers @@ -222,9 +314,13 @@ async def edit( managed_transform_edit_params.ManagedTransformEditParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ManagedTransformEditResponse]._unwrapper, ), - cast_to=ManagedTransformEditResponse, + cast_to=cast(Type[ManagedTransformEditResponse], ResultWrapper[ManagedTransformEditResponse]), ) @@ -235,6 +331,9 @@ def __init__(self, managed_transforms: ManagedTransformsResource) -> None: self.list = to_raw_response_wrapper( managed_transforms.list, ) + self.delete = to_raw_response_wrapper( + managed_transforms.delete, + ) self.edit = to_raw_response_wrapper( managed_transforms.edit, ) @@ -247,6 +346,9 @@ def __init__(self, managed_transforms: AsyncManagedTransformsResource) -> None: self.list = async_to_raw_response_wrapper( managed_transforms.list, ) + self.delete = async_to_raw_response_wrapper( + managed_transforms.delete, + ) self.edit = async_to_raw_response_wrapper( managed_transforms.edit, ) @@ -259,6 +361,9 @@ def __init__(self, managed_transforms: ManagedTransformsResource) -> None: self.list = to_streamed_response_wrapper( managed_transforms.list, ) + self.delete = to_streamed_response_wrapper( + managed_transforms.delete, + ) self.edit = to_streamed_response_wrapper( managed_transforms.edit, ) @@ -271,6 +376,9 @@ def __init__(self, managed_transforms: AsyncManagedTransformsResource) -> None: self.list = async_to_streamed_response_wrapper( managed_transforms.list, ) + self.delete = async_to_streamed_response_wrapper( + managed_transforms.delete, + ) self.edit = async_to_streamed_response_wrapper( managed_transforms.edit, ) diff --git a/src/cloudflare/resources/origin_post_quantum_encryption.py b/src/cloudflare/resources/origin_post_quantum_encryption.py index bda025f507b..ff991b49d4c 100644 --- a/src/cloudflare/resources/origin_post_quantum_encryption.py +++ b/src/cloudflare/resources/origin_post_quantum_encryption.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, cast +from typing import Type, Optional, cast from typing_extensions import Literal import httpx @@ -64,7 +64,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OriginPostQuantumEncryptionUpdateResponse: + ) -> Optional[OriginPostQuantumEncryptionUpdateResponse]: """ Instructs Cloudflare to use Post-Quantum (PQ) key agreement algorithms when connecting to your origin. Preferred instructs Cloudflare to opportunistically @@ -88,24 +88,21 @@ def update( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return cast( - OriginPostQuantumEncryptionUpdateResponse, - self._put( - f"/zones/{zone_id}/cache/origin_post_quantum_encryption", - body=maybe_transform( - {"value": value}, - origin_post_quantum_encryption_update_params.OriginPostQuantumEncryptionUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[OriginPostQuantumEncryptionUpdateResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[OriginPostQuantumEncryptionUpdateResponse] - ), # Union types cannot be passed in as arguments in the type system + return self._put( + f"/zones/{zone_id}/cache/origin_post_quantum_encryption", + body=maybe_transform( + {"value": value}, origin_post_quantum_encryption_update_params.OriginPostQuantumEncryptionUpdateParams + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[OriginPostQuantumEncryptionUpdateResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[OriginPostQuantumEncryptionUpdateResponse]], + ResultWrapper[OriginPostQuantumEncryptionUpdateResponse], ), ) @@ -119,7 +116,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OriginPostQuantumEncryptionGetResponse: + ) -> Optional[OriginPostQuantumEncryptionGetResponse]: """ Instructs Cloudflare to use Post-Quantum (PQ) key agreement algorithms when connecting to your origin. Preferred instructs Cloudflare to opportunistically @@ -141,20 +138,18 @@ def get( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return cast( - OriginPostQuantumEncryptionGetResponse, - self._get( - f"/zones/{zone_id}/cache/origin_post_quantum_encryption", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[OriginPostQuantumEncryptionGetResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[OriginPostQuantumEncryptionGetResponse] - ), # Union types cannot be passed in as arguments in the type system + return self._get( + f"/zones/{zone_id}/cache/origin_post_quantum_encryption", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[OriginPostQuantumEncryptionGetResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[OriginPostQuantumEncryptionGetResponse]], + ResultWrapper[OriginPostQuantumEncryptionGetResponse], ), ) @@ -190,7 +185,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OriginPostQuantumEncryptionUpdateResponse: + ) -> Optional[OriginPostQuantumEncryptionUpdateResponse]: """ Instructs Cloudflare to use Post-Quantum (PQ) key agreement algorithms when connecting to your origin. Preferred instructs Cloudflare to opportunistically @@ -214,24 +209,21 @@ async def update( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return cast( - OriginPostQuantumEncryptionUpdateResponse, - await self._put( - f"/zones/{zone_id}/cache/origin_post_quantum_encryption", - body=await async_maybe_transform( - {"value": value}, - origin_post_quantum_encryption_update_params.OriginPostQuantumEncryptionUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[OriginPostQuantumEncryptionUpdateResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[OriginPostQuantumEncryptionUpdateResponse] - ), # Union types cannot be passed in as arguments in the type system + return await self._put( + f"/zones/{zone_id}/cache/origin_post_quantum_encryption", + body=await async_maybe_transform( + {"value": value}, origin_post_quantum_encryption_update_params.OriginPostQuantumEncryptionUpdateParams + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[OriginPostQuantumEncryptionUpdateResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[OriginPostQuantumEncryptionUpdateResponse]], + ResultWrapper[OriginPostQuantumEncryptionUpdateResponse], ), ) @@ -245,7 +237,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OriginPostQuantumEncryptionGetResponse: + ) -> Optional[OriginPostQuantumEncryptionGetResponse]: """ Instructs Cloudflare to use Post-Quantum (PQ) key agreement algorithms when connecting to your origin. Preferred instructs Cloudflare to opportunistically @@ -267,20 +259,18 @@ async def get( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return cast( - OriginPostQuantumEncryptionGetResponse, - await self._get( - f"/zones/{zone_id}/cache/origin_post_quantum_encryption", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[OriginPostQuantumEncryptionGetResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[OriginPostQuantumEncryptionGetResponse] - ), # Union types cannot be passed in as arguments in the type system + return await self._get( + f"/zones/{zone_id}/cache/origin_post_quantum_encryption", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[OriginPostQuantumEncryptionGetResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[OriginPostQuantumEncryptionGetResponse]], + ResultWrapper[OriginPostQuantumEncryptionGetResponse], ), ) diff --git a/src/cloudflare/resources/r2/buckets/buckets.py b/src/cloudflare/resources/r2/buckets/buckets.py index d1556b62dd5..042d0b13c48 100644 --- a/src/cloudflare/resources/r2/buckets/buckets.py +++ b/src/cloudflare/resources/r2/buckets/buckets.py @@ -118,7 +118,7 @@ def create( name: str, location_hint: Literal["apac", "eeur", "enam", "weur", "wnam"] | NotGiven = NOT_GIVEN, storage_class: Literal["Standard", "InfrequentAccess"] | NotGiven = NOT_GIVEN, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -138,7 +138,7 @@ def create( storage_class: Storage class for newly uploaded objects, unless specified otherwise. - cf_r2_jurisdiction: Creates the bucket in the provided jurisdiction + jurisdiction: Creates the bucket in the provided jurisdiction extra_headers: Send extra headers @@ -151,9 +151,7 @@ def create( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return self._post( @@ -186,7 +184,7 @@ def list( order: Literal["name"] | NotGiven = NOT_GIVEN, per_page: float | NotGiven = NOT_GIVEN, start_after: str | NotGiven = NOT_GIVEN, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -214,7 +212,7 @@ def list( start_after: Bucket name to start searching after. Buckets are ordered lexicographically. - cf_r2_jurisdiction: Lists buckets in the provided jurisdiction + jurisdiction: Lists buckets in the provided jurisdiction extra_headers: Send extra headers @@ -227,9 +225,7 @@ def list( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return self._get( @@ -260,7 +256,7 @@ def delete( bucket_name: str, *, account_id: str, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -276,7 +272,7 @@ def delete( bucket_name: Name of the bucket - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -291,9 +287,7 @@ def delete( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return self._delete( @@ -313,7 +307,7 @@ def get( bucket_name: str, *, account_id: str, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -329,7 +323,7 @@ def get( bucket_name: Name of the bucket - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -344,9 +338,7 @@ def get( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return self._get( @@ -409,7 +401,7 @@ async def create( name: str, location_hint: Literal["apac", "eeur", "enam", "weur", "wnam"] | NotGiven = NOT_GIVEN, storage_class: Literal["Standard", "InfrequentAccess"] | NotGiven = NOT_GIVEN, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -429,7 +421,7 @@ async def create( storage_class: Storage class for newly uploaded objects, unless specified otherwise. - cf_r2_jurisdiction: Creates the bucket in the provided jurisdiction + jurisdiction: Creates the bucket in the provided jurisdiction extra_headers: Send extra headers @@ -442,9 +434,7 @@ async def create( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return await self._post( @@ -477,7 +467,7 @@ async def list( order: Literal["name"] | NotGiven = NOT_GIVEN, per_page: float | NotGiven = NOT_GIVEN, start_after: str | NotGiven = NOT_GIVEN, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -505,7 +495,7 @@ async def list( start_after: Bucket name to start searching after. Buckets are ordered lexicographically. - cf_r2_jurisdiction: Lists buckets in the provided jurisdiction + jurisdiction: Lists buckets in the provided jurisdiction extra_headers: Send extra headers @@ -518,9 +508,7 @@ async def list( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return await self._get( @@ -551,7 +539,7 @@ async def delete( bucket_name: str, *, account_id: str, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -567,7 +555,7 @@ async def delete( bucket_name: Name of the bucket - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -582,9 +570,7 @@ async def delete( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return await self._delete( @@ -604,7 +590,7 @@ async def get( bucket_name: str, *, account_id: str, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -620,7 +606,7 @@ async def get( bucket_name: Name of the bucket - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -635,9 +621,7 @@ async def get( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return await self._get( diff --git a/src/cloudflare/resources/r2/buckets/cors.py b/src/cloudflare/resources/r2/buckets/cors.py index b028f6feec6..e56363fc759 100644 --- a/src/cloudflare/resources/r2/buckets/cors.py +++ b/src/cloudflare/resources/r2/buckets/cors.py @@ -56,7 +56,7 @@ def update( *, account_id: str, rules: Iterable[cors_update_params.Rule] | NotGiven = NOT_GIVEN, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -72,7 +72,7 @@ def update( bucket_name: Name of the bucket - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -87,9 +87,7 @@ def update( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return self._put( @@ -110,7 +108,7 @@ def delete( bucket_name: str, *, account_id: str, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -126,7 +124,7 @@ def delete( bucket_name: Name of the bucket - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -141,9 +139,7 @@ def delete( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return self._delete( @@ -163,7 +159,7 @@ def get( bucket_name: str, *, account_id: str, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -179,7 +175,7 @@ def get( bucket_name: Name of the bucket - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -194,9 +190,7 @@ def get( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return self._get( @@ -238,7 +232,7 @@ async def update( *, account_id: str, rules: Iterable[cors_update_params.Rule] | NotGiven = NOT_GIVEN, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -254,7 +248,7 @@ async def update( bucket_name: Name of the bucket - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -269,9 +263,7 @@ async def update( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return await self._put( @@ -292,7 +284,7 @@ async def delete( bucket_name: str, *, account_id: str, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -308,7 +300,7 @@ async def delete( bucket_name: Name of the bucket - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -323,9 +315,7 @@ async def delete( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return await self._delete( @@ -345,7 +335,7 @@ async def get( bucket_name: str, *, account_id: str, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -361,7 +351,7 @@ async def get( bucket_name: Name of the bucket - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -376,9 +366,7 @@ async def get( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return await self._get( diff --git a/src/cloudflare/resources/r2/buckets/domains/custom.py b/src/cloudflare/resources/r2/buckets/domains/custom.py index 34f2cac3387..9a0f624592e 100644 --- a/src/cloudflare/resources/r2/buckets/domains/custom.py +++ b/src/cloudflare/resources/r2/buckets/domains/custom.py @@ -63,7 +63,7 @@ def create( enabled: bool, zone_id: str, min_tls: Literal["1.0", "1.1", "1.2", "1.3"] | NotGiven = NOT_GIVEN, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -89,7 +89,7 @@ def create( min_tls: Minimum TLS Version the custom domain will accept for incoming connections. If not set, defaults to 1.0. - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -104,9 +104,7 @@ def create( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return self._post( @@ -138,7 +136,7 @@ def update( bucket_name: str, enabled: bool | NotGiven = NOT_GIVEN, min_tls: Literal["1.0", "1.1", "1.2", "1.3"] | NotGiven = NOT_GIVEN, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -161,7 +159,7 @@ def update( min_tls: Minimum TLS Version the custom domain will accept for incoming connections. If not set, defaults to previous value. - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -178,9 +176,7 @@ def update( if not domain_name: raise ValueError(f"Expected a non-empty value for `domain_name` but received {domain_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return self._put( @@ -207,7 +203,7 @@ def list( bucket_name: str, *, account_id: str, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -223,7 +219,7 @@ def list( bucket_name: Name of the bucket - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -238,9 +234,7 @@ def list( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return self._get( @@ -261,7 +255,7 @@ def delete( *, account_id: str, bucket_name: str, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -279,7 +273,7 @@ def delete( domain_name: Name of the custom domain - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -296,9 +290,7 @@ def delete( if not domain_name: raise ValueError(f"Expected a non-empty value for `domain_name` but received {domain_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return self._delete( @@ -319,7 +311,7 @@ def get( *, account_id: str, bucket_name: str, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -337,7 +329,7 @@ def get( domain_name: Name of the custom domain - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -354,9 +346,7 @@ def get( if not domain_name: raise ValueError(f"Expected a non-empty value for `domain_name` but received {domain_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return self._get( @@ -401,7 +391,7 @@ async def create( enabled: bool, zone_id: str, min_tls: Literal["1.0", "1.1", "1.2", "1.3"] | NotGiven = NOT_GIVEN, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -427,7 +417,7 @@ async def create( min_tls: Minimum TLS Version the custom domain will accept for incoming connections. If not set, defaults to 1.0. - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -442,9 +432,7 @@ async def create( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return await self._post( @@ -476,7 +464,7 @@ async def update( bucket_name: str, enabled: bool | NotGiven = NOT_GIVEN, min_tls: Literal["1.0", "1.1", "1.2", "1.3"] | NotGiven = NOT_GIVEN, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -499,7 +487,7 @@ async def update( min_tls: Minimum TLS Version the custom domain will accept for incoming connections. If not set, defaults to previous value. - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -516,9 +504,7 @@ async def update( if not domain_name: raise ValueError(f"Expected a non-empty value for `domain_name` but received {domain_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return await self._put( @@ -545,7 +531,7 @@ async def list( bucket_name: str, *, account_id: str, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -561,7 +547,7 @@ async def list( bucket_name: Name of the bucket - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -576,9 +562,7 @@ async def list( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return await self._get( @@ -599,7 +583,7 @@ async def delete( *, account_id: str, bucket_name: str, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -617,7 +601,7 @@ async def delete( domain_name: Name of the custom domain - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -634,9 +618,7 @@ async def delete( if not domain_name: raise ValueError(f"Expected a non-empty value for `domain_name` but received {domain_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return await self._delete( @@ -657,7 +639,7 @@ async def get( *, account_id: str, bucket_name: str, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -675,7 +657,7 @@ async def get( domain_name: Name of the custom domain - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -692,9 +674,7 @@ async def get( if not domain_name: raise ValueError(f"Expected a non-empty value for `domain_name` but received {domain_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return await self._get( diff --git a/src/cloudflare/resources/r2/buckets/domains/managed.py b/src/cloudflare/resources/r2/buckets/domains/managed.py index 2c0b2ee4fb3..132d316021b 100644 --- a/src/cloudflare/resources/r2/buckets/domains/managed.py +++ b/src/cloudflare/resources/r2/buckets/domains/managed.py @@ -57,7 +57,7 @@ def update( *, account_id: str, enabled: bool, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -75,7 +75,7 @@ def update( enabled: Whether to enable public bucket access at the r2.dev domain - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -90,9 +90,7 @@ def update( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return self._put( @@ -113,7 +111,7 @@ def list( bucket_name: str, *, account_id: str, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -129,7 +127,7 @@ def list( bucket_name: Name of the bucket - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -144,9 +142,7 @@ def list( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return self._get( @@ -188,7 +184,7 @@ async def update( *, account_id: str, enabled: bool, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -206,7 +202,7 @@ async def update( enabled: Whether to enable public bucket access at the r2.dev domain - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -221,9 +217,7 @@ async def update( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return await self._put( @@ -244,7 +238,7 @@ async def list( bucket_name: str, *, account_id: str, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -260,7 +254,7 @@ async def list( bucket_name: Name of the bucket - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -275,9 +269,7 @@ async def list( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return await self._get( diff --git a/src/cloudflare/resources/r2/buckets/event_notifications/configuration/configuration.py b/src/cloudflare/resources/r2/buckets/event_notifications/configuration/configuration.py index 8dbe0b4cb45..400051aa1a9 100644 --- a/src/cloudflare/resources/r2/buckets/event_notifications/configuration/configuration.py +++ b/src/cloudflare/resources/r2/buckets/event_notifications/configuration/configuration.py @@ -61,7 +61,7 @@ def get( bucket_name: str, *, account_id: str, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -77,7 +77,7 @@ def get( bucket_name: Name of the bucket - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -92,9 +92,7 @@ def get( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return self._get( @@ -139,7 +137,7 @@ async def get( bucket_name: str, *, account_id: str, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -155,7 +153,7 @@ async def get( bucket_name: Name of the bucket - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -170,9 +168,7 @@ async def get( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return await self._get( diff --git a/src/cloudflare/resources/r2/buckets/event_notifications/configuration/queues.py b/src/cloudflare/resources/r2/buckets/event_notifications/configuration/queues.py index 49728508268..3b58ade89b8 100644 --- a/src/cloudflare/resources/r2/buckets/event_notifications/configuration/queues.py +++ b/src/cloudflare/resources/r2/buckets/event_notifications/configuration/queues.py @@ -56,7 +56,7 @@ def update( account_id: str, bucket_name: str, rules: Iterable[queue_update_params.Rule] | NotGiven = NOT_GIVEN, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -76,7 +76,7 @@ def update( rules: Array of rules to drive notifications - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -93,9 +93,7 @@ def update( if not queue_id: raise ValueError(f"Expected a non-empty value for `queue_id` but received {queue_id!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return self._put( @@ -117,7 +115,7 @@ def delete( *, account_id: str, bucket_name: str, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -137,7 +135,7 @@ def delete( queue_id: Queue ID - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -154,9 +152,7 @@ def delete( if not queue_id: raise ValueError(f"Expected a non-empty value for `queue_id` but received {queue_id!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return self._delete( @@ -199,7 +195,7 @@ async def update( account_id: str, bucket_name: str, rules: Iterable[queue_update_params.Rule] | NotGiven = NOT_GIVEN, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -219,7 +215,7 @@ async def update( rules: Array of rules to drive notifications - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -236,9 +232,7 @@ async def update( if not queue_id: raise ValueError(f"Expected a non-empty value for `queue_id` but received {queue_id!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return await self._put( @@ -260,7 +254,7 @@ async def delete( *, account_id: str, bucket_name: str, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -280,7 +274,7 @@ async def delete( queue_id: Queue ID - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -297,9 +291,7 @@ async def delete( if not queue_id: raise ValueError(f"Expected a non-empty value for `queue_id` but received {queue_id!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return await self._delete( diff --git a/src/cloudflare/resources/r2/buckets/lifecycle.py b/src/cloudflare/resources/r2/buckets/lifecycle.py index 67fe0d0acad..96385460faf 100644 --- a/src/cloudflare/resources/r2/buckets/lifecycle.py +++ b/src/cloudflare/resources/r2/buckets/lifecycle.py @@ -56,7 +56,7 @@ def update( *, account_id: str, rules: Iterable[lifecycle_update_params.Rule] | NotGiven = NOT_GIVEN, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -72,7 +72,7 @@ def update( bucket_name: Name of the bucket - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -87,9 +87,7 @@ def update( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return self._put( @@ -110,7 +108,7 @@ def get( bucket_name: str, *, account_id: str, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -126,7 +124,7 @@ def get( bucket_name: Name of the bucket - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -141,9 +139,7 @@ def get( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return self._get( @@ -185,7 +181,7 @@ async def update( *, account_id: str, rules: Iterable[lifecycle_update_params.Rule] | NotGiven = NOT_GIVEN, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -201,7 +197,7 @@ async def update( bucket_name: Name of the bucket - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -216,9 +212,7 @@ async def update( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return await self._put( @@ -239,7 +233,7 @@ async def get( bucket_name: str, *, account_id: str, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -255,7 +249,7 @@ async def get( bucket_name: Name of the bucket - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -270,9 +264,7 @@ async def get( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return await self._get( diff --git a/src/cloudflare/resources/r2/buckets/sippy.py b/src/cloudflare/resources/r2/buckets/sippy.py index a8a434f7fdd..ef325b0ef87 100644 --- a/src/cloudflare/resources/r2/buckets/sippy.py +++ b/src/cloudflare/resources/r2/buckets/sippy.py @@ -60,7 +60,7 @@ def update( account_id: str, destination: sippy_update_params.R2EnableSippyAwsDestination | NotGiven = NOT_GIVEN, source: sippy_update_params.R2EnableSippyAwsSource | NotGiven = NOT_GIVEN, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -80,7 +80,7 @@ def update( source: AWS S3 bucket to copy objects from - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -100,7 +100,7 @@ def update( account_id: str, destination: sippy_update_params.R2EnableSippyGcsDestination | NotGiven = NOT_GIVEN, source: sippy_update_params.R2EnableSippyGcsSource | NotGiven = NOT_GIVEN, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -120,7 +120,7 @@ def update( source: GCS bucket to copy objects from - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -142,7 +142,7 @@ def update( source: sippy_update_params.R2EnableSippyAwsSource | sippy_update_params.R2EnableSippyGcsSource | NotGiven = NOT_GIVEN, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -155,9 +155,7 @@ def update( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return self._put( @@ -184,7 +182,7 @@ def delete( bucket_name: str, *, account_id: str, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -200,7 +198,7 @@ def delete( bucket_name: Name of the bucket - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -215,9 +213,7 @@ def delete( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return self._delete( @@ -237,7 +233,7 @@ def get( bucket_name: str, *, account_id: str, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -253,7 +249,7 @@ def get( bucket_name: Name of the bucket - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -268,9 +264,7 @@ def get( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return self._get( @@ -314,7 +308,7 @@ async def update( account_id: str, destination: sippy_update_params.R2EnableSippyAwsDestination | NotGiven = NOT_GIVEN, source: sippy_update_params.R2EnableSippyAwsSource | NotGiven = NOT_GIVEN, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -334,7 +328,7 @@ async def update( source: AWS S3 bucket to copy objects from - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -354,7 +348,7 @@ async def update( account_id: str, destination: sippy_update_params.R2EnableSippyGcsDestination | NotGiven = NOT_GIVEN, source: sippy_update_params.R2EnableSippyGcsSource | NotGiven = NOT_GIVEN, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -374,7 +368,7 @@ async def update( source: GCS bucket to copy objects from - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -396,7 +390,7 @@ async def update( source: sippy_update_params.R2EnableSippyAwsSource | sippy_update_params.R2EnableSippyGcsSource | NotGiven = NOT_GIVEN, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -409,9 +403,7 @@ async def update( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return await self._put( @@ -438,7 +430,7 @@ async def delete( bucket_name: str, *, account_id: str, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -454,7 +446,7 @@ async def delete( bucket_name: Name of the bucket - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -469,9 +461,7 @@ async def delete( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return await self._delete( @@ -491,7 +481,7 @@ async def get( bucket_name: str, *, account_id: str, - cf_r2_jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -507,7 +497,7 @@ async def get( bucket_name: Name of the bucket - cf_r2_jurisdiction: The bucket jurisdiction + jurisdiction: The bucket jurisdiction extra_headers: Send extra headers @@ -522,9 +512,7 @@ async def get( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given( - {"cf-r2-jurisdiction": str(cf_r2_jurisdiction) if is_given(cf_r2_jurisdiction) else NOT_GIVEN} - ), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), **(extra_headers or {}), } return await self._get( diff --git a/src/cloudflare/resources/radar/ai/bots/summary.py b/src/cloudflare/resources/radar/ai/bots/summary.py index f1cf1315778..e8a1c0a005a 100644 --- a/src/cloudflare/resources/radar/ai/bots/summary.py +++ b/src/cloudflare/resources/radar/ai/bots/summary.py @@ -58,6 +58,7 @@ def user_agent( date_range: List[str] | NotGiven = NOT_GIVEN, date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -90,6 +91,9 @@ def user_agent( format: Format results are returned in. + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -119,6 +123,7 @@ def user_agent( "date_range": date_range, "date_start": date_start, "format": format, + "limit_per_group": limit_per_group, "location": location, "name": name, }, @@ -159,6 +164,7 @@ async def user_agent( date_range: List[str] | NotGiven = NOT_GIVEN, date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -191,6 +197,9 @@ async def user_agent( format: Format results are returned in. + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -220,6 +229,7 @@ async def user_agent( "date_range": date_range, "date_start": date_start, "format": format, + "limit_per_group": limit_per_group, "location": location, "name": name, }, diff --git a/src/cloudflare/resources/radar/as112/summary.py b/src/cloudflare/resources/radar/as112/summary.py index 34d4b1676a6..64f1fa64f29 100644 --- a/src/cloudflare/resources/radar/as112/summary.py +++ b/src/cloudflare/resources/radar/as112/summary.py @@ -386,6 +386,7 @@ def query_type( date_range: List[str] | NotGiven = NOT_GIVEN, date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -417,6 +418,9 @@ def query_type( format: Format results are returned in. + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -446,6 +450,7 @@ def query_type( "date_range": date_range, "date_start": date_start, "format": format, + "limit_per_group": limit_per_group, "location": location, "name": name, }, @@ -465,6 +470,7 @@ def response_codes( date_range: List[str] | NotGiven = NOT_GIVEN, date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -496,6 +502,9 @@ def response_codes( format: Format results are returned in. + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -525,6 +534,7 @@ def response_codes( "date_range": date_range, "date_start": date_start, "format": format, + "limit_per_group": limit_per_group, "location": location, "name": name, }, @@ -881,6 +891,7 @@ async def query_type( date_range: List[str] | NotGiven = NOT_GIVEN, date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -912,6 +923,9 @@ async def query_type( format: Format results are returned in. + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -941,6 +955,7 @@ async def query_type( "date_range": date_range, "date_start": date_start, "format": format, + "limit_per_group": limit_per_group, "location": location, "name": name, }, @@ -960,6 +975,7 @@ async def response_codes( date_range: List[str] | NotGiven = NOT_GIVEN, date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -991,6 +1007,9 @@ async def response_codes( format: Format results are returned in. + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -1020,6 +1039,7 @@ async def response_codes( "date_range": date_range, "date_start": date_start, "format": format, + "limit_per_group": limit_per_group, "location": location, "name": name, }, diff --git a/src/cloudflare/resources/radar/as112/timeseries_groups.py b/src/cloudflare/resources/radar/as112/timeseries_groups.py index 00695c14157..4571879b766 100644 --- a/src/cloudflare/resources/radar/as112/timeseries_groups.py +++ b/src/cloudflare/resources/radar/as112/timeseries_groups.py @@ -411,6 +411,7 @@ def query_type( date_range: List[str] | NotGiven = NOT_GIVEN, date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -446,6 +447,9 @@ def query_type( format: Format results are returned in. + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -476,6 +480,7 @@ def query_type( "date_range": date_range, "date_start": date_start, "format": format, + "limit_per_group": limit_per_group, "location": location, "name": name, }, @@ -496,6 +501,7 @@ def response_codes( date_range: List[str] | NotGiven = NOT_GIVEN, date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -532,6 +538,9 @@ def response_codes( format: Format results are returned in. + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -562,6 +571,7 @@ def response_codes( "date_range": date_range, "date_start": date_start, "format": format, + "limit_per_group": limit_per_group, "location": location, "name": name, }, @@ -945,6 +955,7 @@ async def query_type( date_range: List[str] | NotGiven = NOT_GIVEN, date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -980,6 +991,9 @@ async def query_type( format: Format results are returned in. + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -1010,6 +1024,7 @@ async def query_type( "date_range": date_range, "date_start": date_start, "format": format, + "limit_per_group": limit_per_group, "location": location, "name": name, }, @@ -1030,6 +1045,7 @@ async def response_codes( date_range: List[str] | NotGiven = NOT_GIVEN, date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1066,6 +1082,9 @@ async def response_codes( format: Format results are returned in. + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -1096,6 +1115,7 @@ async def response_codes( "date_range": date_range, "date_start": date_start, "format": format, + "limit_per_group": limit_per_group, "location": location, "name": name, }, diff --git a/src/cloudflare/resources/radar/attacks/layer3/summary.py b/src/cloudflare/resources/radar/attacks/layer3/summary.py index 0e6843b6167..b4f5c7853cc 100644 --- a/src/cloudflare/resources/radar/attacks/layer3/summary.py +++ b/src/cloudflare/resources/radar/attacks/layer3/summary.py @@ -487,6 +487,7 @@ def vector( direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, @@ -520,6 +521,9 @@ def vector( ip_version: Filter for ip version. + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -552,6 +556,7 @@ def vector( "direction": direction, "format": format, "ip_version": ip_version, + "limit_per_group": limit_per_group, "location": location, "name": name, "protocol": protocol, @@ -1010,6 +1015,7 @@ async def vector( direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, @@ -1043,6 +1049,9 @@ async def vector( ip_version: Filter for ip version. + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -1075,6 +1084,7 @@ async def vector( "direction": direction, "format": format, "ip_version": ip_version, + "limit_per_group": limit_per_group, "location": location, "name": name, "protocol": protocol, diff --git a/src/cloudflare/resources/radar/attacks/layer7/summary.py b/src/cloudflare/resources/radar/attacks/layer7/summary.py index 2dd6c303e25..69a23e0ced4 100644 --- a/src/cloudflare/resources/radar/attacks/layer7/summary.py +++ b/src/cloudflare/resources/radar/attacks/layer7/summary.py @@ -151,6 +151,7 @@ def http_method( format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, mitigation_product: List[ Literal[ @@ -192,6 +193,9 @@ def http_method( ip_version: Filter for ip version. + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -225,6 +229,7 @@ def http_method( "format": format, "http_version": http_version, "ip_version": ip_version, + "limit_per_group": limit_per_group, "location": location, "mitigation_product": mitigation_product, "name": name, @@ -590,6 +595,7 @@ def managed_rules( | NotGiven = NOT_GIVEN, http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, mitigation_product: List[ Literal[ @@ -633,6 +639,9 @@ def managed_rules( ip_version: Filter for ip version. + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -667,6 +676,7 @@ def managed_rules( "http_method": http_method, "http_version": http_version, "ip_version": ip_version, + "limit_per_group": limit_per_group, "location": location, "mitigation_product": mitigation_product, "name": name, @@ -740,6 +750,7 @@ def mitigation_product( | NotGiven = NOT_GIVEN, http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -777,6 +788,9 @@ def mitigation_product( ip_version: Filter for ip version. + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -809,6 +823,7 @@ def mitigation_product( "http_method": http_method, "http_version": http_version, "ip_version": ip_version, + "limit_per_group": limit_per_group, "location": location, "name": name, }, @@ -930,6 +945,7 @@ async def http_method( format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, mitigation_product: List[ Literal[ @@ -971,6 +987,9 @@ async def http_method( ip_version: Filter for ip version. + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -1004,6 +1023,7 @@ async def http_method( "format": format, "http_version": http_version, "ip_version": ip_version, + "limit_per_group": limit_per_group, "location": location, "mitigation_product": mitigation_product, "name": name, @@ -1369,6 +1389,7 @@ async def managed_rules( | NotGiven = NOT_GIVEN, http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, mitigation_product: List[ Literal[ @@ -1412,6 +1433,9 @@ async def managed_rules( ip_version: Filter for ip version. + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -1446,6 +1470,7 @@ async def managed_rules( "http_method": http_method, "http_version": http_version, "ip_version": ip_version, + "limit_per_group": limit_per_group, "location": location, "mitigation_product": mitigation_product, "name": name, @@ -1519,6 +1544,7 @@ async def mitigation_product( | NotGiven = NOT_GIVEN, http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1556,6 +1582,9 @@ async def mitigation_product( ip_version: Filter for ip version. + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -1588,6 +1617,7 @@ async def mitigation_product( "http_method": http_method, "http_version": http_version, "ip_version": ip_version, + "limit_per_group": limit_per_group, "location": location, "name": name, }, diff --git a/src/cloudflare/resources/radar/attacks/layer7/timeseries_groups.py b/src/cloudflare/resources/radar/attacks/layer7/timeseries_groups.py index 864e7659cde..e57361ae51c 100644 --- a/src/cloudflare/resources/radar/attacks/layer7/timeseries_groups.py +++ b/src/cloudflare/resources/radar/attacks/layer7/timeseries_groups.py @@ -164,6 +164,7 @@ def http_method( format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, mitigation_product: List[ Literal[ @@ -210,6 +211,9 @@ def http_method( ip_version: Filter for ip version. + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -247,6 +251,7 @@ def http_method( "format": format, "http_version": http_version, "ip_version": ip_version, + "limit_per_group": limit_per_group, "location": location, "mitigation_product": mitigation_product, "name": name, @@ -802,6 +807,7 @@ def managed_rules( | NotGiven = NOT_GIVEN, http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, mitigation_product: List[ Literal[ @@ -850,6 +856,9 @@ def managed_rules( ip_version: Filter for ip version. + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -888,6 +897,7 @@ def managed_rules( "http_method": http_method, "http_version": http_version, "ip_version": ip_version, + "limit_per_group": limit_per_group, "location": location, "mitigation_product": mitigation_product, "name": name, @@ -963,6 +973,7 @@ def mitigation_product( | NotGiven = NOT_GIVEN, http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, normalization: Literal["PERCENTAGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, @@ -1005,6 +1016,9 @@ def mitigation_product( ip_version: Filter for ip version. + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -1041,6 +1055,7 @@ def mitigation_product( "http_method": http_method, "http_version": http_version, "ip_version": ip_version, + "limit_per_group": limit_per_group, "location": location, "name": name, "normalization": normalization, @@ -1338,6 +1353,7 @@ async def http_method( format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, mitigation_product: List[ Literal[ @@ -1384,6 +1400,9 @@ async def http_method( ip_version: Filter for ip version. + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -1421,6 +1440,7 @@ async def http_method( "format": format, "http_version": http_version, "ip_version": ip_version, + "limit_per_group": limit_per_group, "location": location, "mitigation_product": mitigation_product, "name": name, @@ -1976,6 +1996,7 @@ async def managed_rules( | NotGiven = NOT_GIVEN, http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, mitigation_product: List[ Literal[ @@ -2024,6 +2045,9 @@ async def managed_rules( ip_version: Filter for ip version. + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -2062,6 +2086,7 @@ async def managed_rules( "http_method": http_method, "http_version": http_version, "ip_version": ip_version, + "limit_per_group": limit_per_group, "location": location, "mitigation_product": mitigation_product, "name": name, @@ -2137,6 +2162,7 @@ async def mitigation_product( | NotGiven = NOT_GIVEN, http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, normalization: Literal["PERCENTAGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, @@ -2179,6 +2205,9 @@ async def mitigation_product( ip_version: Filter for ip version. + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -2215,6 +2244,7 @@ async def mitigation_product( "http_method": http_method, "http_version": http_version, "ip_version": ip_version, + "limit_per_group": limit_per_group, "location": location, "name": name, "normalization": normalization, diff --git a/src/cloudflare/resources/radar/http/timeseries_groups.py b/src/cloudflare/resources/radar/http/timeseries_groups.py index d4c1800e0c5..1b1a6da94db 100644 --- a/src/cloudflare/resources/radar/http/timeseries_groups.py +++ b/src/cloudflare/resources/radar/http/timeseries_groups.py @@ -318,6 +318,7 @@ def browser_family( http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] @@ -368,6 +369,9 @@ def browser_family( ip_version: Filter for ip version. + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -407,6 +411,7 @@ def browser_family( "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, + "limit_per_group": limit_per_group, "location": location, "name": name, "os": os, @@ -1474,6 +1479,7 @@ async def browser_family( http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] @@ -1524,6 +1530,9 @@ async def browser_family( ip_version: Filter for ip version. + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -1563,6 +1572,7 @@ async def browser_family( "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, + "limit_per_group": limit_per_group, "location": location, "name": name, "os": os, diff --git a/src/cloudflare/resources/radar/ranking/domain.py b/src/cloudflare/resources/radar/ranking/domain.py index 60ea7cf7f98..1c2e3a87f4f 100644 --- a/src/cloudflare/resources/radar/ranking/domain.py +++ b/src/cloudflare/resources/radar/ranking/domain.py @@ -2,7 +2,8 @@ from __future__ import annotations -from typing import List, Type, cast +from typing import List, Type, Union, cast +from datetime import date from typing_extensions import Literal import httpx @@ -52,8 +53,9 @@ def get( self, domain: str, *, - date: List[str] | NotGiven = NOT_GIVEN, + date: List[Union[str, date]] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + include_top_locations: bool | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, ranking_type: Literal["POPULAR", "TRENDING_RISE", "TRENDING_STEADY"] | NotGiven = NOT_GIVEN, @@ -76,6 +78,8 @@ def get( format: Format results are returned in. + include_top_locations: Include top locations in the response. + limit: Limit the number of objects in the response. name: Array of names that will be used to name the series in responses. @@ -103,6 +107,7 @@ def get( { "date": date, "format": format, + "include_top_locations": include_top_locations, "limit": limit, "name": name, "ranking_type": ranking_type, @@ -139,8 +144,9 @@ async def get( self, domain: str, *, - date: List[str] | NotGiven = NOT_GIVEN, + date: List[Union[str, date]] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + include_top_locations: bool | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, ranking_type: Literal["POPULAR", "TRENDING_RISE", "TRENDING_STEADY"] | NotGiven = NOT_GIVEN, @@ -163,6 +169,8 @@ async def get( format: Format results are returned in. + include_top_locations: Include top locations in the response. + limit: Limit the number of objects in the response. name: Array of names that will be used to name the series in responses. @@ -190,6 +198,7 @@ async def get( { "date": date, "format": format, + "include_top_locations": include_top_locations, "limit": limit, "name": name, "ranking_type": ranking_type, diff --git a/src/cloudflare/resources/radar/ranking/ranking.py b/src/cloudflare/resources/radar/ranking/ranking.py index d3b371159c1..86136d7ad46 100644 --- a/src/cloudflare/resources/radar/ranking/ranking.py +++ b/src/cloudflare/resources/radar/ranking/ranking.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List, Type, Union, cast -from datetime import datetime +from datetime import date, datetime from typing_extensions import Literal import httpx @@ -143,7 +143,7 @@ def timeseries_groups( def top( self, *, - date: List[str] | NotGiven = NOT_GIVEN, + date: List[Union[str, date]] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, @@ -313,7 +313,7 @@ async def timeseries_groups( async def top( self, *, - date: List[str] | NotGiven = NOT_GIVEN, + date: List[Union[str, date]] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, diff --git a/src/cloudflare/resources/rules/lists/items.py b/src/cloudflare/resources/rules/lists/items.py index dbe7c34c9b9..6245c7c21ce 100644 --- a/src/cloudflare/resources/rules/lists/items.py +++ b/src/cloudflare/resources/rules/lists/items.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, Type, Iterable, cast +from typing import Type, Iterable, cast import httpx @@ -219,7 +219,7 @@ def list( item_list_params.ItemListParams, ), ), - model=cast(Any, ItemListResponse), # Union types cannot be passed in as arguments in the type system + model=ItemListResponse, ) def delete( @@ -308,21 +308,16 @@ def get( raise ValueError(f"Expected a non-empty value for `list_id` but received {list_id!r}") if not item_id: raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}") - return cast( - ItemGetResponse, - self._get( - f"/accounts/{account_identifier}/rules/lists/{list_id}/items/{item_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ItemGetResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[ItemGetResponse] - ), # Union types cannot be passed in as arguments in the type system + return self._get( + f"/accounts/{account_identifier}/rules/lists/{list_id}/items/{item_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ItemGetResponse]._unwrapper, ), + cast_to=cast(Type[ItemGetResponse], ResultWrapper[ItemGetResponse]), ) @@ -513,7 +508,7 @@ def list( item_list_params.ItemListParams, ), ), - model=cast(Any, ItemListResponse), # Union types cannot be passed in as arguments in the type system + model=ItemListResponse, ) async def delete( @@ -602,21 +597,16 @@ async def get( raise ValueError(f"Expected a non-empty value for `list_id` but received {list_id!r}") if not item_id: raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}") - return cast( - ItemGetResponse, - await self._get( - f"/accounts/{account_identifier}/rules/lists/{list_id}/items/{item_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ItemGetResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[ItemGetResponse] - ), # Union types cannot be passed in as arguments in the type system + return await self._get( + f"/accounts/{account_identifier}/rules/lists/{list_id}/items/{item_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ItemGetResponse]._unwrapper, ), + cast_to=cast(Type[ItemGetResponse], ResultWrapper[ItemGetResponse]), ) diff --git a/src/cloudflare/resources/url_normalization.py b/src/cloudflare/resources/url_normalization.py index 3fff83e46ad..87bab9c625e 100644 --- a/src/cloudflare/resources/url_normalization.py +++ b/src/cloudflare/resources/url_normalization.py @@ -2,9 +2,12 @@ from __future__ import annotations +from typing import Type, cast +from typing_extensions import Literal + import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven from .._utils import ( maybe_transform, async_maybe_transform, @@ -17,6 +20,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) +from .._wrappers import ResultWrapper from .._base_client import make_request_options from ..types.url_normalization import url_normalization_update_params from ..types.url_normalization.url_normalization_get_response import URLNormalizationGetResponse @@ -49,8 +53,8 @@ def update( self, *, zone_id: str, - scope: str | NotGiven = NOT_GIVEN, - type: str | NotGiven = NOT_GIVEN, + scope: Literal["incoming", "both"], + type: Literal["cloudflare", "rfc3986"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -59,10 +63,10 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> URLNormalizationUpdateResponse: """ - Updates the URL normalization settings. + Updates the URL Normalization settings. Args: - zone_id: Identifier + zone_id: The unique ID of the zone. scope: The scope of the URL normalization. @@ -87,10 +91,50 @@ def update( }, url_normalization_update_params.URLNormalizationUpdateParams, ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[URLNormalizationUpdateResponse]._unwrapper, + ), + cast_to=cast(Type[URLNormalizationUpdateResponse], ResultWrapper[URLNormalizationUpdateResponse]), + ) + + def delete( + self, + *, + zone_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> None: + """ + Deletes the URL Normalization settings. + + Args: + zone_id: The unique ID of the zone. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return self._delete( + f"/zones/{zone_id}/url_normalization", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=URLNormalizationUpdateResponse, + cast_to=NoneType, ) def get( @@ -105,10 +149,10 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> URLNormalizationGetResponse: """ - Fetches the current URL normalization settings. + Fetches the current URL Normalization settings. Args: - zone_id: Identifier + zone_id: The unique ID of the zone. extra_headers: Send extra headers @@ -123,9 +167,13 @@ def get( return self._get( f"/zones/{zone_id}/url_normalization", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[URLNormalizationGetResponse]._unwrapper, ), - cast_to=URLNormalizationGetResponse, + cast_to=cast(Type[URLNormalizationGetResponse], ResultWrapper[URLNormalizationGetResponse]), ) @@ -153,8 +201,8 @@ async def update( self, *, zone_id: str, - scope: str | NotGiven = NOT_GIVEN, - type: str | NotGiven = NOT_GIVEN, + scope: Literal["incoming", "both"], + type: Literal["cloudflare", "rfc3986"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -163,10 +211,10 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> URLNormalizationUpdateResponse: """ - Updates the URL normalization settings. + Updates the URL Normalization settings. Args: - zone_id: Identifier + zone_id: The unique ID of the zone. scope: The scope of the URL normalization. @@ -191,10 +239,50 @@ async def update( }, url_normalization_update_params.URLNormalizationUpdateParams, ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[URLNormalizationUpdateResponse]._unwrapper, + ), + cast_to=cast(Type[URLNormalizationUpdateResponse], ResultWrapper[URLNormalizationUpdateResponse]), + ) + + async def delete( + self, + *, + zone_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> None: + """ + Deletes the URL Normalization settings. + + Args: + zone_id: The unique ID of the zone. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return await self._delete( + f"/zones/{zone_id}/url_normalization", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=URLNormalizationUpdateResponse, + cast_to=NoneType, ) async def get( @@ -209,10 +297,10 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> URLNormalizationGetResponse: """ - Fetches the current URL normalization settings. + Fetches the current URL Normalization settings. Args: - zone_id: Identifier + zone_id: The unique ID of the zone. extra_headers: Send extra headers @@ -227,9 +315,13 @@ async def get( return await self._get( f"/zones/{zone_id}/url_normalization", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[URLNormalizationGetResponse]._unwrapper, ), - cast_to=URLNormalizationGetResponse, + cast_to=cast(Type[URLNormalizationGetResponse], ResultWrapper[URLNormalizationGetResponse]), ) @@ -240,6 +332,9 @@ def __init__(self, url_normalization: URLNormalizationResource) -> None: self.update = to_raw_response_wrapper( url_normalization.update, ) + self.delete = to_raw_response_wrapper( + url_normalization.delete, + ) self.get = to_raw_response_wrapper( url_normalization.get, ) @@ -252,6 +347,9 @@ def __init__(self, url_normalization: AsyncURLNormalizationResource) -> None: self.update = async_to_raw_response_wrapper( url_normalization.update, ) + self.delete = async_to_raw_response_wrapper( + url_normalization.delete, + ) self.get = async_to_raw_response_wrapper( url_normalization.get, ) @@ -264,6 +362,9 @@ def __init__(self, url_normalization: URLNormalizationResource) -> None: self.update = to_streamed_response_wrapper( url_normalization.update, ) + self.delete = to_streamed_response_wrapper( + url_normalization.delete, + ) self.get = to_streamed_response_wrapper( url_normalization.get, ) @@ -276,6 +377,9 @@ def __init__(self, url_normalization: AsyncURLNormalizationResource) -> None: self.update = async_to_streamed_response_wrapper( url_normalization.update, ) + self.delete = async_to_streamed_response_wrapper( + url_normalization.delete, + ) self.get = async_to_streamed_response_wrapper( url_normalization.get, ) diff --git a/src/cloudflare/resources/url_scanner/responses.py b/src/cloudflare/resources/url_scanner/responses.py index cc0beef4e57..322e44344bc 100644 --- a/src/cloudflare/resources/url_scanner/responses.py +++ b/src/cloudflare/resources/url_scanner/responses.py @@ -56,7 +56,7 @@ def get( will be returned. Args: - account_id: Account Id. + account_id: Account ID. response_id: Response hash. @@ -120,7 +120,7 @@ async def get( will be returned. Args: - account_id: Account Id. + account_id: Account ID. response_id: Response hash. diff --git a/src/cloudflare/resources/url_scanner/scans.py b/src/cloudflare/resources/url_scanner/scans.py index a060414acce..dc22dbddda8 100644 --- a/src/cloudflare/resources/url_scanner/scans.py +++ b/src/cloudflare/resources/url_scanner/scans.py @@ -62,8 +62,8 @@ def with_streaming_response(self) -> ScansResourceWithStreamingResponse: def create( self, - account_id: str, *, + account_id: str, url: str, customagent: str | NotGiven = NOT_GIVEN, custom_headers: Dict[str, str] | NotGiven = NOT_GIVEN, @@ -83,7 +83,7 @@ def create( https://developers.cloudflare.com/security-center/investigate/scan-limits/. Args: - account_id: Account Id. + account_id: Account ID. custom_headers: Set custom headers. @@ -130,8 +130,8 @@ def create( def list( self, - account_id: str, *, + account_id: str, q: str | NotGiven = NOT_GIVEN, size: int | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -155,7 +155,7 @@ def list( with the given hash was downloaded. Args: - account_id: Account Id. + account_id: Account ID. q: Filter scans @@ -191,8 +191,8 @@ def list( def bulk_create( self, - account_id: str, *, + account_id: str, body: Iterable[scan_bulk_create_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -209,7 +209,7 @@ def bulk_create( longer to finish. Args: - account_id: Account Id. + account_id: Account ID. body: List of urls to scan (up to a 100). @@ -249,9 +249,9 @@ def dom( Chrome. Args: - account_id: Account Id. + account_id: Account ID. - scan_id: Scan uuid. + scan_id: Scan UUID. extra_headers: Send extra headers @@ -290,9 +290,9 @@ def get( Get URL scan by uuid Args: - account_id: Account Id. + account_id: Account ID. - scan_id: Scan uuid. + scan_id: Scan UUID. extra_headers: Send extra headers @@ -332,9 +332,9 @@ def har( http://www.softwareishard.com/blog/har-12-spec/. Args: - account_id: Account Id. + account_id: Account ID. - scan_id: Scan uuid. + scan_id: Scan UUID. extra_headers: Send extra headers @@ -373,9 +373,9 @@ def screenshot( Get scan's screenshot by resolution (desktop/mobile/tablet). Args: - account_id: Account Id. + account_id: Account ID. - scan_id: Scan uuid. + scan_id: Scan UUID. resolution: Target device type. @@ -427,8 +427,8 @@ def with_streaming_response(self) -> AsyncScansResourceWithStreamingResponse: async def create( self, - account_id: str, *, + account_id: str, url: str, customagent: str | NotGiven = NOT_GIVEN, custom_headers: Dict[str, str] | NotGiven = NOT_GIVEN, @@ -448,7 +448,7 @@ async def create( https://developers.cloudflare.com/security-center/investigate/scan-limits/. Args: - account_id: Account Id. + account_id: Account ID. custom_headers: Set custom headers. @@ -495,8 +495,8 @@ async def create( async def list( self, - account_id: str, *, + account_id: str, q: str | NotGiven = NOT_GIVEN, size: int | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -520,7 +520,7 @@ async def list( with the given hash was downloaded. Args: - account_id: Account Id. + account_id: Account ID. q: Filter scans @@ -556,8 +556,8 @@ async def list( async def bulk_create( self, - account_id: str, *, + account_id: str, body: Iterable[scan_bulk_create_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -574,7 +574,7 @@ async def bulk_create( longer to finish. Args: - account_id: Account Id. + account_id: Account ID. body: List of urls to scan (up to a 100). @@ -614,9 +614,9 @@ async def dom( Chrome. Args: - account_id: Account Id. + account_id: Account ID. - scan_id: Scan uuid. + scan_id: Scan UUID. extra_headers: Send extra headers @@ -655,9 +655,9 @@ async def get( Get URL scan by uuid Args: - account_id: Account Id. + account_id: Account ID. - scan_id: Scan uuid. + scan_id: Scan UUID. extra_headers: Send extra headers @@ -697,9 +697,9 @@ async def har( http://www.softwareishard.com/blog/har-12-spec/. Args: - account_id: Account Id. + account_id: Account ID. - scan_id: Scan uuid. + scan_id: Scan UUID. extra_headers: Send extra headers @@ -738,9 +738,9 @@ async def screenshot( Get scan's screenshot by resolution (desktop/mobile/tablet). Args: - account_id: Account Id. + account_id: Account ID. - scan_id: Scan uuid. + scan_id: Scan UUID. resolution: Target device type. diff --git a/src/cloudflare/resources/vectorize/indexes/indexes.py b/src/cloudflare/resources/vectorize/indexes/indexes.py index c6529e277b6..f0f19510cce 100644 --- a/src/cloudflare/resources/vectorize/indexes/indexes.py +++ b/src/cloudflare/resources/vectorize/indexes/indexes.py @@ -175,7 +175,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> IndexDeleteResponse: + ) -> Optional[IndexDeleteResponse]: """ Deletes the specified Vectorize Index. @@ -195,7 +195,7 @@ def delete( if not index_name: raise ValueError(f"Expected a non-empty value for `index_name` but received {index_name!r}") return cast( - IndexDeleteResponse, + Optional[IndexDeleteResponse], self._delete( f"/accounts/{account_id}/vectorize/v2/indexes/{index_name}", options=make_request_options( @@ -203,7 +203,7 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[IndexDeleteResponse]._unwrapper, + post_parser=ResultWrapper[Optional[IndexDeleteResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[IndexDeleteResponse] @@ -687,7 +687,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> IndexDeleteResponse: + ) -> Optional[IndexDeleteResponse]: """ Deletes the specified Vectorize Index. @@ -707,7 +707,7 @@ async def delete( if not index_name: raise ValueError(f"Expected a non-empty value for `index_name` but received {index_name!r}") return cast( - IndexDeleteResponse, + Optional[IndexDeleteResponse], await self._delete( f"/accounts/{account_id}/vectorize/v2/indexes/{index_name}", options=make_request_options( @@ -715,7 +715,7 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[IndexDeleteResponse]._unwrapper, + post_parser=ResultWrapper[Optional[IndexDeleteResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[IndexDeleteResponse] diff --git a/src/cloudflare/resources/waiting_rooms/waiting_rooms.py b/src/cloudflare/resources/waiting_rooms/waiting_rooms.py index a7a4308e856..4b9c83a3687 100644 --- a/src/cloudflare/resources/waiting_rooms/waiting_rooms.py +++ b/src/cloudflare/resources/waiting_rooms/waiting_rooms.py @@ -180,6 +180,9 @@ def create( queueing_status_code: Literal[200, 202, 429] | NotGiven = NOT_GIVEN, session_duration: int | NotGiven = NOT_GIVEN, suspended: bool | NotGiven = NOT_GIVEN, + turnstile_action: Literal["log", "infinite_queue"] | NotGiven = NOT_GIVEN, + turnstile_mode: Literal["off", "invisible", "visible_non_interactive", "visible_managed"] + | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -451,6 +454,18 @@ def create( suspended: Suspends or allows traffic going to the waiting room. If set to `true`, the traffic will not go to the waiting room. + turnstile_action: Which action to take when a bot is detected using Turnstile. `log` will have no + impact on queueing behavior, simply keeping track of how many bots are detected + in Waiting Room Analytics. `infinite_queue` will send bots to a false queueing + state, where they will never reach your origin. `infinite_queue` requires + Advanced Waiting Room. + + turnstile_mode: Which Turnstile widget type to use for detecting bot traffic. See + [the Turnstile documentation](https://developers.cloudflare.com/turnstile/concepts/widget/#widget-types) + for the definitions of these widget types. Set to `off` to disable the Turnstile + integration entirely. Setting this to anything other than `off` or `invisible` + requires Advanced Waiting Room. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -484,6 +499,8 @@ def create( "queueing_status_code": queueing_status_code, "session_duration": session_duration, "suspended": suspended, + "turnstile_action": turnstile_action, + "turnstile_mode": turnstile_mode, }, waiting_room_create_params.WaitingRoomCreateParams, ), @@ -561,6 +578,9 @@ def update( queueing_status_code: Literal[200, 202, 429] | NotGiven = NOT_GIVEN, session_duration: int | NotGiven = NOT_GIVEN, suspended: bool | NotGiven = NOT_GIVEN, + turnstile_action: Literal["log", "infinite_queue"] | NotGiven = NOT_GIVEN, + turnstile_mode: Literal["off", "invisible", "visible_non_interactive", "visible_managed"] + | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -832,6 +852,18 @@ def update( suspended: Suspends or allows traffic going to the waiting room. If set to `true`, the traffic will not go to the waiting room. + turnstile_action: Which action to take when a bot is detected using Turnstile. `log` will have no + impact on queueing behavior, simply keeping track of how many bots are detected + in Waiting Room Analytics. `infinite_queue` will send bots to a false queueing + state, where they will never reach your origin. `infinite_queue` requires + Advanced Waiting Room. + + turnstile_mode: Which Turnstile widget type to use for detecting bot traffic. See + [the Turnstile documentation](https://developers.cloudflare.com/turnstile/concepts/widget/#widget-types) + for the definitions of these widget types. Set to `off` to disable the Turnstile + integration entirely. Setting this to anything other than `off` or `invisible` + requires Advanced Waiting Room. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -867,6 +899,8 @@ def update( "queueing_status_code": queueing_status_code, "session_duration": session_duration, "suspended": suspended, + "turnstile_action": turnstile_action, + "turnstile_mode": turnstile_mode, }, waiting_room_update_params.WaitingRoomUpdateParams, ), @@ -1038,6 +1072,9 @@ def edit( queueing_status_code: Literal[200, 202, 429] | NotGiven = NOT_GIVEN, session_duration: int | NotGiven = NOT_GIVEN, suspended: bool | NotGiven = NOT_GIVEN, + turnstile_action: Literal["log", "infinite_queue"] | NotGiven = NOT_GIVEN, + turnstile_mode: Literal["off", "invisible", "visible_non_interactive", "visible_managed"] + | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1309,6 +1346,18 @@ def edit( suspended: Suspends or allows traffic going to the waiting room. If set to `true`, the traffic will not go to the waiting room. + turnstile_action: Which action to take when a bot is detected using Turnstile. `log` will have no + impact on queueing behavior, simply keeping track of how many bots are detected + in Waiting Room Analytics. `infinite_queue` will send bots to a false queueing + state, where they will never reach your origin. `infinite_queue` requires + Advanced Waiting Room. + + turnstile_mode: Which Turnstile widget type to use for detecting bot traffic. See + [the Turnstile documentation](https://developers.cloudflare.com/turnstile/concepts/widget/#widget-types) + for the definitions of these widget types. Set to `off` to disable the Turnstile + integration entirely. Setting this to anything other than `off` or `invisible` + requires Advanced Waiting Room. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1344,6 +1393,8 @@ def edit( "queueing_status_code": queueing_status_code, "session_duration": session_duration, "suspended": suspended, + "turnstile_action": turnstile_action, + "turnstile_mode": turnstile_mode, }, waiting_room_edit_params.WaitingRoomEditParams, ), @@ -1503,6 +1554,9 @@ async def create( queueing_status_code: Literal[200, 202, 429] | NotGiven = NOT_GIVEN, session_duration: int | NotGiven = NOT_GIVEN, suspended: bool | NotGiven = NOT_GIVEN, + turnstile_action: Literal["log", "infinite_queue"] | NotGiven = NOT_GIVEN, + turnstile_mode: Literal["off", "invisible", "visible_non_interactive", "visible_managed"] + | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1774,6 +1828,18 @@ async def create( suspended: Suspends or allows traffic going to the waiting room. If set to `true`, the traffic will not go to the waiting room. + turnstile_action: Which action to take when a bot is detected using Turnstile. `log` will have no + impact on queueing behavior, simply keeping track of how many bots are detected + in Waiting Room Analytics. `infinite_queue` will send bots to a false queueing + state, where they will never reach your origin. `infinite_queue` requires + Advanced Waiting Room. + + turnstile_mode: Which Turnstile widget type to use for detecting bot traffic. See + [the Turnstile documentation](https://developers.cloudflare.com/turnstile/concepts/widget/#widget-types) + for the definitions of these widget types. Set to `off` to disable the Turnstile + integration entirely. Setting this to anything other than `off` or `invisible` + requires Advanced Waiting Room. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1807,6 +1873,8 @@ async def create( "queueing_status_code": queueing_status_code, "session_duration": session_duration, "suspended": suspended, + "turnstile_action": turnstile_action, + "turnstile_mode": turnstile_mode, }, waiting_room_create_params.WaitingRoomCreateParams, ), @@ -1884,6 +1952,9 @@ async def update( queueing_status_code: Literal[200, 202, 429] | NotGiven = NOT_GIVEN, session_duration: int | NotGiven = NOT_GIVEN, suspended: bool | NotGiven = NOT_GIVEN, + turnstile_action: Literal["log", "infinite_queue"] | NotGiven = NOT_GIVEN, + turnstile_mode: Literal["off", "invisible", "visible_non_interactive", "visible_managed"] + | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2155,6 +2226,18 @@ async def update( suspended: Suspends or allows traffic going to the waiting room. If set to `true`, the traffic will not go to the waiting room. + turnstile_action: Which action to take when a bot is detected using Turnstile. `log` will have no + impact on queueing behavior, simply keeping track of how many bots are detected + in Waiting Room Analytics. `infinite_queue` will send bots to a false queueing + state, where they will never reach your origin. `infinite_queue` requires + Advanced Waiting Room. + + turnstile_mode: Which Turnstile widget type to use for detecting bot traffic. See + [the Turnstile documentation](https://developers.cloudflare.com/turnstile/concepts/widget/#widget-types) + for the definitions of these widget types. Set to `off` to disable the Turnstile + integration entirely. Setting this to anything other than `off` or `invisible` + requires Advanced Waiting Room. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2190,6 +2273,8 @@ async def update( "queueing_status_code": queueing_status_code, "session_duration": session_duration, "suspended": suspended, + "turnstile_action": turnstile_action, + "turnstile_mode": turnstile_mode, }, waiting_room_update_params.WaitingRoomUpdateParams, ), @@ -2361,6 +2446,9 @@ async def edit( queueing_status_code: Literal[200, 202, 429] | NotGiven = NOT_GIVEN, session_duration: int | NotGiven = NOT_GIVEN, suspended: bool | NotGiven = NOT_GIVEN, + turnstile_action: Literal["log", "infinite_queue"] | NotGiven = NOT_GIVEN, + turnstile_mode: Literal["off", "invisible", "visible_non_interactive", "visible_managed"] + | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2632,6 +2720,18 @@ async def edit( suspended: Suspends or allows traffic going to the waiting room. If set to `true`, the traffic will not go to the waiting room. + turnstile_action: Which action to take when a bot is detected using Turnstile. `log` will have no + impact on queueing behavior, simply keeping track of how many bots are detected + in Waiting Room Analytics. `infinite_queue` will send bots to a false queueing + state, where they will never reach your origin. `infinite_queue` requires + Advanced Waiting Room. + + turnstile_mode: Which Turnstile widget type to use for detecting bot traffic. See + [the Turnstile documentation](https://developers.cloudflare.com/turnstile/concepts/widget/#widget-types) + for the definitions of these widget types. Set to `off` to disable the Turnstile + integration entirely. Setting this to anything other than `off` or `invisible` + requires Advanced Waiting Room. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2667,6 +2767,8 @@ async def edit( "queueing_status_code": queueing_status_code, "session_duration": session_duration, "suspended": suspended, + "turnstile_action": turnstile_action, + "turnstile_mode": turnstile_mode, }, waiting_room_edit_params.WaitingRoomEditParams, ), diff --git a/src/cloudflare/resources/workers/__init__.py b/src/cloudflare/resources/workers/__init__.py index dea7e3e0167..2009583bd8f 100644 --- a/src/cloudflare/resources/workers/__init__.py +++ b/src/cloudflare/resources/workers/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .ai import ( - AIResource, - AsyncAIResource, - AIResourceWithRawResponse, - AsyncAIResourceWithRawResponse, - AIResourceWithStreamingResponse, - AsyncAIResourceWithStreamingResponse, -) from .assets import ( AssetsResource, AsyncAssetsResource, @@ -16,6 +8,14 @@ AssetsResourceWithStreamingResponse, AsyncAssetsResourceWithStreamingResponse, ) +from .routes import ( + RoutesResource, + AsyncRoutesResource, + RoutesResourceWithRawResponse, + AsyncRoutesResourceWithRawResponse, + RoutesResourceWithStreamingResponse, + AsyncRoutesResourceWithStreamingResponse, +) from .domains import ( DomainsResource, AsyncDomainsResource, @@ -58,12 +58,12 @@ ) __all__ = [ - "AIResource", - "AsyncAIResource", - "AIResourceWithRawResponse", - "AsyncAIResourceWithRawResponse", - "AIResourceWithStreamingResponse", - "AsyncAIResourceWithStreamingResponse", + "RoutesResource", + "AsyncRoutesResource", + "RoutesResourceWithRawResponse", + "AsyncRoutesResourceWithRawResponse", + "RoutesResourceWithStreamingResponse", + "AsyncRoutesResourceWithStreamingResponse", "AssetsResource", "AsyncAssetsResource", "AssetsResourceWithRawResponse", diff --git a/src/cloudflare/resources/workers/ai/__init__.py b/src/cloudflare/resources/workers/ai/__init__.py deleted file mode 100644 index 4921cf245a4..00000000000 --- a/src/cloudflare/resources/workers/ai/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from .ai import ( - AIResource, - AsyncAIResource, - AIResourceWithRawResponse, - AsyncAIResourceWithRawResponse, - AIResourceWithStreamingResponse, - AsyncAIResourceWithStreamingResponse, -) -from .models import ( - ModelsResource, - AsyncModelsResource, - ModelsResourceWithRawResponse, - AsyncModelsResourceWithRawResponse, - ModelsResourceWithStreamingResponse, - AsyncModelsResourceWithStreamingResponse, -) - -__all__ = [ - "ModelsResource", - "AsyncModelsResource", - "ModelsResourceWithRawResponse", - "AsyncModelsResourceWithRawResponse", - "ModelsResourceWithStreamingResponse", - "AsyncModelsResourceWithStreamingResponse", - "AIResource", - "AsyncAIResource", - "AIResourceWithRawResponse", - "AsyncAIResourceWithRawResponse", - "AIResourceWithStreamingResponse", - "AsyncAIResourceWithStreamingResponse", -] diff --git a/src/cloudflare/resources/workers/ai/models/models.py b/src/cloudflare/resources/workers/ai/models/models.py deleted file mode 100644 index 95e2e20f66f..00000000000 --- a/src/cloudflare/resources/workers/ai/models/models.py +++ /dev/null @@ -1,102 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from .schema import ( - SchemaResource, - AsyncSchemaResource, - SchemaResourceWithRawResponse, - AsyncSchemaResourceWithRawResponse, - SchemaResourceWithStreamingResponse, - AsyncSchemaResourceWithStreamingResponse, -) -from ....._compat import cached_property -from ....._resource import SyncAPIResource, AsyncAPIResource - -__all__ = ["ModelsResource", "AsyncModelsResource"] - - -class ModelsResource(SyncAPIResource): - @cached_property - def schema(self) -> SchemaResource: - return SchemaResource(self._client) - - @cached_property - def with_raw_response(self) -> ModelsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return ModelsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> ModelsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return ModelsResourceWithStreamingResponse(self) - - -class AsyncModelsResource(AsyncAPIResource): - @cached_property - def schema(self) -> AsyncSchemaResource: - return AsyncSchemaResource(self._client) - - @cached_property - def with_raw_response(self) -> AsyncModelsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncModelsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncModelsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncModelsResourceWithStreamingResponse(self) - - -class ModelsResourceWithRawResponse: - def __init__(self, models: ModelsResource) -> None: - self._models = models - - @cached_property - def schema(self) -> SchemaResourceWithRawResponse: - return SchemaResourceWithRawResponse(self._models.schema) - - -class AsyncModelsResourceWithRawResponse: - def __init__(self, models: AsyncModelsResource) -> None: - self._models = models - - @cached_property - def schema(self) -> AsyncSchemaResourceWithRawResponse: - return AsyncSchemaResourceWithRawResponse(self._models.schema) - - -class ModelsResourceWithStreamingResponse: - def __init__(self, models: ModelsResource) -> None: - self._models = models - - @cached_property - def schema(self) -> SchemaResourceWithStreamingResponse: - return SchemaResourceWithStreamingResponse(self._models.schema) - - -class AsyncModelsResourceWithStreamingResponse: - def __init__(self, models: AsyncModelsResource) -> None: - self._models = models - - @cached_property - def schema(self) -> AsyncSchemaResourceWithStreamingResponse: - return AsyncSchemaResourceWithStreamingResponse(self._models.schema) diff --git a/src/cloudflare/resources/workers/assets/upload.py b/src/cloudflare/resources/workers/assets/upload.py index 1572f007c5f..ecc8a178557 100644 --- a/src/cloudflare/resources/workers/assets/upload.py +++ b/src/cloudflare/resources/workers/assets/upload.py @@ -61,8 +61,11 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Optional[UploadCreateResponse]: - """ - Upload assets ahead of creating a Worker version. + """Upload assets ahead of creating a Worker version. + + To learn more about the direct + uploads of assets, see + https://developers.cloudflare.com/workers/static-assets/direct-upload/ Args: account_id: Identifier @@ -134,8 +137,11 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Optional[UploadCreateResponse]: - """ - Upload assets ahead of creating a Worker version. + """Upload assets ahead of creating a Worker version. + + To learn more about the direct + uploads of assets, see + https://developers.cloudflare.com/workers/static-assets/direct-upload/ Args: account_id: Identifier diff --git a/src/cloudflare/resources/workers/routes.py b/src/cloudflare/resources/workers/routes.py new file mode 100644 index 00000000000..7af10337af1 --- /dev/null +++ b/src/cloudflare/resources/workers/routes.py @@ -0,0 +1,600 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, Optional, cast + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._wrappers import ResultWrapper +from ...pagination import SyncSinglePage, AsyncSinglePage +from ..._base_client import AsyncPaginator, make_request_options +from ...types.workers import route_create_params, route_update_params +from ...types.workers.route_get_response import RouteGetResponse +from ...types.workers.route_list_response import RouteListResponse +from ...types.workers.route_create_response import RouteCreateResponse +from ...types.workers.route_delete_response import RouteDeleteResponse +from ...types.workers.route_update_response import RouteUpdateResponse + +__all__ = ["RoutesResource", "AsyncRoutesResource"] + + +class RoutesResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> RoutesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return RoutesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> RoutesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return RoutesResourceWithStreamingResponse(self) + + def create( + self, + *, + zone_id: str, + pattern: str, + script: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RouteCreateResponse: + """ + Creates a route that maps a URL pattern to a Worker. + + Args: + zone_id: Identifier + + script: Name of the script, used in URLs and route configuration. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return self._post( + f"/zones/{zone_id}/workers/routes", + body=maybe_transform( + { + "pattern": pattern, + "script": script, + }, + route_create_params.RouteCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RouteCreateResponse, + ) + + def update( + self, + route_id: str, + *, + zone_id: str, + pattern: str, + script: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[RouteUpdateResponse]: + """ + Updates the URL pattern or Worker associated with a route. + + Args: + zone_id: Identifier + + route_id: Identifier + + script: Name of the script, used in URLs and route configuration. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not route_id: + raise ValueError(f"Expected a non-empty value for `route_id` but received {route_id!r}") + return self._put( + f"/zones/{zone_id}/workers/routes/{route_id}", + body=maybe_transform( + { + "pattern": pattern, + "script": script, + }, + route_update_params.RouteUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[RouteUpdateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[RouteUpdateResponse]], ResultWrapper[RouteUpdateResponse]), + ) + + def list( + self, + *, + zone_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncSinglePage[RouteListResponse]: + """ + Returns routes for a zone. + + Args: + zone_id: Identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return self._get_api_list( + f"/zones/{zone_id}/workers/routes", + page=SyncSinglePage[RouteListResponse], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=RouteListResponse, + ) + + def delete( + self, + route_id: str, + *, + zone_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RouteDeleteResponse: + """ + Deletes a route. + + Args: + zone_id: Identifier + + route_id: Identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not route_id: + raise ValueError(f"Expected a non-empty value for `route_id` but received {route_id!r}") + return self._delete( + f"/zones/{zone_id}/workers/routes/{route_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RouteDeleteResponse, + ) + + def get( + self, + route_id: str, + *, + zone_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[RouteGetResponse]: + """ + Returns information about a route, including URL pattern and Worker. + + Args: + zone_id: Identifier + + route_id: Identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not route_id: + raise ValueError(f"Expected a non-empty value for `route_id` but received {route_id!r}") + return self._get( + f"/zones/{zone_id}/workers/routes/{route_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[RouteGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[RouteGetResponse]], ResultWrapper[RouteGetResponse]), + ) + + +class AsyncRoutesResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncRoutesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncRoutesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncRoutesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncRoutesResourceWithStreamingResponse(self) + + async def create( + self, + *, + zone_id: str, + pattern: str, + script: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RouteCreateResponse: + """ + Creates a route that maps a URL pattern to a Worker. + + Args: + zone_id: Identifier + + script: Name of the script, used in URLs and route configuration. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return await self._post( + f"/zones/{zone_id}/workers/routes", + body=await async_maybe_transform( + { + "pattern": pattern, + "script": script, + }, + route_create_params.RouteCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RouteCreateResponse, + ) + + async def update( + self, + route_id: str, + *, + zone_id: str, + pattern: str, + script: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[RouteUpdateResponse]: + """ + Updates the URL pattern or Worker associated with a route. + + Args: + zone_id: Identifier + + route_id: Identifier + + script: Name of the script, used in URLs and route configuration. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not route_id: + raise ValueError(f"Expected a non-empty value for `route_id` but received {route_id!r}") + return await self._put( + f"/zones/{zone_id}/workers/routes/{route_id}", + body=await async_maybe_transform( + { + "pattern": pattern, + "script": script, + }, + route_update_params.RouteUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[RouteUpdateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[RouteUpdateResponse]], ResultWrapper[RouteUpdateResponse]), + ) + + def list( + self, + *, + zone_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[RouteListResponse, AsyncSinglePage[RouteListResponse]]: + """ + Returns routes for a zone. + + Args: + zone_id: Identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return self._get_api_list( + f"/zones/{zone_id}/workers/routes", + page=AsyncSinglePage[RouteListResponse], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=RouteListResponse, + ) + + async def delete( + self, + route_id: str, + *, + zone_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RouteDeleteResponse: + """ + Deletes a route. + + Args: + zone_id: Identifier + + route_id: Identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not route_id: + raise ValueError(f"Expected a non-empty value for `route_id` but received {route_id!r}") + return await self._delete( + f"/zones/{zone_id}/workers/routes/{route_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RouteDeleteResponse, + ) + + async def get( + self, + route_id: str, + *, + zone_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[RouteGetResponse]: + """ + Returns information about a route, including URL pattern and Worker. + + Args: + zone_id: Identifier + + route_id: Identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not route_id: + raise ValueError(f"Expected a non-empty value for `route_id` but received {route_id!r}") + return await self._get( + f"/zones/{zone_id}/workers/routes/{route_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[RouteGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[RouteGetResponse]], ResultWrapper[RouteGetResponse]), + ) + + +class RoutesResourceWithRawResponse: + def __init__(self, routes: RoutesResource) -> None: + self._routes = routes + + self.create = to_raw_response_wrapper( + routes.create, + ) + self.update = to_raw_response_wrapper( + routes.update, + ) + self.list = to_raw_response_wrapper( + routes.list, + ) + self.delete = to_raw_response_wrapper( + routes.delete, + ) + self.get = to_raw_response_wrapper( + routes.get, + ) + + +class AsyncRoutesResourceWithRawResponse: + def __init__(self, routes: AsyncRoutesResource) -> None: + self._routes = routes + + self.create = async_to_raw_response_wrapper( + routes.create, + ) + self.update = async_to_raw_response_wrapper( + routes.update, + ) + self.list = async_to_raw_response_wrapper( + routes.list, + ) + self.delete = async_to_raw_response_wrapper( + routes.delete, + ) + self.get = async_to_raw_response_wrapper( + routes.get, + ) + + +class RoutesResourceWithStreamingResponse: + def __init__(self, routes: RoutesResource) -> None: + self._routes = routes + + self.create = to_streamed_response_wrapper( + routes.create, + ) + self.update = to_streamed_response_wrapper( + routes.update, + ) + self.list = to_streamed_response_wrapper( + routes.list, + ) + self.delete = to_streamed_response_wrapper( + routes.delete, + ) + self.get = to_streamed_response_wrapper( + routes.get, + ) + + +class AsyncRoutesResourceWithStreamingResponse: + def __init__(self, routes: AsyncRoutesResource) -> None: + self._routes = routes + + self.create = async_to_streamed_response_wrapper( + routes.create, + ) + self.update = async_to_streamed_response_wrapper( + routes.update, + ) + self.list = async_to_streamed_response_wrapper( + routes.list, + ) + self.delete = async_to_streamed_response_wrapper( + routes.delete, + ) + self.get = async_to_streamed_response_wrapper( + routes.get, + ) diff --git a/src/cloudflare/resources/workers/scripts/assets/upload.py b/src/cloudflare/resources/workers/scripts/assets/upload.py index 711cf2035d4..836583e47f4 100644 --- a/src/cloudflare/resources/workers/scripts/assets/upload.py +++ b/src/cloudflare/resources/workers/scripts/assets/upload.py @@ -60,8 +60,11 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Optional[UploadCreateResponse]: - """ - Start uploading a collection of assets for use in a Worker version. + """Start uploading a collection of assets for use in a Worker version. + + To learn + more about the direct uploads of assets, see + https://developers.cloudflare.com/workers/static-assets/direct-upload/ Args: account_id: Identifier @@ -130,8 +133,11 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Optional[UploadCreateResponse]: - """ - Start uploading a collection of assets for use in a Worker version. + """Start uploading a collection of assets for use in a Worker version. + + To learn + more about the direct uploads of assets, see + https://developers.cloudflare.com/workers/static-assets/direct-upload/ Args: account_id: Identifier diff --git a/src/cloudflare/resources/workers/scripts/content.py b/src/cloudflare/resources/workers/scripts/content.py index b4c91d83d61..09d1d506899 100644 --- a/src/cloudflare/resources/workers/scripts/content.py +++ b/src/cloudflare/resources/workers/scripts/content.py @@ -2,16 +2,14 @@ from __future__ import annotations -from typing import List, Type, Mapping, Optional, cast +from typing import Type, Optional, cast import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( - extract_files, maybe_transform, strip_not_given, - deepcopy_minimal, async_maybe_transform, ) from ...._compat import cached_property @@ -64,8 +62,7 @@ def update( script_name: str, *, account_id: str, - any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, - metadata: WorkerMetadataParam | NotGiven = NOT_GIVEN, + metadata: WorkerMetadataParam, cf_worker_body_part: str | NotGiven = NOT_GIVEN, cf_worker_main_module_part: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -83,13 +80,6 @@ def update( script_name: Name of the script, used in URLs and route configuration. - any_part_name: A module comprising a Worker script, often a javascript file. Multiple modules - may be provided as separate named parts, but at least one module must be - present. This should be referenced either in the metadata as `main_module` - (esm)/`body_part` (service worker) or as a header `CF-WORKER-MAIN-MODULE-PART` - (esm) /`CF-WORKER-BODY-PART` (service worker) by part name. Source maps may also - be included using the `application/source-map` content type. - metadata: JSON encoded metadata about the uploaded parts and Worker configuration. extra_headers: Send extra headers @@ -113,21 +103,13 @@ def update( ), **(extra_headers or {}), } - body = deepcopy_minimal( - { - "any_part_name": any_part_name, - "metadata": metadata, - } - ) - files = extract_files(cast(Mapping[str, object], body), paths=[["", ""]]) # It should be noted that the actual Content-Type header that will be # sent to the server will contain a `boundary` parameter, e.g. # multipart/form-data; boundary=---abc-- extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} return self._put( f"/accounts/{account_id}/workers/scripts/{script_name}/content", - body=maybe_transform(body, content_update_params.ContentUpdateParams), - files=files, + body=maybe_transform({"metadata": metadata}, content_update_params.ContentUpdateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -205,8 +187,7 @@ async def update( script_name: str, *, account_id: str, - any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, - metadata: WorkerMetadataParam | NotGiven = NOT_GIVEN, + metadata: WorkerMetadataParam, cf_worker_body_part: str | NotGiven = NOT_GIVEN, cf_worker_main_module_part: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -224,13 +205,6 @@ async def update( script_name: Name of the script, used in URLs and route configuration. - any_part_name: A module comprising a Worker script, often a javascript file. Multiple modules - may be provided as separate named parts, but at least one module must be - present. This should be referenced either in the metadata as `main_module` - (esm)/`body_part` (service worker) or as a header `CF-WORKER-MAIN-MODULE-PART` - (esm) /`CF-WORKER-BODY-PART` (service worker) by part name. Source maps may also - be included using the `application/source-map` content type. - metadata: JSON encoded metadata about the uploaded parts and Worker configuration. extra_headers: Send extra headers @@ -254,21 +228,13 @@ async def update( ), **(extra_headers or {}), } - body = deepcopy_minimal( - { - "any_part_name": any_part_name, - "metadata": metadata, - } - ) - files = extract_files(cast(Mapping[str, object], body), paths=[["", ""]]) # It should be noted that the actual Content-Type header that will be # sent to the server will contain a `boundary` parameter, e.g. # multipart/form-data; boundary=---abc-- extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} return await self._put( f"/accounts/{account_id}/workers/scripts/{script_name}/content", - body=await async_maybe_transform(body, content_update_params.ContentUpdateParams), - files=files, + body=await async_maybe_transform({"metadata": metadata}, content_update_params.ContentUpdateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/cloudflare/resources/workers/scripts/scripts.py b/src/cloudflare/resources/workers/scripts/scripts.py index ffc9db763a4..5164db2723c 100644 --- a/src/cloudflare/resources/workers/scripts/scripts.py +++ b/src/cloudflare/resources/workers/scripts/scripts.py @@ -2,8 +2,7 @@ from __future__ import annotations -from typing import List, Type, Optional, cast -from typing_extensions import overload +from typing import Type, Optional, cast import httpx @@ -39,9 +38,8 @@ VersionsResourceWithStreamingResponse, AsyncVersionsResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, FileTypes +from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven from ...._utils import ( - required_args, maybe_transform, async_maybe_transform, ) @@ -72,18 +70,10 @@ ) from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( - BinaryAPIResponse, - AsyncBinaryAPIResponse, - StreamedBinaryAPIResponse, - AsyncStreamedBinaryAPIResponse, to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, - to_custom_raw_response_wrapper, async_to_streamed_response_wrapper, - to_custom_streamed_response_wrapper, - async_to_custom_raw_response_wrapper, - async_to_custom_streamed_response_wrapper, ) from ...._wrappers import ResultWrapper from ....pagination import SyncSinglePage, AsyncSinglePage @@ -155,15 +145,12 @@ def with_streaming_response(self) -> ScriptsResourceWithStreamingResponse: """ return ScriptsResourceWithStreamingResponse(self) - @overload def update( self, script_name: str, *, account_id: str, - rollback_to: str | NotGiven = NOT_GIVEN, - any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, - metadata: script_update_params.Variant0Metadata | NotGiven = NOT_GIVEN, + metadata: script_update_params.Metadata, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -182,16 +169,6 @@ def update( script_name: Name of the script, used in URLs and route configuration. - rollback_to: Rollback to provided deployment based on deployment ID. Request body will only - parse a "message" part. You can learn more about deployments - [here](https://developers.cloudflare.com/workers/platform/deployments/). - - any_part_name: A module comprising a Worker script, often a javascript file. Multiple modules - may be provided as separate named parts, but at least one module must be present - and referenced in the metadata as `main_module` or `body_part` by part name. - Source maps may also be included using the `application/source-map` content - type. - metadata: JSON encoded metadata about the uploaded parts and Worker configuration. extra_headers: Send extra headers @@ -202,88 +179,18 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - def update( - self, - script_name: str, - *, - account_id: str, - rollback_to: str | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ScriptUpdateResponse]: - """Upload a worker module. - - You can find more about the multipart metadata on our - docs: - https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/. - - Args: - account_id: Identifier - - script_name: Name of the script, used in URLs and route configuration. - - rollback_to: Rollback to provided deployment based on deployment ID. Request body will only - parse a "message" part. You can learn more about deployments - [here](https://developers.cloudflare.com/workers/platform/deployments/). - - message: Rollback message to be associated with this deployment. Only parsed when query - param `"rollback_to"` is present. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args(["account_id"]) - def update( - self, - script_name: str, - *, - account_id: str, - rollback_to: str | NotGiven = NOT_GIVEN, - any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, - metadata: script_update_params.Variant0Metadata | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ScriptUpdateResponse]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not script_name: raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") return self._put( f"/accounts/{account_id}/workers/scripts/{script_name}", - body=maybe_transform( - { - "any_part_name": any_part_name, - "metadata": metadata, - "message": message, - }, - script_update_params.ScriptUpdateParams, - ), + body=maybe_transform({"metadata": metadata}, script_update_params.ScriptUpdateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=maybe_transform({"rollback_to": rollback_to}, script_update_params.ScriptUpdateParams), post_parser=ResultWrapper[Optional[ScriptUpdateResponse]]._unwrapper, ), cast_to=cast(Type[Optional[ScriptUpdateResponse]], ResultWrapper[ScriptUpdateResponse]), @@ -387,7 +294,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BinaryAPIResponse: + ) -> str: """Fetch raw script content for your worker. Note this is the original script @@ -410,13 +317,13 @@ def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not script_name: raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") - extra_headers = {"Accept": "undefined", **(extra_headers or {})} + extra_headers = {"Accept": "application/javascript", **(extra_headers or {})} return self._get( f"/accounts/{account_id}/workers/scripts/{script_name}", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=BinaryAPIResponse, + cast_to=str, ) @@ -472,15 +379,12 @@ def with_streaming_response(self) -> AsyncScriptsResourceWithStreamingResponse: """ return AsyncScriptsResourceWithStreamingResponse(self) - @overload async def update( self, script_name: str, *, account_id: str, - rollback_to: str | NotGiven = NOT_GIVEN, - any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, - metadata: script_update_params.Variant0Metadata | NotGiven = NOT_GIVEN, + metadata: script_update_params.Metadata, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -499,16 +403,6 @@ async def update( script_name: Name of the script, used in URLs and route configuration. - rollback_to: Rollback to provided deployment based on deployment ID. Request body will only - parse a "message" part. You can learn more about deployments - [here](https://developers.cloudflare.com/workers/platform/deployments/). - - any_part_name: A module comprising a Worker script, often a javascript file. Multiple modules - may be provided as separate named parts, but at least one module must be present - and referenced in the metadata as `main_module` or `body_part` by part name. - Source maps may also be included using the `application/source-map` content - type. - metadata: JSON encoded metadata about the uploaded parts and Worker configuration. extra_headers: Send extra headers @@ -519,90 +413,18 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - async def update( - self, - script_name: str, - *, - account_id: str, - rollback_to: str | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ScriptUpdateResponse]: - """Upload a worker module. - - You can find more about the multipart metadata on our - docs: - https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/. - - Args: - account_id: Identifier - - script_name: Name of the script, used in URLs and route configuration. - - rollback_to: Rollback to provided deployment based on deployment ID. Request body will only - parse a "message" part. You can learn more about deployments - [here](https://developers.cloudflare.com/workers/platform/deployments/). - - message: Rollback message to be associated with this deployment. Only parsed when query - param `"rollback_to"` is present. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args(["account_id"]) - async def update( - self, - script_name: str, - *, - account_id: str, - rollback_to: str | NotGiven = NOT_GIVEN, - any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, - metadata: script_update_params.Variant0Metadata | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ScriptUpdateResponse]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not script_name: raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") return await self._put( f"/accounts/{account_id}/workers/scripts/{script_name}", - body=await async_maybe_transform( - { - "any_part_name": any_part_name, - "metadata": metadata, - "message": message, - }, - script_update_params.ScriptUpdateParams, - ), + body=await async_maybe_transform({"metadata": metadata}, script_update_params.ScriptUpdateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( - {"rollback_to": rollback_to}, script_update_params.ScriptUpdateParams - ), post_parser=ResultWrapper[Optional[ScriptUpdateResponse]]._unwrapper, ), cast_to=cast(Type[Optional[ScriptUpdateResponse]], ResultWrapper[ScriptUpdateResponse]), @@ -706,7 +528,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncBinaryAPIResponse: + ) -> str: """Fetch raw script content for your worker. Note this is the original script @@ -729,13 +551,13 @@ async def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not script_name: raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") - extra_headers = {"Accept": "undefined", **(extra_headers or {})} + extra_headers = {"Accept": "application/javascript", **(extra_headers or {})} return await self._get( f"/accounts/{account_id}/workers/scripts/{script_name}", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=AsyncBinaryAPIResponse, + cast_to=str, ) @@ -752,9 +574,8 @@ def __init__(self, scripts: ScriptsResource) -> None: self.delete = to_raw_response_wrapper( scripts.delete, ) - self.get = to_custom_raw_response_wrapper( + self.get = to_raw_response_wrapper( scripts.get, - BinaryAPIResponse, ) @cached_property @@ -803,9 +624,8 @@ def __init__(self, scripts: AsyncScriptsResource) -> None: self.delete = async_to_raw_response_wrapper( scripts.delete, ) - self.get = async_to_custom_raw_response_wrapper( + self.get = async_to_raw_response_wrapper( scripts.get, - AsyncBinaryAPIResponse, ) @cached_property @@ -854,9 +674,8 @@ def __init__(self, scripts: ScriptsResource) -> None: self.delete = to_streamed_response_wrapper( scripts.delete, ) - self.get = to_custom_streamed_response_wrapper( + self.get = to_streamed_response_wrapper( scripts.get, - StreamedBinaryAPIResponse, ) @cached_property @@ -905,9 +724,8 @@ def __init__(self, scripts: AsyncScriptsResource) -> None: self.delete = async_to_streamed_response_wrapper( scripts.delete, ) - self.get = async_to_custom_streamed_response_wrapper( + self.get = async_to_streamed_response_wrapper( scripts.get, - AsyncStreamedBinaryAPIResponse, ) @cached_property diff --git a/src/cloudflare/resources/workers/scripts/versions.py b/src/cloudflare/resources/workers/scripts/versions.py index fa1bb14105f..749b4f83f55 100644 --- a/src/cloudflare/resources/workers/scripts/versions.py +++ b/src/cloudflare/resources/workers/scripts/versions.py @@ -2,15 +2,13 @@ from __future__ import annotations -from typing import List, Type, Mapping, Optional, cast +from typing import Type, Optional, cast import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( - extract_files, maybe_transform, - deepcopy_minimal, async_maybe_transform, ) from ...._compat import cached_property @@ -57,8 +55,7 @@ def create( script_name: str, *, account_id: str, - any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, - metadata: version_create_params.Metadata | NotGiven = NOT_GIVEN, + metadata: version_create_params.Metadata, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -77,10 +74,6 @@ def create( script_name: Name of the script. - any_part_name: A module comprising a Worker script, often a javascript file. Multiple modules - may be provided as separate named parts, but at least one module must be present - and referenced in the metadata as `main_module`. - metadata: JSON encoded metadata about the uploaded parts and Worker configuration. extra_headers: Send extra headers @@ -95,21 +88,13 @@ def create( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not script_name: raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") - body = deepcopy_minimal( - { - "any_part_name": any_part_name, - "metadata": metadata, - } - ) - files = extract_files(cast(Mapping[str, object], body), paths=[["", ""]]) # It should be noted that the actual Content-Type header that will be # sent to the server will contain a `boundary` parameter, e.g. # multipart/form-data; boundary=---abc-- extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} return self._post( f"/accounts/{account_id}/workers/scripts/{script_name}/versions", - body=maybe_transform(body, version_create_params.VersionCreateParams), - files=files, + body=maybe_transform({"metadata": metadata}, version_create_params.VersionCreateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -255,8 +240,7 @@ async def create( script_name: str, *, account_id: str, - any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, - metadata: version_create_params.Metadata | NotGiven = NOT_GIVEN, + metadata: version_create_params.Metadata, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -275,10 +259,6 @@ async def create( script_name: Name of the script. - any_part_name: A module comprising a Worker script, often a javascript file. Multiple modules - may be provided as separate named parts, but at least one module must be present - and referenced in the metadata as `main_module`. - metadata: JSON encoded metadata about the uploaded parts and Worker configuration. extra_headers: Send extra headers @@ -293,21 +273,13 @@ async def create( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not script_name: raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") - body = deepcopy_minimal( - { - "any_part_name": any_part_name, - "metadata": metadata, - } - ) - files = extract_files(cast(Mapping[str, object], body), paths=[["", ""]]) # It should be noted that the actual Content-Type header that will be # sent to the server will contain a `boundary` parameter, e.g. # multipart/form-data; boundary=---abc-- extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} return await self._post( f"/accounts/{account_id}/workers/scripts/{script_name}/versions", - body=await async_maybe_transform(body, version_create_params.VersionCreateParams), - files=files, + body=await async_maybe_transform({"metadata": metadata}, version_create_params.VersionCreateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/cloudflare/resources/workers/workers.py b/src/cloudflare/resources/workers/workers.py index ed4da6b38d5..e167830c87d 100644 --- a/src/cloudflare/resources/workers/workers.py +++ b/src/cloudflare/resources/workers/workers.py @@ -2,13 +2,13 @@ from __future__ import annotations -from .ai.ai import ( - AIResource, - AsyncAIResource, - AIResourceWithRawResponse, - AsyncAIResourceWithRawResponse, - AIResourceWithStreamingResponse, - AsyncAIResourceWithStreamingResponse, +from .routes import ( + RoutesResource, + AsyncRoutesResource, + RoutesResourceWithRawResponse, + AsyncRoutesResourceWithRawResponse, + RoutesResourceWithStreamingResponse, + AsyncRoutesResourceWithStreamingResponse, ) from .domains import ( DomainsResource, @@ -58,8 +58,8 @@ class WorkersResource(SyncAPIResource): @cached_property - def ai(self) -> AIResource: - return AIResource(self._client) + def routes(self) -> RoutesResource: + return RoutesResource(self._client) @cached_property def assets(self) -> AssetsResource: @@ -103,8 +103,8 @@ def with_streaming_response(self) -> WorkersResourceWithStreamingResponse: class AsyncWorkersResource(AsyncAPIResource): @cached_property - def ai(self) -> AsyncAIResource: - return AsyncAIResource(self._client) + def routes(self) -> AsyncRoutesResource: + return AsyncRoutesResource(self._client) @cached_property def assets(self) -> AsyncAssetsResource: @@ -151,8 +151,8 @@ def __init__(self, workers: WorkersResource) -> None: self._workers = workers @cached_property - def ai(self) -> AIResourceWithRawResponse: - return AIResourceWithRawResponse(self._workers.ai) + def routes(self) -> RoutesResourceWithRawResponse: + return RoutesResourceWithRawResponse(self._workers.routes) @cached_property def assets(self) -> AssetsResourceWithRawResponse: @@ -180,8 +180,8 @@ def __init__(self, workers: AsyncWorkersResource) -> None: self._workers = workers @cached_property - def ai(self) -> AsyncAIResourceWithRawResponse: - return AsyncAIResourceWithRawResponse(self._workers.ai) + def routes(self) -> AsyncRoutesResourceWithRawResponse: + return AsyncRoutesResourceWithRawResponse(self._workers.routes) @cached_property def assets(self) -> AsyncAssetsResourceWithRawResponse: @@ -209,8 +209,8 @@ def __init__(self, workers: WorkersResource) -> None: self._workers = workers @cached_property - def ai(self) -> AIResourceWithStreamingResponse: - return AIResourceWithStreamingResponse(self._workers.ai) + def routes(self) -> RoutesResourceWithStreamingResponse: + return RoutesResourceWithStreamingResponse(self._workers.routes) @cached_property def assets(self) -> AssetsResourceWithStreamingResponse: @@ -238,8 +238,8 @@ def __init__(self, workers: AsyncWorkersResource) -> None: self._workers = workers @cached_property - def ai(self) -> AsyncAIResourceWithStreamingResponse: - return AsyncAIResourceWithStreamingResponse(self._workers.ai) + def routes(self) -> AsyncRoutesResourceWithStreamingResponse: + return AsyncRoutesResourceWithStreamingResponse(self._workers.routes) @cached_property def assets(self) -> AsyncAssetsResourceWithStreamingResponse: diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/__init__.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/__init__.py index fd5a962f515..668f9921146 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/__init__.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/__init__.py @@ -48,8 +48,22 @@ SettingsResourceWithStreamingResponse, AsyncSettingsResourceWithStreamingResponse, ) +from .asset_upload import ( + AssetUploadResource, + AsyncAssetUploadResource, + AssetUploadResourceWithRawResponse, + AsyncAssetUploadResourceWithRawResponse, + AssetUploadResourceWithStreamingResponse, + AsyncAssetUploadResourceWithStreamingResponse, +) __all__ = [ + "AssetUploadResource", + "AsyncAssetUploadResource", + "AssetUploadResourceWithRawResponse", + "AsyncAssetUploadResourceWithRawResponse", + "AssetUploadResourceWithStreamingResponse", + "AsyncAssetUploadResourceWithStreamingResponse", "ContentResource", "AsyncContentResource", "ContentResourceWithRawResponse", diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/asset_upload.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/asset_upload.py new file mode 100644 index 00000000000..4b4e04a0a4e --- /dev/null +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/asset_upload.py @@ -0,0 +1,223 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Type, Optional, cast + +import httpx + +from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ......_utils import ( + maybe_transform, + async_maybe_transform, +) +from ......_compat import cached_property +from ......_resource import SyncAPIResource, AsyncAPIResource +from ......_response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ......_wrappers import ResultWrapper +from ......_base_client import make_request_options +from ......types.workers_for_platforms.dispatch.namespaces.scripts import asset_upload_create_params +from ......types.workers_for_platforms.dispatch.namespaces.scripts.asset_upload_create_response import ( + AssetUploadCreateResponse, +) + +__all__ = ["AssetUploadResource", "AsyncAssetUploadResource"] + + +class AssetUploadResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> AssetUploadResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AssetUploadResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AssetUploadResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AssetUploadResourceWithStreamingResponse(self) + + def create( + self, + script_name: str, + *, + account_id: str, + dispatch_namespace: str, + manifest: Dict[str, asset_upload_create_params.Manifest] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[AssetUploadCreateResponse]: + """Start uploading a collection of assets for use in a Worker version. + + To learn + more about the direct uploads of assets, see + https://developers.cloudflare.com/workers/static-assets/direct-upload/ + + Args: + account_id: Identifier + + dispatch_namespace: Name of the Workers for Platforms dispatch namespace. + + script_name: Name of the script, used in URLs and route configuration. + + manifest: A manifest ([path]: {hash, size}) map of files to upload. As an example, + `/blog/hello-world.html` would be a valid path key. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not dispatch_namespace: + raise ValueError(f"Expected a non-empty value for `dispatch_namespace` but received {dispatch_namespace!r}") + if not script_name: + raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") + return self._post( + f"/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/assets-upload-session", + body=maybe_transform({"manifest": manifest}, asset_upload_create_params.AssetUploadCreateParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[AssetUploadCreateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[AssetUploadCreateResponse]], ResultWrapper[AssetUploadCreateResponse]), + ) + + +class AsyncAssetUploadResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncAssetUploadResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncAssetUploadResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncAssetUploadResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncAssetUploadResourceWithStreamingResponse(self) + + async def create( + self, + script_name: str, + *, + account_id: str, + dispatch_namespace: str, + manifest: Dict[str, asset_upload_create_params.Manifest] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[AssetUploadCreateResponse]: + """Start uploading a collection of assets for use in a Worker version. + + To learn + more about the direct uploads of assets, see + https://developers.cloudflare.com/workers/static-assets/direct-upload/ + + Args: + account_id: Identifier + + dispatch_namespace: Name of the Workers for Platforms dispatch namespace. + + script_name: Name of the script, used in URLs and route configuration. + + manifest: A manifest ([path]: {hash, size}) map of files to upload. As an example, + `/blog/hello-world.html` would be a valid path key. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not dispatch_namespace: + raise ValueError(f"Expected a non-empty value for `dispatch_namespace` but received {dispatch_namespace!r}") + if not script_name: + raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") + return await self._post( + f"/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/assets-upload-session", + body=await async_maybe_transform( + {"manifest": manifest}, asset_upload_create_params.AssetUploadCreateParams + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[AssetUploadCreateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[AssetUploadCreateResponse]], ResultWrapper[AssetUploadCreateResponse]), + ) + + +class AssetUploadResourceWithRawResponse: + def __init__(self, asset_upload: AssetUploadResource) -> None: + self._asset_upload = asset_upload + + self.create = to_raw_response_wrapper( + asset_upload.create, + ) + + +class AsyncAssetUploadResourceWithRawResponse: + def __init__(self, asset_upload: AsyncAssetUploadResource) -> None: + self._asset_upload = asset_upload + + self.create = async_to_raw_response_wrapper( + asset_upload.create, + ) + + +class AssetUploadResourceWithStreamingResponse: + def __init__(self, asset_upload: AssetUploadResource) -> None: + self._asset_upload = asset_upload + + self.create = to_streamed_response_wrapper( + asset_upload.create, + ) + + +class AsyncAssetUploadResourceWithStreamingResponse: + def __init__(self, asset_upload: AsyncAssetUploadResource) -> None: + self._asset_upload = asset_upload + + self.create = async_to_streamed_response_wrapper( + asset_upload.create, + ) diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/content.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/content.py index dd445795f95..48a6af6ffc6 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/content.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/content.py @@ -2,16 +2,14 @@ from __future__ import annotations -from typing import List, Type, Mapping, Optional, cast +from typing import Type, Optional, cast import httpx -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes +from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven from ......_utils import ( - extract_files, maybe_transform, strip_not_given, - deepcopy_minimal, async_maybe_transform, ) from ......_compat import cached_property @@ -65,8 +63,7 @@ def update( *, account_id: str, dispatch_namespace: str, - any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, - metadata: WorkerMetadataParam | NotGiven = NOT_GIVEN, + metadata: WorkerMetadataParam, cf_worker_body_part: str | NotGiven = NOT_GIVEN, cf_worker_main_module_part: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -86,13 +83,6 @@ def update( script_name: Name of the script, used in URLs and route configuration. - any_part_name: A module comprising a Worker script, often a javascript file. Multiple modules - may be provided as separate named parts, but at least one module must be - present. This should be referenced either in the metadata as `main_module` - (esm)/`body_part` (service worker) or as a header `CF-WORKER-MAIN-MODULE-PART` - (esm) /`CF-WORKER-BODY-PART` (service worker) by part name. Source maps may also - be included using the `application/source-map` content type. - metadata: JSON encoded metadata about the uploaded parts and Worker configuration. extra_headers: Send extra headers @@ -118,21 +108,13 @@ def update( ), **(extra_headers or {}), } - body = deepcopy_minimal( - { - "any_part_name": any_part_name, - "metadata": metadata, - } - ) - files = extract_files(cast(Mapping[str, object], body), paths=[["", ""]]) # It should be noted that the actual Content-Type header that will be # sent to the server will contain a `boundary` parameter, e.g. # multipart/form-data; boundary=---abc-- extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} return self._put( f"/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/content", - body=maybe_transform(body, content_update_params.ContentUpdateParams), - files=files, + body=maybe_transform({"metadata": metadata}, content_update_params.ContentUpdateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -217,8 +199,7 @@ async def update( *, account_id: str, dispatch_namespace: str, - any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, - metadata: WorkerMetadataParam | NotGiven = NOT_GIVEN, + metadata: WorkerMetadataParam, cf_worker_body_part: str | NotGiven = NOT_GIVEN, cf_worker_main_module_part: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -238,13 +219,6 @@ async def update( script_name: Name of the script, used in URLs and route configuration. - any_part_name: A module comprising a Worker script, often a javascript file. Multiple modules - may be provided as separate named parts, but at least one module must be - present. This should be referenced either in the metadata as `main_module` - (esm)/`body_part` (service worker) or as a header `CF-WORKER-MAIN-MODULE-PART` - (esm) /`CF-WORKER-BODY-PART` (service worker) by part name. Source maps may also - be included using the `application/source-map` content type. - metadata: JSON encoded metadata about the uploaded parts and Worker configuration. extra_headers: Send extra headers @@ -270,21 +244,13 @@ async def update( ), **(extra_headers or {}), } - body = deepcopy_minimal( - { - "any_part_name": any_part_name, - "metadata": metadata, - } - ) - files = extract_files(cast(Mapping[str, object], body), paths=[["", ""]]) # It should be noted that the actual Content-Type header that will be # sent to the server will contain a `boundary` parameter, e.g. # multipart/form-data; boundary=---abc-- extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} return await self._put( f"/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/content", - body=await async_maybe_transform(body, content_update_params.ContentUpdateParams), - files=files, + body=await async_maybe_transform({"metadata": metadata}, content_update_params.ContentUpdateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/scripts.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/scripts.py index 1f29a5acbe9..054cb9de7be 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/scripts.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/scripts.py @@ -2,8 +2,7 @@ from __future__ import annotations -from typing import List, Type, Optional, cast -from typing_extensions import overload +from typing import Type, Optional, cast import httpx @@ -47,13 +46,20 @@ SettingsResourceWithStreamingResponse, AsyncSettingsResourceWithStreamingResponse, ) -from ......_types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, FileTypes +from ......_types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven from ......_utils import ( - required_args, maybe_transform, async_maybe_transform, ) from ......_compat import cached_property +from .asset_upload import ( + AssetUploadResource, + AsyncAssetUploadResource, + AssetUploadResourceWithRawResponse, + AsyncAssetUploadResourceWithRawResponse, + AssetUploadResourceWithStreamingResponse, + AsyncAssetUploadResourceWithStreamingResponse, +) from ......_resource import SyncAPIResource, AsyncAPIResource from ......_response import ( to_raw_response_wrapper, @@ -71,6 +77,10 @@ class ScriptsResource(SyncAPIResource): + @cached_property + def asset_upload(self) -> AssetUploadResource: + return AssetUploadResource(self._client) + @cached_property def content(self) -> ContentResource: return ContentResource(self._client) @@ -110,15 +120,13 @@ def with_streaming_response(self) -> ScriptsResourceWithStreamingResponse: """ return ScriptsResourceWithStreamingResponse(self) - @overload def update( self, script_name: str, *, account_id: str, dispatch_namespace: str, - any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, - metadata: script_update_params.Variant0Metadata | NotGiven = NOT_GIVEN, + metadata: script_update_params.Metadata, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -139,12 +147,6 @@ def update( script_name: Name of the script, used in URLs and route configuration. - any_part_name: A module comprising a Worker script, often a javascript file. Multiple modules - may be provided as separate named parts, but at least one module must be present - and referenced in the metadata as `main_module` or `body_part` by part name. - Source maps may also be included using the `application/source-map` content - type. - metadata: JSON encoded metadata about the uploaded parts and Worker configuration. extra_headers: Send extra headers @@ -155,66 +157,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - def update( - self, - script_name: str, - *, - account_id: str, - dispatch_namespace: str, - message: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ScriptUpdateResponse]: - """Upload a worker module to a Workers for Platforms namespace. - - You can find more - about the multipart metadata on our docs: - https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/. - - Args: - account_id: Identifier - - dispatch_namespace: Name of the Workers for Platforms dispatch namespace. - - script_name: Name of the script, used in URLs and route configuration. - - message: Rollback message to be associated with this deployment. Only parsed when query - param `"rollback_to"` is present. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args(["account_id", "dispatch_namespace"]) - def update( - self, - script_name: str, - *, - account_id: str, - dispatch_namespace: str, - any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, - metadata: script_update_params.Variant0Metadata | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ScriptUpdateResponse]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -223,14 +165,7 @@ def update( raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") return self._put( f"/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}", - body=maybe_transform( - { - "any_part_name": any_part_name, - "metadata": metadata, - "message": message, - }, - script_update_params.ScriptUpdateParams, - ), + body=maybe_transform({"metadata": metadata}, script_update_params.ScriptUpdateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -349,6 +284,10 @@ def get( class AsyncScriptsResource(AsyncAPIResource): + @cached_property + def asset_upload(self) -> AsyncAssetUploadResource: + return AsyncAssetUploadResource(self._client) + @cached_property def content(self) -> AsyncContentResource: return AsyncContentResource(self._client) @@ -388,15 +327,13 @@ def with_streaming_response(self) -> AsyncScriptsResourceWithStreamingResponse: """ return AsyncScriptsResourceWithStreamingResponse(self) - @overload async def update( self, script_name: str, *, account_id: str, dispatch_namespace: str, - any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, - metadata: script_update_params.Variant0Metadata | NotGiven = NOT_GIVEN, + metadata: script_update_params.Metadata, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -417,12 +354,6 @@ async def update( script_name: Name of the script, used in URLs and route configuration. - any_part_name: A module comprising a Worker script, often a javascript file. Multiple modules - may be provided as separate named parts, but at least one module must be present - and referenced in the metadata as `main_module` or `body_part` by part name. - Source maps may also be included using the `application/source-map` content - type. - metadata: JSON encoded metadata about the uploaded parts and Worker configuration. extra_headers: Send extra headers @@ -433,66 +364,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @overload - async def update( - self, - script_name: str, - *, - account_id: str, - dispatch_namespace: str, - message: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ScriptUpdateResponse]: - """Upload a worker module to a Workers for Platforms namespace. - - You can find more - about the multipart metadata on our docs: - https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/. - - Args: - account_id: Identifier - - dispatch_namespace: Name of the Workers for Platforms dispatch namespace. - - script_name: Name of the script, used in URLs and route configuration. - - message: Rollback message to be associated with this deployment. Only parsed when query - param `"rollback_to"` is present. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @required_args(["account_id", "dispatch_namespace"]) - async def update( - self, - script_name: str, - *, - account_id: str, - dispatch_namespace: str, - any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, - metadata: script_update_params.Variant0Metadata | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ScriptUpdateResponse]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -501,14 +372,7 @@ async def update( raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") return await self._put( f"/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}", - body=await async_maybe_transform( - { - "any_part_name": any_part_name, - "metadata": metadata, - "message": message, - }, - script_update_params.ScriptUpdateParams, - ), + body=await async_maybe_transform({"metadata": metadata}, script_update_params.ScriptUpdateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -640,6 +504,10 @@ def __init__(self, scripts: ScriptsResource) -> None: scripts.get, ) + @cached_property + def asset_upload(self) -> AssetUploadResourceWithRawResponse: + return AssetUploadResourceWithRawResponse(self._scripts.asset_upload) + @cached_property def content(self) -> ContentResourceWithRawResponse: return ContentResourceWithRawResponse(self._scripts.content) @@ -675,6 +543,10 @@ def __init__(self, scripts: AsyncScriptsResource) -> None: scripts.get, ) + @cached_property + def asset_upload(self) -> AsyncAssetUploadResourceWithRawResponse: + return AsyncAssetUploadResourceWithRawResponse(self._scripts.asset_upload) + @cached_property def content(self) -> AsyncContentResourceWithRawResponse: return AsyncContentResourceWithRawResponse(self._scripts.content) @@ -710,6 +582,10 @@ def __init__(self, scripts: ScriptsResource) -> None: scripts.get, ) + @cached_property + def asset_upload(self) -> AssetUploadResourceWithStreamingResponse: + return AssetUploadResourceWithStreamingResponse(self._scripts.asset_upload) + @cached_property def content(self) -> ContentResourceWithStreamingResponse: return ContentResourceWithStreamingResponse(self._scripts.content) @@ -745,6 +621,10 @@ def __init__(self, scripts: AsyncScriptsResource) -> None: scripts.get, ) + @cached_property + def asset_upload(self) -> AsyncAssetUploadResourceWithStreamingResponse: + return AsyncAssetUploadResourceWithStreamingResponse(self._scripts.asset_upload) + @cached_property def content(self) -> AsyncContentResourceWithStreamingResponse: return AsyncContentResourceWithStreamingResponse(self._scripts.content) diff --git a/src/cloudflare/resources/zero_trust/access/__init__.py b/src/cloudflare/resources/zero_trust/access/__init__.py index d368bdfbfc8..12bf11047ec 100644 --- a/src/cloudflare/resources/zero_trust/access/__init__.py +++ b/src/cloudflare/resources/zero_trust/access/__init__.py @@ -64,6 +64,14 @@ BookmarksResourceWithStreamingResponse, AsyncBookmarksResourceWithStreamingResponse, ) +from .gateway_ca import ( + GatewayCAResource, + AsyncGatewayCAResource, + GatewayCAResourceWithRawResponse, + AsyncGatewayCAResourceWithRawResponse, + GatewayCAResourceWithStreamingResponse, + AsyncGatewayCAResourceWithStreamingResponse, +) from .applications import ( ApplicationsResource, AsyncApplicationsResource, @@ -106,6 +114,12 @@ ) __all__ = [ + "GatewayCAResource", + "AsyncGatewayCAResource", + "GatewayCAResourceWithRawResponse", + "AsyncGatewayCAResourceWithRawResponse", + "GatewayCAResourceWithStreamingResponse", + "AsyncGatewayCAResourceWithStreamingResponse", "InfrastructureResource", "AsyncInfrastructureResource", "InfrastructureResourceWithRawResponse", diff --git a/src/cloudflare/resources/zero_trust/access/access.py b/src/cloudflare/resources/zero_trust/access/access.py index c76631f16f5..d6aef830815 100644 --- a/src/cloudflare/resources/zero_trust/access/access.py +++ b/src/cloudflare/resources/zero_trust/access/access.py @@ -51,6 +51,14 @@ AsyncLogsResourceWithStreamingResponse, ) from ...._compat import cached_property +from .gateway_ca import ( + GatewayCAResource, + AsyncGatewayCAResource, + GatewayCAResourceWithRawResponse, + AsyncGatewayCAResourceWithRawResponse, + GatewayCAResourceWithStreamingResponse, + AsyncGatewayCAResourceWithStreamingResponse, +) from .users.users import ( UsersResource, AsyncUsersResource, @@ -105,6 +113,10 @@ class AccessResource(SyncAPIResource): + @cached_property + def gateway_ca(self) -> GatewayCAResource: + return GatewayCAResource(self._client) + @cached_property def infrastructure(self) -> InfrastructureResource: return InfrastructureResource(self._client) @@ -174,6 +186,10 @@ def with_streaming_response(self) -> AccessResourceWithStreamingResponse: class AsyncAccessResource(AsyncAPIResource): + @cached_property + def gateway_ca(self) -> AsyncGatewayCAResource: + return AsyncGatewayCAResource(self._client) + @cached_property def infrastructure(self) -> AsyncInfrastructureResource: return AsyncInfrastructureResource(self._client) @@ -246,6 +262,10 @@ class AccessResourceWithRawResponse: def __init__(self, access: AccessResource) -> None: self._access = access + @cached_property + def gateway_ca(self) -> GatewayCAResourceWithRawResponse: + return GatewayCAResourceWithRawResponse(self._access.gateway_ca) + @cached_property def infrastructure(self) -> InfrastructureResourceWithRawResponse: return InfrastructureResourceWithRawResponse(self._access.infrastructure) @@ -299,6 +319,10 @@ class AsyncAccessResourceWithRawResponse: def __init__(self, access: AsyncAccessResource) -> None: self._access = access + @cached_property + def gateway_ca(self) -> AsyncGatewayCAResourceWithRawResponse: + return AsyncGatewayCAResourceWithRawResponse(self._access.gateway_ca) + @cached_property def infrastructure(self) -> AsyncInfrastructureResourceWithRawResponse: return AsyncInfrastructureResourceWithRawResponse(self._access.infrastructure) @@ -352,6 +376,10 @@ class AccessResourceWithStreamingResponse: def __init__(self, access: AccessResource) -> None: self._access = access + @cached_property + def gateway_ca(self) -> GatewayCAResourceWithStreamingResponse: + return GatewayCAResourceWithStreamingResponse(self._access.gateway_ca) + @cached_property def infrastructure(self) -> InfrastructureResourceWithStreamingResponse: return InfrastructureResourceWithStreamingResponse(self._access.infrastructure) @@ -405,6 +433,10 @@ class AsyncAccessResourceWithStreamingResponse: def __init__(self, access: AsyncAccessResource) -> None: self._access = access + @cached_property + def gateway_ca(self) -> AsyncGatewayCAResourceWithStreamingResponse: + return AsyncGatewayCAResourceWithStreamingResponse(self._access.gateway_ca) + @cached_property def infrastructure(self) -> AsyncInfrastructureResourceWithStreamingResponse: return AsyncInfrastructureResourceWithStreamingResponse(self._access.infrastructure) diff --git a/src/cloudflare/resources/zero_trust/access/gateway_ca.py b/src/cloudflare/resources/zero_trust/access/gateway_ca.py new file mode 100644 index 00000000000..d349400078f --- /dev/null +++ b/src/cloudflare/resources/zero_trust/access/gateway_ca.py @@ -0,0 +1,365 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, Optional, cast + +import httpx + +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...._wrappers import ResultWrapper +from ....pagination import SyncSinglePage, AsyncSinglePage +from ...._base_client import AsyncPaginator, make_request_options +from ....types.zero_trust.access.gateway_ca_list_response import GatewayCAListResponse +from ....types.zero_trust.access.gateway_ca_create_response import GatewayCACreateResponse +from ....types.zero_trust.access.gateway_ca_delete_response import GatewayCADeleteResponse + +__all__ = ["GatewayCAResource", "AsyncGatewayCAResource"] + + +class GatewayCAResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> GatewayCAResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return GatewayCAResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> GatewayCAResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return GatewayCAResourceWithStreamingResponse(self) + + def create( + self, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[GatewayCACreateResponse]: + """ + Adds a new SSH Certificate Authority (CA). + + Args: + account_id: Identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._post( + f"/accounts/{account_id}/access/gateway_ca", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[GatewayCACreateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[GatewayCACreateResponse]], ResultWrapper[GatewayCACreateResponse]), + ) + + def list( + self, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncSinglePage[GatewayCAListResponse]: + """ + Lists SSH Certificate Authorities (CA). + + Args: + account_id: Identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get_api_list( + f"/accounts/{account_id}/access/gateway_ca", + page=SyncSinglePage[GatewayCAListResponse], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=GatewayCAListResponse, + ) + + def delete( + self, + certificate_id: str, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[GatewayCADeleteResponse]: + """ + Deletes an SSH Certificate Authority. + + Args: + account_id: Identifier + + certificate_id: UUID + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not certificate_id: + raise ValueError(f"Expected a non-empty value for `certificate_id` but received {certificate_id!r}") + return self._delete( + f"/accounts/{account_id}/access/gateway_ca/{certificate_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[GatewayCADeleteResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[GatewayCADeleteResponse]], ResultWrapper[GatewayCADeleteResponse]), + ) + + +class AsyncGatewayCAResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncGatewayCAResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncGatewayCAResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncGatewayCAResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncGatewayCAResourceWithStreamingResponse(self) + + async def create( + self, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[GatewayCACreateResponse]: + """ + Adds a new SSH Certificate Authority (CA). + + Args: + account_id: Identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return await self._post( + f"/accounts/{account_id}/access/gateway_ca", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[GatewayCACreateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[GatewayCACreateResponse]], ResultWrapper[GatewayCACreateResponse]), + ) + + def list( + self, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[GatewayCAListResponse, AsyncSinglePage[GatewayCAListResponse]]: + """ + Lists SSH Certificate Authorities (CA). + + Args: + account_id: Identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get_api_list( + f"/accounts/{account_id}/access/gateway_ca", + page=AsyncSinglePage[GatewayCAListResponse], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=GatewayCAListResponse, + ) + + async def delete( + self, + certificate_id: str, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[GatewayCADeleteResponse]: + """ + Deletes an SSH Certificate Authority. + + Args: + account_id: Identifier + + certificate_id: UUID + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not certificate_id: + raise ValueError(f"Expected a non-empty value for `certificate_id` but received {certificate_id!r}") + return await self._delete( + f"/accounts/{account_id}/access/gateway_ca/{certificate_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[GatewayCADeleteResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[GatewayCADeleteResponse]], ResultWrapper[GatewayCADeleteResponse]), + ) + + +class GatewayCAResourceWithRawResponse: + def __init__(self, gateway_ca: GatewayCAResource) -> None: + self._gateway_ca = gateway_ca + + self.create = to_raw_response_wrapper( + gateway_ca.create, + ) + self.list = to_raw_response_wrapper( + gateway_ca.list, + ) + self.delete = to_raw_response_wrapper( + gateway_ca.delete, + ) + + +class AsyncGatewayCAResourceWithRawResponse: + def __init__(self, gateway_ca: AsyncGatewayCAResource) -> None: + self._gateway_ca = gateway_ca + + self.create = async_to_raw_response_wrapper( + gateway_ca.create, + ) + self.list = async_to_raw_response_wrapper( + gateway_ca.list, + ) + self.delete = async_to_raw_response_wrapper( + gateway_ca.delete, + ) + + +class GatewayCAResourceWithStreamingResponse: + def __init__(self, gateway_ca: GatewayCAResource) -> None: + self._gateway_ca = gateway_ca + + self.create = to_streamed_response_wrapper( + gateway_ca.create, + ) + self.list = to_streamed_response_wrapper( + gateway_ca.list, + ) + self.delete = to_streamed_response_wrapper( + gateway_ca.delete, + ) + + +class AsyncGatewayCAResourceWithStreamingResponse: + def __init__(self, gateway_ca: AsyncGatewayCAResource) -> None: + self._gateway_ca = gateway_ca + + self.create = async_to_streamed_response_wrapper( + gateway_ca.create, + ) + self.list = async_to_streamed_response_wrapper( + gateway_ca.list, + ) + self.delete = async_to_streamed_response_wrapper( + gateway_ca.delete, + ) diff --git a/src/cloudflare/resources/zero_trust/access/infrastructure/targets.py b/src/cloudflare/resources/zero_trust/access/infrastructure/targets.py index 364b09d482d..ff0a4df5312 100644 --- a/src/cloudflare/resources/zero_trust/access/infrastructure/targets.py +++ b/src/cloudflare/resources/zero_trust/access/infrastructure/targets.py @@ -2,8 +2,9 @@ from __future__ import annotations -from typing import Type, Union, Iterable, Optional, cast +from typing import List, Type, Union, Iterable, Optional, cast from datetime import datetime +from typing_extensions import Literal import httpx @@ -176,11 +177,16 @@ def list( *, account_id: str, created_after: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + created_before: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, hostname: Optional[str] | NotGiven = NOT_GIVEN, hostname_contains: Optional[str] | NotGiven = NOT_GIVEN, ip_v4: Optional[str] | NotGiven = NOT_GIVEN, ip_v6: Optional[str] | NotGiven = NOT_GIVEN, + ips: List[str] | NotGiven = NOT_GIVEN, modified_after: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + modified_before: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + order: Literal["hostname", "created_at"] | NotGiven = NOT_GIVEN, page: int | NotGiven = NOT_GIVEN, per_page: int | NotGiven = NOT_GIVEN, virtual_network_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -191,13 +197,20 @@ def list( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncV4PagePaginationArray[TargetListResponse]: - """ - List all targets + """Lists and sorts an account’s targets. + + Filters are optional and are ORed + together. However, when a timestamp is specified with both its before and after + counterparts, the timestamp filters are ANDed. Args: account_id: Account identifier - created_after: Date and time at which the target was created + created_after: Date and time at which the target was created after (inclusive) + + created_before: Date and time at which the target was created before (inclusive) + + direction: The sorting direction. hostname: Hostname of a target @@ -207,7 +220,14 @@ def list( ip_v6: IPv6 address of the target - modified_after: Date and time at which the target was modified + ips: Filters for targets that have any of the following IP addresses. Specify `ips` + multiple times in query parameter to build list of candidates. + + modified_after: Date and time at which the target was modified after (inclusive) + + modified_before: Date and time at which the target was modified before (inclusive) + + order: The field to sort by. page: Current page in the response @@ -236,11 +256,16 @@ def list( query=maybe_transform( { "created_after": created_after, + "created_before": created_before, + "direction": direction, "hostname": hostname, "hostname_contains": hostname_contains, "ip_v4": ip_v4, "ip_v6": ip_v6, + "ips": ips, "modified_after": modified_after, + "modified_before": modified_before, + "order": order, "page": page, "per_page": per_page, "virtual_network_id": virtual_network_id, @@ -548,11 +573,16 @@ def list( *, account_id: str, created_after: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + created_before: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, hostname: Optional[str] | NotGiven = NOT_GIVEN, hostname_contains: Optional[str] | NotGiven = NOT_GIVEN, ip_v4: Optional[str] | NotGiven = NOT_GIVEN, ip_v6: Optional[str] | NotGiven = NOT_GIVEN, + ips: List[str] | NotGiven = NOT_GIVEN, modified_after: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + modified_before: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + order: Literal["hostname", "created_at"] | NotGiven = NOT_GIVEN, page: int | NotGiven = NOT_GIVEN, per_page: int | NotGiven = NOT_GIVEN, virtual_network_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -563,13 +593,20 @@ def list( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[TargetListResponse, AsyncV4PagePaginationArray[TargetListResponse]]: - """ - List all targets + """Lists and sorts an account’s targets. + + Filters are optional and are ORed + together. However, when a timestamp is specified with both its before and after + counterparts, the timestamp filters are ANDed. Args: account_id: Account identifier - created_after: Date and time at which the target was created + created_after: Date and time at which the target was created after (inclusive) + + created_before: Date and time at which the target was created before (inclusive) + + direction: The sorting direction. hostname: Hostname of a target @@ -579,7 +616,14 @@ def list( ip_v6: IPv6 address of the target - modified_after: Date and time at which the target was modified + ips: Filters for targets that have any of the following IP addresses. Specify `ips` + multiple times in query parameter to build list of candidates. + + modified_after: Date and time at which the target was modified after (inclusive) + + modified_before: Date and time at which the target was modified before (inclusive) + + order: The field to sort by. page: Current page in the response @@ -608,11 +652,16 @@ def list( query=maybe_transform( { "created_after": created_after, + "created_before": created_before, + "direction": direction, "hostname": hostname, "hostname_contains": hostname_contains, "ip_v4": ip_v4, "ip_v6": ip_v6, + "ips": ips, "modified_after": modified_after, + "modified_before": modified_before, + "order": order, "page": page, "per_page": per_page, "virtual_network_id": virtual_network_id, diff --git a/src/cloudflare/resources/zero_trust/devices/devices.py b/src/cloudflare/resources/zero_trust/devices/devices.py index 3b946277c22..cdb59f224e5 100644 --- a/src/cloudflare/resources/zero_trust/devices/devices.py +++ b/src/cloudflare/resources/zero_trust/devices/devices.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, cast +from typing import Type, Optional, cast import httpx @@ -197,7 +197,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DeviceGetResponse: + ) -> Optional[DeviceGetResponse]: """ Fetches details for a single device. @@ -216,21 +216,16 @@ def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not device_id: raise ValueError(f"Expected a non-empty value for `device_id` but received {device_id!r}") - return cast( - DeviceGetResponse, - self._get( - f"/accounts/{account_id}/devices/{device_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[DeviceGetResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[DeviceGetResponse] - ), # Union types cannot be passed in as arguments in the type system + return self._get( + f"/accounts/{account_id}/devices/{device_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[DeviceGetResponse]]._unwrapper, ), + cast_to=cast(Type[Optional[DeviceGetResponse]], ResultWrapper[DeviceGetResponse]), ) @@ -335,7 +330,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DeviceGetResponse: + ) -> Optional[DeviceGetResponse]: """ Fetches details for a single device. @@ -354,21 +349,16 @@ async def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not device_id: raise ValueError(f"Expected a non-empty value for `device_id` but received {device_id!r}") - return cast( - DeviceGetResponse, - await self._get( - f"/accounts/{account_id}/devices/{device_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[DeviceGetResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[DeviceGetResponse] - ), # Union types cannot be passed in as arguments in the type system + return await self._get( + f"/accounts/{account_id}/devices/{device_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[DeviceGetResponse]]._unwrapper, ), + cast_to=cast(Type[Optional[DeviceGetResponse]], ResultWrapper[DeviceGetResponse]), ) diff --git a/src/cloudflare/resources/zero_trust/devices/fleet_status.py b/src/cloudflare/resources/zero_trust/devices/fleet_status.py index 871b776677f..57b2c298c03 100644 --- a/src/cloudflare/resources/zero_trust/devices/fleet_status.py +++ b/src/cloudflare/resources/zero_trust/devices/fleet_status.py @@ -85,7 +85,7 @@ def get( if not device_id: raise ValueError(f"Expected a non-empty value for `device_id` but received {device_id!r}") return self._get( - f"/accounts/{account_id}/devices/{device_id}/fleet-status/live", + f"/accounts/{account_id}/dex/devices/{device_id}/fleet-status/live", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -165,7 +165,7 @@ async def get( if not device_id: raise ValueError(f"Expected a non-empty value for `device_id` but received {device_id!r}") return await self._get( - f"/accounts/{account_id}/devices/{device_id}/fleet-status/live", + f"/accounts/{account_id}/dex/devices/{device_id}/fleet-status/live", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/cloudflare/resources/zero_trust/devices/policies/default/certificates.py b/src/cloudflare/resources/zero_trust/devices/policies/default/certificates.py index 1996ac06b92..d14e2eaa953 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/default/certificates.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/default/certificates.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, cast +from typing import Any, Optional, cast import httpx @@ -59,7 +59,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CertificateEditResponse: + ) -> Optional[CertificateEditResponse]: """ Enable Zero Trust Clients to provision a certificate, containing a x509 subject, and referenced by Access device posture policies when the client visits MTLS @@ -80,7 +80,7 @@ def edit( if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( - CertificateEditResponse, + Optional[CertificateEditResponse], self._patch( f"/zones/{zone_id}/devices/policy/certificates", body=maybe_transform({"enabled": enabled}, certificate_edit_params.CertificateEditParams), @@ -89,7 +89,7 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CertificateEditResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CertificateEditResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[CertificateEditResponse] @@ -107,7 +107,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CertificateGetResponse: + ) -> Optional[CertificateGetResponse]: """ Fetches device certificate provisioning @@ -123,7 +123,7 @@ def get( if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( - CertificateGetResponse, + Optional[CertificateGetResponse], self._get( f"/zones/{zone_id}/devices/policy/certificates", options=make_request_options( @@ -131,7 +131,7 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CertificateGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CertificateGetResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[CertificateGetResponse] @@ -171,7 +171,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CertificateEditResponse: + ) -> Optional[CertificateEditResponse]: """ Enable Zero Trust Clients to provision a certificate, containing a x509 subject, and referenced by Access device posture policies when the client visits MTLS @@ -192,7 +192,7 @@ async def edit( if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( - CertificateEditResponse, + Optional[CertificateEditResponse], await self._patch( f"/zones/{zone_id}/devices/policy/certificates", body=await async_maybe_transform({"enabled": enabled}, certificate_edit_params.CertificateEditParams), @@ -201,7 +201,7 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CertificateEditResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CertificateEditResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[CertificateEditResponse] @@ -219,7 +219,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CertificateGetResponse: + ) -> Optional[CertificateGetResponse]: """ Fetches device certificate provisioning @@ -235,7 +235,7 @@ async def get( if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( - CertificateGetResponse, + Optional[CertificateGetResponse], await self._get( f"/zones/{zone_id}/devices/policy/certificates", options=make_request_options( @@ -243,7 +243,7 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CertificateGetResponse]._unwrapper, + post_parser=ResultWrapper[Optional[CertificateGetResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[CertificateGetResponse] diff --git a/src/cloudflare/resources/zero_trust/devices/posture/integrations.py b/src/cloudflare/resources/zero_trust/devices/posture/integrations.py index 0074d8055da..c02ac6559f6 100644 --- a/src/cloudflare/resources/zero_trust/devices/posture/integrations.py +++ b/src/cloudflare/resources/zero_trust/devices/posture/integrations.py @@ -156,7 +156,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> IntegrationDeleteResponse: + ) -> Optional[IntegrationDeleteResponse]: """ Delete a configured device posture integration. @@ -176,7 +176,7 @@ def delete( if not integration_id: raise ValueError(f"Expected a non-empty value for `integration_id` but received {integration_id!r}") return cast( - IntegrationDeleteResponse, + Optional[IntegrationDeleteResponse], self._delete( f"/accounts/{account_id}/devices/posture/integration/{integration_id}", options=make_request_options( @@ -184,7 +184,7 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[IntegrationDeleteResponse]._unwrapper, + post_parser=ResultWrapper[Optional[IntegrationDeleteResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[IntegrationDeleteResponse] @@ -428,7 +428,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> IntegrationDeleteResponse: + ) -> Optional[IntegrationDeleteResponse]: """ Delete a configured device posture integration. @@ -448,7 +448,7 @@ async def delete( if not integration_id: raise ValueError(f"Expected a non-empty value for `integration_id` but received {integration_id!r}") return cast( - IntegrationDeleteResponse, + Optional[IntegrationDeleteResponse], await self._delete( f"/accounts/{account_id}/devices/posture/integration/{integration_id}", options=make_request_options( @@ -456,7 +456,7 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[IntegrationDeleteResponse]._unwrapper, + post_parser=ResultWrapper[Optional[IntegrationDeleteResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[IntegrationDeleteResponse] diff --git a/src/cloudflare/resources/zero_trust/devices/revoke.py b/src/cloudflare/resources/zero_trust/devices/revoke.py index d14f3536764..3057bf6c62d 100644 --- a/src/cloudflare/resources/zero_trust/devices/revoke.py +++ b/src/cloudflare/resources/zero_trust/devices/revoke.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, List, cast +from typing import Any, List, Optional, cast import httpx @@ -57,7 +57,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RevokeCreateResponse: + ) -> Optional[RevokeCreateResponse]: """ Revokes a list of devices. @@ -75,7 +75,7 @@ def create( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( - RevokeCreateResponse, + Optional[RevokeCreateResponse], self._post( f"/accounts/{account_id}/devices/revoke", body=maybe_transform(body, List[str]), @@ -84,7 +84,7 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[RevokeCreateResponse]._unwrapper, + post_parser=ResultWrapper[Optional[RevokeCreateResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[RevokeCreateResponse] @@ -124,7 +124,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RevokeCreateResponse: + ) -> Optional[RevokeCreateResponse]: """ Revokes a list of devices. @@ -142,7 +142,7 @@ async def create( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( - RevokeCreateResponse, + Optional[RevokeCreateResponse], await self._post( f"/accounts/{account_id}/devices/revoke", body=await async_maybe_transform(body, List[str]), @@ -151,7 +151,7 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[RevokeCreateResponse]._unwrapper, + post_parser=ResultWrapper[Optional[RevokeCreateResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[RevokeCreateResponse] diff --git a/src/cloudflare/resources/zero_trust/devices/unrevoke.py b/src/cloudflare/resources/zero_trust/devices/unrevoke.py index 3c4489edec1..b99f36a0037 100644 --- a/src/cloudflare/resources/zero_trust/devices/unrevoke.py +++ b/src/cloudflare/resources/zero_trust/devices/unrevoke.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, List, cast +from typing import Any, List, Optional, cast import httpx @@ -57,7 +57,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> UnrevokeCreateResponse: + ) -> Optional[UnrevokeCreateResponse]: """ Unrevokes a list of devices. @@ -75,7 +75,7 @@ def create( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( - UnrevokeCreateResponse, + Optional[UnrevokeCreateResponse], self._post( f"/accounts/{account_id}/devices/unrevoke", body=maybe_transform(body, List[str]), @@ -84,7 +84,7 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[UnrevokeCreateResponse]._unwrapper, + post_parser=ResultWrapper[Optional[UnrevokeCreateResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[UnrevokeCreateResponse] @@ -124,7 +124,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> UnrevokeCreateResponse: + ) -> Optional[UnrevokeCreateResponse]: """ Unrevokes a list of devices. @@ -142,7 +142,7 @@ async def create( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( - UnrevokeCreateResponse, + Optional[UnrevokeCreateResponse], await self._post( f"/accounts/{account_id}/devices/unrevoke", body=await async_maybe_transform(body, List[str]), @@ -151,7 +151,7 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[UnrevokeCreateResponse]._unwrapper, + post_parser=ResultWrapper[Optional[UnrevokeCreateResponse]]._unwrapper, ), cast_to=cast( Any, ResultWrapper[UnrevokeCreateResponse] diff --git a/src/cloudflare/resources/zero_trust/dex/commands/__init__.py b/src/cloudflare/resources/zero_trust/dex/commands/__init__.py index 4566edefe96..1cf551c58ba 100644 --- a/src/cloudflare/resources/zero_trust/dex/commands/__init__.py +++ b/src/cloudflare/resources/zero_trust/dex/commands/__init__.py @@ -8,6 +8,22 @@ QuotaResourceWithStreamingResponse, AsyncQuotaResourceWithStreamingResponse, ) +from .users import ( + UsersResource, + AsyncUsersResource, + UsersResourceWithRawResponse, + AsyncUsersResourceWithRawResponse, + UsersResourceWithStreamingResponse, + AsyncUsersResourceWithStreamingResponse, +) +from .devices import ( + DevicesResource, + AsyncDevicesResource, + DevicesResourceWithRawResponse, + AsyncDevicesResourceWithRawResponse, + DevicesResourceWithStreamingResponse, + AsyncDevicesResourceWithStreamingResponse, +) from .commands import ( CommandsResource, AsyncCommandsResource, @@ -26,6 +42,18 @@ ) __all__ = [ + "UsersResource", + "AsyncUsersResource", + "UsersResourceWithRawResponse", + "AsyncUsersResourceWithRawResponse", + "UsersResourceWithStreamingResponse", + "AsyncUsersResourceWithStreamingResponse", + "DevicesResource", + "AsyncDevicesResource", + "DevicesResourceWithRawResponse", + "AsyncDevicesResourceWithRawResponse", + "DevicesResourceWithStreamingResponse", + "AsyncDevicesResourceWithStreamingResponse", "DownloadsResource", "AsyncDownloadsResource", "DownloadsResourceWithRawResponse", diff --git a/src/cloudflare/resources/zero_trust/dex/commands/commands.py b/src/cloudflare/resources/zero_trust/dex/commands/commands.py index f59aadf5646..7f887f8e617 100644 --- a/src/cloudflare/resources/zero_trust/dex/commands/commands.py +++ b/src/cloudflare/resources/zero_trust/dex/commands/commands.py @@ -16,6 +16,22 @@ QuotaResourceWithStreamingResponse, AsyncQuotaResourceWithStreamingResponse, ) +from .users import ( + UsersResource, + AsyncUsersResource, + UsersResourceWithRawResponse, + AsyncUsersResourceWithRawResponse, + UsersResourceWithStreamingResponse, + AsyncUsersResourceWithStreamingResponse, +) +from .devices import ( + DevicesResource, + AsyncDevicesResource, + DevicesResourceWithRawResponse, + AsyncDevicesResourceWithRawResponse, + DevicesResourceWithStreamingResponse, + AsyncDevicesResourceWithStreamingResponse, +) from .downloads import ( DownloadsResource, AsyncDownloadsResource, @@ -48,6 +64,14 @@ class CommandsResource(SyncAPIResource): + @cached_property + def users(self) -> UsersResource: + return UsersResource(self._client) + + @cached_property + def devices(self) -> DevicesResource: + return DevicesResource(self._client) + @cached_property def downloads(self) -> DownloadsResource: return DownloadsResource(self._client) @@ -104,7 +128,7 @@ def create( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( - f"/accounts/{account_id}/commands", + f"/accounts/{account_id}/dex/commands", body=maybe_transform({"commands": commands}, command_create_params.CommandCreateParams), options=make_request_options( extra_headers=extra_headers, @@ -167,7 +191,7 @@ def list( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( - f"/accounts/{account_id}/commands", + f"/accounts/{account_id}/dex/commands", page=SyncV4PagePagination[Optional[CommandListResponse]], options=make_request_options( extra_headers=extra_headers, @@ -193,6 +217,14 @@ def list( class AsyncCommandsResource(AsyncAPIResource): + @cached_property + def users(self) -> AsyncUsersResource: + return AsyncUsersResource(self._client) + + @cached_property + def devices(self) -> AsyncDevicesResource: + return AsyncDevicesResource(self._client) + @cached_property def downloads(self) -> AsyncDownloadsResource: return AsyncDownloadsResource(self._client) @@ -249,7 +281,7 @@ async def create( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( - f"/accounts/{account_id}/commands", + f"/accounts/{account_id}/dex/commands", body=await async_maybe_transform({"commands": commands}, command_create_params.CommandCreateParams), options=make_request_options( extra_headers=extra_headers, @@ -312,7 +344,7 @@ def list( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( - f"/accounts/{account_id}/commands", + f"/accounts/{account_id}/dex/commands", page=AsyncV4PagePagination[Optional[CommandListResponse]], options=make_request_options( extra_headers=extra_headers, @@ -348,6 +380,14 @@ def __init__(self, commands: CommandsResource) -> None: commands.list, ) + @cached_property + def users(self) -> UsersResourceWithRawResponse: + return UsersResourceWithRawResponse(self._commands.users) + + @cached_property + def devices(self) -> DevicesResourceWithRawResponse: + return DevicesResourceWithRawResponse(self._commands.devices) + @cached_property def downloads(self) -> DownloadsResourceWithRawResponse: return DownloadsResourceWithRawResponse(self._commands.downloads) @@ -368,6 +408,14 @@ def __init__(self, commands: AsyncCommandsResource) -> None: commands.list, ) + @cached_property + def users(self) -> AsyncUsersResourceWithRawResponse: + return AsyncUsersResourceWithRawResponse(self._commands.users) + + @cached_property + def devices(self) -> AsyncDevicesResourceWithRawResponse: + return AsyncDevicesResourceWithRawResponse(self._commands.devices) + @cached_property def downloads(self) -> AsyncDownloadsResourceWithRawResponse: return AsyncDownloadsResourceWithRawResponse(self._commands.downloads) @@ -388,6 +436,14 @@ def __init__(self, commands: CommandsResource) -> None: commands.list, ) + @cached_property + def users(self) -> UsersResourceWithStreamingResponse: + return UsersResourceWithStreamingResponse(self._commands.users) + + @cached_property + def devices(self) -> DevicesResourceWithStreamingResponse: + return DevicesResourceWithStreamingResponse(self._commands.devices) + @cached_property def downloads(self) -> DownloadsResourceWithStreamingResponse: return DownloadsResourceWithStreamingResponse(self._commands.downloads) @@ -408,6 +464,14 @@ def __init__(self, commands: AsyncCommandsResource) -> None: commands.list, ) + @cached_property + def users(self) -> AsyncUsersResourceWithStreamingResponse: + return AsyncUsersResourceWithStreamingResponse(self._commands.users) + + @cached_property + def devices(self) -> AsyncDevicesResourceWithStreamingResponse: + return AsyncDevicesResourceWithStreamingResponse(self._commands.devices) + @cached_property def downloads(self) -> AsyncDownloadsResourceWithStreamingResponse: return AsyncDownloadsResourceWithStreamingResponse(self._commands.downloads) diff --git a/src/cloudflare/resources/zero_trust/dex/commands/devices.py b/src/cloudflare/resources/zero_trust/dex/commands/devices.py new file mode 100644 index 00000000000..4f3b3697c94 --- /dev/null +++ b/src/cloudflare/resources/zero_trust/dex/commands/devices.py @@ -0,0 +1,212 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional + +import httpx + +from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._utils import maybe_transform +from ....._compat import cached_property +from ....._resource import SyncAPIResource, AsyncAPIResource +from ....._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .....pagination import SyncV4PagePagination, AsyncV4PagePagination +from ....._base_client import AsyncPaginator, make_request_options +from .....types.zero_trust.dex.commands import device_list_params +from .....types.zero_trust.dex.commands.device_list_response import DeviceListResponse + +__all__ = ["DevicesResource", "AsyncDevicesResource"] + + +class DevicesResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> DevicesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return DevicesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> DevicesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return DevicesResourceWithStreamingResponse(self) + + def list( + self, + *, + account_id: str, + page: float, + per_page: float, + search: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncV4PagePagination[Optional[DeviceListResponse]]: + """ + List devices with WARP client support for remote captures which have been + connected in the last 1 hour. + + Args: + page: Page number of paginated results + + per_page: Number of items per page + + search: Filter devices by name or email + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get_api_list( + f"/accounts/{account_id}/dex/commands/devices", + page=SyncV4PagePagination[Optional[DeviceListResponse]], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "page": page, + "per_page": per_page, + "search": search, + }, + device_list_params.DeviceListParams, + ), + ), + model=DeviceListResponse, + ) + + +class AsyncDevicesResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncDevicesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncDevicesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncDevicesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncDevicesResourceWithStreamingResponse(self) + + def list( + self, + *, + account_id: str, + page: float, + per_page: float, + search: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[Optional[DeviceListResponse], AsyncV4PagePagination[Optional[DeviceListResponse]]]: + """ + List devices with WARP client support for remote captures which have been + connected in the last 1 hour. + + Args: + page: Page number of paginated results + + per_page: Number of items per page + + search: Filter devices by name or email + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get_api_list( + f"/accounts/{account_id}/dex/commands/devices", + page=AsyncV4PagePagination[Optional[DeviceListResponse]], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "page": page, + "per_page": per_page, + "search": search, + }, + device_list_params.DeviceListParams, + ), + ), + model=DeviceListResponse, + ) + + +class DevicesResourceWithRawResponse: + def __init__(self, devices: DevicesResource) -> None: + self._devices = devices + + self.list = to_raw_response_wrapper( + devices.list, + ) + + +class AsyncDevicesResourceWithRawResponse: + def __init__(self, devices: AsyncDevicesResource) -> None: + self._devices = devices + + self.list = async_to_raw_response_wrapper( + devices.list, + ) + + +class DevicesResourceWithStreamingResponse: + def __init__(self, devices: DevicesResource) -> None: + self._devices = devices + + self.list = to_streamed_response_wrapper( + devices.list, + ) + + +class AsyncDevicesResourceWithStreamingResponse: + def __init__(self, devices: AsyncDevicesResource) -> None: + self._devices = devices + + self.list = async_to_streamed_response_wrapper( + devices.list, + ) diff --git a/src/cloudflare/resources/zero_trust/dex/commands/downloads.py b/src/cloudflare/resources/zero_trust/dex/commands/downloads.py index 4baa6e25922..57b8e0320aa 100644 --- a/src/cloudflare/resources/zero_trust/dex/commands/downloads.py +++ b/src/cloudflare/resources/zero_trust/dex/commands/downloads.py @@ -78,7 +78,7 @@ def get( raise ValueError(f"Expected a non-empty value for `filename` but received {filename!r}") extra_headers = {"Accept": "application/zip", **(extra_headers or {})} return self._get( - f"/accounts/{account_id}/commands/{command_id}/downloads/{filename}", + f"/accounts/{account_id}/dex/commands/{command_id}/downloads/{filename}", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -142,7 +142,7 @@ async def get( raise ValueError(f"Expected a non-empty value for `filename` but received {filename!r}") extra_headers = {"Accept": "application/zip", **(extra_headers or {})} return await self._get( - f"/accounts/{account_id}/commands/{command_id}/downloads/{filename}", + f"/accounts/{account_id}/dex/commands/{command_id}/downloads/{filename}", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/cloudflare/resources/zero_trust/dex/commands/quota.py b/src/cloudflare/resources/zero_trust/dex/commands/quota.py index f16c78b78ce..8a0ba05b4b3 100644 --- a/src/cloudflare/resources/zero_trust/dex/commands/quota.py +++ b/src/cloudflare/resources/zero_trust/dex/commands/quota.py @@ -69,7 +69,7 @@ def get( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( - f"/accounts/{account_id}/commands/quota", + f"/accounts/{account_id}/dex/commands/quota", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -128,7 +128,7 @@ async def get( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( - f"/accounts/{account_id}/commands/quota", + f"/accounts/{account_id}/dex/commands/quota", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/cloudflare/resources/zero_trust/dex/commands/users.py b/src/cloudflare/resources/zero_trust/dex/commands/users.py new file mode 100644 index 00000000000..7c9308df318 --- /dev/null +++ b/src/cloudflare/resources/zero_trust/dex/commands/users.py @@ -0,0 +1,189 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, Optional, cast + +import httpx + +from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._utils import ( + maybe_transform, + async_maybe_transform, +) +from ....._compat import cached_property +from ....._resource import SyncAPIResource, AsyncAPIResource +from ....._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ....._wrappers import ResultWrapper +from ....._base_client import make_request_options +from .....types.zero_trust.dex.commands import user_list_params +from .....types.zero_trust.dex.commands.user_list_response import UserListResponse + +__all__ = ["UsersResource", "AsyncUsersResource"] + + +class UsersResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> UsersResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return UsersResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> UsersResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return UsersResourceWithStreamingResponse(self) + + def list( + self, + *, + account_id: str, + search: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[UserListResponse]: + """ + List users emails associated with devices with WARP client support for remote + captures which have been connected in the last 1 hour. + + Args: + search: filter user emails by search + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get( + f"/accounts/{account_id}/dex/commands/users", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"search": search}, user_list_params.UserListParams), + post_parser=ResultWrapper[Optional[UserListResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[UserListResponse]], ResultWrapper[UserListResponse]), + ) + + +class AsyncUsersResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncUsersResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncUsersResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncUsersResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncUsersResourceWithStreamingResponse(self) + + async def list( + self, + *, + account_id: str, + search: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[UserListResponse]: + """ + List users emails associated with devices with WARP client support for remote + captures which have been connected in the last 1 hour. + + Args: + search: filter user emails by search + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return await self._get( + f"/accounts/{account_id}/dex/commands/users", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform({"search": search}, user_list_params.UserListParams), + post_parser=ResultWrapper[Optional[UserListResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[UserListResponse]], ResultWrapper[UserListResponse]), + ) + + +class UsersResourceWithRawResponse: + def __init__(self, users: UsersResource) -> None: + self._users = users + + self.list = to_raw_response_wrapper( + users.list, + ) + + +class AsyncUsersResourceWithRawResponse: + def __init__(self, users: AsyncUsersResource) -> None: + self._users = users + + self.list = async_to_raw_response_wrapper( + users.list, + ) + + +class UsersResourceWithStreamingResponse: + def __init__(self, users: UsersResource) -> None: + self._users = users + + self.list = to_streamed_response_wrapper( + users.list, + ) + + +class AsyncUsersResourceWithStreamingResponse: + def __init__(self, users: AsyncUsersResource) -> None: + self._users = users + + self.list = async_to_streamed_response_wrapper( + users.list, + ) diff --git a/src/cloudflare/resources/zero_trust/dlp/__init__.py b/src/cloudflare/resources/zero_trust/dlp/__init__.py index b3185380cfb..03f7e960404 100644 --- a/src/cloudflare/resources/zero_trust/dlp/__init__.py +++ b/src/cloudflare/resources/zero_trust/dlp/__init__.py @@ -8,6 +8,14 @@ DLPResourceWithStreamingResponse, AsyncDLPResourceWithStreamingResponse, ) +from .email import ( + EmailResource, + AsyncEmailResource, + EmailResourceWithRawResponse, + AsyncEmailResourceWithRawResponse, + EmailResourceWithStreamingResponse, + AsyncEmailResourceWithStreamingResponse, +) from .limits import ( LimitsResource, AsyncLimitsResource, @@ -76,6 +84,12 @@ "AsyncPayloadLogsResourceWithRawResponse", "PayloadLogsResourceWithStreamingResponse", "AsyncPayloadLogsResourceWithStreamingResponse", + "EmailResource", + "AsyncEmailResource", + "EmailResourceWithRawResponse", + "AsyncEmailResourceWithRawResponse", + "EmailResourceWithStreamingResponse", + "AsyncEmailResourceWithStreamingResponse", "ProfilesResource", "AsyncProfilesResource", "ProfilesResourceWithRawResponse", diff --git a/src/cloudflare/resources/zero_trust/dlp/dlp.py b/src/cloudflare/resources/zero_trust/dlp/dlp.py index 742d20a6233..2a5da23c2db 100644 --- a/src/cloudflare/resources/zero_trust/dlp/dlp.py +++ b/src/cloudflare/resources/zero_trust/dlp/dlp.py @@ -27,6 +27,14 @@ AsyncPatternsResourceWithStreamingResponse, ) from ...._compat import cached_property +from .email.email import ( + EmailResource, + AsyncEmailResource, + EmailResourceWithRawResponse, + AsyncEmailResourceWithRawResponse, + EmailResourceWithStreamingResponse, + AsyncEmailResourceWithStreamingResponse, +) from ...._resource import SyncAPIResource, AsyncAPIResource from .payload_logs import ( PayloadLogsResource, @@ -69,6 +77,10 @@ def patterns(self) -> PatternsResource: def payload_logs(self) -> PayloadLogsResource: return PayloadLogsResource(self._client) + @cached_property + def email(self) -> EmailResource: + return EmailResource(self._client) + @cached_property def profiles(self) -> ProfilesResource: return ProfilesResource(self._client) @@ -114,6 +126,10 @@ def patterns(self) -> AsyncPatternsResource: def payload_logs(self) -> AsyncPayloadLogsResource: return AsyncPayloadLogsResource(self._client) + @cached_property + def email(self) -> AsyncEmailResource: + return AsyncEmailResource(self._client) + @cached_property def profiles(self) -> AsyncProfilesResource: return AsyncProfilesResource(self._client) @@ -162,6 +178,10 @@ def patterns(self) -> PatternsResourceWithRawResponse: def payload_logs(self) -> PayloadLogsResourceWithRawResponse: return PayloadLogsResourceWithRawResponse(self._dlp.payload_logs) + @cached_property + def email(self) -> EmailResourceWithRawResponse: + return EmailResourceWithRawResponse(self._dlp.email) + @cached_property def profiles(self) -> ProfilesResourceWithRawResponse: return ProfilesResourceWithRawResponse(self._dlp.profiles) @@ -191,6 +211,10 @@ def patterns(self) -> AsyncPatternsResourceWithRawResponse: def payload_logs(self) -> AsyncPayloadLogsResourceWithRawResponse: return AsyncPayloadLogsResourceWithRawResponse(self._dlp.payload_logs) + @cached_property + def email(self) -> AsyncEmailResourceWithRawResponse: + return AsyncEmailResourceWithRawResponse(self._dlp.email) + @cached_property def profiles(self) -> AsyncProfilesResourceWithRawResponse: return AsyncProfilesResourceWithRawResponse(self._dlp.profiles) @@ -220,6 +244,10 @@ def patterns(self) -> PatternsResourceWithStreamingResponse: def payload_logs(self) -> PayloadLogsResourceWithStreamingResponse: return PayloadLogsResourceWithStreamingResponse(self._dlp.payload_logs) + @cached_property + def email(self) -> EmailResourceWithStreamingResponse: + return EmailResourceWithStreamingResponse(self._dlp.email) + @cached_property def profiles(self) -> ProfilesResourceWithStreamingResponse: return ProfilesResourceWithStreamingResponse(self._dlp.profiles) @@ -249,6 +277,10 @@ def patterns(self) -> AsyncPatternsResourceWithStreamingResponse: def payload_logs(self) -> AsyncPayloadLogsResourceWithStreamingResponse: return AsyncPayloadLogsResourceWithStreamingResponse(self._dlp.payload_logs) + @cached_property + def email(self) -> AsyncEmailResourceWithStreamingResponse: + return AsyncEmailResourceWithStreamingResponse(self._dlp.email) + @cached_property def profiles(self) -> AsyncProfilesResourceWithStreamingResponse: return AsyncProfilesResourceWithStreamingResponse(self._dlp.profiles) diff --git a/src/cloudflare/resources/zero_trust/dlp/email/__init__.py b/src/cloudflare/resources/zero_trust/dlp/email/__init__.py new file mode 100644 index 00000000000..bed0373f820 --- /dev/null +++ b/src/cloudflare/resources/zero_trust/dlp/email/__init__.py @@ -0,0 +1,47 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .email import ( + EmailResource, + AsyncEmailResource, + EmailResourceWithRawResponse, + AsyncEmailResourceWithRawResponse, + EmailResourceWithStreamingResponse, + AsyncEmailResourceWithStreamingResponse, +) +from .rules import ( + RulesResource, + AsyncRulesResource, + RulesResourceWithRawResponse, + AsyncRulesResourceWithRawResponse, + RulesResourceWithStreamingResponse, + AsyncRulesResourceWithStreamingResponse, +) +from .account_mapping import ( + AccountMappingResource, + AsyncAccountMappingResource, + AccountMappingResourceWithRawResponse, + AsyncAccountMappingResourceWithRawResponse, + AccountMappingResourceWithStreamingResponse, + AsyncAccountMappingResourceWithStreamingResponse, +) + +__all__ = [ + "AccountMappingResource", + "AsyncAccountMappingResource", + "AccountMappingResourceWithRawResponse", + "AsyncAccountMappingResourceWithRawResponse", + "AccountMappingResourceWithStreamingResponse", + "AsyncAccountMappingResourceWithStreamingResponse", + "RulesResource", + "AsyncRulesResource", + "RulesResourceWithRawResponse", + "AsyncRulesResourceWithRawResponse", + "RulesResourceWithStreamingResponse", + "AsyncRulesResourceWithStreamingResponse", + "EmailResource", + "AsyncEmailResource", + "EmailResourceWithRawResponse", + "AsyncEmailResourceWithRawResponse", + "EmailResourceWithStreamingResponse", + "AsyncEmailResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/addressing/prefixes/bgp/statuses.py b/src/cloudflare/resources/zero_trust/dlp/email/account_mapping.py similarity index 59% rename from src/cloudflare/resources/addressing/prefixes/bgp/statuses.py rename to src/cloudflare/resources/zero_trust/dlp/email/account_mapping.py index adab1b6a231..d9c04a979d4 100644 --- a/src/cloudflare/resources/addressing/prefixes/bgp/statuses.py +++ b/src/cloudflare/resources/zero_trust/dlp/email/account_mapping.py @@ -21,56 +21,49 @@ ) from ....._wrappers import ResultWrapper from ....._base_client import make_request_options -from .....types.addressing.prefixes.bgp import status_edit_params -from .....types.addressing.prefixes.bgp.status_get_response import StatusGetResponse -from .....types.addressing.prefixes.bgp.status_edit_response import StatusEditResponse +from .....types.zero_trust.dlp.email import account_mapping_create_params +from .....types.zero_trust.dlp.email.account_mapping_get_response import AccountMappingGetResponse +from .....types.zero_trust.dlp.email.account_mapping_create_response import AccountMappingCreateResponse -__all__ = ["StatusesResource", "AsyncStatusesResource"] +__all__ = ["AccountMappingResource", "AsyncAccountMappingResource"] -class StatusesResource(SyncAPIResource): +class AccountMappingResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> StatusesResourceWithRawResponse: + def with_raw_response(self) -> AccountMappingResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers """ - return StatusesResourceWithRawResponse(self) + return AccountMappingResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> StatusesResourceWithStreamingResponse: + def with_streaming_response(self) -> AccountMappingResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response """ - return StatusesResourceWithStreamingResponse(self) + return AccountMappingResourceWithStreamingResponse(self) - def edit( + def create( self, - prefix_id: str, *, account_id: str, - advertised: bool, + auth_requirements: account_mapping_create_params.AuthRequirements, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[StatusEditResponse]: + ) -> Optional[AccountMappingCreateResponse]: """ - Advertise or withdraw BGP route for a prefix. + Create mapping Args: - account_id: Identifier - - prefix_id: Identifier - - advertised: Enablement of prefix advertisement to the Internet. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -81,24 +74,23 @@ def edit( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not prefix_id: - raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}") - return self._patch( - f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status", - body=maybe_transform({"advertised": advertised}, status_edit_params.StatusEditParams), + return self._post( + f"/accounts/{account_id}/dlp/email/account_mapping", + body=maybe_transform( + {"auth_requirements": auth_requirements}, account_mapping_create_params.AccountMappingCreateParams + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[StatusEditResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[AccountMappingCreateResponse]]._unwrapper, ), - cast_to=cast(Type[Optional[StatusEditResponse]], ResultWrapper[StatusEditResponse]), + cast_to=cast(Type[Optional[AccountMappingCreateResponse]], ResultWrapper[AccountMappingCreateResponse]), ) def get( self, - prefix_id: str, *, account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -107,15 +99,11 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[StatusGetResponse]: + ) -> Optional[AccountMappingGetResponse]: """ - List the current advertisement state for a prefix. + Get mapping Args: - account_id: Identifier - - prefix_id: Identifier - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -126,64 +114,55 @@ def get( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not prefix_id: - raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}") return self._get( - f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status", + f"/accounts/{account_id}/dlp/email/account_mapping", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[StatusGetResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[AccountMappingGetResponse]]._unwrapper, ), - cast_to=cast(Type[Optional[StatusGetResponse]], ResultWrapper[StatusGetResponse]), + cast_to=cast(Type[Optional[AccountMappingGetResponse]], ResultWrapper[AccountMappingGetResponse]), ) -class AsyncStatusesResource(AsyncAPIResource): +class AsyncAccountMappingResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncStatusesResourceWithRawResponse: + def with_raw_response(self) -> AsyncAccountMappingResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers """ - return AsyncStatusesResourceWithRawResponse(self) + return AsyncAccountMappingResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncStatusesResourceWithStreamingResponse: + def with_streaming_response(self) -> AsyncAccountMappingResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response """ - return AsyncStatusesResourceWithStreamingResponse(self) + return AsyncAccountMappingResourceWithStreamingResponse(self) - async def edit( + async def create( self, - prefix_id: str, *, account_id: str, - advertised: bool, + auth_requirements: account_mapping_create_params.AuthRequirements, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[StatusEditResponse]: + ) -> Optional[AccountMappingCreateResponse]: """ - Advertise or withdraw BGP route for a prefix. + Create mapping Args: - account_id: Identifier - - prefix_id: Identifier - - advertised: Enablement of prefix advertisement to the Internet. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -194,24 +173,23 @@ async def edit( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not prefix_id: - raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}") - return await self._patch( - f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status", - body=await async_maybe_transform({"advertised": advertised}, status_edit_params.StatusEditParams), + return await self._post( + f"/accounts/{account_id}/dlp/email/account_mapping", + body=await async_maybe_transform( + {"auth_requirements": auth_requirements}, account_mapping_create_params.AccountMappingCreateParams + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[StatusEditResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[AccountMappingCreateResponse]]._unwrapper, ), - cast_to=cast(Type[Optional[StatusEditResponse]], ResultWrapper[StatusEditResponse]), + cast_to=cast(Type[Optional[AccountMappingCreateResponse]], ResultWrapper[AccountMappingCreateResponse]), ) async def get( self, - prefix_id: str, *, account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -220,15 +198,11 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[StatusGetResponse]: + ) -> Optional[AccountMappingGetResponse]: """ - List the current advertisement state for a prefix. + Get mapping Args: - account_id: Identifier - - prefix_id: Identifier - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -239,64 +213,62 @@ async def get( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not prefix_id: - raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}") return await self._get( - f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status", + f"/accounts/{account_id}/dlp/email/account_mapping", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[StatusGetResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[AccountMappingGetResponse]]._unwrapper, ), - cast_to=cast(Type[Optional[StatusGetResponse]], ResultWrapper[StatusGetResponse]), + cast_to=cast(Type[Optional[AccountMappingGetResponse]], ResultWrapper[AccountMappingGetResponse]), ) -class StatusesResourceWithRawResponse: - def __init__(self, statuses: StatusesResource) -> None: - self._statuses = statuses +class AccountMappingResourceWithRawResponse: + def __init__(self, account_mapping: AccountMappingResource) -> None: + self._account_mapping = account_mapping - self.edit = to_raw_response_wrapper( - statuses.edit, + self.create = to_raw_response_wrapper( + account_mapping.create, ) self.get = to_raw_response_wrapper( - statuses.get, + account_mapping.get, ) -class AsyncStatusesResourceWithRawResponse: - def __init__(self, statuses: AsyncStatusesResource) -> None: - self._statuses = statuses +class AsyncAccountMappingResourceWithRawResponse: + def __init__(self, account_mapping: AsyncAccountMappingResource) -> None: + self._account_mapping = account_mapping - self.edit = async_to_raw_response_wrapper( - statuses.edit, + self.create = async_to_raw_response_wrapper( + account_mapping.create, ) self.get = async_to_raw_response_wrapper( - statuses.get, + account_mapping.get, ) -class StatusesResourceWithStreamingResponse: - def __init__(self, statuses: StatusesResource) -> None: - self._statuses = statuses +class AccountMappingResourceWithStreamingResponse: + def __init__(self, account_mapping: AccountMappingResource) -> None: + self._account_mapping = account_mapping - self.edit = to_streamed_response_wrapper( - statuses.edit, + self.create = to_streamed_response_wrapper( + account_mapping.create, ) self.get = to_streamed_response_wrapper( - statuses.get, + account_mapping.get, ) -class AsyncStatusesResourceWithStreamingResponse: - def __init__(self, statuses: AsyncStatusesResource) -> None: - self._statuses = statuses +class AsyncAccountMappingResourceWithStreamingResponse: + def __init__(self, account_mapping: AsyncAccountMappingResource) -> None: + self._account_mapping = account_mapping - self.edit = async_to_streamed_response_wrapper( - statuses.edit, + self.create = async_to_streamed_response_wrapper( + account_mapping.create, ) self.get = async_to_streamed_response_wrapper( - statuses.get, + account_mapping.get, ) diff --git a/src/cloudflare/resources/zero_trust/dlp/email/email.py b/src/cloudflare/resources/zero_trust/dlp/email/email.py new file mode 100644 index 00000000000..5a860e81a40 --- /dev/null +++ b/src/cloudflare/resources/zero_trust/dlp/email/email.py @@ -0,0 +1,134 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .rules import ( + RulesResource, + AsyncRulesResource, + RulesResourceWithRawResponse, + AsyncRulesResourceWithRawResponse, + RulesResourceWithStreamingResponse, + AsyncRulesResourceWithStreamingResponse, +) +from ....._compat import cached_property +from ....._resource import SyncAPIResource, AsyncAPIResource +from .account_mapping import ( + AccountMappingResource, + AsyncAccountMappingResource, + AccountMappingResourceWithRawResponse, + AsyncAccountMappingResourceWithRawResponse, + AccountMappingResourceWithStreamingResponse, + AsyncAccountMappingResourceWithStreamingResponse, +) + +__all__ = ["EmailResource", "AsyncEmailResource"] + + +class EmailResource(SyncAPIResource): + @cached_property + def account_mapping(self) -> AccountMappingResource: + return AccountMappingResource(self._client) + + @cached_property + def rules(self) -> RulesResource: + return RulesResource(self._client) + + @cached_property + def with_raw_response(self) -> EmailResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return EmailResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> EmailResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return EmailResourceWithStreamingResponse(self) + + +class AsyncEmailResource(AsyncAPIResource): + @cached_property + def account_mapping(self) -> AsyncAccountMappingResource: + return AsyncAccountMappingResource(self._client) + + @cached_property + def rules(self) -> AsyncRulesResource: + return AsyncRulesResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncEmailResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncEmailResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncEmailResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncEmailResourceWithStreamingResponse(self) + + +class EmailResourceWithRawResponse: + def __init__(self, email: EmailResource) -> None: + self._email = email + + @cached_property + def account_mapping(self) -> AccountMappingResourceWithRawResponse: + return AccountMappingResourceWithRawResponse(self._email.account_mapping) + + @cached_property + def rules(self) -> RulesResourceWithRawResponse: + return RulesResourceWithRawResponse(self._email.rules) + + +class AsyncEmailResourceWithRawResponse: + def __init__(self, email: AsyncEmailResource) -> None: + self._email = email + + @cached_property + def account_mapping(self) -> AsyncAccountMappingResourceWithRawResponse: + return AsyncAccountMappingResourceWithRawResponse(self._email.account_mapping) + + @cached_property + def rules(self) -> AsyncRulesResourceWithRawResponse: + return AsyncRulesResourceWithRawResponse(self._email.rules) + + +class EmailResourceWithStreamingResponse: + def __init__(self, email: EmailResource) -> None: + self._email = email + + @cached_property + def account_mapping(self) -> AccountMappingResourceWithStreamingResponse: + return AccountMappingResourceWithStreamingResponse(self._email.account_mapping) + + @cached_property + def rules(self) -> RulesResourceWithStreamingResponse: + return RulesResourceWithStreamingResponse(self._email.rules) + + +class AsyncEmailResourceWithStreamingResponse: + def __init__(self, email: AsyncEmailResource) -> None: + self._email = email + + @cached_property + def account_mapping(self) -> AsyncAccountMappingResourceWithStreamingResponse: + return AsyncAccountMappingResourceWithStreamingResponse(self._email.account_mapping) + + @cached_property + def rules(self) -> AsyncRulesResourceWithStreamingResponse: + return AsyncRulesResourceWithStreamingResponse(self._email.rules) diff --git a/src/cloudflare/resources/zero_trust/dlp/email/rules.py b/src/cloudflare/resources/zero_trust/dlp/email/rules.py new file mode 100644 index 00000000000..63906966157 --- /dev/null +++ b/src/cloudflare/resources/zero_trust/dlp/email/rules.py @@ -0,0 +1,701 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Type, Iterable, Optional, cast + +import httpx + +from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._utils import ( + maybe_transform, + async_maybe_transform, +) +from ....._compat import cached_property +from ....._resource import SyncAPIResource, AsyncAPIResource +from ....._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ....._wrappers import ResultWrapper +from .....pagination import SyncSinglePage, AsyncSinglePage +from ....._base_client import AsyncPaginator, make_request_options +from .....types.zero_trust.dlp.email import rule_create_params, rule_update_params, rule_bulk_edit_params +from .....types.zero_trust.dlp.email.rule_get_response import RuleGetResponse +from .....types.zero_trust.dlp.email.rule_list_response import RuleListResponse +from .....types.zero_trust.dlp.email.rule_create_response import RuleCreateResponse +from .....types.zero_trust.dlp.email.rule_delete_response import RuleDeleteResponse +from .....types.zero_trust.dlp.email.rule_update_response import RuleUpdateResponse +from .....types.zero_trust.dlp.email.rule_bulk_edit_response import RuleBulkEditResponse + +__all__ = ["RulesResource", "AsyncRulesResource"] + + +class RulesResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> RulesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return RulesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> RulesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return RulesResourceWithStreamingResponse(self) + + def create( + self, + *, + account_id: str, + action: rule_create_params.Action, + conditions: Iterable[rule_create_params.Condition], + enabled: bool, + name: str, + description: Optional[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[RuleCreateResponse]: + """ + Create email scanner rule + + Args: + conditions: Rule is triggered if all conditions match + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._post( + f"/accounts/{account_id}/dlp/email/rules", + body=maybe_transform( + { + "action": action, + "conditions": conditions, + "enabled": enabled, + "name": name, + "description": description, + }, + rule_create_params.RuleCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[RuleCreateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[RuleCreateResponse]], ResultWrapper[RuleCreateResponse]), + ) + + def update( + self, + rule_id: str, + *, + account_id: str, + action: rule_update_params.Action, + conditions: Iterable[rule_update_params.Condition], + enabled: bool, + name: str, + description: Optional[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[RuleUpdateResponse]: + """ + Update email scanner rule + + Args: + conditions: Rule is triggered if all conditions match + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not rule_id: + raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") + return self._put( + f"/accounts/{account_id}/dlp/email/rules/{rule_id}", + body=maybe_transform( + { + "action": action, + "conditions": conditions, + "enabled": enabled, + "name": name, + "description": description, + }, + rule_update_params.RuleUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[RuleUpdateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[RuleUpdateResponse]], ResultWrapper[RuleUpdateResponse]), + ) + + def list( + self, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncSinglePage[RuleListResponse]: + """ + Lists all email scanner rules for an account. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get_api_list( + f"/accounts/{account_id}/dlp/email/rules", + page=SyncSinglePage[RuleListResponse], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=RuleListResponse, + ) + + def delete( + self, + rule_id: str, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[RuleDeleteResponse]: + """ + Delete email scanner rule + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not rule_id: + raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") + return self._delete( + f"/accounts/{account_id}/dlp/email/rules/{rule_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[RuleDeleteResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[RuleDeleteResponse]], ResultWrapper[RuleDeleteResponse]), + ) + + def bulk_edit( + self, + *, + account_id: str, + new_priorities: Dict[str, int], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[RuleBulkEditResponse]: + """ + Update email scanner rule priorities + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._patch( + f"/accounts/{account_id}/dlp/email/rules", + body=maybe_transform({"new_priorities": new_priorities}, rule_bulk_edit_params.RuleBulkEditParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[RuleBulkEditResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[RuleBulkEditResponse]], ResultWrapper[RuleBulkEditResponse]), + ) + + def get( + self, + rule_id: str, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[RuleGetResponse]: + """ + Get an email scanner rule + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not rule_id: + raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") + return self._get( + f"/accounts/{account_id}/dlp/email/rules/{rule_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[RuleGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[RuleGetResponse]], ResultWrapper[RuleGetResponse]), + ) + + +class AsyncRulesResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncRulesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncRulesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncRulesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncRulesResourceWithStreamingResponse(self) + + async def create( + self, + *, + account_id: str, + action: rule_create_params.Action, + conditions: Iterable[rule_create_params.Condition], + enabled: bool, + name: str, + description: Optional[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[RuleCreateResponse]: + """ + Create email scanner rule + + Args: + conditions: Rule is triggered if all conditions match + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return await self._post( + f"/accounts/{account_id}/dlp/email/rules", + body=await async_maybe_transform( + { + "action": action, + "conditions": conditions, + "enabled": enabled, + "name": name, + "description": description, + }, + rule_create_params.RuleCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[RuleCreateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[RuleCreateResponse]], ResultWrapper[RuleCreateResponse]), + ) + + async def update( + self, + rule_id: str, + *, + account_id: str, + action: rule_update_params.Action, + conditions: Iterable[rule_update_params.Condition], + enabled: bool, + name: str, + description: Optional[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[RuleUpdateResponse]: + """ + Update email scanner rule + + Args: + conditions: Rule is triggered if all conditions match + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not rule_id: + raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") + return await self._put( + f"/accounts/{account_id}/dlp/email/rules/{rule_id}", + body=await async_maybe_transform( + { + "action": action, + "conditions": conditions, + "enabled": enabled, + "name": name, + "description": description, + }, + rule_update_params.RuleUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[RuleUpdateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[RuleUpdateResponse]], ResultWrapper[RuleUpdateResponse]), + ) + + def list( + self, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[RuleListResponse, AsyncSinglePage[RuleListResponse]]: + """ + Lists all email scanner rules for an account. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get_api_list( + f"/accounts/{account_id}/dlp/email/rules", + page=AsyncSinglePage[RuleListResponse], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=RuleListResponse, + ) + + async def delete( + self, + rule_id: str, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[RuleDeleteResponse]: + """ + Delete email scanner rule + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not rule_id: + raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") + return await self._delete( + f"/accounts/{account_id}/dlp/email/rules/{rule_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[RuleDeleteResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[RuleDeleteResponse]], ResultWrapper[RuleDeleteResponse]), + ) + + async def bulk_edit( + self, + *, + account_id: str, + new_priorities: Dict[str, int], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[RuleBulkEditResponse]: + """ + Update email scanner rule priorities + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return await self._patch( + f"/accounts/{account_id}/dlp/email/rules", + body=await async_maybe_transform( + {"new_priorities": new_priorities}, rule_bulk_edit_params.RuleBulkEditParams + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[RuleBulkEditResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[RuleBulkEditResponse]], ResultWrapper[RuleBulkEditResponse]), + ) + + async def get( + self, + rule_id: str, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[RuleGetResponse]: + """ + Get an email scanner rule + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not rule_id: + raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") + return await self._get( + f"/accounts/{account_id}/dlp/email/rules/{rule_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[RuleGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[RuleGetResponse]], ResultWrapper[RuleGetResponse]), + ) + + +class RulesResourceWithRawResponse: + def __init__(self, rules: RulesResource) -> None: + self._rules = rules + + self.create = to_raw_response_wrapper( + rules.create, + ) + self.update = to_raw_response_wrapper( + rules.update, + ) + self.list = to_raw_response_wrapper( + rules.list, + ) + self.delete = to_raw_response_wrapper( + rules.delete, + ) + self.bulk_edit = to_raw_response_wrapper( + rules.bulk_edit, + ) + self.get = to_raw_response_wrapper( + rules.get, + ) + + +class AsyncRulesResourceWithRawResponse: + def __init__(self, rules: AsyncRulesResource) -> None: + self._rules = rules + + self.create = async_to_raw_response_wrapper( + rules.create, + ) + self.update = async_to_raw_response_wrapper( + rules.update, + ) + self.list = async_to_raw_response_wrapper( + rules.list, + ) + self.delete = async_to_raw_response_wrapper( + rules.delete, + ) + self.bulk_edit = async_to_raw_response_wrapper( + rules.bulk_edit, + ) + self.get = async_to_raw_response_wrapper( + rules.get, + ) + + +class RulesResourceWithStreamingResponse: + def __init__(self, rules: RulesResource) -> None: + self._rules = rules + + self.create = to_streamed_response_wrapper( + rules.create, + ) + self.update = to_streamed_response_wrapper( + rules.update, + ) + self.list = to_streamed_response_wrapper( + rules.list, + ) + self.delete = to_streamed_response_wrapper( + rules.delete, + ) + self.bulk_edit = to_streamed_response_wrapper( + rules.bulk_edit, + ) + self.get = to_streamed_response_wrapper( + rules.get, + ) + + +class AsyncRulesResourceWithStreamingResponse: + def __init__(self, rules: AsyncRulesResource) -> None: + self._rules = rules + + self.create = async_to_streamed_response_wrapper( + rules.create, + ) + self.update = async_to_streamed_response_wrapper( + rules.update, + ) + self.list = async_to_streamed_response_wrapper( + rules.list, + ) + self.delete = async_to_streamed_response_wrapper( + rules.delete, + ) + self.bulk_edit = async_to_streamed_response_wrapper( + rules.bulk_edit, + ) + self.get = async_to_streamed_response_wrapper( + rules.get, + ) diff --git a/src/cloudflare/resources/zero_trust/gateway/configurations/configurations.py b/src/cloudflare/resources/zero_trust/gateway/configurations/configurations.py index 4ebaf1a42d5..269e71f769f 100755 --- a/src/cloudflare/resources/zero_trust/gateway/configurations/configurations.py +++ b/src/cloudflare/resources/zero_trust/gateway/configurations/configurations.py @@ -81,7 +81,7 @@ def update( Updates the current Zero Trust account configuration. Args: - settings: account settings. + settings: Account settings extra_headers: Send extra headers @@ -127,7 +127,7 @@ def edit( error if any collection of settings is not properly configured. Args: - settings: account settings. + settings: Account settings extra_headers: Send extra headers @@ -230,7 +230,7 @@ async def update( Updates the current Zero Trust account configuration. Args: - settings: account settings. + settings: Account settings extra_headers: Send extra headers @@ -278,7 +278,7 @@ async def edit( error if any collection of settings is not properly configured. Args: - settings: account settings. + settings: Account settings extra_headers: Send extra headers diff --git a/src/cloudflare/resources/zero_trust/gateway/lists/lists.py b/src/cloudflare/resources/zero_trust/gateway/lists/lists.py index db84089871a..324a7de6194 100644 --- a/src/cloudflare/resources/zero_trust/gateway/lists/lists.py +++ b/src/cloudflare/resources/zero_trust/gateway/lists/lists.py @@ -128,6 +128,7 @@ def update( account_id: str, name: str, description: str | NotGiven = NOT_GIVEN, + items: Iterable[GatewayItemParam] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -135,8 +136,10 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Optional[GatewayList]: - """ - Updates a configured Zero Trust list. + """Updates a configured Zero Trust list. + + Skips updating list items if not included + in the payload. Args: list_id: API Resource UUID tag. @@ -145,6 +148,8 @@ def update( description: The description of the list. + items: The items in the list. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -163,6 +168,7 @@ def update( { "name": name, "description": description, + "items": items, }, list_update_params.ListUpdateParams, ), @@ -446,6 +452,7 @@ async def update( account_id: str, name: str, description: str | NotGiven = NOT_GIVEN, + items: Iterable[GatewayItemParam] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -453,8 +460,10 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Optional[GatewayList]: - """ - Updates a configured Zero Trust list. + """Updates a configured Zero Trust list. + + Skips updating list items if not included + in the payload. Args: list_id: API Resource UUID tag. @@ -463,6 +472,8 @@ async def update( description: The description of the list. + items: The items in the list. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -481,6 +492,7 @@ async def update( { "name": name, "description": description, + "items": items, }, list_update_params.ListUpdateParams, ), diff --git a/src/cloudflare/resources/zero_trust/organizations/doh.py b/src/cloudflare/resources/zero_trust/organizations/doh.py index d16604fe4b7..70518bc0925 100644 --- a/src/cloudflare/resources/zero_trust/organizations/doh.py +++ b/src/cloudflare/resources/zero_trust/organizations/doh.py @@ -52,7 +52,7 @@ def update( self, *, account_id: str, - jwt_duration: str | NotGiven = NOT_GIVEN, + doh_jwt_duration: str | NotGiven = NOT_GIVEN, service_token_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -67,7 +67,7 @@ def update( Args: account_id: Identifier - jwt_duration: The duration the DoH JWT is valid for. Must be in the format `300ms` or `2h45m`. + doh_jwt_duration: The duration the DoH JWT is valid for. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. Note that the maximum duration for this setting is the same as the key rotation period on the account. Default expiration is 24h @@ -88,7 +88,7 @@ def update( f"/accounts/{account_id}/access/organizations/doh", body=maybe_transform( { - "jwt_duration": jwt_duration, + "doh_jwt_duration": doh_jwt_duration, "service_token_id": service_token_id, }, doh_update_params.DOHUpdateParams, @@ -167,7 +167,7 @@ async def update( self, *, account_id: str, - jwt_duration: str | NotGiven = NOT_GIVEN, + doh_jwt_duration: str | NotGiven = NOT_GIVEN, service_token_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -182,7 +182,7 @@ async def update( Args: account_id: Identifier - jwt_duration: The duration the DoH JWT is valid for. Must be in the format `300ms` or `2h45m`. + doh_jwt_duration: The duration the DoH JWT is valid for. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. Note that the maximum duration for this setting is the same as the key rotation period on the account. Default expiration is 24h @@ -203,7 +203,7 @@ async def update( f"/accounts/{account_id}/access/organizations/doh", body=await async_maybe_transform( { - "jwt_duration": jwt_duration, + "doh_jwt_duration": doh_jwt_duration, "service_token_id": service_token_id, }, doh_update_params.DOHUpdateParams, diff --git a/src/cloudflare/resources/zones/holds.py b/src/cloudflare/resources/zones/holds.py index 890ce0319b9..50ff188a172 100644 --- a/src/cloudflare/resources/zones/holds.py +++ b/src/cloudflare/resources/zones/holds.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, Optional, cast +from typing import Type, cast import httpx @@ -20,7 +20,7 @@ async_to_streamed_response_wrapper, ) from ..._wrappers import ResultWrapper -from ...types.zones import hold_create_params, hold_delete_params +from ...types.zones import hold_edit_params, hold_create_params, hold_delete_params from ..._base_client import make_request_options from ...types.zones.zone_hold import ZoneHold @@ -105,7 +105,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ZoneHold]: + ) -> ZoneHold: """ Stop enforcement of a zone hold on the zone, permanently or temporarily, allowing the creation and activation of zones with this zone's hostname. @@ -135,9 +135,69 @@ def delete( extra_body=extra_body, timeout=timeout, query=maybe_transform({"hold_after": hold_after}, hold_delete_params.HoldDeleteParams), - post_parser=ResultWrapper[Optional[ZoneHold]]._unwrapper, + post_parser=ResultWrapper[ZoneHold]._unwrapper, ), - cast_to=cast(Type[Optional[ZoneHold]], ResultWrapper[ZoneHold]), + cast_to=cast(Type[ZoneHold], ResultWrapper[ZoneHold]), + ) + + def edit( + self, + *, + zone_id: str, + hold_after: str | NotGiven = NOT_GIVEN, + include_subdomains: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ZoneHold: + """ + Update the `hold_after` and/or `include_subdomains` values on an existing zone + hold. The hold is enabled if the `hold_after` date-time value is in the past. + + Args: + zone_id: Identifier + + hold_after: If `hold_after` is provided and future-dated, the hold will be temporarily + disabled, then automatically re-enabled by the system at the time specified in + this RFC3339-formatted timestamp. A past-dated `hold_after` value will have no + effect on an existing, enabled hold. Providing an empty string will set its + value to the current time. + + include_subdomains: If `true`, the zone hold will extend to block any subdomain of the given zone, + as well as SSL4SaaS Custom Hostnames. For example, a zone hold on a zone with + the hostname 'example.com' and include_subdomains=true will block 'example.com', + 'staging.example.com', 'api.staging.example.com', etc. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return self._patch( + f"/zones/{zone_id}/hold", + body=maybe_transform( + { + "hold_after": hold_after, + "include_subdomains": include_subdomains, + }, + hold_edit_params.HoldEditParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ZoneHold]._unwrapper, + ), + cast_to=cast(Type[ZoneHold], ResultWrapper[ZoneHold]), ) def get( @@ -261,7 +321,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ZoneHold]: + ) -> ZoneHold: """ Stop enforcement of a zone hold on the zone, permanently or temporarily, allowing the creation and activation of zones with this zone's hostname. @@ -291,9 +351,69 @@ async def delete( extra_body=extra_body, timeout=timeout, query=await async_maybe_transform({"hold_after": hold_after}, hold_delete_params.HoldDeleteParams), - post_parser=ResultWrapper[Optional[ZoneHold]]._unwrapper, + post_parser=ResultWrapper[ZoneHold]._unwrapper, ), - cast_to=cast(Type[Optional[ZoneHold]], ResultWrapper[ZoneHold]), + cast_to=cast(Type[ZoneHold], ResultWrapper[ZoneHold]), + ) + + async def edit( + self, + *, + zone_id: str, + hold_after: str | NotGiven = NOT_GIVEN, + include_subdomains: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ZoneHold: + """ + Update the `hold_after` and/or `include_subdomains` values on an existing zone + hold. The hold is enabled if the `hold_after` date-time value is in the past. + + Args: + zone_id: Identifier + + hold_after: If `hold_after` is provided and future-dated, the hold will be temporarily + disabled, then automatically re-enabled by the system at the time specified in + this RFC3339-formatted timestamp. A past-dated `hold_after` value will have no + effect on an existing, enabled hold. Providing an empty string will set its + value to the current time. + + include_subdomains: If `true`, the zone hold will extend to block any subdomain of the given zone, + as well as SSL4SaaS Custom Hostnames. For example, a zone hold on a zone with + the hostname 'example.com' and include_subdomains=true will block 'example.com', + 'staging.example.com', 'api.staging.example.com', etc. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return await self._patch( + f"/zones/{zone_id}/hold", + body=await async_maybe_transform( + { + "hold_after": hold_after, + "include_subdomains": include_subdomains, + }, + hold_edit_params.HoldEditParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ZoneHold]._unwrapper, + ), + cast_to=cast(Type[ZoneHold], ResultWrapper[ZoneHold]), ) async def get( @@ -347,6 +467,9 @@ def __init__(self, holds: HoldsResource) -> None: self.delete = to_raw_response_wrapper( holds.delete, ) + self.edit = to_raw_response_wrapper( + holds.edit, + ) self.get = to_raw_response_wrapper( holds.get, ) @@ -362,6 +485,9 @@ def __init__(self, holds: AsyncHoldsResource) -> None: self.delete = async_to_raw_response_wrapper( holds.delete, ) + self.edit = async_to_raw_response_wrapper( + holds.edit, + ) self.get = async_to_raw_response_wrapper( holds.get, ) @@ -377,6 +503,9 @@ def __init__(self, holds: HoldsResource) -> None: self.delete = to_streamed_response_wrapper( holds.delete, ) + self.edit = to_streamed_response_wrapper( + holds.edit, + ) self.get = to_streamed_response_wrapper( holds.get, ) @@ -392,6 +521,9 @@ def __init__(self, holds: AsyncHoldsResource) -> None: self.delete = async_to_streamed_response_wrapper( holds.delete, ) + self.edit = async_to_streamed_response_wrapper( + holds.edit, + ) self.get = async_to_streamed_response_wrapper( holds.get, ) diff --git a/src/cloudflare/types/abuse_reports/__init__.py b/src/cloudflare/types/abuse_reports/__init__.py new file mode 100644 index 00000000000..c17465cb40c --- /dev/null +++ b/src/cloudflare/types/abuse_reports/__init__.py @@ -0,0 +1,6 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .abuse_report_create_params import AbuseReportCreateParams as AbuseReportCreateParams +from .abuse_report_create_response import AbuseReportCreateResponse as AbuseReportCreateResponse diff --git a/src/cloudflare/types/abuse_reports/abuse_report_create_params.py b/src/cloudflare/types/abuse_reports/abuse_report_create_params.py new file mode 100644 index 00000000000..ff19f93f7c5 --- /dev/null +++ b/src/cloudflare/types/abuse_reports/abuse_report_create_params.py @@ -0,0 +1,140 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["AbuseReportCreateParams"] + + +class AbuseReportCreateParams(TypedDict, total=False): + account_id: Required[str] + + act: Required[ + Literal[ + "abuse_dmca", + "abuse_trademark", + "abuse_general", + "abuse_phishing", + "abuse_children", + "abuse_threat", + "abuse_registrar_whois", + "abuse_ncsei", + ] + ] + """The abuse report type""" + + email: Required[str] + """A valid email of the abuse reporter""" + + email2: Required[str] + """Should match the value provided in `email`""" + + host_notification: Required[Literal["send", "send-anon", "none"]] + """Notification type based on the abuse type. + + NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. + """ + + ncmec_notification: Required[Literal["send", "send-anon", "none"]] + """Notification type based on the abuse type. + + NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. + """ + + owner_notification: Required[Literal["send", "send-anon", "none"]] + """Notification type based on the abuse type. + + NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. + """ + + urls: Required[str] + """A list of valid URLs separated by ‘ ’ (new line character). + + The list of the URLs should not exceed 250 URLs. All URLs should have the same + hostname. Each URL should be unique + """ + + address1: str + """Text not exceeding 100 characters""" + + agent_name: str + """The name of the copyright holder. Text not exceeding 60 characters.""" + + agree: Literal[0, 1] + """Can be 0 or 1""" + + city: str + """Text not exceeding 255 characters""" + + comments: str + """Any additional comments about the infringement not exceeding 2000 characters""" + + company: str + """Text not exceeding 100 characters""" + + country: str + """Text not exceeding 255 characters""" + + destination_ips: str + """A list of IP addresses separated by ‘ ’ (new line character). + + The list of destination IPs should not exceed 30 IP addresses. Each one of the + IP addresses ought to be unique + """ + + justification: str + """ + A detailed description of the infringement, including any necessary access + details and the exact steps needed to view the content, not exceeding 5000 + characters + """ + + name: str + """Text not exceeding 255 characters""" + + ncsei_subject_representation: bool + """If the submitter is the target of NCSEI in the URLs of the abuse report""" + + original_work: str + """Text not exceeding 255 characters""" + + ports_protocols: str + """A comma separated list of ports and protocols e.g. + + 80/TCP, 22/UDP. The total size of the field should not exceed 2000 characters. + Each individual port/protocol should not exceed 100 characters. The list should + not have more than 30 unique ports and protocols. + """ + + signature: str + """Required for DMCA reports, should be same as Name. + + An affirmation that all information in the report is true and accurate while + agreeing to the policies of Cloudflare's abuse reports + """ + + source_ips: str + """A list of IP addresses separated by ‘ ’ (new line character). + + The list of source IPs should not exceed 30 IP addresses. Each one of the IP + addresses ought to be unique + """ + + state: str + """Text not exceeding 255 characters""" + + tele: str + """Text not exceeding 20 characters""" + + title: str + """Text not exceeding 255 characters""" + + trademark_number: str + """Text not exceeding 1000 characters""" + + trademark_office: str + """Text not exceeding 1000 characters""" + + trademark_symbol: str + """Text not exceeding 1000 characters""" diff --git a/src/cloudflare/types/abuse_reports/abuse_report_create_response.py b/src/cloudflare/types/abuse_reports/abuse_report_create_response.py new file mode 100644 index 00000000000..03fc4011e68 --- /dev/null +++ b/src/cloudflare/types/abuse_reports/abuse_report_create_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["AbuseReportCreateResponse"] + +AbuseReportCreateResponse: TypeAlias = str diff --git a/src/cloudflare/types/accounts/logs/__init__.py b/src/cloudflare/types/accounts/logs/__init__.py new file mode 100644 index 00000000000..4db884733b2 --- /dev/null +++ b/src/cloudflare/types/accounts/logs/__init__.py @@ -0,0 +1,6 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .audit_list_params import AuditListParams as AuditListParams +from .audit_list_response import AuditListResponse as AuditListResponse diff --git a/src/cloudflare/types/accounts/logs/audit_list_params.py b/src/cloudflare/types/accounts/logs/audit_list_params.py new file mode 100644 index 00000000000..0d0bd685341 --- /dev/null +++ b/src/cloudflare/types/accounts/logs/audit_list_params.py @@ -0,0 +1,115 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from datetime import date +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ...._utils import PropertyInfo + +__all__ = ["AuditListParams"] + + +class AuditListParams(TypedDict, total=False): + account_id: Required[str] + """The unique id that identifies the account.""" + + before: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] + """ + Filters actions based on a given timestamp in the format yyyy-mm-dd, returning + only logs that occurred on and before the specified date. + """ + + since: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] + """ + Filters actions based on a given timestamp in the format yyyy-mm-dd, returning + only logs that occurred on and after the specified date. + """ + + account_name: str + """Filters by the account name.""" + + action_result: Literal["success", "failure"] + """Whether the action was successful or not.""" + + action_type: Literal["create", "delete", "view", "update"] + """Filters by the action type.""" + + actor_context: Literal["api_key", "api_token", "dash", "oauth", "origin_ca_key"] + """Filters by the actor context.""" + + actor_email: str + """Filters by the actor's email address.""" + + actor_id: str + """Filters by the actor ID. This can be either the Account ID or User ID.""" + + actor_ip_address: str + """The IP address where the action was initiated.""" + + actor_token_id: str + """Filters by the API token ID when the actor context is an api_token or oauth.""" + + actor_token_name: str + """Filters by the API token name when the actor context is an api_token or oauth.""" + + actor_type: Literal["cloudflare_admin", "account", "user"] + """Filters by the actor type.""" + + audit_log_id: str + """Finds a specific log by its ID.""" + + cursor: str + """The cursor is an opaque token used to paginate through large sets of records. + + It indicates the position from which to continue when requesting the next set of + records. A valid cursor value can be obtained from the cursor object in the + result_info structure of a previous response. + """ + + direction: Literal["desc", "asc"] + """Sets sorting order.""" + + limit: float + """The number limits the objects to return. + + The cursor attribute may be used to iterate over the next batch of objects if + there are more than the limit. + """ + + raw_cf_rayid: Annotated[str, PropertyInfo(alias="raw_cf_ray_id")] + """Filters by the response CF Ray ID.""" + + raw_method: str + """The HTTP method for the API call.""" + + raw_status_code: int + """The response status code that was returned.""" + + raw_uri: str + """Filters by the request URI.""" + + resource_id: str + """Filters by the resource ID.""" + + resource_product: str + """ + Filters audit logs by the Cloudflare product associated with the changed + resource. + """ + + resource_scope: Literal["accounts", "user", "zones"] + """ + Filters by the resource scope, specifying whether the resource is associated + with an user, an account, or a zone. + """ + + resource_type: str + """Filters audit logs based on the unique type of resource changed by the action.""" + + zone_id: str + """Filters by the zone ID.""" + + zone_name: str + """Filters by the zone name associated with the change.""" diff --git a/src/cloudflare/types/accounts/logs/audit_list_response.py b/src/cloudflare/types/accounts/logs/audit_list_response.py new file mode 100644 index 00000000000..ec2281163c6 --- /dev/null +++ b/src/cloudflare/types/accounts/logs/audit_list_response.py @@ -0,0 +1,124 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = ["AuditListResponse", "Account", "Action", "Actor", "Raw", "Resource", "Zone"] + + +class Account(BaseModel): + id: Optional[str] = None + """A unique identifier for the account.""" + + name: Optional[str] = None + """A string that identifies the account name.""" + + +class Action(BaseModel): + description: Optional[str] = None + """A short description of the action performed.""" + + result: Optional[str] = None + """The result of the action, indicating success or failure.""" + + time: Optional[datetime] = None + """A timestamp indicating when the action was logged.""" + + type: Optional[str] = None + """A short string that describes the action that was performed.""" + + +class Actor(BaseModel): + id: Optional[str] = None + """The ID of the actor who performed the action. + + If a user performed the action, this will be their User ID. + """ + + context: Optional[Literal["api_key", "api_token", "dash", "oauth", "origin_ca_key"]] = None + + email: Optional[str] = None + """The email of the actor who performed the action.""" + + ip_address: Optional[str] = None + """The IP address of the request that performed the action.""" + + token_id: Optional[str] = None + """Filters by the API token ID when the actor context is an api_token.""" + + token_name: Optional[str] = None + """Filters by the API token name when the actor context is an api_token.""" + + type: Optional[Literal["user", "account", "cloudflare-admin"]] = None + """The type of actor.""" + + +class Raw(BaseModel): + cf_rayid: Optional[str] = FieldInfo(alias="cf_ray_id", default=None) + """The Cloudflare Ray ID for the request.""" + + method: Optional[str] = None + """The HTTP method of the request.""" + + status_code: Optional[int] = None + """The HTTP response status code returned by the API.""" + + uri: Optional[str] = None + """The URI of the request.""" + + user_agent: Optional[str] = None + """The client's user agent string sent with the request.""" + + +class Resource(BaseModel): + id: Optional[str] = None + """The unique identifier for the affected resource.""" + + product: Optional[str] = None + """The Cloudflare product associated with the resource.""" + + request: Optional[object] = None + + response: Optional[object] = None + + scope: Optional[object] = None + """The scope of the resource.""" + + type: Optional[str] = None + """The type of the resource.""" + + +class Zone(BaseModel): + id: Optional[str] = None + """A string that identifies the zone id.""" + + name: Optional[str] = None + """A string that identifies the zone name.""" + + +class AuditListResponse(BaseModel): + id: Optional[str] = None + """A unique identifier for the audit log entry.""" + + account: Optional[Account] = None + """Contains account related information.""" + + action: Optional[Action] = None + """Provides information about the action performed.""" + + actor: Optional[Actor] = None + """Provides details about the actor who performed the action.""" + + raw: Optional[Raw] = None + """Provides raw information about the request and response.""" + + resource: Optional[Resource] = None + """Provides details about the affected resource.""" + + zone: Optional[Zone] = None + """Provides details about the zone affected by the action.""" diff --git a/src/cloudflare/types/accounts/token_create_params.py b/src/cloudflare/types/accounts/token_create_params.py index aca51228744..e94512a93f9 100644 --- a/src/cloudflare/types/accounts/token_create_params.py +++ b/src/cloudflare/types/accounts/token_create_params.py @@ -50,5 +50,5 @@ class ConditionRequestIP(_ConditionRequestIPReservedKeywords, total=False): class Condition(TypedDict, total=False): - request_ip: Annotated[ConditionRequestIP, PropertyInfo(alias="request.ip")] + request_ip: ConditionRequestIP """Client IP restrictions.""" diff --git a/src/cloudflare/types/accounts/token_create_response.py b/src/cloudflare/types/accounts/token_create_response.py index cfc75aba10c..baad5983f71 100644 --- a/src/cloudflare/types/accounts/token_create_response.py +++ b/src/cloudflare/types/accounts/token_create_response.py @@ -23,7 +23,7 @@ class ConditionRequestIP(BaseModel): class Condition(BaseModel): - request_ip: Optional[ConditionRequestIP] = FieldInfo(alias="request.ip", default=None) + request_ip: Optional[ConditionRequestIP] = None """Client IP restrictions.""" diff --git a/src/cloudflare/types/accounts/token_update_params.py b/src/cloudflare/types/accounts/token_update_params.py index 1968327cffa..bec89b38118 100644 --- a/src/cloudflare/types/accounts/token_update_params.py +++ b/src/cloudflare/types/accounts/token_update_params.py @@ -53,5 +53,5 @@ class ConditionRequestIP(_ConditionRequestIPReservedKeywords, total=False): class Condition(TypedDict, total=False): - request_ip: Annotated[ConditionRequestIP, PropertyInfo(alias="request.ip")] + request_ip: ConditionRequestIP """Client IP restrictions.""" diff --git a/src/cloudflare/types/addressing/address_map.py b/src/cloudflare/types/addressing/address_map.py index dff7660e50c..1ff0f0ab4f2 100644 --- a/src/cloudflare/types/addressing/address_map.py +++ b/src/cloudflare/types/addressing/address_map.py @@ -10,7 +10,7 @@ class AddressMap(BaseModel): id: Optional[str] = None - """Identifier""" + """Identifier of an Address Map.""" can_delete: Optional[bool] = None """If set to false, then the Address Map cannot be deleted via API. diff --git a/src/cloudflare/types/addressing/address_map_create_params.py b/src/cloudflare/types/addressing/address_map_create_params.py index ac313102d61..bef1dcc72a9 100644 --- a/src/cloudflare/types/addressing/address_map_create_params.py +++ b/src/cloudflare/types/addressing/address_map_create_params.py @@ -12,7 +12,7 @@ class AddressMapCreateParams(TypedDict, total=False): account_id: Required[str] - """Identifier""" + """Identifier of a Cloudflare account.""" description: Optional[str] """ diff --git a/src/cloudflare/types/addressing/address_map_create_response.py b/src/cloudflare/types/addressing/address_map_create_response.py index 032e1166d18..08303310e4e 100644 --- a/src/cloudflare/types/addressing/address_map_create_response.py +++ b/src/cloudflare/types/addressing/address_map_create_response.py @@ -31,7 +31,7 @@ class Membership(BaseModel): class AddressMapCreateResponse(BaseModel): id: Optional[str] = None - """Identifier""" + """Identifier of an Address Map.""" can_delete: Optional[bool] = None """If set to false, then the Address Map cannot be deleted via API. diff --git a/src/cloudflare/types/addressing/address_map_edit_params.py b/src/cloudflare/types/addressing/address_map_edit_params.py index 5d91c15dab3..78a94270693 100644 --- a/src/cloudflare/types/addressing/address_map_edit_params.py +++ b/src/cloudflare/types/addressing/address_map_edit_params.py @@ -10,7 +10,7 @@ class AddressMapEditParams(TypedDict, total=False): account_id: Required[str] - """Identifier""" + """Identifier of a Cloudflare account.""" default_sni: Optional[str] """ diff --git a/src/cloudflare/types/addressing/address_map_get_response.py b/src/cloudflare/types/addressing/address_map_get_response.py index 0eb306ccdbd..2eda9977d94 100644 --- a/src/cloudflare/types/addressing/address_map_get_response.py +++ b/src/cloudflare/types/addressing/address_map_get_response.py @@ -31,7 +31,7 @@ class Membership(BaseModel): class AddressMapGetResponse(BaseModel): id: Optional[str] = None - """Identifier""" + """Identifier of an Address Map.""" can_delete: Optional[bool] = None """If set to false, then the Address Map cannot be deleted via API. diff --git a/src/cloudflare/types/addressing/address_maps/account_update_params.py b/src/cloudflare/types/addressing/address_maps/account_update_params.py index f06483675c1..ff618f7f917 100644 --- a/src/cloudflare/types/addressing/address_maps/account_update_params.py +++ b/src/cloudflare/types/addressing/address_maps/account_update_params.py @@ -9,6 +9,6 @@ class AccountUpdateParams(TypedDict, total=False): account_id: Required[str] - """Identifier""" + """Identifier of a Cloudflare account.""" body: Required[object] diff --git a/src/cloudflare/types/addressing/address_maps/ip_update_params.py b/src/cloudflare/types/addressing/address_maps/ip_update_params.py index 41cd04d50b1..7c4e1611411 100644 --- a/src/cloudflare/types/addressing/address_maps/ip_update_params.py +++ b/src/cloudflare/types/addressing/address_maps/ip_update_params.py @@ -9,9 +9,9 @@ class IPUpdateParams(TypedDict, total=False): account_id: Required[str] - """Identifier""" + """Identifier of a Cloudflare account.""" address_map_id: Required[str] - """Identifier""" + """Identifier of an Address Map.""" body: Required[object] diff --git a/src/cloudflare/types/addressing/address_maps/zone_update_params.py b/src/cloudflare/types/addressing/address_maps/zone_update_params.py index 3cd7060a7ed..04047f85fc0 100644 --- a/src/cloudflare/types/addressing/address_maps/zone_update_params.py +++ b/src/cloudflare/types/addressing/address_maps/zone_update_params.py @@ -9,9 +9,9 @@ class ZoneUpdateParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" + """Identifier of a zone.""" account_id: Required[str] - """Identifier""" + """Identifier of a Cloudflare account.""" body: Required[object] diff --git a/src/cloudflare/types/addressing/loa_document_create_params.py b/src/cloudflare/types/addressing/loa_document_create_params.py index 4f8da69a2a5..3ea6bd6de69 100644 --- a/src/cloudflare/types/addressing/loa_document_create_params.py +++ b/src/cloudflare/types/addressing/loa_document_create_params.py @@ -9,7 +9,7 @@ class LOADocumentCreateParams(TypedDict, total=False): account_id: Required[str] - """Identifier""" + """Identifier of a Cloudflare account.""" loa_document: Required[str] """LOA document to upload.""" diff --git a/src/cloudflare/types/addressing/loa_document_create_response.py b/src/cloudflare/types/addressing/loa_document_create_response.py index 915d2b130c4..dd84b6a3b39 100644 --- a/src/cloudflare/types/addressing/loa_document_create_response.py +++ b/src/cloudflare/types/addressing/loa_document_create_response.py @@ -13,7 +13,7 @@ class LOADocumentCreateResponse(BaseModel): """Identifier for the uploaded LOA document.""" account_id: Optional[str] = None - """Identifier""" + """Identifier of a Cloudflare account.""" created: Optional[datetime] = None diff --git a/src/cloudflare/types/addressing/loa_documents/__init__.py b/src/cloudflare/types/addressing/loa_documents/__init__.py deleted file mode 100644 index f8ee8b14b1c..00000000000 --- a/src/cloudflare/types/addressing/loa_documents/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations diff --git a/src/cloudflare/types/addressing/prefix.py b/src/cloudflare/types/addressing/prefix.py index 9dd12947704..7a680d672f4 100644 --- a/src/cloudflare/types/addressing/prefix.py +++ b/src/cloudflare/types/addressing/prefix.py @@ -10,10 +10,10 @@ class Prefix(BaseModel): id: Optional[str] = None - """Identifier""" + """Identifier of an IP Prefix.""" account_id: Optional[str] = None - """Identifier""" + """Identifier of a Cloudflare account.""" advertised: Optional[bool] = None """Prefix advertisement status to the Internet. diff --git a/src/cloudflare/types/addressing/prefix_create_params.py b/src/cloudflare/types/addressing/prefix_create_params.py index edbe51ebcf4..b2d40ba7d01 100644 --- a/src/cloudflare/types/addressing/prefix_create_params.py +++ b/src/cloudflare/types/addressing/prefix_create_params.py @@ -10,7 +10,7 @@ class PrefixCreateParams(TypedDict, total=False): account_id: Required[str] - """Identifier""" + """Identifier of a Cloudflare account.""" asn: Required[Optional[int]] """Autonomous System Number (ASN) the prefix will be advertised under.""" diff --git a/src/cloudflare/types/addressing/prefix_edit_params.py b/src/cloudflare/types/addressing/prefix_edit_params.py index 9f4b08a8b40..b1ad60bb46f 100644 --- a/src/cloudflare/types/addressing/prefix_edit_params.py +++ b/src/cloudflare/types/addressing/prefix_edit_params.py @@ -9,7 +9,7 @@ class PrefixEditParams(TypedDict, total=False): account_id: Required[str] - """Identifier""" + """Identifier of a Cloudflare account.""" description: Required[str] """Description of the prefix.""" diff --git a/src/cloudflare/types/addressing/prefixes/__init__.py b/src/cloudflare/types/addressing/prefixes/__init__.py index 3f5ae7763da..70970ffbada 100644 --- a/src/cloudflare/types/addressing/prefixes/__init__.py +++ b/src/cloudflare/types/addressing/prefixes/__init__.py @@ -2,6 +2,15 @@ from __future__ import annotations +from .bgp_prefix import BGPPrefix as BGPPrefix from .delegations import Delegations as Delegations +from .service_binding import ServiceBinding as ServiceBinding +from .bgp_prefix_edit_params import BGPPrefixEditParams as BGPPrefixEditParams +from .bgp_prefix_create_params import BGPPrefixCreateParams as BGPPrefixCreateParams from .delegation_create_params import DelegationCreateParams as DelegationCreateParams from .delegation_delete_response import DelegationDeleteResponse as DelegationDeleteResponse +from .service_binding_create_params import ServiceBindingCreateParams as ServiceBindingCreateParams +from .service_binding_delete_response import ServiceBindingDeleteResponse as ServiceBindingDeleteResponse +from .advertisement_status_edit_params import AdvertisementStatusEditParams as AdvertisementStatusEditParams +from .advertisement_status_get_response import AdvertisementStatusGetResponse as AdvertisementStatusGetResponse +from .advertisement_status_edit_response import AdvertisementStatusEditResponse as AdvertisementStatusEditResponse diff --git a/src/cloudflare/types/addressing/prefixes/advertisement_status_edit_params.py b/src/cloudflare/types/addressing/prefixes/advertisement_status_edit_params.py new file mode 100644 index 00000000000..5de84a7f1d0 --- /dev/null +++ b/src/cloudflare/types/addressing/prefixes/advertisement_status_edit_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["AdvertisementStatusEditParams"] + + +class AdvertisementStatusEditParams(TypedDict, total=False): + account_id: Required[str] + """Identifier of a Cloudflare account.""" + + advertised: Required[bool] + """Advertisement status of the prefix. + + If `true`, the BGP route for the prefix is advertised to the Internet. If + `false`, the BGP route is withdrawn. + """ diff --git a/src/cloudflare/types/addressing/prefixes/bgp/status_get_response.py b/src/cloudflare/types/addressing/prefixes/advertisement_status_edit_response.py similarity index 54% rename from src/cloudflare/types/addressing/prefixes/bgp/status_get_response.py rename to src/cloudflare/types/addressing/prefixes/advertisement_status_edit_response.py index a6012cb77de..3c32d04dfcd 100644 --- a/src/cloudflare/types/addressing/prefixes/bgp/status_get_response.py +++ b/src/cloudflare/types/addressing/prefixes/advertisement_status_edit_response.py @@ -3,14 +3,18 @@ from typing import Optional from datetime import datetime -from ....._models import BaseModel +from ...._models import BaseModel -__all__ = ["StatusGetResponse"] +__all__ = ["AdvertisementStatusEditResponse"] -class StatusGetResponse(BaseModel): +class AdvertisementStatusEditResponse(BaseModel): advertised: Optional[bool] = None - """Enablement of prefix advertisement to the Internet.""" + """Advertisement status of the prefix. + + If `true`, the BGP route for the prefix is advertised to the Internet. If + `false`, the BGP route is withdrawn. + """ advertised_modified_at: Optional[datetime] = None """Last time the advertisement status was changed. diff --git a/src/cloudflare/types/addressing/prefixes/bgp/status_edit_response.py b/src/cloudflare/types/addressing/prefixes/advertisement_status_get_response.py similarity index 54% rename from src/cloudflare/types/addressing/prefixes/bgp/status_edit_response.py rename to src/cloudflare/types/addressing/prefixes/advertisement_status_get_response.py index f67cfc5baef..86260979361 100644 --- a/src/cloudflare/types/addressing/prefixes/bgp/status_edit_response.py +++ b/src/cloudflare/types/addressing/prefixes/advertisement_status_get_response.py @@ -3,14 +3,18 @@ from typing import Optional from datetime import datetime -from ....._models import BaseModel +from ...._models import BaseModel -__all__ = ["StatusEditResponse"] +__all__ = ["AdvertisementStatusGetResponse"] -class StatusEditResponse(BaseModel): +class AdvertisementStatusGetResponse(BaseModel): advertised: Optional[bool] = None - """Enablement of prefix advertisement to the Internet.""" + """Advertisement status of the prefix. + + If `true`, the BGP route for the prefix is advertised to the Internet. If + `false`, the BGP route is withdrawn. + """ advertised_modified_at: Optional[datetime] = None """Last time the advertisement status was changed. diff --git a/src/cloudflare/types/addressing/prefixes/bgp/__init__.py b/src/cloudflare/types/addressing/prefixes/bgp/__init__.py deleted file mode 100644 index bf70ca01135..00000000000 --- a/src/cloudflare/types/addressing/prefixes/bgp/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from .bgp_prefix import BGPPrefix as BGPPrefix -from .service_binding import ServiceBinding as ServiceBinding -from .prefix_edit_params import PrefixEditParams as PrefixEditParams -from .status_edit_params import StatusEditParams as StatusEditParams -from .status_get_response import StatusGetResponse as StatusGetResponse -from .status_edit_response import StatusEditResponse as StatusEditResponse -from .binding_create_params import BindingCreateParams as BindingCreateParams -from .binding_delete_response import BindingDeleteResponse as BindingDeleteResponse diff --git a/src/cloudflare/types/addressing/prefixes/bgp/bgp_prefix.py b/src/cloudflare/types/addressing/prefixes/bgp_prefix.py similarity index 96% rename from src/cloudflare/types/addressing/prefixes/bgp/bgp_prefix.py rename to src/cloudflare/types/addressing/prefixes/bgp_prefix.py index d9eecdf9d89..e58c9ebdd33 100644 --- a/src/cloudflare/types/addressing/prefixes/bgp/bgp_prefix.py +++ b/src/cloudflare/types/addressing/prefixes/bgp_prefix.py @@ -3,7 +3,7 @@ from typing import Optional from datetime import datetime -from ....._models import BaseModel +from ...._models import BaseModel __all__ = ["BGPPrefix", "BGPSignalOpts", "OnDemand"] @@ -50,7 +50,7 @@ class OnDemand(BaseModel): class BGPPrefix(BaseModel): id: Optional[str] = None - """Identifier""" + """Identifier of BGP Prefix.""" asn: Optional[int] = None """Autonomous System Number (ASN) the prefix will be advertised under.""" diff --git a/src/cloudflare/types/addressing/prefixes/bgp/binding_create_params.py b/src/cloudflare/types/addressing/prefixes/bgp_prefix_create_params.py similarity index 65% rename from src/cloudflare/types/addressing/prefixes/bgp/binding_create_params.py rename to src/cloudflare/types/addressing/prefixes/bgp_prefix_create_params.py index d4b3604ae77..387be0b879f 100644 --- a/src/cloudflare/types/addressing/prefixes/bgp/binding_create_params.py +++ b/src/cloudflare/types/addressing/prefixes/bgp_prefix_create_params.py @@ -4,15 +4,12 @@ from typing_extensions import Required, TypedDict -__all__ = ["BindingCreateParams"] +__all__ = ["BGPPrefixCreateParams"] -class BindingCreateParams(TypedDict, total=False): +class BGPPrefixCreateParams(TypedDict, total=False): account_id: Required[str] - """Identifier""" + """Identifier of a Cloudflare account.""" cidr: str """IP Prefix in Classless Inter-Domain Routing format.""" - - service_id: str - """Identifier""" diff --git a/src/cloudflare/types/addressing/prefixes/bgp/prefix_edit_params.py b/src/cloudflare/types/addressing/prefixes/bgp_prefix_edit_params.py similarity index 64% rename from src/cloudflare/types/addressing/prefixes/bgp/prefix_edit_params.py rename to src/cloudflare/types/addressing/prefixes/bgp_prefix_edit_params.py index 5040a427e1f..5822fc5a307 100644 --- a/src/cloudflare/types/addressing/prefixes/bgp/prefix_edit_params.py +++ b/src/cloudflare/types/addressing/prefixes/bgp_prefix_edit_params.py @@ -4,15 +4,15 @@ from typing_extensions import Required, TypedDict -__all__ = ["PrefixEditParams", "OnDemand"] +__all__ = ["BGPPrefixEditParams", "OnDemand"] -class PrefixEditParams(TypedDict, total=False): +class BGPPrefixEditParams(TypedDict, total=False): account_id: Required[str] - """Identifier""" + """Identifier of a Cloudflare account.""" prefix_id: Required[str] - """Identifier""" + """Identifier of an IP Prefix.""" on_demand: OnDemand diff --git a/src/cloudflare/types/addressing/prefixes/delegation_create_params.py b/src/cloudflare/types/addressing/prefixes/delegation_create_params.py index f8f9c9719f2..948fe969d3e 100644 --- a/src/cloudflare/types/addressing/prefixes/delegation_create_params.py +++ b/src/cloudflare/types/addressing/prefixes/delegation_create_params.py @@ -9,7 +9,7 @@ class DelegationCreateParams(TypedDict, total=False): account_id: Required[str] - """Identifier""" + """Identifier of a Cloudflare account.""" cidr: Required[str] """IP Prefix in Classless Inter-Domain Routing format.""" diff --git a/src/cloudflare/types/addressing/prefixes/delegation_delete_response.py b/src/cloudflare/types/addressing/prefixes/delegation_delete_response.py index 3581f2c3c0a..352868765b9 100644 --- a/src/cloudflare/types/addressing/prefixes/delegation_delete_response.py +++ b/src/cloudflare/types/addressing/prefixes/delegation_delete_response.py @@ -9,4 +9,4 @@ class DelegationDeleteResponse(BaseModel): id: Optional[str] = None - """Delegation identifier tag.""" + """Identifier of a Delegation.""" diff --git a/src/cloudflare/types/addressing/prefixes/delegations.py b/src/cloudflare/types/addressing/prefixes/delegations.py index 8a2d2d8fea8..c9b97dfc3d5 100644 --- a/src/cloudflare/types/addressing/prefixes/delegations.py +++ b/src/cloudflare/types/addressing/prefixes/delegations.py @@ -10,7 +10,7 @@ class Delegations(BaseModel): id: Optional[str] = None - """Delegation identifier tag.""" + """Identifier of a Delegation.""" cidr: Optional[str] = None """IP Prefix in Classless Inter-Domain Routing format.""" @@ -23,4 +23,4 @@ class Delegations(BaseModel): modified_at: Optional[datetime] = None parent_prefix_id: Optional[str] = None - """Identifier""" + """Identifier of an IP Prefix.""" diff --git a/src/cloudflare/types/addressing/prefixes/bgp/service_binding.py b/src/cloudflare/types/addressing/prefixes/service_binding.py similarity index 79% rename from src/cloudflare/types/addressing/prefixes/bgp/service_binding.py rename to src/cloudflare/types/addressing/prefixes/service_binding.py index 505f89b7c2e..34bbeabd065 100644 --- a/src/cloudflare/types/addressing/prefixes/bgp/service_binding.py +++ b/src/cloudflare/types/addressing/prefixes/service_binding.py @@ -3,7 +3,7 @@ from typing import Optional from typing_extensions import Literal -from ....._models import BaseModel +from ...._models import BaseModel __all__ = ["ServiceBinding", "Provisioning"] @@ -18,7 +18,7 @@ class Provisioning(BaseModel): class ServiceBinding(BaseModel): id: Optional[str] = None - """Identifier""" + """Identifier of a Service Binding.""" cidr: Optional[str] = None """IP Prefix in Classless Inter-Domain Routing format.""" @@ -27,7 +27,10 @@ class ServiceBinding(BaseModel): """Status of a Service Binding's deployment to the Cloudflare network""" service_id: Optional[str] = None - """Identifier""" + """Identifier of a Service on the Cloudflare network. + + Available services and their IDs may be found in the **List Services** endpoint. + """ service_name: Optional[str] = None """Name of a service running on the Cloudflare network""" diff --git a/src/cloudflare/types/addressing/prefixes/service_binding_create_params.py b/src/cloudflare/types/addressing/prefixes/service_binding_create_params.py new file mode 100644 index 00000000000..6e1f0420211 --- /dev/null +++ b/src/cloudflare/types/addressing/prefixes/service_binding_create_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["ServiceBindingCreateParams"] + + +class ServiceBindingCreateParams(TypedDict, total=False): + account_id: Required[str] + """Identifier of a Cloudflare account.""" + + cidr: str + """IP Prefix in Classless Inter-Domain Routing format.""" + + service_id: str + """Identifier of a Service on the Cloudflare network. + + Available services and their IDs may be found in the **List Services** endpoint. + """ diff --git a/src/cloudflare/types/addressing/prefixes/service_binding_delete_response.py b/src/cloudflare/types/addressing/prefixes/service_binding_delete_response.py new file mode 100644 index 00000000000..7c24a85fea7 --- /dev/null +++ b/src/cloudflare/types/addressing/prefixes/service_binding_delete_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import Literal + +from ...._models import BaseModel +from ...shared.response_info import ResponseInfo + +__all__ = ["ServiceBindingDeleteResponse"] + + +class ServiceBindingDeleteResponse(BaseModel): + errors: List[ResponseInfo] + + messages: List[ResponseInfo] + + success: Literal[True] + """Whether the API call was successful""" diff --git a/src/cloudflare/types/addressing/service_list_response.py b/src/cloudflare/types/addressing/service_list_response.py index e4e66040091..a97b11929a2 100644 --- a/src/cloudflare/types/addressing/service_list_response.py +++ b/src/cloudflare/types/addressing/service_list_response.py @@ -9,7 +9,10 @@ class ServiceListResponse(BaseModel): id: Optional[str] = None - """Identifier""" + """Identifier of a Service on the Cloudflare network. + + Available services and their IDs may be found in the **List Services** endpoint. + """ name: Optional[str] = None """Name of a service running on the Cloudflare network""" diff --git a/src/cloudflare/types/ai/__init__.py b/src/cloudflare/types/ai/__init__.py new file mode 100644 index 00000000000..4f495e50871 --- /dev/null +++ b/src/cloudflare/types/ai/__init__.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .ai_run_params import AIRunParams as AIRunParams +from .ai_run_response import AIRunResponse as AIRunResponse +from .model_list_params import ModelListParams as ModelListParams +from .finetune_create_params import FinetuneCreateParams as FinetuneCreateParams +from .finetune_list_response import FinetuneListResponse as FinetuneListResponse +from .finetune_create_response import FinetuneCreateResponse as FinetuneCreateResponse diff --git a/src/cloudflare/types/workers/ai_run_params.py b/src/cloudflare/types/ai/ai_run_params.py similarity index 100% rename from src/cloudflare/types/workers/ai_run_params.py rename to src/cloudflare/types/ai/ai_run_params.py diff --git a/src/cloudflare/types/workers/ai_run_response.py b/src/cloudflare/types/ai/ai_run_response.py similarity index 100% rename from src/cloudflare/types/workers/ai_run_response.py rename to src/cloudflare/types/ai/ai_run_response.py diff --git a/src/cloudflare/types/addressing/prefixes/bgp/status_edit_params.py b/src/cloudflare/types/ai/finetune_create_params.py similarity index 51% rename from src/cloudflare/types/addressing/prefixes/bgp/status_edit_params.py rename to src/cloudflare/types/ai/finetune_create_params.py index 10f8c1cf7b3..84fc0d24f14 100644 --- a/src/cloudflare/types/addressing/prefixes/bgp/status_edit_params.py +++ b/src/cloudflare/types/ai/finetune_create_params.py @@ -4,12 +4,16 @@ from typing_extensions import Required, TypedDict -__all__ = ["StatusEditParams"] +__all__ = ["FinetuneCreateParams"] -class StatusEditParams(TypedDict, total=False): +class FinetuneCreateParams(TypedDict, total=False): account_id: Required[str] - """Identifier""" - advertised: Required[bool] - """Enablement of prefix advertisement to the Internet.""" + model: Required[str] + + name: Required[str] + + description: str + + public: bool diff --git a/src/cloudflare/types/ai/finetune_create_response.py b/src/cloudflare/types/ai/finetune_create_response.py new file mode 100644 index 00000000000..2b4b9963389 --- /dev/null +++ b/src/cloudflare/types/ai/finetune_create_response.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from ..._models import BaseModel + +__all__ = ["FinetuneCreateResponse"] + + +class FinetuneCreateResponse(BaseModel): + id: str + + created_at: datetime + + model: str + + modified_at: datetime + + name: str + + public: bool + + description: Optional[str] = None diff --git a/src/cloudflare/types/ai/finetune_list_response.py b/src/cloudflare/types/ai/finetune_list_response.py new file mode 100644 index 00000000000..b036b170114 --- /dev/null +++ b/src/cloudflare/types/ai/finetune_list_response.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from ..._models import BaseModel + +__all__ = ["FinetuneListResponse"] + + +class FinetuneListResponse(BaseModel): + id: str + + created_at: datetime + + model: str + + modified_at: datetime + + name: str + + description: Optional[str] = None diff --git a/src/cloudflare/types/ai/finetunes/__init__.py b/src/cloudflare/types/ai/finetunes/__init__.py new file mode 100644 index 00000000000..736711396fa --- /dev/null +++ b/src/cloudflare/types/ai/finetunes/__init__.py @@ -0,0 +1,8 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .public_list_params import PublicListParams as PublicListParams +from .asset_create_params import AssetCreateParams as AssetCreateParams +from .public_list_response import PublicListResponse as PublicListResponse +from .asset_create_response import AssetCreateResponse as AssetCreateResponse diff --git a/src/cloudflare/types/ai/finetunes/asset_create_params.py b/src/cloudflare/types/ai/finetunes/asset_create_params.py new file mode 100644 index 00000000000..26f0da33305 --- /dev/null +++ b/src/cloudflare/types/ai/finetunes/asset_create_params.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from ...._types import FileTypes + +__all__ = ["AssetCreateParams"] + + +class AssetCreateParams(TypedDict, total=False): + account_id: Required[str] + + file: FileTypes + + file_name: str diff --git a/src/cloudflare/types/ai/finetunes/asset_create_response.py b/src/cloudflare/types/ai/finetunes/asset_create_response.py new file mode 100644 index 00000000000..eef3e2d7d2d --- /dev/null +++ b/src/cloudflare/types/ai/finetunes/asset_create_response.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from datetime import datetime + +from ...._models import BaseModel + +__all__ = ["AssetCreateResponse"] + + +class AssetCreateResponse(BaseModel): + id: str + + bucket_name: str + + created_at: datetime + + file_name: str + + finetune_id: str + + modified_at: datetime diff --git a/src/cloudflare/types/ai/finetunes/public_list_params.py b/src/cloudflare/types/ai/finetunes/public_list_params.py new file mode 100644 index 00000000000..c5a973eaf63 --- /dev/null +++ b/src/cloudflare/types/ai/finetunes/public_list_params.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ...._utils import PropertyInfo + +__all__ = ["PublicListParams"] + + +class PublicListParams(TypedDict, total=False): + account_id: Required[str] + + limit: float + """Pagination Limit""" + + offset: float + """Pagination Offset""" + + order_by: Annotated[str, PropertyInfo(alias="orderBy")] + """Order By Column Name""" diff --git a/src/cloudflare/types/ai/finetunes/public_list_response.py b/src/cloudflare/types/ai/finetunes/public_list_response.py new file mode 100644 index 00000000000..4f96442b435 --- /dev/null +++ b/src/cloudflare/types/ai/finetunes/public_list_response.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from ...._models import BaseModel + +__all__ = ["PublicListResponse"] + + +class PublicListResponse(BaseModel): + id: str + + created_at: datetime + + model: str + + modified_at: datetime + + name: str + + public: bool + + description: Optional[str] = None diff --git a/src/cloudflare/types/ai/model_list_params.py b/src/cloudflare/types/ai/model_list_params.py new file mode 100644 index 00000000000..bcbc1d7bc05 --- /dev/null +++ b/src/cloudflare/types/ai/model_list_params.py @@ -0,0 +1,30 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["ModelListParams"] + + +class ModelListParams(TypedDict, total=False): + account_id: Required[str] + + author: str + """Filter by Author""" + + hide_experimental: bool + """Filter to hide experimental models""" + + page: int + + per_page: int + + search: str + """Search""" + + source: float + """Filter by Source Id""" + + task: str + """Filter by Task Name""" diff --git a/src/cloudflare/types/workers/ai/models/__init__.py b/src/cloudflare/types/ai/models/__init__.py similarity index 100% rename from src/cloudflare/types/workers/ai/models/__init__.py rename to src/cloudflare/types/ai/models/__init__.py diff --git a/src/cloudflare/types/workers/ai/models/schema_get_params.py b/src/cloudflare/types/ai/models/schema_get_params.py similarity index 100% rename from src/cloudflare/types/workers/ai/models/schema_get_params.py rename to src/cloudflare/types/ai/models/schema_get_params.py diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_create_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_create_response.py index d13ca4fea1f..8c4df8ce75e 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_create_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_create_response.py @@ -13,6 +13,10 @@ class AIGatewayCreateResponse(BaseModel): id: str """gateway id""" + account_id: str + + account_tag: str + cache_invalidate_on_update: bool cache_ttl: Optional[int] = None @@ -21,6 +25,8 @@ class AIGatewayCreateResponse(BaseModel): created_at: datetime + internal_id: str + modified_at: datetime rate_limiting_interval: Optional[int] = None diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_delete_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_delete_response.py index 96e4ed45b33..56b71b99466 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_delete_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_delete_response.py @@ -13,6 +13,10 @@ class AIGatewayDeleteResponse(BaseModel): id: str """gateway id""" + account_id: str + + account_tag: str + cache_invalidate_on_update: bool cache_ttl: Optional[int] = None @@ -21,6 +25,8 @@ class AIGatewayDeleteResponse(BaseModel): created_at: datetime + internal_id: str + modified_at: datetime rate_limiting_interval: Optional[int] = None diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_get_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_get_response.py index 4686eb08c4f..eed84b4ee8d 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_get_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_get_response.py @@ -13,6 +13,10 @@ class AIGatewayGetResponse(BaseModel): id: str """gateway id""" + account_id: str + + account_tag: str + cache_invalidate_on_update: bool cache_ttl: Optional[int] = None @@ -21,6 +25,8 @@ class AIGatewayGetResponse(BaseModel): created_at: datetime + internal_id: str + modified_at: datetime rate_limiting_interval: Optional[int] = None diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_list_params.py b/src/cloudflare/types/ai_gateway/ai_gateway_list_params.py index a363b567a3f..a2545d4af8e 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_list_params.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, TypedDict +from typing_extensions import Required, TypedDict __all__ = ["AIGatewayListParams"] @@ -10,12 +10,6 @@ class AIGatewayListParams(TypedDict, total=False): account_id: Required[str] - order_by: str - """Order By Column Name""" - - order_by_direction: Literal["asc", "desc"] - """Order By Direction""" - page: int per_page: int diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_list_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_list_response.py index b7e93763d69..31dca9345f4 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_list_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_list_response.py @@ -13,6 +13,10 @@ class AIGatewayListResponse(BaseModel): id: str """gateway id""" + account_id: str + + account_tag: str + cache_invalidate_on_update: bool cache_ttl: Optional[int] = None @@ -21,6 +25,8 @@ class AIGatewayListResponse(BaseModel): created_at: datetime + internal_id: str + modified_at: datetime rate_limiting_interval: Optional[int] = None diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_update_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_update_response.py index 9a0077bb441..21e6cd223b6 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_update_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_update_response.py @@ -13,6 +13,10 @@ class AIGatewayUpdateResponse(BaseModel): id: str """gateway id""" + account_id: str + + account_tag: str + cache_invalidate_on_update: bool cache_ttl: Optional[int] = None @@ -21,6 +25,8 @@ class AIGatewayUpdateResponse(BaseModel): created_at: datetime + internal_id: str + modified_at: datetime rate_limiting_interval: Optional[int] = None diff --git a/src/cloudflare/types/ai_gateway/dataset_create_response.py b/src/cloudflare/types/ai_gateway/dataset_create_response.py index 806584ab12e..5be90be4a14 100644 --- a/src/cloudflare/types/ai_gateway/dataset_create_response.py +++ b/src/cloudflare/types/ai_gateway/dataset_create_response.py @@ -34,6 +34,10 @@ class Filter(BaseModel): class DatasetCreateResponse(BaseModel): id: str + account_id: str + + account_tag: str + created_at: datetime enable: bool diff --git a/src/cloudflare/types/ai_gateway/dataset_delete_response.py b/src/cloudflare/types/ai_gateway/dataset_delete_response.py index b097128ba3c..9b9ede756f2 100644 --- a/src/cloudflare/types/ai_gateway/dataset_delete_response.py +++ b/src/cloudflare/types/ai_gateway/dataset_delete_response.py @@ -34,6 +34,10 @@ class Filter(BaseModel): class DatasetDeleteResponse(BaseModel): id: str + account_id: str + + account_tag: str + created_at: datetime enable: bool diff --git a/src/cloudflare/types/ai_gateway/dataset_get_response.py b/src/cloudflare/types/ai_gateway/dataset_get_response.py index 1641c723f9e..102c0cd1b49 100644 --- a/src/cloudflare/types/ai_gateway/dataset_get_response.py +++ b/src/cloudflare/types/ai_gateway/dataset_get_response.py @@ -34,6 +34,10 @@ class Filter(BaseModel): class DatasetGetResponse(BaseModel): id: str + account_id: str + + account_tag: str + created_at: datetime enable: bool diff --git a/src/cloudflare/types/ai_gateway/dataset_list_params.py b/src/cloudflare/types/ai_gateway/dataset_list_params.py index 29c35578d00..440331fa032 100644 --- a/src/cloudflare/types/ai_gateway/dataset_list_params.py +++ b/src/cloudflare/types/ai_gateway/dataset_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, TypedDict +from typing_extensions import Required, TypedDict __all__ = ["DatasetListParams"] @@ -14,12 +14,6 @@ class DatasetListParams(TypedDict, total=False): name: str - order_by: str - """Order By Column Name""" - - order_by_direction: Literal["asc", "desc"] - """Order By Direction""" - page: int per_page: int diff --git a/src/cloudflare/types/ai_gateway/dataset_list_response.py b/src/cloudflare/types/ai_gateway/dataset_list_response.py index 710a48b322d..cf9d6e28bd3 100644 --- a/src/cloudflare/types/ai_gateway/dataset_list_response.py +++ b/src/cloudflare/types/ai_gateway/dataset_list_response.py @@ -34,6 +34,10 @@ class Filter(BaseModel): class DatasetListResponse(BaseModel): id: str + account_id: str + + account_tag: str + created_at: datetime enable: bool diff --git a/src/cloudflare/types/ai_gateway/dataset_update_response.py b/src/cloudflare/types/ai_gateway/dataset_update_response.py index a68021d1647..2cfeca9e20c 100644 --- a/src/cloudflare/types/ai_gateway/dataset_update_response.py +++ b/src/cloudflare/types/ai_gateway/dataset_update_response.py @@ -34,6 +34,10 @@ class Filter(BaseModel): class DatasetUpdateResponse(BaseModel): id: str + account_id: str + + account_tag: str + created_at: datetime enable: bool diff --git a/src/cloudflare/types/ai_gateway/evaluation_create_response.py b/src/cloudflare/types/ai_gateway/evaluation_create_response.py index 41775aef604..40b1b09254b 100644 --- a/src/cloudflare/types/ai_gateway/evaluation_create_response.py +++ b/src/cloudflare/types/ai_gateway/evaluation_create_response.py @@ -34,6 +34,10 @@ class DatasetFilter(BaseModel): class Dataset(BaseModel): id: str + account_id: str + + account_tag: str + created_at: datetime enable: bool @@ -71,6 +75,10 @@ class Result(BaseModel): class EvaluationCreateResponse(BaseModel): id: str + account_id: str + + account_tag: str + created_at: datetime datasets: List[Dataset] diff --git a/src/cloudflare/types/ai_gateway/evaluation_delete_response.py b/src/cloudflare/types/ai_gateway/evaluation_delete_response.py index 97255d29893..163d4406dd6 100644 --- a/src/cloudflare/types/ai_gateway/evaluation_delete_response.py +++ b/src/cloudflare/types/ai_gateway/evaluation_delete_response.py @@ -34,6 +34,10 @@ class DatasetFilter(BaseModel): class Dataset(BaseModel): id: str + account_id: str + + account_tag: str + created_at: datetime enable: bool @@ -71,6 +75,10 @@ class Result(BaseModel): class EvaluationDeleteResponse(BaseModel): id: str + account_id: str + + account_tag: str + created_at: datetime datasets: List[Dataset] diff --git a/src/cloudflare/types/ai_gateway/evaluation_get_response.py b/src/cloudflare/types/ai_gateway/evaluation_get_response.py index 63b8598ce32..2ac71bd4a18 100644 --- a/src/cloudflare/types/ai_gateway/evaluation_get_response.py +++ b/src/cloudflare/types/ai_gateway/evaluation_get_response.py @@ -34,6 +34,10 @@ class DatasetFilter(BaseModel): class Dataset(BaseModel): id: str + account_id: str + + account_tag: str + created_at: datetime enable: bool @@ -71,6 +75,10 @@ class Result(BaseModel): class EvaluationGetResponse(BaseModel): id: str + account_id: str + + account_tag: str + created_at: datetime datasets: List[Dataset] diff --git a/src/cloudflare/types/ai_gateway/evaluation_list_params.py b/src/cloudflare/types/ai_gateway/evaluation_list_params.py index 1577eb25188..deefec45cbf 100644 --- a/src/cloudflare/types/ai_gateway/evaluation_list_params.py +++ b/src/cloudflare/types/ai_gateway/evaluation_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Required, TypedDict +from typing_extensions import Required, TypedDict __all__ = ["EvaluationListParams"] @@ -12,12 +12,6 @@ class EvaluationListParams(TypedDict, total=False): name: str - order_by: str - """Order By Column Name""" - - order_by_direction: Literal["asc", "desc"] - """Order By Direction""" - page: int per_page: int diff --git a/src/cloudflare/types/ai_gateway/evaluation_list_response.py b/src/cloudflare/types/ai_gateway/evaluation_list_response.py index 75a55183881..e40b09a38aa 100644 --- a/src/cloudflare/types/ai_gateway/evaluation_list_response.py +++ b/src/cloudflare/types/ai_gateway/evaluation_list_response.py @@ -34,6 +34,10 @@ class DatasetFilter(BaseModel): class Dataset(BaseModel): id: str + account_id: str + + account_tag: str + created_at: datetime enable: bool @@ -71,6 +75,10 @@ class Result(BaseModel): class EvaluationListResponse(BaseModel): id: str + account_id: str + + account_tag: str + created_at: datetime datasets: List[Dataset] diff --git a/src/cloudflare/types/ai_gateway/log_delete_params.py b/src/cloudflare/types/ai_gateway/log_delete_params.py index 4a6d76f27a0..0f7f4ca6c3c 100644 --- a/src/cloudflare/types/ai_gateway/log_delete_params.py +++ b/src/cloudflare/types/ai_gateway/log_delete_params.py @@ -35,6 +35,7 @@ class LogDeleteParams(TypedDict, total=False): class Filter(TypedDict, total=False): key: Required[ Literal[ + "id", "created_at", "request_content_type", "response_content_type", @@ -49,6 +50,12 @@ class Filter(TypedDict, total=False): "tokens_out", "duration", "feedback", + "event_id", + "request_type", + "metadata.key", + "metadata.value", + "prompts.prompt_id", + "prompts.version_id", ] ] diff --git a/src/cloudflare/types/ai_gateway/log_list_params.py b/src/cloudflare/types/ai_gateway/log_list_params.py index 14365d3a489..dbdf158649c 100644 --- a/src/cloudflare/types/ai_gateway/log_list_params.py +++ b/src/cloudflare/types/ai_gateway/log_list_params.py @@ -74,6 +74,7 @@ class LogListParams(TypedDict, total=False): class Filter(TypedDict, total=False): key: Required[ Literal[ + "id", "created_at", "request_content_type", "response_content_type", @@ -88,6 +89,12 @@ class Filter(TypedDict, total=False): "tokens_out", "duration", "feedback", + "event_id", + "request_type", + "metadata.key", + "metadata.value", + "prompts.prompt_id", + "prompts.version_id", ] ] diff --git a/src/cloudflare/types/api_gateway/__init__.py b/src/cloudflare/types/api_gateway/__init__.py index 272e71c2b78..bb1373799ba 100644 --- a/src/cloudflare/types/api_gateway/__init__.py +++ b/src/cloudflare/types/api_gateway/__init__.py @@ -4,7 +4,6 @@ from .message import Message as Message from .settings import Settings as Settings -from .api_shield import APIShield as APIShield from .configuration import Configuration as Configuration from .public_schema import PublicSchema as PublicSchema from .schema_upload import SchemaUpload as SchemaUpload @@ -26,5 +25,7 @@ from .user_schema_create_params import UserSchemaCreateParams as UserSchemaCreateParams from .configuration_update_params import ConfigurationUpdateParams as ConfigurationUpdateParams from .user_schema_delete_response import UserSchemaDeleteResponse as UserSchemaDeleteResponse +from .operation_bulk_create_params import OperationBulkCreateParams as OperationBulkCreateParams from .configuration_update_response import ConfigurationUpdateResponse as ConfigurationUpdateResponse +from .operation_bulk_create_response import OperationBulkCreateResponse as OperationBulkCreateResponse from .operation_bulk_delete_response import OperationBulkDeleteResponse as OperationBulkDeleteResponse diff --git a/src/cloudflare/types/api_gateway/api_shield.py b/src/cloudflare/types/api_gateway/api_shield.py deleted file mode 100644 index f884d96b96c..00000000000 --- a/src/cloudflare/types/api_gateway/api_shield.py +++ /dev/null @@ -1,227 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, TypeAlias - -from ..._models import BaseModel - -__all__ = [ - "APIShield", - "Features", - "FeaturesAPIShieldOperationFeatureThresholds", - "FeaturesAPIShieldOperationFeatureThresholdsThresholds", - "FeaturesAPIShieldOperationFeatureParameterSchemas", - "FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas", - "FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas", - "FeaturesAPIShieldOperationFeatureAPIRouting", - "FeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting", - "FeaturesAPIShieldOperationFeatureConfidenceIntervals", - "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals", - "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold", - "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals", - "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90", - "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95", - "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99", - "FeaturesAPIShieldOperationFeatureSchemaInfo", - "FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo", - "FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema", -] - - -class FeaturesAPIShieldOperationFeatureThresholdsThresholds(BaseModel): - auth_id_tokens: Optional[int] = None - """The total number of auth-ids seen across this calculation.""" - - data_points: Optional[int] = None - """The number of data points used for the threshold suggestion calculation.""" - - last_updated: Optional[datetime] = None - - p50: Optional[int] = None - """The p50 quantile of requests (in period_seconds).""" - - p90: Optional[int] = None - """The p90 quantile of requests (in period_seconds).""" - - p99: Optional[int] = None - """The p99 quantile of requests (in period_seconds).""" - - period_seconds: Optional[int] = None - """The period over which this threshold is suggested.""" - - requests: Optional[int] = None - """The estimated number of requests covered by these calculations.""" - - suggested_threshold: Optional[int] = None - """The suggested threshold in requests done by the same auth_id or period_seconds.""" - - -class FeaturesAPIShieldOperationFeatureThresholds(BaseModel): - thresholds: Optional[FeaturesAPIShieldOperationFeatureThresholdsThresholds] = None - - -class FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas(BaseModel): - parameters: Optional[List[object]] = None - """An array containing the learned parameter schemas.""" - - responses: Optional[object] = None - """An empty response object. - - This field is required to yield a valid operation schema. - """ - - -class FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas(BaseModel): - last_updated: Optional[datetime] = None - - parameter_schemas: Optional[FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas] = ( - None - ) - """An operation schema object containing a response.""" - - -class FeaturesAPIShieldOperationFeatureParameterSchemas(BaseModel): - parameter_schemas: FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas - - -class FeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting(BaseModel): - last_updated: Optional[datetime] = None - - route: Optional[str] = None - """Target route.""" - - -class FeaturesAPIShieldOperationFeatureAPIRouting(BaseModel): - api_routing: Optional[FeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting] = None - """API Routing settings on endpoint.""" - - -class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90( - BaseModel -): - lower: Optional[float] = None - """Lower bound for percentile estimate""" - - upper: Optional[float] = None - """Upper bound for percentile estimate""" - - -class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95( - BaseModel -): - lower: Optional[float] = None - """Lower bound for percentile estimate""" - - upper: Optional[float] = None - """Upper bound for percentile estimate""" - - -class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99( - BaseModel -): - lower: Optional[float] = None - """Lower bound for percentile estimate""" - - upper: Optional[float] = None - """Upper bound for percentile estimate""" - - -class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals( - BaseModel -): - p90: Optional[ - FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90 - ] = None - """Upper and lower bound for percentile estimate""" - - p95: Optional[ - FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95 - ] = None - """Upper and lower bound for percentile estimate""" - - p99: Optional[ - FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99 - ] = None - """Upper and lower bound for percentile estimate""" - - -class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold(BaseModel): - confidence_intervals: Optional[ - FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals - ] = None - - mean: Optional[float] = None - """Suggested threshold.""" - - -class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals(BaseModel): - last_updated: Optional[datetime] = None - - suggested_threshold: Optional[ - FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold - ] = None - - -class FeaturesAPIShieldOperationFeatureConfidenceIntervals(BaseModel): - confidence_intervals: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals] = None - - -class FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema(BaseModel): - id: Optional[str] = None - """UUID""" - - created_at: Optional[datetime] = None - - is_learned: Optional[bool] = None - """True if schema is Cloudflare-provided.""" - - name: Optional[str] = None - """Schema file name.""" - - -class FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo(BaseModel): - active_schema: Optional[FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema] = None - """Schema active on endpoint.""" - - learned_available: Optional[bool] = None - """True if a Cloudflare-provided learned schema is available for this endpoint.""" - - mitigation_action: Optional[Literal["none", "log", "block"]] = None - """Action taken on requests failing validation.""" - - -class FeaturesAPIShieldOperationFeatureSchemaInfo(BaseModel): - schema_info: Optional[FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo] = None - - -Features: TypeAlias = Union[ - FeaturesAPIShieldOperationFeatureThresholds, - FeaturesAPIShieldOperationFeatureParameterSchemas, - FeaturesAPIShieldOperationFeatureAPIRouting, - FeaturesAPIShieldOperationFeatureConfidenceIntervals, - FeaturesAPIShieldOperationFeatureSchemaInfo, -] - - -class APIShield(BaseModel): - endpoint: str - """ - The endpoint which can contain path parameter templates in curly braces, each - will be replaced from left to right with {varN}, starting with {var1}, during - insertion. This will further be Cloudflare-normalized upon insertion. See: - https://developers.cloudflare.com/rules/normalization/how-it-works/. - """ - - host: str - """RFC3986-compliant host.""" - - last_updated: datetime - - method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"] - """The HTTP method used to access the endpoint.""" - - operation_id: str - """UUID""" - - features: Optional[Features] = None diff --git a/src/cloudflare/types/api_gateway/operation_bulk_create_params.py b/src/cloudflare/types/api_gateway/operation_bulk_create_params.py new file mode 100644 index 00000000000..8672ae972e9 --- /dev/null +++ b/src/cloudflare/types/api_gateway/operation_bulk_create_params.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["OperationBulkCreateParams", "Body"] + + +class OperationBulkCreateParams(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + body: Required[Iterable[Body]] + + +class Body(TypedDict, total=False): + endpoint: Required[str] + """ + The endpoint which can contain path parameter templates in curly braces, each + will be replaced from left to right with {varN}, starting with {var1}, during + insertion. This will further be Cloudflare-normalized upon insertion. See: + https://developers.cloudflare.com/rules/normalization/how-it-works/. + """ + + host: Required[str] + """RFC3986-compliant host.""" + + method: Required[Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"]] + """The HTTP method used to access the endpoint.""" diff --git a/src/cloudflare/types/api_gateway/operation_bulk_create_response.py b/src/cloudflare/types/api_gateway/operation_bulk_create_response.py new file mode 100644 index 00000000000..cf7c4824a17 --- /dev/null +++ b/src/cloudflare/types/api_gateway/operation_bulk_create_response.py @@ -0,0 +1,239 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, TypeAlias + +from ..._models import BaseModel + +__all__ = [ + "OperationBulkCreateResponse", + "OperationBulkCreateResponseItem", + "OperationBulkCreateResponseItemFeatures", + "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureThresholds", + "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureThresholdsThresholds", + "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemas", + "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas", + "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas", + "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureAPIRouting", + "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting", + "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervals", + "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals", + "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold", + "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals", + "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90", + "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95", + "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99", + "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfo", + "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo", + "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema", +] + + +class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureThresholdsThresholds(BaseModel): + auth_id_tokens: Optional[int] = None + """The total number of auth-ids seen across this calculation.""" + + data_points: Optional[int] = None + """The number of data points used for the threshold suggestion calculation.""" + + last_updated: Optional[datetime] = None + + p50: Optional[int] = None + """The p50 quantile of requests (in period_seconds).""" + + p90: Optional[int] = None + """The p90 quantile of requests (in period_seconds).""" + + p99: Optional[int] = None + """The p99 quantile of requests (in period_seconds).""" + + period_seconds: Optional[int] = None + """The period over which this threshold is suggested.""" + + requests: Optional[int] = None + """The estimated number of requests covered by these calculations.""" + + suggested_threshold: Optional[int] = None + """The suggested threshold in requests done by the same auth_id or period_seconds.""" + + +class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureThresholds(BaseModel): + thresholds: Optional[OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureThresholdsThresholds] = None + + +class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas( + BaseModel +): + parameters: Optional[List[object]] = None + """An array containing the learned parameter schemas.""" + + responses: Optional[object] = None + """An empty response object. + + This field is required to yield a valid operation schema. + """ + + +class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas(BaseModel): + last_updated: Optional[datetime] = None + + parameter_schemas: Optional[ + OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas + ] = None + """An operation schema object containing a response.""" + + +class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemas(BaseModel): + parameter_schemas: OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas + + +class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting(BaseModel): + last_updated: Optional[datetime] = None + + route: Optional[str] = None + """Target route.""" + + +class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureAPIRouting(BaseModel): + api_routing: Optional[OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting] = None + """API Routing settings on endpoint.""" + + +class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90( + BaseModel +): + lower: Optional[float] = None + """Lower bound for percentile estimate""" + + upper: Optional[float] = None + """Upper bound for percentile estimate""" + + +class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95( + BaseModel +): + lower: Optional[float] = None + """Lower bound for percentile estimate""" + + upper: Optional[float] = None + """Upper bound for percentile estimate""" + + +class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99( + BaseModel +): + lower: Optional[float] = None + """Lower bound for percentile estimate""" + + upper: Optional[float] = None + """Upper bound for percentile estimate""" + + +class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals( + BaseModel +): + p90: Optional[ + OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90 + ] = None + """Upper and lower bound for percentile estimate""" + + p95: Optional[ + OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95 + ] = None + """Upper and lower bound for percentile estimate""" + + p99: Optional[ + OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99 + ] = None + """Upper and lower bound for percentile estimate""" + + +class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold( + BaseModel +): + confidence_intervals: Optional[ + OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals + ] = None + + mean: Optional[float] = None + """Suggested threshold.""" + + +class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals(BaseModel): + last_updated: Optional[datetime] = None + + suggested_threshold: Optional[ + OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold + ] = None + + +class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervals(BaseModel): + confidence_intervals: Optional[ + OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals + ] = None + + +class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema(BaseModel): + id: Optional[str] = None + """UUID""" + + created_at: Optional[datetime] = None + + is_learned: Optional[bool] = None + """True if schema is Cloudflare-provided.""" + + name: Optional[str] = None + """Schema file name.""" + + +class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo(BaseModel): + active_schema: Optional[ + OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema + ] = None + """Schema active on endpoint.""" + + learned_available: Optional[bool] = None + """True if a Cloudflare-provided learned schema is available for this endpoint.""" + + mitigation_action: Optional[Literal["none", "log", "block"]] = None + """Action taken on requests failing validation.""" + + +class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfo(BaseModel): + schema_info: Optional[OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo] = None + + +OperationBulkCreateResponseItemFeatures: TypeAlias = Union[ + OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureThresholds, + OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemas, + OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureAPIRouting, + OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervals, + OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfo, +] + + +class OperationBulkCreateResponseItem(BaseModel): + endpoint: str + """ + The endpoint which can contain path parameter templates in curly braces, each + will be replaced from left to right with {varN}, starting with {var1}, during + insertion. This will further be Cloudflare-normalized upon insertion. See: + https://developers.cloudflare.com/rules/normalization/how-it-works/. + """ + + host: str + """RFC3986-compliant host.""" + + last_updated: datetime + + method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"] + """The HTTP method used to access the endpoint.""" + + operation_id: str + """UUID""" + + features: Optional[OperationBulkCreateResponseItemFeatures] = None + + +OperationBulkCreateResponse: TypeAlias = List[OperationBulkCreateResponseItem] diff --git a/src/cloudflare/types/api_gateway/operation_create_params.py b/src/cloudflare/types/api_gateway/operation_create_params.py index dbfa97bf6e8..4563a0f9afb 100644 --- a/src/cloudflare/types/api_gateway/operation_create_params.py +++ b/src/cloudflare/types/api_gateway/operation_create_params.py @@ -2,20 +2,15 @@ from __future__ import annotations -from typing import Iterable from typing_extensions import Literal, Required, TypedDict -__all__ = ["OperationCreateParams", "Body"] +__all__ = ["OperationCreateParams"] class OperationCreateParams(TypedDict, total=False): zone_id: Required[str] """Identifier""" - body: Required[Iterable[Body]] - - -class Body(TypedDict, total=False): endpoint: Required[str] """ The endpoint which can contain path parameter templates in curly braces, each diff --git a/src/cloudflare/types/api_gateway/operation_create_response.py b/src/cloudflare/types/api_gateway/operation_create_response.py index 23d0751ec12..a9b73ff2a91 100644 --- a/src/cloudflare/types/api_gateway/operation_create_response.py +++ b/src/cloudflare/types/api_gateway/operation_create_response.py @@ -1,10 +1,227 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List -from typing_extensions import TypeAlias +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, TypeAlias -from .api_shield import APIShield +from ..._models import BaseModel -__all__ = ["OperationCreateResponse"] +__all__ = [ + "OperationCreateResponse", + "Features", + "FeaturesAPIShieldOperationFeatureThresholds", + "FeaturesAPIShieldOperationFeatureThresholdsThresholds", + "FeaturesAPIShieldOperationFeatureParameterSchemas", + "FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas", + "FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas", + "FeaturesAPIShieldOperationFeatureAPIRouting", + "FeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting", + "FeaturesAPIShieldOperationFeatureConfidenceIntervals", + "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals", + "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold", + "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals", + "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90", + "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95", + "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99", + "FeaturesAPIShieldOperationFeatureSchemaInfo", + "FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo", + "FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema", +] -OperationCreateResponse: TypeAlias = List[APIShield] + +class FeaturesAPIShieldOperationFeatureThresholdsThresholds(BaseModel): + auth_id_tokens: Optional[int] = None + """The total number of auth-ids seen across this calculation.""" + + data_points: Optional[int] = None + """The number of data points used for the threshold suggestion calculation.""" + + last_updated: Optional[datetime] = None + + p50: Optional[int] = None + """The p50 quantile of requests (in period_seconds).""" + + p90: Optional[int] = None + """The p90 quantile of requests (in period_seconds).""" + + p99: Optional[int] = None + """The p99 quantile of requests (in period_seconds).""" + + period_seconds: Optional[int] = None + """The period over which this threshold is suggested.""" + + requests: Optional[int] = None + """The estimated number of requests covered by these calculations.""" + + suggested_threshold: Optional[int] = None + """The suggested threshold in requests done by the same auth_id or period_seconds.""" + + +class FeaturesAPIShieldOperationFeatureThresholds(BaseModel): + thresholds: Optional[FeaturesAPIShieldOperationFeatureThresholdsThresholds] = None + + +class FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas(BaseModel): + parameters: Optional[List[object]] = None + """An array containing the learned parameter schemas.""" + + responses: Optional[object] = None + """An empty response object. + + This field is required to yield a valid operation schema. + """ + + +class FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas(BaseModel): + last_updated: Optional[datetime] = None + + parameter_schemas: Optional[FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas] = ( + None + ) + """An operation schema object containing a response.""" + + +class FeaturesAPIShieldOperationFeatureParameterSchemas(BaseModel): + parameter_schemas: FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas + + +class FeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting(BaseModel): + last_updated: Optional[datetime] = None + + route: Optional[str] = None + """Target route.""" + + +class FeaturesAPIShieldOperationFeatureAPIRouting(BaseModel): + api_routing: Optional[FeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting] = None + """API Routing settings on endpoint.""" + + +class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90( + BaseModel +): + lower: Optional[float] = None + """Lower bound for percentile estimate""" + + upper: Optional[float] = None + """Upper bound for percentile estimate""" + + +class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95( + BaseModel +): + lower: Optional[float] = None + """Lower bound for percentile estimate""" + + upper: Optional[float] = None + """Upper bound for percentile estimate""" + + +class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99( + BaseModel +): + lower: Optional[float] = None + """Lower bound for percentile estimate""" + + upper: Optional[float] = None + """Upper bound for percentile estimate""" + + +class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals( + BaseModel +): + p90: Optional[ + FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90 + ] = None + """Upper and lower bound for percentile estimate""" + + p95: Optional[ + FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95 + ] = None + """Upper and lower bound for percentile estimate""" + + p99: Optional[ + FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99 + ] = None + """Upper and lower bound for percentile estimate""" + + +class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold(BaseModel): + confidence_intervals: Optional[ + FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals + ] = None + + mean: Optional[float] = None + """Suggested threshold.""" + + +class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals(BaseModel): + last_updated: Optional[datetime] = None + + suggested_threshold: Optional[ + FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold + ] = None + + +class FeaturesAPIShieldOperationFeatureConfidenceIntervals(BaseModel): + confidence_intervals: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals] = None + + +class FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema(BaseModel): + id: Optional[str] = None + """UUID""" + + created_at: Optional[datetime] = None + + is_learned: Optional[bool] = None + """True if schema is Cloudflare-provided.""" + + name: Optional[str] = None + """Schema file name.""" + + +class FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo(BaseModel): + active_schema: Optional[FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema] = None + """Schema active on endpoint.""" + + learned_available: Optional[bool] = None + """True if a Cloudflare-provided learned schema is available for this endpoint.""" + + mitigation_action: Optional[Literal["none", "log", "block"]] = None + """Action taken on requests failing validation.""" + + +class FeaturesAPIShieldOperationFeatureSchemaInfo(BaseModel): + schema_info: Optional[FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo] = None + + +Features: TypeAlias = Union[ + FeaturesAPIShieldOperationFeatureThresholds, + FeaturesAPIShieldOperationFeatureParameterSchemas, + FeaturesAPIShieldOperationFeatureAPIRouting, + FeaturesAPIShieldOperationFeatureConfidenceIntervals, + FeaturesAPIShieldOperationFeatureSchemaInfo, +] + + +class OperationCreateResponse(BaseModel): + endpoint: str + """ + The endpoint which can contain path parameter templates in curly braces, each + will be replaced from left to right with {varN}, starting with {var1}, during + insertion. This will further be Cloudflare-normalized upon insertion. See: + https://developers.cloudflare.com/rules/normalization/how-it-works/. + """ + + host: str + """RFC3986-compliant host.""" + + last_updated: datetime + + method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"] + """The HTTP method used to access the endpoint.""" + + operation_id: str + """UUID""" + + features: Optional[Features] = None diff --git a/src/cloudflare/types/api_gateway/user_schemas/operation_list_response.py b/src/cloudflare/types/api_gateway/user_schemas/operation_list_response.py index 3149155c055..cae8a5a0a92 100644 --- a/src/cloudflare/types/api_gateway/user_schemas/operation_list_response.py +++ b/src/cloudflare/types/api_gateway/user_schemas/operation_list_response.py @@ -1,12 +1,236 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union +from typing import List, Union, Optional +from datetime import datetime from typing_extensions import Literal, TypeAlias from ...._models import BaseModel -from ..api_shield import APIShield -__all__ = ["OperationListResponse", "APIShieldBasicOperation"] +__all__ = [ + "OperationListResponse", + "APIShieldOperation", + "APIShieldOperationFeatures", + "APIShieldOperationFeaturesAPIShieldOperationFeatureThresholds", + "APIShieldOperationFeaturesAPIShieldOperationFeatureThresholdsThresholds", + "APIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemas", + "APIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas", + "APIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas", + "APIShieldOperationFeaturesAPIShieldOperationFeatureAPIRouting", + "APIShieldOperationFeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting", + "APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervals", + "APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals", + "APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold", + "APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals", + "APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90", + "APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95", + "APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99", + "APIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfo", + "APIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo", + "APIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema", + "APIShieldBasicOperation", +] + + +class APIShieldOperationFeaturesAPIShieldOperationFeatureThresholdsThresholds(BaseModel): + auth_id_tokens: Optional[int] = None + """The total number of auth-ids seen across this calculation.""" + + data_points: Optional[int] = None + """The number of data points used for the threshold suggestion calculation.""" + + last_updated: Optional[datetime] = None + + p50: Optional[int] = None + """The p50 quantile of requests (in period_seconds).""" + + p90: Optional[int] = None + """The p90 quantile of requests (in period_seconds).""" + + p99: Optional[int] = None + """The p99 quantile of requests (in period_seconds).""" + + period_seconds: Optional[int] = None + """The period over which this threshold is suggested.""" + + requests: Optional[int] = None + """The estimated number of requests covered by these calculations.""" + + suggested_threshold: Optional[int] = None + """The suggested threshold in requests done by the same auth_id or period_seconds.""" + + +class APIShieldOperationFeaturesAPIShieldOperationFeatureThresholds(BaseModel): + thresholds: Optional[APIShieldOperationFeaturesAPIShieldOperationFeatureThresholdsThresholds] = None + + +class APIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas(BaseModel): + parameters: Optional[List[object]] = None + """An array containing the learned parameter schemas.""" + + responses: Optional[object] = None + """An empty response object. + + This field is required to yield a valid operation schema. + """ + + +class APIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas(BaseModel): + last_updated: Optional[datetime] = None + + parameter_schemas: Optional[ + APIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas + ] = None + """An operation schema object containing a response.""" + + +class APIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemas(BaseModel): + parameter_schemas: APIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas + + +class APIShieldOperationFeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting(BaseModel): + last_updated: Optional[datetime] = None + + route: Optional[str] = None + """Target route.""" + + +class APIShieldOperationFeaturesAPIShieldOperationFeatureAPIRouting(BaseModel): + api_routing: Optional[APIShieldOperationFeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting] = None + """API Routing settings on endpoint.""" + + +class APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90( + BaseModel +): + lower: Optional[float] = None + """Lower bound for percentile estimate""" + + upper: Optional[float] = None + """Upper bound for percentile estimate""" + + +class APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95( + BaseModel +): + lower: Optional[float] = None + """Lower bound for percentile estimate""" + + upper: Optional[float] = None + """Upper bound for percentile estimate""" + + +class APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99( + BaseModel +): + lower: Optional[float] = None + """Lower bound for percentile estimate""" + + upper: Optional[float] = None + """Upper bound for percentile estimate""" + + +class APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals( + BaseModel +): + p90: Optional[ + APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90 + ] = None + """Upper and lower bound for percentile estimate""" + + p95: Optional[ + APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95 + ] = None + """Upper and lower bound for percentile estimate""" + + p99: Optional[ + APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99 + ] = None + """Upper and lower bound for percentile estimate""" + + +class APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold( + BaseModel +): + confidence_intervals: Optional[ + APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals + ] = None + + mean: Optional[float] = None + """Suggested threshold.""" + + +class APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals(BaseModel): + last_updated: Optional[datetime] = None + + suggested_threshold: Optional[ + APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold + ] = None + + +class APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervals(BaseModel): + confidence_intervals: Optional[ + APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals + ] = None + + +class APIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema(BaseModel): + id: Optional[str] = None + """UUID""" + + created_at: Optional[datetime] = None + + is_learned: Optional[bool] = None + """True if schema is Cloudflare-provided.""" + + name: Optional[str] = None + """Schema file name.""" + + +class APIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo(BaseModel): + active_schema: Optional[APIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema] = None + """Schema active on endpoint.""" + + learned_available: Optional[bool] = None + """True if a Cloudflare-provided learned schema is available for this endpoint.""" + + mitigation_action: Optional[Literal["none", "log", "block"]] = None + """Action taken on requests failing validation.""" + + +class APIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfo(BaseModel): + schema_info: Optional[APIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo] = None + + +APIShieldOperationFeatures: TypeAlias = Union[ + APIShieldOperationFeaturesAPIShieldOperationFeatureThresholds, + APIShieldOperationFeaturesAPIShieldOperationFeatureParameterSchemas, + APIShieldOperationFeaturesAPIShieldOperationFeatureAPIRouting, + APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervals, + APIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfo, +] + + +class APIShieldOperation(BaseModel): + endpoint: str + """ + The endpoint which can contain path parameter templates in curly braces, each + will be replaced from left to right with {varN}, starting with {var1}, during + insertion. This will further be Cloudflare-normalized upon insertion. See: + https://developers.cloudflare.com/rules/normalization/how-it-works/. + """ + + host: str + """RFC3986-compliant host.""" + + last_updated: datetime + + method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"] + """The HTTP method used to access the endpoint.""" + + operation_id: str + """UUID""" + + features: Optional[APIShieldOperationFeatures] = None class APIShieldBasicOperation(BaseModel): @@ -25,4 +249,4 @@ class APIShieldBasicOperation(BaseModel): """The HTTP method used to access the endpoint.""" -OperationListResponse: TypeAlias = Union[APIShield, APIShieldBasicOperation] +OperationListResponse: TypeAlias = Union[APIShieldOperation, APIShieldBasicOperation] diff --git a/src/cloudflare/types/argo/tiered_caching_edit_response.py b/src/cloudflare/types/argo/tiered_caching_edit_response.py index 0e99559b8f5..dfabfbc67c2 100644 --- a/src/cloudflare/types/argo/tiered_caching_edit_response.py +++ b/src/cloudflare/types/argo/tiered_caching_edit_response.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import Optional from datetime import datetime from typing_extensions import Literal @@ -9,14 +10,14 @@ class TieredCachingEditResponse(BaseModel): - id: str - """The identifier of the caching setting""" + id: Literal["tiered_caching"] + """ID of the zone setting.""" editable: bool """Whether the setting is editable""" - modified_on: datetime - """The time when the setting was last modified""" - value: Literal["on", "off"] - """The status of the feature being on / off""" + """The value of the feature""" + + modified_on: Optional[datetime] = None + """Last time this setting was modified.""" diff --git a/src/cloudflare/types/argo/tiered_caching_get_response.py b/src/cloudflare/types/argo/tiered_caching_get_response.py index 72f04aac880..8747f72e833 100644 --- a/src/cloudflare/types/argo/tiered_caching_get_response.py +++ b/src/cloudflare/types/argo/tiered_caching_get_response.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import Optional from datetime import datetime from typing_extensions import Literal @@ -9,14 +10,14 @@ class TieredCachingGetResponse(BaseModel): - id: str - """The identifier of the caching setting""" + id: Literal["tiered_caching"] + """ID of the zone setting.""" editable: bool """Whether the setting is editable""" - modified_on: datetime - """The time when the setting was last modified""" - value: Literal["on", "off"] - """The status of the feature being on / off""" + """The value of the feature""" + + modified_on: Optional[datetime] = None + """Last time this setting was modified.""" diff --git a/src/cloudflare/types/cache/__init__.py b/src/cloudflare/types/cache/__init__.py index dca49dade79..10937a5c1b3 100644 --- a/src/cloudflare/types/cache/__init__.py +++ b/src/cloudflare/types/cache/__init__.py @@ -4,7 +4,6 @@ from .state import State as State from .cache_reserve import CacheReserve as CacheReserve -from .cache_variant import CacheVariant as CacheVariant from .cache_purge_params import CachePurgeParams as CachePurgeParams from .cache_reserve_clear import CacheReserveClear as CacheReserveClear from .variant_edit_params import VariantEditParams as VariantEditParams @@ -12,6 +11,7 @@ from .variant_get_response import VariantGetResponse as VariantGetResponse from .regional_tiered_cache import RegionalTieredCache as RegionalTieredCache from .variant_edit_response import VariantEditResponse as VariantEditResponse +from .variant_delete_response import VariantDeleteResponse as VariantDeleteResponse from .cache_reserve_edit_params import CacheReserveEditParams as CacheReserveEditParams from .cache_reserve_clear_params import CacheReserveClearParams as CacheReserveClearParams from .cache_reserve_get_response import CacheReserveGetResponse as CacheReserveGetResponse diff --git a/src/cloudflare/types/cache/cache_reserve_clear_response.py b/src/cloudflare/types/cache/cache_reserve_clear_response.py index 6ef83d88029..48410c41b3c 100644 --- a/src/cloudflare/types/cache/cache_reserve_clear_response.py +++ b/src/cloudflare/types/cache/cache_reserve_clear_response.py @@ -14,9 +14,6 @@ class CacheReserveClearResponse(BaseModel): id: CacheReserveClear """ID of the zone setting.""" - modified_on: Optional[datetime] = None - """last time this setting was modified.""" - start_ts: datetime """The time that the latest Cache Reserve Clear operation started.""" @@ -25,3 +22,6 @@ class CacheReserveClearResponse(BaseModel): end_ts: Optional[datetime] = None """The time that the latest Cache Reserve Clear operation completed.""" + + modified_on: Optional[datetime] = None + """Last time this setting was modified.""" diff --git a/src/cloudflare/types/cache/cache_reserve_edit_response.py b/src/cloudflare/types/cache/cache_reserve_edit_response.py index cf94dab2551..1ecbfb5cc66 100644 --- a/src/cloudflare/types/cache/cache_reserve_edit_response.py +++ b/src/cloudflare/types/cache/cache_reserve_edit_response.py @@ -14,8 +14,11 @@ class CacheReserveEditResponse(BaseModel): id: CacheReserve """ID of the zone setting.""" - modified_on: Optional[datetime] = None - """last time this setting was modified.""" + editable: bool + """Whether the setting is editable""" value: Literal["on", "off"] - """Value of the Cache Reserve zone setting.""" + """The value of the feature""" + + modified_on: Optional[datetime] = None + """Last time this setting was modified.""" diff --git a/src/cloudflare/types/cache/cache_reserve_get_response.py b/src/cloudflare/types/cache/cache_reserve_get_response.py index 78ddefe3883..bfca4dcc125 100644 --- a/src/cloudflare/types/cache/cache_reserve_get_response.py +++ b/src/cloudflare/types/cache/cache_reserve_get_response.py @@ -14,8 +14,11 @@ class CacheReserveGetResponse(BaseModel): id: CacheReserve """ID of the zone setting.""" - modified_on: Optional[datetime] = None - """last time this setting was modified.""" + editable: bool + """Whether the setting is editable""" value: Literal["on", "off"] - """Value of the Cache Reserve zone setting.""" + """The value of the feature""" + + modified_on: Optional[datetime] = None + """Last time this setting was modified.""" diff --git a/src/cloudflare/types/cache/cache_reserve_status_response.py b/src/cloudflare/types/cache/cache_reserve_status_response.py index abc1c4cba82..277b898dd11 100644 --- a/src/cloudflare/types/cache/cache_reserve_status_response.py +++ b/src/cloudflare/types/cache/cache_reserve_status_response.py @@ -14,9 +14,6 @@ class CacheReserveStatusResponse(BaseModel): id: CacheReserveClear """ID of the zone setting.""" - modified_on: Optional[datetime] = None - """last time this setting was modified.""" - start_ts: datetime """The time that the latest Cache Reserve Clear operation started.""" @@ -25,3 +22,6 @@ class CacheReserveStatusResponse(BaseModel): end_ts: Optional[datetime] = None """The time that the latest Cache Reserve Clear operation completed.""" + + modified_on: Optional[datetime] = None + """Last time this setting was modified.""" diff --git a/src/cloudflare/types/cache/regional_tiered_cache_edit_response.py b/src/cloudflare/types/cache/regional_tiered_cache_edit_response.py index 8350d75dc86..089ee489e99 100644 --- a/src/cloudflare/types/cache/regional_tiered_cache_edit_response.py +++ b/src/cloudflare/types/cache/regional_tiered_cache_edit_response.py @@ -2,31 +2,23 @@ from typing import Optional from datetime import datetime +from typing_extensions import Literal from ..._models import BaseModel from .regional_tiered_cache import RegionalTieredCache -__all__ = ["RegionalTieredCacheEditResponse", "Value"] +__all__ = ["RegionalTieredCacheEditResponse"] -class Value(BaseModel): +class RegionalTieredCacheEditResponse(BaseModel): id: RegionalTieredCache """ID of the zone setting.""" - modified_on: Optional[datetime] = None - """last time this setting was modified.""" - + editable: bool + """Whether the setting is editable""" -class RegionalTieredCacheEditResponse(BaseModel): - id: RegionalTieredCache - """ID of the zone setting.""" + value: Literal["on", "off"] + """The value of the feature""" modified_on: Optional[datetime] = None - """last time this setting was modified.""" - - value: Value - """ - Instructs Cloudflare to check a regional hub data center on the way to your - upper tier. This can help improve performance for smart and custom tiered cache - topologies. - """ + """Last time this setting was modified.""" diff --git a/src/cloudflare/types/cache/regional_tiered_cache_get_response.py b/src/cloudflare/types/cache/regional_tiered_cache_get_response.py index ac3f6c4e6e3..2730910de20 100644 --- a/src/cloudflare/types/cache/regional_tiered_cache_get_response.py +++ b/src/cloudflare/types/cache/regional_tiered_cache_get_response.py @@ -2,31 +2,23 @@ from typing import Optional from datetime import datetime +from typing_extensions import Literal from ..._models import BaseModel from .regional_tiered_cache import RegionalTieredCache -__all__ = ["RegionalTieredCacheGetResponse", "Value"] +__all__ = ["RegionalTieredCacheGetResponse"] -class Value(BaseModel): +class RegionalTieredCacheGetResponse(BaseModel): id: RegionalTieredCache """ID of the zone setting.""" - modified_on: Optional[datetime] = None - """last time this setting was modified.""" - + editable: bool + """Whether the setting is editable""" -class RegionalTieredCacheGetResponse(BaseModel): - id: RegionalTieredCache - """ID of the zone setting.""" + value: Literal["on", "off"] + """The value of the feature""" modified_on: Optional[datetime] = None - """last time this setting was modified.""" - - value: Value - """ - Instructs Cloudflare to check a regional hub data center on the way to your - upper tier. This can help improve performance for smart and custom tiered cache - topologies. - """ + """Last time this setting was modified.""" diff --git a/src/cloudflare/types/cache/smart_tiered_cache_delete_response.py b/src/cloudflare/types/cache/smart_tiered_cache_delete_response.py index 3ccc2711f88..7bc174f36ae 100644 --- a/src/cloudflare/types/cache/smart_tiered_cache_delete_response.py +++ b/src/cloudflare/types/cache/smart_tiered_cache_delete_response.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import Optional from datetime import datetime from typing_extensions import Literal @@ -9,14 +10,11 @@ class SmartTieredCacheDeleteResponse(BaseModel): - id: str - """The identifier of the caching setting""" + id: Literal["tiered_cache_smart_topology_enable"] + """ID of the zone setting.""" editable: bool """Whether the setting is editable""" - modified_on: datetime - """The time when the setting was last modified""" - - value: Literal["on", "off"] - """The status of the feature being on / off""" + modified_on: Optional[datetime] = None + """Last time this setting was modified.""" diff --git a/src/cloudflare/types/cache/smart_tiered_cache_edit_response.py b/src/cloudflare/types/cache/smart_tiered_cache_edit_response.py index 8e871b0599c..75ab468d3bb 100644 --- a/src/cloudflare/types/cache/smart_tiered_cache_edit_response.py +++ b/src/cloudflare/types/cache/smart_tiered_cache_edit_response.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import Optional from datetime import datetime from typing_extensions import Literal @@ -9,14 +10,14 @@ class SmartTieredCacheEditResponse(BaseModel): - id: str - """The identifier of the caching setting""" + id: Literal["tiered_cache_smart_topology_enable"] + """ID of the zone setting.""" editable: bool """Whether the setting is editable""" - modified_on: datetime - """The time when the setting was last modified""" - value: Literal["on", "off"] - """The status of the feature being on / off""" + """The value of the feature""" + + modified_on: Optional[datetime] = None + """Last time this setting was modified.""" diff --git a/src/cloudflare/types/cache/smart_tiered_cache_get_response.py b/src/cloudflare/types/cache/smart_tiered_cache_get_response.py index 787aa0d5d59..b8066e94776 100644 --- a/src/cloudflare/types/cache/smart_tiered_cache_get_response.py +++ b/src/cloudflare/types/cache/smart_tiered_cache_get_response.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import Optional from datetime import datetime from typing_extensions import Literal @@ -9,14 +10,14 @@ class SmartTieredCacheGetResponse(BaseModel): - id: str - """The identifier of the caching setting""" + id: Literal["tiered_cache_smart_topology_enable"] + """ID of the zone setting.""" editable: bool """Whether the setting is editable""" - modified_on: datetime - """The time when the setting was last modified""" - value: Literal["on", "off"] - """The status of the feature being on / off""" + """The value of the feature""" + + modified_on: Optional[datetime] = None + """Last time this setting was modified.""" diff --git a/src/cloudflare/types/cache/cache_variant.py b/src/cloudflare/types/cache/variant_delete_response.py similarity index 63% rename from src/cloudflare/types/cache/cache_variant.py rename to src/cloudflare/types/cache/variant_delete_response.py index e83ec666d1c..6d697bb1232 100644 --- a/src/cloudflare/types/cache/cache_variant.py +++ b/src/cloudflare/types/cache/variant_delete_response.py @@ -6,12 +6,15 @@ from ..._models import BaseModel -__all__ = ["CacheVariant"] +__all__ = ["VariantDeleteResponse"] -class CacheVariant(BaseModel): +class VariantDeleteResponse(BaseModel): id: Literal["variants"] """ID of the zone setting.""" + editable: bool + """Whether the setting is editable""" + modified_on: Optional[datetime] = None - """last time this setting was modified.""" + """Last time this setting was modified.""" diff --git a/src/cloudflare/types/cache/variant_edit_response.py b/src/cloudflare/types/cache/variant_edit_response.py index bdd337a206e..0cd828d795a 100644 --- a/src/cloudflare/types/cache/variant_edit_response.py +++ b/src/cloudflare/types/cache/variant_edit_response.py @@ -1,88 +1,23 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Optional from datetime import datetime from typing_extensions import Literal from ..._models import BaseModel -__all__ = ["VariantEditResponse", "Value"] - - -class Value(BaseModel): - avif: Optional[List[str]] = None - """ - List of strings with the MIME types of all the variants that should be served - for avif. - """ - - bmp: Optional[List[str]] = None - """ - List of strings with the MIME types of all the variants that should be served - for bmp. - """ - - gif: Optional[List[str]] = None - """ - List of strings with the MIME types of all the variants that should be served - for gif. - """ - - jp2: Optional[List[str]] = None - """ - List of strings with the MIME types of all the variants that should be served - for jp2. - """ - - jpeg: Optional[List[str]] = None - """ - List of strings with the MIME types of all the variants that should be served - for jpeg. - """ - - jpg: Optional[List[str]] = None - """ - List of strings with the MIME types of all the variants that should be served - for jpg. - """ - - jpg2: Optional[List[str]] = None - """ - List of strings with the MIME types of all the variants that should be served - for jpg2. - """ - - png: Optional[List[str]] = None - """ - List of strings with the MIME types of all the variants that should be served - for png. - """ - - tif: Optional[List[str]] = None - """ - List of strings with the MIME types of all the variants that should be served - for tif. - """ - - tiff: Optional[List[str]] = None - """ - List of strings with the MIME types of all the variants that should be served - for tiff. - """ - - webp: Optional[List[str]] = None - """ - List of strings with the MIME types of all the variants that should be served - for webp. - """ +__all__ = ["VariantEditResponse"] class VariantEditResponse(BaseModel): id: Literal["variants"] """ID of the zone setting.""" - modified_on: Optional[datetime] = None - """last time this setting was modified.""" + editable: bool + """Whether the setting is editable""" + + value: str + """The value of the feature""" - value: Value - """Value of the zone setting.""" + modified_on: Optional[datetime] = None + """Last time this setting was modified.""" diff --git a/src/cloudflare/types/cache/variant_get_response.py b/src/cloudflare/types/cache/variant_get_response.py index 777c7d0da5c..1b440b5b812 100644 --- a/src/cloudflare/types/cache/variant_get_response.py +++ b/src/cloudflare/types/cache/variant_get_response.py @@ -1,88 +1,23 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Optional from datetime import datetime from typing_extensions import Literal from ..._models import BaseModel -__all__ = ["VariantGetResponse", "Value"] - - -class Value(BaseModel): - avif: Optional[List[str]] = None - """ - List of strings with the MIME types of all the variants that should be served - for avif. - """ - - bmp: Optional[List[str]] = None - """ - List of strings with the MIME types of all the variants that should be served - for bmp. - """ - - gif: Optional[List[str]] = None - """ - List of strings with the MIME types of all the variants that should be served - for gif. - """ - - jp2: Optional[List[str]] = None - """ - List of strings with the MIME types of all the variants that should be served - for jp2. - """ - - jpeg: Optional[List[str]] = None - """ - List of strings with the MIME types of all the variants that should be served - for jpeg. - """ - - jpg: Optional[List[str]] = None - """ - List of strings with the MIME types of all the variants that should be served - for jpg. - """ - - jpg2: Optional[List[str]] = None - """ - List of strings with the MIME types of all the variants that should be served - for jpg2. - """ - - png: Optional[List[str]] = None - """ - List of strings with the MIME types of all the variants that should be served - for png. - """ - - tif: Optional[List[str]] = None - """ - List of strings with the MIME types of all the variants that should be served - for tif. - """ - - tiff: Optional[List[str]] = None - """ - List of strings with the MIME types of all the variants that should be served - for tiff. - """ - - webp: Optional[List[str]] = None - """ - List of strings with the MIME types of all the variants that should be served - for webp. - """ +__all__ = ["VariantGetResponse"] class VariantGetResponse(BaseModel): id: Literal["variants"] """ID of the zone setting.""" - modified_on: Optional[datetime] = None - """last time this setting was modified.""" + editable: bool + """Whether the setting is editable""" + + value: str + """The value of the feature""" - value: Value - """Value of the zone setting.""" + modified_on: Optional[datetime] = None + """Last time this setting was modified.""" diff --git a/src/cloudflare/types/cloud_connector/rule_update_params.py b/src/cloudflare/types/cloud_connector/rule_update_params.py index f8c25c9b2a7..41d4e4aaa74 100644 --- a/src/cloudflare/types/cloud_connector/rule_update_params.py +++ b/src/cloudflare/types/cloud_connector/rule_update_params.py @@ -5,23 +5,23 @@ from typing import Iterable from typing_extensions import Literal, Required, TypedDict -__all__ = ["RuleUpdateParams", "Body", "BodyParameters"] +__all__ = ["RuleUpdateParams", "Rule", "RuleParameters"] class RuleUpdateParams(TypedDict, total=False): zone_id: Required[str] """Identifier""" - body: Required[Iterable[Body]] + rules: Required[Iterable[Rule]] """List of Cloud Connector rules""" -class BodyParameters(TypedDict, total=False): +class RuleParameters(TypedDict, total=False): host: str """Host to perform Cloud Connection to""" -class Body(TypedDict, total=False): +class Rule(TypedDict, total=False): id: str description: str @@ -30,7 +30,7 @@ class Body(TypedDict, total=False): expression: str - parameters: BodyParameters + parameters: RuleParameters """Parameters of Cloud Connector Rule""" provider: Literal["aws_s3", "r2", "gcp_storage", "azure_storage"] diff --git a/src/cloudflare/types/dns/__init__.py b/src/cloudflare/types/dns/__init__.py index 896ce3f6c10..13c7472b8f1 100644 --- a/src/cloudflare/types/dns/__init__.py +++ b/src/cloudflare/types/dns/__init__.py @@ -28,9 +28,11 @@ from .dnskey_record import DNSKEYRecord as DNSKEYRecord from .smimea_record import SMIMEARecord as SMIMEARecord from .a_record_param import ARecordParam as ARecordParam +from .batch_put_param import BatchPutParam as BatchPutParam from .ds_record_param import DSRecordParam as DSRecordParam from .mx_record_param import MXRecordParam as MXRecordParam from .ns_record_param import NSRecordParam as NSRecordParam +from .record_response import RecordResponse as RecordResponse from .caa_record_param import CAARecordParam as CAARecordParam from .loc_record_param import LOCRecordParam as LOCRecordParam from .ptr_record_param import PTRRecordParam as PTRRecordParam @@ -38,6 +40,7 @@ from .txt_record_param import TXTRecordParam as TXTRecordParam from .uri_record_param import URIRecordParam as URIRecordParam from .aaaa_record_param import AAAARecordParam as AAAARecordParam +from .batch_patch_param import BatchPatchParam as BatchPatchParam from .cert_record_param import CERTRecordParam as CERTRecordParam from .svcb_record_param import SVCBRecordParam as SVCBRecordParam from .tlsa_record_param import TLSARecordParam as TLSARecordParam @@ -52,23 +55,17 @@ from .dns_analytics_query import DNSAnalyticsQuery as DNSAnalyticsQuery from .dnskey_record_param import DNSKEYRecordParam as DNSKEYRecordParam from .record_batch_params import RecordBatchParams as RecordBatchParams -from .record_get_response import RecordGetResponse as RecordGetResponse from .setting_edit_params import SettingEditParams as SettingEditParams from .smimea_record_param import SMIMEARecordParam as SMIMEARecordParam from .record_create_params import RecordCreateParams as RecordCreateParams -from .record_edit_response import RecordEditResponse as RecordEditResponse from .record_import_params import RecordImportParams as RecordImportParams -from .record_list_response import RecordListResponse as RecordListResponse from .record_scan_response import RecordScanResponse as RecordScanResponse from .record_update_params import RecordUpdateParams as RecordUpdateParams from .setting_get_response import SettingGetResponse as SettingGetResponse from .record_batch_response import RecordBatchResponse as RecordBatchResponse -from .record_process_timing import RecordProcessTiming as RecordProcessTiming from .setting_edit_response import SettingEditResponse as SettingEditResponse from .dnssec_delete_response import DNSSECDeleteResponse as DNSSECDeleteResponse -from .record_create_response import RecordCreateResponse as RecordCreateResponse from .record_delete_response import RecordDeleteResponse as RecordDeleteResponse from .record_export_response import RecordExportResponse as RecordExportResponse from .record_import_response import RecordImportResponse as RecordImportResponse -from .record_update_response import RecordUpdateResponse as RecordUpdateResponse from .dns_analytics_nominal_metric import DNSAnalyticsNominalMetric as DNSAnalyticsNominalMetric diff --git a/src/cloudflare/types/dns/a_record.py b/src/cloudflare/types/dns/a_record.py index 0e92b18aa87..45e3bc709a2 100644 --- a/src/cloudflare/types/dns/a_record.py +++ b/src/cloudflare/types/dns/a_record.py @@ -7,7 +7,25 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["ARecord"] +__all__ = ["ARecord", "Settings"] + + +class Settings(BaseModel): + ipv4_only: Optional[bool] = None + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: Optional[bool] = None + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ class ARecord(BaseModel): @@ -29,6 +47,9 @@ class ARecord(BaseModel): Cloudflare. """ + settings: Optional[Settings] = None + """Settings for the DNS record.""" + tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/a_record_param.py b/src/cloudflare/types/dns/a_record_param.py index a7b46b5a982..181939fa954 100644 --- a/src/cloudflare/types/dns/a_record_param.py +++ b/src/cloudflare/types/dns/a_record_param.py @@ -8,7 +8,25 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["ARecordParam"] +__all__ = ["ARecordParam", "Settings"] + + +class Settings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ class ARecordParam(TypedDict, total=False): @@ -30,6 +48,9 @@ class ARecordParam(TypedDict, total=False): Cloudflare. """ + settings: Settings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/aaaa_record.py b/src/cloudflare/types/dns/aaaa_record.py index 12b4a80d50f..a9b929e4f9f 100644 --- a/src/cloudflare/types/dns/aaaa_record.py +++ b/src/cloudflare/types/dns/aaaa_record.py @@ -7,7 +7,25 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["AAAARecord"] +__all__ = ["AAAARecord", "Settings"] + + +class Settings(BaseModel): + ipv4_only: Optional[bool] = None + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: Optional[bool] = None + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ class AAAARecord(BaseModel): @@ -29,6 +47,9 @@ class AAAARecord(BaseModel): Cloudflare. """ + settings: Optional[Settings] = None + """Settings for the DNS record.""" + tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/aaaa_record_param.py b/src/cloudflare/types/dns/aaaa_record_param.py index dda366f6e09..d305b76b8f0 100644 --- a/src/cloudflare/types/dns/aaaa_record_param.py +++ b/src/cloudflare/types/dns/aaaa_record_param.py @@ -8,7 +8,25 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["AAAARecordParam"] +__all__ = ["AAAARecordParam", "Settings"] + + +class Settings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ class AAAARecordParam(TypedDict, total=False): @@ -30,6 +48,9 @@ class AAAARecordParam(TypedDict, total=False): Cloudflare. """ + settings: Settings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/batch_patch_param.py b/src/cloudflare/types/dns/batch_patch_param.py new file mode 100644 index 00000000000..e3e0ae92005 --- /dev/null +++ b/src/cloudflare/types/dns/batch_patch_param.py @@ -0,0 +1,237 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from .ttl_param import TTLParam +from .record_tags import RecordTags +from .a_record_param import ARecordParam +from .ds_record_param import DSRecordParam +from .mx_record_param import MXRecordParam +from .ns_record_param import NSRecordParam +from .caa_record_param import CAARecordParam +from .loc_record_param import LOCRecordParam +from .ptr_record_param import PTRRecordParam +from .srv_record_param import SRVRecordParam +from .txt_record_param import TXTRecordParam +from .uri_record_param import URIRecordParam +from .aaaa_record_param import AAAARecordParam +from .cert_record_param import CERTRecordParam +from .svcb_record_param import SVCBRecordParam +from .tlsa_record_param import TLSARecordParam +from .cname_record_param import CNAMERecordParam +from .https_record_param import HTTPSRecordParam +from .naptr_record_param import NAPTRRecordParam +from .sshfp_record_param import SSHFPRecordParam +from .dnskey_record_param import DNSKEYRecordParam +from .smimea_record_param import SMIMEARecordParam + +__all__ = [ + "BatchPatchParam", + "ARecord", + "AAAARecord", + "CAARecord", + "CERTRecord", + "CNAMERecord", + "DNSKEYRecord", + "DSRecord", + "HTTPSRecord", + "LOCRecord", + "MXRecord", + "NAPTRRecord", + "NSRecord", + "Openpgpkey", + "OpenpgpkeySettings", + "PTRRecord", + "SMIMEARecord", + "SRVRecord", + "SSHFPRecord", + "SVCBRecord", + "TLSARecord", + "TXTRecord", + "URIRecord", +] + + +class ARecord(ARecordParam): + id: Required[str] + """Identifier""" + + +class AAAARecord(AAAARecordParam): + id: Required[str] + """Identifier""" + + +class CAARecord(CAARecordParam): + id: Required[str] + """Identifier""" + + +class CERTRecord(CERTRecordParam): + id: Required[str] + """Identifier""" + + +class CNAMERecord(CNAMERecordParam): + id: Required[str] + """Identifier""" + + +class DNSKEYRecord(DNSKEYRecordParam): + id: Required[str] + """Identifier""" + + +class DSRecord(DSRecordParam): + id: Required[str] + """Identifier""" + + +class HTTPSRecord(HTTPSRecordParam): + id: Required[str] + """Identifier""" + + +class LOCRecord(LOCRecordParam): + id: Required[str] + """Identifier""" + + +class MXRecord(MXRecordParam): + id: Required[str] + """Identifier""" + + +class NAPTRRecord(NAPTRRecordParam): + id: Required[str] + """Identifier""" + + +class NSRecord(NSRecordParam): + id: Required[str] + """Identifier""" + + +class OpenpgpkeySettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + +class Openpgpkey(TypedDict, total=False): + id: Required[str] + """Identifier""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + content: str + """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" + + name: str + """DNS record name (or @ for the zone apex) in Punycode.""" + + proxied: bool + """ + Whether the record is receiving the performance and security benefits of + Cloudflare. + """ + + settings: OpenpgpkeySettings + """Settings for the DNS record.""" + + tags: List[RecordTags] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: TTLParam + """Time To Live (TTL) of the DNS record in seconds. + + Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the + minimum reduced to 30 for Enterprise zones. + """ + + type: Literal["OPENPGPKEY"] + """Record type.""" + + +class PTRRecord(PTRRecordParam): + id: Required[str] + """Identifier""" + + +class SMIMEARecord(SMIMEARecordParam): + id: Required[str] + """Identifier""" + + +class SRVRecord(SRVRecordParam): + id: Required[str] + """Identifier""" + + +class SSHFPRecord(SSHFPRecordParam): + id: Required[str] + """Identifier""" + + +class SVCBRecord(SVCBRecordParam): + id: Required[str] + """Identifier""" + + +class TLSARecord(TLSARecordParam): + id: Required[str] + """Identifier""" + + +class TXTRecord(TXTRecordParam): + id: Required[str] + """Identifier""" + + +class URIRecord(URIRecordParam): + id: Required[str] + """Identifier""" + + +BatchPatchParam: TypeAlias = Union[ + ARecord, + AAAARecord, + CAARecord, + CERTRecord, + CNAMERecord, + DNSKEYRecord, + DSRecord, + HTTPSRecord, + LOCRecord, + MXRecord, + NAPTRRecord, + NSRecord, + Openpgpkey, + PTRRecord, + SMIMEARecord, + SRVRecord, + SSHFPRecord, + SVCBRecord, + TLSARecord, + TXTRecord, + URIRecord, +] diff --git a/src/cloudflare/types/dns/batch_put_param.py b/src/cloudflare/types/dns/batch_put_param.py new file mode 100644 index 00000000000..d21c25d5b4c --- /dev/null +++ b/src/cloudflare/types/dns/batch_put_param.py @@ -0,0 +1,237 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from .ttl_param import TTLParam +from .record_tags import RecordTags +from .a_record_param import ARecordParam +from .ds_record_param import DSRecordParam +from .mx_record_param import MXRecordParam +from .ns_record_param import NSRecordParam +from .caa_record_param import CAARecordParam +from .loc_record_param import LOCRecordParam +from .ptr_record_param import PTRRecordParam +from .srv_record_param import SRVRecordParam +from .txt_record_param import TXTRecordParam +from .uri_record_param import URIRecordParam +from .aaaa_record_param import AAAARecordParam +from .cert_record_param import CERTRecordParam +from .svcb_record_param import SVCBRecordParam +from .tlsa_record_param import TLSARecordParam +from .cname_record_param import CNAMERecordParam +from .https_record_param import HTTPSRecordParam +from .naptr_record_param import NAPTRRecordParam +from .sshfp_record_param import SSHFPRecordParam +from .dnskey_record_param import DNSKEYRecordParam +from .smimea_record_param import SMIMEARecordParam + +__all__ = [ + "BatchPutParam", + "ARecord", + "AAAARecord", + "CAARecord", + "CERTRecord", + "CNAMERecord", + "DNSKEYRecord", + "DSRecord", + "HTTPSRecord", + "LOCRecord", + "MXRecord", + "NAPTRRecord", + "NSRecord", + "Openpgpkey", + "OpenpgpkeySettings", + "PTRRecord", + "SMIMEARecord", + "SRVRecord", + "SSHFPRecord", + "SVCBRecord", + "TLSARecord", + "TXTRecord", + "URIRecord", +] + + +class ARecord(ARecordParam): + id: str + """Identifier""" + + +class AAAARecord(AAAARecordParam): + id: str + """Identifier""" + + +class CAARecord(CAARecordParam): + id: str + """Identifier""" + + +class CERTRecord(CERTRecordParam): + id: str + """Identifier""" + + +class CNAMERecord(CNAMERecordParam): + id: str + """Identifier""" + + +class DNSKEYRecord(DNSKEYRecordParam): + id: str + """Identifier""" + + +class DSRecord(DSRecordParam): + id: str + """Identifier""" + + +class HTTPSRecord(HTTPSRecordParam): + id: str + """Identifier""" + + +class LOCRecord(LOCRecordParam): + id: str + """Identifier""" + + +class MXRecord(MXRecordParam): + id: str + """Identifier""" + + +class NAPTRRecord(NAPTRRecordParam): + id: str + """Identifier""" + + +class NSRecord(NSRecordParam): + id: str + """Identifier""" + + +class OpenpgpkeySettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + +class Openpgpkey(TypedDict, total=False): + content: Required[str] + """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["OPENPGPKEY"]] + """Record type.""" + + id: str + """Identifier""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + proxied: bool + """ + Whether the record is receiving the performance and security benefits of + Cloudflare. + """ + + settings: OpenpgpkeySettings + """Settings for the DNS record.""" + + tags: List[RecordTags] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: TTLParam + """Time To Live (TTL) of the DNS record in seconds. + + Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the + minimum reduced to 30 for Enterprise zones. + """ + + +class PTRRecord(PTRRecordParam): + id: str + """Identifier""" + + +class SMIMEARecord(SMIMEARecordParam): + id: str + """Identifier""" + + +class SRVRecord(SRVRecordParam): + id: str + """Identifier""" + + +class SSHFPRecord(SSHFPRecordParam): + id: str + """Identifier""" + + +class SVCBRecord(SVCBRecordParam): + id: str + """Identifier""" + + +class TLSARecord(TLSARecordParam): + id: str + """Identifier""" + + +class TXTRecord(TXTRecordParam): + id: str + """Identifier""" + + +class URIRecord(URIRecordParam): + id: str + """Identifier""" + + +BatchPutParam: TypeAlias = Union[ + ARecord, + AAAARecord, + CAARecord, + CERTRecord, + CNAMERecord, + DNSKEYRecord, + DSRecord, + HTTPSRecord, + LOCRecord, + MXRecord, + NAPTRRecord, + NSRecord, + Openpgpkey, + PTRRecord, + SMIMEARecord, + SRVRecord, + SSHFPRecord, + SVCBRecord, + TLSARecord, + TXTRecord, + URIRecord, +] diff --git a/src/cloudflare/types/dns/caa_record.py b/src/cloudflare/types/dns/caa_record.py index db52be5fb3d..c4635a7d010 100644 --- a/src/cloudflare/types/dns/caa_record.py +++ b/src/cloudflare/types/dns/caa_record.py @@ -7,7 +7,7 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["CAARecord", "Data"] +__all__ = ["CAARecord", "Data", "Settings"] class Data(BaseModel): @@ -21,6 +21,24 @@ class Data(BaseModel): """Value of the record. This field's semantics depend on the chosen tag.""" +class Settings(BaseModel): + ipv4_only: Optional[bool] = None + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: Optional[bool] = None + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class CAARecord(BaseModel): comment: Optional[str] = None """Comments or notes about the DNS record. @@ -43,6 +61,9 @@ class CAARecord(BaseModel): Cloudflare. """ + settings: Optional[Settings] = None + """Settings for the DNS record.""" + tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/caa_record_param.py b/src/cloudflare/types/dns/caa_record_param.py index f4607bff8a3..b33a737dcfd 100644 --- a/src/cloudflare/types/dns/caa_record_param.py +++ b/src/cloudflare/types/dns/caa_record_param.py @@ -8,7 +8,7 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["CAARecordParam", "Data"] +__all__ = ["CAARecordParam", "Data", "Settings"] class Data(TypedDict, total=False): @@ -22,6 +22,24 @@ class Data(TypedDict, total=False): """Value of the record. This field's semantics depend on the chosen tag.""" +class Settings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class CAARecordParam(TypedDict, total=False): comment: str """Comments or notes about the DNS record. @@ -41,6 +59,9 @@ class CAARecordParam(TypedDict, total=False): Cloudflare. """ + settings: Settings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/cert_record.py b/src/cloudflare/types/dns/cert_record.py index 773fc039929..158b93608aa 100644 --- a/src/cloudflare/types/dns/cert_record.py +++ b/src/cloudflare/types/dns/cert_record.py @@ -7,7 +7,7 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["CERTRecord", "Data"] +__all__ = ["CERTRecord", "Data", "Settings"] class Data(BaseModel): @@ -24,6 +24,24 @@ class Data(BaseModel): """Type.""" +class Settings(BaseModel): + ipv4_only: Optional[bool] = None + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: Optional[bool] = None + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class CERTRecord(BaseModel): comment: Optional[str] = None """Comments or notes about the DNS record. @@ -46,6 +64,9 @@ class CERTRecord(BaseModel): Cloudflare. """ + settings: Optional[Settings] = None + """Settings for the DNS record.""" + tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/cert_record_param.py b/src/cloudflare/types/dns/cert_record_param.py index ae6a63bf15f..139c4c13d84 100644 --- a/src/cloudflare/types/dns/cert_record_param.py +++ b/src/cloudflare/types/dns/cert_record_param.py @@ -8,7 +8,7 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["CERTRecordParam", "Data"] +__all__ = ["CERTRecordParam", "Data", "Settings"] class Data(TypedDict, total=False): @@ -25,6 +25,24 @@ class Data(TypedDict, total=False): """Type.""" +class Settings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class CERTRecordParam(TypedDict, total=False): comment: str """Comments or notes about the DNS record. @@ -44,6 +62,9 @@ class CERTRecordParam(TypedDict, total=False): Cloudflare. """ + settings: Settings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/cname_record.py b/src/cloudflare/types/dns/cname_record.py index fb32c1ca384..acbb165c725 100644 --- a/src/cloudflare/types/dns/cname_record.py +++ b/src/cloudflare/types/dns/cname_record.py @@ -15,10 +15,26 @@ class Settings(BaseModel): """ If enabled, causes the CNAME record to be resolved externally and the resulting address records (e.g., A and AAAA) to be returned instead of the CNAME record - itself. This setting has no effect on proxied records, which are always + itself. This setting is unavailable for proxied records, since they are always flattened. """ + ipv4_only: Optional[bool] = None + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: Optional[bool] = None + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + class CNAMERecord(BaseModel): comment: Optional[str] = None @@ -40,6 +56,7 @@ class CNAMERecord(BaseModel): """ settings: Optional[Settings] = None + """Settings for the DNS record.""" tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/cname_record_param.py b/src/cloudflare/types/dns/cname_record_param.py index 87006d1b36d..122daccc16c 100644 --- a/src/cloudflare/types/dns/cname_record_param.py +++ b/src/cloudflare/types/dns/cname_record_param.py @@ -16,10 +16,26 @@ class Settings(TypedDict, total=False): """ If enabled, causes the CNAME record to be resolved externally and the resulting address records (e.g., A and AAAA) to be returned instead of the CNAME record - itself. This setting has no effect on proxied records, which are always + itself. This setting is unavailable for proxied records, since they are always flattened. """ + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + class CNAMERecordParam(TypedDict, total=False): comment: str @@ -41,6 +57,7 @@ class CNAMERecordParam(TypedDict, total=False): """ settings: Settings + """Settings for the DNS record.""" tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/dnskey_record.py b/src/cloudflare/types/dns/dnskey_record.py index 650e258205b..b7ab534a265 100644 --- a/src/cloudflare/types/dns/dnskey_record.py +++ b/src/cloudflare/types/dns/dnskey_record.py @@ -7,7 +7,7 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["DNSKEYRecord", "Data"] +__all__ = ["DNSKEYRecord", "Data", "Settings"] class Data(BaseModel): @@ -24,6 +24,24 @@ class Data(BaseModel): """Public Key.""" +class Settings(BaseModel): + ipv4_only: Optional[bool] = None + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: Optional[bool] = None + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class DNSKEYRecord(BaseModel): comment: Optional[str] = None """Comments or notes about the DNS record. @@ -46,6 +64,9 @@ class DNSKEYRecord(BaseModel): Cloudflare. """ + settings: Optional[Settings] = None + """Settings for the DNS record.""" + tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/dnskey_record_param.py b/src/cloudflare/types/dns/dnskey_record_param.py index daba9a3225e..87784bd7f8c 100644 --- a/src/cloudflare/types/dns/dnskey_record_param.py +++ b/src/cloudflare/types/dns/dnskey_record_param.py @@ -8,7 +8,7 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["DNSKEYRecordParam", "Data"] +__all__ = ["DNSKEYRecordParam", "Data", "Settings"] class Data(TypedDict, total=False): @@ -25,6 +25,24 @@ class Data(TypedDict, total=False): """Public Key.""" +class Settings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class DNSKEYRecordParam(TypedDict, total=False): comment: str """Comments or notes about the DNS record. @@ -44,6 +62,9 @@ class DNSKEYRecordParam(TypedDict, total=False): Cloudflare. """ + settings: Settings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/ds_record.py b/src/cloudflare/types/dns/ds_record.py index 2d13516a67e..7a6f2b87cfc 100644 --- a/src/cloudflare/types/dns/ds_record.py +++ b/src/cloudflare/types/dns/ds_record.py @@ -7,7 +7,7 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["DSRecord", "Data"] +__all__ = ["DSRecord", "Data", "Settings"] class Data(BaseModel): @@ -24,6 +24,24 @@ class Data(BaseModel): """Key Tag.""" +class Settings(BaseModel): + ipv4_only: Optional[bool] = None + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: Optional[bool] = None + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class DSRecord(BaseModel): comment: Optional[str] = None """Comments or notes about the DNS record. @@ -46,6 +64,9 @@ class DSRecord(BaseModel): Cloudflare. """ + settings: Optional[Settings] = None + """Settings for the DNS record.""" + tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/ds_record_param.py b/src/cloudflare/types/dns/ds_record_param.py index 14618b80a4b..b37b3e538b2 100644 --- a/src/cloudflare/types/dns/ds_record_param.py +++ b/src/cloudflare/types/dns/ds_record_param.py @@ -8,7 +8,7 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["DSRecordParam", "Data"] +__all__ = ["DSRecordParam", "Data", "Settings"] class Data(TypedDict, total=False): @@ -25,6 +25,24 @@ class Data(TypedDict, total=False): """Key Tag.""" +class Settings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class DSRecordParam(TypedDict, total=False): comment: str """Comments or notes about the DNS record. @@ -44,6 +62,9 @@ class DSRecordParam(TypedDict, total=False): Cloudflare. """ + settings: Settings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/https_record.py b/src/cloudflare/types/dns/https_record.py index 7fb87c4bcf3..9080fc0d2ca 100644 --- a/src/cloudflare/types/dns/https_record.py +++ b/src/cloudflare/types/dns/https_record.py @@ -7,7 +7,7 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["HTTPSRecord", "Data"] +__all__ = ["HTTPSRecord", "Data", "Settings"] class Data(BaseModel): @@ -21,6 +21,24 @@ class Data(BaseModel): """value.""" +class Settings(BaseModel): + ipv4_only: Optional[bool] = None + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: Optional[bool] = None + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class HTTPSRecord(BaseModel): comment: Optional[str] = None """Comments or notes about the DNS record. @@ -43,6 +61,9 @@ class HTTPSRecord(BaseModel): Cloudflare. """ + settings: Optional[Settings] = None + """Settings for the DNS record.""" + tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/https_record_param.py b/src/cloudflare/types/dns/https_record_param.py index 250fbb445ee..510e57ae626 100644 --- a/src/cloudflare/types/dns/https_record_param.py +++ b/src/cloudflare/types/dns/https_record_param.py @@ -8,7 +8,7 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["HTTPSRecordParam", "Data"] +__all__ = ["HTTPSRecordParam", "Data", "Settings"] class Data(TypedDict, total=False): @@ -22,6 +22,24 @@ class Data(TypedDict, total=False): """value.""" +class Settings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class HTTPSRecordParam(TypedDict, total=False): comment: str """Comments or notes about the DNS record. @@ -41,6 +59,9 @@ class HTTPSRecordParam(TypedDict, total=False): Cloudflare. """ + settings: Settings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/loc_record.py b/src/cloudflare/types/dns/loc_record.py index 0fa1b139124..6fdf091618b 100644 --- a/src/cloudflare/types/dns/loc_record.py +++ b/src/cloudflare/types/dns/loc_record.py @@ -7,7 +7,7 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["LOCRecord", "Data"] +__all__ = ["LOCRecord", "Data", "Settings"] class Data(BaseModel): @@ -48,6 +48,24 @@ class Data(BaseModel): """Size of location in meters.""" +class Settings(BaseModel): + ipv4_only: Optional[bool] = None + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: Optional[bool] = None + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class LOCRecord(BaseModel): comment: Optional[str] = None """Comments or notes about the DNS record. @@ -70,6 +88,9 @@ class LOCRecord(BaseModel): Cloudflare. """ + settings: Optional[Settings] = None + """Settings for the DNS record.""" + tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/loc_record_param.py b/src/cloudflare/types/dns/loc_record_param.py index 15b31223784..55ec03b2297 100644 --- a/src/cloudflare/types/dns/loc_record_param.py +++ b/src/cloudflare/types/dns/loc_record_param.py @@ -8,7 +8,7 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["LOCRecordParam", "Data"] +__all__ = ["LOCRecordParam", "Data", "Settings"] class Data(TypedDict, total=False): @@ -49,6 +49,24 @@ class Data(TypedDict, total=False): """Size of location in meters.""" +class Settings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class LOCRecordParam(TypedDict, total=False): comment: str """Comments or notes about the DNS record. @@ -68,6 +86,9 @@ class LOCRecordParam(TypedDict, total=False): Cloudflare. """ + settings: Settings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/mx_record.py b/src/cloudflare/types/dns/mx_record.py index ef6c49db053..4d3a7dd1874 100644 --- a/src/cloudflare/types/dns/mx_record.py +++ b/src/cloudflare/types/dns/mx_record.py @@ -7,7 +7,25 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["MXRecord"] +__all__ = ["MXRecord", "Settings"] + + +class Settings(BaseModel): + ipv4_only: Optional[bool] = None + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: Optional[bool] = None + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ class MXRecord(BaseModel): @@ -35,6 +53,9 @@ class MXRecord(BaseModel): Cloudflare. """ + settings: Optional[Settings] = None + """Settings for the DNS record.""" + tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/mx_record_param.py b/src/cloudflare/types/dns/mx_record_param.py index 633211e4684..e38ea7456ca 100644 --- a/src/cloudflare/types/dns/mx_record_param.py +++ b/src/cloudflare/types/dns/mx_record_param.py @@ -8,7 +8,25 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["MXRecordParam"] +__all__ = ["MXRecordParam", "Settings"] + + +class Settings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ class MXRecordParam(TypedDict, total=False): @@ -36,6 +54,9 @@ class MXRecordParam(TypedDict, total=False): Cloudflare. """ + settings: Settings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/naptr_record.py b/src/cloudflare/types/dns/naptr_record.py index 909bdc97dad..b2fe91864bf 100644 --- a/src/cloudflare/types/dns/naptr_record.py +++ b/src/cloudflare/types/dns/naptr_record.py @@ -7,7 +7,7 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["NAPTRRecord", "Data"] +__all__ = ["NAPTRRecord", "Data", "Settings"] class Data(BaseModel): @@ -30,6 +30,24 @@ class Data(BaseModel): """Service.""" +class Settings(BaseModel): + ipv4_only: Optional[bool] = None + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: Optional[bool] = None + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class NAPTRRecord(BaseModel): comment: Optional[str] = None """Comments or notes about the DNS record. @@ -52,6 +70,9 @@ class NAPTRRecord(BaseModel): Cloudflare. """ + settings: Optional[Settings] = None + """Settings for the DNS record.""" + tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/naptr_record_param.py b/src/cloudflare/types/dns/naptr_record_param.py index 9511cbba68e..25b91ed4f29 100644 --- a/src/cloudflare/types/dns/naptr_record_param.py +++ b/src/cloudflare/types/dns/naptr_record_param.py @@ -8,7 +8,7 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["NAPTRRecordParam", "Data"] +__all__ = ["NAPTRRecordParam", "Data", "Settings"] class Data(TypedDict, total=False): @@ -31,6 +31,24 @@ class Data(TypedDict, total=False): """Service.""" +class Settings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class NAPTRRecordParam(TypedDict, total=False): comment: str """Comments or notes about the DNS record. @@ -50,6 +68,9 @@ class NAPTRRecordParam(TypedDict, total=False): Cloudflare. """ + settings: Settings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/ns_record.py b/src/cloudflare/types/dns/ns_record.py index 76e5aaff7c1..78ac6fe4049 100644 --- a/src/cloudflare/types/dns/ns_record.py +++ b/src/cloudflare/types/dns/ns_record.py @@ -7,7 +7,25 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["NSRecord"] +__all__ = ["NSRecord", "Settings"] + + +class Settings(BaseModel): + ipv4_only: Optional[bool] = None + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: Optional[bool] = None + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ class NSRecord(BaseModel): @@ -29,6 +47,9 @@ class NSRecord(BaseModel): Cloudflare. """ + settings: Optional[Settings] = None + """Settings for the DNS record.""" + tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/ns_record_param.py b/src/cloudflare/types/dns/ns_record_param.py index f036a719ddf..eabb69eedd4 100644 --- a/src/cloudflare/types/dns/ns_record_param.py +++ b/src/cloudflare/types/dns/ns_record_param.py @@ -8,7 +8,25 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["NSRecordParam"] +__all__ = ["NSRecordParam", "Settings"] + + +class Settings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ class NSRecordParam(TypedDict, total=False): @@ -30,6 +48,9 @@ class NSRecordParam(TypedDict, total=False): Cloudflare. """ + settings: Settings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/ptr_record.py b/src/cloudflare/types/dns/ptr_record.py index 3eee7c802d1..c392256cbbc 100644 --- a/src/cloudflare/types/dns/ptr_record.py +++ b/src/cloudflare/types/dns/ptr_record.py @@ -7,7 +7,25 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["PTRRecord"] +__all__ = ["PTRRecord", "Settings"] + + +class Settings(BaseModel): + ipv4_only: Optional[bool] = None + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: Optional[bool] = None + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ class PTRRecord(BaseModel): @@ -29,6 +47,9 @@ class PTRRecord(BaseModel): Cloudflare. """ + settings: Optional[Settings] = None + """Settings for the DNS record.""" + tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/ptr_record_param.py b/src/cloudflare/types/dns/ptr_record_param.py index d0390797c51..82d92c301fd 100644 --- a/src/cloudflare/types/dns/ptr_record_param.py +++ b/src/cloudflare/types/dns/ptr_record_param.py @@ -8,7 +8,25 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["PTRRecordParam"] +__all__ = ["PTRRecordParam", "Settings"] + + +class Settings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ class PTRRecordParam(TypedDict, total=False): @@ -30,6 +48,9 @@ class PTRRecordParam(TypedDict, total=False): Cloudflare. """ + settings: Settings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/record_batch_params.py b/src/cloudflare/types/dns/record_batch_params.py index 3b9a78fbd2f..cb31cfdef94 100644 --- a/src/cloudflare/types/dns/record_batch_params.py +++ b/src/cloudflare/types/dns/record_batch_params.py @@ -2,81 +2,14 @@ from __future__ import annotations -from typing import List, Union, Iterable -from typing_extensions import Literal, Required, TypeAlias, TypedDict +from typing import Iterable +from typing_extensions import Required, TypedDict -from .ttl_param import TTLParam -from .record_tags import RecordTags from .record_param import RecordParam -from .a_record_param import ARecordParam -from .ds_record_param import DSRecordParam -from .mx_record_param import MXRecordParam -from .ns_record_param import NSRecordParam -from .caa_record_param import CAARecordParam -from .loc_record_param import LOCRecordParam -from .ptr_record_param import PTRRecordParam -from .srv_record_param import SRVRecordParam -from .txt_record_param import TXTRecordParam -from .uri_record_param import URIRecordParam -from .aaaa_record_param import AAAARecordParam -from .cert_record_param import CERTRecordParam -from .svcb_record_param import SVCBRecordParam -from .tlsa_record_param import TLSARecordParam -from .cname_record_param import CNAMERecordParam -from .https_record_param import HTTPSRecordParam -from .naptr_record_param import NAPTRRecordParam -from .sshfp_record_param import SSHFPRecordParam -from .dnskey_record_param import DNSKEYRecordParam -from .smimea_record_param import SMIMEARecordParam +from .batch_put_param import BatchPutParam +from .batch_patch_param import BatchPatchParam -__all__ = [ - "RecordBatchParams", - "Delete", - "Patch", - "PatchARecord", - "PatchAAAARecord", - "PatchCAARecord", - "PatchCERTRecord", - "PatchCNAMERecord", - "PatchDNSKEYRecord", - "PatchDSRecord", - "PatchHTTPSRecord", - "PatchLOCRecord", - "PatchMXRecord", - "PatchNAPTRRecord", - "PatchNSRecord", - "PatchOpenpgpkeyRecord", - "PatchPTRRecord", - "PatchSMIMEARecord", - "PatchSRVRecord", - "PatchSSHFPRecord", - "PatchSVCBRecord", - "PatchTLSARecord", - "PatchTXTRecord", - "PatchURIRecord", - "Put", - "PutARecord", - "PutAAAARecord", - "PutCAARecord", - "PutCERTRecord", - "PutCNAMERecord", - "PutDNSKEYRecord", - "PutDSRecord", - "PutHTTPSRecord", - "PutLOCRecord", - "PutMXRecord", - "PutNAPTRRecord", - "PutNSRecord", - "PutOpenpgpkeyRecord", - "PutPTRRecord", - "PutSMIMEARecord", - "PutSRVRecord", - "PutSSHFPRecord", - "PutSVCBRecord", - "PutTLSARecord", - "PutTXTRecord", - "PutURIRecord", -] +__all__ = ["RecordBatchParams", "Delete"] class RecordBatchParams(TypedDict, total=False): @@ -85,335 +18,13 @@ class RecordBatchParams(TypedDict, total=False): deletes: Iterable[Delete] - patches: Iterable[Patch] + patches: Iterable[BatchPatchParam] posts: Iterable[RecordParam] - puts: Iterable[Put] + puts: Iterable[BatchPutParam] class Delete(TypedDict, total=False): id: Required[str] """Identifier""" - - -class PatchARecord(ARecordParam): - id: Required[str] - """Identifier""" - - -class PatchAAAARecord(AAAARecordParam): - id: Required[str] - """Identifier""" - - -class PatchCAARecord(CAARecordParam): - id: Required[str] - """Identifier""" - - -class PatchCERTRecord(CERTRecordParam): - id: Required[str] - """Identifier""" - - -class PatchCNAMERecord(CNAMERecordParam): - id: Required[str] - """Identifier""" - - -class PatchDNSKEYRecord(DNSKEYRecordParam): - id: Required[str] - """Identifier""" - - -class PatchDSRecord(DSRecordParam): - id: Required[str] - """Identifier""" - - -class PatchHTTPSRecord(HTTPSRecordParam): - id: Required[str] - """Identifier""" - - -class PatchLOCRecord(LOCRecordParam): - id: Required[str] - """Identifier""" - - -class PatchMXRecord(MXRecordParam): - id: Required[str] - """Identifier""" - - -class PatchNAPTRRecord(NAPTRRecordParam): - id: Required[str] - """Identifier""" - - -class PatchNSRecord(NSRecordParam): - id: Required[str] - """Identifier""" - - -class PatchOpenpgpkeyRecord(TypedDict, total=False): - id: Required[str] - """Identifier""" - - comment: str - """Comments or notes about the DNS record. - - This field has no effect on DNS responses. - """ - - content: str - """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - - proxied: bool - """ - Whether the record is receiving the performance and security benefits of - Cloudflare. - """ - - tags: List[RecordTags] - """Custom tags for the DNS record. This field has no effect on DNS responses.""" - - ttl: TTLParam - """Time To Live (TTL) of the DNS record in seconds. - - Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the - minimum reduced to 30 for Enterprise zones. - """ - - type: Literal["OPENPGPKEY"] - """Record type.""" - - -class PatchPTRRecord(PTRRecordParam): - id: Required[str] - """Identifier""" - - -class PatchSMIMEARecord(SMIMEARecordParam): - id: Required[str] - """Identifier""" - - -class PatchSRVRecord(SRVRecordParam): - id: Required[str] - """Identifier""" - - -class PatchSSHFPRecord(SSHFPRecordParam): - id: Required[str] - """Identifier""" - - -class PatchSVCBRecord(SVCBRecordParam): - id: Required[str] - """Identifier""" - - -class PatchTLSARecord(TLSARecordParam): - id: Required[str] - """Identifier""" - - -class PatchTXTRecord(TXTRecordParam): - id: Required[str] - """Identifier""" - - -class PatchURIRecord(URIRecordParam): - id: Required[str] - """Identifier""" - - -Patch: TypeAlias = Union[ - PatchARecord, - PatchAAAARecord, - PatchCAARecord, - PatchCERTRecord, - PatchCNAMERecord, - PatchDNSKEYRecord, - PatchDSRecord, - PatchHTTPSRecord, - PatchLOCRecord, - PatchMXRecord, - PatchNAPTRRecord, - PatchNSRecord, - PatchOpenpgpkeyRecord, - PatchPTRRecord, - PatchSMIMEARecord, - PatchSRVRecord, - PatchSSHFPRecord, - PatchSVCBRecord, - PatchTLSARecord, - PatchTXTRecord, - PatchURIRecord, -] - - -class PutARecord(ARecordParam): - id: Required[str] - """Identifier""" - - -class PutAAAARecord(AAAARecordParam): - id: Required[str] - """Identifier""" - - -class PutCAARecord(CAARecordParam): - id: Required[str] - """Identifier""" - - -class PutCERTRecord(CERTRecordParam): - id: Required[str] - """Identifier""" - - -class PutCNAMERecord(CNAMERecordParam): - id: Required[str] - """Identifier""" - - -class PutDNSKEYRecord(DNSKEYRecordParam): - id: Required[str] - """Identifier""" - - -class PutDSRecord(DSRecordParam): - id: Required[str] - """Identifier""" - - -class PutHTTPSRecord(HTTPSRecordParam): - id: Required[str] - """Identifier""" - - -class PutLOCRecord(LOCRecordParam): - id: Required[str] - """Identifier""" - - -class PutMXRecord(MXRecordParam): - id: Required[str] - """Identifier""" - - -class PutNAPTRRecord(NAPTRRecordParam): - id: Required[str] - """Identifier""" - - -class PutNSRecord(NSRecordParam): - id: Required[str] - """Identifier""" - - -class PutOpenpgpkeyRecord(TypedDict, total=False): - id: Required[str] - """Identifier""" - - content: Required[str] - """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" - - name: Required[str] - """DNS record name (or @ for the zone apex) in Punycode.""" - - type: Required[Literal["OPENPGPKEY"]] - """Record type.""" - - comment: str - """Comments or notes about the DNS record. - - This field has no effect on DNS responses. - """ - - proxied: bool - """ - Whether the record is receiving the performance and security benefits of - Cloudflare. - """ - - tags: List[RecordTags] - """Custom tags for the DNS record. This field has no effect on DNS responses.""" - - ttl: TTLParam - """Time To Live (TTL) of the DNS record in seconds. - - Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the - minimum reduced to 30 for Enterprise zones. - """ - - -class PutPTRRecord(PTRRecordParam): - id: Required[str] - """Identifier""" - - -class PutSMIMEARecord(SMIMEARecordParam): - id: Required[str] - """Identifier""" - - -class PutSRVRecord(SRVRecordParam): - id: Required[str] - """Identifier""" - - -class PutSSHFPRecord(SSHFPRecordParam): - id: Required[str] - """Identifier""" - - -class PutSVCBRecord(SVCBRecordParam): - id: Required[str] - """Identifier""" - - -class PutTLSARecord(TLSARecordParam): - id: Required[str] - """Identifier""" - - -class PutTXTRecord(TXTRecordParam): - id: Required[str] - """Identifier""" - - -class PutURIRecord(URIRecordParam): - id: Required[str] - """Identifier""" - - -Put: TypeAlias = Union[ - PutARecord, - PutAAAARecord, - PutCAARecord, - PutCERTRecord, - PutCNAMERecord, - PutDNSKEYRecord, - PutDSRecord, - PutHTTPSRecord, - PutLOCRecord, - PutMXRecord, - PutNAPTRRecord, - PutNSRecord, - PutOpenpgpkeyRecord, - PutPTRRecord, - PutSMIMEARecord, - PutSRVRecord, - PutSSHFPRecord, - PutSVCBRecord, - PutTLSARecord, - PutTXTRecord, - PutURIRecord, -] diff --git a/src/cloudflare/types/dns/record_batch_response.py b/src/cloudflare/types/dns/record_batch_response.py index c11f212f328..4bdc03c4b1c 100644 --- a/src/cloudflare/types/dns/record_batch_response.py +++ b/src/cloudflare/types/dns/record_batch_response.py @@ -1,2287 +1,18 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, TypeAlias +from typing import List, Optional -from .ttl import TTL -from .a_record import ARecord from ..._models import BaseModel -from .ds_record import DSRecord -from .mx_record import MXRecord -from .ns_record import NSRecord -from .caa_record import CAARecord -from .loc_record import LOCRecord -from .ptr_record import PTRRecord -from .srv_record import SRVRecord -from .txt_record import TXTRecord -from .uri_record import URIRecord -from .aaaa_record import AAAARecord -from .cert_record import CERTRecord -from .record_tags import RecordTags -from .svcb_record import SVCBRecord -from .tlsa_record import TLSARecord -from .cname_record import CNAMERecord -from .https_record import HTTPSRecord -from .naptr_record import NAPTRRecord -from .sshfp_record import SSHFPRecord -from .dnskey_record import DNSKEYRecord -from .smimea_record import SMIMEARecord +from .record_response import RecordResponse -__all__ = [ - "RecordBatchResponse", - "Delete", - "DeleteARecord", - "DeleteAAAARecord", - "DeleteCAARecord", - "DeleteCERTRecord", - "DeleteCNAMERecord", - "DeleteDNSKEYRecord", - "DeleteDSRecord", - "DeleteHTTPSRecord", - "DeleteLOCRecord", - "DeleteMXRecord", - "DeleteNAPTRRecord", - "DeleteNSRecord", - "DeleteOpenpgpkeyRecord", - "DeletePTRRecord", - "DeleteSMIMEARecord", - "DeleteSRVRecord", - "DeleteSSHFPRecord", - "DeleteSVCBRecord", - "DeleteTLSARecord", - "DeleteTXTRecord", - "DeleteURIRecord", - "Patch", - "PatchARecord", - "PatchAAAARecord", - "PatchCAARecord", - "PatchCERTRecord", - "PatchCNAMERecord", - "PatchDNSKEYRecord", - "PatchDSRecord", - "PatchHTTPSRecord", - "PatchLOCRecord", - "PatchMXRecord", - "PatchNAPTRRecord", - "PatchNSRecord", - "PatchOpenpgpkeyRecord", - "PatchPTRRecord", - "PatchSMIMEARecord", - "PatchSRVRecord", - "PatchSSHFPRecord", - "PatchSVCBRecord", - "PatchTLSARecord", - "PatchTXTRecord", - "PatchURIRecord", - "Post", - "PostARecord", - "PostAAAARecord", - "PostCAARecord", - "PostCERTRecord", - "PostCNAMERecord", - "PostDNSKEYRecord", - "PostDSRecord", - "PostHTTPSRecord", - "PostLOCRecord", - "PostMXRecord", - "PostNAPTRRecord", - "PostNSRecord", - "PostOpenpgpkeyRecord", - "PostPTRRecord", - "PostSMIMEARecord", - "PostSRVRecord", - "PostSSHFPRecord", - "PostSVCBRecord", - "PostTLSARecord", - "PostTXTRecord", - "PostURIRecord", - "Put", - "PutARecord", - "PutAAAARecord", - "PutCAARecord", - "PutCERTRecord", - "PutCNAMERecord", - "PutDNSKEYRecord", - "PutDSRecord", - "PutHTTPSRecord", - "PutLOCRecord", - "PutMXRecord", - "PutNAPTRRecord", - "PutNSRecord", - "PutOpenpgpkeyRecord", - "PutPTRRecord", - "PutSMIMEARecord", - "PutSRVRecord", - "PutSSHFPRecord", - "PutSVCBRecord", - "PutTLSARecord", - "PutTXTRecord", - "PutURIRecord", -] - - -class DeleteARecord(ARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class DeleteAAAARecord(AAAARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class DeleteCAARecord(CAARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class DeleteCERTRecord(CERTRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class DeleteCNAMERecord(CNAMERecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class DeleteDNSKEYRecord(DNSKEYRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class DeleteDSRecord(DSRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class DeleteHTTPSRecord(HTTPSRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class DeleteLOCRecord(LOCRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class DeleteMXRecord(MXRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class DeleteNAPTRRecord(NAPTRRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class DeleteNSRecord(NSRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class DeleteOpenpgpkeyRecord(BaseModel): - id: str - """Identifier""" - - comment: str - """Comments or notes about the DNS record. - - This field has no effect on DNS responses. - """ - - content: str - """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - proxied: bool - """ - Whether the record is receiving the performance and security benefits of - Cloudflare. - """ - - tags: List[RecordTags] - """Custom tags for the DNS record. This field has no effect on DNS responses.""" - - ttl: TTL - """Time To Live (TTL) of the DNS record in seconds. - - Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the - minimum reduced to 30 for Enterprise zones. - """ - - type: Literal["OPENPGPKEY"] - """Record type.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class DeletePTRRecord(PTRRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class DeleteSMIMEARecord(SMIMEARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class DeleteSRVRecord(SRVRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class DeleteSSHFPRecord(SSHFPRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class DeleteSVCBRecord(SVCBRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class DeleteTLSARecord(TLSARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class DeleteTXTRecord(TXTRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class DeleteURIRecord(URIRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -Delete: TypeAlias = Union[ - DeleteARecord, - DeleteAAAARecord, - DeleteCAARecord, - DeleteCERTRecord, - DeleteCNAMERecord, - DeleteDNSKEYRecord, - DeleteDSRecord, - DeleteHTTPSRecord, - DeleteLOCRecord, - DeleteMXRecord, - DeleteNAPTRRecord, - DeleteNSRecord, - DeleteOpenpgpkeyRecord, - DeletePTRRecord, - DeleteSMIMEARecord, - DeleteSRVRecord, - DeleteSSHFPRecord, - DeleteSVCBRecord, - DeleteTLSARecord, - DeleteTXTRecord, - DeleteURIRecord, -] - - -class PatchARecord(ARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PatchAAAARecord(AAAARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PatchCAARecord(CAARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PatchCERTRecord(CERTRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PatchCNAMERecord(CNAMERecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PatchDNSKEYRecord(DNSKEYRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PatchDSRecord(DSRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PatchHTTPSRecord(HTTPSRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PatchLOCRecord(LOCRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PatchMXRecord(MXRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PatchNAPTRRecord(NAPTRRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PatchNSRecord(NSRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PatchOpenpgpkeyRecord(BaseModel): - id: str - """Identifier""" - - comment: str - """Comments or notes about the DNS record. - - This field has no effect on DNS responses. - """ - - content: str - """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - proxied: bool - """ - Whether the record is receiving the performance and security benefits of - Cloudflare. - """ - - tags: List[RecordTags] - """Custom tags for the DNS record. This field has no effect on DNS responses.""" - - ttl: TTL - """Time To Live (TTL) of the DNS record in seconds. - - Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the - minimum reduced to 30 for Enterprise zones. - """ - - type: Literal["OPENPGPKEY"] - """Record type.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PatchPTRRecord(PTRRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PatchSMIMEARecord(SMIMEARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PatchSRVRecord(SRVRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PatchSSHFPRecord(SSHFPRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PatchSVCBRecord(SVCBRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PatchTLSARecord(TLSARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PatchTXTRecord(TXTRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PatchURIRecord(URIRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -Patch: TypeAlias = Union[ - PatchARecord, - PatchAAAARecord, - PatchCAARecord, - PatchCERTRecord, - PatchCNAMERecord, - PatchDNSKEYRecord, - PatchDSRecord, - PatchHTTPSRecord, - PatchLOCRecord, - PatchMXRecord, - PatchNAPTRRecord, - PatchNSRecord, - PatchOpenpgpkeyRecord, - PatchPTRRecord, - PatchSMIMEARecord, - PatchSRVRecord, - PatchSSHFPRecord, - PatchSVCBRecord, - PatchTLSARecord, - PatchTXTRecord, - PatchURIRecord, -] - - -class PostARecord(ARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PostAAAARecord(AAAARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PostCAARecord(CAARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PostCERTRecord(CERTRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PostCNAMERecord(CNAMERecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PostDNSKEYRecord(DNSKEYRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PostDSRecord(DSRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PostHTTPSRecord(HTTPSRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PostLOCRecord(LOCRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PostMXRecord(MXRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PostNAPTRRecord(NAPTRRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PostNSRecord(NSRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PostOpenpgpkeyRecord(BaseModel): - id: str - """Identifier""" - - comment: str - """Comments or notes about the DNS record. - - This field has no effect on DNS responses. - """ - - content: str - """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - proxied: bool - """ - Whether the record is receiving the performance and security benefits of - Cloudflare. - """ - - tags: List[RecordTags] - """Custom tags for the DNS record. This field has no effect on DNS responses.""" - - ttl: TTL - """Time To Live (TTL) of the DNS record in seconds. - - Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the - minimum reduced to 30 for Enterprise zones. - """ - - type: Literal["OPENPGPKEY"] - """Record type.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PostPTRRecord(PTRRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PostSMIMEARecord(SMIMEARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PostSRVRecord(SRVRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PostSSHFPRecord(SSHFPRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PostSVCBRecord(SVCBRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PostTLSARecord(TLSARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PostTXTRecord(TXTRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PostURIRecord(URIRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -Post: TypeAlias = Union[ - PostARecord, - PostAAAARecord, - PostCAARecord, - PostCERTRecord, - PostCNAMERecord, - PostDNSKEYRecord, - PostDSRecord, - PostHTTPSRecord, - PostLOCRecord, - PostMXRecord, - PostNAPTRRecord, - PostNSRecord, - PostOpenpgpkeyRecord, - PostPTRRecord, - PostSMIMEARecord, - PostSRVRecord, - PostSSHFPRecord, - PostSVCBRecord, - PostTLSARecord, - PostTXTRecord, - PostURIRecord, -] - - -class PutARecord(ARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PutAAAARecord(AAAARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PutCAARecord(CAARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PutCERTRecord(CERTRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PutCNAMERecord(CNAMERecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PutDNSKEYRecord(DNSKEYRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PutDSRecord(DSRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PutHTTPSRecord(HTTPSRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PutLOCRecord(LOCRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PutMXRecord(MXRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PutNAPTRRecord(NAPTRRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PutNSRecord(NSRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PutOpenpgpkeyRecord(BaseModel): - id: str - """Identifier""" - - comment: str - """Comments or notes about the DNS record. - - This field has no effect on DNS responses. - """ - - content: str - """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - proxied: bool - """ - Whether the record is receiving the performance and security benefits of - Cloudflare. - """ - - tags: List[RecordTags] - """Custom tags for the DNS record. This field has no effect on DNS responses.""" - - ttl: TTL - """Time To Live (TTL) of the DNS record in seconds. - - Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the - minimum reduced to 30 for Enterprise zones. - """ - - type: Literal["OPENPGPKEY"] - """Record type.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PutPTRRecord(PTRRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PutSMIMEARecord(SMIMEARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PutSRVRecord(SRVRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PutSSHFPRecord(SSHFPRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PutSVCBRecord(SVCBRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PutTLSARecord(TLSARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PutTXTRecord(TXTRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PutURIRecord(URIRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -Put: TypeAlias = Union[ - PutARecord, - PutAAAARecord, - PutCAARecord, - PutCERTRecord, - PutCNAMERecord, - PutDNSKEYRecord, - PutDSRecord, - PutHTTPSRecord, - PutLOCRecord, - PutMXRecord, - PutNAPTRRecord, - PutNSRecord, - PutOpenpgpkeyRecord, - PutPTRRecord, - PutSMIMEARecord, - PutSRVRecord, - PutSSHFPRecord, - PutSVCBRecord, - PutTLSARecord, - PutTXTRecord, - PutURIRecord, -] +__all__ = ["RecordBatchResponse"] class RecordBatchResponse(BaseModel): - deletes: Optional[List[Delete]] = None + deletes: Optional[List[RecordResponse]] = None - patches: Optional[List[Patch]] = None + patches: Optional[List[RecordResponse]] = None - posts: Optional[List[Post]] = None + posts: Optional[List[RecordResponse]] = None - puts: Optional[List[Put]] = None + puts: Optional[List[RecordResponse]] = None diff --git a/src/cloudflare/types/dns/record_create_params.py b/src/cloudflare/types/dns/record_create_params.py index b9ce9b46a95..c04cfc7995e 100644 --- a/src/cloudflare/types/dns/record_create_params.py +++ b/src/cloudflare/types/dns/record_create_params.py @@ -11,40 +11,60 @@ __all__ = [ "RecordCreateParams", "ARecord", + "ARecordSettings", "AAAARecord", + "AAAARecordSettings", "CAARecord", "CAARecordData", + "CAARecordSettings", "CERTRecord", "CERTRecordData", + "CERTRecordSettings", "CNAMERecord", "CNAMERecordSettings", "DNSKEYRecord", "DNSKEYRecordData", + "DNSKEYRecordSettings", "DSRecord", "DSRecordData", + "DSRecordSettings", "HTTPSRecord", "HTTPSRecordData", + "HTTPSRecordSettings", "LOCRecord", "LOCRecordData", + "LOCRecordSettings", "MXRecord", + "MXRecordSettings", "NAPTRRecord", "NAPTRRecordData", + "NAPTRRecordSettings", "NSRecord", + "NSRecordSettings", "DNSRecordsOpenpgpkeyRecord", + "DNSRecordsOpenpgpkeyRecordSettings", "PTRRecord", + "PTRRecordSettings", "SMIMEARecord", "SMIMEARecordData", + "SMIMEARecordSettings", "SRVRecord", "SRVRecordData", + "SRVRecordSettings", "SSHFPRecord", "SSHFPRecordData", + "SSHFPRecordSettings", "SVCBRecord", "SVCBRecordData", + "SVCBRecordSettings", "TLSARecord", "TLSARecordData", + "TLSARecordSettings", "TXTRecord", + "TXTRecordSettings", "URIRecord", "URIRecordData", + "URIRecordSettings", ] @@ -70,6 +90,9 @@ class ARecord(TypedDict, total=False): Cloudflare. """ + settings: ARecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -84,6 +107,24 @@ class ARecord(TypedDict, total=False): """Record type.""" +class ARecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class AAAARecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -106,6 +147,9 @@ class AAAARecord(TypedDict, total=False): Cloudflare. """ + settings: AAAARecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -120,6 +164,24 @@ class AAAARecord(TypedDict, total=False): """Record type.""" +class AAAARecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class CAARecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -142,6 +204,9 @@ class CAARecord(TypedDict, total=False): Cloudflare. """ + settings: CAARecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -167,6 +232,24 @@ class CAARecordData(TypedDict, total=False): """Value of the record. This field's semantics depend on the chosen tag.""" +class CAARecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class CERTRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -189,6 +272,9 @@ class CERTRecord(TypedDict, total=False): Cloudflare. """ + settings: CERTRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -217,6 +303,24 @@ class CERTRecordData(TypedDict, total=False): """Type.""" +class CERTRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class CNAMERecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -240,6 +344,7 @@ class CNAMERecord(TypedDict, total=False): """ settings: CNAMERecordSettings + """Settings for the DNS record.""" tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -260,10 +365,26 @@ class CNAMERecordSettings(TypedDict, total=False): """ If enabled, causes the CNAME record to be resolved externally and the resulting address records (e.g., A and AAAA) to be returned instead of the CNAME record - itself. This setting has no effect on proxied records, which are always + itself. This setting is unavailable for proxied records, since they are always flattened. """ + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + class DNSKEYRecord(TypedDict, total=False): zone_id: Required[str] @@ -287,6 +408,9 @@ class DNSKEYRecord(TypedDict, total=False): Cloudflare. """ + settings: DNSKEYRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -315,6 +439,24 @@ class DNSKEYRecordData(TypedDict, total=False): """Public Key.""" +class DNSKEYRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class DSRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -337,6 +479,9 @@ class DSRecord(TypedDict, total=False): Cloudflare. """ + settings: DSRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -365,6 +510,24 @@ class DSRecordData(TypedDict, total=False): """Key Tag.""" +class DSRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class HTTPSRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -387,6 +550,9 @@ class HTTPSRecord(TypedDict, total=False): Cloudflare. """ + settings: HTTPSRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -412,6 +578,24 @@ class HTTPSRecordData(TypedDict, total=False): """value.""" +class HTTPSRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class LOCRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -434,6 +618,9 @@ class LOCRecord(TypedDict, total=False): Cloudflare. """ + settings: LOCRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -486,6 +673,24 @@ class LOCRecordData(TypedDict, total=False): """Size of location in meters.""" +class LOCRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class MXRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -514,6 +719,9 @@ class MXRecord(TypedDict, total=False): Cloudflare. """ + settings: MXRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -528,6 +736,24 @@ class MXRecord(TypedDict, total=False): """Record type.""" +class MXRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class NAPTRRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -550,6 +776,9 @@ class NAPTRRecord(TypedDict, total=False): Cloudflare. """ + settings: NAPTRRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -584,6 +813,24 @@ class NAPTRRecordData(TypedDict, total=False): """Service.""" +class NAPTRRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class NSRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -606,6 +853,9 @@ class NSRecord(TypedDict, total=False): Cloudflare. """ + settings: NSRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -620,6 +870,24 @@ class NSRecord(TypedDict, total=False): """Record type.""" +class NSRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -642,6 +910,9 @@ class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): Cloudflare. """ + settings: DNSRecordsOpenpgpkeyRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -656,6 +927,24 @@ class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): """Record type.""" +class DNSRecordsOpenpgpkeyRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class PTRRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -678,6 +967,9 @@ class PTRRecord(TypedDict, total=False): Cloudflare. """ + settings: PTRRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -692,6 +984,24 @@ class PTRRecord(TypedDict, total=False): """Record type.""" +class PTRRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class SMIMEARecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -714,6 +1024,9 @@ class SMIMEARecord(TypedDict, total=False): Cloudflare. """ + settings: SMIMEARecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -742,6 +1055,24 @@ class SMIMEARecordData(TypedDict, total=False): """Usage.""" +class SMIMEARecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class SRVRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -764,6 +1095,9 @@ class SRVRecord(TypedDict, total=False): Cloudflare. """ + settings: SRVRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -795,6 +1129,24 @@ class SRVRecordData(TypedDict, total=False): """The record weight.""" +class SRVRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class SSHFPRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -817,6 +1169,9 @@ class SSHFPRecord(TypedDict, total=False): Cloudflare. """ + settings: SSHFPRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -842,6 +1197,24 @@ class SSHFPRecordData(TypedDict, total=False): """type.""" +class SSHFPRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class SVCBRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -864,6 +1237,9 @@ class SVCBRecord(TypedDict, total=False): Cloudflare. """ + settings: SVCBRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -889,6 +1265,24 @@ class SVCBRecordData(TypedDict, total=False): """value.""" +class SVCBRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class TLSARecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -911,6 +1305,9 @@ class TLSARecord(TypedDict, total=False): Cloudflare. """ + settings: TLSARecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -939,6 +1336,24 @@ class TLSARecordData(TypedDict, total=False): """Usage.""" +class TLSARecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class TXTRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -969,6 +1384,9 @@ class TXTRecord(TypedDict, total=False): Cloudflare. """ + settings: TXTRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -983,6 +1401,24 @@ class TXTRecord(TypedDict, total=False): """Record type.""" +class TXTRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class URIRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -1011,6 +1447,9 @@ class URIRecord(TypedDict, total=False): Cloudflare. """ + settings: URIRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -1033,6 +1472,24 @@ class URIRecordData(TypedDict, total=False): """The record weight.""" +class URIRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + RecordCreateParams: TypeAlias = Union[ ARecord, AAAARecord, diff --git a/src/cloudflare/types/dns/record_create_response.py b/src/cloudflare/types/dns/record_create_response.py deleted file mode 100644 index ae0ed8bb218..00000000000 --- a/src/cloudflare/types/dns/record_create_response.py +++ /dev/null @@ -1,595 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, TypeAlias - -from . import ( - a_record, - ds_record, - mx_record, - ns_record, - caa_record, - loc_record, - ptr_record, - srv_record, - txt_record, - uri_record, - aaaa_record, - cert_record, - svcb_record, - tlsa_record, - cname_record, - https_record, - naptr_record, - sshfp_record, - dnskey_record, - smimea_record, -) -from .ttl import TTL -from ..._models import BaseModel -from .record_tags import RecordTags - -__all__ = [ - "RecordCreateResponse", - "ARecord", - "AAAARecord", - "CAARecord", - "CERTRecord", - "CNAMERecord", - "DNSKEYRecord", - "DSRecord", - "HTTPSRecord", - "LOCRecord", - "MXRecord", - "NAPTRRecord", - "NSRecord", - "OpenpgpkeyRecord", - "PTRRecord", - "SMIMEARecord", - "SRVRecord", - "SSHFPRecord", - "SVCBRecord", - "TLSARecord", - "TXTRecord", - "URIRecord", -] - - -class ARecord(a_record.ARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class AAAARecord(aaaa_record.AAAARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class CAARecord(caa_record.CAARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class CERTRecord(cert_record.CERTRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class CNAMERecord(cname_record.CNAMERecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class DNSKEYRecord(dnskey_record.DNSKEYRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class DSRecord(ds_record.DSRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class HTTPSRecord(https_record.HTTPSRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class LOCRecord(loc_record.LOCRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class MXRecord(mx_record.MXRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class NAPTRRecord(naptr_record.NAPTRRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class NSRecord(ns_record.NSRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class OpenpgpkeyRecord(BaseModel): - id: str - """Identifier""" - - comment: str - """Comments or notes about the DNS record. - - This field has no effect on DNS responses. - """ - - content: str - """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - proxied: bool - """ - Whether the record is receiving the performance and security benefits of - Cloudflare. - """ - - tags: List[RecordTags] - """Custom tags for the DNS record. This field has no effect on DNS responses.""" - - ttl: TTL - """Time To Live (TTL) of the DNS record in seconds. - - Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the - minimum reduced to 30 for Enterprise zones. - """ - - type: Literal["OPENPGPKEY"] - """Record type.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PTRRecord(ptr_record.PTRRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class SMIMEARecord(smimea_record.SMIMEARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class SRVRecord(srv_record.SRVRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class SSHFPRecord(sshfp_record.SSHFPRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class SVCBRecord(svcb_record.SVCBRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class TLSARecord(tlsa_record.TLSARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class TXTRecord(txt_record.TXTRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class URIRecord(uri_record.URIRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -RecordCreateResponse: TypeAlias = Union[ - ARecord, - AAAARecord, - CAARecord, - CERTRecord, - CNAMERecord, - DNSKEYRecord, - DSRecord, - HTTPSRecord, - LOCRecord, - MXRecord, - NAPTRRecord, - NSRecord, - OpenpgpkeyRecord, - PTRRecord, - SMIMEARecord, - SRVRecord, - SSHFPRecord, - SVCBRecord, - TLSARecord, - TXTRecord, - URIRecord, -] diff --git a/src/cloudflare/types/dns/record_edit_params.py b/src/cloudflare/types/dns/record_edit_params.py index 560790f1419..179b94923d9 100644 --- a/src/cloudflare/types/dns/record_edit_params.py +++ b/src/cloudflare/types/dns/record_edit_params.py @@ -11,40 +11,60 @@ __all__ = [ "RecordEditParams", "ARecord", + "ARecordSettings", "AAAARecord", + "AAAARecordSettings", "CAARecord", "CAARecordData", + "CAARecordSettings", "CERTRecord", "CERTRecordData", + "CERTRecordSettings", "CNAMERecord", "CNAMERecordSettings", "DNSKEYRecord", "DNSKEYRecordData", + "DNSKEYRecordSettings", "DSRecord", "DSRecordData", + "DSRecordSettings", "HTTPSRecord", "HTTPSRecordData", + "HTTPSRecordSettings", "LOCRecord", "LOCRecordData", + "LOCRecordSettings", "MXRecord", + "MXRecordSettings", "NAPTRRecord", "NAPTRRecordData", + "NAPTRRecordSettings", "NSRecord", + "NSRecordSettings", "DNSRecordsOpenpgpkeyRecord", + "DNSRecordsOpenpgpkeyRecordSettings", "PTRRecord", + "PTRRecordSettings", "SMIMEARecord", "SMIMEARecordData", + "SMIMEARecordSettings", "SRVRecord", "SRVRecordData", + "SRVRecordSettings", "SSHFPRecord", "SSHFPRecordData", + "SSHFPRecordSettings", "SVCBRecord", "SVCBRecordData", + "SVCBRecordSettings", "TLSARecord", "TLSARecordData", + "TLSARecordSettings", "TXTRecord", + "TXTRecordSettings", "URIRecord", "URIRecordData", + "URIRecordSettings", ] @@ -70,6 +90,9 @@ class ARecord(TypedDict, total=False): Cloudflare. """ + settings: ARecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -84,6 +107,24 @@ class ARecord(TypedDict, total=False): """Record type.""" +class ARecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class AAAARecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -106,6 +147,9 @@ class AAAARecord(TypedDict, total=False): Cloudflare. """ + settings: AAAARecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -120,6 +164,24 @@ class AAAARecord(TypedDict, total=False): """Record type.""" +class AAAARecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class CAARecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -142,6 +204,9 @@ class CAARecord(TypedDict, total=False): Cloudflare. """ + settings: CAARecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -167,6 +232,24 @@ class CAARecordData(TypedDict, total=False): """Value of the record. This field's semantics depend on the chosen tag.""" +class CAARecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class CERTRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -189,6 +272,9 @@ class CERTRecord(TypedDict, total=False): Cloudflare. """ + settings: CERTRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -217,6 +303,24 @@ class CERTRecordData(TypedDict, total=False): """Type.""" +class CERTRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class CNAMERecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -240,6 +344,7 @@ class CNAMERecord(TypedDict, total=False): """ settings: CNAMERecordSettings + """Settings for the DNS record.""" tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -260,10 +365,26 @@ class CNAMERecordSettings(TypedDict, total=False): """ If enabled, causes the CNAME record to be resolved externally and the resulting address records (e.g., A and AAAA) to be returned instead of the CNAME record - itself. This setting has no effect on proxied records, which are always + itself. This setting is unavailable for proxied records, since they are always flattened. """ + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + class DNSKEYRecord(TypedDict, total=False): zone_id: Required[str] @@ -287,6 +408,9 @@ class DNSKEYRecord(TypedDict, total=False): Cloudflare. """ + settings: DNSKEYRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -315,6 +439,24 @@ class DNSKEYRecordData(TypedDict, total=False): """Public Key.""" +class DNSKEYRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class DSRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -337,6 +479,9 @@ class DSRecord(TypedDict, total=False): Cloudflare. """ + settings: DSRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -365,6 +510,24 @@ class DSRecordData(TypedDict, total=False): """Key Tag.""" +class DSRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class HTTPSRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -387,6 +550,9 @@ class HTTPSRecord(TypedDict, total=False): Cloudflare. """ + settings: HTTPSRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -412,6 +578,24 @@ class HTTPSRecordData(TypedDict, total=False): """value.""" +class HTTPSRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class LOCRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -434,6 +618,9 @@ class LOCRecord(TypedDict, total=False): Cloudflare. """ + settings: LOCRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -486,6 +673,24 @@ class LOCRecordData(TypedDict, total=False): """Size of location in meters.""" +class LOCRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class MXRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -514,6 +719,9 @@ class MXRecord(TypedDict, total=False): Cloudflare. """ + settings: MXRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -528,6 +736,24 @@ class MXRecord(TypedDict, total=False): """Record type.""" +class MXRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class NAPTRRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -550,6 +776,9 @@ class NAPTRRecord(TypedDict, total=False): Cloudflare. """ + settings: NAPTRRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -584,6 +813,24 @@ class NAPTRRecordData(TypedDict, total=False): """Service.""" +class NAPTRRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class NSRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -606,6 +853,9 @@ class NSRecord(TypedDict, total=False): Cloudflare. """ + settings: NSRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -620,6 +870,24 @@ class NSRecord(TypedDict, total=False): """Record type.""" +class NSRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -642,6 +910,9 @@ class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): Cloudflare. """ + settings: DNSRecordsOpenpgpkeyRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -656,6 +927,24 @@ class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): """Record type.""" +class DNSRecordsOpenpgpkeyRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class PTRRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -678,6 +967,9 @@ class PTRRecord(TypedDict, total=False): Cloudflare. """ + settings: PTRRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -692,6 +984,24 @@ class PTRRecord(TypedDict, total=False): """Record type.""" +class PTRRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class SMIMEARecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -714,6 +1024,9 @@ class SMIMEARecord(TypedDict, total=False): Cloudflare. """ + settings: SMIMEARecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -742,6 +1055,24 @@ class SMIMEARecordData(TypedDict, total=False): """Usage.""" +class SMIMEARecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class SRVRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -764,6 +1095,9 @@ class SRVRecord(TypedDict, total=False): Cloudflare. """ + settings: SRVRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -795,6 +1129,24 @@ class SRVRecordData(TypedDict, total=False): """The record weight.""" +class SRVRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class SSHFPRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -817,6 +1169,9 @@ class SSHFPRecord(TypedDict, total=False): Cloudflare. """ + settings: SSHFPRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -842,6 +1197,24 @@ class SSHFPRecordData(TypedDict, total=False): """type.""" +class SSHFPRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class SVCBRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -864,6 +1237,9 @@ class SVCBRecord(TypedDict, total=False): Cloudflare. """ + settings: SVCBRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -889,6 +1265,24 @@ class SVCBRecordData(TypedDict, total=False): """value.""" +class SVCBRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class TLSARecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -911,6 +1305,9 @@ class TLSARecord(TypedDict, total=False): Cloudflare. """ + settings: TLSARecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -939,6 +1336,24 @@ class TLSARecordData(TypedDict, total=False): """Usage.""" +class TLSARecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class TXTRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -969,6 +1384,9 @@ class TXTRecord(TypedDict, total=False): Cloudflare. """ + settings: TXTRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -983,6 +1401,24 @@ class TXTRecord(TypedDict, total=False): """Record type.""" +class TXTRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class URIRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -1011,6 +1447,9 @@ class URIRecord(TypedDict, total=False): Cloudflare. """ + settings: URIRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -1033,6 +1472,24 @@ class URIRecordData(TypedDict, total=False): """The record weight.""" +class URIRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + RecordEditParams: TypeAlias = Union[ ARecord, AAAARecord, diff --git a/src/cloudflare/types/dns/record_get_response.py b/src/cloudflare/types/dns/record_get_response.py deleted file mode 100644 index 35c2ce1092d..00000000000 --- a/src/cloudflare/types/dns/record_get_response.py +++ /dev/null @@ -1,595 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, TypeAlias - -from . import ( - a_record, - ds_record, - mx_record, - ns_record, - caa_record, - loc_record, - ptr_record, - srv_record, - txt_record, - uri_record, - aaaa_record, - cert_record, - svcb_record, - tlsa_record, - cname_record, - https_record, - naptr_record, - sshfp_record, - dnskey_record, - smimea_record, -) -from .ttl import TTL -from ..._models import BaseModel -from .record_tags import RecordTags - -__all__ = [ - "RecordGetResponse", - "ARecord", - "AAAARecord", - "CAARecord", - "CERTRecord", - "CNAMERecord", - "DNSKEYRecord", - "DSRecord", - "HTTPSRecord", - "LOCRecord", - "MXRecord", - "NAPTRRecord", - "NSRecord", - "OpenpgpkeyRecord", - "PTRRecord", - "SMIMEARecord", - "SRVRecord", - "SSHFPRecord", - "SVCBRecord", - "TLSARecord", - "TXTRecord", - "URIRecord", -] - - -class ARecord(a_record.ARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class AAAARecord(aaaa_record.AAAARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class CAARecord(caa_record.CAARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class CERTRecord(cert_record.CERTRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class CNAMERecord(cname_record.CNAMERecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class DNSKEYRecord(dnskey_record.DNSKEYRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class DSRecord(ds_record.DSRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class HTTPSRecord(https_record.HTTPSRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class LOCRecord(loc_record.LOCRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class MXRecord(mx_record.MXRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class NAPTRRecord(naptr_record.NAPTRRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class NSRecord(ns_record.NSRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class OpenpgpkeyRecord(BaseModel): - id: str - """Identifier""" - - comment: str - """Comments or notes about the DNS record. - - This field has no effect on DNS responses. - """ - - content: str - """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - proxied: bool - """ - Whether the record is receiving the performance and security benefits of - Cloudflare. - """ - - tags: List[RecordTags] - """Custom tags for the DNS record. This field has no effect on DNS responses.""" - - ttl: TTL - """Time To Live (TTL) of the DNS record in seconds. - - Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the - minimum reduced to 30 for Enterprise zones. - """ - - type: Literal["OPENPGPKEY"] - """Record type.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PTRRecord(ptr_record.PTRRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class SMIMEARecord(smimea_record.SMIMEARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class SRVRecord(srv_record.SRVRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class SSHFPRecord(sshfp_record.SSHFPRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class SVCBRecord(svcb_record.SVCBRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class TLSARecord(tlsa_record.TLSARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class TXTRecord(txt_record.TXTRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class URIRecord(uri_record.URIRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -RecordGetResponse: TypeAlias = Union[ - ARecord, - AAAARecord, - CAARecord, - CERTRecord, - CNAMERecord, - DNSKEYRecord, - DSRecord, - HTTPSRecord, - LOCRecord, - MXRecord, - NAPTRRecord, - NSRecord, - OpenpgpkeyRecord, - PTRRecord, - SMIMEARecord, - SRVRecord, - SSHFPRecord, - SVCBRecord, - TLSARecord, - TXTRecord, - URIRecord, -] diff --git a/src/cloudflare/types/dns/record_list_response.py b/src/cloudflare/types/dns/record_list_response.py deleted file mode 100644 index db08bb0b1a0..00000000000 --- a/src/cloudflare/types/dns/record_list_response.py +++ /dev/null @@ -1,595 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, TypeAlias - -from . import ( - a_record, - ds_record, - mx_record, - ns_record, - caa_record, - loc_record, - ptr_record, - srv_record, - txt_record, - uri_record, - aaaa_record, - cert_record, - svcb_record, - tlsa_record, - cname_record, - https_record, - naptr_record, - sshfp_record, - dnskey_record, - smimea_record, -) -from .ttl import TTL -from ..._models import BaseModel -from .record_tags import RecordTags - -__all__ = [ - "RecordListResponse", - "ARecord", - "AAAARecord", - "CAARecord", - "CERTRecord", - "CNAMERecord", - "DNSKEYRecord", - "DSRecord", - "HTTPSRecord", - "LOCRecord", - "MXRecord", - "NAPTRRecord", - "NSRecord", - "OpenpgpkeyRecord", - "PTRRecord", - "SMIMEARecord", - "SRVRecord", - "SSHFPRecord", - "SVCBRecord", - "TLSARecord", - "TXTRecord", - "URIRecord", -] - - -class ARecord(a_record.ARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class AAAARecord(aaaa_record.AAAARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class CAARecord(caa_record.CAARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class CERTRecord(cert_record.CERTRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class CNAMERecord(cname_record.CNAMERecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class DNSKEYRecord(dnskey_record.DNSKEYRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class DSRecord(ds_record.DSRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class HTTPSRecord(https_record.HTTPSRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class LOCRecord(loc_record.LOCRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class MXRecord(mx_record.MXRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class NAPTRRecord(naptr_record.NAPTRRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class NSRecord(ns_record.NSRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class OpenpgpkeyRecord(BaseModel): - id: str - """Identifier""" - - comment: str - """Comments or notes about the DNS record. - - This field has no effect on DNS responses. - """ - - content: str - """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - proxied: bool - """ - Whether the record is receiving the performance and security benefits of - Cloudflare. - """ - - tags: List[RecordTags] - """Custom tags for the DNS record. This field has no effect on DNS responses.""" - - ttl: TTL - """Time To Live (TTL) of the DNS record in seconds. - - Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the - minimum reduced to 30 for Enterprise zones. - """ - - type: Literal["OPENPGPKEY"] - """Record type.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PTRRecord(ptr_record.PTRRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class SMIMEARecord(smimea_record.SMIMEARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class SRVRecord(srv_record.SRVRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class SSHFPRecord(sshfp_record.SSHFPRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class SVCBRecord(svcb_record.SVCBRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class TLSARecord(tlsa_record.TLSARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class TXTRecord(txt_record.TXTRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class URIRecord(uri_record.URIRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -RecordListResponse: TypeAlias = Union[ - ARecord, - AAAARecord, - CAARecord, - CERTRecord, - CNAMERecord, - DNSKEYRecord, - DSRecord, - HTTPSRecord, - LOCRecord, - MXRecord, - NAPTRRecord, - NSRecord, - OpenpgpkeyRecord, - PTRRecord, - SMIMEARecord, - SRVRecord, - SSHFPRecord, - SVCBRecord, - TLSARecord, - TXTRecord, - URIRecord, -] diff --git a/src/cloudflare/types/dns/record_param.py b/src/cloudflare/types/dns/record_param.py index 86c91d8b874..fd9202fefef 100644 --- a/src/cloudflare/types/dns/record_param.py +++ b/src/cloudflare/types/dns/record_param.py @@ -28,10 +28,28 @@ from .dnskey_record_param import DNSKEYRecordParam from .smimea_record_param import SMIMEARecordParam -__all__ = ["RecordParam", "DNSRecordsOpenpgpkeyRecord"] +__all__ = ["RecordParam", "Openpgpkey", "OpenpgpkeySettings"] -class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): +class OpenpgpkeySettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + +class Openpgpkey(TypedDict, total=False): comment: str """Comments or notes about the DNS record. @@ -50,6 +68,9 @@ class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): Cloudflare. """ + settings: OpenpgpkeySettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -77,7 +98,7 @@ class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): MXRecordParam, NAPTRRecordParam, NSRecordParam, - DNSRecordsOpenpgpkeyRecord, + Openpgpkey, PTRRecordParam, SMIMEARecordParam, SRVRecordParam, diff --git a/src/cloudflare/types/dns/record_process_timing.py b/src/cloudflare/types/dns/record_process_timing.py deleted file mode 100644 index 1fc4d7db12a..00000000000 --- a/src/cloudflare/types/dns/record_process_timing.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime - -from ..._models import BaseModel - -__all__ = ["RecordProcessTiming"] - - -class RecordProcessTiming(BaseModel): - end_time: Optional[datetime] = None - """When the file parsing ended.""" - - process_time: Optional[float] = None - """Processing time of the file in seconds.""" - - start_time: Optional[datetime] = None - """When the file parsing started.""" diff --git a/src/cloudflare/types/dns/record_edit_response.py b/src/cloudflare/types/dns/record_response.py similarity index 94% rename from src/cloudflare/types/dns/record_edit_response.py rename to src/cloudflare/types/dns/record_response.py index 685475e6962..86334c5f111 100644 --- a/src/cloudflare/types/dns/record_edit_response.py +++ b/src/cloudflare/types/dns/record_response.py @@ -31,7 +31,7 @@ from .record_tags import RecordTags __all__ = [ - "RecordEditResponse", + "RecordResponse", "ARecord", "AAAARecord", "CAARecord", @@ -44,7 +44,8 @@ "MXRecord", "NAPTRRecord", "NSRecord", - "OpenpgpkeyRecord", + "Openpgpkey", + "OpenpgpkeySettings", "PTRRecord", "SMIMEARecord", "SRVRecord", @@ -332,7 +333,25 @@ class NSRecord(ns_record.NSRecord): """When the record tags were last modified. Omitted if there are no tags.""" -class OpenpgpkeyRecord(BaseModel): +class OpenpgpkeySettings(BaseModel): + ipv4_only: Optional[bool] = None + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: Optional[bool] = None + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + +class Openpgpkey(BaseModel): id: str """Identifier""" @@ -366,6 +385,9 @@ class OpenpgpkeyRecord(BaseModel): Cloudflare. """ + settings: OpenpgpkeySettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -570,7 +592,7 @@ class URIRecord(uri_record.URIRecord): """When the record tags were last modified. Omitted if there are no tags.""" -RecordEditResponse: TypeAlias = Union[ +RecordResponse: TypeAlias = Union[ ARecord, AAAARecord, CAARecord, @@ -583,7 +605,7 @@ class URIRecord(uri_record.URIRecord): MXRecord, NAPTRRecord, NSRecord, - OpenpgpkeyRecord, + Openpgpkey, PTRRecord, SMIMEARecord, SRVRecord, diff --git a/src/cloudflare/types/dns/record_update_params.py b/src/cloudflare/types/dns/record_update_params.py index d959b8c6e1e..e594247fb7e 100644 --- a/src/cloudflare/types/dns/record_update_params.py +++ b/src/cloudflare/types/dns/record_update_params.py @@ -11,40 +11,60 @@ __all__ = [ "RecordUpdateParams", "ARecord", + "ARecordSettings", "AAAARecord", + "AAAARecordSettings", "CAARecord", "CAARecordData", + "CAARecordSettings", "CERTRecord", "CERTRecordData", + "CERTRecordSettings", "CNAMERecord", "CNAMERecordSettings", "DNSKEYRecord", "DNSKEYRecordData", + "DNSKEYRecordSettings", "DSRecord", "DSRecordData", + "DSRecordSettings", "HTTPSRecord", "HTTPSRecordData", + "HTTPSRecordSettings", "LOCRecord", "LOCRecordData", + "LOCRecordSettings", "MXRecord", + "MXRecordSettings", "NAPTRRecord", "NAPTRRecordData", + "NAPTRRecordSettings", "NSRecord", + "NSRecordSettings", "DNSRecordsOpenpgpkeyRecord", + "DNSRecordsOpenpgpkeyRecordSettings", "PTRRecord", + "PTRRecordSettings", "SMIMEARecord", "SMIMEARecordData", + "SMIMEARecordSettings", "SRVRecord", "SRVRecordData", + "SRVRecordSettings", "SSHFPRecord", "SSHFPRecordData", + "SSHFPRecordSettings", "SVCBRecord", "SVCBRecordData", + "SVCBRecordSettings", "TLSARecord", "TLSARecordData", + "TLSARecordSettings", "TXTRecord", + "TXTRecordSettings", "URIRecord", "URIRecordData", + "URIRecordSettings", ] @@ -70,6 +90,9 @@ class ARecord(TypedDict, total=False): Cloudflare. """ + settings: ARecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -84,6 +107,24 @@ class ARecord(TypedDict, total=False): """Record type.""" +class ARecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class AAAARecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -106,6 +147,9 @@ class AAAARecord(TypedDict, total=False): Cloudflare. """ + settings: AAAARecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -120,6 +164,24 @@ class AAAARecord(TypedDict, total=False): """Record type.""" +class AAAARecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class CAARecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -142,6 +204,9 @@ class CAARecord(TypedDict, total=False): Cloudflare. """ + settings: CAARecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -167,6 +232,24 @@ class CAARecordData(TypedDict, total=False): """Value of the record. This field's semantics depend on the chosen tag.""" +class CAARecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class CERTRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -189,6 +272,9 @@ class CERTRecord(TypedDict, total=False): Cloudflare. """ + settings: CERTRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -217,6 +303,24 @@ class CERTRecordData(TypedDict, total=False): """Type.""" +class CERTRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class CNAMERecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -240,6 +344,7 @@ class CNAMERecord(TypedDict, total=False): """ settings: CNAMERecordSettings + """Settings for the DNS record.""" tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -260,10 +365,26 @@ class CNAMERecordSettings(TypedDict, total=False): """ If enabled, causes the CNAME record to be resolved externally and the resulting address records (e.g., A and AAAA) to be returned instead of the CNAME record - itself. This setting has no effect on proxied records, which are always + itself. This setting is unavailable for proxied records, since they are always flattened. """ + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + class DNSKEYRecord(TypedDict, total=False): zone_id: Required[str] @@ -287,6 +408,9 @@ class DNSKEYRecord(TypedDict, total=False): Cloudflare. """ + settings: DNSKEYRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -315,6 +439,24 @@ class DNSKEYRecordData(TypedDict, total=False): """Public Key.""" +class DNSKEYRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class DSRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -337,6 +479,9 @@ class DSRecord(TypedDict, total=False): Cloudflare. """ + settings: DSRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -365,6 +510,24 @@ class DSRecordData(TypedDict, total=False): """Key Tag.""" +class DSRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class HTTPSRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -387,6 +550,9 @@ class HTTPSRecord(TypedDict, total=False): Cloudflare. """ + settings: HTTPSRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -412,6 +578,24 @@ class HTTPSRecordData(TypedDict, total=False): """value.""" +class HTTPSRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class LOCRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -434,6 +618,9 @@ class LOCRecord(TypedDict, total=False): Cloudflare. """ + settings: LOCRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -486,6 +673,24 @@ class LOCRecordData(TypedDict, total=False): """Size of location in meters.""" +class LOCRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class MXRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -514,6 +719,9 @@ class MXRecord(TypedDict, total=False): Cloudflare. """ + settings: MXRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -528,6 +736,24 @@ class MXRecord(TypedDict, total=False): """Record type.""" +class MXRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class NAPTRRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -550,6 +776,9 @@ class NAPTRRecord(TypedDict, total=False): Cloudflare. """ + settings: NAPTRRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -584,6 +813,24 @@ class NAPTRRecordData(TypedDict, total=False): """Service.""" +class NAPTRRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class NSRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -606,6 +853,9 @@ class NSRecord(TypedDict, total=False): Cloudflare. """ + settings: NSRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -620,6 +870,24 @@ class NSRecord(TypedDict, total=False): """Record type.""" +class NSRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -642,6 +910,9 @@ class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): Cloudflare. """ + settings: DNSRecordsOpenpgpkeyRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -656,6 +927,24 @@ class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): """Record type.""" +class DNSRecordsOpenpgpkeyRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class PTRRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -678,6 +967,9 @@ class PTRRecord(TypedDict, total=False): Cloudflare. """ + settings: PTRRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -692,6 +984,24 @@ class PTRRecord(TypedDict, total=False): """Record type.""" +class PTRRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class SMIMEARecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -714,6 +1024,9 @@ class SMIMEARecord(TypedDict, total=False): Cloudflare. """ + settings: SMIMEARecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -742,6 +1055,24 @@ class SMIMEARecordData(TypedDict, total=False): """Usage.""" +class SMIMEARecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class SRVRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -764,6 +1095,9 @@ class SRVRecord(TypedDict, total=False): Cloudflare. """ + settings: SRVRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -795,6 +1129,24 @@ class SRVRecordData(TypedDict, total=False): """The record weight.""" +class SRVRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class SSHFPRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -817,6 +1169,9 @@ class SSHFPRecord(TypedDict, total=False): Cloudflare. """ + settings: SSHFPRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -842,6 +1197,24 @@ class SSHFPRecordData(TypedDict, total=False): """type.""" +class SSHFPRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class SVCBRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -864,6 +1237,9 @@ class SVCBRecord(TypedDict, total=False): Cloudflare. """ + settings: SVCBRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -889,6 +1265,24 @@ class SVCBRecordData(TypedDict, total=False): """value.""" +class SVCBRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class TLSARecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -911,6 +1305,9 @@ class TLSARecord(TypedDict, total=False): Cloudflare. """ + settings: TLSARecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -939,6 +1336,24 @@ class TLSARecordData(TypedDict, total=False): """Usage.""" +class TLSARecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class TXTRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -969,6 +1384,9 @@ class TXTRecord(TypedDict, total=False): Cloudflare. """ + settings: TXTRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -983,6 +1401,24 @@ class TXTRecord(TypedDict, total=False): """Record type.""" +class TXTRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class URIRecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -1011,6 +1447,9 @@ class URIRecord(TypedDict, total=False): Cloudflare. """ + settings: URIRecordSettings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" @@ -1033,6 +1472,24 @@ class URIRecordData(TypedDict, total=False): """The record weight.""" +class URIRecordSettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + RecordUpdateParams: TypeAlias = Union[ ARecord, AAAARecord, diff --git a/src/cloudflare/types/dns/record_update_response.py b/src/cloudflare/types/dns/record_update_response.py deleted file mode 100644 index 342d44349d1..00000000000 --- a/src/cloudflare/types/dns/record_update_response.py +++ /dev/null @@ -1,595 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, TypeAlias - -from . import ( - a_record, - ds_record, - mx_record, - ns_record, - caa_record, - loc_record, - ptr_record, - srv_record, - txt_record, - uri_record, - aaaa_record, - cert_record, - svcb_record, - tlsa_record, - cname_record, - https_record, - naptr_record, - sshfp_record, - dnskey_record, - smimea_record, -) -from .ttl import TTL -from ..._models import BaseModel -from .record_tags import RecordTags - -__all__ = [ - "RecordUpdateResponse", - "ARecord", - "AAAARecord", - "CAARecord", - "CERTRecord", - "CNAMERecord", - "DNSKEYRecord", - "DSRecord", - "HTTPSRecord", - "LOCRecord", - "MXRecord", - "NAPTRRecord", - "NSRecord", - "OpenpgpkeyRecord", - "PTRRecord", - "SMIMEARecord", - "SRVRecord", - "SSHFPRecord", - "SVCBRecord", - "TLSARecord", - "TXTRecord", - "URIRecord", -] - - -class ARecord(a_record.ARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class AAAARecord(aaaa_record.AAAARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class CAARecord(caa_record.CAARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class CERTRecord(cert_record.CERTRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class CNAMERecord(cname_record.CNAMERecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class DNSKEYRecord(dnskey_record.DNSKEYRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class DSRecord(ds_record.DSRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class HTTPSRecord(https_record.HTTPSRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class LOCRecord(loc_record.LOCRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class MXRecord(mx_record.MXRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class NAPTRRecord(naptr_record.NAPTRRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class NSRecord(ns_record.NSRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class OpenpgpkeyRecord(BaseModel): - id: str - """Identifier""" - - comment: str - """Comments or notes about the DNS record. - - This field has no effect on DNS responses. - """ - - content: str - """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - proxied: bool - """ - Whether the record is receiving the performance and security benefits of - Cloudflare. - """ - - tags: List[RecordTags] - """Custom tags for the DNS record. This field has no effect on DNS responses.""" - - ttl: TTL - """Time To Live (TTL) of the DNS record in seconds. - - Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the - minimum reduced to 30 for Enterprise zones. - """ - - type: Literal["OPENPGPKEY"] - """Record type.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class PTRRecord(ptr_record.PTRRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class SMIMEARecord(smimea_record.SMIMEARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class SRVRecord(srv_record.SRVRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class SSHFPRecord(sshfp_record.SSHFPRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class SVCBRecord(svcb_record.SVCBRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class TLSARecord(tlsa_record.TLSARecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class TXTRecord(txt_record.TXTRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -class URIRecord(uri_record.URIRecord): - id: str - """Identifier""" - - created_on: datetime - """When the record was created.""" - - meta: object - """Extra Cloudflare-specific information about the record.""" - - modified_on: datetime - """When the record was last modified.""" - - proxiable: bool - """Whether the record can be proxied by Cloudflare or not.""" - - comment_modified_on: Optional[datetime] = None - """When the record comment was last modified. Omitted if there is no comment.""" - - tags_modified_on: Optional[datetime] = None - """When the record tags were last modified. Omitted if there are no tags.""" - - -RecordUpdateResponse: TypeAlias = Union[ - ARecord, - AAAARecord, - CAARecord, - CERTRecord, - CNAMERecord, - DNSKEYRecord, - DSRecord, - HTTPSRecord, - LOCRecord, - MXRecord, - NAPTRRecord, - NSRecord, - OpenpgpkeyRecord, - PTRRecord, - SMIMEARecord, - SRVRecord, - SSHFPRecord, - SVCBRecord, - TLSARecord, - TXTRecord, - URIRecord, -] diff --git a/src/cloudflare/types/dns/smimea_record.py b/src/cloudflare/types/dns/smimea_record.py index 7fae716400b..7dc5ddbe673 100644 --- a/src/cloudflare/types/dns/smimea_record.py +++ b/src/cloudflare/types/dns/smimea_record.py @@ -7,7 +7,7 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["SMIMEARecord", "Data"] +__all__ = ["SMIMEARecord", "Data", "Settings"] class Data(BaseModel): @@ -24,6 +24,24 @@ class Data(BaseModel): """Usage.""" +class Settings(BaseModel): + ipv4_only: Optional[bool] = None + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: Optional[bool] = None + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class SMIMEARecord(BaseModel): comment: Optional[str] = None """Comments or notes about the DNS record. @@ -46,6 +64,9 @@ class SMIMEARecord(BaseModel): Cloudflare. """ + settings: Optional[Settings] = None + """Settings for the DNS record.""" + tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/smimea_record_param.py b/src/cloudflare/types/dns/smimea_record_param.py index ce121a41674..45fb99c8700 100644 --- a/src/cloudflare/types/dns/smimea_record_param.py +++ b/src/cloudflare/types/dns/smimea_record_param.py @@ -8,7 +8,7 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["SMIMEARecordParam", "Data"] +__all__ = ["SMIMEARecordParam", "Data", "Settings"] class Data(TypedDict, total=False): @@ -25,6 +25,24 @@ class Data(TypedDict, total=False): """Usage.""" +class Settings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class SMIMEARecordParam(TypedDict, total=False): comment: str """Comments or notes about the DNS record. @@ -44,6 +62,9 @@ class SMIMEARecordParam(TypedDict, total=False): Cloudflare. """ + settings: Settings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/srv_record.py b/src/cloudflare/types/dns/srv_record.py index 5be06e73406..add58ecb3c5 100644 --- a/src/cloudflare/types/dns/srv_record.py +++ b/src/cloudflare/types/dns/srv_record.py @@ -7,7 +7,7 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["SRVRecord", "Data"] +__all__ = ["SRVRecord", "Data", "Settings"] class Data(BaseModel): @@ -27,6 +27,24 @@ class Data(BaseModel): """The record weight.""" +class Settings(BaseModel): + ipv4_only: Optional[bool] = None + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: Optional[bool] = None + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class SRVRecord(BaseModel): comment: Optional[str] = None """Comments or notes about the DNS record. @@ -52,6 +70,9 @@ class SRVRecord(BaseModel): Cloudflare. """ + settings: Optional[Settings] = None + """Settings for the DNS record.""" + tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/srv_record_param.py b/src/cloudflare/types/dns/srv_record_param.py index 69812aa320e..a451de23711 100644 --- a/src/cloudflare/types/dns/srv_record_param.py +++ b/src/cloudflare/types/dns/srv_record_param.py @@ -8,7 +8,7 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["SRVRecordParam", "Data"] +__all__ = ["SRVRecordParam", "Data", "Settings"] class Data(TypedDict, total=False): @@ -28,6 +28,24 @@ class Data(TypedDict, total=False): """The record weight.""" +class Settings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class SRVRecordParam(TypedDict, total=False): comment: str """Comments or notes about the DNS record. @@ -47,6 +65,9 @@ class SRVRecordParam(TypedDict, total=False): Cloudflare. """ + settings: Settings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/sshfp_record.py b/src/cloudflare/types/dns/sshfp_record.py index 855c412d9c6..cc8082194a4 100644 --- a/src/cloudflare/types/dns/sshfp_record.py +++ b/src/cloudflare/types/dns/sshfp_record.py @@ -7,7 +7,7 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["SSHFPRecord", "Data"] +__all__ = ["SSHFPRecord", "Data", "Settings"] class Data(BaseModel): @@ -21,6 +21,24 @@ class Data(BaseModel): """type.""" +class Settings(BaseModel): + ipv4_only: Optional[bool] = None + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: Optional[bool] = None + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class SSHFPRecord(BaseModel): comment: Optional[str] = None """Comments or notes about the DNS record. @@ -43,6 +61,9 @@ class SSHFPRecord(BaseModel): Cloudflare. """ + settings: Optional[Settings] = None + """Settings for the DNS record.""" + tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/sshfp_record_param.py b/src/cloudflare/types/dns/sshfp_record_param.py index 90bced65ccd..1f76cd1426b 100644 --- a/src/cloudflare/types/dns/sshfp_record_param.py +++ b/src/cloudflare/types/dns/sshfp_record_param.py @@ -8,7 +8,7 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["SSHFPRecordParam", "Data"] +__all__ = ["SSHFPRecordParam", "Data", "Settings"] class Data(TypedDict, total=False): @@ -22,6 +22,24 @@ class Data(TypedDict, total=False): """type.""" +class Settings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class SSHFPRecordParam(TypedDict, total=False): comment: str """Comments or notes about the DNS record. @@ -41,6 +59,9 @@ class SSHFPRecordParam(TypedDict, total=False): Cloudflare. """ + settings: Settings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/svcb_record.py b/src/cloudflare/types/dns/svcb_record.py index 57e4bfa4b62..9daf5db47e4 100644 --- a/src/cloudflare/types/dns/svcb_record.py +++ b/src/cloudflare/types/dns/svcb_record.py @@ -7,7 +7,7 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["SVCBRecord", "Data"] +__all__ = ["SVCBRecord", "Data", "Settings"] class Data(BaseModel): @@ -21,6 +21,24 @@ class Data(BaseModel): """value.""" +class Settings(BaseModel): + ipv4_only: Optional[bool] = None + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: Optional[bool] = None + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class SVCBRecord(BaseModel): comment: Optional[str] = None """Comments or notes about the DNS record. @@ -43,6 +61,9 @@ class SVCBRecord(BaseModel): Cloudflare. """ + settings: Optional[Settings] = None + """Settings for the DNS record.""" + tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/svcb_record_param.py b/src/cloudflare/types/dns/svcb_record_param.py index e96d13d1bf3..d82b6b1fa75 100644 --- a/src/cloudflare/types/dns/svcb_record_param.py +++ b/src/cloudflare/types/dns/svcb_record_param.py @@ -8,7 +8,7 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["SVCBRecordParam", "Data"] +__all__ = ["SVCBRecordParam", "Data", "Settings"] class Data(TypedDict, total=False): @@ -22,6 +22,24 @@ class Data(TypedDict, total=False): """value.""" +class Settings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class SVCBRecordParam(TypedDict, total=False): comment: str """Comments or notes about the DNS record. @@ -41,6 +59,9 @@ class SVCBRecordParam(TypedDict, total=False): Cloudflare. """ + settings: Settings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/tlsa_record.py b/src/cloudflare/types/dns/tlsa_record.py index a822b971be1..f87a2bf2e98 100644 --- a/src/cloudflare/types/dns/tlsa_record.py +++ b/src/cloudflare/types/dns/tlsa_record.py @@ -7,7 +7,7 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["TLSARecord", "Data"] +__all__ = ["TLSARecord", "Data", "Settings"] class Data(BaseModel): @@ -24,6 +24,24 @@ class Data(BaseModel): """Usage.""" +class Settings(BaseModel): + ipv4_only: Optional[bool] = None + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: Optional[bool] = None + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class TLSARecord(BaseModel): comment: Optional[str] = None """Comments or notes about the DNS record. @@ -46,6 +64,9 @@ class TLSARecord(BaseModel): Cloudflare. """ + settings: Optional[Settings] = None + """Settings for the DNS record.""" + tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/tlsa_record_param.py b/src/cloudflare/types/dns/tlsa_record_param.py index 9ee66f2ec8d..8ccad170c08 100644 --- a/src/cloudflare/types/dns/tlsa_record_param.py +++ b/src/cloudflare/types/dns/tlsa_record_param.py @@ -8,7 +8,7 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["TLSARecordParam", "Data"] +__all__ = ["TLSARecordParam", "Data", "Settings"] class Data(TypedDict, total=False): @@ -25,6 +25,24 @@ class Data(TypedDict, total=False): """Usage.""" +class Settings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class TLSARecordParam(TypedDict, total=False): comment: str """Comments or notes about the DNS record. @@ -44,6 +62,9 @@ class TLSARecordParam(TypedDict, total=False): Cloudflare. """ + settings: Settings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/txt_record.py b/src/cloudflare/types/dns/txt_record.py index 065a97c8938..77e0cba8c67 100644 --- a/src/cloudflare/types/dns/txt_record.py +++ b/src/cloudflare/types/dns/txt_record.py @@ -7,7 +7,25 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["TXTRecord"] +__all__ = ["TXTRecord", "Settings"] + + +class Settings(BaseModel): + ipv4_only: Optional[bool] = None + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: Optional[bool] = None + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ class TXTRecord(BaseModel): @@ -37,6 +55,9 @@ class TXTRecord(BaseModel): Cloudflare. """ + settings: Optional[Settings] = None + """Settings for the DNS record.""" + tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/txt_record_param.py b/src/cloudflare/types/dns/txt_record_param.py index 4395ac4bcee..b17a8385426 100644 --- a/src/cloudflare/types/dns/txt_record_param.py +++ b/src/cloudflare/types/dns/txt_record_param.py @@ -8,7 +8,25 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["TXTRecordParam"] +__all__ = ["TXTRecordParam", "Settings"] + + +class Settings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ class TXTRecordParam(TypedDict, total=False): @@ -38,6 +56,9 @@ class TXTRecordParam(TypedDict, total=False): Cloudflare. """ + settings: Settings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/uri_record.py b/src/cloudflare/types/dns/uri_record.py index b3d45461850..d281d0c6d28 100644 --- a/src/cloudflare/types/dns/uri_record.py +++ b/src/cloudflare/types/dns/uri_record.py @@ -7,7 +7,7 @@ from ..._models import BaseModel from .record_tags import RecordTags -__all__ = ["URIRecord", "Data"] +__all__ = ["URIRecord", "Data", "Settings"] class Data(BaseModel): @@ -18,6 +18,24 @@ class Data(BaseModel): """The record weight.""" +class Settings(BaseModel): + ipv4_only: Optional[bool] = None + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: Optional[bool] = None + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class URIRecord(BaseModel): comment: Optional[str] = None """Comments or notes about the DNS record. @@ -46,6 +64,9 @@ class URIRecord(BaseModel): Cloudflare. """ + settings: Optional[Settings] = None + """Settings for the DNS record.""" + tags: Optional[List[RecordTags]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/dns/uri_record_param.py b/src/cloudflare/types/dns/uri_record_param.py index 59aafdfd3bc..4995b415771 100644 --- a/src/cloudflare/types/dns/uri_record_param.py +++ b/src/cloudflare/types/dns/uri_record_param.py @@ -8,7 +8,7 @@ from .ttl_param import TTLParam from .record_tags import RecordTags -__all__ = ["URIRecordParam", "Data"] +__all__ = ["URIRecordParam", "Data", "Settings"] class Data(TypedDict, total=False): @@ -19,6 +19,24 @@ class Data(TypedDict, total=False): """The record weight.""" +class Settings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + class URIRecordParam(TypedDict, total=False): comment: str """Comments or notes about the DNS record. @@ -44,6 +62,9 @@ class URIRecordParam(TypedDict, total=False): Cloudflare. """ + settings: Settings + """Settings for the DNS record.""" + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" diff --git a/src/cloudflare/types/email_security/investigate/preview_create_response.py b/src/cloudflare/types/email_security/investigate/preview_create_response.py index decc493cddc..21d6b0ca34a 100644 --- a/src/cloudflare/types/email_security/investigate/preview_create_response.py +++ b/src/cloudflare/types/email_security/investigate/preview_create_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from ...._models import BaseModel @@ -9,5 +8,4 @@ class PreviewCreateResponse(BaseModel): screenshot: str - - error: Optional[str] = None + """A base64 encoded PNG image of the email.""" diff --git a/src/cloudflare/types/email_security/settings/block_sender_create_params.py b/src/cloudflare/types/email_security/settings/block_sender_create_params.py index 1408cb0674c..dc5290d600f 100644 --- a/src/cloudflare/types/email_security/settings/block_sender_create_params.py +++ b/src/cloudflare/types/email_security/settings/block_sender_create_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing import Union, Iterable, Optional -from typing_extensions import Literal, Required, TypeAlias, TypedDict +from typing import Optional +from typing_extensions import Literal, Required, TypedDict -__all__ = ["BlockSenderCreateParams", "EmailSecurityCreateBlockedSender", "Variant1", "Variant1Body"] +__all__ = ["BlockSenderCreateParams"] -class EmailSecurityCreateBlockedSender(TypedDict, total=False): +class BlockSenderCreateParams(TypedDict, total=False): account_id: Required[str] """Account Identifier""" @@ -19,23 +19,3 @@ class EmailSecurityCreateBlockedSender(TypedDict, total=False): pattern_type: Required[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]] comments: Optional[str] - - -class Variant1(TypedDict, total=False): - account_id: Required[str] - """Account Identifier""" - - body: Required[Iterable[Variant1Body]] - - -class Variant1Body(TypedDict, total=False): - is_regex: Required[bool] - - pattern: Required[str] - - pattern_type: Required[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]] - - comments: Optional[str] - - -BlockSenderCreateParams: TypeAlias = Union[EmailSecurityCreateBlockedSender, Variant1] diff --git a/src/cloudflare/types/email_security/settings/block_sender_create_response.py b/src/cloudflare/types/email_security/settings/block_sender_create_response.py index b3e80c9195e..615755f8fd7 100644 --- a/src/cloudflare/types/email_security/settings/block_sender_create_response.py +++ b/src/cloudflare/types/email_security/settings/block_sender_create_response.py @@ -1,16 +1,17 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional +from typing import Optional from datetime import datetime -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal from ...._models import BaseModel -__all__ = ["BlockSenderCreateResponse", "EmailSecurityBlockedSender", "UnionMember1"] +__all__ = ["BlockSenderCreateResponse"] -class EmailSecurityBlockedSender(BaseModel): +class BlockSenderCreateResponse(BaseModel): id: int + """The unique identifier for the allow policy.""" created_at: datetime @@ -23,22 +24,3 @@ class EmailSecurityBlockedSender(BaseModel): pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"] comments: Optional[str] = None - - -class UnionMember1(BaseModel): - id: int - - created_at: datetime - - is_regex: bool - - last_modified: datetime - - pattern: str - - pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"] - - comments: Optional[str] = None - - -BlockSenderCreateResponse: TypeAlias = Union[EmailSecurityBlockedSender, List[UnionMember1]] diff --git a/src/cloudflare/types/email_security/settings/block_sender_delete_response.py b/src/cloudflare/types/email_security/settings/block_sender_delete_response.py index 2dac65de0e7..f19dbd8d807 100644 --- a/src/cloudflare/types/email_security/settings/block_sender_delete_response.py +++ b/src/cloudflare/types/email_security/settings/block_sender_delete_response.py @@ -8,3 +8,4 @@ class BlockSenderDeleteResponse(BaseModel): id: int + """The unique identifier for the allow policy.""" diff --git a/src/cloudflare/types/email_security/settings/block_sender_edit_response.py b/src/cloudflare/types/email_security/settings/block_sender_edit_response.py index 55252960899..764d9fd5dee 100644 --- a/src/cloudflare/types/email_security/settings/block_sender_edit_response.py +++ b/src/cloudflare/types/email_security/settings/block_sender_edit_response.py @@ -11,6 +11,7 @@ class BlockSenderEditResponse(BaseModel): id: int + """The unique identifier for the allow policy.""" created_at: datetime diff --git a/src/cloudflare/types/email_security/settings/block_sender_get_response.py b/src/cloudflare/types/email_security/settings/block_sender_get_response.py index 5ec8429d4b8..66f03f3e3f6 100644 --- a/src/cloudflare/types/email_security/settings/block_sender_get_response.py +++ b/src/cloudflare/types/email_security/settings/block_sender_get_response.py @@ -11,6 +11,7 @@ class BlockSenderGetResponse(BaseModel): id: int + """The unique identifier for the allow policy.""" created_at: datetime diff --git a/src/cloudflare/types/email_security/settings/block_sender_list_response.py b/src/cloudflare/types/email_security/settings/block_sender_list_response.py index 3b30e018736..497ae4dc93d 100644 --- a/src/cloudflare/types/email_security/settings/block_sender_list_response.py +++ b/src/cloudflare/types/email_security/settings/block_sender_list_response.py @@ -11,6 +11,7 @@ class BlockSenderListResponse(BaseModel): id: int + """The unique identifier for the allow policy.""" created_at: datetime diff --git a/src/cloudflare/types/email_security/settings/impersonation_registry_create_params.py b/src/cloudflare/types/email_security/settings/impersonation_registry_create_params.py index 6afe1e4ecc2..db25db7e746 100644 --- a/src/cloudflare/types/email_security/settings/impersonation_registry_create_params.py +++ b/src/cloudflare/types/email_security/settings/impersonation_registry_create_params.py @@ -2,13 +2,12 @@ from __future__ import annotations -from typing import Union, Iterable -from typing_extensions import Required, TypeAlias, TypedDict +from typing_extensions import Required, TypedDict -__all__ = ["ImpersonationRegistryCreateParams", "EmailSecurityCreateDisplayName", "Variant1", "Variant1Body"] +__all__ = ["ImpersonationRegistryCreateParams"] -class EmailSecurityCreateDisplayName(TypedDict, total=False): +class ImpersonationRegistryCreateParams(TypedDict, total=False): account_id: Required[str] """Account Identifier""" @@ -17,21 +16,3 @@ class EmailSecurityCreateDisplayName(TypedDict, total=False): is_email_regex: Required[bool] name: Required[str] - - -class Variant1(TypedDict, total=False): - account_id: Required[str] - """Account Identifier""" - - body: Required[Iterable[Variant1Body]] - - -class Variant1Body(TypedDict, total=False): - email: Required[str] - - is_email_regex: Required[bool] - - name: Required[str] - - -ImpersonationRegistryCreateParams: TypeAlias = Union[EmailSecurityCreateDisplayName, Variant1] diff --git a/src/cloudflare/types/email_security/settings/impersonation_registry_create_response.py b/src/cloudflare/types/email_security/settings/impersonation_registry_create_response.py index 9a6c685fde3..c0dd1f55354 100644 --- a/src/cloudflare/types/email_security/settings/impersonation_registry_create_response.py +++ b/src/cloudflare/types/email_security/settings/impersonation_registry_create_response.py @@ -1,42 +1,19 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional +from typing import Optional from datetime import datetime -from typing_extensions import TypeAlias from ...._models import BaseModel -__all__ = ["ImpersonationRegistryCreateResponse", "EmailSecurityDisplayName", "UnionMember1"] +__all__ = ["ImpersonationRegistryCreateResponse"] -class EmailSecurityDisplayName(BaseModel): +class ImpersonationRegistryCreateResponse(BaseModel): id: int created_at: datetime - is_email_regex: bool - - last_modified: datetime - - name: str - - comments: Optional[str] = None - - directory_id: Optional[int] = None - - directory_node_id: Optional[int] = None - - email: Optional[str] = None - - external_directory_node_id: Optional[str] = None - - provenance: Optional[str] = None - - -class UnionMember1(BaseModel): - id: int - - created_at: datetime + email: str is_email_regex: bool @@ -50,11 +27,6 @@ class UnionMember1(BaseModel): directory_node_id: Optional[int] = None - email: Optional[str] = None - external_directory_node_id: Optional[str] = None provenance: Optional[str] = None - - -ImpersonationRegistryCreateResponse: TypeAlias = Union[EmailSecurityDisplayName, List[UnionMember1]] diff --git a/src/cloudflare/types/email_security/settings/impersonation_registry_edit_response.py b/src/cloudflare/types/email_security/settings/impersonation_registry_edit_response.py index 8555fe6e757..824a0946f7c 100644 --- a/src/cloudflare/types/email_security/settings/impersonation_registry_edit_response.py +++ b/src/cloudflare/types/email_security/settings/impersonation_registry_edit_response.py @@ -13,6 +13,8 @@ class ImpersonationRegistryEditResponse(BaseModel): created_at: datetime + email: str + is_email_regex: bool last_modified: datetime @@ -25,8 +27,6 @@ class ImpersonationRegistryEditResponse(BaseModel): directory_node_id: Optional[int] = None - email: Optional[str] = None - external_directory_node_id: Optional[str] = None provenance: Optional[str] = None diff --git a/src/cloudflare/types/email_security/settings/impersonation_registry_get_response.py b/src/cloudflare/types/email_security/settings/impersonation_registry_get_response.py index 2ffea2569d4..85a8ab50d71 100644 --- a/src/cloudflare/types/email_security/settings/impersonation_registry_get_response.py +++ b/src/cloudflare/types/email_security/settings/impersonation_registry_get_response.py @@ -13,6 +13,8 @@ class ImpersonationRegistryGetResponse(BaseModel): created_at: datetime + email: str + is_email_regex: bool last_modified: datetime @@ -25,8 +27,6 @@ class ImpersonationRegistryGetResponse(BaseModel): directory_node_id: Optional[int] = None - email: Optional[str] = None - external_directory_node_id: Optional[str] = None provenance: Optional[str] = None diff --git a/src/cloudflare/types/email_security/settings/impersonation_registry_list_response.py b/src/cloudflare/types/email_security/settings/impersonation_registry_list_response.py index d75829c8a05..800c8d4bfd7 100644 --- a/src/cloudflare/types/email_security/settings/impersonation_registry_list_response.py +++ b/src/cloudflare/types/email_security/settings/impersonation_registry_list_response.py @@ -13,6 +13,8 @@ class ImpersonationRegistryListResponse(BaseModel): created_at: datetime + email: str + is_email_regex: bool last_modified: datetime @@ -25,8 +27,6 @@ class ImpersonationRegistryListResponse(BaseModel): directory_node_id: Optional[int] = None - email: Optional[str] = None - external_directory_node_id: Optional[str] = None provenance: Optional[str] = None diff --git a/src/cloudflare/types/images/v1/variant_delete_response.py b/src/cloudflare/types/images/v1/variant_delete_response.py index 849e187534e..3b3a97038ec 100644 --- a/src/cloudflare/types/images/v1/variant_delete_response.py +++ b/src/cloudflare/types/images/v1/variant_delete_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union, Optional +from typing import Union from typing_extensions import TypeAlias __all__ = ["VariantDeleteResponse"] -VariantDeleteResponse: TypeAlias = Union[Optional[str], Optional[object]] +VariantDeleteResponse: TypeAlias = Union[str, object] diff --git a/src/cloudflare/types/images/v1_delete_response.py b/src/cloudflare/types/images/v1_delete_response.py index b616950e39c..0122c846f86 100644 --- a/src/cloudflare/types/images/v1_delete_response.py +++ b/src/cloudflare/types/images/v1_delete_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union, Optional +from typing import Union from typing_extensions import TypeAlias __all__ = ["V1DeleteResponse"] -V1DeleteResponse: TypeAlias = Union[Optional[str], Optional[object]] +V1DeleteResponse: TypeAlias = Union[str, object] diff --git a/src/cloudflare/types/logpush/__init__.py b/src/cloudflare/types/logpush/__init__.py index 2416eed9d38..8ae5b0ec652 100644 --- a/src/cloudflare/types/logpush/__init__.py +++ b/src/cloudflare/types/logpush/__init__.py @@ -19,3 +19,5 @@ from .ownership_validate_params import OwnershipValidateParams as OwnershipValidateParams from .validate_destination_params import ValidateDestinationParams as ValidateDestinationParams from .validate_destination_response import ValidateDestinationResponse as ValidateDestinationResponse +from .validate_destination_exists_params import ValidateDestinationExistsParams as ValidateDestinationExistsParams +from .validate_destination_exists_response import ValidateDestinationExistsResponse as ValidateDestinationExistsResponse diff --git a/src/cloudflare/types/logpush/job_update_params.py b/src/cloudflare/types/logpush/job_update_params.py index 857882c86bf..dda7f649121 100644 --- a/src/cloudflare/types/logpush/job_update_params.py +++ b/src/cloudflare/types/logpush/job_update_params.py @@ -79,6 +79,13 @@ class JobUpdateParams(TypedDict, total=False): available for jobs with `edge` as its kind. """ + name: Optional[str] + """Optional human readable job name. + + Not unique. Cloudflare suggests that you set this to a meaningful string, like + the domain name, to make it easier to identify your job. + """ + output_options: Optional[OutputOptionsParam] """The structured replacement for `logpull_options`. diff --git a/src/cloudflare/types/logpush/validate_destination_exists_params.py b/src/cloudflare/types/logpush/validate_destination_exists_params.py new file mode 100644 index 00000000000..a23ee805037 --- /dev/null +++ b/src/cloudflare/types/logpush/validate_destination_exists_params.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["ValidateDestinationExistsParams"] + + +class ValidateDestinationExistsParams(TypedDict, total=False): + destination_conf: Required[str] + """Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. + + Additional configuration parameters supported by the destination may be + included. + """ + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" diff --git a/src/cloudflare/types/logpush/validate_destination_exists_response.py b/src/cloudflare/types/logpush/validate_destination_exists_response.py new file mode 100644 index 00000000000..6a0d5189763 --- /dev/null +++ b/src/cloudflare/types/logpush/validate_destination_exists_response.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["ValidateDestinationExistsResponse"] + + +class ValidateDestinationExistsResponse(BaseModel): + exists: Optional[bool] = None diff --git a/src/cloudflare/types/logpush/validate_destination_response.py b/src/cloudflare/types/logpush/validate_destination_response.py index e7fe2fd5ea9..e47e8559eb0 100644 --- a/src/cloudflare/types/logpush/validate_destination_response.py +++ b/src/cloudflare/types/logpush/validate_destination_response.py @@ -8,4 +8,6 @@ class ValidateDestinationResponse(BaseModel): - exists: Optional[bool] = None + message: Optional[str] = None + + valid: Optional[bool] = None diff --git a/src/cloudflare/types/magic_transit/sites/acl.py b/src/cloudflare/types/magic_transit/sites/acl.py index 5565fc0f5c9..41429544d0f 100644 --- a/src/cloudflare/types/magic_transit/sites/acl.py +++ b/src/cloudflare/types/magic_transit/sites/acl.py @@ -32,3 +32,11 @@ class ACL(BaseModel): """The name of the ACL.""" protocols: Optional[List[AllowedProtocol]] = None + + unidirectional: Optional[bool] = None + """The desired traffic direction for this ACL policy. + + If set to "false", the policy will allow bidirectional traffic. If set to + "true", the policy will only allow traffic in one direction. If not included in + request, will default to false. + """ diff --git a/src/cloudflare/types/magic_transit/sites/acl_create_params.py b/src/cloudflare/types/magic_transit/sites/acl_create_params.py index 48b2d5f517b..c193c6d556c 100644 --- a/src/cloudflare/types/magic_transit/sites/acl_create_params.py +++ b/src/cloudflare/types/magic_transit/sites/acl_create_params.py @@ -34,3 +34,11 @@ class ACLCreateParams(TypedDict, total=False): """ protocols: List[AllowedProtocol] + + unidirectional: bool + """The desired traffic direction for this ACL policy. + + If set to "false", the policy will allow bidirectional traffic. If set to + "true", the policy will only allow traffic in one direction. If not included in + request, will default to false. + """ diff --git a/src/cloudflare/types/magic_transit/sites/acl_edit_params.py b/src/cloudflare/types/magic_transit/sites/acl_edit_params.py index 8a6c7b0f5c6..3280bbe53b2 100644 --- a/src/cloudflare/types/magic_transit/sites/acl_edit_params.py +++ b/src/cloudflare/types/magic_transit/sites/acl_edit_params.py @@ -37,3 +37,11 @@ class ACLEditParams(TypedDict, total=False): """The name of the ACL.""" protocols: List[AllowedProtocol] + + unidirectional: bool + """The desired traffic direction for this ACL policy. + + If set to "false", the policy will allow bidirectional traffic. If set to + "true", the policy will only allow traffic in one direction. If not included in + request, will default to false. + """ diff --git a/src/cloudflare/types/magic_transit/sites/acl_update_params.py b/src/cloudflare/types/magic_transit/sites/acl_update_params.py index 5abc70c2329..250ed85c126 100644 --- a/src/cloudflare/types/magic_transit/sites/acl_update_params.py +++ b/src/cloudflare/types/magic_transit/sites/acl_update_params.py @@ -37,3 +37,11 @@ class ACLUpdateParams(TypedDict, total=False): """The name of the ACL.""" protocols: List[AllowedProtocol] + + unidirectional: bool + """The desired traffic direction for this ACL policy. + + If set to "false", the policy will allow bidirectional traffic. If set to + "true", the policy will only allow traffic in one direction. If not included in + request, will default to false. + """ diff --git a/src/cloudflare/types/magic_transit/sites/wan.py b/src/cloudflare/types/magic_transit/sites/wan.py index 1148e9f087f..dc8378ae312 100644 --- a/src/cloudflare/types/magic_transit/sites/wan.py +++ b/src/cloudflare/types/magic_transit/sites/wan.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional +from typing_extensions import Literal from ...._models import BaseModel from .wan_static_addressing import WANStaticAddressing @@ -12,6 +13,12 @@ class WAN(BaseModel): id: Optional[str] = None """Identifier""" + health_check_rate: Optional[Literal["low", "mid", "high"]] = None + """Magic WAN health check rate for tunnels created on this link. + + The default value is `mid`. + """ + name: Optional[str] = None physport: Optional[int] = None diff --git a/src/cloudflare/types/managed_transforms/__init__.py b/src/cloudflare/types/managed_transforms/__init__.py index 09e75d9fc15..34117bfe591 100644 --- a/src/cloudflare/types/managed_transforms/__init__.py +++ b/src/cloudflare/types/managed_transforms/__init__.py @@ -2,8 +2,6 @@ from __future__ import annotations -from .request_model import RequestModel as RequestModel -from .request_model_param import RequestModelParam as RequestModelParam from .managed_transform_edit_params import ManagedTransformEditParams as ManagedTransformEditParams from .managed_transform_edit_response import ManagedTransformEditResponse as ManagedTransformEditResponse from .managed_transform_list_response import ManagedTransformListResponse as ManagedTransformListResponse diff --git a/src/cloudflare/types/managed_transforms/managed_transform_edit_params.py b/src/cloudflare/types/managed_transforms/managed_transform_edit_params.py index 3f45bc1e8ef..0d92ba91f8d 100644 --- a/src/cloudflare/types/managed_transforms/managed_transform_edit_params.py +++ b/src/cloudflare/types/managed_transforms/managed_transform_edit_params.py @@ -5,15 +5,31 @@ from typing import Iterable from typing_extensions import Required, TypedDict -from .request_model_param import RequestModelParam - -__all__ = ["ManagedTransformEditParams"] +__all__ = ["ManagedTransformEditParams", "ManagedRequestHeader", "ManagedResponseHeader"] class ManagedTransformEditParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" + """The unique ID of the zone.""" + + managed_request_headers: Required[Iterable[ManagedRequestHeader]] + """The list of Managed Request Transforms.""" + + managed_response_headers: Required[Iterable[ManagedResponseHeader]] + """The list of Managed Response Transforms.""" + + +class ManagedRequestHeader(TypedDict, total=False): + id: Required[str] + """The human-readable identifier of the Managed Transform.""" + + enabled: Required[bool] + """Whether the Managed Transform is enabled.""" + - managed_request_headers: Required[Iterable[RequestModelParam]] +class ManagedResponseHeader(TypedDict, total=False): + id: Required[str] + """The human-readable identifier of the Managed Transform.""" - managed_response_headers: Required[Iterable[RequestModelParam]] + enabled: Required[bool] + """Whether the Managed Transform is enabled.""" diff --git a/src/cloudflare/types/managed_transforms/managed_transform_edit_response.py b/src/cloudflare/types/managed_transforms/managed_transform_edit_response.py index 59fab379331..762945a848b 100644 --- a/src/cloudflare/types/managed_transforms/managed_transform_edit_response.py +++ b/src/cloudflare/types/managed_transforms/managed_transform_edit_response.py @@ -8,28 +8,42 @@ class ManagedRequestHeader(BaseModel): - id: Optional[str] = None - """Human-readable identifier of the Managed Transform.""" + id: str + """The human-readable identifier of the Managed Transform.""" - available: Optional[bool] = None - """When true, the Managed Transform is available in the current Cloudflare plan.""" + enabled: bool + """Whether the Managed Transform is enabled.""" - enabled: Optional[bool] = None - """When true, the Managed Transform is enabled.""" + has_conflict: bool + """ + Whether the Managed Transform conflicts with the currently-enabled Managed + Transforms. + """ + + conflicts_with: Optional[List[str]] = None + """The Managed Transforms that this Managed Transform conflicts with.""" class ManagedResponseHeader(BaseModel): - id: Optional[str] = None - """Human-readable identifier of the Managed Transform.""" + id: str + """The human-readable identifier of the Managed Transform.""" + + enabled: bool + """Whether the Managed Transform is enabled.""" - available: Optional[bool] = None - """When true, the Managed Transform is available in the current Cloudflare plan.""" + has_conflict: bool + """ + Whether the Managed Transform conflicts with the currently-enabled Managed + Transforms. + """ - enabled: Optional[bool] = None - """When true, the Managed Transform is enabled.""" + conflicts_with: Optional[List[str]] = None + """The Managed Transforms that this Managed Transform conflicts with.""" class ManagedTransformEditResponse(BaseModel): - managed_request_headers: Optional[List[ManagedRequestHeader]] = None + managed_request_headers: List[ManagedRequestHeader] + """The list of Managed Request Transforms.""" - managed_response_headers: Optional[List[ManagedResponseHeader]] = None + managed_response_headers: List[ManagedResponseHeader] + """The list of Managed Response Transforms.""" diff --git a/src/cloudflare/types/managed_transforms/managed_transform_list_response.py b/src/cloudflare/types/managed_transforms/managed_transform_list_response.py index dfc3ffc7171..c9c5f5c4af2 100644 --- a/src/cloudflare/types/managed_transforms/managed_transform_list_response.py +++ b/src/cloudflare/types/managed_transforms/managed_transform_list_response.py @@ -3,12 +3,47 @@ from typing import List, Optional from ..._models import BaseModel -from .request_model import RequestModel -__all__ = ["ManagedTransformListResponse"] +__all__ = ["ManagedTransformListResponse", "ManagedRequestHeader", "ManagedResponseHeader"] + + +class ManagedRequestHeader(BaseModel): + id: str + """The human-readable identifier of the Managed Transform.""" + + enabled: bool + """Whether the Managed Transform is enabled.""" + + has_conflict: bool + """ + Whether the Managed Transform conflicts with the currently-enabled Managed + Transforms. + """ + + conflicts_with: Optional[List[str]] = None + """The Managed Transforms that this Managed Transform conflicts with.""" + + +class ManagedResponseHeader(BaseModel): + id: str + """The human-readable identifier of the Managed Transform.""" + + enabled: bool + """Whether the Managed Transform is enabled.""" + + has_conflict: bool + """ + Whether the Managed Transform conflicts with the currently-enabled Managed + Transforms. + """ + + conflicts_with: Optional[List[str]] = None + """The Managed Transforms that this Managed Transform conflicts with.""" class ManagedTransformListResponse(BaseModel): - managed_request_headers: Optional[List[RequestModel]] = None + managed_request_headers: List[ManagedRequestHeader] + """The list of Managed Request Transforms.""" - managed_response_headers: Optional[List[RequestModel]] = None + managed_response_headers: List[ManagedResponseHeader] + """The list of Managed Response Transforms.""" diff --git a/src/cloudflare/types/managed_transforms/request_model.py b/src/cloudflare/types/managed_transforms/request_model.py deleted file mode 100644 index 281db0613d3..00000000000 --- a/src/cloudflare/types/managed_transforms/request_model.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["RequestModel"] - - -class RequestModel(BaseModel): - id: Optional[str] = None - """Human-readable identifier of the Managed Transform.""" - - enabled: Optional[bool] = None - """When true, the Managed Transform is enabled.""" diff --git a/src/cloudflare/types/managed_transforms/request_model_param.py b/src/cloudflare/types/managed_transforms/request_model_param.py deleted file mode 100644 index d207b5bf111..00000000000 --- a/src/cloudflare/types/managed_transforms/request_model_param.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -__all__ = ["RequestModelParam"] - - -class RequestModelParam(TypedDict, total=False): - id: str - """Human-readable identifier of the Managed Transform.""" - - enabled: bool - """When true, the Managed Transform is enabled.""" diff --git a/src/cloudflare/types/origin_post_quantum_encryption/origin_post_quantum_encryption_get_response.py b/src/cloudflare/types/origin_post_quantum_encryption/origin_post_quantum_encryption_get_response.py index 6f1aa4dca49..160be05baa8 100644 --- a/src/cloudflare/types/origin_post_quantum_encryption/origin_post_quantum_encryption_get_response.py +++ b/src/cloudflare/types/origin_post_quantum_encryption/origin_post_quantum_encryption_get_response.py @@ -1,8 +1,23 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union, Optional -from typing_extensions import TypeAlias +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel __all__ = ["OriginPostQuantumEncryptionGetResponse"] -OriginPostQuantumEncryptionGetResponse: TypeAlias = Union[Optional[str], Optional[object]] + +class OriginPostQuantumEncryptionGetResponse(BaseModel): + id: Literal["origin_pqe"] + """Value of the zone setting.""" + + editable: bool + """Whether the setting is editable""" + + value: Literal["preferred", "supported", "off"] + """The value of the feature""" + + modified_on: Optional[datetime] = None + """Last time this setting was modified.""" diff --git a/src/cloudflare/types/origin_post_quantum_encryption/origin_post_quantum_encryption_update_response.py b/src/cloudflare/types/origin_post_quantum_encryption/origin_post_quantum_encryption_update_response.py index bfc6dab7036..f2ec8775f16 100644 --- a/src/cloudflare/types/origin_post_quantum_encryption/origin_post_quantum_encryption_update_response.py +++ b/src/cloudflare/types/origin_post_quantum_encryption/origin_post_quantum_encryption_update_response.py @@ -1,8 +1,23 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union, Optional -from typing_extensions import TypeAlias +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel __all__ = ["OriginPostQuantumEncryptionUpdateResponse"] -OriginPostQuantumEncryptionUpdateResponse: TypeAlias = Union[Optional[str], Optional[object]] + +class OriginPostQuantumEncryptionUpdateResponse(BaseModel): + id: Literal["origin_pqe"] + """Value of the zone setting.""" + + editable: bool + """Whether the setting is editable""" + + value: Literal["preferred", "supported", "off"] + """The value of the feature""" + + modified_on: Optional[datetime] = None + """Last time this setting was modified.""" diff --git a/src/cloudflare/types/page_rules/page_rule.py b/src/cloudflare/types/page_rules/page_rule.py index 3792ea151f9..64a7fa0508c 100644 --- a/src/cloudflare/types/page_rules/page_rule.py +++ b/src/cloudflare/types/page_rules/page_rule.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional +from typing import Dict, List, Union, Optional from datetime import datetime from typing_extensions import Literal, Annotated, TypeAlias @@ -32,14 +32,15 @@ "ActionBypassCacheOnCookie", "ActionCacheByDeviceType", "ActionCacheDeceptionArmor", - "ActionCacheKey", - "ActionCacheKeyValue", - "ActionCacheKeyValueCookie", - "ActionCacheKeyValueHeader", - "ActionCacheKeyValueHost", - "ActionCacheKeyValueQueryString", - "ActionCacheKeyValueUser", + "ActionCacheKeyFields", + "ActionCacheKeyFieldsValue", + "ActionCacheKeyFieldsValueCookie", + "ActionCacheKeyFieldsValueHeader", + "ActionCacheKeyFieldsValueHost", + "ActionCacheKeyFieldsValueQueryString", + "ActionCacheKeyFieldsValueUser", "ActionCacheOnCookie", + "ActionCacheTTLByStatus", "ActionDisableApps", "ActionDisablePerformance", "ActionDisableSecurity", @@ -90,7 +91,7 @@ class ActionCacheDeceptionArmor(BaseModel): """The status of Cache Deception Armor.""" -class ActionCacheKeyValueCookie(BaseModel): +class ActionCacheKeyFieldsValueCookie(BaseModel): check_presence: Optional[List[str]] = None """ A list of cookies to check for the presence of, without including their actual @@ -101,7 +102,7 @@ class ActionCacheKeyValueCookie(BaseModel): """A list of cookies to include.""" -class ActionCacheKeyValueHeader(BaseModel): +class ActionCacheKeyFieldsValueHeader(BaseModel): check_presence: Optional[List[str]] = None """ A list of headers to check for the presence of, without including their actual @@ -115,12 +116,12 @@ class ActionCacheKeyValueHeader(BaseModel): """A list of headers to include.""" -class ActionCacheKeyValueHost(BaseModel): +class ActionCacheKeyFieldsValueHost(BaseModel): resolved: Optional[bool] = None """Whether to include the Host header in the HTTP request sent to the origin.""" -class ActionCacheKeyValueQueryString(BaseModel): +class ActionCacheKeyFieldsValueQueryString(BaseModel): exclude: Union[Literal["*"], List[str], None] = None """Ignore all query string parameters.""" @@ -128,7 +129,7 @@ class ActionCacheKeyValueQueryString(BaseModel): """Include all query string parameters.""" -class ActionCacheKeyValueUser(BaseModel): +class ActionCacheKeyFieldsValueUser(BaseModel): device_type: Optional[bool] = None """ Classifies a request as `mobile`, `desktop`, or `tablet` based on the User @@ -145,38 +146,38 @@ class ActionCacheKeyValueUser(BaseModel): """ -class ActionCacheKeyValue(BaseModel): - cookie: Optional[ActionCacheKeyValueCookie] = None +class ActionCacheKeyFieldsValue(BaseModel): + cookie: Optional[ActionCacheKeyFieldsValueCookie] = None """Controls which cookies appear in the Cache Key.""" - header: Optional[ActionCacheKeyValueHeader] = None + header: Optional[ActionCacheKeyFieldsValueHeader] = None """Controls which headers go into the Cache Key. Exactly one of `include` or `exclude` is expected. """ - host: Optional[ActionCacheKeyValueHost] = None + host: Optional[ActionCacheKeyFieldsValueHost] = None """Determines which host header to include in the Cache Key.""" - query_string: Optional[ActionCacheKeyValueQueryString] = None + query_string: Optional[ActionCacheKeyFieldsValueQueryString] = None """Controls which URL query string parameters go into the Cache Key. Exactly one of `include` or `exclude` is expected. """ - user: Optional[ActionCacheKeyValueUser] = None + user: Optional[ActionCacheKeyFieldsValueUser] = None """Feature fields to add features about the end-user (client) into the Cache Key.""" -class ActionCacheKey(BaseModel): - id: Optional[Literal["cache_key"]] = None +class ActionCacheKeyFields(BaseModel): + id: Optional[Literal["cache_key_fields"]] = None """ Control specifically what variables to include when deciding which resources to cache. This allows customers to determine what to cache based on something other than just the URL. """ - value: Optional[ActionCacheKeyValue] = None + value: Optional[ActionCacheKeyFieldsValue] = None class ActionCacheOnCookie(BaseModel): @@ -190,6 +191,36 @@ class ActionCacheOnCookie(BaseModel): """The regular expression to use for matching cookie names in the request.""" +class ActionCacheTTLByStatus(BaseModel): + id: Optional[Literal["cache_ttl_by_status"]] = None + """ + Enterprise customers can set cache time-to-live (TTL) based on the response + status from the origin web server. Cache TTL refers to the duration of a + resource in the Cloudflare network before being marked as stale or discarded + from cache. Status codes are returned by a resource's origin. Setting cache TTL + based on response status overrides the default cache behavior (standard caching) + for static files and overrides cache instructions sent by the origin web server. + To cache non-static assets, set a Cache Level of Cache Everything using a Page + Rule. Setting no-store Cache-Control or a low TTL (using `max-age`/`s-maxage`) + increases requests to origin web servers and decreases performance. + """ + + value: Optional[Dict[str, Union[Literal["no-cache", "no-store"], int]]] = None + """ + A JSON object containing status codes and their corresponding TTLs. Each + key-value pair in the cache TTL by status cache rule has the following syntax + + - `status_code`: An integer value such as 200 or 500. status_code matches the + exact status code from the origin web server. Valid status codes are between + 100-999. + - `status_code_range`: Integer values for from and to. status_code_range matches + any status code from the origin web server within the specified range. + - `value`: An integer value that defines the duration an asset is valid in + seconds or one of the following strings: no-store (equivalent to -1), no-cache + (equivalent to 0). + """ + + class ActionDisableApps(BaseModel): id: Optional[Literal["disable_apps"]] = None """ @@ -309,9 +340,10 @@ class ActionRespectStrongEtag(BaseModel): ActionBypassCacheOnCookie, ActionCacheByDeviceType, ActionCacheDeceptionArmor, - ActionCacheKey, + ActionCacheKeyFields, CacheLevel, ActionCacheOnCookie, + ActionCacheTTLByStatus, ActionDisableApps, ActionDisablePerformance, ActionDisableSecurity, diff --git a/src/cloudflare/types/page_rules/page_rule_create_params.py b/src/cloudflare/types/page_rules/page_rule_create_params.py index 7a3dbc4fcf9..9a137919711 100644 --- a/src/cloudflare/types/page_rules/page_rule_create_params.py +++ b/src/cloudflare/types/page_rules/page_rule_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Union, Iterable +from typing import Dict, List, Union, Iterable from typing_extensions import Literal, Required, TypeAlias, TypedDict from .target_param import TargetParam @@ -31,14 +31,15 @@ "ActionBypassCacheOnCookie", "ActionCacheByDeviceType", "ActionCacheDeceptionArmor", - "ActionCacheKey", - "ActionCacheKeyValue", - "ActionCacheKeyValueCookie", - "ActionCacheKeyValueHeader", - "ActionCacheKeyValueHost", - "ActionCacheKeyValueQueryString", - "ActionCacheKeyValueUser", + "ActionCacheKeyFields", + "ActionCacheKeyFieldsValue", + "ActionCacheKeyFieldsValueCookie", + "ActionCacheKeyFieldsValueHeader", + "ActionCacheKeyFieldsValueHost", + "ActionCacheKeyFieldsValueQueryString", + "ActionCacheKeyFieldsValueUser", "ActionCacheOnCookie", + "ActionCacheTTLByStatus", "ActionDisableApps", "ActionDisablePerformance", "ActionDisableSecurity", @@ -115,7 +116,7 @@ class ActionCacheDeceptionArmor(TypedDict, total=False): """The status of Cache Deception Armor.""" -class ActionCacheKeyValueCookie(TypedDict, total=False): +class ActionCacheKeyFieldsValueCookie(TypedDict, total=False): check_presence: List[str] """ A list of cookies to check for the presence of, without including their actual @@ -126,7 +127,7 @@ class ActionCacheKeyValueCookie(TypedDict, total=False): """A list of cookies to include.""" -class ActionCacheKeyValueHeader(TypedDict, total=False): +class ActionCacheKeyFieldsValueHeader(TypedDict, total=False): check_presence: List[str] """ A list of headers to check for the presence of, without including their actual @@ -140,12 +141,12 @@ class ActionCacheKeyValueHeader(TypedDict, total=False): """A list of headers to include.""" -class ActionCacheKeyValueHost(TypedDict, total=False): +class ActionCacheKeyFieldsValueHost(TypedDict, total=False): resolved: bool """Whether to include the Host header in the HTTP request sent to the origin.""" -class ActionCacheKeyValueQueryString(TypedDict, total=False): +class ActionCacheKeyFieldsValueQueryString(TypedDict, total=False): exclude: Union[Literal["*"], List[str]] """Ignore all query string parameters.""" @@ -153,7 +154,7 @@ class ActionCacheKeyValueQueryString(TypedDict, total=False): """Include all query string parameters.""" -class ActionCacheKeyValueUser(TypedDict, total=False): +class ActionCacheKeyFieldsValueUser(TypedDict, total=False): device_type: bool """ Classifies a request as `mobile`, `desktop`, or `tablet` based on the User @@ -170,38 +171,38 @@ class ActionCacheKeyValueUser(TypedDict, total=False): """ -class ActionCacheKeyValue(TypedDict, total=False): - cookie: ActionCacheKeyValueCookie +class ActionCacheKeyFieldsValue(TypedDict, total=False): + cookie: ActionCacheKeyFieldsValueCookie """Controls which cookies appear in the Cache Key.""" - header: ActionCacheKeyValueHeader + header: ActionCacheKeyFieldsValueHeader """Controls which headers go into the Cache Key. Exactly one of `include` or `exclude` is expected. """ - host: ActionCacheKeyValueHost + host: ActionCacheKeyFieldsValueHost """Determines which host header to include in the Cache Key.""" - query_string: ActionCacheKeyValueQueryString + query_string: ActionCacheKeyFieldsValueQueryString """Controls which URL query string parameters go into the Cache Key. Exactly one of `include` or `exclude` is expected. """ - user: ActionCacheKeyValueUser + user: ActionCacheKeyFieldsValueUser """Feature fields to add features about the end-user (client) into the Cache Key.""" -class ActionCacheKey(TypedDict, total=False): - id: Literal["cache_key"] +class ActionCacheKeyFields(TypedDict, total=False): + id: Literal["cache_key_fields"] """ Control specifically what variables to include when deciding which resources to cache. This allows customers to determine what to cache based on something other than just the URL. """ - value: ActionCacheKeyValue + value: ActionCacheKeyFieldsValue class ActionCacheOnCookie(TypedDict, total=False): @@ -215,6 +216,36 @@ class ActionCacheOnCookie(TypedDict, total=False): """The regular expression to use for matching cookie names in the request.""" +class ActionCacheTTLByStatus(TypedDict, total=False): + id: Literal["cache_ttl_by_status"] + """ + Enterprise customers can set cache time-to-live (TTL) based on the response + status from the origin web server. Cache TTL refers to the duration of a + resource in the Cloudflare network before being marked as stale or discarded + from cache. Status codes are returned by a resource's origin. Setting cache TTL + based on response status overrides the default cache behavior (standard caching) + for static files and overrides cache instructions sent by the origin web server. + To cache non-static assets, set a Cache Level of Cache Everything using a Page + Rule. Setting no-store Cache-Control or a low TTL (using `max-age`/`s-maxage`) + increases requests to origin web servers and decreases performance. + """ + + value: Dict[str, Union[Literal["no-cache", "no-store"], int]] + """ + A JSON object containing status codes and their corresponding TTLs. Each + key-value pair in the cache TTL by status cache rule has the following syntax + + - `status_code`: An integer value such as 200 or 500. status_code matches the + exact status code from the origin web server. Valid status codes are between + 100-999. + - `status_code_range`: Integer values for from and to. status_code_range matches + any status code from the origin web server within the specified range. + - `value`: An integer value that defines the duration an asset is valid in + seconds or one of the following strings: no-store (equivalent to -1), no-cache + (equivalent to 0). + """ + + class ActionDisableApps(TypedDict, total=False): id: Literal["disable_apps"] """ @@ -333,9 +364,10 @@ class ActionRespectStrongEtag(TypedDict, total=False): ActionBypassCacheOnCookie, ActionCacheByDeviceType, ActionCacheDeceptionArmor, - ActionCacheKey, + ActionCacheKeyFields, CacheLevelParam, ActionCacheOnCookie, + ActionCacheTTLByStatus, ActionDisableApps, ActionDisablePerformance, ActionDisableSecurity, diff --git a/src/cloudflare/types/page_rules/page_rule_edit_params.py b/src/cloudflare/types/page_rules/page_rule_edit_params.py index fe7c599ea02..ea3b103842d 100644 --- a/src/cloudflare/types/page_rules/page_rule_edit_params.py +++ b/src/cloudflare/types/page_rules/page_rule_edit_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Union, Iterable +from typing import Dict, List, Union, Iterable from typing_extensions import Literal, Required, TypeAlias, TypedDict from .target_param import TargetParam @@ -31,14 +31,15 @@ "ActionBypassCacheOnCookie", "ActionCacheByDeviceType", "ActionCacheDeceptionArmor", - "ActionCacheKey", - "ActionCacheKeyValue", - "ActionCacheKeyValueCookie", - "ActionCacheKeyValueHeader", - "ActionCacheKeyValueHost", - "ActionCacheKeyValueQueryString", - "ActionCacheKeyValueUser", + "ActionCacheKeyFields", + "ActionCacheKeyFieldsValue", + "ActionCacheKeyFieldsValueCookie", + "ActionCacheKeyFieldsValueHeader", + "ActionCacheKeyFieldsValueHost", + "ActionCacheKeyFieldsValueQueryString", + "ActionCacheKeyFieldsValueUser", "ActionCacheOnCookie", + "ActionCacheTTLByStatus", "ActionDisableApps", "ActionDisablePerformance", "ActionDisableSecurity", @@ -115,7 +116,7 @@ class ActionCacheDeceptionArmor(TypedDict, total=False): """The status of Cache Deception Armor.""" -class ActionCacheKeyValueCookie(TypedDict, total=False): +class ActionCacheKeyFieldsValueCookie(TypedDict, total=False): check_presence: List[str] """ A list of cookies to check for the presence of, without including their actual @@ -126,7 +127,7 @@ class ActionCacheKeyValueCookie(TypedDict, total=False): """A list of cookies to include.""" -class ActionCacheKeyValueHeader(TypedDict, total=False): +class ActionCacheKeyFieldsValueHeader(TypedDict, total=False): check_presence: List[str] """ A list of headers to check for the presence of, without including their actual @@ -140,12 +141,12 @@ class ActionCacheKeyValueHeader(TypedDict, total=False): """A list of headers to include.""" -class ActionCacheKeyValueHost(TypedDict, total=False): +class ActionCacheKeyFieldsValueHost(TypedDict, total=False): resolved: bool """Whether to include the Host header in the HTTP request sent to the origin.""" -class ActionCacheKeyValueQueryString(TypedDict, total=False): +class ActionCacheKeyFieldsValueQueryString(TypedDict, total=False): exclude: Union[Literal["*"], List[str]] """Ignore all query string parameters.""" @@ -153,7 +154,7 @@ class ActionCacheKeyValueQueryString(TypedDict, total=False): """Include all query string parameters.""" -class ActionCacheKeyValueUser(TypedDict, total=False): +class ActionCacheKeyFieldsValueUser(TypedDict, total=False): device_type: bool """ Classifies a request as `mobile`, `desktop`, or `tablet` based on the User @@ -170,38 +171,38 @@ class ActionCacheKeyValueUser(TypedDict, total=False): """ -class ActionCacheKeyValue(TypedDict, total=False): - cookie: ActionCacheKeyValueCookie +class ActionCacheKeyFieldsValue(TypedDict, total=False): + cookie: ActionCacheKeyFieldsValueCookie """Controls which cookies appear in the Cache Key.""" - header: ActionCacheKeyValueHeader + header: ActionCacheKeyFieldsValueHeader """Controls which headers go into the Cache Key. Exactly one of `include` or `exclude` is expected. """ - host: ActionCacheKeyValueHost + host: ActionCacheKeyFieldsValueHost """Determines which host header to include in the Cache Key.""" - query_string: ActionCacheKeyValueQueryString + query_string: ActionCacheKeyFieldsValueQueryString """Controls which URL query string parameters go into the Cache Key. Exactly one of `include` or `exclude` is expected. """ - user: ActionCacheKeyValueUser + user: ActionCacheKeyFieldsValueUser """Feature fields to add features about the end-user (client) into the Cache Key.""" -class ActionCacheKey(TypedDict, total=False): - id: Literal["cache_key"] +class ActionCacheKeyFields(TypedDict, total=False): + id: Literal["cache_key_fields"] """ Control specifically what variables to include when deciding which resources to cache. This allows customers to determine what to cache based on something other than just the URL. """ - value: ActionCacheKeyValue + value: ActionCacheKeyFieldsValue class ActionCacheOnCookie(TypedDict, total=False): @@ -215,6 +216,36 @@ class ActionCacheOnCookie(TypedDict, total=False): """The regular expression to use for matching cookie names in the request.""" +class ActionCacheTTLByStatus(TypedDict, total=False): + id: Literal["cache_ttl_by_status"] + """ + Enterprise customers can set cache time-to-live (TTL) based on the response + status from the origin web server. Cache TTL refers to the duration of a + resource in the Cloudflare network before being marked as stale or discarded + from cache. Status codes are returned by a resource's origin. Setting cache TTL + based on response status overrides the default cache behavior (standard caching) + for static files and overrides cache instructions sent by the origin web server. + To cache non-static assets, set a Cache Level of Cache Everything using a Page + Rule. Setting no-store Cache-Control or a low TTL (using `max-age`/`s-maxage`) + increases requests to origin web servers and decreases performance. + """ + + value: Dict[str, Union[Literal["no-cache", "no-store"], int]] + """ + A JSON object containing status codes and their corresponding TTLs. Each + key-value pair in the cache TTL by status cache rule has the following syntax + + - `status_code`: An integer value such as 200 or 500. status_code matches the + exact status code from the origin web server. Valid status codes are between + 100-999. + - `status_code_range`: Integer values for from and to. status_code_range matches + any status code from the origin web server within the specified range. + - `value`: An integer value that defines the duration an asset is valid in + seconds or one of the following strings: no-store (equivalent to -1), no-cache + (equivalent to 0). + """ + + class ActionDisableApps(TypedDict, total=False): id: Literal["disable_apps"] """ @@ -333,9 +364,10 @@ class ActionRespectStrongEtag(TypedDict, total=False): ActionBypassCacheOnCookie, ActionCacheByDeviceType, ActionCacheDeceptionArmor, - ActionCacheKey, + ActionCacheKeyFields, CacheLevelParam, ActionCacheOnCookie, + ActionCacheTTLByStatus, ActionDisableApps, ActionDisablePerformance, ActionDisableSecurity, diff --git a/src/cloudflare/types/page_rules/page_rule_update_params.py b/src/cloudflare/types/page_rules/page_rule_update_params.py index ceff13a48fe..9328f0540b8 100644 --- a/src/cloudflare/types/page_rules/page_rule_update_params.py +++ b/src/cloudflare/types/page_rules/page_rule_update_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Union, Iterable +from typing import Dict, List, Union, Iterable from typing_extensions import Literal, Required, TypeAlias, TypedDict from .target_param import TargetParam @@ -31,14 +31,15 @@ "ActionBypassCacheOnCookie", "ActionCacheByDeviceType", "ActionCacheDeceptionArmor", - "ActionCacheKey", - "ActionCacheKeyValue", - "ActionCacheKeyValueCookie", - "ActionCacheKeyValueHeader", - "ActionCacheKeyValueHost", - "ActionCacheKeyValueQueryString", - "ActionCacheKeyValueUser", + "ActionCacheKeyFields", + "ActionCacheKeyFieldsValue", + "ActionCacheKeyFieldsValueCookie", + "ActionCacheKeyFieldsValueHeader", + "ActionCacheKeyFieldsValueHost", + "ActionCacheKeyFieldsValueQueryString", + "ActionCacheKeyFieldsValueUser", "ActionCacheOnCookie", + "ActionCacheTTLByStatus", "ActionDisableApps", "ActionDisablePerformance", "ActionDisableSecurity", @@ -115,7 +116,7 @@ class ActionCacheDeceptionArmor(TypedDict, total=False): """The status of Cache Deception Armor.""" -class ActionCacheKeyValueCookie(TypedDict, total=False): +class ActionCacheKeyFieldsValueCookie(TypedDict, total=False): check_presence: List[str] """ A list of cookies to check for the presence of, without including their actual @@ -126,7 +127,7 @@ class ActionCacheKeyValueCookie(TypedDict, total=False): """A list of cookies to include.""" -class ActionCacheKeyValueHeader(TypedDict, total=False): +class ActionCacheKeyFieldsValueHeader(TypedDict, total=False): check_presence: List[str] """ A list of headers to check for the presence of, without including their actual @@ -140,12 +141,12 @@ class ActionCacheKeyValueHeader(TypedDict, total=False): """A list of headers to include.""" -class ActionCacheKeyValueHost(TypedDict, total=False): +class ActionCacheKeyFieldsValueHost(TypedDict, total=False): resolved: bool """Whether to include the Host header in the HTTP request sent to the origin.""" -class ActionCacheKeyValueQueryString(TypedDict, total=False): +class ActionCacheKeyFieldsValueQueryString(TypedDict, total=False): exclude: Union[Literal["*"], List[str]] """Ignore all query string parameters.""" @@ -153,7 +154,7 @@ class ActionCacheKeyValueQueryString(TypedDict, total=False): """Include all query string parameters.""" -class ActionCacheKeyValueUser(TypedDict, total=False): +class ActionCacheKeyFieldsValueUser(TypedDict, total=False): device_type: bool """ Classifies a request as `mobile`, `desktop`, or `tablet` based on the User @@ -170,38 +171,38 @@ class ActionCacheKeyValueUser(TypedDict, total=False): """ -class ActionCacheKeyValue(TypedDict, total=False): - cookie: ActionCacheKeyValueCookie +class ActionCacheKeyFieldsValue(TypedDict, total=False): + cookie: ActionCacheKeyFieldsValueCookie """Controls which cookies appear in the Cache Key.""" - header: ActionCacheKeyValueHeader + header: ActionCacheKeyFieldsValueHeader """Controls which headers go into the Cache Key. Exactly one of `include` or `exclude` is expected. """ - host: ActionCacheKeyValueHost + host: ActionCacheKeyFieldsValueHost """Determines which host header to include in the Cache Key.""" - query_string: ActionCacheKeyValueQueryString + query_string: ActionCacheKeyFieldsValueQueryString """Controls which URL query string parameters go into the Cache Key. Exactly one of `include` or `exclude` is expected. """ - user: ActionCacheKeyValueUser + user: ActionCacheKeyFieldsValueUser """Feature fields to add features about the end-user (client) into the Cache Key.""" -class ActionCacheKey(TypedDict, total=False): - id: Literal["cache_key"] +class ActionCacheKeyFields(TypedDict, total=False): + id: Literal["cache_key_fields"] """ Control specifically what variables to include when deciding which resources to cache. This allows customers to determine what to cache based on something other than just the URL. """ - value: ActionCacheKeyValue + value: ActionCacheKeyFieldsValue class ActionCacheOnCookie(TypedDict, total=False): @@ -215,6 +216,36 @@ class ActionCacheOnCookie(TypedDict, total=False): """The regular expression to use for matching cookie names in the request.""" +class ActionCacheTTLByStatus(TypedDict, total=False): + id: Literal["cache_ttl_by_status"] + """ + Enterprise customers can set cache time-to-live (TTL) based on the response + status from the origin web server. Cache TTL refers to the duration of a + resource in the Cloudflare network before being marked as stale or discarded + from cache. Status codes are returned by a resource's origin. Setting cache TTL + based on response status overrides the default cache behavior (standard caching) + for static files and overrides cache instructions sent by the origin web server. + To cache non-static assets, set a Cache Level of Cache Everything using a Page + Rule. Setting no-store Cache-Control or a low TTL (using `max-age`/`s-maxage`) + increases requests to origin web servers and decreases performance. + """ + + value: Dict[str, Union[Literal["no-cache", "no-store"], int]] + """ + A JSON object containing status codes and their corresponding TTLs. Each + key-value pair in the cache TTL by status cache rule has the following syntax + + - `status_code`: An integer value such as 200 or 500. status_code matches the + exact status code from the origin web server. Valid status codes are between + 100-999. + - `status_code_range`: Integer values for from and to. status_code_range matches + any status code from the origin web server within the specified range. + - `value`: An integer value that defines the duration an asset is valid in + seconds or one of the following strings: no-store (equivalent to -1), no-cache + (equivalent to 0). + """ + + class ActionDisableApps(TypedDict, total=False): id: Literal["disable_apps"] """ @@ -333,9 +364,10 @@ class ActionRespectStrongEtag(TypedDict, total=False): ActionBypassCacheOnCookie, ActionCacheByDeviceType, ActionCacheDeceptionArmor, - ActionCacheKey, + ActionCacheKeyFields, CacheLevelParam, ActionCacheOnCookie, + ActionCacheTTLByStatus, ActionDisableApps, ActionDisablePerformance, ActionDisableSecurity, diff --git a/src/cloudflare/types/r2/bucket_create_params.py b/src/cloudflare/types/r2/bucket_create_params.py index f3c106fa96f..2515c1d8a5c 100644 --- a/src/cloudflare/types/r2/bucket_create_params.py +++ b/src/cloudflare/types/r2/bucket_create_params.py @@ -22,5 +22,5 @@ class BucketCreateParams(TypedDict, total=False): storage_class: Annotated[Literal["Standard", "InfrequentAccess"], PropertyInfo(alias="storageClass")] """Storage class for newly uploaded objects, unless specified otherwise.""" - cf_r2_jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] + jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] """Creates the bucket in the provided jurisdiction""" diff --git a/src/cloudflare/types/r2/bucket_list_params.py b/src/cloudflare/types/r2/bucket_list_params.py index 81069cdc221..debb1a9c91d 100644 --- a/src/cloudflare/types/r2/bucket_list_params.py +++ b/src/cloudflare/types/r2/bucket_list_params.py @@ -37,5 +37,5 @@ class BucketListParams(TypedDict, total=False): start_after: str """Bucket name to start searching after. Buckets are ordered lexicographically.""" - cf_r2_jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] + jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] """Lists buckets in the provided jurisdiction""" diff --git a/src/cloudflare/types/r2/buckets/cors_update_params.py b/src/cloudflare/types/r2/buckets/cors_update_params.py index 3b88a5fea57..ad5b14f0775 100644 --- a/src/cloudflare/types/r2/buckets/cors_update_params.py +++ b/src/cloudflare/types/r2/buckets/cors_update_params.py @@ -16,7 +16,7 @@ class CORSUpdateParams(TypedDict, total=False): rules: Iterable[Rule] - cf_r2_jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] + jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] """The bucket jurisdiction""" diff --git a/src/cloudflare/types/r2/buckets/domains/custom_create_params.py b/src/cloudflare/types/r2/buckets/domains/custom_create_params.py index d975f7ddba6..304a30f83b6 100644 --- a/src/cloudflare/types/r2/buckets/domains/custom_create_params.py +++ b/src/cloudflare/types/r2/buckets/domains/custom_create_params.py @@ -31,5 +31,5 @@ class CustomCreateParams(TypedDict, total=False): If not set, defaults to 1.0. """ - cf_r2_jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] + jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] """The bucket jurisdiction""" diff --git a/src/cloudflare/types/r2/buckets/domains/custom_update_params.py b/src/cloudflare/types/r2/buckets/domains/custom_update_params.py index 874833c65b7..5719767b9bb 100644 --- a/src/cloudflare/types/r2/buckets/domains/custom_update_params.py +++ b/src/cloudflare/types/r2/buckets/domains/custom_update_params.py @@ -25,5 +25,5 @@ class CustomUpdateParams(TypedDict, total=False): If not set, defaults to previous value. """ - cf_r2_jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] + jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] """The bucket jurisdiction""" diff --git a/src/cloudflare/types/r2/buckets/domains/managed_update_params.py b/src/cloudflare/types/r2/buckets/domains/managed_update_params.py index 8e6546e1361..bf053372804 100644 --- a/src/cloudflare/types/r2/buckets/domains/managed_update_params.py +++ b/src/cloudflare/types/r2/buckets/domains/managed_update_params.py @@ -16,5 +16,5 @@ class ManagedUpdateParams(TypedDict, total=False): enabled: Required[bool] """Whether to enable public bucket access at the r2.dev domain""" - cf_r2_jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] + jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] """The bucket jurisdiction""" diff --git a/src/cloudflare/types/r2/buckets/event_notifications/configuration/queue_update_params.py b/src/cloudflare/types/r2/buckets/event_notifications/configuration/queue_update_params.py index 0de29620db4..6d0db95320f 100644 --- a/src/cloudflare/types/r2/buckets/event_notifications/configuration/queue_update_params.py +++ b/src/cloudflare/types/r2/buckets/event_notifications/configuration/queue_update_params.py @@ -20,7 +20,7 @@ class QueueUpdateParams(TypedDict, total=False): rules: Iterable[Rule] """Array of rules to drive notifications""" - cf_r2_jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] + jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] """The bucket jurisdiction""" diff --git a/src/cloudflare/types/r2/buckets/lifecycle_update_params.py b/src/cloudflare/types/r2/buckets/lifecycle_update_params.py index 0de8fab57b1..5ee16f78bab 100644 --- a/src/cloudflare/types/r2/buckets/lifecycle_update_params.py +++ b/src/cloudflare/types/r2/buckets/lifecycle_update_params.py @@ -31,7 +31,7 @@ class LifecycleUpdateParams(TypedDict, total=False): rules: Iterable[Rule] - cf_r2_jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] + jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] """The bucket jurisdiction""" diff --git a/src/cloudflare/types/r2/buckets/sippy_update_params.py b/src/cloudflare/types/r2/buckets/sippy_update_params.py index 3e40fe0fc31..b260ff4a373 100644 --- a/src/cloudflare/types/r2/buckets/sippy_update_params.py +++ b/src/cloudflare/types/r2/buckets/sippy_update_params.py @@ -29,7 +29,7 @@ class R2EnableSippyAws(TypedDict, total=False): source: R2EnableSippyAwsSource """AWS S3 bucket to copy objects from""" - cf_r2_jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] + jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] """The bucket jurisdiction""" @@ -83,7 +83,7 @@ class R2EnableSippyGcs(TypedDict, total=False): source: R2EnableSippyGcsSource """GCS bucket to copy objects from""" - cf_r2_jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] + jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] """The bucket jurisdiction""" diff --git a/src/cloudflare/types/radar/ai/bots/summary_user_agent_params.py b/src/cloudflare/types/radar/ai/bots/summary_user_agent_params.py index 1056e13c5b2..448b49a9f2c 100644 --- a/src/cloudflare/types/radar/ai/bots/summary_user_agent_params.py +++ b/src/cloudflare/types/radar/ai/bots/summary_user_agent_params.py @@ -42,6 +42,12 @@ class SummaryUserAgentParams(TypedDict, total=False): format: Literal["JSON", "CSV"] """Format results are returned in.""" + limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] + """ + Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + """ + location: List[str] """Array of comma separated list of locations (alpha-2 country codes). diff --git a/src/cloudflare/types/radar/ai/bots/summary_user_agent_response.py b/src/cloudflare/types/radar/ai/bots/summary_user_agent_response.py index b46f01345af..d47ce220214 100644 --- a/src/cloudflare/types/radar/ai/bots/summary_user_agent_response.py +++ b/src/cloudflare/types/radar/ai/bots/summary_user_agent_response.py @@ -53,4 +53,4 @@ class Meta(BaseModel): class SummaryUserAgentResponse(BaseModel): meta: Meta - summary_0: Dict[str, List[str]] + summary_0: Dict[str, str] diff --git a/src/cloudflare/types/radar/as112/summary_query_type_params.py b/src/cloudflare/types/radar/as112/summary_query_type_params.py index aea17cb0a58..6ff8f600ad8 100644 --- a/src/cloudflare/types/radar/as112/summary_query_type_params.py +++ b/src/cloudflare/types/radar/as112/summary_query_type_params.py @@ -42,6 +42,12 @@ class SummaryQueryTypeParams(TypedDict, total=False): format: Literal["JSON", "CSV"] """Format results are returned in.""" + limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] + """ + Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + """ + location: List[str] """Array of comma separated list of locations (alpha-2 country codes). diff --git a/src/cloudflare/types/radar/as112/summary_query_type_response.py b/src/cloudflare/types/radar/as112/summary_query_type_response.py index d5268d2eb3f..87baa9cd63b 100644 --- a/src/cloudflare/types/radar/as112/summary_query_type_response.py +++ b/src/cloudflare/types/radar/as112/summary_query_type_response.py @@ -1,20 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Dict, List, Optional from datetime import datetime from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = [ - "SummaryQueryTypeResponse", - "Meta", - "MetaDateRange", - "MetaConfidenceInfo", - "MetaConfidenceInfoAnnotation", - "Summary0", -] +__all__ = ["SummaryQueryTypeResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation"] class MetaDateRange(BaseModel): @@ -57,19 +50,7 @@ class Meta(BaseModel): confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) -class Summary0(BaseModel): - a: str = FieldInfo(alias="A") - - aaaa: str = FieldInfo(alias="AAAA") - - ptr: str = FieldInfo(alias="PTR") - - soa: str = FieldInfo(alias="SOA") - - srv: str = FieldInfo(alias="SRV") - - class SummaryQueryTypeResponse(BaseModel): meta: Meta - summary_0: Summary0 + summary_0: Dict[str, str] diff --git a/src/cloudflare/types/radar/as112/summary_response_codes_params.py b/src/cloudflare/types/radar/as112/summary_response_codes_params.py index 9579b04766e..1ee19186ded 100644 --- a/src/cloudflare/types/radar/as112/summary_response_codes_params.py +++ b/src/cloudflare/types/radar/as112/summary_response_codes_params.py @@ -42,6 +42,12 @@ class SummaryResponseCodesParams(TypedDict, total=False): format: Literal["JSON", "CSV"] """Format results are returned in.""" + limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] + """ + Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + """ + location: List[str] """Array of comma separated list of locations (alpha-2 country codes). diff --git a/src/cloudflare/types/radar/as112/summary_response_codes_response.py b/src/cloudflare/types/radar/as112/summary_response_codes_response.py index 9c916f07a98..f4e19fe4238 100644 --- a/src/cloudflare/types/radar/as112/summary_response_codes_response.py +++ b/src/cloudflare/types/radar/as112/summary_response_codes_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Dict, List, Optional from datetime import datetime from pydantic import Field as FieldInfo @@ -13,7 +13,6 @@ "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", - "Summary0", ] @@ -57,13 +56,7 @@ class Meta(BaseModel): confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) -class Summary0(BaseModel): - noerror: str = FieldInfo(alias="NOERROR") - - nxdomain: str = FieldInfo(alias="NXDOMAIN") - - class SummaryResponseCodesResponse(BaseModel): meta: Meta - summary_0: Summary0 + summary_0: Dict[str, str] diff --git a/src/cloudflare/types/radar/as112/timeseries_group_query_type_params.py b/src/cloudflare/types/radar/as112/timeseries_group_query_type_params.py index d83568fe1d3..cb0afb94023 100644 --- a/src/cloudflare/types/radar/as112/timeseries_group_query_type_params.py +++ b/src/cloudflare/types/radar/as112/timeseries_group_query_type_params.py @@ -49,6 +49,12 @@ class TimeseriesGroupQueryTypeParams(TypedDict, total=False): format: Literal["JSON", "CSV"] """Format results are returned in.""" + limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] + """ + Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + """ + location: List[str] """Array of comma separated list of locations (alpha-2 country codes). diff --git a/src/cloudflare/types/radar/as112/timeseries_group_response_codes_params.py b/src/cloudflare/types/radar/as112/timeseries_group_response_codes_params.py index 05cf4ac7fab..50fa3dd1979 100644 --- a/src/cloudflare/types/radar/as112/timeseries_group_response_codes_params.py +++ b/src/cloudflare/types/radar/as112/timeseries_group_response_codes_params.py @@ -49,6 +49,12 @@ class TimeseriesGroupResponseCodesParams(TypedDict, total=False): format: Literal["JSON", "CSV"] """Format results are returned in.""" + limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] + """ + Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + """ + location: List[str] """Array of comma separated list of locations (alpha-2 country codes). diff --git a/src/cloudflare/types/radar/attacks/layer3/summary_vector_params.py b/src/cloudflare/types/radar/attacks/layer3/summary_vector_params.py index 3da6f2912a7..55e3ea8a30a 100644 --- a/src/cloudflare/types/radar/attacks/layer3/summary_vector_params.py +++ b/src/cloudflare/types/radar/attacks/layer3/summary_vector_params.py @@ -44,6 +44,12 @@ class SummaryVectorParams(TypedDict, total=False): ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] """Filter for ip version.""" + limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] + """ + Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + """ + location: List[str] """Array of comma separated list of locations (alpha-2 country codes). diff --git a/src/cloudflare/types/radar/attacks/layer3/summary_vector_response.py b/src/cloudflare/types/radar/attacks/layer3/summary_vector_response.py index cf21e355719..7dd4becaf4b 100644 --- a/src/cloudflare/types/radar/attacks/layer3/summary_vector_response.py +++ b/src/cloudflare/types/radar/attacks/layer3/summary_vector_response.py @@ -53,4 +53,4 @@ class Meta(BaseModel): class SummaryVectorResponse(BaseModel): meta: Meta - summary_0: Dict[str, List[str]] + summary_0: Dict[str, str] diff --git a/src/cloudflare/types/radar/attacks/layer7/summary_http_method_params.py b/src/cloudflare/types/radar/attacks/layer7/summary_http_method_params.py index 6060fcfa603..056c66ca9f4 100644 --- a/src/cloudflare/types/radar/attacks/layer7/summary_http_method_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/summary_http_method_params.py @@ -48,6 +48,12 @@ class SummaryHTTPMethodParams(TypedDict, total=False): ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] """Filter for ip version.""" + limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] + """ + Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + """ + location: List[str] """Array of comma separated list of locations (alpha-2 country codes). diff --git a/src/cloudflare/types/radar/attacks/layer7/summary_http_method_response.py b/src/cloudflare/types/radar/attacks/layer7/summary_http_method_response.py index 38203e4eb07..79afadef9b6 100644 --- a/src/cloudflare/types/radar/attacks/layer7/summary_http_method_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/summary_http_method_response.py @@ -1,20 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Dict, List, Optional from datetime import datetime from pydantic import Field as FieldInfo from ....._models import BaseModel -__all__ = [ - "SummaryHTTPMethodResponse", - "Meta", - "MetaDateRange", - "MetaConfidenceInfo", - "MetaConfidenceInfoAnnotation", - "Summary0", -] +__all__ = ["SummaryHTTPMethodResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation"] class MetaDateRange(BaseModel): @@ -57,13 +50,7 @@ class Meta(BaseModel): confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) -class Summary0(BaseModel): - get: str = FieldInfo(alias="GET") - - post: str = FieldInfo(alias="POST") - - class SummaryHTTPMethodResponse(BaseModel): meta: Meta - summary_0: Summary0 + summary_0: Dict[str, str] diff --git a/src/cloudflare/types/radar/attacks/layer7/summary_managed_rules_params.py b/src/cloudflare/types/radar/attacks/layer7/summary_managed_rules_params.py index 5dfedbebd51..16197925be5 100644 --- a/src/cloudflare/types/radar/attacks/layer7/summary_managed_rules_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/summary_managed_rules_params.py @@ -103,6 +103,12 @@ class SummaryManagedRulesParams(TypedDict, total=False): ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] """Filter for ip version.""" + limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] + """ + Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + """ + location: List[str] """Array of comma separated list of locations (alpha-2 country codes). diff --git a/src/cloudflare/types/radar/attacks/layer7/summary_managed_rules_response.py b/src/cloudflare/types/radar/attacks/layer7/summary_managed_rules_response.py index 2a095a472e6..d63373ae0c7 100644 --- a/src/cloudflare/types/radar/attacks/layer7/summary_managed_rules_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/summary_managed_rules_response.py @@ -53,4 +53,4 @@ class Meta(BaseModel): class SummaryManagedRulesResponse(BaseModel): meta: Meta - summary_0: Dict[str, List[str]] + summary_0: Dict[str, str] diff --git a/src/cloudflare/types/radar/attacks/layer7/summary_mitigation_product_params.py b/src/cloudflare/types/radar/attacks/layer7/summary_mitigation_product_params.py index 4013e1ee425..55a45aa7fc1 100644 --- a/src/cloudflare/types/radar/attacks/layer7/summary_mitigation_product_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/summary_mitigation_product_params.py @@ -103,6 +103,12 @@ class SummaryMitigationProductParams(TypedDict, total=False): ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] """Filter for ip version.""" + limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] + """ + Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + """ + location: List[str] """Array of comma separated list of locations (alpha-2 country codes). diff --git a/src/cloudflare/types/radar/attacks/layer7/summary_mitigation_product_response.py b/src/cloudflare/types/radar/attacks/layer7/summary_mitigation_product_response.py index f815da2375a..eebfb391f20 100644 --- a/src/cloudflare/types/radar/attacks/layer7/summary_mitigation_product_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/summary_mitigation_product_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Dict, List, Optional from datetime import datetime from pydantic import Field as FieldInfo @@ -13,7 +13,6 @@ "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation", - "Summary0", ] @@ -57,13 +56,7 @@ class Meta(BaseModel): confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) -class Summary0(BaseModel): - ddos: str = FieldInfo(alias="DDOS") - - waf: str = FieldInfo(alias="WAF") - - class SummaryMitigationProductResponse(BaseModel): meta: Meta - summary_0: Summary0 + summary_0: Dict[str, str] diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_method_params.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_method_params.py index d6ea3e4eec2..098e2050b40 100644 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_method_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_method_params.py @@ -55,6 +55,12 @@ class TimeseriesGroupHTTPMethodParams(TypedDict, total=False): ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] """Filter for ip version.""" + limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] + """ + Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + """ + location: List[str] """Array of comma separated list of locations (alpha-2 country codes). diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_method_response.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_method_response.py index a0f6379a2c5..45e7a8b8a9f 100644 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_method_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_method_response.py @@ -1,8 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List - -from pydantic import Field as FieldInfo +from typing import TYPE_CHECKING, List from ....._models import BaseModel @@ -10,10 +8,14 @@ class Serie0(BaseModel): - get: List[str] = FieldInfo(alias="GET") - timestamps: List[str] + if TYPE_CHECKING: + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> List[str]: ... + class TimeseriesGroupHTTPMethodResponse(BaseModel): meta: object diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_version_response.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_version_response.py index f8085143fa2..0aeb0474fd0 100644 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_version_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_version_response.py @@ -12,6 +12,10 @@ class Serie0(BaseModel): http_1_x: List[str] = FieldInfo(alias="HTTP/1.x") + http_2: List[str] = FieldInfo(alias="HTTP/2") + + http_3: List[str] = FieldInfo(alias="HTTP/3") + timestamps: List[str] diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_managed_rules_params.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_managed_rules_params.py index 7c26f5c6c64..055a4d3e140 100644 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_managed_rules_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_managed_rules_params.py @@ -110,6 +110,12 @@ class TimeseriesGroupManagedRulesParams(TypedDict, total=False): ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] """Filter for ip version.""" + limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] + """ + Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + """ + location: List[str] """Array of comma separated list of locations (alpha-2 country codes). diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_mitigation_product_params.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_mitigation_product_params.py index 7dfb3741259..97c71692e3c 100644 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_mitigation_product_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_mitigation_product_params.py @@ -110,6 +110,12 @@ class TimeseriesGroupMitigationProductParams(TypedDict, total=False): ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] """Filter for ip version.""" + limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] + """ + Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + """ + location: List[str] """Array of comma separated list of locations (alpha-2 country codes). diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_mitigation_product_response.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_mitigation_product_response.py index 7e598104c96..b3e88c1e6a0 100644 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_mitigation_product_response.py +++ b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_mitigation_product_response.py @@ -1,8 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List - -from pydantic import Field as FieldInfo +from typing import TYPE_CHECKING, List from ....._models import BaseModel @@ -10,10 +8,14 @@ class Serie0(BaseModel): - ddos: List[str] = FieldInfo(alias="DDOS") - timestamps: List[str] + if TYPE_CHECKING: + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> List[str]: ... + class TimeseriesGroupMitigationProductResponse(BaseModel): meta: object diff --git a/src/cloudflare/types/radar/http/timeseries_group_browser_family_params.py b/src/cloudflare/types/radar/http/timeseries_group_browser_family_params.py index df17101636c..ae16d65d0c7 100644 --- a/src/cloudflare/types/radar/http/timeseries_group_browser_family_params.py +++ b/src/cloudflare/types/radar/http/timeseries_group_browser_family_params.py @@ -68,6 +68,12 @@ class TimeseriesGroupBrowserFamilyParams(TypedDict, total=False): ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] """Filter for ip version.""" + limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] + """ + Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + """ + location: List[str] """Array of comma separated list of locations (alpha-2 country codes). diff --git a/src/cloudflare/types/radar/ranking/domain_get_params.py b/src/cloudflare/types/radar/ranking/domain_get_params.py index 98bbbaf27da..95eb1587c83 100644 --- a/src/cloudflare/types/radar/ranking/domain_get_params.py +++ b/src/cloudflare/types/radar/ranking/domain_get_params.py @@ -2,7 +2,8 @@ from __future__ import annotations -from typing import List +import datetime +from typing import List, Union from typing_extensions import Literal, Annotated, TypedDict from ...._utils import PropertyInfo @@ -11,12 +12,15 @@ class DomainGetParams(TypedDict, total=False): - date: List[str] + date: Annotated[List[Union[str, datetime.date]], PropertyInfo(format="iso8601")] """Array of dates to filter the ranking.""" format: Literal["JSON", "CSV"] """Format results are returned in.""" + include_top_locations: Annotated[bool, PropertyInfo(alias="includeTopLocations")] + """Include top locations in the response.""" + limit: int """Limit the number of objects in the response.""" diff --git a/src/cloudflare/types/radar/ranking_top_params.py b/src/cloudflare/types/radar/ranking_top_params.py index e482e6f9f96..903af228882 100644 --- a/src/cloudflare/types/radar/ranking_top_params.py +++ b/src/cloudflare/types/radar/ranking_top_params.py @@ -2,7 +2,8 @@ from __future__ import annotations -from typing import List +import datetime +from typing import List, Union from typing_extensions import Literal, Annotated, TypedDict from ..._utils import PropertyInfo @@ -11,7 +12,7 @@ class RankingTopParams(TypedDict, total=False): - date: List[str] + date: Annotated[List[Union[str, datetime.date]], PropertyInfo(format="iso8601")] """Array of dates to filter the ranking.""" format: Literal["JSON", "CSV"] diff --git a/src/cloudflare/types/radar/tcp_resets_timeout_timeseries_groups_response.py b/src/cloudflare/types/radar/tcp_resets_timeout_timeseries_groups_response.py index 84e1ce0e8ea..b6ab06c0b94 100644 --- a/src/cloudflare/types/radar/tcp_resets_timeout_timeseries_groups_response.py +++ b/src/cloudflare/types/radar/tcp_resets_timeout_timeseries_groups_response.py @@ -59,31 +59,14 @@ class Meta(BaseModel): class Serie0(BaseModel): later_in_flow: List[str] - """ - Connection resets within the first 10 packets from the client, but after the - server has received multiple data packets. - """ no_match: List[str] - """All other connections.""" post_ack: List[str] - """ - Connection resets or timeouts after the server received both a SYN packet and an - ACK packet, meaning the connection was successfully established. - """ post_psh: List[str] - """ - Connection resets or timeouts after the server received a packet with PSH flag - set, following connection establishment. - """ post_syn: List[str] - """ - Connection resets or timeouts after the server received only a single SYN - packet. - """ timestamps: List[datetime] diff --git a/src/cloudflare/types/rules/lists/item_get_response.py b/src/cloudflare/types/rules/lists/item_get_response.py index 7ed243ab3ae..7293cef70a3 100644 --- a/src/cloudflare/types/rules/lists/item_get_response.py +++ b/src/cloudflare/types/rules/lists/item_get_response.py @@ -1,19 +1,15 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union, Optional -from typing_extensions import TypeAlias +from typing import Optional from ..hostname import Hostname from ..redirect import Redirect +from ...._models import BaseModel -__all__ = ["ItemGetResponse", "UnionMember0", "RulesListsRedirect", "RulesListsHostname", "UnionMember3"] +__all__ = ["ItemGetResponse"] -class UnionMember0: - pass - - -class RulesListsRedirect(Redirect): +class ItemGetResponse(BaseModel): id: Optional[str] = None """The unique ID of the list.""" @@ -43,42 +39,3 @@ class RulesListsRedirect(Redirect): redirect: Optional[Redirect] = None """The definition of the redirect.""" - - -class RulesListsHostname(Hostname): - id: Optional[str] = None - """The unique ID of the list.""" - - asn: Optional[int] = None - """A non-negative 32 bit integer""" - - comment: Optional[str] = None - """An informative summary of the list item.""" - - created_on: Optional[str] = None - """The RFC 3339 timestamp of when the item was created.""" - - hostname: Optional[Hostname] = None - """ - Valid characters for hostnames are ASCII(7) letters from a to z, the digits from - 0 to 9, wildcards (\\**), and the hyphen (-). - """ - - ip: Optional[str] = None - """An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. - - IPv6 CIDRs are limited to a maximum of /64. - """ - - modified_on: Optional[str] = None - """The RFC 3339 timestamp of when the item was last modified.""" - - redirect: Optional[Redirect] = None - """The definition of the redirect.""" - - -class UnionMember3: - pass - - -ItemGetResponse: TypeAlias = Union[UnionMember0, RulesListsRedirect, RulesListsHostname, UnionMember3] diff --git a/src/cloudflare/types/rules/lists/item_list_response.py b/src/cloudflare/types/rules/lists/item_list_response.py index 21703540fd6..233b99f1da7 100644 --- a/src/cloudflare/types/rules/lists/item_list_response.py +++ b/src/cloudflare/types/rules/lists/item_list_response.py @@ -1,19 +1,15 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union, Optional -from typing_extensions import TypeAlias +from typing import Optional from ..hostname import Hostname from ..redirect import Redirect +from ...._models import BaseModel -__all__ = ["ItemListResponse", "UnionMember0", "RulesListsRedirect", "RulesListsHostname", "UnionMember3"] +__all__ = ["ItemListResponse"] -class UnionMember0: - pass - - -class RulesListsRedirect(Redirect): +class ItemListResponse(BaseModel): id: Optional[str] = None """The unique ID of the list.""" @@ -43,42 +39,3 @@ class RulesListsRedirect(Redirect): redirect: Optional[Redirect] = None """The definition of the redirect.""" - - -class RulesListsHostname(Hostname): - id: Optional[str] = None - """The unique ID of the list.""" - - asn: Optional[int] = None - """A non-negative 32 bit integer""" - - comment: Optional[str] = None - """An informative summary of the list item.""" - - created_on: Optional[str] = None - """The RFC 3339 timestamp of when the item was created.""" - - hostname: Optional[Hostname] = None - """ - Valid characters for hostnames are ASCII(7) letters from a to z, the digits from - 0 to 9, wildcards (\\**), and the hyphen (-). - """ - - ip: Optional[str] = None - """An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. - - IPv6 CIDRs are limited to a maximum of /64. - """ - - modified_on: Optional[str] = None - """The RFC 3339 timestamp of when the item was last modified.""" - - redirect: Optional[Redirect] = None - """The definition of the redirect.""" - - -class UnionMember3: - pass - - -ItemListResponse: TypeAlias = Union[UnionMember0, RulesListsRedirect, RulesListsHostname, UnionMember3] diff --git a/src/cloudflare/types/rulesets/rule_create_params.py b/src/cloudflare/types/rulesets/rule_create_params.py index efc9c72846f..bb8fb83441d 100644 --- a/src/cloudflare/types/rulesets/rule_create_params.py +++ b/src/cloudflare/types/rulesets/rule_create_params.py @@ -147,8 +147,14 @@ "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeader", "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHost", "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString", - "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude", - "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters", "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser", "SetCacheSettingsRuleActionParametersCacheReserve", "SetCacheSettingsRuleActionParametersEdgeTTL", @@ -2276,40 +2282,68 @@ class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHost(TypedDict, total """ -class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude(TypedDict, total=False): +class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters( + TypedDict, total=False +): + list: List[str] + + +class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters( + TypedDict, total=False +): all: bool - """Exclude all query string parameters from use in building the cache key.""" + """Determines whether to include all query string parameters in the cache key.""" - list: List[str] - """A list of query string parameters NOT used to build the cache key. - All parameters present in the request but missing in this list will be used to - build the cache key. - """ +SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude: TypeAlias = Union[ + SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters, + SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters, +] -class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude(TypedDict, total=False): - all: bool - """Use all query string parameters in the cache key.""" +class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters( + TypedDict, total=False +): + include: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude + """A list of query string parameters used to build the cache key.""" + +class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters( + TypedDict, total=False +): list: List[str] - """A list of query string parameters used to build the cache key.""" -class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString(TypedDict, total=False): - exclude: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude - """ - build the cache key using all query string parameters EXCECPT these excluded - parameters - """ +class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters( + TypedDict, total=False +): + all: bool + """Determines whether to exclude all query string parameters from the cache key.""" - include: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude - """ - build the cache key using a list of query string parameters that ARE in the - request. + +SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude: TypeAlias = Union[ + SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters, + SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters, +] + + +class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters( + TypedDict, total=False +): + exclude: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude + """A list of query string parameters NOT used to build the cache key. + + All parameters present in the request but missing in this list will be used to + build the cache key. """ +SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString: TypeAlias = Union[ + SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters, + SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters, +] + + class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser(TypedDict, total=False): device_type: bool """Use the user agent's device type in the cache key.""" @@ -2332,10 +2366,7 @@ class SetCacheSettingsRuleActionParametersCacheKeyCustomKey(TypedDict, total=Fal """Whether to use the original host or the resolved host in the cache key.""" query_string: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString - """ - Use the presence or absence of parameters in the query string to build the cache - key. - """ + """Use the presence of parameters in the query string to build the cache key.""" user: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser """Characteristics of the request user agent used in building the cache key.""" diff --git a/src/cloudflare/types/rulesets/rule_edit_params.py b/src/cloudflare/types/rulesets/rule_edit_params.py index 201bf84f5b3..396a92a4459 100644 --- a/src/cloudflare/types/rulesets/rule_edit_params.py +++ b/src/cloudflare/types/rulesets/rule_edit_params.py @@ -147,8 +147,14 @@ "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHeader", "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHost", "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString", - "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude", - "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters", + "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters", "SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser", "SetCacheSettingsRuleActionParametersCacheReserve", "SetCacheSettingsRuleActionParametersEdgeTTL", @@ -2321,40 +2327,68 @@ class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyHost(TypedDict, total """ -class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude(TypedDict, total=False): +class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters( + TypedDict, total=False +): + list: List[str] + + +class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters( + TypedDict, total=False +): all: bool - """Exclude all query string parameters from use in building the cache key.""" + """Determines whether to include all query string parameters in the cache key.""" - list: List[str] - """A list of query string parameters NOT used to build the cache key. - All parameters present in the request but missing in this list will be used to - build the cache key. - """ +SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude: TypeAlias = Union[ + SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters, + SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters, +] -class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude(TypedDict, total=False): - all: bool - """Use all query string parameters in the cache key.""" +class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters( + TypedDict, total=False +): + include: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude + """A list of query string parameters used to build the cache key.""" + +class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters( + TypedDict, total=False +): list: List[str] - """A list of query string parameters used to build the cache key.""" -class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString(TypedDict, total=False): - exclude: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExclude - """ - build the cache key using all query string parameters EXCECPT these excluded - parameters - """ +class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters( + TypedDict, total=False +): + all: bool + """Determines whether to exclude all query string parameters from the cache key.""" - include: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringInclude - """ - build the cache key using a list of query string parameters that ARE in the - request. + +SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude: TypeAlias = Union[ + SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters, + SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters, +] + + +class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters( + TypedDict, total=False +): + exclude: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude + """A list of query string parameters NOT used to build the cache key. + + All parameters present in the request but missing in this list will be used to + build the cache key. """ +SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString: TypeAlias = Union[ + SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters, + SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters, +] + + class SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser(TypedDict, total=False): device_type: bool """Use the user agent's device type in the cache key.""" @@ -2377,10 +2411,7 @@ class SetCacheSettingsRuleActionParametersCacheKeyCustomKey(TypedDict, total=Fal """Whether to use the original host or the resolved host in the cache key.""" query_string: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyQueryString - """ - Use the presence or absence of parameters in the query string to build the cache - key. - """ + """Use the presence of parameters in the query string to build the cache key.""" user: SetCacheSettingsRuleActionParametersCacheKeyCustomKeyUser """Characteristics of the request user agent used in building the cache key.""" diff --git a/src/cloudflare/types/rulesets/set_cache_settings_rule.py b/src/cloudflare/types/rulesets/set_cache_settings_rule.py index 2b35f718029..e88114d9f66 100644 --- a/src/cloudflare/types/rulesets/set_cache_settings_rule.py +++ b/src/cloudflare/types/rulesets/set_cache_settings_rule.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Optional +from typing import Dict, List, Union, Optional from datetime import datetime -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from pydantic import Field as FieldInfo @@ -19,8 +19,14 @@ "ActionParametersCacheKeyCustomKeyHeader", "ActionParametersCacheKeyCustomKeyHost", "ActionParametersCacheKeyCustomKeyQueryString", - "ActionParametersCacheKeyCustomKeyQueryStringExclude", - "ActionParametersCacheKeyCustomKeyQueryStringInclude", + "ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters", + "ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude", + "ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters", + "ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters", + "ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters", + "ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude", + "ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters", + "ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters", "ActionParametersCacheKeyCustomKeyUser", "ActionParametersCacheReserve", "ActionParametersEdgeTTL", @@ -85,40 +91,64 @@ class ActionParametersCacheKeyCustomKeyHost(BaseModel): """ -class ActionParametersCacheKeyCustomKeyQueryStringExclude(BaseModel): +class ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters( + BaseModel +): + rule_list: Optional[List[str]] = FieldInfo(alias="list", default=None) + + +class ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters( + BaseModel +): all: Optional[bool] = None - """Exclude all query string parameters from use in building the cache key.""" + """Determines whether to include all query string parameters in the cache key.""" - rule_list: Optional[List[str]] = FieldInfo(alias="list", default=None) - """A list of query string parameters NOT used to build the cache key. - All parameters present in the request but missing in this list will be used to - build the cache key. - """ +ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude: TypeAlias = Union[ + ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters, + ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters, +] -class ActionParametersCacheKeyCustomKeyQueryStringInclude(BaseModel): - all: Optional[bool] = None - """Use all query string parameters in the cache key.""" +class ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters(BaseModel): + include: Optional[ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude] = None + """A list of query string parameters used to build the cache key.""" + +class ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters( + BaseModel +): rule_list: Optional[List[str]] = FieldInfo(alias="list", default=None) - """A list of query string parameters used to build the cache key.""" -class ActionParametersCacheKeyCustomKeyQueryString(BaseModel): - exclude: Optional[ActionParametersCacheKeyCustomKeyQueryStringExclude] = None - """ - build the cache key using all query string parameters EXCECPT these excluded - parameters - """ +class ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters( + BaseModel +): + all: Optional[bool] = None + """Determines whether to exclude all query string parameters from the cache key.""" - include: Optional[ActionParametersCacheKeyCustomKeyQueryStringInclude] = None - """ - build the cache key using a list of query string parameters that ARE in the - request. + +ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude: TypeAlias = Union[ + ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters, + ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters, +] + + +class ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters(BaseModel): + exclude: Optional[ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude] = None + """A list of query string parameters NOT used to build the cache key. + + All parameters present in the request but missing in this list will be used to + build the cache key. """ +ActionParametersCacheKeyCustomKeyQueryString: TypeAlias = Union[ + ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters, + ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters, +] + + class ActionParametersCacheKeyCustomKeyUser(BaseModel): device_type: Optional[bool] = None """Use the user agent's device type in the cache key.""" @@ -141,10 +171,7 @@ class ActionParametersCacheKeyCustomKey(BaseModel): """Whether to use the original host or the resolved host in the cache key.""" query_string: Optional[ActionParametersCacheKeyCustomKeyQueryString] = None - """ - Use the presence or absence of parameters in the query string to build the cache - key. - """ + """Use the presence of parameters in the query string to build the cache key.""" user: Optional[ActionParametersCacheKeyCustomKeyUser] = None """Characteristics of the request user agent used in building the cache key.""" diff --git a/src/cloudflare/types/rulesets/set_cache_settings_rule_param.py b/src/cloudflare/types/rulesets/set_cache_settings_rule_param.py index ff8c9861e22..ed6d9f5818e 100644 --- a/src/cloudflare/types/rulesets/set_cache_settings_rule_param.py +++ b/src/cloudflare/types/rulesets/set_cache_settings_rule_param.py @@ -2,8 +2,8 @@ from __future__ import annotations -from typing import Dict, List, Iterable -from typing_extensions import Literal, Required, TypedDict +from typing import Dict, List, Union, Iterable +from typing_extensions import Literal, Required, TypeAlias, TypedDict from .logging_param import LoggingParam @@ -17,8 +17,14 @@ "ActionParametersCacheKeyCustomKeyHeader", "ActionParametersCacheKeyCustomKeyHost", "ActionParametersCacheKeyCustomKeyQueryString", - "ActionParametersCacheKeyCustomKeyQueryStringExclude", - "ActionParametersCacheKeyCustomKeyQueryStringInclude", + "ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters", + "ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude", + "ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters", + "ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters", + "ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters", + "ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude", + "ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters", + "ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters", "ActionParametersCacheKeyCustomKeyUser", "ActionParametersCacheReserve", "ActionParametersEdgeTTL", @@ -83,40 +89,64 @@ class ActionParametersCacheKeyCustomKeyHost(TypedDict, total=False): """ -class ActionParametersCacheKeyCustomKeyQueryStringExclude(TypedDict, total=False): +class ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters( + TypedDict, total=False +): + list: List[str] + + +class ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters( + TypedDict, total=False +): all: bool - """Exclude all query string parameters from use in building the cache key.""" + """Determines whether to include all query string parameters in the cache key.""" - list: List[str] - """A list of query string parameters NOT used to build the cache key. - All parameters present in the request but missing in this list will be used to - build the cache key. - """ +ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude: TypeAlias = Union[ + ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeSomeQueryStringParameters, + ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersIncludeAllQueryStringParameters, +] -class ActionParametersCacheKeyCustomKeyQueryStringInclude(TypedDict, total=False): - all: bool - """Use all query string parameters in the cache key.""" +class ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters(TypedDict, total=False): + include: ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParametersInclude + """A list of query string parameters used to build the cache key.""" + +class ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters( + TypedDict, total=False +): list: List[str] - """A list of query string parameters used to build the cache key.""" -class ActionParametersCacheKeyCustomKeyQueryString(TypedDict, total=False): - exclude: ActionParametersCacheKeyCustomKeyQueryStringExclude - """ - build the cache key using all query string parameters EXCECPT these excluded - parameters - """ +class ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters( + TypedDict, total=False +): + all: bool + """Determines whether to exclude all query string parameters from the cache key.""" - include: ActionParametersCacheKeyCustomKeyQueryStringInclude - """ - build the cache key using a list of query string parameters that ARE in the - request. + +ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude: TypeAlias = Union[ + ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeSomeQueryStringParameters, + ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExcludeAllQueryStringParameters, +] + + +class ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters(TypedDict, total=False): + exclude: ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParametersExclude + """A list of query string parameters NOT used to build the cache key. + + All parameters present in the request but missing in this list will be used to + build the cache key. """ +ActionParametersCacheKeyCustomKeyQueryString: TypeAlias = Union[ + ActionParametersCacheKeyCustomKeyQueryStringIncludedQueryStringParameters, + ActionParametersCacheKeyCustomKeyQueryStringExcludedQueryStringParameters, +] + + class ActionParametersCacheKeyCustomKeyUser(TypedDict, total=False): device_type: bool """Use the user agent's device type in the cache key.""" @@ -139,10 +169,7 @@ class ActionParametersCacheKeyCustomKey(TypedDict, total=False): """Whether to use the original host or the resolved host in the cache key.""" query_string: ActionParametersCacheKeyCustomKeyQueryString - """ - Use the presence or absence of parameters in the query string to build the cache - key. - """ + """Use the presence of parameters in the query string to build the cache key.""" user: ActionParametersCacheKeyCustomKeyUser """Characteristics of the request user agent used in building the cache key.""" diff --git a/src/cloudflare/types/shared/token.py b/src/cloudflare/types/shared/token.py index 60c5cc8e911..fd4787368c9 100644 --- a/src/cloudflare/types/shared/token.py +++ b/src/cloudflare/types/shared/token.py @@ -22,7 +22,7 @@ class ConditionRequestIP(BaseModel): class Condition(BaseModel): - request_ip: Optional[ConditionRequestIP] = FieldInfo(alias="request.ip", default=None) + request_ip: Optional[ConditionRequestIP] = None """Client IP restrictions.""" diff --git a/src/cloudflare/types/shared/token_policy.py b/src/cloudflare/types/shared/token_policy.py index 9611c150894..10909830a01 100644 --- a/src/cloudflare/types/shared/token_policy.py +++ b/src/cloudflare/types/shared/token_policy.py @@ -1,11 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Dict, List, Optional from typing_extensions import Literal from ..._models import BaseModel -__all__ = ["TokenPolicy", "PermissionGroup", "PermissionGroupMeta", "Resources"] +__all__ = ["TokenPolicy", "PermissionGroup", "PermissionGroupMeta"] class PermissionGroupMeta(BaseModel): @@ -25,12 +25,6 @@ class PermissionGroup(BaseModel): """Name of the group.""" -class Resources(BaseModel): - resource: Optional[str] = None - - scope: Optional[str] = None - - class TokenPolicy(BaseModel): id: str """Policy identifier.""" @@ -41,5 +35,5 @@ class TokenPolicy(BaseModel): permission_groups: List[PermissionGroup] """A set of permission groups that are specified to the policy.""" - resources: Resources + resources: Dict[str, str] """A list of resource names that the policy applies to.""" diff --git a/src/cloudflare/types/shared_params/token_policy.py b/src/cloudflare/types/shared_params/token_policy.py index 789802e3df7..96b7d37451f 100644 --- a/src/cloudflare/types/shared_params/token_policy.py +++ b/src/cloudflare/types/shared_params/token_policy.py @@ -2,10 +2,10 @@ from __future__ import annotations -from typing import Iterable +from typing import Dict, Iterable from typing_extensions import Literal, Required, TypedDict -__all__ = ["TokenPolicy", "PermissionGroup", "PermissionGroupMeta", "Resources"] +__all__ = ["TokenPolicy", "PermissionGroup", "PermissionGroupMeta"] class PermissionGroupMeta(TypedDict, total=False): @@ -19,12 +19,6 @@ class PermissionGroup(TypedDict, total=False): """Attributes associated to the permission group.""" -class Resources(TypedDict, total=False): - resource: str - - scope: str - - class TokenPolicy(TypedDict, total=False): effect: Required[Literal["allow", "deny"]] """Allow or deny operations against the resources.""" @@ -32,5 +26,5 @@ class TokenPolicy(TypedDict, total=False): permission_groups: Required[Iterable[PermissionGroup]] """A set of permission groups that are specified to the policy.""" - resources: Required[Resources] + resources: Required[Dict[str, str]] """A list of resource names that the policy applies to.""" diff --git a/src/cloudflare/types/url_normalization/url_normalization_get_response.py b/src/cloudflare/types/url_normalization/url_normalization_get_response.py index 0bebaa4413c..9ea0d8949ea 100644 --- a/src/cloudflare/types/url_normalization/url_normalization_get_response.py +++ b/src/cloudflare/types/url_normalization/url_normalization_get_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing_extensions import Literal from ..._models import BaseModel @@ -8,8 +8,8 @@ class URLNormalizationGetResponse(BaseModel): - scope: Optional[str] = None + scope: Literal["incoming", "both"] """The scope of the URL normalization.""" - type: Optional[str] = None + type: Literal["cloudflare", "rfc3986"] """The type of URL normalization performed by Cloudflare.""" diff --git a/src/cloudflare/types/url_normalization/url_normalization_update_params.py b/src/cloudflare/types/url_normalization/url_normalization_update_params.py index fb2b4551fa4..77533d9d48a 100644 --- a/src/cloudflare/types/url_normalization/url_normalization_update_params.py +++ b/src/cloudflare/types/url_normalization/url_normalization_update_params.py @@ -2,17 +2,17 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["URLNormalizationUpdateParams"] class URLNormalizationUpdateParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" + """The unique ID of the zone.""" - scope: str + scope: Required[Literal["incoming", "both"]] """The scope of the URL normalization.""" - type: str + type: Required[Literal["cloudflare", "rfc3986"]] """The type of URL normalization performed by Cloudflare.""" diff --git a/src/cloudflare/types/url_normalization/url_normalization_update_response.py b/src/cloudflare/types/url_normalization/url_normalization_update_response.py index b7d70096ced..610eef85af1 100644 --- a/src/cloudflare/types/url_normalization/url_normalization_update_response.py +++ b/src/cloudflare/types/url_normalization/url_normalization_update_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing_extensions import Literal from ..._models import BaseModel @@ -8,8 +8,8 @@ class URLNormalizationUpdateResponse(BaseModel): - scope: Optional[str] = None + scope: Literal["incoming", "both"] """The scope of the URL normalization.""" - type: Optional[str] = None + type: Literal["cloudflare", "rfc3986"] """The type of URL normalization performed by Cloudflare.""" diff --git a/src/cloudflare/types/url_scanner/scan_bulk_create_params.py b/src/cloudflare/types/url_scanner/scan_bulk_create_params.py index 8bdd2ef9263..6509c75550e 100644 --- a/src/cloudflare/types/url_scanner/scan_bulk_create_params.py +++ b/src/cloudflare/types/url_scanner/scan_bulk_create_params.py @@ -11,6 +11,9 @@ class ScanBulkCreateParams(TypedDict, total=False): + account_id: Required[str] + """Account ID.""" + body: Required[Iterable[Body]] """List of urls to scan (up to a 100).""" diff --git a/src/cloudflare/types/url_scanner/scan_create_params.py b/src/cloudflare/types/url_scanner/scan_create_params.py index 16a71092669..782da4a9c85 100644 --- a/src/cloudflare/types/url_scanner/scan_create_params.py +++ b/src/cloudflare/types/url_scanner/scan_create_params.py @@ -11,6 +11,9 @@ class ScanCreateParams(TypedDict, total=False): + account_id: Required[str] + """Account ID.""" + url: Required[str] customagent: str diff --git a/src/cloudflare/types/url_scanner/scan_list_params.py b/src/cloudflare/types/url_scanner/scan_list_params.py index c13e697eda1..97421b92ccc 100644 --- a/src/cloudflare/types/url_scanner/scan_list_params.py +++ b/src/cloudflare/types/url_scanner/scan_list_params.py @@ -2,12 +2,15 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["ScanListParams"] class ScanListParams(TypedDict, total=False): + account_id: Required[str] + """Account ID.""" + q: str """Filter scans""" diff --git a/src/cloudflare/types/url_scanner/scan_screenshot_params.py b/src/cloudflare/types/url_scanner/scan_screenshot_params.py index 2b3a24b0dd4..263a003363f 100644 --- a/src/cloudflare/types/url_scanner/scan_screenshot_params.py +++ b/src/cloudflare/types/url_scanner/scan_screenshot_params.py @@ -2,16 +2,14 @@ from __future__ import annotations -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ..._utils import PropertyInfo +from typing_extensions import Literal, Required, TypedDict __all__ = ["ScanScreenshotParams"] class ScanScreenshotParams(TypedDict, total=False): - account_id: Required[Annotated[str, PropertyInfo(alias="accountId")]] - """Account Id.""" + account_id: Required[str] + """Account ID.""" resolution: Literal["desktop", "mobile", "tablet"] """Target device type.""" diff --git a/src/cloudflare/types/user/token_create_params.py b/src/cloudflare/types/user/token_create_params.py index bf9e2e8de5b..166b95b2e7f 100644 --- a/src/cloudflare/types/user/token_create_params.py +++ b/src/cloudflare/types/user/token_create_params.py @@ -47,5 +47,5 @@ class ConditionRequestIP(_ConditionRequestIPReservedKeywords, total=False): class Condition(TypedDict, total=False): - request_ip: Annotated[ConditionRequestIP, PropertyInfo(alias="request.ip")] + request_ip: ConditionRequestIP """Client IP restrictions.""" diff --git a/src/cloudflare/types/user/token_create_response.py b/src/cloudflare/types/user/token_create_response.py index cfc75aba10c..baad5983f71 100644 --- a/src/cloudflare/types/user/token_create_response.py +++ b/src/cloudflare/types/user/token_create_response.py @@ -23,7 +23,7 @@ class ConditionRequestIP(BaseModel): class Condition(BaseModel): - request_ip: Optional[ConditionRequestIP] = FieldInfo(alias="request.ip", default=None) + request_ip: Optional[ConditionRequestIP] = None """Client IP restrictions.""" diff --git a/src/cloudflare/types/user/token_update_params.py b/src/cloudflare/types/user/token_update_params.py index 55c166825b4..b48ae15215b 100644 --- a/src/cloudflare/types/user/token_update_params.py +++ b/src/cloudflare/types/user/token_update_params.py @@ -50,5 +50,5 @@ class ConditionRequestIP(_ConditionRequestIPReservedKeywords, total=False): class Condition(TypedDict, total=False): - request_ip: Annotated[ConditionRequestIP, PropertyInfo(alias="request.ip")] + request_ip: ConditionRequestIP """Client IP restrictions.""" diff --git a/src/cloudflare/types/vectorize/index_delete_response.py b/src/cloudflare/types/vectorize/index_delete_response.py index 2680eb61604..04ceee6b545 100644 --- a/src/cloudflare/types/vectorize/index_delete_response.py +++ b/src/cloudflare/types/vectorize/index_delete_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union, Optional +from typing import Union from typing_extensions import TypeAlias __all__ = ["IndexDeleteResponse"] -IndexDeleteResponse: TypeAlias = Union[Optional[str], Optional[object]] +IndexDeleteResponse: TypeAlias = Union[str, object, None] diff --git a/src/cloudflare/types/waiting_rooms/waiting_room.py b/src/cloudflare/types/waiting_rooms/waiting_room.py index eff1d6b5d24..0364a65dfb7 100644 --- a/src/cloudflare/types/waiting_rooms/waiting_room.py +++ b/src/cloudflare/types/waiting_rooms/waiting_room.py @@ -376,3 +376,22 @@ class WaitingRoom(BaseModel): active users sessions on the route based on the traffic patterns at that time around the world. """ + + turnstile_action: Optional[Literal["log", "infinite_queue"]] = None + """Which action to take when a bot is detected using Turnstile. + + `log` will have no impact on queueing behavior, simply keeping track of how many + bots are detected in Waiting Room Analytics. `infinite_queue` will send bots to + a false queueing state, where they will never reach your origin. + `infinite_queue` requires Advanced Waiting Room. + """ + + turnstile_mode: Optional[Literal["off", "invisible", "visible_non_interactive", "visible_managed"]] = None + """Which Turnstile widget type to use for detecting bot traffic. + + See + [the Turnstile documentation](https://developers.cloudflare.com/turnstile/concepts/widget/#widget-types) + for the definitions of these widget types. Set to `off` to disable the Turnstile + integration entirely. Setting this to anything other than `off` or `invisible` + requires Advanced Waiting Room. + """ diff --git a/src/cloudflare/types/waiting_rooms/waiting_room_create_params.py b/src/cloudflare/types/waiting_rooms/waiting_room_create_params.py index ef0cf714c53..775fc8974ca 100644 --- a/src/cloudflare/types/waiting_rooms/waiting_room_create_params.py +++ b/src/cloudflare/types/waiting_rooms/waiting_room_create_params.py @@ -365,3 +365,22 @@ class WaitingRoomCreateParams(TypedDict, total=False): If set to `true`, the traffic will not go to the waiting room. """ + + turnstile_action: Literal["log", "infinite_queue"] + """Which action to take when a bot is detected using Turnstile. + + `log` will have no impact on queueing behavior, simply keeping track of how many + bots are detected in Waiting Room Analytics. `infinite_queue` will send bots to + a false queueing state, where they will never reach your origin. + `infinite_queue` requires Advanced Waiting Room. + """ + + turnstile_mode: Literal["off", "invisible", "visible_non_interactive", "visible_managed"] + """Which Turnstile widget type to use for detecting bot traffic. + + See + [the Turnstile documentation](https://developers.cloudflare.com/turnstile/concepts/widget/#widget-types) + for the definitions of these widget types. Set to `off` to disable the Turnstile + integration entirely. Setting this to anything other than `off` or `invisible` + requires Advanced Waiting Room. + """ diff --git a/src/cloudflare/types/waiting_rooms/waiting_room_edit_params.py b/src/cloudflare/types/waiting_rooms/waiting_room_edit_params.py index f47bf7c06c6..c2c494dc57c 100644 --- a/src/cloudflare/types/waiting_rooms/waiting_room_edit_params.py +++ b/src/cloudflare/types/waiting_rooms/waiting_room_edit_params.py @@ -365,3 +365,22 @@ class WaitingRoomEditParams(TypedDict, total=False): If set to `true`, the traffic will not go to the waiting room. """ + + turnstile_action: Literal["log", "infinite_queue"] + """Which action to take when a bot is detected using Turnstile. + + `log` will have no impact on queueing behavior, simply keeping track of how many + bots are detected in Waiting Room Analytics. `infinite_queue` will send bots to + a false queueing state, where they will never reach your origin. + `infinite_queue` requires Advanced Waiting Room. + """ + + turnstile_mode: Literal["off", "invisible", "visible_non_interactive", "visible_managed"] + """Which Turnstile widget type to use for detecting bot traffic. + + See + [the Turnstile documentation](https://developers.cloudflare.com/turnstile/concepts/widget/#widget-types) + for the definitions of these widget types. Set to `off` to disable the Turnstile + integration entirely. Setting this to anything other than `off` or `invisible` + requires Advanced Waiting Room. + """ diff --git a/src/cloudflare/types/waiting_rooms/waiting_room_update_params.py b/src/cloudflare/types/waiting_rooms/waiting_room_update_params.py index f93d914d4b0..52e93cfbc38 100644 --- a/src/cloudflare/types/waiting_rooms/waiting_room_update_params.py +++ b/src/cloudflare/types/waiting_rooms/waiting_room_update_params.py @@ -365,3 +365,22 @@ class WaitingRoomUpdateParams(TypedDict, total=False): If set to `true`, the traffic will not go to the waiting room. """ + + turnstile_action: Literal["log", "infinite_queue"] + """Which action to take when a bot is detected using Turnstile. + + `log` will have no impact on queueing behavior, simply keeping track of how many + bots are detected in Waiting Room Analytics. `infinite_queue` will send bots to + a false queueing state, where they will never reach your origin. + `infinite_queue` requires Advanced Waiting Room. + """ + + turnstile_mode: Literal["off", "invisible", "visible_non_interactive", "visible_managed"] + """Which Turnstile widget type to use for detecting bot traffic. + + See + [the Turnstile documentation](https://developers.cloudflare.com/turnstile/concepts/widget/#widget-types) + for the definitions of these widget types. Set to `off` to disable the Turnstile + integration entirely. Setting this to anything other than `off` or `invisible` + requires Advanced Waiting Room. + """ diff --git a/src/cloudflare/types/workers/__init__.py b/src/cloudflare/types/workers/__init__.py index 57bde2d76cb..201450ef852 100644 --- a/src/cloudflare/types/workers/__init__.py +++ b/src/cloudflare/types/workers/__init__.py @@ -4,42 +4,28 @@ from .domain import Domain as Domain from .script import Script as Script -from .binding import Binding as Binding -from .d1_binding import D1Binding as D1Binding -from .r2_binding import R2Binding as R2Binding -from .ai_run_params import AIRunParams as AIRunParams -from .binding_param import BindingParam as BindingParam from .migration_step import MigrationStep as MigrationStep from .script_setting import ScriptSetting as ScriptSetting -from .ai_run_response import AIRunResponse as AIRunResponse -from .service_binding import ServiceBinding as ServiceBinding -from .d1_binding_param import D1BindingParam as D1BindingParam -from .r2_binding_param import R2BindingParam as R2BindingParam -from .mtls_cert_binding import MTLSCERTBinding as MTLSCERTBinding -from .stepped_migration import SteppedMigration as SteppedMigration from .domain_list_params import DomainListParams as DomainListParams +from .route_get_response import RouteGetResponse as RouteGetResponse +from .route_create_params import RouteCreateParams as RouteCreateParams +from .route_list_response import RouteListResponse as RouteListResponse +from .route_update_params import RouteUpdateParams as RouteUpdateParams +from .script_get_response import ScriptGetResponse as ScriptGetResponse from .domain_update_params import DomainUpdateParams as DomainUpdateParams -from .kv_namespace_binding import KVNamespaceBinding as KVNamespaceBinding from .migration_step_param import MigrationStepParam as MigrationStepParam from .script_delete_params import ScriptDeleteParams as ScriptDeleteParams from .script_update_params import ScriptUpdateParams as ScriptUpdateParams -from .service_binding_param import ServiceBindingParam as ServiceBindingParam +from .route_create_response import RouteCreateResponse as RouteCreateResponse +from .route_delete_response import RouteDeleteResponse as RouteDeleteResponse +from .route_update_response import RouteUpdateResponse as RouteUpdateResponse from .single_step_migration import SingleStepMigration as SingleStepMigration from .worker_metadata_param import WorkerMetadataParam as WorkerMetadataParam -from .durable_object_binding import DurableObjectBinding as DurableObjectBinding from .script_update_response import ScriptUpdateResponse as ScriptUpdateResponse from .subdomain_get_response import SubdomainGetResponse as SubdomainGetResponse -from .mtls_cert_binding_param import MTLSCERTBindingParam as MTLSCERTBindingParam -from .placement_configuration import PlacementConfiguration as PlacementConfiguration -from .stepped_migration_param import SteppedMigrationParam as SteppedMigrationParam from .subdomain_update_params import SubdomainUpdateParams as SubdomainUpdateParams from .subdomain_update_response import SubdomainUpdateResponse as SubdomainUpdateResponse -from .dispatch_namespace_binding import DispatchNamespaceBinding as DispatchNamespaceBinding -from .kv_namespace_binding_param import KVNamespaceBindingParam as KVNamespaceBindingParam from .single_step_migration_param import SingleStepMigrationParam as SingleStepMigrationParam from .account_setting_get_response import AccountSettingGetResponse as AccountSettingGetResponse -from .durable_object_binding_param import DurableObjectBindingParam as DurableObjectBindingParam from .account_setting_update_params import AccountSettingUpdateParams as AccountSettingUpdateParams -from .placement_configuration_param import PlacementConfigurationParam as PlacementConfigurationParam from .account_setting_update_response import AccountSettingUpdateResponse as AccountSettingUpdateResponse -from .dispatch_namespace_binding_param import DispatchNamespaceBindingParam as DispatchNamespaceBindingParam diff --git a/src/cloudflare/types/workers/binding.py b/src/cloudflare/types/workers/binding.py deleted file mode 100644 index 9a34a8ef377..00000000000 --- a/src/cloudflare/types/workers/binding.py +++ /dev/null @@ -1,47 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union -from typing_extensions import Literal, TypeAlias - -from ..._models import BaseModel -from .d1_binding import D1Binding -from .r2_binding import R2Binding -from .service_binding import ServiceBinding -from .mtls_cert_binding import MTLSCERTBinding -from .kv_namespace_binding import KVNamespaceBinding -from .durable_object_binding import DurableObjectBinding -from .dispatch_namespace_binding import DispatchNamespaceBinding - -__all__ = ["Binding", "WorkersQueueBinding", "WorkersAssetsBinding"] - - -class WorkersQueueBinding(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - queue_name: str - """Name of the Queue to bind to""" - - type: Literal["queue"] - """The class of resource that the binding provides.""" - - -class WorkersAssetsBinding(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["assets"] - """The class of resource that the binding provides.""" - - -Binding: TypeAlias = Union[ - KVNamespaceBinding, - ServiceBinding, - DurableObjectBinding, - R2Binding, - WorkersQueueBinding, - D1Binding, - DispatchNamespaceBinding, - MTLSCERTBinding, - WorkersAssetsBinding, -] diff --git a/src/cloudflare/types/workers/binding_param.py b/src/cloudflare/types/workers/binding_param.py deleted file mode 100644 index b0d2a41ab37..00000000000 --- a/src/cloudflare/types/workers/binding_param.py +++ /dev/null @@ -1,42 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Literal, Required, TypeAlias, TypedDict - -from .d1_binding_param import D1BindingParam -from .r2_binding_param import R2BindingParam -from .service_binding_param import ServiceBindingParam -from .mtls_cert_binding_param import MTLSCERTBindingParam -from .kv_namespace_binding_param import KVNamespaceBindingParam -from .durable_object_binding_param import DurableObjectBindingParam -from .dispatch_namespace_binding_param import DispatchNamespaceBindingParam - -__all__ = ["BindingParam", "WorkersQueueBinding", "WorkersAssetsBinding"] - - -class WorkersQueueBinding(TypedDict, total=False): - queue_name: Required[str] - """Name of the Queue to bind to""" - - type: Required[Literal["queue"]] - """The class of resource that the binding provides.""" - - -class WorkersAssetsBinding(TypedDict, total=False): - type: Required[Literal["assets"]] - """The class of resource that the binding provides.""" - - -BindingParam: TypeAlias = Union[ - KVNamespaceBindingParam, - ServiceBindingParam, - DurableObjectBindingParam, - R2BindingParam, - WorkersQueueBinding, - D1BindingParam, - DispatchNamespaceBindingParam, - MTLSCERTBindingParam, - WorkersAssetsBinding, -] diff --git a/src/cloudflare/types/workers/d1_binding.py b/src/cloudflare/types/workers/d1_binding.py deleted file mode 100644 index 7010fcfa068..00000000000 --- a/src/cloudflare/types/workers/d1_binding.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["D1Binding"] - - -class D1Binding(BaseModel): - id: str - """ID of the D1 database to bind to""" - - binding: str - """A JavaScript variable name for the binding.""" - - name: str - """The name of the D1 database associated with the 'id' provided.""" - - type: Literal["d1"] - """The class of resource that the binding provides.""" diff --git a/src/cloudflare/types/workers/d1_binding_param.py b/src/cloudflare/types/workers/d1_binding_param.py deleted file mode 100644 index 74face1628f..00000000000 --- a/src/cloudflare/types/workers/d1_binding_param.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, TypedDict - -__all__ = ["D1BindingParam"] - - -class D1BindingParam(TypedDict, total=False): - id: Required[str] - """ID of the D1 database to bind to""" - - name: Required[str] - """The name of the D1 database associated with the 'id' provided.""" - - type: Required[Literal["d1"]] - """The class of resource that the binding provides.""" diff --git a/src/cloudflare/types/workers/dispatch_namespace_binding.py b/src/cloudflare/types/workers/dispatch_namespace_binding.py deleted file mode 100644 index 7211e0a0dbb..00000000000 --- a/src/cloudflare/types/workers/dispatch_namespace_binding.py +++ /dev/null @@ -1,41 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["DispatchNamespaceBinding", "Outbound", "OutboundWorker"] - - -class OutboundWorker(BaseModel): - environment: Optional[str] = None - """Environment of the outbound worker""" - - service: Optional[str] = None - """Name of the outbound worker""" - - -class Outbound(BaseModel): - params: Optional[List[str]] = None - """ - Pass information from the Dispatch Worker to the Outbound Worker through the - parameters - """ - - worker: Optional[OutboundWorker] = None - """Outbound worker""" - - -class DispatchNamespaceBinding(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - namespace: str - """Namespace to bind to""" - - type: Literal["dispatch_namespace"] - """The class of resource that the binding provides.""" - - outbound: Optional[Outbound] = None - """Outbound worker""" diff --git a/src/cloudflare/types/workers/dispatch_namespace_binding_param.py b/src/cloudflare/types/workers/dispatch_namespace_binding_param.py deleted file mode 100644 index 584c5d86e15..00000000000 --- a/src/cloudflare/types/workers/dispatch_namespace_binding_param.py +++ /dev/null @@ -1,38 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List -from typing_extensions import Literal, Required, TypedDict - -__all__ = ["DispatchNamespaceBindingParam", "Outbound", "OutboundWorker"] - - -class OutboundWorker(TypedDict, total=False): - environment: str - """Environment of the outbound worker""" - - service: str - """Name of the outbound worker""" - - -class Outbound(TypedDict, total=False): - params: List[str] - """ - Pass information from the Dispatch Worker to the Outbound Worker through the - parameters - """ - - worker: OutboundWorker - """Outbound worker""" - - -class DispatchNamespaceBindingParam(TypedDict, total=False): - namespace: Required[str] - """Namespace to bind to""" - - type: Required[Literal["dispatch_namespace"]] - """The class of resource that the binding provides.""" - - outbound: Outbound - """Outbound worker""" diff --git a/src/cloudflare/types/workers/durable_object_binding.py b/src/cloudflare/types/workers/durable_object_binding.py deleted file mode 100644 index acef5a67aae..00000000000 --- a/src/cloudflare/types/workers/durable_object_binding.py +++ /dev/null @@ -1,30 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["DurableObjectBinding"] - - -class DurableObjectBinding(BaseModel): - class_name: str - """The exported class name of the Durable Object""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["durable_object_namespace"] - """The class of resource that the binding provides.""" - - environment: Optional[str] = None - """The environment of the script_name to bind to""" - - namespace_id: Optional[str] = None - """Namespace identifier tag.""" - - script_name: Optional[str] = None - """ - The script where the Durable Object is defined, if it is external to this Worker - """ diff --git a/src/cloudflare/types/workers/durable_object_binding_param.py b/src/cloudflare/types/workers/durable_object_binding_param.py deleted file mode 100644 index 6c00bbd63a9..00000000000 --- a/src/cloudflare/types/workers/durable_object_binding_param.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, TypedDict - -__all__ = ["DurableObjectBindingParam"] - - -class DurableObjectBindingParam(TypedDict, total=False): - class_name: Required[str] - """The exported class name of the Durable Object""" - - type: Required[Literal["durable_object_namespace"]] - """The class of resource that the binding provides.""" - - environment: str - """The environment of the script_name to bind to""" - - script_name: str - """ - The script where the Durable Object is defined, if it is external to this Worker - """ diff --git a/src/cloudflare/types/workers/kv_namespace_binding.py b/src/cloudflare/types/workers/kv_namespace_binding.py deleted file mode 100644 index bf28ce9caac..00000000000 --- a/src/cloudflare/types/workers/kv_namespace_binding.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["KVNamespaceBinding"] - - -class KVNamespaceBinding(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - namespace_id: str - """Namespace identifier tag.""" - - type: Literal["kv_namespace"] - """The class of resource that the binding provides.""" diff --git a/src/cloudflare/types/workers/kv_namespace_binding_param.py b/src/cloudflare/types/workers/kv_namespace_binding_param.py deleted file mode 100644 index 7dc97bab2a6..00000000000 --- a/src/cloudflare/types/workers/kv_namespace_binding_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, TypedDict - -__all__ = ["KVNamespaceBindingParam"] - - -class KVNamespaceBindingParam(TypedDict, total=False): - type: Required[Literal["kv_namespace"]] - """The class of resource that the binding provides.""" diff --git a/src/cloudflare/types/workers/mtls_cert_binding.py b/src/cloudflare/types/workers/mtls_cert_binding.py deleted file mode 100644 index e80080bd283..00000000000 --- a/src/cloudflare/types/workers/mtls_cert_binding.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["MTLSCERTBinding"] - - -class MTLSCERTBinding(BaseModel): - certificate_id: str - """ID of the certificate to bind to""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["mtls_certificate"] - """The class of resource that the binding provides.""" diff --git a/src/cloudflare/types/workers/mtls_cert_binding_param.py b/src/cloudflare/types/workers/mtls_cert_binding_param.py deleted file mode 100644 index 5dbf4a2d61b..00000000000 --- a/src/cloudflare/types/workers/mtls_cert_binding_param.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, TypedDict - -__all__ = ["MTLSCERTBindingParam"] - - -class MTLSCERTBindingParam(TypedDict, total=False): - certificate_id: Required[str] - """ID of the certificate to bind to""" - - type: Required[Literal["mtls_certificate"]] - """The class of resource that the binding provides.""" diff --git a/src/cloudflare/types/workers/placement_configuration.py b/src/cloudflare/types/workers/placement_configuration.py deleted file mode 100644 index 0eb2b9eec7d..00000000000 --- a/src/cloudflare/types/workers/placement_configuration.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["PlacementConfiguration"] - - -class PlacementConfiguration(BaseModel): - mode: Optional[Literal["smart"]] = None - """ - Enables - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - Only `"smart"` is currently supported - """ diff --git a/src/cloudflare/types/workers/placement_configuration_param.py b/src/cloudflare/types/workers/placement_configuration_param.py deleted file mode 100644 index f6ef4c070fd..00000000000 --- a/src/cloudflare/types/workers/placement_configuration_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, TypedDict - -__all__ = ["PlacementConfigurationParam"] - - -class PlacementConfigurationParam(TypedDict, total=False): - mode: Literal["smart"] - """ - Enables - [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - Only `"smart"` is currently supported - """ diff --git a/src/cloudflare/types/workers/r2_binding.py b/src/cloudflare/types/workers/r2_binding.py deleted file mode 100644 index 523844ac272..00000000000 --- a/src/cloudflare/types/workers/r2_binding.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["R2Binding"] - - -class R2Binding(BaseModel): - bucket_name: str - """R2 bucket to bind to""" - - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["r2_bucket"] - """The class of resource that the binding provides.""" diff --git a/src/cloudflare/types/workers/r2_binding_param.py b/src/cloudflare/types/workers/r2_binding_param.py deleted file mode 100644 index 559667ded10..00000000000 --- a/src/cloudflare/types/workers/r2_binding_param.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, TypedDict - -__all__ = ["R2BindingParam"] - - -class R2BindingParam(TypedDict, total=False): - bucket_name: Required[str] - """R2 bucket to bind to""" - - type: Required[Literal["r2_bucket"]] - """The class of resource that the binding provides.""" diff --git a/src/cloudflare/types/workers/route_create_params.py b/src/cloudflare/types/workers/route_create_params.py new file mode 100644 index 00000000000..479c701b0e9 --- /dev/null +++ b/src/cloudflare/types/workers/route_create_params.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["RouteCreateParams"] + + +class RouteCreateParams(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + pattern: Required[str] + + script: str + """Name of the script, used in URLs and route configuration.""" diff --git a/src/cloudflare/types/addressing/prefixes/bgp/binding_delete_response.py b/src/cloudflare/types/workers/route_create_response.py similarity index 64% rename from src/cloudflare/types/addressing/prefixes/bgp/binding_delete_response.py rename to src/cloudflare/types/workers/route_create_response.py index 9746074b34a..9e27967d480 100644 --- a/src/cloudflare/types/addressing/prefixes/bgp/binding_delete_response.py +++ b/src/cloudflare/types/workers/route_create_response.py @@ -3,13 +3,13 @@ from typing import List from typing_extensions import Literal -from ....._models import BaseModel -from ....shared.response_info import ResponseInfo +from ..._models import BaseModel +from ..shared.response_info import ResponseInfo -__all__ = ["BindingDeleteResponse"] +__all__ = ["RouteCreateResponse"] -class BindingDeleteResponse(BaseModel): +class RouteCreateResponse(BaseModel): errors: List[ResponseInfo] messages: List[ResponseInfo] diff --git a/src/cloudflare/types/workers/route_delete_response.py b/src/cloudflare/types/workers/route_delete_response.py new file mode 100644 index 00000000000..df25ccce223 --- /dev/null +++ b/src/cloudflare/types/workers/route_delete_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import Literal + +from ..._models import BaseModel +from ..shared.response_info import ResponseInfo + +__all__ = ["RouteDeleteResponse"] + + +class RouteDeleteResponse(BaseModel): + errors: List[ResponseInfo] + + messages: List[ResponseInfo] + + success: Literal[True] + """Whether the API call was successful""" diff --git a/src/cloudflare/types/workers/route_get_response.py b/src/cloudflare/types/workers/route_get_response.py new file mode 100644 index 00000000000..169dcf43ea2 --- /dev/null +++ b/src/cloudflare/types/workers/route_get_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["RouteGetResponse"] + + +class RouteGetResponse(BaseModel): + id: str + """Identifier""" + + pattern: str + + script: str + """Name of the script, used in URLs and route configuration.""" diff --git a/src/cloudflare/types/workers/route_list_response.py b/src/cloudflare/types/workers/route_list_response.py new file mode 100644 index 00000000000..b6002c20b63 --- /dev/null +++ b/src/cloudflare/types/workers/route_list_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["RouteListResponse"] + + +class RouteListResponse(BaseModel): + id: str + """Identifier""" + + pattern: str + + script: str + """Name of the script, used in URLs and route configuration.""" diff --git a/src/cloudflare/types/workers/route_update_params.py b/src/cloudflare/types/workers/route_update_params.py new file mode 100644 index 00000000000..d4954d0bd6a --- /dev/null +++ b/src/cloudflare/types/workers/route_update_params.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["RouteUpdateParams"] + + +class RouteUpdateParams(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + pattern: Required[str] + + script: str + """Name of the script, used in URLs and route configuration.""" diff --git a/src/cloudflare/types/workers/route_update_response.py b/src/cloudflare/types/workers/route_update_response.py new file mode 100644 index 00000000000..1c2e70ac262 --- /dev/null +++ b/src/cloudflare/types/workers/route_update_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["RouteUpdateResponse"] + + +class RouteUpdateResponse(BaseModel): + id: str + """Identifier""" + + pattern: str + + script: str + """Name of the script, used in URLs and route configuration.""" diff --git a/src/cloudflare/types/workers/script.py b/src/cloudflare/types/workers/script.py index f57a98a895f..336e5797a4f 100644 --- a/src/cloudflare/types/workers/script.py +++ b/src/cloudflare/types/workers/script.py @@ -2,11 +2,26 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from ..._models import BaseModel from .scripts.consumer_script import ConsumerScript -__all__ = ["Script"] +__all__ = ["Script", "Placement"] + + +class Placement(BaseModel): + mode: Optional[Literal["smart"]] = None + """ + Enables + [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). + """ + + status: Optional[Literal["SUCCESS", "UNSUPPORTED_APPLICATION", "INSUFFICIENT_INVOCATIONS"]] = None + """ + Status of + [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). + """ class Script(BaseModel): @@ -31,11 +46,26 @@ class Script(BaseModel): modified_on: Optional[datetime] = None """When the script was last modified.""" - placement_mode: Optional[str] = None - """Specifies the placement mode for the Worker (e.g. 'smart').""" + placement: Optional[Placement] = None + """ + Configuration for + [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). + """ + + placement_mode: Optional[Literal["smart"]] = None + """ + Enables + [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). + """ + + placement_status: Optional[Literal["SUCCESS", "UNSUPPORTED_APPLICATION", "INSUFFICIENT_INVOCATIONS"]] = None + """ + Status of + [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). + """ tail_consumers: Optional[List[ConsumerScript]] = None """List of Workers that will consume logs from the attached Worker.""" - usage_model: Optional[str] = None - """Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound').""" + usage_model: Optional[Literal["standard"]] = None + """Usage model for the Worker invocations.""" diff --git a/src/cloudflare/types/workers/script_get_response.py b/src/cloudflare/types/workers/script_get_response.py new file mode 100644 index 00000000000..7d789c074c7 --- /dev/null +++ b/src/cloudflare/types/workers/script_get_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["ScriptGetResponse"] + +ScriptGetResponse: TypeAlias = str diff --git a/src/cloudflare/types/workers/script_update_params.py b/src/cloudflare/types/workers/script_update_params.py index ebdb23511ac..3bac9979ed1 100644 --- a/src/cloudflare/types/workers/script_update_params.py +++ b/src/cloudflare/types/workers/script_update_params.py @@ -3,54 +3,56 @@ from __future__ import annotations from typing import Dict, List, Union, Iterable, Optional -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Literal, Required, TypeAlias, TypedDict -from ..._types import FileTypes -from ..._utils import PropertyInfo -from .stepped_migration_param import SteppedMigrationParam +from .migration_step_param import MigrationStepParam from .single_step_migration_param import SingleStepMigrationParam -from .placement_configuration_param import PlacementConfigurationParam from .scripts.consumer_script_param import ConsumerScriptParam __all__ = [ "ScriptUpdateParams", - "Variant0", - "Variant0Metadata", - "Variant0MetadataAssets", - "Variant0MetadataAssetsConfig", - "Variant0MetadataBinding", - "Variant0MetadataMigrations", - "Variant0MetadataObservability", - "Variant1", + "Metadata", + "MetadataAssets", + "MetadataAssetsConfig", + "MetadataBinding", + "MetadataBindingWorkersBindingKindAny", + "MetadataBindingWorkersBindingKindAI", + "MetadataBindingWorkersBindingKindAnalyticsEngine", + "MetadataBindingWorkersBindingKindAssets", + "MetadataBindingWorkersBindingKindBrowserRendering", + "MetadataBindingWorkersBindingKindD1", + "MetadataBindingWorkersBindingKindDispatchNamespace", + "MetadataBindingWorkersBindingKindDispatchNamespaceOutbound", + "MetadataBindingWorkersBindingKindDispatchNamespaceOutboundWorker", + "MetadataBindingWorkersBindingKindDo", + "MetadataBindingWorkersBindingKindHyperdrive", + "MetadataBindingWorkersBindingKindJson", + "MetadataBindingWorkersBindingKindKVNamespace", + "MetadataBindingWorkersBindingKindMTLSCERT", + "MetadataBindingWorkersBindingKindPlainText", + "MetadataBindingWorkersBindingKindQueue", + "MetadataBindingWorkersBindingKindR2", + "MetadataBindingWorkersBindingKindSecret", + "MetadataBindingWorkersBindingKindService", + "MetadataBindingWorkersBindingKindTailConsumer", + "MetadataBindingWorkersBindingKindVectorize", + "MetadataBindingWorkersBindingKindVersionMetadata", + "MetadataMigrations", + "MetadataMigrationsWorkersMultipleStepMigrations", + "MetadataObservability", + "MetadataPlacement", ] -class Variant0(TypedDict, total=False): +class ScriptUpdateParams(TypedDict, total=False): account_id: Required[str] """Identifier""" - rollback_to: str - """Rollback to provided deployment based on deployment ID. - - Request body will only parse a "message" part. You can learn more about - deployments - [here](https://developers.cloudflare.com/workers/platform/deployments/). - """ - - any_part_name: Annotated[List[FileTypes], PropertyInfo(alias="")] - """A module comprising a Worker script, often a javascript file. - - Multiple modules may be provided as separate named parts, but at least one - module must be present and referenced in the metadata as `main_module` or - `body_part` by part name. Source maps may also be included using the - `application/source-map` content type. - """ - - metadata: Variant0Metadata + metadata: Required[Metadata] """JSON encoded metadata about the uploaded parts and Worker configuration.""" -class Variant0MetadataAssetsConfig(TypedDict, total=False): +class MetadataAssetsConfig(TypedDict, total=False): html_handling: Literal["auto-trailing-slash", "force-trailing-slash", "drop-trailing-slash", "none"] """Determines the redirects and rewrites of requests for HTML content.""" @@ -68,32 +70,301 @@ class Variant0MetadataAssetsConfig(TypedDict, total=False): """ -class Variant0MetadataAssets(TypedDict, total=False): - config: Variant0MetadataAssetsConfig +class MetadataAssets(TypedDict, total=False): + config: MetadataAssetsConfig """Configuration for assets within a Worker.""" jwt: str """Token provided upon successful upload of all files from a registered manifest.""" -class Variant0MetadataBindingTyped(TypedDict, total=False): - name: str - """Name of the binding variable.""" +class MetadataBindingWorkersBindingKindAnyTyped(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" - type: str - """Type of binding. + type: Required[str] + """The kind of resource that the binding provides.""" - You can find more about bindings on our docs: - https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings. + +MetadataBindingWorkersBindingKindAny: TypeAlias = Union[MetadataBindingWorkersBindingKindAnyTyped, Dict[str, object]] + + +class MetadataBindingWorkersBindingKindAI(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["ai"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindAnalyticsEngine(TypedDict, total=False): + dataset: Required[str] + """The dataset name to bind to.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["analytics_engine"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindAssets(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["assets"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindBrowserRendering(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["browser_rendering"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindD1(TypedDict, total=False): + id: Required[str] + """Identifier of the D1 database to bind to.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["d1"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindDispatchNamespaceOutboundWorker(TypedDict, total=False): + environment: str + """Environment of the outbound worker.""" + + service: str + """Name of the outbound worker.""" + + +class MetadataBindingWorkersBindingKindDispatchNamespaceOutbound(TypedDict, total=False): + params: List[str] + """ + Pass information from the Dispatch Worker to the Outbound Worker through the + parameters. + """ + + worker: MetadataBindingWorkersBindingKindDispatchNamespaceOutboundWorker + """Outbound worker.""" + + +class MetadataBindingWorkersBindingKindDispatchNamespace(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + namespace: Required[str] + """Namespace to bind to.""" + + type: Required[Literal["dispatch_namespace"]] + """The kind of resource that the binding provides.""" + + outbound: MetadataBindingWorkersBindingKindDispatchNamespaceOutbound + """Outbound worker.""" + + +class MetadataBindingWorkersBindingKindDo(TypedDict, total=False): + class_name: Required[str] + """The exported class name of the Durable Object.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["durable_object_namespace"]] + """The kind of resource that the binding provides.""" + + environment: str + """The environment of the script_name to bind to.""" + + namespace_id: str + """Namespace identifier tag.""" + + script_name: str + """ + The script where the Durable Object is defined, if it is external to this + Worker. + """ + + +class MetadataBindingWorkersBindingKindHyperdrive(TypedDict, total=False): + id: Required[str] + """Identifier of the Hyperdrive connection to bind to.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["hyperdrive"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindJson(TypedDict, total=False): + json: Required[str] + """JSON data to use.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["json"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindKVNamespace(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + namespace_id: Required[str] + """Namespace identifier tag.""" + + type: Required[Literal["kv_namespace"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindMTLSCERT(TypedDict, total=False): + certificate_id: Required[str] + """Identifier of the certificate to bind to.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["mtls_certificate"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindPlainText(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + text: Required[str] + """The text value to use.""" + + type: Required[Literal["plain_text"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindQueue(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + queue_name: Required[str] + """Name of the Queue to bind to.""" + + type: Required[Literal["queue"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindR2(TypedDict, total=False): + bucket_name: Required[str] + """R2 bucket to bind to.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["r2_bucket"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindSecret(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + text: Required[str] + """The secret value to use.""" + + type: Required[Literal["secret_text"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindService(TypedDict, total=False): + environment: Required[str] + """Optional environment if the Worker utilizes one.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + service: Required[str] + """Name of Worker to bind to.""" + + type: Required[Literal["service"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindTailConsumer(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + service: Required[str] + """Name of Tail Worker to bind to.""" + + type: Required[Literal["tail_consumer"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindVectorize(TypedDict, total=False): + index_name: Required[str] + """Name of the Vectorize index to bind to.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["vectorize"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindVersionMetadata(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["version_metadata"]] + """The kind of resource that the binding provides.""" + + +MetadataBinding: TypeAlias = Union[ + MetadataBindingWorkersBindingKindAny, + MetadataBindingWorkersBindingKindAI, + MetadataBindingWorkersBindingKindAnalyticsEngine, + MetadataBindingWorkersBindingKindAssets, + MetadataBindingWorkersBindingKindBrowserRendering, + MetadataBindingWorkersBindingKindD1, + MetadataBindingWorkersBindingKindDispatchNamespace, + MetadataBindingWorkersBindingKindDo, + MetadataBindingWorkersBindingKindHyperdrive, + MetadataBindingWorkersBindingKindJson, + MetadataBindingWorkersBindingKindKVNamespace, + MetadataBindingWorkersBindingKindMTLSCERT, + MetadataBindingWorkersBindingKindPlainText, + MetadataBindingWorkersBindingKindQueue, + MetadataBindingWorkersBindingKindR2, + MetadataBindingWorkersBindingKindSecret, + MetadataBindingWorkersBindingKindService, + MetadataBindingWorkersBindingKindTailConsumer, + MetadataBindingWorkersBindingKindVectorize, + MetadataBindingWorkersBindingKindVersionMetadata, +] + + +class MetadataMigrationsWorkersMultipleStepMigrations(TypedDict, total=False): + new_tag: str + """Tag to set as the latest migration tag.""" + + old_tag: str + """Tag used to verify against the latest migration tag for this Worker. + + If they don't match, the upload is rejected. """ + steps: Iterable[MigrationStepParam] + """Migrations to apply in order.""" -Variant0MetadataBinding: TypeAlias = Union[Variant0MetadataBindingTyped, Dict[str, object]] -Variant0MetadataMigrations: TypeAlias = Union[SingleStepMigrationParam, SteppedMigrationParam] +MetadataMigrations: TypeAlias = Union[SingleStepMigrationParam, MetadataMigrationsWorkersMultipleStepMigrations] -class Variant0MetadataObservability(TypedDict, total=False): +class MetadataObservability(TypedDict, total=False): enabled: Required[bool] """Whether observability is enabled for the Worker.""" @@ -104,12 +375,24 @@ class Variant0MetadataObservability(TypedDict, total=False): """ -class Variant0Metadata(TypedDict, total=False): - assets: Variant0MetadataAssets +class MetadataPlacement(TypedDict, total=False): + mode: Literal["smart"] + """ + Enables + [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). + """ + + +class Metadata(TypedDict, total=False): + assets: MetadataAssets """Configuration for assets within a Worker""" - bindings: Iterable[Variant0MetadataBinding] - """List of bindings available to the worker.""" + bindings: Iterable[MetadataBinding] + """List of bindings attached to a Worker. + + You can find more about bindings on our docs: + https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings. + """ body_part: str """Name of the part in the multipart request that contains the script (e.g. @@ -150,13 +433,17 @@ class Variant0Metadata(TypedDict, total=False): the file exporting a `fetch` handler). Indicates a `module syntax` Worker. """ - migrations: Variant0MetadataMigrations + migrations: MetadataMigrations """Migrations to apply for Durable Objects associated with this Worker.""" - observability: Variant0MetadataObservability + observability: MetadataObservability """Observability settings for the Worker.""" - placement: PlacementConfigurationParam + placement: MetadataPlacement + """ + Configuration for + [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). + """ tags: List[str] """List of strings to use as tags for this Worker.""" @@ -164,30 +451,5 @@ class Variant0Metadata(TypedDict, total=False): tail_consumers: Iterable[ConsumerScriptParam] """List of Workers that will consume logs from the attached Worker.""" - usage_model: Literal["bundled", "unbound"] - """Usage model to apply to invocations.""" - - version_tags: Dict[str, str] - """Key-value pairs to use as tags for this version of this Worker.""" - - -class Variant1(TypedDict, total=False): - account_id: Required[str] - """Identifier""" - - rollback_to: str - """Rollback to provided deployment based on deployment ID. - - Request body will only parse a "message" part. You can learn more about - deployments - [here](https://developers.cloudflare.com/workers/platform/deployments/). - """ - - message: str - """Rollback message to be associated with this deployment. - - Only parsed when query param `"rollback_to"` is present. - """ - - -ScriptUpdateParams: TypeAlias = Union[Variant0, Variant1] + usage_model: Literal["standard"] + """Usage model for the Worker invocations.""" diff --git a/src/cloudflare/types/workers/script_update_response.py b/src/cloudflare/types/workers/script_update_response.py index b677f246eda..53d735b8638 100644 --- a/src/cloudflare/types/workers/script_update_response.py +++ b/src/cloudflare/types/workers/script_update_response.py @@ -2,11 +2,26 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from ..._models import BaseModel from .scripts.consumer_script import ConsumerScript -__all__ = ["ScriptUpdateResponse"] +__all__ = ["ScriptUpdateResponse", "Placement"] + + +class Placement(BaseModel): + mode: Optional[Literal["smart"]] = None + """ + Enables + [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). + """ + + status: Optional[Literal["SUCCESS", "UNSUPPORTED_APPLICATION", "INSUFFICIENT_INVOCATIONS"]] = None + """ + Status of + [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). + """ class ScriptUpdateResponse(BaseModel): @@ -31,13 +46,28 @@ class ScriptUpdateResponse(BaseModel): modified_on: Optional[datetime] = None """When the script was last modified.""" - placement_mode: Optional[str] = None - """Specifies the placement mode for the Worker (e.g. 'smart').""" + placement: Optional[Placement] = None + """ + Configuration for + [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). + """ + + placement_mode: Optional[Literal["smart"]] = None + """ + Enables + [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). + """ + + placement_status: Optional[Literal["SUCCESS", "UNSUPPORTED_APPLICATION", "INSUFFICIENT_INVOCATIONS"]] = None + """ + Status of + [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). + """ startup_time_ms: Optional[int] = None tail_consumers: Optional[List[ConsumerScript]] = None """List of Workers that will consume logs from the attached Worker.""" - usage_model: Optional[str] = None - """Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound').""" + usage_model: Optional[Literal["standard"]] = None + """Usage model for the Worker invocations.""" diff --git a/src/cloudflare/types/workers/scripts/content_update_params.py b/src/cloudflare/types/workers/scripts/content_update_params.py index f5c5e96e343..4228706762e 100644 --- a/src/cloudflare/types/workers/scripts/content_update_params.py +++ b/src/cloudflare/types/workers/scripts/content_update_params.py @@ -2,10 +2,8 @@ from __future__ import annotations -from typing import List from typing_extensions import Required, Annotated, TypedDict -from ...._types import FileTypes from ...._utils import PropertyInfo from ..worker_metadata_param import WorkerMetadataParam @@ -16,18 +14,7 @@ class ContentUpdateParams(TypedDict, total=False): account_id: Required[str] """Identifier""" - any_part_name: Annotated[List[FileTypes], PropertyInfo(alias="")] - """A module comprising a Worker script, often a javascript file. - - Multiple modules may be provided as separate named parts, but at least one - module must be present. This should be referenced either in the metadata as - `main_module` (esm)/`body_part` (service worker) or as a header - `CF-WORKER-MAIN-MODULE-PART` (esm) /`CF-WORKER-BODY-PART` (service worker) by - part name. Source maps may also be included using the `application/source-map` - content type. - """ - - metadata: WorkerMetadataParam + metadata: Required[WorkerMetadataParam] """JSON encoded metadata about the uploaded parts and Worker configuration.""" cf_worker_body_part: Annotated[str, PropertyInfo(alias="CF-WORKER-BODY-PART")] diff --git a/src/cloudflare/types/workers/scripts/version_create_params.py b/src/cloudflare/types/workers/scripts/version_create_params.py index a80b0f876e9..ea793046aa2 100644 --- a/src/cloudflare/types/workers/scripts/version_create_params.py +++ b/src/cloudflare/types/workers/scripts/version_create_params.py @@ -2,27 +2,46 @@ from __future__ import annotations -from typing import List, Iterable -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing import Dict, List, Union, Iterable +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict -from ...._types import FileTypes from ...._utils import PropertyInfo -__all__ = ["VersionCreateParams", "Metadata", "MetadataAnnotations"] +__all__ = [ + "VersionCreateParams", + "Metadata", + "MetadataAnnotations", + "MetadataBinding", + "MetadataBindingWorkersBindingKindAny", + "MetadataBindingWorkersBindingKindAI", + "MetadataBindingWorkersBindingKindAnalyticsEngine", + "MetadataBindingWorkersBindingKindAssets", + "MetadataBindingWorkersBindingKindBrowserRendering", + "MetadataBindingWorkersBindingKindD1", + "MetadataBindingWorkersBindingKindDispatchNamespace", + "MetadataBindingWorkersBindingKindDispatchNamespaceOutbound", + "MetadataBindingWorkersBindingKindDispatchNamespaceOutboundWorker", + "MetadataBindingWorkersBindingKindDo", + "MetadataBindingWorkersBindingKindHyperdrive", + "MetadataBindingWorkersBindingKindJson", + "MetadataBindingWorkersBindingKindKVNamespace", + "MetadataBindingWorkersBindingKindMTLSCERT", + "MetadataBindingWorkersBindingKindPlainText", + "MetadataBindingWorkersBindingKindQueue", + "MetadataBindingWorkersBindingKindR2", + "MetadataBindingWorkersBindingKindSecret", + "MetadataBindingWorkersBindingKindService", + "MetadataBindingWorkersBindingKindTailConsumer", + "MetadataBindingWorkersBindingKindVectorize", + "MetadataBindingWorkersBindingKindVersionMetadata", +] class VersionCreateParams(TypedDict, total=False): account_id: Required[str] """Identifier""" - any_part_name: Annotated[List[FileTypes], PropertyInfo(alias="")] - """A module comprising a Worker script, often a javascript file. - - Multiple modules may be provided as separate named parts, but at least one - module must be present and referenced in the metadata as `main_module`. - """ - - metadata: Metadata + metadata: Required[Metadata] """JSON encoded metadata about the uploaded parts and Worker configuration.""" @@ -34,11 +53,291 @@ class MetadataAnnotations(TypedDict, total=False): """User-provided identifier for the version.""" +class MetadataBindingWorkersBindingKindAnyTyped(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[str] + """The kind of resource that the binding provides.""" + + +MetadataBindingWorkersBindingKindAny: TypeAlias = Union[MetadataBindingWorkersBindingKindAnyTyped, Dict[str, object]] + + +class MetadataBindingWorkersBindingKindAI(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["ai"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindAnalyticsEngine(TypedDict, total=False): + dataset: Required[str] + """The dataset name to bind to.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["analytics_engine"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindAssets(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["assets"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindBrowserRendering(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["browser_rendering"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindD1(TypedDict, total=False): + id: Required[str] + """Identifier of the D1 database to bind to.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["d1"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindDispatchNamespaceOutboundWorker(TypedDict, total=False): + environment: str + """Environment of the outbound worker.""" + + service: str + """Name of the outbound worker.""" + + +class MetadataBindingWorkersBindingKindDispatchNamespaceOutbound(TypedDict, total=False): + params: List[str] + """ + Pass information from the Dispatch Worker to the Outbound Worker through the + parameters. + """ + + worker: MetadataBindingWorkersBindingKindDispatchNamespaceOutboundWorker + """Outbound worker.""" + + +class MetadataBindingWorkersBindingKindDispatchNamespace(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + namespace: Required[str] + """Namespace to bind to.""" + + type: Required[Literal["dispatch_namespace"]] + """The kind of resource that the binding provides.""" + + outbound: MetadataBindingWorkersBindingKindDispatchNamespaceOutbound + """Outbound worker.""" + + +class MetadataBindingWorkersBindingKindDo(TypedDict, total=False): + class_name: Required[str] + """The exported class name of the Durable Object.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["durable_object_namespace"]] + """The kind of resource that the binding provides.""" + + environment: str + """The environment of the script_name to bind to.""" + + namespace_id: str + """Namespace identifier tag.""" + + script_name: str + """ + The script where the Durable Object is defined, if it is external to this + Worker. + """ + + +class MetadataBindingWorkersBindingKindHyperdrive(TypedDict, total=False): + id: Required[str] + """Identifier of the Hyperdrive connection to bind to.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["hyperdrive"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindJson(TypedDict, total=False): + json: Required[str] + """JSON data to use.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["json"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindKVNamespace(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + namespace_id: Required[str] + """Namespace identifier tag.""" + + type: Required[Literal["kv_namespace"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindMTLSCERT(TypedDict, total=False): + certificate_id: Required[str] + """Identifier of the certificate to bind to.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["mtls_certificate"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindPlainText(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + text: Required[str] + """The text value to use.""" + + type: Required[Literal["plain_text"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindQueue(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + queue_name: Required[str] + """Name of the Queue to bind to.""" + + type: Required[Literal["queue"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindR2(TypedDict, total=False): + bucket_name: Required[str] + """R2 bucket to bind to.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["r2_bucket"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindSecret(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + text: Required[str] + """The secret value to use.""" + + type: Required[Literal["secret_text"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindService(TypedDict, total=False): + environment: Required[str] + """Optional environment if the Worker utilizes one.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + service: Required[str] + """Name of Worker to bind to.""" + + type: Required[Literal["service"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindTailConsumer(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + service: Required[str] + """Name of Tail Worker to bind to.""" + + type: Required[Literal["tail_consumer"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindVectorize(TypedDict, total=False): + index_name: Required[str] + """Name of the Vectorize index to bind to.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["vectorize"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindVersionMetadata(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["version_metadata"]] + """The kind of resource that the binding provides.""" + + +MetadataBinding: TypeAlias = Union[ + MetadataBindingWorkersBindingKindAny, + MetadataBindingWorkersBindingKindAI, + MetadataBindingWorkersBindingKindAnalyticsEngine, + MetadataBindingWorkersBindingKindAssets, + MetadataBindingWorkersBindingKindBrowserRendering, + MetadataBindingWorkersBindingKindD1, + MetadataBindingWorkersBindingKindDispatchNamespace, + MetadataBindingWorkersBindingKindDo, + MetadataBindingWorkersBindingKindHyperdrive, + MetadataBindingWorkersBindingKindJson, + MetadataBindingWorkersBindingKindKVNamespace, + MetadataBindingWorkersBindingKindMTLSCERT, + MetadataBindingWorkersBindingKindPlainText, + MetadataBindingWorkersBindingKindQueue, + MetadataBindingWorkersBindingKindR2, + MetadataBindingWorkersBindingKindSecret, + MetadataBindingWorkersBindingKindService, + MetadataBindingWorkersBindingKindTailConsumer, + MetadataBindingWorkersBindingKindVectorize, + MetadataBindingWorkersBindingKindVersionMetadata, +] + + class Metadata(TypedDict, total=False): + main_module: Required[str] + """Name of the part in the multipart request that contains the main module (e.g. + + the file exporting a `fetch` handler). Indicates a `module syntax` Worker, which + is required for Version Upload. + """ + annotations: MetadataAnnotations - bindings: Iterable[object] - """List of bindings available to the worker.""" + bindings: Iterable[MetadataBinding] + """List of bindings attached to a Worker. + + You can find more about bindings on our docs: + https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings. + """ compatibility_date: str """Date indicating targeted support in the Workers runtime. @@ -57,11 +356,5 @@ class Metadata(TypedDict, total=False): keep_bindings: List[str] """List of binding types to keep from previous_upload.""" - main_module: str - """Name of the part in the multipart request that contains the main module (e.g. - - the file exporting a `fetch` handler). Indicates a `module syntax` Worker. - """ - usage_model: Literal["standard"] - """Usage model to apply to invocations.""" + """Usage model for the Worker invocations.""" diff --git a/src/cloudflare/types/workers/service_binding.py b/src/cloudflare/types/workers/service_binding.py deleted file mode 100644 index ffd0c7b07f5..00000000000 --- a/src/cloudflare/types/workers/service_binding.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["ServiceBinding"] - - -class ServiceBinding(BaseModel): - environment: str - """Optional environment if the Worker utilizes one.""" - - name: str - """A JavaScript variable name for the binding.""" - - service: str - """Name of Worker to bind to""" - - type: Literal["service"] - """The class of resource that the binding provides.""" diff --git a/src/cloudflare/types/workers/service_binding_param.py b/src/cloudflare/types/workers/service_binding_param.py deleted file mode 100644 index 52ecb335075..00000000000 --- a/src/cloudflare/types/workers/service_binding_param.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, TypedDict - -__all__ = ["ServiceBindingParam"] - - -class ServiceBindingParam(TypedDict, total=False): - environment: Required[str] - """Optional environment if the Worker utilizes one.""" - - service: Required[str] - """Name of Worker to bind to""" - - type: Required[Literal["service"]] - """The class of resource that the binding provides.""" diff --git a/src/cloudflare/types/workers/stepped_migration.py b/src/cloudflare/types/workers/stepped_migration.py deleted file mode 100644 index 3383a9a473f..00000000000 --- a/src/cloudflare/types/workers/stepped_migration.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel -from .migration_step import MigrationStep - -__all__ = ["SteppedMigration"] - - -class SteppedMigration(BaseModel): - new_tag: Optional[str] = None - """Tag to set as the latest migration tag.""" - - old_tag: Optional[str] = None - """Tag used to verify against the latest migration tag for this Worker. - - If they don't match, the upload is rejected. - """ - - steps: Optional[List[MigrationStep]] = None - """Migrations to apply in order.""" diff --git a/src/cloudflare/types/workers/stepped_migration_param.py b/src/cloudflare/types/workers/stepped_migration_param.py deleted file mode 100644 index 2465041142b..00000000000 --- a/src/cloudflare/types/workers/stepped_migration_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import TypedDict - -from .migration_step_param import MigrationStepParam - -__all__ = ["SteppedMigrationParam"] - - -class SteppedMigrationParam(TypedDict, total=False): - new_tag: str - """Tag to set as the latest migration tag.""" - - old_tag: str - """Tag used to verify against the latest migration tag for this Worker. - - If they don't match, the upload is rejected. - """ - - steps: Iterable[MigrationStepParam] - """Migrations to apply in order.""" diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py index 13d32321c3f..0470a9fe602 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py @@ -3,49 +3,59 @@ from __future__ import annotations from typing import Dict, List, Union, Iterable, Optional -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import Literal, Required, TypeAlias, TypedDict -from ....._types import FileTypes -from ....._utils import PropertyInfo -from ....workers.stepped_migration_param import SteppedMigrationParam +from ....workers.migration_step_param import MigrationStepParam from ....workers.single_step_migration_param import SingleStepMigrationParam -from ....workers.placement_configuration_param import PlacementConfigurationParam from ....workers.scripts.consumer_script_param import ConsumerScriptParam __all__ = [ "ScriptUpdateParams", - "Variant0", - "Variant0Metadata", - "Variant0MetadataAssets", - "Variant0MetadataAssetsConfig", - "Variant0MetadataBinding", - "Variant0MetadataMigrations", - "Variant0MetadataObservability", - "Variant1", + "Metadata", + "MetadataAssets", + "MetadataAssetsConfig", + "MetadataBinding", + "MetadataBindingWorkersBindingKindAny", + "MetadataBindingWorkersBindingKindAI", + "MetadataBindingWorkersBindingKindAnalyticsEngine", + "MetadataBindingWorkersBindingKindAssets", + "MetadataBindingWorkersBindingKindBrowserRendering", + "MetadataBindingWorkersBindingKindD1", + "MetadataBindingWorkersBindingKindDispatchNamespace", + "MetadataBindingWorkersBindingKindDispatchNamespaceOutbound", + "MetadataBindingWorkersBindingKindDispatchNamespaceOutboundWorker", + "MetadataBindingWorkersBindingKindDo", + "MetadataBindingWorkersBindingKindHyperdrive", + "MetadataBindingWorkersBindingKindJson", + "MetadataBindingWorkersBindingKindKVNamespace", + "MetadataBindingWorkersBindingKindMTLSCERT", + "MetadataBindingWorkersBindingKindPlainText", + "MetadataBindingWorkersBindingKindQueue", + "MetadataBindingWorkersBindingKindR2", + "MetadataBindingWorkersBindingKindSecret", + "MetadataBindingWorkersBindingKindService", + "MetadataBindingWorkersBindingKindTailConsumer", + "MetadataBindingWorkersBindingKindVectorize", + "MetadataBindingWorkersBindingKindVersionMetadata", + "MetadataMigrations", + "MetadataMigrationsWorkersMultipleStepMigrations", + "MetadataObservability", + "MetadataPlacement", ] -class Variant0(TypedDict, total=False): +class ScriptUpdateParams(TypedDict, total=False): account_id: Required[str] """Identifier""" dispatch_namespace: Required[str] """Name of the Workers for Platforms dispatch namespace.""" - any_part_name: Annotated[List[FileTypes], PropertyInfo(alias="")] - """A module comprising a Worker script, often a javascript file. - - Multiple modules may be provided as separate named parts, but at least one - module must be present and referenced in the metadata as `main_module` or - `body_part` by part name. Source maps may also be included using the - `application/source-map` content type. - """ - - metadata: Variant0Metadata + metadata: Required[Metadata] """JSON encoded metadata about the uploaded parts and Worker configuration.""" -class Variant0MetadataAssetsConfig(TypedDict, total=False): +class MetadataAssetsConfig(TypedDict, total=False): html_handling: Literal["auto-trailing-slash", "force-trailing-slash", "drop-trailing-slash", "none"] """Determines the redirects and rewrites of requests for HTML content.""" @@ -63,32 +73,301 @@ class Variant0MetadataAssetsConfig(TypedDict, total=False): """ -class Variant0MetadataAssets(TypedDict, total=False): - config: Variant0MetadataAssetsConfig +class MetadataAssets(TypedDict, total=False): + config: MetadataAssetsConfig """Configuration for assets within a Worker.""" jwt: str """Token provided upon successful upload of all files from a registered manifest.""" -class Variant0MetadataBindingTyped(TypedDict, total=False): - name: str - """Name of the binding variable.""" +class MetadataBindingWorkersBindingKindAnyTyped(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" - type: str - """Type of binding. + type: Required[str] + """The kind of resource that the binding provides.""" - You can find more about bindings on our docs: - https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings. + +MetadataBindingWorkersBindingKindAny: TypeAlias = Union[MetadataBindingWorkersBindingKindAnyTyped, Dict[str, object]] + + +class MetadataBindingWorkersBindingKindAI(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["ai"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindAnalyticsEngine(TypedDict, total=False): + dataset: Required[str] + """The dataset name to bind to.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["analytics_engine"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindAssets(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["assets"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindBrowserRendering(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["browser_rendering"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindD1(TypedDict, total=False): + id: Required[str] + """Identifier of the D1 database to bind to.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["d1"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindDispatchNamespaceOutboundWorker(TypedDict, total=False): + environment: str + """Environment of the outbound worker.""" + + service: str + """Name of the outbound worker.""" + + +class MetadataBindingWorkersBindingKindDispatchNamespaceOutbound(TypedDict, total=False): + params: List[str] + """ + Pass information from the Dispatch Worker to the Outbound Worker through the + parameters. + """ + + worker: MetadataBindingWorkersBindingKindDispatchNamespaceOutboundWorker + """Outbound worker.""" + + +class MetadataBindingWorkersBindingKindDispatchNamespace(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + namespace: Required[str] + """Namespace to bind to.""" + + type: Required[Literal["dispatch_namespace"]] + """The kind of resource that the binding provides.""" + + outbound: MetadataBindingWorkersBindingKindDispatchNamespaceOutbound + """Outbound worker.""" + + +class MetadataBindingWorkersBindingKindDo(TypedDict, total=False): + class_name: Required[str] + """The exported class name of the Durable Object.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["durable_object_namespace"]] + """The kind of resource that the binding provides.""" + + environment: str + """The environment of the script_name to bind to.""" + + namespace_id: str + """Namespace identifier tag.""" + + script_name: str """ + The script where the Durable Object is defined, if it is external to this + Worker. + """ + + +class MetadataBindingWorkersBindingKindHyperdrive(TypedDict, total=False): + id: Required[str] + """Identifier of the Hyperdrive connection to bind to.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["hyperdrive"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindJson(TypedDict, total=False): + json: Required[str] + """JSON data to use.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["json"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindKVNamespace(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + namespace_id: Required[str] + """Namespace identifier tag.""" + + type: Required[Literal["kv_namespace"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindMTLSCERT(TypedDict, total=False): + certificate_id: Required[str] + """Identifier of the certificate to bind to.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["mtls_certificate"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindPlainText(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + text: Required[str] + """The text value to use.""" -Variant0MetadataBinding: TypeAlias = Union[Variant0MetadataBindingTyped, Dict[str, object]] + type: Required[Literal["plain_text"]] + """The kind of resource that the binding provides.""" -Variant0MetadataMigrations: TypeAlias = Union[SingleStepMigrationParam, SteppedMigrationParam] +class MetadataBindingWorkersBindingKindQueue(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" -class Variant0MetadataObservability(TypedDict, total=False): + queue_name: Required[str] + """Name of the Queue to bind to.""" + + type: Required[Literal["queue"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindR2(TypedDict, total=False): + bucket_name: Required[str] + """R2 bucket to bind to.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["r2_bucket"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindSecret(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + text: Required[str] + """The secret value to use.""" + + type: Required[Literal["secret_text"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindService(TypedDict, total=False): + environment: Required[str] + """Optional environment if the Worker utilizes one.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + service: Required[str] + """Name of Worker to bind to.""" + + type: Required[Literal["service"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindTailConsumer(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + service: Required[str] + """Name of Tail Worker to bind to.""" + + type: Required[Literal["tail_consumer"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindVectorize(TypedDict, total=False): + index_name: Required[str] + """Name of the Vectorize index to bind to.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["vectorize"]] + """The kind of resource that the binding provides.""" + + +class MetadataBindingWorkersBindingKindVersionMetadata(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["version_metadata"]] + """The kind of resource that the binding provides.""" + + +MetadataBinding: TypeAlias = Union[ + MetadataBindingWorkersBindingKindAny, + MetadataBindingWorkersBindingKindAI, + MetadataBindingWorkersBindingKindAnalyticsEngine, + MetadataBindingWorkersBindingKindAssets, + MetadataBindingWorkersBindingKindBrowserRendering, + MetadataBindingWorkersBindingKindD1, + MetadataBindingWorkersBindingKindDispatchNamespace, + MetadataBindingWorkersBindingKindDo, + MetadataBindingWorkersBindingKindHyperdrive, + MetadataBindingWorkersBindingKindJson, + MetadataBindingWorkersBindingKindKVNamespace, + MetadataBindingWorkersBindingKindMTLSCERT, + MetadataBindingWorkersBindingKindPlainText, + MetadataBindingWorkersBindingKindQueue, + MetadataBindingWorkersBindingKindR2, + MetadataBindingWorkersBindingKindSecret, + MetadataBindingWorkersBindingKindService, + MetadataBindingWorkersBindingKindTailConsumer, + MetadataBindingWorkersBindingKindVectorize, + MetadataBindingWorkersBindingKindVersionMetadata, +] + + +class MetadataMigrationsWorkersMultipleStepMigrations(TypedDict, total=False): + new_tag: str + """Tag to set as the latest migration tag.""" + + old_tag: str + """Tag used to verify against the latest migration tag for this Worker. + + If they don't match, the upload is rejected. + """ + + steps: Iterable[MigrationStepParam] + """Migrations to apply in order.""" + + +MetadataMigrations: TypeAlias = Union[SingleStepMigrationParam, MetadataMigrationsWorkersMultipleStepMigrations] + + +class MetadataObservability(TypedDict, total=False): enabled: Required[bool] """Whether observability is enabled for the Worker.""" @@ -99,12 +378,24 @@ class Variant0MetadataObservability(TypedDict, total=False): """ -class Variant0Metadata(TypedDict, total=False): - assets: Variant0MetadataAssets +class MetadataPlacement(TypedDict, total=False): + mode: Literal["smart"] + """ + Enables + [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). + """ + + +class Metadata(TypedDict, total=False): + assets: MetadataAssets """Configuration for assets within a Worker""" - bindings: Iterable[Variant0MetadataBinding] - """List of bindings available to the worker.""" + bindings: Iterable[MetadataBinding] + """List of bindings attached to a Worker. + + You can find more about bindings on our docs: + https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings. + """ body_part: str """Name of the part in the multipart request that contains the script (e.g. @@ -145,13 +436,17 @@ class Variant0Metadata(TypedDict, total=False): the file exporting a `fetch` handler). Indicates a `module syntax` Worker. """ - migrations: Variant0MetadataMigrations + migrations: MetadataMigrations """Migrations to apply for Durable Objects associated with this Worker.""" - observability: Variant0MetadataObservability + observability: MetadataObservability """Observability settings for the Worker.""" - placement: PlacementConfigurationParam + placement: MetadataPlacement + """ + Configuration for + [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). + """ tags: List[str] """List of strings to use as tags for this Worker.""" @@ -159,25 +454,5 @@ class Variant0Metadata(TypedDict, total=False): tail_consumers: Iterable[ConsumerScriptParam] """List of Workers that will consume logs from the attached Worker.""" - usage_model: Literal["bundled", "unbound"] - """Usage model to apply to invocations.""" - - version_tags: Dict[str, str] - """Key-value pairs to use as tags for this version of this Worker.""" - - -class Variant1(TypedDict, total=False): - account_id: Required[str] - """Identifier""" - - dispatch_namespace: Required[str] - """Name of the Workers for Platforms dispatch namespace.""" - - message: str - """Rollback message to be associated with this deployment. - - Only parsed when query param `"rollback_to"` is present. - """ - - -ScriptUpdateParams: TypeAlias = Union[Variant0, Variant1] + usage_model: Literal["standard"] + """Usage model for the Worker invocations.""" diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_response.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_response.py index e4fd8cf4809..d79a5e9b267 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_response.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_response.py @@ -2,11 +2,26 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from ....._models import BaseModel from ....workers.scripts.consumer_script import ConsumerScript -__all__ = ["ScriptUpdateResponse"] +__all__ = ["ScriptUpdateResponse", "Placement"] + + +class Placement(BaseModel): + mode: Optional[Literal["smart"]] = None + """ + Enables + [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). + """ + + status: Optional[Literal["SUCCESS", "UNSUPPORTED_APPLICATION", "INSUFFICIENT_INVOCATIONS"]] = None + """ + Status of + [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). + """ class ScriptUpdateResponse(BaseModel): @@ -31,13 +46,28 @@ class ScriptUpdateResponse(BaseModel): modified_on: Optional[datetime] = None """When the script was last modified.""" - placement_mode: Optional[str] = None - """Specifies the placement mode for the Worker (e.g. 'smart').""" + placement: Optional[Placement] = None + """ + Configuration for + [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). + """ + + placement_mode: Optional[Literal["smart"]] = None + """ + Enables + [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). + """ + + placement_status: Optional[Literal["SUCCESS", "UNSUPPORTED_APPLICATION", "INSUFFICIENT_INVOCATIONS"]] = None + """ + Status of + [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). + """ startup_time_ms: Optional[int] = None tail_consumers: Optional[List[ConsumerScript]] = None """List of Workers that will consume logs from the attached Worker.""" - usage_model: Optional[str] = None - """Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound').""" + usage_model: Optional[Literal["standard"]] = None + """Usage model for the Worker invocations.""" diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/__init__.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/__init__.py index b1e6bf59e47..b1d4cb724c8 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/__init__.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/__init__.py @@ -14,3 +14,5 @@ from .content_update_params import ContentUpdateParams as ContentUpdateParams from .setting_edit_response import SettingEditResponse as SettingEditResponse from .secret_update_response import SecretUpdateResponse as SecretUpdateResponse +from .asset_upload_create_params import AssetUploadCreateParams as AssetUploadCreateParams +from .asset_upload_create_response import AssetUploadCreateResponse as AssetUploadCreateResponse diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/asset_upload_create_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/asset_upload_create_params.py new file mode 100644 index 00000000000..83870f01ad2 --- /dev/null +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/asset_upload_create_params.py @@ -0,0 +1,30 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict +from typing_extensions import Required, TypedDict + +__all__ = ["AssetUploadCreateParams", "Manifest"] + + +class AssetUploadCreateParams(TypedDict, total=False): + account_id: Required[str] + """Identifier""" + + dispatch_namespace: Required[str] + """Name of the Workers for Platforms dispatch namespace.""" + + manifest: Dict[str, Manifest] + """A manifest ([path]: {hash, size}) map of files to upload. + + As an example, `/blog/hello-world.html` would be a valid path key. + """ + + +class Manifest(TypedDict, total=False): + hash: str + """The hash of the file.""" + + size: int + """The size of the file in bytes.""" diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/asset_upload_create_response.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/asset_upload_create_response.py new file mode 100644 index 00000000000..e25a814291a --- /dev/null +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/asset_upload_create_response.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ......_models import BaseModel + +__all__ = ["AssetUploadCreateResponse"] + + +class AssetUploadCreateResponse(BaseModel): + buckets: Optional[List[List[str]]] = None + """The requests to make to upload assets.""" + + jwt: Optional[str] = None + """A JWT to use as authentication for uploading assets.""" diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py index b7a3d0c673f..c347a833b16 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py @@ -1,10 +1,309 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List -from typing_extensions import TypeAlias +from typing import TYPE_CHECKING, List, Union, Optional +from typing_extensions import Literal, TypeAlias -from .....workers.binding import Binding +from pydantic import Field as FieldInfo -__all__ = ["BindingGetResponse"] +from ......_models import BaseModel -BindingGetResponse: TypeAlias = List[Binding] +__all__ = [ + "BindingGetResponse", + "BindingGetResponseItem", + "BindingGetResponseItemWorkersBindingKindAny", + "BindingGetResponseItemWorkersBindingKindAI", + "BindingGetResponseItemWorkersBindingKindAnalyticsEngine", + "BindingGetResponseItemWorkersBindingKindAssets", + "BindingGetResponseItemWorkersBindingKindBrowserRendering", + "BindingGetResponseItemWorkersBindingKindD1", + "BindingGetResponseItemWorkersBindingKindDispatchNamespace", + "BindingGetResponseItemWorkersBindingKindDispatchNamespaceOutbound", + "BindingGetResponseItemWorkersBindingKindDispatchNamespaceOutboundWorker", + "BindingGetResponseItemWorkersBindingKindDo", + "BindingGetResponseItemWorkersBindingKindHyperdrive", + "BindingGetResponseItemWorkersBindingKindJson", + "BindingGetResponseItemWorkersBindingKindKVNamespace", + "BindingGetResponseItemWorkersBindingKindMTLSCERT", + "BindingGetResponseItemWorkersBindingKindPlainText", + "BindingGetResponseItemWorkersBindingKindQueue", + "BindingGetResponseItemWorkersBindingKindR2", + "BindingGetResponseItemWorkersBindingKindSecret", + "BindingGetResponseItemWorkersBindingKindService", + "BindingGetResponseItemWorkersBindingKindTailConsumer", + "BindingGetResponseItemWorkersBindingKindVectorize", + "BindingGetResponseItemWorkersBindingKindVersionMetadata", +] + + +class BindingGetResponseItemWorkersBindingKindAny(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: str + """The kind of resource that the binding provides.""" + + if TYPE_CHECKING: + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + + +class BindingGetResponseItemWorkersBindingKindAI(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["ai"] + """The kind of resource that the binding provides.""" + + +class BindingGetResponseItemWorkersBindingKindAnalyticsEngine(BaseModel): + dataset: str + """The dataset name to bind to.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["analytics_engine"] + """The kind of resource that the binding provides.""" + + +class BindingGetResponseItemWorkersBindingKindAssets(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["assets"] + """The kind of resource that the binding provides.""" + + +class BindingGetResponseItemWorkersBindingKindBrowserRendering(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["browser_rendering"] + """The kind of resource that the binding provides.""" + + +class BindingGetResponseItemWorkersBindingKindD1(BaseModel): + id: str + """Identifier of the D1 database to bind to.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["d1"] + """The kind of resource that the binding provides.""" + + +class BindingGetResponseItemWorkersBindingKindDispatchNamespaceOutboundWorker(BaseModel): + environment: Optional[str] = None + """Environment of the outbound worker.""" + + service: Optional[str] = None + """Name of the outbound worker.""" + + +class BindingGetResponseItemWorkersBindingKindDispatchNamespaceOutbound(BaseModel): + params: Optional[List[str]] = None + """ + Pass information from the Dispatch Worker to the Outbound Worker through the + parameters. + """ + + worker: Optional[BindingGetResponseItemWorkersBindingKindDispatchNamespaceOutboundWorker] = None + """Outbound worker.""" + + +class BindingGetResponseItemWorkersBindingKindDispatchNamespace(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + namespace: str + """Namespace to bind to.""" + + type: Literal["dispatch_namespace"] + """The kind of resource that the binding provides.""" + + outbound: Optional[BindingGetResponseItemWorkersBindingKindDispatchNamespaceOutbound] = None + """Outbound worker.""" + + +class BindingGetResponseItemWorkersBindingKindDo(BaseModel): + class_name: str + """The exported class name of the Durable Object.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["durable_object_namespace"] + """The kind of resource that the binding provides.""" + + environment: Optional[str] = None + """The environment of the script_name to bind to.""" + + namespace_id: Optional[str] = None + """Namespace identifier tag.""" + + script_name: Optional[str] = None + """ + The script where the Durable Object is defined, if it is external to this + Worker. + """ + + +class BindingGetResponseItemWorkersBindingKindHyperdrive(BaseModel): + id: str + """Identifier of the Hyperdrive connection to bind to.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["hyperdrive"] + """The kind of resource that the binding provides.""" + + +class BindingGetResponseItemWorkersBindingKindJson(BaseModel): + json_: str = FieldInfo(alias="json") + """JSON data to use.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["json"] + """The kind of resource that the binding provides.""" + + +class BindingGetResponseItemWorkersBindingKindKVNamespace(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + namespace_id: str + """Namespace identifier tag.""" + + type: Literal["kv_namespace"] + """The kind of resource that the binding provides.""" + + +class BindingGetResponseItemWorkersBindingKindMTLSCERT(BaseModel): + certificate_id: str + """Identifier of the certificate to bind to.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["mtls_certificate"] + """The kind of resource that the binding provides.""" + + +class BindingGetResponseItemWorkersBindingKindPlainText(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + text: str + """The text value to use.""" + + type: Literal["plain_text"] + """The kind of resource that the binding provides.""" + + +class BindingGetResponseItemWorkersBindingKindQueue(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + queue_name: str + """Name of the Queue to bind to.""" + + type: Literal["queue"] + """The kind of resource that the binding provides.""" + + +class BindingGetResponseItemWorkersBindingKindR2(BaseModel): + bucket_name: str + """R2 bucket to bind to.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["r2_bucket"] + """The kind of resource that the binding provides.""" + + +class BindingGetResponseItemWorkersBindingKindSecret(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + text: str + """The secret value to use.""" + + type: Literal["secret_text"] + """The kind of resource that the binding provides.""" + + +class BindingGetResponseItemWorkersBindingKindService(BaseModel): + environment: str + """Optional environment if the Worker utilizes one.""" + + name: str + """A JavaScript variable name for the binding.""" + + service: str + """Name of Worker to bind to.""" + + type: Literal["service"] + """The kind of resource that the binding provides.""" + + +class BindingGetResponseItemWorkersBindingKindTailConsumer(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + service: str + """Name of Tail Worker to bind to.""" + + type: Literal["tail_consumer"] + """The kind of resource that the binding provides.""" + + +class BindingGetResponseItemWorkersBindingKindVectorize(BaseModel): + index_name: str + """Name of the Vectorize index to bind to.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["vectorize"] + """The kind of resource that the binding provides.""" + + +class BindingGetResponseItemWorkersBindingKindVersionMetadata(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["version_metadata"] + """The kind of resource that the binding provides.""" + + +BindingGetResponseItem: TypeAlias = Union[ + BindingGetResponseItemWorkersBindingKindAny, + BindingGetResponseItemWorkersBindingKindAI, + BindingGetResponseItemWorkersBindingKindAnalyticsEngine, + BindingGetResponseItemWorkersBindingKindAssets, + BindingGetResponseItemWorkersBindingKindBrowserRendering, + BindingGetResponseItemWorkersBindingKindD1, + BindingGetResponseItemWorkersBindingKindDispatchNamespace, + BindingGetResponseItemWorkersBindingKindDo, + BindingGetResponseItemWorkersBindingKindHyperdrive, + BindingGetResponseItemWorkersBindingKindJson, + BindingGetResponseItemWorkersBindingKindKVNamespace, + BindingGetResponseItemWorkersBindingKindMTLSCERT, + BindingGetResponseItemWorkersBindingKindPlainText, + BindingGetResponseItemWorkersBindingKindQueue, + BindingGetResponseItemWorkersBindingKindR2, + BindingGetResponseItemWorkersBindingKindSecret, + BindingGetResponseItemWorkersBindingKindService, + BindingGetResponseItemWorkersBindingKindTailConsumer, + BindingGetResponseItemWorkersBindingKindVectorize, + BindingGetResponseItemWorkersBindingKindVersionMetadata, +] + +BindingGetResponse: TypeAlias = List[BindingGetResponseItem] diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/content_update_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/content_update_params.py index 9f4d3118469..84e1916a5ef 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/content_update_params.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/content_update_params.py @@ -2,10 +2,8 @@ from __future__ import annotations -from typing import List from typing_extensions import Required, Annotated, TypedDict -from ......_types import FileTypes from ......_utils import PropertyInfo from .....workers.worker_metadata_param import WorkerMetadataParam @@ -19,18 +17,7 @@ class ContentUpdateParams(TypedDict, total=False): dispatch_namespace: Required[str] """Name of the Workers for Platforms dispatch namespace.""" - any_part_name: Annotated[List[FileTypes], PropertyInfo(alias="")] - """A module comprising a Worker script, often a javascript file. - - Multiple modules may be provided as separate named parts, but at least one - module must be present. This should be referenced either in the metadata as - `main_module` (esm)/`body_part` (service worker) or as a header - `CF-WORKER-MAIN-MODULE-PART` (esm) /`CF-WORKER-BODY-PART` (service worker) by - part name. Source maps may also be included using the `application/source-map` - content type. - """ - - metadata: WorkerMetadataParam + metadata: Required[WorkerMetadataParam] """JSON encoded metadata about the uploaded parts and Worker configuration.""" cf_worker_body_part: Annotated[str, PropertyInfo(alias="CF-WORKER-BODY-PART")] diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py index f7e8aedcdf9..cfb478bb1c8 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py @@ -2,16 +2,45 @@ from __future__ import annotations -from typing import List, Union, Iterable, Optional -from typing_extensions import Required, TypeAlias, TypedDict +from typing import Dict, List, Union, Iterable, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict -from .....workers.binding_param import BindingParam -from .....workers.stepped_migration_param import SteppedMigrationParam +from .....workers.migration_step_param import MigrationStepParam from .....workers.single_step_migration_param import SingleStepMigrationParam -from .....workers.placement_configuration_param import PlacementConfigurationParam from .....workers.scripts.consumer_script_param import ConsumerScriptParam -__all__ = ["SettingEditParams", "Settings", "SettingsLimits", "SettingsMigrations", "SettingsObservability"] +__all__ = [ + "SettingEditParams", + "Settings", + "SettingsBinding", + "SettingsBindingWorkersBindingKindAny", + "SettingsBindingWorkersBindingKindAI", + "SettingsBindingWorkersBindingKindAnalyticsEngine", + "SettingsBindingWorkersBindingKindAssets", + "SettingsBindingWorkersBindingKindBrowserRendering", + "SettingsBindingWorkersBindingKindD1", + "SettingsBindingWorkersBindingKindDispatchNamespace", + "SettingsBindingWorkersBindingKindDispatchNamespaceOutbound", + "SettingsBindingWorkersBindingKindDispatchNamespaceOutboundWorker", + "SettingsBindingWorkersBindingKindDo", + "SettingsBindingWorkersBindingKindHyperdrive", + "SettingsBindingWorkersBindingKindJson", + "SettingsBindingWorkersBindingKindKVNamespace", + "SettingsBindingWorkersBindingKindMTLSCERT", + "SettingsBindingWorkersBindingKindPlainText", + "SettingsBindingWorkersBindingKindQueue", + "SettingsBindingWorkersBindingKindR2", + "SettingsBindingWorkersBindingKindSecret", + "SettingsBindingWorkersBindingKindService", + "SettingsBindingWorkersBindingKindTailConsumer", + "SettingsBindingWorkersBindingKindVectorize", + "SettingsBindingWorkersBindingKindVersionMetadata", + "SettingsLimits", + "SettingsMigrations", + "SettingsMigrationsWorkersMultipleStepMigrations", + "SettingsObservability", + "SettingsPlacement", +] class SettingEditParams(TypedDict, total=False): @@ -24,12 +53,295 @@ class SettingEditParams(TypedDict, total=False): settings: Settings +class SettingsBindingWorkersBindingKindAnyTyped(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[str] + """The kind of resource that the binding provides.""" + + +SettingsBindingWorkersBindingKindAny: TypeAlias = Union[SettingsBindingWorkersBindingKindAnyTyped, Dict[str, object]] + + +class SettingsBindingWorkersBindingKindAI(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["ai"]] + """The kind of resource that the binding provides.""" + + +class SettingsBindingWorkersBindingKindAnalyticsEngine(TypedDict, total=False): + dataset: Required[str] + """The dataset name to bind to.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["analytics_engine"]] + """The kind of resource that the binding provides.""" + + +class SettingsBindingWorkersBindingKindAssets(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["assets"]] + """The kind of resource that the binding provides.""" + + +class SettingsBindingWorkersBindingKindBrowserRendering(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["browser_rendering"]] + """The kind of resource that the binding provides.""" + + +class SettingsBindingWorkersBindingKindD1(TypedDict, total=False): + id: Required[str] + """Identifier of the D1 database to bind to.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["d1"]] + """The kind of resource that the binding provides.""" + + +class SettingsBindingWorkersBindingKindDispatchNamespaceOutboundWorker(TypedDict, total=False): + environment: str + """Environment of the outbound worker.""" + + service: str + """Name of the outbound worker.""" + + +class SettingsBindingWorkersBindingKindDispatchNamespaceOutbound(TypedDict, total=False): + params: List[str] + """ + Pass information from the Dispatch Worker to the Outbound Worker through the + parameters. + """ + + worker: SettingsBindingWorkersBindingKindDispatchNamespaceOutboundWorker + """Outbound worker.""" + + +class SettingsBindingWorkersBindingKindDispatchNamespace(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + namespace: Required[str] + """Namespace to bind to.""" + + type: Required[Literal["dispatch_namespace"]] + """The kind of resource that the binding provides.""" + + outbound: SettingsBindingWorkersBindingKindDispatchNamespaceOutbound + """Outbound worker.""" + + +class SettingsBindingWorkersBindingKindDo(TypedDict, total=False): + class_name: Required[str] + """The exported class name of the Durable Object.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["durable_object_namespace"]] + """The kind of resource that the binding provides.""" + + environment: str + """The environment of the script_name to bind to.""" + + namespace_id: str + """Namespace identifier tag.""" + + script_name: str + """ + The script where the Durable Object is defined, if it is external to this + Worker. + """ + + +class SettingsBindingWorkersBindingKindHyperdrive(TypedDict, total=False): + id: Required[str] + """Identifier of the Hyperdrive connection to bind to.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["hyperdrive"]] + """The kind of resource that the binding provides.""" + + +class SettingsBindingWorkersBindingKindJson(TypedDict, total=False): + json: Required[str] + """JSON data to use.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["json"]] + """The kind of resource that the binding provides.""" + + +class SettingsBindingWorkersBindingKindKVNamespace(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + namespace_id: Required[str] + """Namespace identifier tag.""" + + type: Required[Literal["kv_namespace"]] + """The kind of resource that the binding provides.""" + + +class SettingsBindingWorkersBindingKindMTLSCERT(TypedDict, total=False): + certificate_id: Required[str] + """Identifier of the certificate to bind to.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["mtls_certificate"]] + """The kind of resource that the binding provides.""" + + +class SettingsBindingWorkersBindingKindPlainText(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + text: Required[str] + """The text value to use.""" + + type: Required[Literal["plain_text"]] + """The kind of resource that the binding provides.""" + + +class SettingsBindingWorkersBindingKindQueue(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + queue_name: Required[str] + """Name of the Queue to bind to.""" + + type: Required[Literal["queue"]] + """The kind of resource that the binding provides.""" + + +class SettingsBindingWorkersBindingKindR2(TypedDict, total=False): + bucket_name: Required[str] + """R2 bucket to bind to.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["r2_bucket"]] + """The kind of resource that the binding provides.""" + + +class SettingsBindingWorkersBindingKindSecret(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + text: Required[str] + """The secret value to use.""" + + type: Required[Literal["secret_text"]] + """The kind of resource that the binding provides.""" + + +class SettingsBindingWorkersBindingKindService(TypedDict, total=False): + environment: Required[str] + """Optional environment if the Worker utilizes one.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + service: Required[str] + """Name of Worker to bind to.""" + + type: Required[Literal["service"]] + """The kind of resource that the binding provides.""" + + +class SettingsBindingWorkersBindingKindTailConsumer(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + service: Required[str] + """Name of Tail Worker to bind to.""" + + type: Required[Literal["tail_consumer"]] + """The kind of resource that the binding provides.""" + + +class SettingsBindingWorkersBindingKindVectorize(TypedDict, total=False): + index_name: Required[str] + """Name of the Vectorize index to bind to.""" + + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["vectorize"]] + """The kind of resource that the binding provides.""" + + +class SettingsBindingWorkersBindingKindVersionMetadata(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + type: Required[Literal["version_metadata"]] + """The kind of resource that the binding provides.""" + + +SettingsBinding: TypeAlias = Union[ + SettingsBindingWorkersBindingKindAny, + SettingsBindingWorkersBindingKindAI, + SettingsBindingWorkersBindingKindAnalyticsEngine, + SettingsBindingWorkersBindingKindAssets, + SettingsBindingWorkersBindingKindBrowserRendering, + SettingsBindingWorkersBindingKindD1, + SettingsBindingWorkersBindingKindDispatchNamespace, + SettingsBindingWorkersBindingKindDo, + SettingsBindingWorkersBindingKindHyperdrive, + SettingsBindingWorkersBindingKindJson, + SettingsBindingWorkersBindingKindKVNamespace, + SettingsBindingWorkersBindingKindMTLSCERT, + SettingsBindingWorkersBindingKindPlainText, + SettingsBindingWorkersBindingKindQueue, + SettingsBindingWorkersBindingKindR2, + SettingsBindingWorkersBindingKindSecret, + SettingsBindingWorkersBindingKindService, + SettingsBindingWorkersBindingKindTailConsumer, + SettingsBindingWorkersBindingKindVectorize, + SettingsBindingWorkersBindingKindVersionMetadata, +] + + class SettingsLimits(TypedDict, total=False): cpu_ms: int """The amount of CPU time this Worker can use in milliseconds.""" -SettingsMigrations: TypeAlias = Union[SingleStepMigrationParam, SteppedMigrationParam] +class SettingsMigrationsWorkersMultipleStepMigrations(TypedDict, total=False): + new_tag: str + """Tag to set as the latest migration tag.""" + + old_tag: str + """Tag used to verify against the latest migration tag for this Worker. + + If they don't match, the upload is rejected. + """ + + steps: Iterable[MigrationStepParam] + """Migrations to apply in order.""" + + +SettingsMigrations: TypeAlias = Union[SingleStepMigrationParam, SettingsMigrationsWorkersMultipleStepMigrations] class SettingsObservability(TypedDict, total=False): @@ -43,15 +355,35 @@ class SettingsObservability(TypedDict, total=False): """ +class SettingsPlacement(TypedDict, total=False): + mode: Literal["smart"] + """ + Enables + [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). + """ + + class Settings(TypedDict, total=False): - bindings: Iterable[BindingParam] - """List of bindings attached to this Worker""" + bindings: Iterable[SettingsBinding] + """List of bindings attached to a Worker. + + You can find more about bindings on our docs: + https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings. + """ compatibility_date: str - """Opt your Worker into changes after this date""" + """Date indicating targeted support in the Workers runtime. + + Backwards incompatible fixes to the runtime following this date will not affect + this Worker. + """ compatibility_flags: List[str] - """Opt your Worker into specific changes""" + """Flags that enable or disable certain features in the Workers runtime. + + Used to enable upcoming features or opt in or out of specific changes not + included in a `compatibility_date`. + """ limits: SettingsLimits """Limits to apply for this Worker.""" @@ -65,7 +397,11 @@ class Settings(TypedDict, total=False): observability: SettingsObservability """Observability settings for the Worker.""" - placement: PlacementConfigurationParam + placement: SettingsPlacement + """ + Configuration for + [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). + """ tags: List[str] """Tags to help you manage your Workers""" @@ -73,5 +409,5 @@ class Settings(TypedDict, total=False): tail_consumers: Iterable[ConsumerScriptParam] """List of Workers that will consume logs from the attached Worker.""" - usage_model: str - """Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound').""" + usage_model: Literal["standard"] + """Usage model for the Worker invocations.""" diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_response.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_response.py index a5f8112d446..799ad01b712 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_response.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_response.py @@ -1,16 +1,318 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from typing_extensions import TypeAlias +from typing import TYPE_CHECKING, List, Union, Optional +from typing_extensions import Literal, TypeAlias + +from pydantic import Field as FieldInfo from ......_models import BaseModel -from .....workers.binding import Binding -from .....workers.stepped_migration import SteppedMigration +from .....workers.migration_step import MigrationStep from .....workers.single_step_migration import SingleStepMigration -from .....workers.placement_configuration import PlacementConfiguration from .....workers.scripts.consumer_script import ConsumerScript -__all__ = ["SettingEditResponse", "Limits", "Migrations", "Observability"] +__all__ = [ + "SettingEditResponse", + "Binding", + "BindingWorkersBindingKindAny", + "BindingWorkersBindingKindAI", + "BindingWorkersBindingKindAnalyticsEngine", + "BindingWorkersBindingKindAssets", + "BindingWorkersBindingKindBrowserRendering", + "BindingWorkersBindingKindD1", + "BindingWorkersBindingKindDispatchNamespace", + "BindingWorkersBindingKindDispatchNamespaceOutbound", + "BindingWorkersBindingKindDispatchNamespaceOutboundWorker", + "BindingWorkersBindingKindDo", + "BindingWorkersBindingKindHyperdrive", + "BindingWorkersBindingKindJson", + "BindingWorkersBindingKindKVNamespace", + "BindingWorkersBindingKindMTLSCERT", + "BindingWorkersBindingKindPlainText", + "BindingWorkersBindingKindQueue", + "BindingWorkersBindingKindR2", + "BindingWorkersBindingKindSecret", + "BindingWorkersBindingKindService", + "BindingWorkersBindingKindTailConsumer", + "BindingWorkersBindingKindVectorize", + "BindingWorkersBindingKindVersionMetadata", + "Limits", + "Migrations", + "MigrationsWorkersMultipleStepMigrations", + "Observability", + "Placement", +] + + +class BindingWorkersBindingKindAny(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: str + """The kind of resource that the binding provides.""" + + if TYPE_CHECKING: + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + + +class BindingWorkersBindingKindAI(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["ai"] + """The kind of resource that the binding provides.""" + + +class BindingWorkersBindingKindAnalyticsEngine(BaseModel): + dataset: str + """The dataset name to bind to.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["analytics_engine"] + """The kind of resource that the binding provides.""" + + +class BindingWorkersBindingKindAssets(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["assets"] + """The kind of resource that the binding provides.""" + + +class BindingWorkersBindingKindBrowserRendering(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["browser_rendering"] + """The kind of resource that the binding provides.""" + + +class BindingWorkersBindingKindD1(BaseModel): + id: str + """Identifier of the D1 database to bind to.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["d1"] + """The kind of resource that the binding provides.""" + + +class BindingWorkersBindingKindDispatchNamespaceOutboundWorker(BaseModel): + environment: Optional[str] = None + """Environment of the outbound worker.""" + + service: Optional[str] = None + """Name of the outbound worker.""" + + +class BindingWorkersBindingKindDispatchNamespaceOutbound(BaseModel): + params: Optional[List[str]] = None + """ + Pass information from the Dispatch Worker to the Outbound Worker through the + parameters. + """ + + worker: Optional[BindingWorkersBindingKindDispatchNamespaceOutboundWorker] = None + """Outbound worker.""" + + +class BindingWorkersBindingKindDispatchNamespace(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + namespace: str + """Namespace to bind to.""" + + type: Literal["dispatch_namespace"] + """The kind of resource that the binding provides.""" + + outbound: Optional[BindingWorkersBindingKindDispatchNamespaceOutbound] = None + """Outbound worker.""" + + +class BindingWorkersBindingKindDo(BaseModel): + class_name: str + """The exported class name of the Durable Object.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["durable_object_namespace"] + """The kind of resource that the binding provides.""" + + environment: Optional[str] = None + """The environment of the script_name to bind to.""" + + namespace_id: Optional[str] = None + """Namespace identifier tag.""" + + script_name: Optional[str] = None + """ + The script where the Durable Object is defined, if it is external to this + Worker. + """ + + +class BindingWorkersBindingKindHyperdrive(BaseModel): + id: str + """Identifier of the Hyperdrive connection to bind to.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["hyperdrive"] + """The kind of resource that the binding provides.""" + + +class BindingWorkersBindingKindJson(BaseModel): + json_: str = FieldInfo(alias="json") + """JSON data to use.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["json"] + """The kind of resource that the binding provides.""" + + +class BindingWorkersBindingKindKVNamespace(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + namespace_id: str + """Namespace identifier tag.""" + + type: Literal["kv_namespace"] + """The kind of resource that the binding provides.""" + + +class BindingWorkersBindingKindMTLSCERT(BaseModel): + certificate_id: str + """Identifier of the certificate to bind to.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["mtls_certificate"] + """The kind of resource that the binding provides.""" + + +class BindingWorkersBindingKindPlainText(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + text: str + """The text value to use.""" + + type: Literal["plain_text"] + """The kind of resource that the binding provides.""" + + +class BindingWorkersBindingKindQueue(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + queue_name: str + """Name of the Queue to bind to.""" + + type: Literal["queue"] + """The kind of resource that the binding provides.""" + + +class BindingWorkersBindingKindR2(BaseModel): + bucket_name: str + """R2 bucket to bind to.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["r2_bucket"] + """The kind of resource that the binding provides.""" + + +class BindingWorkersBindingKindSecret(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + text: str + """The secret value to use.""" + + type: Literal["secret_text"] + """The kind of resource that the binding provides.""" + + +class BindingWorkersBindingKindService(BaseModel): + environment: str + """Optional environment if the Worker utilizes one.""" + + name: str + """A JavaScript variable name for the binding.""" + + service: str + """Name of Worker to bind to.""" + + type: Literal["service"] + """The kind of resource that the binding provides.""" + + +class BindingWorkersBindingKindTailConsumer(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + service: str + """Name of Tail Worker to bind to.""" + + type: Literal["tail_consumer"] + """The kind of resource that the binding provides.""" + + +class BindingWorkersBindingKindVectorize(BaseModel): + index_name: str + """Name of the Vectorize index to bind to.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["vectorize"] + """The kind of resource that the binding provides.""" + + +class BindingWorkersBindingKindVersionMetadata(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["version_metadata"] + """The kind of resource that the binding provides.""" + + +Binding: TypeAlias = Union[ + BindingWorkersBindingKindAny, + BindingWorkersBindingKindAI, + BindingWorkersBindingKindAnalyticsEngine, + BindingWorkersBindingKindAssets, + BindingWorkersBindingKindBrowserRendering, + BindingWorkersBindingKindD1, + BindingWorkersBindingKindDispatchNamespace, + BindingWorkersBindingKindDo, + BindingWorkersBindingKindHyperdrive, + BindingWorkersBindingKindJson, + BindingWorkersBindingKindKVNamespace, + BindingWorkersBindingKindMTLSCERT, + BindingWorkersBindingKindPlainText, + BindingWorkersBindingKindQueue, + BindingWorkersBindingKindR2, + BindingWorkersBindingKindSecret, + BindingWorkersBindingKindService, + BindingWorkersBindingKindTailConsumer, + BindingWorkersBindingKindVectorize, + BindingWorkersBindingKindVersionMetadata, +] class Limits(BaseModel): @@ -18,7 +320,21 @@ class Limits(BaseModel): """The amount of CPU time this Worker can use in milliseconds.""" -Migrations: TypeAlias = Union[SingleStepMigration, SteppedMigration] +class MigrationsWorkersMultipleStepMigrations(BaseModel): + new_tag: Optional[str] = None + """Tag to set as the latest migration tag.""" + + old_tag: Optional[str] = None + """Tag used to verify against the latest migration tag for this Worker. + + If they don't match, the upload is rejected. + """ + + steps: Optional[List[MigrationStep]] = None + """Migrations to apply in order.""" + + +Migrations: TypeAlias = Union[SingleStepMigration, MigrationsWorkersMultipleStepMigrations] class Observability(BaseModel): @@ -32,15 +348,35 @@ class Observability(BaseModel): """ +class Placement(BaseModel): + mode: Optional[Literal["smart"]] = None + """ + Enables + [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). + """ + + class SettingEditResponse(BaseModel): bindings: Optional[List[Binding]] = None - """List of bindings attached to this Worker""" + """List of bindings attached to a Worker. + + You can find more about bindings on our docs: + https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings. + """ compatibility_date: Optional[str] = None - """Opt your Worker into changes after this date""" + """Date indicating targeted support in the Workers runtime. + + Backwards incompatible fixes to the runtime following this date will not affect + this Worker. + """ compatibility_flags: Optional[List[str]] = None - """Opt your Worker into specific changes""" + """Flags that enable or disable certain features in the Workers runtime. + + Used to enable upcoming features or opt in or out of specific changes not + included in a `compatibility_date`. + """ limits: Optional[Limits] = None """Limits to apply for this Worker.""" @@ -54,7 +390,11 @@ class SettingEditResponse(BaseModel): observability: Optional[Observability] = None """Observability settings for the Worker.""" - placement: Optional[PlacementConfiguration] = None + placement: Optional[Placement] = None + """ + Configuration for + [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). + """ tags: Optional[List[str]] = None """Tags to help you manage your Workers""" @@ -62,5 +402,5 @@ class SettingEditResponse(BaseModel): tail_consumers: Optional[List[ConsumerScript]] = None """List of Workers that will consume logs from the attached Worker.""" - usage_model: Optional[str] = None - """Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound').""" + usage_model: Optional[Literal["standard"]] = None + """Usage model for the Worker invocations.""" diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_get_response.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_get_response.py index 8e7516ccf3d..e6a39d1e9af 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_get_response.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_get_response.py @@ -1,16 +1,318 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from typing_extensions import TypeAlias +from typing import TYPE_CHECKING, List, Union, Optional +from typing_extensions import Literal, TypeAlias + +from pydantic import Field as FieldInfo from ......_models import BaseModel -from .....workers.binding import Binding -from .....workers.stepped_migration import SteppedMigration +from .....workers.migration_step import MigrationStep from .....workers.single_step_migration import SingleStepMigration -from .....workers.placement_configuration import PlacementConfiguration from .....workers.scripts.consumer_script import ConsumerScript -__all__ = ["SettingGetResponse", "Limits", "Migrations", "Observability"] +__all__ = [ + "SettingGetResponse", + "Binding", + "BindingWorkersBindingKindAny", + "BindingWorkersBindingKindAI", + "BindingWorkersBindingKindAnalyticsEngine", + "BindingWorkersBindingKindAssets", + "BindingWorkersBindingKindBrowserRendering", + "BindingWorkersBindingKindD1", + "BindingWorkersBindingKindDispatchNamespace", + "BindingWorkersBindingKindDispatchNamespaceOutbound", + "BindingWorkersBindingKindDispatchNamespaceOutboundWorker", + "BindingWorkersBindingKindDo", + "BindingWorkersBindingKindHyperdrive", + "BindingWorkersBindingKindJson", + "BindingWorkersBindingKindKVNamespace", + "BindingWorkersBindingKindMTLSCERT", + "BindingWorkersBindingKindPlainText", + "BindingWorkersBindingKindQueue", + "BindingWorkersBindingKindR2", + "BindingWorkersBindingKindSecret", + "BindingWorkersBindingKindService", + "BindingWorkersBindingKindTailConsumer", + "BindingWorkersBindingKindVectorize", + "BindingWorkersBindingKindVersionMetadata", + "Limits", + "Migrations", + "MigrationsWorkersMultipleStepMigrations", + "Observability", + "Placement", +] + + +class BindingWorkersBindingKindAny(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: str + """The kind of resource that the binding provides.""" + + if TYPE_CHECKING: + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + + +class BindingWorkersBindingKindAI(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["ai"] + """The kind of resource that the binding provides.""" + + +class BindingWorkersBindingKindAnalyticsEngine(BaseModel): + dataset: str + """The dataset name to bind to.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["analytics_engine"] + """The kind of resource that the binding provides.""" + + +class BindingWorkersBindingKindAssets(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["assets"] + """The kind of resource that the binding provides.""" + + +class BindingWorkersBindingKindBrowserRendering(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["browser_rendering"] + """The kind of resource that the binding provides.""" + + +class BindingWorkersBindingKindD1(BaseModel): + id: str + """Identifier of the D1 database to bind to.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["d1"] + """The kind of resource that the binding provides.""" + + +class BindingWorkersBindingKindDispatchNamespaceOutboundWorker(BaseModel): + environment: Optional[str] = None + """Environment of the outbound worker.""" + + service: Optional[str] = None + """Name of the outbound worker.""" + + +class BindingWorkersBindingKindDispatchNamespaceOutbound(BaseModel): + params: Optional[List[str]] = None + """ + Pass information from the Dispatch Worker to the Outbound Worker through the + parameters. + """ + + worker: Optional[BindingWorkersBindingKindDispatchNamespaceOutboundWorker] = None + """Outbound worker.""" + + +class BindingWorkersBindingKindDispatchNamespace(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + namespace: str + """Namespace to bind to.""" + + type: Literal["dispatch_namespace"] + """The kind of resource that the binding provides.""" + + outbound: Optional[BindingWorkersBindingKindDispatchNamespaceOutbound] = None + """Outbound worker.""" + + +class BindingWorkersBindingKindDo(BaseModel): + class_name: str + """The exported class name of the Durable Object.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["durable_object_namespace"] + """The kind of resource that the binding provides.""" + + environment: Optional[str] = None + """The environment of the script_name to bind to.""" + + namespace_id: Optional[str] = None + """Namespace identifier tag.""" + + script_name: Optional[str] = None + """ + The script where the Durable Object is defined, if it is external to this + Worker. + """ + + +class BindingWorkersBindingKindHyperdrive(BaseModel): + id: str + """Identifier of the Hyperdrive connection to bind to.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["hyperdrive"] + """The kind of resource that the binding provides.""" + + +class BindingWorkersBindingKindJson(BaseModel): + json_: str = FieldInfo(alias="json") + """JSON data to use.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["json"] + """The kind of resource that the binding provides.""" + + +class BindingWorkersBindingKindKVNamespace(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + namespace_id: str + """Namespace identifier tag.""" + + type: Literal["kv_namespace"] + """The kind of resource that the binding provides.""" + + +class BindingWorkersBindingKindMTLSCERT(BaseModel): + certificate_id: str + """Identifier of the certificate to bind to.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["mtls_certificate"] + """The kind of resource that the binding provides.""" + + +class BindingWorkersBindingKindPlainText(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + text: str + """The text value to use.""" + + type: Literal["plain_text"] + """The kind of resource that the binding provides.""" + + +class BindingWorkersBindingKindQueue(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + queue_name: str + """Name of the Queue to bind to.""" + + type: Literal["queue"] + """The kind of resource that the binding provides.""" + + +class BindingWorkersBindingKindR2(BaseModel): + bucket_name: str + """R2 bucket to bind to.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["r2_bucket"] + """The kind of resource that the binding provides.""" + + +class BindingWorkersBindingKindSecret(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + text: str + """The secret value to use.""" + + type: Literal["secret_text"] + """The kind of resource that the binding provides.""" + + +class BindingWorkersBindingKindService(BaseModel): + environment: str + """Optional environment if the Worker utilizes one.""" + + name: str + """A JavaScript variable name for the binding.""" + + service: str + """Name of Worker to bind to.""" + + type: Literal["service"] + """The kind of resource that the binding provides.""" + + +class BindingWorkersBindingKindTailConsumer(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + service: str + """Name of Tail Worker to bind to.""" + + type: Literal["tail_consumer"] + """The kind of resource that the binding provides.""" + + +class BindingWorkersBindingKindVectorize(BaseModel): + index_name: str + """Name of the Vectorize index to bind to.""" + + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["vectorize"] + """The kind of resource that the binding provides.""" + + +class BindingWorkersBindingKindVersionMetadata(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["version_metadata"] + """The kind of resource that the binding provides.""" + + +Binding: TypeAlias = Union[ + BindingWorkersBindingKindAny, + BindingWorkersBindingKindAI, + BindingWorkersBindingKindAnalyticsEngine, + BindingWorkersBindingKindAssets, + BindingWorkersBindingKindBrowserRendering, + BindingWorkersBindingKindD1, + BindingWorkersBindingKindDispatchNamespace, + BindingWorkersBindingKindDo, + BindingWorkersBindingKindHyperdrive, + BindingWorkersBindingKindJson, + BindingWorkersBindingKindKVNamespace, + BindingWorkersBindingKindMTLSCERT, + BindingWorkersBindingKindPlainText, + BindingWorkersBindingKindQueue, + BindingWorkersBindingKindR2, + BindingWorkersBindingKindSecret, + BindingWorkersBindingKindService, + BindingWorkersBindingKindTailConsumer, + BindingWorkersBindingKindVectorize, + BindingWorkersBindingKindVersionMetadata, +] class Limits(BaseModel): @@ -18,7 +320,21 @@ class Limits(BaseModel): """The amount of CPU time this Worker can use in milliseconds.""" -Migrations: TypeAlias = Union[SingleStepMigration, SteppedMigration] +class MigrationsWorkersMultipleStepMigrations(BaseModel): + new_tag: Optional[str] = None + """Tag to set as the latest migration tag.""" + + old_tag: Optional[str] = None + """Tag used to verify against the latest migration tag for this Worker. + + If they don't match, the upload is rejected. + """ + + steps: Optional[List[MigrationStep]] = None + """Migrations to apply in order.""" + + +Migrations: TypeAlias = Union[SingleStepMigration, MigrationsWorkersMultipleStepMigrations] class Observability(BaseModel): @@ -32,15 +348,35 @@ class Observability(BaseModel): """ +class Placement(BaseModel): + mode: Optional[Literal["smart"]] = None + """ + Enables + [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). + """ + + class SettingGetResponse(BaseModel): bindings: Optional[List[Binding]] = None - """List of bindings attached to this Worker""" + """List of bindings attached to a Worker. + + You can find more about bindings on our docs: + https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings. + """ compatibility_date: Optional[str] = None - """Opt your Worker into changes after this date""" + """Date indicating targeted support in the Workers runtime. + + Backwards incompatible fixes to the runtime following this date will not affect + this Worker. + """ compatibility_flags: Optional[List[str]] = None - """Opt your Worker into specific changes""" + """Flags that enable or disable certain features in the Workers runtime. + + Used to enable upcoming features or opt in or out of specific changes not + included in a `compatibility_date`. + """ limits: Optional[Limits] = None """Limits to apply for this Worker.""" @@ -54,7 +390,11 @@ class SettingGetResponse(BaseModel): observability: Optional[Observability] = None """Observability settings for the Worker.""" - placement: Optional[PlacementConfiguration] = None + placement: Optional[Placement] = None + """ + Configuration for + [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). + """ tags: Optional[List[str]] = None """Tags to help you manage your Workers""" @@ -62,5 +402,5 @@ class SettingGetResponse(BaseModel): tail_consumers: Optional[List[ConsumerScript]] = None """List of Workers that will consume logs from the attached Worker.""" - usage_model: Optional[str] = None - """Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound').""" + usage_model: Optional[Literal["standard"]] = None + """Usage model for the Worker invocations.""" diff --git a/src/cloudflare/types/zero_trust/access/__init__.py b/src/cloudflare/types/zero_trust/access/__init__.py index 042c3929e5c..3db17eae160 100644 --- a/src/cloudflare/types/zero_trust/access/__init__.py +++ b/src/cloudflare/types/zero_trust/access/__init__.py @@ -54,6 +54,7 @@ from .application_get_response import ApplicationGetResponse as ApplicationGetResponse from .bookmark_delete_response import BookmarkDeleteResponse as BookmarkDeleteResponse from .custom_page_without_html import CustomPageWithoutHTML as CustomPageWithoutHTML +from .gateway_ca_list_response import GatewayCAListResponse as GatewayCAListResponse from .application_create_params import ApplicationCreateParams as ApplicationCreateParams from .application_list_response import ApplicationListResponse as ApplicationListResponse from .application_update_params import ApplicationUpdateParams as ApplicationUpdateParams @@ -63,6 +64,8 @@ from .custom_page_update_params import CustomPageUpdateParams as CustomPageUpdateParams from .scim_config_mapping_param import SCIMConfigMappingParam as SCIMConfigMappingParam from .service_token_list_params import ServiceTokenListParams as ServiceTokenListParams +from .gateway_ca_create_response import GatewayCACreateResponse as GatewayCACreateResponse +from .gateway_ca_delete_response import GatewayCADeleteResponse as GatewayCADeleteResponse from .application_create_response import ApplicationCreateResponse as ApplicationCreateResponse from .application_delete_response import ApplicationDeleteResponse as ApplicationDeleteResponse from .application_update_response import ApplicationUpdateResponse as ApplicationUpdateResponse diff --git a/src/cloudflare/types/zero_trust/access/application_create_params.py b/src/cloudflare/types/zero_trust/access/application_create_params.py index 46981914209..8f28b6ec26a 100644 --- a/src/cloudflare/types/zero_trust/access/application_create_params.py +++ b/src/cloudflare/types/zero_trust/access/application_create_params.py @@ -23,11 +23,16 @@ "ApplicationCreateParams", "SelfHostedApplication", "SelfHostedApplicationDestination", + "SelfHostedApplicationDestinationPublicDestination", + "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationPolicy", "SelfHostedApplicationPolicyAccessAppPolicyLink", "SelfHostedApplicationPolicyUnionMember2", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", + "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "SaaSApplication", "SaaSApplicationPolicy", "SaaSApplicationPolicyAccessAppPolicyLink", @@ -35,20 +40,33 @@ "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", "SaaSApplicationSCIMConfigAuthentication", + "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", + "BrowserSSHApplicationDestinationPublicDestination", + "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationPolicyAccessAppPolicyLink", "BrowserSSHApplicationPolicyUnionMember2", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", + "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", + "BrowserVNCApplicationDestinationPublicDestination", + "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationPolicyAccessAppPolicyLink", "BrowserVNCApplicationPolicyUnionMember2", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", + "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "AppLauncherApplication", "AppLauncherApplicationFooterLink", "AppLauncherApplicationLandingPageDesign", @@ -57,6 +75,9 @@ "AppLauncherApplicationPolicyUnionMember2", "AppLauncherApplicationSCIMConfig", "AppLauncherApplicationSCIMConfigAuthentication", + "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationFooterLink", "DeviceEnrollmentPermissionsApplicationLandingPageDesign", @@ -65,6 +86,9 @@ "DeviceEnrollmentPermissionsApplicationPolicyUnionMember2", "DeviceEnrollmentPermissionsApplicationSCIMConfig", "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthentication", + "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationFooterLink", "BrowserIsolationPermissionsApplicationLandingPageDesign", @@ -73,9 +97,15 @@ "BrowserIsolationPermissionsApplicationPolicyUnionMember2", "BrowserIsolationPermissionsApplicationSCIMConfig", "BrowserIsolationPermissionsApplicationSCIMConfigAuthentication", + "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BookmarkApplication", "BookmarkApplicationSCIMConfig", "BookmarkApplicationSCIMConfigAuthentication", + "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", "InfrastructureApplicationPolicy", @@ -233,20 +263,47 @@ class SelfHostedApplication(TypedDict, total=False): """ -class SelfHostedApplicationDestination(TypedDict, total=False): - type: Literal["public", "private"] +class SelfHostedApplicationDestinationPublicDestination(TypedDict, total=False): + type: Literal["public"] uri: str """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class SelfHostedApplicationDestinationPrivateDestination(TypedDict, total=False): + cidr: str + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: str + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Literal["tcp", "udp"] + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: str + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Literal["private"] + + vnet_id: str + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +SelfHostedApplicationDestination: TypeAlias = Union[ + SelfHostedApplicationDestinationPublicDestination, SelfHostedApplicationDestinationPrivateDestination +] + + class SelfHostedApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): id: str """The UUID of the policy""" @@ -302,10 +359,58 @@ class SelfHostedApplicationPolicyUnionMember2(TypedDict, total=False): SelfHostedApplicationPolicyAccessAppPolicyLink, str, SelfHostedApplicationPolicyUnionMember2 ] + +class SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasicParam, + SCIMConfigAuthenticationOAuthBearerTokenParam, + SCIMConfigAuthenticationOauth2Param, + SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + SelfHostedApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, + SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + Iterable[SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -457,10 +562,56 @@ class SaaSApplicationPolicyUnionMember2(TypedDict, total=False): SaaSApplicationSaaSApp: TypeAlias = Union[SAMLSaaSAppParam, OIDCSaaSAppParam] + +class SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(TypedDict, total=False): + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasicParam, + SCIMConfigAuthenticationOAuthBearerTokenParam, + SCIMConfigAuthenticationOauth2Param, + SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + SaaSApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, + SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + Iterable[SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -646,20 +797,47 @@ class BrowserSSHApplication(TypedDict, total=False): """ -class BrowserSSHApplicationDestination(TypedDict, total=False): - type: Literal["public", "private"] +class BrowserSSHApplicationDestinationPublicDestination(TypedDict, total=False): + type: Literal["public"] uri: str """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserSSHApplicationDestinationPrivateDestination(TypedDict, total=False): + cidr: str + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: str + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Literal["tcp", "udp"] + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: str + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Literal["private"] + + vnet_id: str + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserSSHApplicationDestination: TypeAlias = Union[ + BrowserSSHApplicationDestinationPublicDestination, BrowserSSHApplicationDestinationPrivateDestination +] + + class BrowserSSHApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): id: str """The UUID of the policy""" @@ -715,10 +893,58 @@ class BrowserSSHApplicationPolicyUnionMember2(TypedDict, total=False): BrowserSSHApplicationPolicyAccessAppPolicyLink, str, BrowserSSHApplicationPolicyUnionMember2 ] + +class BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasicParam, + SCIMConfigAuthenticationOAuthBearerTokenParam, + SCIMConfigAuthenticationOauth2Param, + BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + BrowserSSHApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, + BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + Iterable[BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -904,20 +1130,47 @@ class BrowserVNCApplication(TypedDict, total=False): """ -class BrowserVNCApplicationDestination(TypedDict, total=False): - type: Literal["public", "private"] +class BrowserVNCApplicationDestinationPublicDestination(TypedDict, total=False): + type: Literal["public"] uri: str """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserVNCApplicationDestinationPrivateDestination(TypedDict, total=False): + cidr: str + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: str + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Literal["tcp", "udp"] + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: str + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Literal["private"] + + vnet_id: str + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserVNCApplicationDestination: TypeAlias = Union[ + BrowserVNCApplicationDestinationPublicDestination, BrowserVNCApplicationDestinationPrivateDestination +] + + class BrowserVNCApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): id: str """The UUID of the policy""" @@ -973,10 +1226,58 @@ class BrowserVNCApplicationPolicyUnionMember2(TypedDict, total=False): BrowserVNCApplicationPolicyAccessAppPolicyLink, str, BrowserVNCApplicationPolicyUnionMember2 ] + +class BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasicParam, + SCIMConfigAuthenticationOAuthBearerTokenParam, + SCIMConfigAuthenticationOauth2Param, + BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + BrowserVNCApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, + BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + Iterable[BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -1156,10 +1457,58 @@ class AppLauncherApplicationPolicyUnionMember2(TypedDict, total=False): AppLauncherApplicationPolicyAccessAppPolicyLink, str, AppLauncherApplicationPolicyUnionMember2 ] + +class AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasicParam, + SCIMConfigAuthenticationOAuthBearerTokenParam, + SCIMConfigAuthenticationOauth2Param, + AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + AppLauncherApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, + AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + Iterable[AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -1341,10 +1690,58 @@ class DeviceEnrollmentPermissionsApplicationPolicyUnionMember2(TypedDict, total= DeviceEnrollmentPermissionsApplicationPolicyUnionMember2, ] + +class DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasicParam, + SCIMConfigAuthenticationOAuthBearerTokenParam, + SCIMConfigAuthenticationOauth2Param, + DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + DeviceEnrollmentPermissionsApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, + DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + Iterable[DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -1526,10 +1923,58 @@ class BrowserIsolationPermissionsApplicationPolicyUnionMember2(TypedDict, total= BrowserIsolationPermissionsApplicationPolicyUnionMember2, ] + +class BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasicParam, + SCIMConfigAuthenticationOAuthBearerTokenParam, + SCIMConfigAuthenticationOauth2Param, + BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + BrowserIsolationPermissionsApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, + BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + Iterable[BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -1601,10 +2046,57 @@ class BookmarkApplication(TypedDict, total=False): """The application type.""" +class BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasicParam, + SCIMConfigAuthenticationOAuthBearerTokenParam, + SCIMConfigAuthenticationOauth2Param, + BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + BookmarkApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, + BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + Iterable[BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] diff --git a/src/cloudflare/types/zero_trust/access/application_create_response.py b/src/cloudflare/types/zero_trust/access/application_create_response.py index 6249dd96de2..1f3a5fdb214 100644 --- a/src/cloudflare/types/zero_trust/access/application_create_response.py +++ b/src/cloudflare/types/zero_trust/access/application_create_response.py @@ -23,45 +23,75 @@ "ApplicationCreateResponse", "SelfHostedApplication", "SelfHostedApplicationDestination", + "SelfHostedApplicationDestinationPublicDestination", + "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationPolicy", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", + "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "SaaSApplication", "SaaSApplicationPolicy", "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", "SaaSApplicationSCIMConfigAuthentication", + "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", + "BrowserSSHApplicationDestinationPublicDestination", + "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", + "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", + "BrowserVNCApplicationDestinationPublicDestination", + "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", + "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "AppLauncherApplication", "AppLauncherApplicationFooterLink", "AppLauncherApplicationLandingPageDesign", "AppLauncherApplicationPolicy", "AppLauncherApplicationSCIMConfig", "AppLauncherApplicationSCIMConfigAuthentication", + "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationFooterLink", "DeviceEnrollmentPermissionsApplicationLandingPageDesign", "DeviceEnrollmentPermissionsApplicationPolicy", "DeviceEnrollmentPermissionsApplicationSCIMConfig", "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthentication", + "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationFooterLink", "BrowserIsolationPermissionsApplicationLandingPageDesign", "BrowserIsolationPermissionsApplicationPolicy", "BrowserIsolationPermissionsApplicationSCIMConfig", "BrowserIsolationPermissionsApplicationSCIMConfigAuthentication", + "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BookmarkApplication", "BookmarkApplicationSCIMConfig", "BookmarkApplicationSCIMConfigAuthentication", + "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", "InfrastructureApplicationPolicy", @@ -69,23 +99,53 @@ "InfrastructureApplicationPolicyConnectionRulesSSH", "InfrastructureApplicationSCIMConfig", "InfrastructureApplicationSCIMConfigAuthentication", + "InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", ] -class SelfHostedApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class SelfHostedApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class SelfHostedApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +SelfHostedApplicationDestination: TypeAlias = Union[ + SelfHostedApplicationDestinationPublicDestination, SelfHostedApplicationDestinationPrivateDestination +] + + class SelfHostedApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -94,8 +154,55 @@ class SelfHostedApplicationPolicy(ApplicationPolicy): """ +class SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + SelfHostedApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -290,8 +397,56 @@ class SaaSApplicationPolicy(ApplicationPolicy): SaaSApplicationSaaSApp: TypeAlias = Union[SAMLSaaSApp, OIDCSaaSApp] + +class SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + SaaSApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -385,20 +540,47 @@ class SaaSApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserSSHApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class BrowserSSHApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserSSHApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserSSHApplicationDestination: TypeAlias = Union[ + BrowserSSHApplicationDestinationPublicDestination, BrowserSSHApplicationDestinationPrivateDestination +] + + class BrowserSSHApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -407,8 +589,55 @@ class BrowserSSHApplicationPolicy(ApplicationPolicy): """ +class BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + BrowserSSHApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -593,20 +822,47 @@ class BrowserSSHApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserVNCApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class BrowserVNCApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserVNCApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserVNCApplicationDestination: TypeAlias = Union[ + BrowserVNCApplicationDestinationPublicDestination, BrowserVNCApplicationDestinationPrivateDestination +] + + class BrowserVNCApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -615,8 +871,55 @@ class BrowserVNCApplicationPolicy(ApplicationPolicy): """ +class BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + BrowserVNCApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -834,8 +1137,55 @@ class AppLauncherApplicationPolicy(ApplicationPolicy): """ +class AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + AppLauncherApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -976,8 +1326,57 @@ class DeviceEnrollmentPermissionsApplicationPolicy(ApplicationPolicy): """ +class DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + DeviceEnrollmentPermissionsApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -1118,8 +1517,57 @@ class BrowserIsolationPermissionsApplicationPolicy(ApplicationPolicy): """ +class BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + BrowserIsolationPermissionsApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -1227,8 +1675,55 @@ class BrowserIsolationPermissionsApplication(BaseModel): updated_at: Optional[datetime] = None +class BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + BookmarkApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -1376,8 +1871,55 @@ class InfrastructureApplicationPolicy(BaseModel): updated_at: Optional[datetime] = None +class InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + InfrastructureApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] diff --git a/src/cloudflare/types/zero_trust/access/application_get_response.py b/src/cloudflare/types/zero_trust/access/application_get_response.py index 1cd213b07d0..cffacb3a76a 100644 --- a/src/cloudflare/types/zero_trust/access/application_get_response.py +++ b/src/cloudflare/types/zero_trust/access/application_get_response.py @@ -23,45 +23,75 @@ "ApplicationGetResponse", "SelfHostedApplication", "SelfHostedApplicationDestination", + "SelfHostedApplicationDestinationPublicDestination", + "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationPolicy", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", + "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "SaaSApplication", "SaaSApplicationPolicy", "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", "SaaSApplicationSCIMConfigAuthentication", + "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", + "BrowserSSHApplicationDestinationPublicDestination", + "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", + "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", + "BrowserVNCApplicationDestinationPublicDestination", + "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", + "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "AppLauncherApplication", "AppLauncherApplicationFooterLink", "AppLauncherApplicationLandingPageDesign", "AppLauncherApplicationPolicy", "AppLauncherApplicationSCIMConfig", "AppLauncherApplicationSCIMConfigAuthentication", + "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationFooterLink", "DeviceEnrollmentPermissionsApplicationLandingPageDesign", "DeviceEnrollmentPermissionsApplicationPolicy", "DeviceEnrollmentPermissionsApplicationSCIMConfig", "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthentication", + "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationFooterLink", "BrowserIsolationPermissionsApplicationLandingPageDesign", "BrowserIsolationPermissionsApplicationPolicy", "BrowserIsolationPermissionsApplicationSCIMConfig", "BrowserIsolationPermissionsApplicationSCIMConfigAuthentication", + "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BookmarkApplication", "BookmarkApplicationSCIMConfig", "BookmarkApplicationSCIMConfigAuthentication", + "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", "InfrastructureApplicationPolicy", @@ -69,23 +99,53 @@ "InfrastructureApplicationPolicyConnectionRulesSSH", "InfrastructureApplicationSCIMConfig", "InfrastructureApplicationSCIMConfigAuthentication", + "InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", ] -class SelfHostedApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class SelfHostedApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class SelfHostedApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +SelfHostedApplicationDestination: TypeAlias = Union[ + SelfHostedApplicationDestinationPublicDestination, SelfHostedApplicationDestinationPrivateDestination +] + + class SelfHostedApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -94,8 +154,55 @@ class SelfHostedApplicationPolicy(ApplicationPolicy): """ +class SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + SelfHostedApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -290,8 +397,56 @@ class SaaSApplicationPolicy(ApplicationPolicy): SaaSApplicationSaaSApp: TypeAlias = Union[SAMLSaaSApp, OIDCSaaSApp] + +class SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + SaaSApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -385,20 +540,47 @@ class SaaSApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserSSHApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class BrowserSSHApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserSSHApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserSSHApplicationDestination: TypeAlias = Union[ + BrowserSSHApplicationDestinationPublicDestination, BrowserSSHApplicationDestinationPrivateDestination +] + + class BrowserSSHApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -407,8 +589,55 @@ class BrowserSSHApplicationPolicy(ApplicationPolicy): """ +class BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + BrowserSSHApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -593,20 +822,47 @@ class BrowserSSHApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserVNCApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class BrowserVNCApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserVNCApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserVNCApplicationDestination: TypeAlias = Union[ + BrowserVNCApplicationDestinationPublicDestination, BrowserVNCApplicationDestinationPrivateDestination +] + + class BrowserVNCApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -615,8 +871,55 @@ class BrowserVNCApplicationPolicy(ApplicationPolicy): """ +class BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + BrowserVNCApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -834,8 +1137,55 @@ class AppLauncherApplicationPolicy(ApplicationPolicy): """ +class AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + AppLauncherApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -976,8 +1326,57 @@ class DeviceEnrollmentPermissionsApplicationPolicy(ApplicationPolicy): """ +class DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + DeviceEnrollmentPermissionsApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -1118,8 +1517,57 @@ class BrowserIsolationPermissionsApplicationPolicy(ApplicationPolicy): """ +class BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + BrowserIsolationPermissionsApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -1227,8 +1675,55 @@ class BrowserIsolationPermissionsApplication(BaseModel): updated_at: Optional[datetime] = None +class BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + BookmarkApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -1376,8 +1871,55 @@ class InfrastructureApplicationPolicy(BaseModel): updated_at: Optional[datetime] = None +class InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + InfrastructureApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] diff --git a/src/cloudflare/types/zero_trust/access/application_list_response.py b/src/cloudflare/types/zero_trust/access/application_list_response.py index 975532467ec..1a0257ad43c 100644 --- a/src/cloudflare/types/zero_trust/access/application_list_response.py +++ b/src/cloudflare/types/zero_trust/access/application_list_response.py @@ -23,45 +23,75 @@ "ApplicationListResponse", "SelfHostedApplication", "SelfHostedApplicationDestination", + "SelfHostedApplicationDestinationPublicDestination", + "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationPolicy", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", + "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "SaaSApplication", "SaaSApplicationPolicy", "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", "SaaSApplicationSCIMConfigAuthentication", + "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", + "BrowserSSHApplicationDestinationPublicDestination", + "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", + "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", + "BrowserVNCApplicationDestinationPublicDestination", + "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", + "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "AppLauncherApplication", "AppLauncherApplicationFooterLink", "AppLauncherApplicationLandingPageDesign", "AppLauncherApplicationPolicy", "AppLauncherApplicationSCIMConfig", "AppLauncherApplicationSCIMConfigAuthentication", + "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationFooterLink", "DeviceEnrollmentPermissionsApplicationLandingPageDesign", "DeviceEnrollmentPermissionsApplicationPolicy", "DeviceEnrollmentPermissionsApplicationSCIMConfig", "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthentication", + "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationFooterLink", "BrowserIsolationPermissionsApplicationLandingPageDesign", "BrowserIsolationPermissionsApplicationPolicy", "BrowserIsolationPermissionsApplicationSCIMConfig", "BrowserIsolationPermissionsApplicationSCIMConfigAuthentication", + "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BookmarkApplication", "BookmarkApplicationSCIMConfig", "BookmarkApplicationSCIMConfigAuthentication", + "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", "InfrastructureApplicationPolicy", @@ -69,23 +99,53 @@ "InfrastructureApplicationPolicyConnectionRulesSSH", "InfrastructureApplicationSCIMConfig", "InfrastructureApplicationSCIMConfigAuthentication", + "InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", ] -class SelfHostedApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class SelfHostedApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class SelfHostedApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +SelfHostedApplicationDestination: TypeAlias = Union[ + SelfHostedApplicationDestinationPublicDestination, SelfHostedApplicationDestinationPrivateDestination +] + + class SelfHostedApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -94,8 +154,55 @@ class SelfHostedApplicationPolicy(ApplicationPolicy): """ +class SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + SelfHostedApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -290,8 +397,56 @@ class SaaSApplicationPolicy(ApplicationPolicy): SaaSApplicationSaaSApp: TypeAlias = Union[SAMLSaaSApp, OIDCSaaSApp] + +class SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + SaaSApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -385,20 +540,47 @@ class SaaSApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserSSHApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class BrowserSSHApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserSSHApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserSSHApplicationDestination: TypeAlias = Union[ + BrowserSSHApplicationDestinationPublicDestination, BrowserSSHApplicationDestinationPrivateDestination +] + + class BrowserSSHApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -407,8 +589,55 @@ class BrowserSSHApplicationPolicy(ApplicationPolicy): """ +class BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + BrowserSSHApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -593,20 +822,47 @@ class BrowserSSHApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserVNCApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class BrowserVNCApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserVNCApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserVNCApplicationDestination: TypeAlias = Union[ + BrowserVNCApplicationDestinationPublicDestination, BrowserVNCApplicationDestinationPrivateDestination +] + + class BrowserVNCApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -615,8 +871,55 @@ class BrowserVNCApplicationPolicy(ApplicationPolicy): """ +class BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + BrowserVNCApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -834,8 +1137,55 @@ class AppLauncherApplicationPolicy(ApplicationPolicy): """ +class AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + AppLauncherApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -976,8 +1326,57 @@ class DeviceEnrollmentPermissionsApplicationPolicy(ApplicationPolicy): """ +class DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + DeviceEnrollmentPermissionsApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -1118,8 +1517,57 @@ class BrowserIsolationPermissionsApplicationPolicy(ApplicationPolicy): """ +class BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + BrowserIsolationPermissionsApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -1227,8 +1675,55 @@ class BrowserIsolationPermissionsApplication(BaseModel): updated_at: Optional[datetime] = None +class BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + BookmarkApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -1376,8 +1871,55 @@ class InfrastructureApplicationPolicy(BaseModel): updated_at: Optional[datetime] = None +class InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + InfrastructureApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] diff --git a/src/cloudflare/types/zero_trust/access/application_update_params.py b/src/cloudflare/types/zero_trust/access/application_update_params.py index 2a8f59a7281..f96f295a24f 100644 --- a/src/cloudflare/types/zero_trust/access/application_update_params.py +++ b/src/cloudflare/types/zero_trust/access/application_update_params.py @@ -23,11 +23,16 @@ "ApplicationUpdateParams", "SelfHostedApplication", "SelfHostedApplicationDestination", + "SelfHostedApplicationDestinationPublicDestination", + "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationPolicy", "SelfHostedApplicationPolicyAccessAppPolicyLink", "SelfHostedApplicationPolicyUnionMember2", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", + "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "SaaSApplication", "SaaSApplicationPolicy", "SaaSApplicationPolicyAccessAppPolicyLink", @@ -35,20 +40,33 @@ "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", "SaaSApplicationSCIMConfigAuthentication", + "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", + "BrowserSSHApplicationDestinationPublicDestination", + "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationPolicyAccessAppPolicyLink", "BrowserSSHApplicationPolicyUnionMember2", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", + "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", + "BrowserVNCApplicationDestinationPublicDestination", + "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationPolicyAccessAppPolicyLink", "BrowserVNCApplicationPolicyUnionMember2", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", + "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "AppLauncherApplication", "AppLauncherApplicationFooterLink", "AppLauncherApplicationLandingPageDesign", @@ -57,6 +75,9 @@ "AppLauncherApplicationPolicyUnionMember2", "AppLauncherApplicationSCIMConfig", "AppLauncherApplicationSCIMConfigAuthentication", + "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationFooterLink", "DeviceEnrollmentPermissionsApplicationLandingPageDesign", @@ -65,6 +86,9 @@ "DeviceEnrollmentPermissionsApplicationPolicyUnionMember2", "DeviceEnrollmentPermissionsApplicationSCIMConfig", "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthentication", + "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationFooterLink", "BrowserIsolationPermissionsApplicationLandingPageDesign", @@ -73,9 +97,15 @@ "BrowserIsolationPermissionsApplicationPolicyUnionMember2", "BrowserIsolationPermissionsApplicationSCIMConfig", "BrowserIsolationPermissionsApplicationSCIMConfigAuthentication", + "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BookmarkApplication", "BookmarkApplicationSCIMConfig", "BookmarkApplicationSCIMConfigAuthentication", + "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", "InfrastructureApplicationPolicy", @@ -233,20 +263,47 @@ class SelfHostedApplication(TypedDict, total=False): """ -class SelfHostedApplicationDestination(TypedDict, total=False): - type: Literal["public", "private"] +class SelfHostedApplicationDestinationPublicDestination(TypedDict, total=False): + type: Literal["public"] uri: str """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class SelfHostedApplicationDestinationPrivateDestination(TypedDict, total=False): + cidr: str + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: str + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Literal["tcp", "udp"] + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: str + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Literal["private"] + + vnet_id: str + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +SelfHostedApplicationDestination: TypeAlias = Union[ + SelfHostedApplicationDestinationPublicDestination, SelfHostedApplicationDestinationPrivateDestination +] + + class SelfHostedApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): id: str """The UUID of the policy""" @@ -302,10 +359,58 @@ class SelfHostedApplicationPolicyUnionMember2(TypedDict, total=False): SelfHostedApplicationPolicyAccessAppPolicyLink, str, SelfHostedApplicationPolicyUnionMember2 ] + +class SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasicParam, + SCIMConfigAuthenticationOAuthBearerTokenParam, + SCIMConfigAuthenticationOauth2Param, + SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + SelfHostedApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, + SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + Iterable[SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -457,10 +562,56 @@ class SaaSApplicationPolicyUnionMember2(TypedDict, total=False): SaaSApplicationSaaSApp: TypeAlias = Union[SAMLSaaSAppParam, OIDCSaaSAppParam] + +class SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(TypedDict, total=False): + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasicParam, + SCIMConfigAuthenticationOAuthBearerTokenParam, + SCIMConfigAuthenticationOauth2Param, + SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + SaaSApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, + SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + Iterable[SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -646,20 +797,47 @@ class BrowserSSHApplication(TypedDict, total=False): """ -class BrowserSSHApplicationDestination(TypedDict, total=False): - type: Literal["public", "private"] +class BrowserSSHApplicationDestinationPublicDestination(TypedDict, total=False): + type: Literal["public"] uri: str """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserSSHApplicationDestinationPrivateDestination(TypedDict, total=False): + cidr: str + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: str + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Literal["tcp", "udp"] + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: str + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Literal["private"] + + vnet_id: str + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserSSHApplicationDestination: TypeAlias = Union[ + BrowserSSHApplicationDestinationPublicDestination, BrowserSSHApplicationDestinationPrivateDestination +] + + class BrowserSSHApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): id: str """The UUID of the policy""" @@ -715,10 +893,58 @@ class BrowserSSHApplicationPolicyUnionMember2(TypedDict, total=False): BrowserSSHApplicationPolicyAccessAppPolicyLink, str, BrowserSSHApplicationPolicyUnionMember2 ] + +class BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasicParam, + SCIMConfigAuthenticationOAuthBearerTokenParam, + SCIMConfigAuthenticationOauth2Param, + BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + BrowserSSHApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, + BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + Iterable[BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -904,20 +1130,47 @@ class BrowserVNCApplication(TypedDict, total=False): """ -class BrowserVNCApplicationDestination(TypedDict, total=False): - type: Literal["public", "private"] +class BrowserVNCApplicationDestinationPublicDestination(TypedDict, total=False): + type: Literal["public"] uri: str """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserVNCApplicationDestinationPrivateDestination(TypedDict, total=False): + cidr: str + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: str + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Literal["tcp", "udp"] + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: str + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Literal["private"] + + vnet_id: str + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserVNCApplicationDestination: TypeAlias = Union[ + BrowserVNCApplicationDestinationPublicDestination, BrowserVNCApplicationDestinationPrivateDestination +] + + class BrowserVNCApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): id: str """The UUID of the policy""" @@ -973,10 +1226,58 @@ class BrowserVNCApplicationPolicyUnionMember2(TypedDict, total=False): BrowserVNCApplicationPolicyAccessAppPolicyLink, str, BrowserVNCApplicationPolicyUnionMember2 ] + +class BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasicParam, + SCIMConfigAuthenticationOAuthBearerTokenParam, + SCIMConfigAuthenticationOauth2Param, + BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + BrowserVNCApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, + BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + Iterable[BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -1156,10 +1457,58 @@ class AppLauncherApplicationPolicyUnionMember2(TypedDict, total=False): AppLauncherApplicationPolicyAccessAppPolicyLink, str, AppLauncherApplicationPolicyUnionMember2 ] + +class AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasicParam, + SCIMConfigAuthenticationOAuthBearerTokenParam, + SCIMConfigAuthenticationOauth2Param, + AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + AppLauncherApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, + AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + Iterable[AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -1341,10 +1690,58 @@ class DeviceEnrollmentPermissionsApplicationPolicyUnionMember2(TypedDict, total= DeviceEnrollmentPermissionsApplicationPolicyUnionMember2, ] + +class DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasicParam, + SCIMConfigAuthenticationOAuthBearerTokenParam, + SCIMConfigAuthenticationOauth2Param, + DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + DeviceEnrollmentPermissionsApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, + DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + Iterable[DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -1526,10 +1923,58 @@ class BrowserIsolationPermissionsApplicationPolicyUnionMember2(TypedDict, total= BrowserIsolationPermissionsApplicationPolicyUnionMember2, ] + +class BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasicParam, + SCIMConfigAuthenticationOAuthBearerTokenParam, + SCIMConfigAuthenticationOauth2Param, + BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + BrowserIsolationPermissionsApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, + BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + Iterable[BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -1601,10 +2046,57 @@ class BookmarkApplication(TypedDict, total=False): """The application type.""" +class BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasicParam, + SCIMConfigAuthenticationOAuthBearerTokenParam, + SCIMConfigAuthenticationOauth2Param, + BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + BookmarkApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, + BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + Iterable[BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] diff --git a/src/cloudflare/types/zero_trust/access/application_update_response.py b/src/cloudflare/types/zero_trust/access/application_update_response.py index 72369b46d05..00ea299d5f3 100644 --- a/src/cloudflare/types/zero_trust/access/application_update_response.py +++ b/src/cloudflare/types/zero_trust/access/application_update_response.py @@ -23,45 +23,75 @@ "ApplicationUpdateResponse", "SelfHostedApplication", "SelfHostedApplicationDestination", + "SelfHostedApplicationDestinationPublicDestination", + "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationPolicy", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", + "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "SaaSApplication", "SaaSApplicationPolicy", "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", "SaaSApplicationSCIMConfigAuthentication", + "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", + "BrowserSSHApplicationDestinationPublicDestination", + "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", + "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", + "BrowserVNCApplicationDestinationPublicDestination", + "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", + "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "AppLauncherApplication", "AppLauncherApplicationFooterLink", "AppLauncherApplicationLandingPageDesign", "AppLauncherApplicationPolicy", "AppLauncherApplicationSCIMConfig", "AppLauncherApplicationSCIMConfigAuthentication", + "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationFooterLink", "DeviceEnrollmentPermissionsApplicationLandingPageDesign", "DeviceEnrollmentPermissionsApplicationPolicy", "DeviceEnrollmentPermissionsApplicationSCIMConfig", "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthentication", + "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationFooterLink", "BrowserIsolationPermissionsApplicationLandingPageDesign", "BrowserIsolationPermissionsApplicationPolicy", "BrowserIsolationPermissionsApplicationSCIMConfig", "BrowserIsolationPermissionsApplicationSCIMConfigAuthentication", + "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BookmarkApplication", "BookmarkApplicationSCIMConfig", "BookmarkApplicationSCIMConfigAuthentication", + "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", "InfrastructureApplicationPolicy", @@ -69,23 +99,53 @@ "InfrastructureApplicationPolicyConnectionRulesSSH", "InfrastructureApplicationSCIMConfig", "InfrastructureApplicationSCIMConfigAuthentication", + "InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", ] -class SelfHostedApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class SelfHostedApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class SelfHostedApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +SelfHostedApplicationDestination: TypeAlias = Union[ + SelfHostedApplicationDestinationPublicDestination, SelfHostedApplicationDestinationPrivateDestination +] + + class SelfHostedApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -94,8 +154,55 @@ class SelfHostedApplicationPolicy(ApplicationPolicy): """ +class SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + SelfHostedApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -290,8 +397,56 @@ class SaaSApplicationPolicy(ApplicationPolicy): SaaSApplicationSaaSApp: TypeAlias = Union[SAMLSaaSApp, OIDCSaaSApp] + +class SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + SaaSApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -385,20 +540,47 @@ class SaaSApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserSSHApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class BrowserSSHApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserSSHApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserSSHApplicationDestination: TypeAlias = Union[ + BrowserSSHApplicationDestinationPublicDestination, BrowserSSHApplicationDestinationPrivateDestination +] + + class BrowserSSHApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -407,8 +589,55 @@ class BrowserSSHApplicationPolicy(ApplicationPolicy): """ +class BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + BrowserSSHApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -593,20 +822,47 @@ class BrowserSSHApplication(BaseModel): updated_at: Optional[datetime] = None -class BrowserVNCApplicationDestination(BaseModel): - type: Optional[Literal["public", "private"]] = None +class BrowserVNCApplicationDestinationPublicDestination(BaseModel): + type: Optional[Literal["public"]] = None uri: Optional[str] = None """The URI of the destination. - Public destinations can include a domain and path with + Public destinations' URIs can include a domain and path with [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). - Private destinations are an early access feature and gated behind a feature - flag. Private destinations support private IPv4, IPv6, and Server Name - Indications (SNI) with optional port ranges. """ +class BrowserVNCApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +BrowserVNCApplicationDestination: TypeAlias = Union[ + BrowserVNCApplicationDestinationPublicDestination, BrowserVNCApplicationDestinationPrivateDestination +] + + class BrowserVNCApplicationPolicy(ApplicationPolicy): precedence: Optional[int] = None """The order of execution for this policy. @@ -615,8 +871,55 @@ class BrowserVNCApplicationPolicy(ApplicationPolicy): """ +class BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + BrowserVNCApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -834,8 +1137,55 @@ class AppLauncherApplicationPolicy(ApplicationPolicy): """ +class AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + AppLauncherApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -976,8 +1326,57 @@ class DeviceEnrollmentPermissionsApplicationPolicy(ApplicationPolicy): """ +class DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + DeviceEnrollmentPermissionsApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -1118,8 +1517,57 @@ class BrowserIsolationPermissionsApplicationPolicy(ApplicationPolicy): """ +class BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + BrowserIsolationPermissionsApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -1227,8 +1675,55 @@ class BrowserIsolationPermissionsApplication(BaseModel): updated_at: Optional[datetime] = None +class BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + BookmarkApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[BookmarkApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] @@ -1376,8 +1871,55 @@ class InfrastructureApplicationPolicy(BaseModel): updated_at: Optional[datetime] = None +class InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + InfrastructureApplicationSCIMConfigAuthentication: TypeAlias = Union[ - SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2 + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] diff --git a/src/cloudflare/types/zero_trust/access/gateway_ca_create_response.py b/src/cloudflare/types/zero_trust/access/gateway_ca_create_response.py new file mode 100644 index 00000000000..42288b6edad --- /dev/null +++ b/src/cloudflare/types/zero_trust/access/gateway_ca_create_response.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["GatewayCACreateResponse"] + + +class GatewayCACreateResponse(BaseModel): + id: Optional[str] = None + """The key ID of this certificate.""" + + public_key: Optional[str] = None + """The public key of this certificate.""" diff --git a/src/cloudflare/types/zero_trust/access/gateway_ca_delete_response.py b/src/cloudflare/types/zero_trust/access/gateway_ca_delete_response.py new file mode 100644 index 00000000000..a30c09026e1 --- /dev/null +++ b/src/cloudflare/types/zero_trust/access/gateway_ca_delete_response.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["GatewayCADeleteResponse"] + + +class GatewayCADeleteResponse(BaseModel): + id: Optional[str] = None + """UUID""" diff --git a/src/cloudflare/types/zero_trust/access/gateway_ca_list_response.py b/src/cloudflare/types/zero_trust/access/gateway_ca_list_response.py new file mode 100644 index 00000000000..4a1ebc3f0b2 --- /dev/null +++ b/src/cloudflare/types/zero_trust/access/gateway_ca_list_response.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["GatewayCAListResponse"] + + +class GatewayCAListResponse(BaseModel): + id: Optional[str] = None + """The key ID of this certificate.""" + + public_key: Optional[str] = None + """The public key of this certificate.""" diff --git a/src/cloudflare/types/zero_trust/access/infrastructure/target_list_params.py b/src/cloudflare/types/zero_trust/access/infrastructure/target_list_params.py index fae2ccc7255..fb6f96ce9ad 100644 --- a/src/cloudflare/types/zero_trust/access/infrastructure/target_list_params.py +++ b/src/cloudflare/types/zero_trust/access/infrastructure/target_list_params.py @@ -2,9 +2,9 @@ from __future__ import annotations -from typing import Union, Optional +from typing import List, Union, Optional from datetime import datetime -from typing_extensions import Required, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ....._utils import PropertyInfo @@ -16,7 +16,13 @@ class TargetListParams(TypedDict, total=False): """Account identifier""" created_after: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] - """Date and time at which the target was created""" + """Date and time at which the target was created after (inclusive)""" + + created_before: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] + """Date and time at which the target was created before (inclusive)""" + + direction: Literal["asc", "desc"] + """The sorting direction.""" hostname: Optional[str] """Hostname of a target""" @@ -30,8 +36,20 @@ class TargetListParams(TypedDict, total=False): ip_v6: Optional[str] """IPv6 address of the target""" + ips: List[str] + """Filters for targets that have any of the following IP addresses. + + Specify `ips` multiple times in query parameter to build list of candidates. + """ + modified_after: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] - """Date and time at which the target was modified""" + """Date and time at which the target was modified after (inclusive)""" + + modified_before: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] + """Date and time at which the target was modified before (inclusive)""" + + order: Literal["hostname", "created_at"] + """The field to sort by.""" page: int """Current page in the response""" diff --git a/src/cloudflare/types/zero_trust/device_get_response.py b/src/cloudflare/types/zero_trust/device_get_response.py index 0b11c5ec1cc..12ecc5f039a 100644 --- a/src/cloudflare/types/zero_trust/device_get_response.py +++ b/src/cloudflare/types/zero_trust/device_get_response.py @@ -1,8 +1,83 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union, Optional -from typing_extensions import TypeAlias +from typing import Optional +from datetime import datetime -__all__ = ["DeviceGetResponse"] +from ..._models import BaseModel -DeviceGetResponse: TypeAlias = Union[Optional[str], Optional[object]] +__all__ = ["DeviceGetResponse", "Account", "User"] + + +class Account(BaseModel): + id: Optional[str] = None + + account_type: Optional[str] = None + + name: Optional[str] = None + """The name of the enrolled account.""" + + +class User(BaseModel): + id: Optional[str] = None + """UUID""" + + email: Optional[str] = None + """The contact email address of the user.""" + + name: Optional[str] = None + """The enrolled device user's name.""" + + +class DeviceGetResponse(BaseModel): + id: Optional[str] = None + """Device ID.""" + + account: Optional[Account] = None + + created: Optional[datetime] = None + """When the device was created.""" + + deleted: Optional[bool] = None + """True if the device was deleted.""" + + device_type: Optional[str] = None + + gateway_device_id: Optional[str] = None + + ip: Optional[str] = None + """IPv4 or IPv6 address.""" + + key: Optional[str] = None + """The device's public key.""" + + key_type: Optional[str] = None + """Type of the key.""" + + last_seen: Optional[datetime] = None + """When the device last connected to Cloudflare services.""" + + mac_address: Optional[str] = None + """The device mac address.""" + + model: Optional[str] = None + """The device model name.""" + + name: Optional[str] = None + """The device name.""" + + os_version: Optional[str] = None + """The operating system version.""" + + serial_number: Optional[str] = None + """The device serial number.""" + + tunnel_type: Optional[str] = None + """Type of the tunnel connection used.""" + + updated: Optional[datetime] = None + """When the device was updated.""" + + user: Optional[User] = None + + version: Optional[str] = None + """The WARP client version.""" diff --git a/src/cloudflare/types/zero_trust/devices/policies/default/certificate_edit_response.py b/src/cloudflare/types/zero_trust/devices/policies/default/certificate_edit_response.py index 0cd113c6420..b74cd9b2576 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/default/certificate_edit_response.py +++ b/src/cloudflare/types/zero_trust/devices/policies/default/certificate_edit_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union, Optional +from typing import Union from typing_extensions import TypeAlias __all__ = ["CertificateEditResponse"] -CertificateEditResponse: TypeAlias = Union[Optional[str], Optional[object]] +CertificateEditResponse: TypeAlias = Union[str, object, None] diff --git a/src/cloudflare/types/zero_trust/devices/policies/default/certificate_get_response.py b/src/cloudflare/types/zero_trust/devices/policies/default/certificate_get_response.py index 055be51f531..47253a71db8 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/default/certificate_get_response.py +++ b/src/cloudflare/types/zero_trust/devices/policies/default/certificate_get_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union, Optional +from typing import Union from typing_extensions import TypeAlias __all__ = ["CertificateGetResponse"] -CertificateGetResponse: TypeAlias = Union[Optional[str], Optional[object]] +CertificateGetResponse: TypeAlias = Union[str, object, None] diff --git a/src/cloudflare/types/zero_trust/devices/posture/integration_delete_response.py b/src/cloudflare/types/zero_trust/devices/posture/integration_delete_response.py index df93cf5607b..5ad6c5cee94 100644 --- a/src/cloudflare/types/zero_trust/devices/posture/integration_delete_response.py +++ b/src/cloudflare/types/zero_trust/devices/posture/integration_delete_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union, Optional +from typing import Union from typing_extensions import TypeAlias __all__ = ["IntegrationDeleteResponse"] -IntegrationDeleteResponse: TypeAlias = Union[Optional[str], Optional[object]] +IntegrationDeleteResponse: TypeAlias = Union[str, object, None] diff --git a/src/cloudflare/types/zero_trust/devices/revoke_create_response.py b/src/cloudflare/types/zero_trust/devices/revoke_create_response.py index 09aceb4935f..42834980772 100644 --- a/src/cloudflare/types/zero_trust/devices/revoke_create_response.py +++ b/src/cloudflare/types/zero_trust/devices/revoke_create_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union, Optional +from typing import Union from typing_extensions import TypeAlias __all__ = ["RevokeCreateResponse"] -RevokeCreateResponse: TypeAlias = Union[Optional[str], Optional[object]] +RevokeCreateResponse: TypeAlias = Union[str, object, None] diff --git a/src/cloudflare/types/zero_trust/devices/unrevoke_create_response.py b/src/cloudflare/types/zero_trust/devices/unrevoke_create_response.py index 4b3977f4e98..80dd27e6b84 100644 --- a/src/cloudflare/types/zero_trust/devices/unrevoke_create_response.py +++ b/src/cloudflare/types/zero_trust/devices/unrevoke_create_response.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union, Optional +from typing import Union from typing_extensions import TypeAlias __all__ = ["UnrevokeCreateResponse"] -UnrevokeCreateResponse: TypeAlias = Union[Optional[str], Optional[object]] +UnrevokeCreateResponse: TypeAlias = Union[str, object, None] diff --git a/src/cloudflare/types/zero_trust/dex/commands/__init__.py b/src/cloudflare/types/zero_trust/dex/commands/__init__.py index 83304891f5e..cf51077364d 100644 --- a/src/cloudflare/types/zero_trust/dex/commands/__init__.py +++ b/src/cloudflare/types/zero_trust/dex/commands/__init__.py @@ -2,4 +2,8 @@ from __future__ import annotations +from .user_list_params import UserListParams as UserListParams +from .device_list_params import DeviceListParams as DeviceListParams from .quota_get_response import QuotaGetResponse as QuotaGetResponse +from .user_list_response import UserListResponse as UserListResponse +from .device_list_response import DeviceListResponse as DeviceListResponse diff --git a/src/cloudflare/types/zero_trust/dex/commands/device_list_params.py b/src/cloudflare/types/zero_trust/dex/commands/device_list_params.py new file mode 100644 index 00000000000..126d1a8cb20 --- /dev/null +++ b/src/cloudflare/types/zero_trust/dex/commands/device_list_params.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["DeviceListParams"] + + +class DeviceListParams(TypedDict, total=False): + account_id: Required[str] + + page: Required[float] + """Page number of paginated results""" + + per_page: Required[float] + """Number of items per page""" + + search: str + """Filter devices by name or email""" diff --git a/src/cloudflare/types/zero_trust/dex/commands/device_list_response.py b/src/cloudflare/types/zero_trust/dex/commands/device_list_response.py new file mode 100644 index 00000000000..5fb1c642279 --- /dev/null +++ b/src/cloudflare/types/zero_trust/dex/commands/device_list_response.py @@ -0,0 +1,37 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ....._models import BaseModel + +__all__ = ["DeviceListResponse", "Device"] + + +class Device(BaseModel): + device_id: Optional[str] = FieldInfo(alias="deviceId", default=None) + """Device identifier (UUID v4)""" + + device_name: Optional[str] = FieldInfo(alias="deviceName", default=None) + """Device identifier (human readable)""" + + person_email: Optional[str] = FieldInfo(alias="personEmail", default=None) + """User contact email address""" + + platform: Optional[str] = None + """Operating system""" + + status: Optional[str] = None + """Network status""" + + timestamp: Optional[str] = None + """Timestamp in ISO format""" + + version: Optional[str] = None + """WARP client version""" + + +class DeviceListResponse(BaseModel): + devices: Optional[List[Device]] = None + """List of eligible devices""" diff --git a/src/cloudflare/types/zero_trust/dex/commands/user_list_params.py b/src/cloudflare/types/zero_trust/dex/commands/user_list_params.py new file mode 100644 index 00000000000..753ca290284 --- /dev/null +++ b/src/cloudflare/types/zero_trust/dex/commands/user_list_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["UserListParams"] + + +class UserListParams(TypedDict, total=False): + account_id: Required[str] + + search: str + """filter user emails by search""" diff --git a/src/cloudflare/types/zero_trust/dex/commands/user_list_response.py b/src/cloudflare/types/zero_trust/dex/commands/user_list_response.py new file mode 100644 index 00000000000..d2394cc4a99 --- /dev/null +++ b/src/cloudflare/types/zero_trust/dex/commands/user_list_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ....._models import BaseModel + +__all__ = ["UserListResponse"] + + +class UserListResponse(BaseModel): + user_emails: Optional[List[str]] = FieldInfo(alias="userEmails", default=None) + """List of user emails""" diff --git a/src/cloudflare/types/zero_trust/dlp/dataset.py b/src/cloudflare/types/zero_trust/dlp/dataset.py index a7f2b015e78..88fe2483702 100644 --- a/src/cloudflare/types/zero_trust/dlp/dataset.py +++ b/src/cloudflare/types/zero_trust/dlp/dataset.py @@ -45,6 +45,10 @@ class Dataset(BaseModel): status: Literal["empty", "uploading", "processing", "failed", "complete"] updated_at: datetime + """When the dataset was last updated. + + This includes name or description changes as well as uploads. + """ uploads: List[Upload] diff --git a/src/cloudflare/types/zero_trust/dlp/email/__init__.py b/src/cloudflare/types/zero_trust/dlp/email/__init__.py new file mode 100644 index 00000000000..d6f82bc8871 --- /dev/null +++ b/src/cloudflare/types/zero_trust/dlp/email/__init__.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .rule_get_response import RuleGetResponse as RuleGetResponse +from .rule_create_params import RuleCreateParams as RuleCreateParams +from .rule_list_response import RuleListResponse as RuleListResponse +from .rule_update_params import RuleUpdateParams as RuleUpdateParams +from .rule_create_response import RuleCreateResponse as RuleCreateResponse +from .rule_delete_response import RuleDeleteResponse as RuleDeleteResponse +from .rule_update_response import RuleUpdateResponse as RuleUpdateResponse +from .rule_bulk_edit_params import RuleBulkEditParams as RuleBulkEditParams +from .rule_bulk_edit_response import RuleBulkEditResponse as RuleBulkEditResponse +from .account_mapping_get_response import AccountMappingGetResponse as AccountMappingGetResponse +from .account_mapping_create_params import AccountMappingCreateParams as AccountMappingCreateParams +from .account_mapping_create_response import AccountMappingCreateResponse as AccountMappingCreateResponse diff --git a/src/cloudflare/types/zero_trust/dlp/email/account_mapping_create_params.py b/src/cloudflare/types/zero_trust/dlp/email/account_mapping_create_params.py new file mode 100644 index 00000000000..0c6ebbedd48 --- /dev/null +++ b/src/cloudflare/types/zero_trust/dlp/email/account_mapping_create_params.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +__all__ = ["AccountMappingCreateParams", "AuthRequirements", "AuthRequirementsUnionMember0", "AuthRequirementsType"] + + +class AccountMappingCreateParams(TypedDict, total=False): + account_id: Required[str] + + auth_requirements: Required[AuthRequirements] + + +class AuthRequirementsUnionMember0(TypedDict, total=False): + allowed_microsoft_organizations: Required[List[str]] + + type: Required[Literal["Org"]] + + +class AuthRequirementsType(TypedDict, total=False): + type: Required[Literal["NoAuth"]] + + +AuthRequirements: TypeAlias = Union[AuthRequirementsUnionMember0, AuthRequirementsType] diff --git a/src/cloudflare/types/zero_trust/dlp/email/account_mapping_create_response.py b/src/cloudflare/types/zero_trust/dlp/email/account_mapping_create_response.py new file mode 100644 index 00000000000..5be7c141a7d --- /dev/null +++ b/src/cloudflare/types/zero_trust/dlp/email/account_mapping_create_response.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union +from typing_extensions import Literal, TypeAlias + +from ....._models import BaseModel + +__all__ = ["AccountMappingCreateResponse", "AuthRequirements", "AuthRequirementsUnionMember0", "AuthRequirementsType"] + + +class AuthRequirementsUnionMember0(BaseModel): + allowed_microsoft_organizations: List[str] + + type: Literal["Org"] + + +class AuthRequirementsType(BaseModel): + type: Literal["NoAuth"] + + +AuthRequirements: TypeAlias = Union[AuthRequirementsUnionMember0, AuthRequirementsType] + + +class AccountMappingCreateResponse(BaseModel): + addin_identifier_token: str + + auth_requirements: AuthRequirements diff --git a/src/cloudflare/types/zero_trust/dlp/email/account_mapping_get_response.py b/src/cloudflare/types/zero_trust/dlp/email/account_mapping_get_response.py new file mode 100644 index 00000000000..2b3be1a1c92 --- /dev/null +++ b/src/cloudflare/types/zero_trust/dlp/email/account_mapping_get_response.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union +from typing_extensions import Literal, TypeAlias + +from ....._models import BaseModel + +__all__ = ["AccountMappingGetResponse", "AuthRequirements", "AuthRequirementsUnionMember0", "AuthRequirementsType"] + + +class AuthRequirementsUnionMember0(BaseModel): + allowed_microsoft_organizations: List[str] + + type: Literal["Org"] + + +class AuthRequirementsType(BaseModel): + type: Literal["NoAuth"] + + +AuthRequirements: TypeAlias = Union[AuthRequirementsUnionMember0, AuthRequirementsType] + + +class AccountMappingGetResponse(BaseModel): + addin_identifier_token: str + + auth_requirements: AuthRequirements diff --git a/src/cloudflare/types/zero_trust/dlp/email/rule_bulk_edit_params.py b/src/cloudflare/types/zero_trust/dlp/email/rule_bulk_edit_params.py new file mode 100644 index 00000000000..bd76fa7aa29 --- /dev/null +++ b/src/cloudflare/types/zero_trust/dlp/email/rule_bulk_edit_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict +from typing_extensions import Required, TypedDict + +__all__ = ["RuleBulkEditParams"] + + +class RuleBulkEditParams(TypedDict, total=False): + account_id: Required[str] + + new_priorities: Required[Dict[str, int]] diff --git a/src/cloudflare/types/zero_trust/dlp/email/rule_bulk_edit_response.py b/src/cloudflare/types/zero_trust/dlp/email/rule_bulk_edit_response.py new file mode 100644 index 00000000000..55a9db93b90 --- /dev/null +++ b/src/cloudflare/types/zero_trust/dlp/email/rule_bulk_edit_response.py @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from ....._models import BaseModel + +__all__ = ["RuleBulkEditResponse", "Action", "Condition"] + + +class Action(BaseModel): + action: Literal["Block"] + + message: Optional[str] = None + + +class Condition(BaseModel): + operator: Literal["InList", "NotInList", "MatchRegex", "NotMatchRegex"] + + selector: Literal["Recipients", "Sender", "DLPProfiles"] + + value: object + + +class RuleBulkEditResponse(BaseModel): + action: Action + + conditions: List[Condition] + """Rule is triggered if all conditions match""" + + created_at: datetime + + enabled: bool + + name: str + + priority: int + + rule_id: str + + updated_at: datetime + + description: Optional[str] = None diff --git a/src/cloudflare/types/zero_trust/dlp/email/rule_create_params.py b/src/cloudflare/types/zero_trust/dlp/email/rule_create_params.py new file mode 100644 index 00000000000..8d1bf0f8cd2 --- /dev/null +++ b/src/cloudflare/types/zero_trust/dlp/email/rule_create_params.py @@ -0,0 +1,37 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable, Optional +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["RuleCreateParams", "Action", "Condition"] + + +class RuleCreateParams(TypedDict, total=False): + account_id: Required[str] + + action: Required[Action] + + conditions: Required[Iterable[Condition]] + """Rule is triggered if all conditions match""" + + enabled: Required[bool] + + name: Required[str] + + description: Optional[str] + + +class Action(TypedDict, total=False): + action: Required[Literal["Block"]] + + message: Optional[str] + + +class Condition(TypedDict, total=False): + operator: Required[Literal["InList", "NotInList", "MatchRegex", "NotMatchRegex"]] + + selector: Required[Literal["Recipients", "Sender", "DLPProfiles"]] + + value: Required[object] diff --git a/src/cloudflare/types/zero_trust/dlp/email/rule_create_response.py b/src/cloudflare/types/zero_trust/dlp/email/rule_create_response.py new file mode 100644 index 00000000000..7077679dc93 --- /dev/null +++ b/src/cloudflare/types/zero_trust/dlp/email/rule_create_response.py @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from ....._models import BaseModel + +__all__ = ["RuleCreateResponse", "Action", "Condition"] + + +class Action(BaseModel): + action: Literal["Block"] + + message: Optional[str] = None + + +class Condition(BaseModel): + operator: Literal["InList", "NotInList", "MatchRegex", "NotMatchRegex"] + + selector: Literal["Recipients", "Sender", "DLPProfiles"] + + value: object + + +class RuleCreateResponse(BaseModel): + action: Action + + conditions: List[Condition] + """Rule is triggered if all conditions match""" + + created_at: datetime + + enabled: bool + + name: str + + priority: int + + rule_id: str + + updated_at: datetime + + description: Optional[str] = None diff --git a/src/cloudflare/types/zero_trust/dlp/email/rule_delete_response.py b/src/cloudflare/types/zero_trust/dlp/email/rule_delete_response.py new file mode 100644 index 00000000000..b67309d5e8a --- /dev/null +++ b/src/cloudflare/types/zero_trust/dlp/email/rule_delete_response.py @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from ....._models import BaseModel + +__all__ = ["RuleDeleteResponse", "Action", "Condition"] + + +class Action(BaseModel): + action: Literal["Block"] + + message: Optional[str] = None + + +class Condition(BaseModel): + operator: Literal["InList", "NotInList", "MatchRegex", "NotMatchRegex"] + + selector: Literal["Recipients", "Sender", "DLPProfiles"] + + value: object + + +class RuleDeleteResponse(BaseModel): + action: Action + + conditions: List[Condition] + """Rule is triggered if all conditions match""" + + created_at: datetime + + enabled: bool + + name: str + + priority: int + + rule_id: str + + updated_at: datetime + + description: Optional[str] = None diff --git a/src/cloudflare/types/zero_trust/dlp/email/rule_get_response.py b/src/cloudflare/types/zero_trust/dlp/email/rule_get_response.py new file mode 100644 index 00000000000..75681ab045e --- /dev/null +++ b/src/cloudflare/types/zero_trust/dlp/email/rule_get_response.py @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from ....._models import BaseModel + +__all__ = ["RuleGetResponse", "Action", "Condition"] + + +class Action(BaseModel): + action: Literal["Block"] + + message: Optional[str] = None + + +class Condition(BaseModel): + operator: Literal["InList", "NotInList", "MatchRegex", "NotMatchRegex"] + + selector: Literal["Recipients", "Sender", "DLPProfiles"] + + value: object + + +class RuleGetResponse(BaseModel): + action: Action + + conditions: List[Condition] + """Rule is triggered if all conditions match""" + + created_at: datetime + + enabled: bool + + name: str + + priority: int + + rule_id: str + + updated_at: datetime + + description: Optional[str] = None diff --git a/src/cloudflare/types/zero_trust/dlp/email/rule_list_response.py b/src/cloudflare/types/zero_trust/dlp/email/rule_list_response.py new file mode 100644 index 00000000000..0e5913db430 --- /dev/null +++ b/src/cloudflare/types/zero_trust/dlp/email/rule_list_response.py @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from ....._models import BaseModel + +__all__ = ["RuleListResponse", "Action", "Condition"] + + +class Action(BaseModel): + action: Literal["Block"] + + message: Optional[str] = None + + +class Condition(BaseModel): + operator: Literal["InList", "NotInList", "MatchRegex", "NotMatchRegex"] + + selector: Literal["Recipients", "Sender", "DLPProfiles"] + + value: object + + +class RuleListResponse(BaseModel): + action: Action + + conditions: List[Condition] + """Rule is triggered if all conditions match""" + + created_at: datetime + + enabled: bool + + name: str + + priority: int + + rule_id: str + + updated_at: datetime + + description: Optional[str] = None diff --git a/src/cloudflare/types/zero_trust/dlp/email/rule_update_params.py b/src/cloudflare/types/zero_trust/dlp/email/rule_update_params.py new file mode 100644 index 00000000000..1bf1e76cf2f --- /dev/null +++ b/src/cloudflare/types/zero_trust/dlp/email/rule_update_params.py @@ -0,0 +1,37 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable, Optional +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["RuleUpdateParams", "Action", "Condition"] + + +class RuleUpdateParams(TypedDict, total=False): + account_id: Required[str] + + action: Required[Action] + + conditions: Required[Iterable[Condition]] + """Rule is triggered if all conditions match""" + + enabled: Required[bool] + + name: Required[str] + + description: Optional[str] + + +class Action(TypedDict, total=False): + action: Required[Literal["Block"]] + + message: Optional[str] + + +class Condition(TypedDict, total=False): + operator: Required[Literal["InList", "NotInList", "MatchRegex", "NotMatchRegex"]] + + selector: Required[Literal["Recipients", "Sender", "DLPProfiles"]] + + value: Required[object] diff --git a/src/cloudflare/types/zero_trust/dlp/email/rule_update_response.py b/src/cloudflare/types/zero_trust/dlp/email/rule_update_response.py new file mode 100644 index 00000000000..c1e9f32703d --- /dev/null +++ b/src/cloudflare/types/zero_trust/dlp/email/rule_update_response.py @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from ....._models import BaseModel + +__all__ = ["RuleUpdateResponse", "Action", "Condition"] + + +class Action(BaseModel): + action: Literal["Block"] + + message: Optional[str] = None + + +class Condition(BaseModel): + operator: Literal["InList", "NotInList", "MatchRegex", "NotMatchRegex"] + + selector: Literal["Recipients", "Sender", "DLPProfiles"] + + value: object + + +class RuleUpdateResponse(BaseModel): + action: Action + + conditions: List[Condition] + """Rule is triggered if all conditions match""" + + created_at: datetime + + enabled: bool + + name: str + + priority: int + + rule_id: str + + updated_at: datetime + + description: Optional[str] = None diff --git a/src/cloudflare/types/zero_trust/gateway/configuration_edit_params.py b/src/cloudflare/types/zero_trust/gateway/configuration_edit_params.py index 9adb3f5ae01..e2a203f8dd8 100644 --- a/src/cloudflare/types/zero_trust/gateway/configuration_edit_params.py +++ b/src/cloudflare/types/zero_trust/gateway/configuration_edit_params.py @@ -13,4 +13,4 @@ class ConfigurationEditParams(TypedDict, total=False): account_id: Required[str] settings: GatewayConfigurationSettingsParam - """account settings.""" + """Account settings""" diff --git a/src/cloudflare/types/zero_trust/gateway/configuration_edit_response.py b/src/cloudflare/types/zero_trust/gateway/configuration_edit_response.py index e7659cf264e..13a39732b9b 100644 --- a/src/cloudflare/types/zero_trust/gateway/configuration_edit_response.py +++ b/src/cloudflare/types/zero_trust/gateway/configuration_edit_response.py @@ -13,6 +13,6 @@ class ConfigurationEditResponse(BaseModel): created_at: Optional[datetime] = None settings: Optional[GatewayConfigurationSettings] = None - """account settings.""" + """Account settings""" updated_at: Optional[datetime] = None diff --git a/src/cloudflare/types/zero_trust/gateway/configuration_get_response.py b/src/cloudflare/types/zero_trust/gateway/configuration_get_response.py index ab5d764c721..63636f9ea17 100644 --- a/src/cloudflare/types/zero_trust/gateway/configuration_get_response.py +++ b/src/cloudflare/types/zero_trust/gateway/configuration_get_response.py @@ -13,6 +13,6 @@ class ConfigurationGetResponse(BaseModel): created_at: Optional[datetime] = None settings: Optional[GatewayConfigurationSettings] = None - """account settings.""" + """Account settings""" updated_at: Optional[datetime] = None diff --git a/src/cloudflare/types/zero_trust/gateway/configuration_update_params.py b/src/cloudflare/types/zero_trust/gateway/configuration_update_params.py index 7fcc1d00377..8dc9dece583 100644 --- a/src/cloudflare/types/zero_trust/gateway/configuration_update_params.py +++ b/src/cloudflare/types/zero_trust/gateway/configuration_update_params.py @@ -13,4 +13,4 @@ class ConfigurationUpdateParams(TypedDict, total=False): account_id: Required[str] settings: GatewayConfigurationSettingsParam - """account settings.""" + """Account settings""" diff --git a/src/cloudflare/types/zero_trust/gateway/configuration_update_response.py b/src/cloudflare/types/zero_trust/gateway/configuration_update_response.py index f88c116ea7e..17c9c505bf3 100644 --- a/src/cloudflare/types/zero_trust/gateway/configuration_update_response.py +++ b/src/cloudflare/types/zero_trust/gateway/configuration_update_response.py @@ -13,6 +13,6 @@ class ConfigurationUpdateResponse(BaseModel): created_at: Optional[datetime] = None settings: Optional[GatewayConfigurationSettings] = None - """account settings.""" + """Account settings""" updated_at: Optional[datetime] = None diff --git a/src/cloudflare/types/zero_trust/gateway/gateway_rule.py b/src/cloudflare/types/zero_trust/gateway/gateway_rule.py index 0f312358eea..ba61ea684bd 100644 --- a/src/cloudflare/types/zero_trust/gateway/gateway_rule.py +++ b/src/cloudflare/types/zero_trust/gateway/gateway_rule.py @@ -117,3 +117,6 @@ class GatewayRule(BaseModel): """The wirefilter expression used for traffic matching.""" updated_at: Optional[datetime] = None + + version: Optional[int] = None + """version number of the rule""" diff --git a/src/cloudflare/types/zero_trust/gateway/list_update_params.py b/src/cloudflare/types/zero_trust/gateway/list_update_params.py index 0177452d00e..d02a3f2a256 100644 --- a/src/cloudflare/types/zero_trust/gateway/list_update_params.py +++ b/src/cloudflare/types/zero_trust/gateway/list_update_params.py @@ -2,8 +2,11 @@ from __future__ import annotations +from typing import Iterable from typing_extensions import Required, TypedDict +from .gateway_item_param import GatewayItemParam + __all__ = ["ListUpdateParams"] @@ -15,3 +18,6 @@ class ListUpdateParams(TypedDict, total=False): description: str """The description of the list.""" + + items: Iterable[GatewayItemParam] + """The items in the list.""" diff --git a/src/cloudflare/types/zero_trust/gateway/location.py b/src/cloudflare/types/zero_trust/gateway/location.py index b13ca136603..a5755c64010 100644 --- a/src/cloudflare/types/zero_trust/gateway/location.py +++ b/src/cloudflare/types/zero_trust/gateway/location.py @@ -25,6 +25,13 @@ class Location(BaseModel): dns_destination_ips_id: Optional[str] = None """The identifier of the pair of IPv4 addresses assigned to this location.""" + dns_destination_ipv6_block_id: Optional[str] = None + """ + The uuid identifier of the IPv6 block brought to the gateway, so that this + location's IPv6 address is allocated from the Bring Your Own Ipv6(BYOIPv6) block + and not from the standard CloudFlare IPv6 block. + """ + doh_subdomain: Optional[str] = None """The DNS over HTTPS domain to send DNS requests to. diff --git a/src/cloudflare/types/zero_trust/gateway/rule_setting.py b/src/cloudflare/types/zero_trust/gateway/rule_setting.py index 60b6eff04c4..3d73a0b442c 100644 --- a/src/cloudflare/types/zero_trust/gateway/rule_setting.py +++ b/src/cloudflare/types/zero_trust/gateway/rule_setting.py @@ -18,6 +18,7 @@ "NotificationSettings", "PayloadLog", "Quarantine", + "ResolveDNSInternally", "UntrustedCERT", ] @@ -107,6 +108,18 @@ class Quarantine(BaseModel): """Types of files to sandbox.""" +class ResolveDNSInternally(BaseModel): + fallback: Optional[Literal["none", "public_dns"]] = None + """ + The fallback behavior to apply when the internal DNS response code is different + from 'NOERROR' or when the response data only contains CNAME records for 'A' or + 'AAAA' queries. + """ + + view_id: Optional[str] = None + """The internal DNS view identifier that's passed to the internal DNS service.""" + + class UntrustedCERT(BaseModel): action: Optional[Literal["pass_through", "block", "error"]] = None """The action performed when an untrusted certificate is seen. @@ -149,9 +162,9 @@ class RuleSetting(BaseModel): dns_resolvers: Optional[DNSResolvers] = None """Add your own custom resolvers to route queries that match the resolver policy. - Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will - route to the address closest to their origin. Only valid when a rule's action is - set to 'resolve'. + Cannot be used when 'resolve_dns_through_cloudflare' or 'resolve_dns_internally' + are set. DNS queries will route to the address closest to their origin. Only + valid when a rule's action is set to 'resolve'. """ egress: Optional[Egress] = None @@ -204,11 +217,20 @@ class RuleSetting(BaseModel): quarantine: Optional[Quarantine] = None """Settings that apply to quarantine rules""" + resolve_dns_internally: Optional[ResolveDNSInternally] = None + """ + Configure to forward the query to the internal DNS service, passing the + specified 'view_id' as input. Cannot be set when 'dns_resolvers' are specified + or 'resolve_dns_through_cloudflare' is set. Only valid when a rule's action is + set to 'resolve'. + """ + resolve_dns_through_cloudflare: Optional[bool] = None """ Enable to send queries that match the policy to Cloudflare's default 1.1.1.1 DNS - resolver. Cannot be set when dns_resolvers are specified. Only valid when a - rule's action is set to 'resolve'. + resolver. Cannot be set when 'dns_resolvers' are specified or + 'resolve_dns_internally' is set. Only valid when a rule's action is set to + 'resolve'. """ untrusted_cert: Optional[UntrustedCERT] = None diff --git a/src/cloudflare/types/zero_trust/gateway/rule_setting_param.py b/src/cloudflare/types/zero_trust/gateway/rule_setting_param.py index 11da19fb61f..6f3884920e2 100644 --- a/src/cloudflare/types/zero_trust/gateway/rule_setting_param.py +++ b/src/cloudflare/types/zero_trust/gateway/rule_setting_param.py @@ -19,6 +19,7 @@ "NotificationSettings", "PayloadLog", "Quarantine", + "ResolveDNSInternally", "UntrustedCERT", ] @@ -108,6 +109,18 @@ class Quarantine(TypedDict, total=False): """Types of files to sandbox.""" +class ResolveDNSInternally(TypedDict, total=False): + fallback: Literal["none", "public_dns"] + """ + The fallback behavior to apply when the internal DNS response code is different + from 'NOERROR' or when the response data only contains CNAME records for 'A' or + 'AAAA' queries. + """ + + view_id: str + """The internal DNS view identifier that's passed to the internal DNS service.""" + + class UntrustedCERT(TypedDict, total=False): action: Literal["pass_through", "block", "error"] """The action performed when an untrusted certificate is seen. @@ -150,9 +163,9 @@ class RuleSettingParam(TypedDict, total=False): dns_resolvers: DNSResolvers """Add your own custom resolvers to route queries that match the resolver policy. - Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will - route to the address closest to their origin. Only valid when a rule's action is - set to 'resolve'. + Cannot be used when 'resolve_dns_through_cloudflare' or 'resolve_dns_internally' + are set. DNS queries will route to the address closest to their origin. Only + valid when a rule's action is set to 'resolve'. """ egress: Egress @@ -205,11 +218,20 @@ class RuleSettingParam(TypedDict, total=False): quarantine: Quarantine """Settings that apply to quarantine rules""" + resolve_dns_internally: ResolveDNSInternally + """ + Configure to forward the query to the internal DNS service, passing the + specified 'view_id' as input. Cannot be set when 'dns_resolvers' are specified + or 'resolve_dns_through_cloudflare' is set. Only valid when a rule's action is + set to 'resolve'. + """ + resolve_dns_through_cloudflare: bool """ Enable to send queries that match the policy to Cloudflare's default 1.1.1.1 DNS - resolver. Cannot be set when dns_resolvers are specified. Only valid when a - rule's action is set to 'resolve'. + resolver. Cannot be set when 'dns_resolvers' are specified or + 'resolve_dns_internally' is set. Only valid when a rule's action is set to + 'resolve'. """ untrusted_cert: UntrustedCERT diff --git a/src/cloudflare/types/zero_trust/identity_provider_scim_config.py b/src/cloudflare/types/zero_trust/identity_provider_scim_config.py index 3f664fe6216..aa4b9fecffe 100644 --- a/src/cloudflare/types/zero_trust/identity_provider_scim_config.py +++ b/src/cloudflare/types/zero_trust/identity_provider_scim_config.py @@ -23,6 +23,9 @@ class IdentityProviderSCIMConfig(BaseModel): updates in any way and users will not be prompted to reauthenticate. """ + scim_base_url: Optional[str] = None + """The base URL of Cloudflare's SCIM V2.0 API endpoint.""" + seat_deprovision: Optional[bool] = None """ A flag to remove a user's seat in Zero Trust when they have been deprovisioned @@ -34,7 +37,7 @@ class IdentityProviderSCIMConfig(BaseModel): """ A read-only token generated when the SCIM integration is enabled for the first time. It is redacted on subsequent requests. If you lose this you will need to - refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + refresh it at /access/identity_providers/:idpID/refresh_scim_secret. """ user_deprovision: Optional[bool] = None diff --git a/src/cloudflare/types/zero_trust/organizations/doh_get_response.py b/src/cloudflare/types/zero_trust/organizations/doh_get_response.py index 45cb3c7a793..adb3be9867c 100644 --- a/src/cloudflare/types/zero_trust/organizations/doh_get_response.py +++ b/src/cloudflare/types/zero_trust/organizations/doh_get_response.py @@ -20,6 +20,14 @@ class DOHGetResponse(BaseModel): created_at: Optional[datetime] = None + doh_jwt_duration: Optional[str] = None + """The duration the DoH JWT is valid for. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. Note that the maximum duration for this setting is the same as the + key rotation period on the account. + """ + duration: Optional[str] = None """The duration for how long the service token will be valid. @@ -29,14 +37,6 @@ class DOHGetResponse(BaseModel): expires_at: Optional[datetime] = None - jwt_duration: Optional[str] = None - """The duration the DoH JWT is valid for. - - Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), - ms, s, m, h. Note that the maximum duration for this setting is the same as the - key rotation period on the account. - """ - name: Optional[str] = None """The name of the service token.""" diff --git a/src/cloudflare/types/zero_trust/organizations/doh_update_params.py b/src/cloudflare/types/zero_trust/organizations/doh_update_params.py index 46ff3ae5df6..2392abf7fe0 100644 --- a/src/cloudflare/types/zero_trust/organizations/doh_update_params.py +++ b/src/cloudflare/types/zero_trust/organizations/doh_update_params.py @@ -11,7 +11,7 @@ class DOHUpdateParams(TypedDict, total=False): account_id: Required[str] """Identifier""" - jwt_duration: str + doh_jwt_duration: str """The duration the DoH JWT is valid for. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), diff --git a/src/cloudflare/types/zero_trust/organizations/doh_update_response.py b/src/cloudflare/types/zero_trust/organizations/doh_update_response.py index 4a9196368f9..128469eebb3 100644 --- a/src/cloudflare/types/zero_trust/organizations/doh_update_response.py +++ b/src/cloudflare/types/zero_trust/organizations/doh_update_response.py @@ -20,6 +20,14 @@ class DOHUpdateResponse(BaseModel): created_at: Optional[datetime] = None + doh_jwt_duration: Optional[str] = None + """The duration the DoH JWT is valid for. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. Note that the maximum duration for this setting is the same as the + key rotation period on the account. Default expiration is 24h + """ + duration: Optional[str] = None """The duration for how long the service token will be valid. @@ -29,14 +37,6 @@ class DOHUpdateResponse(BaseModel): expires_at: Optional[datetime] = None - jwt_duration: Optional[str] = None - """The duration the DoH JWT is valid for. - - Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), - ms, s, m, h. Note that the maximum duration for this setting is the same as the - key rotation period on the account. Default expiration is 24h - """ - name: Optional[str] = None """The name of the service token.""" diff --git a/src/cloudflare/types/zones/__init__.py b/src/cloudflare/types/zones/__init__.py index f82d8f8e328..5b7501b8935 100644 --- a/src/cloudflare/types/zones/__init__.py +++ b/src/cloudflare/types/zones/__init__.py @@ -49,6 +49,7 @@ from .websocket_param import WebsocketParam as WebsocketParam from .always_use_https import AlwaysUseHTTPS as AlwaysUseHTTPS from .development_mode import DevelopmentMode as DevelopmentMode +from .hold_edit_params import HoldEditParams as HoldEditParams from .orange_to_orange import OrangeToOrange as OrangeToOrange from .prefetch_preload import PrefetchPreload as PrefetchPreload from .security_headers import SecurityHeaders as SecurityHeaders @@ -94,7 +95,6 @@ from .browser_cache_ttl_param import BrowserCacheTTLParam as BrowserCacheTTLParam from .email_obfuscation_param import EmailObfuscationParam as EmailObfuscationParam from .h2_prioritization_param import H2PrioritizationParam as H2PrioritizationParam -from .origin_max_http_version import OriginMaxHTTPVersion as OriginMaxHTTPVersion from .automatic_https_rewrites import AutomaticHTTPSRewrites as AutomaticHTTPSRewrites from .hotlink_protection_param import HotlinkProtectionParam as HotlinkProtectionParam from .opportunistic_encryption import OpportunisticEncryption as OpportunisticEncryption diff --git a/src/cloudflare/types/zones/hold_edit_params.py b/src/cloudflare/types/zones/hold_edit_params.py new file mode 100644 index 00000000000..fc5e878576f --- /dev/null +++ b/src/cloudflare/types/zones/hold_edit_params.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["HoldEditParams"] + + +class HoldEditParams(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + hold_after: str + """ + If `hold_after` is provided and future-dated, the hold will be temporarily + disabled, then automatically re-enabled by the system at the time specified in + this RFC3339-formatted timestamp. A past-dated `hold_after` value will have no + effect on an existing, enabled hold. Providing an empty string will set its + value to the current time. + """ + + include_subdomains: bool + """ + If `true`, the zone hold will extend to block any subdomain of the given zone, + as well as SSL4SaaS Custom Hostnames. For example, a zone hold on a zone with + the hostname 'example.com' and include_subdomains=true will block 'example.com', + 'staging.example.com', 'api.staging.example.com', etc. + """ diff --git a/src/cloudflare/types/zones/origin_max_http_version.py b/src/cloudflare/types/zones/origin_max_http_version.py deleted file mode 100644 index 4572b289282..00000000000 --- a/src/cloudflare/types/zones/origin_max_http_version.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["OriginMaxHTTPVersion"] - -OriginMaxHTTPVersion: TypeAlias = Literal["origin_max_http_version"] diff --git a/tests/api_resources/addressing/loa_documents/__init__.py b/tests/api_resources/accounts/logs/__init__.py similarity index 100% rename from tests/api_resources/addressing/loa_documents/__init__.py rename to tests/api_resources/accounts/logs/__init__.py diff --git a/tests/api_resources/accounts/logs/test_audit.py b/tests/api_resources/accounts/logs/test_audit.py new file mode 100644 index 00000000000..0c9faafda0e --- /dev/null +++ b/tests/api_resources/accounts/logs/test_audit.py @@ -0,0 +1,192 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare._utils import parse_date +from cloudflare.pagination import SyncCursorLimitPagination, AsyncCursorLimitPagination +from cloudflare.types.accounts.logs import AuditListResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestAudit: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="TODO:investigate broken test") + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + audit = client.accounts.logs.audit.list( + account_id="a67e14daa5f8dceeb91fe5449ba496ef", + before=parse_date("2024-10-31"), + since=parse_date("2024-10-30"), + ) + assert_matches_type(SyncCursorLimitPagination[AuditListResponse], audit, path=["response"]) + + @pytest.mark.skip(reason="TODO:investigate broken test") + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + audit = client.accounts.logs.audit.list( + account_id="a67e14daa5f8dceeb91fe5449ba496ef", + before=parse_date("2024-10-31"), + since=parse_date("2024-10-30"), + account_name="account_name", + action_result="success", + action_type="create", + actor_context="api_key", + actor_email="alice@example.com", + actor_id="1d20c3afe174f18b642710cec6298a9d", + actor_ip_address="17.168.228.63", + actor_token_id="144cdb2e39c55e203cf225d8d8208647", + actor_token_name="Test Token", + actor_type="cloudflare_admin", + audit_log_id="f174be97-19b1-40d6-954d-70cd5fbd52db", + cursor="Q1buH-__DQqqig7SVYXT-SsMOTGY2Z3Y80W-fGgva7yaDdmPKveucH5ddOcHsJRhNb-xUK8agZQqkJSMAENGO8NU6g==", + direction="desc", + limit=25, + raw_cf_rayid="8e8dd2156ef28414", + raw_method="GET", + raw_status_code=200, + raw_uri="raw_uri", + resource_id="resource_id", + resource_product="Stream", + resource_scope="accounts", + resource_type="Video", + zone_id="zone_id", + zone_name="example.com", + ) + assert_matches_type(SyncCursorLimitPagination[AuditListResponse], audit, path=["response"]) + + @pytest.mark.skip(reason="TODO:investigate broken test") + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.accounts.logs.audit.with_raw_response.list( + account_id="a67e14daa5f8dceeb91fe5449ba496ef", + before=parse_date("2024-10-31"), + since=parse_date("2024-10-30"), + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + audit = response.parse() + assert_matches_type(SyncCursorLimitPagination[AuditListResponse], audit, path=["response"]) + + @pytest.mark.skip(reason="TODO:investigate broken test") + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.accounts.logs.audit.with_streaming_response.list( + account_id="a67e14daa5f8dceeb91fe5449ba496ef", + before=parse_date("2024-10-31"), + since=parse_date("2024-10-30"), + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + audit = response.parse() + assert_matches_type(SyncCursorLimitPagination[AuditListResponse], audit, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO:investigate broken test") + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.accounts.logs.audit.with_raw_response.list( + account_id="", + before=parse_date("2024-10-31"), + since=parse_date("2024-10-30"), + ) + + +class TestAsyncAudit: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="TODO:investigate broken test") + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + audit = await async_client.accounts.logs.audit.list( + account_id="a67e14daa5f8dceeb91fe5449ba496ef", + before=parse_date("2024-10-31"), + since=parse_date("2024-10-30"), + ) + assert_matches_type(AsyncCursorLimitPagination[AuditListResponse], audit, path=["response"]) + + @pytest.mark.skip(reason="TODO:investigate broken test") + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + audit = await async_client.accounts.logs.audit.list( + account_id="a67e14daa5f8dceeb91fe5449ba496ef", + before=parse_date("2024-10-31"), + since=parse_date("2024-10-30"), + account_name="account_name", + action_result="success", + action_type="create", + actor_context="api_key", + actor_email="alice@example.com", + actor_id="1d20c3afe174f18b642710cec6298a9d", + actor_ip_address="17.168.228.63", + actor_token_id="144cdb2e39c55e203cf225d8d8208647", + actor_token_name="Test Token", + actor_type="cloudflare_admin", + audit_log_id="f174be97-19b1-40d6-954d-70cd5fbd52db", + cursor="Q1buH-__DQqqig7SVYXT-SsMOTGY2Z3Y80W-fGgva7yaDdmPKveucH5ddOcHsJRhNb-xUK8agZQqkJSMAENGO8NU6g==", + direction="desc", + limit=25, + raw_cf_rayid="8e8dd2156ef28414", + raw_method="GET", + raw_status_code=200, + raw_uri="raw_uri", + resource_id="resource_id", + resource_product="Stream", + resource_scope="accounts", + resource_type="Video", + zone_id="zone_id", + zone_name="example.com", + ) + assert_matches_type(AsyncCursorLimitPagination[AuditListResponse], audit, path=["response"]) + + @pytest.mark.skip(reason="TODO:investigate broken test") + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.accounts.logs.audit.with_raw_response.list( + account_id="a67e14daa5f8dceeb91fe5449ba496ef", + before=parse_date("2024-10-31"), + since=parse_date("2024-10-30"), + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + audit = await response.parse() + assert_matches_type(AsyncCursorLimitPagination[AuditListResponse], audit, path=["response"]) + + @pytest.mark.skip(reason="TODO:investigate broken test") + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.accounts.logs.audit.with_streaming_response.list( + account_id="a67e14daa5f8dceeb91fe5449ba496ef", + before=parse_date("2024-10-31"), + since=parse_date("2024-10-30"), + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + audit = await response.parse() + assert_matches_type(AsyncCursorLimitPagination[AuditListResponse], audit, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO:investigate broken test") + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.accounts.logs.audit.with_raw_response.list( + account_id="", + before=parse_date("2024-10-31"), + since=parse_date("2024-10-30"), + ) diff --git a/tests/api_resources/accounts/test_tokens.py b/tests/api_resources/accounts/test_tokens.py index e0b183d7188..dc10d79e1de 100644 --- a/tests/api_resources/accounts/test_tokens.py +++ b/tests/api_resources/accounts/test_tokens.py @@ -34,7 +34,10 @@ def test_method_create(self, client: Cloudflare) -> None: { "effect": "allow", "permission_groups": [{}, {}], - "resources": {}, + "resources": { + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }, } ], ) @@ -64,8 +67,8 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: }, ], "resources": { - "resource": "resource", - "scope": "scope", + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", }, } ], @@ -90,7 +93,10 @@ def test_raw_response_create(self, client: Cloudflare) -> None: { "effect": "allow", "permission_groups": [{}, {}], - "resources": {}, + "resources": { + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }, } ], ) @@ -110,7 +116,10 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: { "effect": "allow", "permission_groups": [{}, {}], - "resources": {}, + "resources": { + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }, } ], ) as response: @@ -133,7 +142,10 @@ def test_path_params_create(self, client: Cloudflare) -> None: { "effect": "allow", "permission_groups": [{}, {}], - "resources": {}, + "resources": { + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }, } ], ) @@ -180,8 +192,8 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: }, ], "resources": { - "resource": "resource", - "scope": "scope", + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", }, } ], @@ -445,7 +457,10 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: { "effect": "allow", "permission_groups": [{}, {}], - "resources": {}, + "resources": { + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }, } ], ) @@ -475,8 +490,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare }, ], "resources": { - "resource": "resource", - "scope": "scope", + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", }, } ], @@ -501,7 +516,10 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: { "effect": "allow", "permission_groups": [{}, {}], - "resources": {}, + "resources": { + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }, } ], ) @@ -521,7 +539,10 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> { "effect": "allow", "permission_groups": [{}, {}], - "resources": {}, + "resources": { + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }, } ], ) as response: @@ -544,7 +565,10 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: { "effect": "allow", "permission_groups": [{}, {}], - "resources": {}, + "resources": { + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }, } ], ) @@ -591,8 +615,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare }, ], "resources": { - "resource": "resource", - "scope": "scope", + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", }, } ], diff --git a/tests/api_resources/addressing/address_maps/test_accounts.py b/tests/api_resources/addressing/address_maps/test_accounts.py index b84e7ea91ed..3bb5dc17626 100644 --- a/tests/api_resources/addressing/address_maps/test_accounts.py +++ b/tests/api_resources/addressing/address_maps/test_accounts.py @@ -20,8 +20,8 @@ class TestAccounts: @parametrize def test_method_update(self, client: Cloudflare) -> None: account = client.addressing.address_maps.accounts.update( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="258def64c72dae45f3e4c8516e2111f2", body={}, ) assert_matches_type(AccountUpdateResponse, account, path=["response"]) @@ -29,8 +29,8 @@ def test_method_update(self, client: Cloudflare) -> None: @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: response = client.addressing.address_maps.accounts.with_raw_response.update( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="258def64c72dae45f3e4c8516e2111f2", body={}, ) @@ -42,8 +42,8 @@ def test_raw_response_update(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: with client.addressing.address_maps.accounts.with_streaming_response.update( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="258def64c72dae45f3e4c8516e2111f2", body={}, ) as response: assert not response.is_closed @@ -58,7 +58,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.addressing.address_maps.accounts.with_raw_response.update( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", account_id="", body={}, ) @@ -66,23 +66,23 @@ def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): client.addressing.address_maps.accounts.with_raw_response.update( address_map_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", body={}, ) @parametrize def test_method_delete(self, client: Cloudflare) -> None: account = client.addressing.address_maps.accounts.delete( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert_matches_type(AccountDeleteResponse, account, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: response = client.addressing.address_maps.accounts.with_raw_response.delete( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert response.is_closed is True @@ -93,8 +93,8 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: with client.addressing.address_maps.accounts.with_streaming_response.delete( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="258def64c72dae45f3e4c8516e2111f2", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -108,14 +108,14 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: def test_path_params_delete(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.addressing.address_maps.accounts.with_raw_response.delete( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): client.addressing.address_maps.accounts.with_raw_response.delete( address_map_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) @@ -125,8 +125,8 @@ class TestAsyncAccounts: @parametrize async def test_method_update(self, async_client: AsyncCloudflare) -> None: account = await async_client.addressing.address_maps.accounts.update( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="258def64c72dae45f3e4c8516e2111f2", body={}, ) assert_matches_type(AccountUpdateResponse, account, path=["response"]) @@ -134,8 +134,8 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.address_maps.accounts.with_raw_response.update( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="258def64c72dae45f3e4c8516e2111f2", body={}, ) @@ -147,8 +147,8 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.address_maps.accounts.with_streaming_response.update( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="258def64c72dae45f3e4c8516e2111f2", body={}, ) as response: assert not response.is_closed @@ -163,7 +163,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.addressing.address_maps.accounts.with_raw_response.update( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", account_id="", body={}, ) @@ -171,23 +171,23 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): await async_client.addressing.address_maps.accounts.with_raw_response.update( address_map_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", body={}, ) @parametrize async def test_method_delete(self, async_client: AsyncCloudflare) -> None: account = await async_client.addressing.address_maps.accounts.delete( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert_matches_type(AccountDeleteResponse, account, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.address_maps.accounts.with_raw_response.delete( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert response.is_closed is True @@ -198,8 +198,8 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.address_maps.accounts.with_streaming_response.delete( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="258def64c72dae45f3e4c8516e2111f2", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -213,12 +213,12 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.addressing.address_maps.accounts.with_raw_response.delete( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): await async_client.addressing.address_maps.accounts.with_raw_response.delete( address_map_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) diff --git a/tests/api_resources/addressing/address_maps/test_ips.py b/tests/api_resources/addressing/address_maps/test_ips.py index 8525eee077b..63221153f3a 100644 --- a/tests/api_resources/addressing/address_maps/test_ips.py +++ b/tests/api_resources/addressing/address_maps/test_ips.py @@ -21,8 +21,8 @@ class TestIPs: def test_method_update(self, client: Cloudflare) -> None: ip = client.addressing.address_maps.ips.update( ip_address="192.0.2.1", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="055817b111884e0227e1be16a0be6ee0", body={}, ) assert_matches_type(IPUpdateResponse, ip, path=["response"]) @@ -31,8 +31,8 @@ def test_method_update(self, client: Cloudflare) -> None: def test_raw_response_update(self, client: Cloudflare) -> None: response = client.addressing.address_maps.ips.with_raw_response.update( ip_address="192.0.2.1", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="055817b111884e0227e1be16a0be6ee0", body={}, ) @@ -45,8 +45,8 @@ def test_raw_response_update(self, client: Cloudflare) -> None: def test_streaming_response_update(self, client: Cloudflare) -> None: with client.addressing.address_maps.ips.with_streaming_response.update( ip_address="192.0.2.1", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="055817b111884e0227e1be16a0be6ee0", body={}, ) as response: assert not response.is_closed @@ -63,14 +63,14 @@ def test_path_params_update(self, client: Cloudflare) -> None: client.addressing.address_maps.ips.with_raw_response.update( ip_address="192.0.2.1", account_id="", - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", body={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): client.addressing.address_maps.ips.with_raw_response.update( ip_address="192.0.2.1", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", address_map_id="", body={}, ) @@ -78,8 +78,8 @@ def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `ip_address` but received ''"): client.addressing.address_maps.ips.with_raw_response.update( ip_address="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="055817b111884e0227e1be16a0be6ee0", body={}, ) @@ -87,8 +87,8 @@ def test_path_params_update(self, client: Cloudflare) -> None: def test_method_delete(self, client: Cloudflare) -> None: ip = client.addressing.address_maps.ips.delete( ip_address="192.0.2.1", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="055817b111884e0227e1be16a0be6ee0", ) assert_matches_type(IPDeleteResponse, ip, path=["response"]) @@ -96,8 +96,8 @@ def test_method_delete(self, client: Cloudflare) -> None: def test_raw_response_delete(self, client: Cloudflare) -> None: response = client.addressing.address_maps.ips.with_raw_response.delete( ip_address="192.0.2.1", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="055817b111884e0227e1be16a0be6ee0", ) assert response.is_closed is True @@ -109,8 +109,8 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: def test_streaming_response_delete(self, client: Cloudflare) -> None: with client.addressing.address_maps.ips.with_streaming_response.delete( ip_address="192.0.2.1", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="055817b111884e0227e1be16a0be6ee0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -126,21 +126,21 @@ def test_path_params_delete(self, client: Cloudflare) -> None: client.addressing.address_maps.ips.with_raw_response.delete( ip_address="192.0.2.1", account_id="", - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): client.addressing.address_maps.ips.with_raw_response.delete( ip_address="192.0.2.1", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", address_map_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `ip_address` but received ''"): client.addressing.address_maps.ips.with_raw_response.delete( ip_address="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="055817b111884e0227e1be16a0be6ee0", ) @@ -151,8 +151,8 @@ class TestAsyncIPs: async def test_method_update(self, async_client: AsyncCloudflare) -> None: ip = await async_client.addressing.address_maps.ips.update( ip_address="192.0.2.1", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="055817b111884e0227e1be16a0be6ee0", body={}, ) assert_matches_type(IPUpdateResponse, ip, path=["response"]) @@ -161,8 +161,8 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.address_maps.ips.with_raw_response.update( ip_address="192.0.2.1", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="055817b111884e0227e1be16a0be6ee0", body={}, ) @@ -175,8 +175,8 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.address_maps.ips.with_streaming_response.update( ip_address="192.0.2.1", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="055817b111884e0227e1be16a0be6ee0", body={}, ) as response: assert not response.is_closed @@ -193,14 +193,14 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: await async_client.addressing.address_maps.ips.with_raw_response.update( ip_address="192.0.2.1", account_id="", - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", body={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): await async_client.addressing.address_maps.ips.with_raw_response.update( ip_address="192.0.2.1", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", address_map_id="", body={}, ) @@ -208,8 +208,8 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `ip_address` but received ''"): await async_client.addressing.address_maps.ips.with_raw_response.update( ip_address="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="055817b111884e0227e1be16a0be6ee0", body={}, ) @@ -217,8 +217,8 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: async def test_method_delete(self, async_client: AsyncCloudflare) -> None: ip = await async_client.addressing.address_maps.ips.delete( ip_address="192.0.2.1", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="055817b111884e0227e1be16a0be6ee0", ) assert_matches_type(IPDeleteResponse, ip, path=["response"]) @@ -226,8 +226,8 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.address_maps.ips.with_raw_response.delete( ip_address="192.0.2.1", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="055817b111884e0227e1be16a0be6ee0", ) assert response.is_closed is True @@ -239,8 +239,8 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.address_maps.ips.with_streaming_response.delete( ip_address="192.0.2.1", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="055817b111884e0227e1be16a0be6ee0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -256,19 +256,19 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: await async_client.addressing.address_maps.ips.with_raw_response.delete( ip_address="192.0.2.1", account_id="", - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): await async_client.addressing.address_maps.ips.with_raw_response.delete( ip_address="192.0.2.1", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", address_map_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `ip_address` but received ''"): await async_client.addressing.address_maps.ips.with_raw_response.delete( ip_address="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", + address_map_id="055817b111884e0227e1be16a0be6ee0", ) diff --git a/tests/api_resources/addressing/address_maps/test_zones.py b/tests/api_resources/addressing/address_maps/test_zones.py index 12786fdfd14..f0fe5d2d2bb 100644 --- a/tests/api_resources/addressing/address_maps/test_zones.py +++ b/tests/api_resources/addressing/address_maps/test_zones.py @@ -20,9 +20,9 @@ class TestZones: @parametrize def test_method_update(self, client: Cloudflare) -> None: zone = client.addressing.address_maps.zones.update( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + zone_id="8ac8489932db6327334c9b6d58544cfe", + account_id="258def64c72dae45f3e4c8516e2111f2", body={}, ) assert_matches_type(ZoneUpdateResponse, zone, path=["response"]) @@ -30,9 +30,9 @@ def test_method_update(self, client: Cloudflare) -> None: @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: response = client.addressing.address_maps.zones.with_raw_response.update( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + zone_id="8ac8489932db6327334c9b6d58544cfe", + account_id="258def64c72dae45f3e4c8516e2111f2", body={}, ) @@ -44,9 +44,9 @@ def test_raw_response_update(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: with client.addressing.address_maps.zones.with_streaming_response.update( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + zone_id="8ac8489932db6327334c9b6d58544cfe", + account_id="258def64c72dae45f3e4c8516e2111f2", body={}, ) as response: assert not response.is_closed @@ -61,16 +61,16 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.addressing.address_maps.zones.with_raw_response.update( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", zone_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", body={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.addressing.address_maps.zones.with_raw_response.update( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + zone_id="8ac8489932db6327334c9b6d58544cfe", account_id="", body={}, ) @@ -78,26 +78,26 @@ def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): client.addressing.address_maps.zones.with_raw_response.update( address_map_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="8ac8489932db6327334c9b6d58544cfe", + account_id="258def64c72dae45f3e4c8516e2111f2", body={}, ) @parametrize def test_method_delete(self, client: Cloudflare) -> None: zone = client.addressing.address_maps.zones.delete( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + zone_id="8ac8489932db6327334c9b6d58544cfe", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert_matches_type(ZoneDeleteResponse, zone, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: response = client.addressing.address_maps.zones.with_raw_response.delete( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + zone_id="8ac8489932db6327334c9b6d58544cfe", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert response.is_closed is True @@ -108,9 +108,9 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: with client.addressing.address_maps.zones.with_streaming_response.delete( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + zone_id="8ac8489932db6327334c9b6d58544cfe", + account_id="258def64c72dae45f3e4c8516e2111f2", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -124,23 +124,23 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: def test_path_params_delete(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.addressing.address_maps.zones.with_raw_response.delete( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", zone_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.addressing.address_maps.zones.with_raw_response.delete( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + zone_id="8ac8489932db6327334c9b6d58544cfe", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): client.addressing.address_maps.zones.with_raw_response.delete( address_map_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="8ac8489932db6327334c9b6d58544cfe", + account_id="258def64c72dae45f3e4c8516e2111f2", ) @@ -150,9 +150,9 @@ class TestAsyncZones: @parametrize async def test_method_update(self, async_client: AsyncCloudflare) -> None: zone = await async_client.addressing.address_maps.zones.update( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + zone_id="8ac8489932db6327334c9b6d58544cfe", + account_id="258def64c72dae45f3e4c8516e2111f2", body={}, ) assert_matches_type(ZoneUpdateResponse, zone, path=["response"]) @@ -160,9 +160,9 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.address_maps.zones.with_raw_response.update( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + zone_id="8ac8489932db6327334c9b6d58544cfe", + account_id="258def64c72dae45f3e4c8516e2111f2", body={}, ) @@ -174,9 +174,9 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.address_maps.zones.with_streaming_response.update( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + zone_id="8ac8489932db6327334c9b6d58544cfe", + account_id="258def64c72dae45f3e4c8516e2111f2", body={}, ) as response: assert not response.is_closed @@ -191,16 +191,16 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.addressing.address_maps.zones.with_raw_response.update( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", zone_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", body={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.addressing.address_maps.zones.with_raw_response.update( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + zone_id="8ac8489932db6327334c9b6d58544cfe", account_id="", body={}, ) @@ -208,26 +208,26 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): await async_client.addressing.address_maps.zones.with_raw_response.update( address_map_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="8ac8489932db6327334c9b6d58544cfe", + account_id="258def64c72dae45f3e4c8516e2111f2", body={}, ) @parametrize async def test_method_delete(self, async_client: AsyncCloudflare) -> None: zone = await async_client.addressing.address_maps.zones.delete( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + zone_id="8ac8489932db6327334c9b6d58544cfe", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert_matches_type(ZoneDeleteResponse, zone, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.address_maps.zones.with_raw_response.delete( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + zone_id="8ac8489932db6327334c9b6d58544cfe", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert response.is_closed is True @@ -238,9 +238,9 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.address_maps.zones.with_streaming_response.delete( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + zone_id="8ac8489932db6327334c9b6d58544cfe", + account_id="258def64c72dae45f3e4c8516e2111f2", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -254,21 +254,21 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.addressing.address_maps.zones.with_raw_response.delete( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", zone_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.addressing.address_maps.zones.with_raw_response.delete( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + zone_id="8ac8489932db6327334c9b6d58544cfe", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): await async_client.addressing.address_maps.zones.with_raw_response.delete( address_map_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="8ac8489932db6327334c9b6d58544cfe", + account_id="258def64c72dae45f3e4c8516e2111f2", ) diff --git a/tests/api_resources/addressing/loa_documents/test_downloads.py b/tests/api_resources/addressing/loa_documents/test_downloads.py deleted file mode 100644 index b4ff36279c0..00000000000 --- a/tests/api_resources/addressing/loa_documents/test_downloads.py +++ /dev/null @@ -1,184 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import httpx -import pytest -from respx import MockRouter - -from cloudflare import Cloudflare, AsyncCloudflare -from cloudflare._response import ( - BinaryAPIResponse, - AsyncBinaryAPIResponse, - StreamedBinaryAPIResponse, - AsyncStreamedBinaryAPIResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestDownloads: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip( - reason="TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489" - ) - @parametrize - @pytest.mark.respx(base_url=base_url) - def test_method_get(self, client: Cloudflare, respx_mock: MockRouter) -> None: - respx_mock.get( - "/accounts/023e105f4ecef8ad9ca31a8372d0c353/addressing/loa_documents/d933b1530bc56c9953cf8ce166da8004/download" - ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) - download = client.addressing.loa_documents.downloads.get( - loa_document_id="d933b1530bc56c9953cf8ce166da8004", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert download.is_closed - assert download.json() == {"foo": "bar"} - assert cast(Any, download.is_closed) is True - assert isinstance(download, BinaryAPIResponse) - - @pytest.mark.skip( - reason="TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489" - ) - @parametrize - @pytest.mark.respx(base_url=base_url) - def test_raw_response_get(self, client: Cloudflare, respx_mock: MockRouter) -> None: - respx_mock.get( - "/accounts/023e105f4ecef8ad9ca31a8372d0c353/addressing/loa_documents/d933b1530bc56c9953cf8ce166da8004/download" - ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) - - download = client.addressing.loa_documents.downloads.with_raw_response.get( - loa_document_id="d933b1530bc56c9953cf8ce166da8004", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert download.is_closed is True - assert download.http_request.headers.get("X-Stainless-Lang") == "python" - assert download.json() == {"foo": "bar"} - assert isinstance(download, BinaryAPIResponse) - - @pytest.mark.skip( - reason="TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489" - ) - @parametrize - @pytest.mark.respx(base_url=base_url) - def test_streaming_response_get(self, client: Cloudflare, respx_mock: MockRouter) -> None: - respx_mock.get( - "/accounts/023e105f4ecef8ad9ca31a8372d0c353/addressing/loa_documents/d933b1530bc56c9953cf8ce166da8004/download" - ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) - with client.addressing.loa_documents.downloads.with_streaming_response.get( - loa_document_id="d933b1530bc56c9953cf8ce166da8004", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as download: - assert not download.is_closed - assert download.http_request.headers.get("X-Stainless-Lang") == "python" - - assert download.json() == {"foo": "bar"} - assert cast(Any, download.is_closed) is True - assert isinstance(download, StreamedBinaryAPIResponse) - - assert cast(Any, download.is_closed) is True - - @pytest.mark.skip( - reason="TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489" - ) - @parametrize - @pytest.mark.respx(base_url=base_url) - def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.addressing.loa_documents.downloads.with_raw_response.get( - loa_document_id="d933b1530bc56c9953cf8ce166da8004", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `loa_document_id` but received ''"): - client.addressing.loa_documents.downloads.with_raw_response.get( - loa_document_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - -class TestAsyncDownloads: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip( - reason="TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489" - ) - @parametrize - @pytest.mark.respx(base_url=base_url) - async def test_method_get(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None: - respx_mock.get( - "/accounts/023e105f4ecef8ad9ca31a8372d0c353/addressing/loa_documents/d933b1530bc56c9953cf8ce166da8004/download" - ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) - download = await async_client.addressing.loa_documents.downloads.get( - loa_document_id="d933b1530bc56c9953cf8ce166da8004", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert download.is_closed - assert await download.json() == {"foo": "bar"} - assert cast(Any, download.is_closed) is True - assert isinstance(download, AsyncBinaryAPIResponse) - - @pytest.mark.skip( - reason="TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489" - ) - @parametrize - @pytest.mark.respx(base_url=base_url) - async def test_raw_response_get(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None: - respx_mock.get( - "/accounts/023e105f4ecef8ad9ca31a8372d0c353/addressing/loa_documents/d933b1530bc56c9953cf8ce166da8004/download" - ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) - - download = await async_client.addressing.loa_documents.downloads.with_raw_response.get( - loa_document_id="d933b1530bc56c9953cf8ce166da8004", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert download.is_closed is True - assert download.http_request.headers.get("X-Stainless-Lang") == "python" - assert await download.json() == {"foo": "bar"} - assert isinstance(download, AsyncBinaryAPIResponse) - - @pytest.mark.skip( - reason="TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489" - ) - @parametrize - @pytest.mark.respx(base_url=base_url) - async def test_streaming_response_get(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None: - respx_mock.get( - "/accounts/023e105f4ecef8ad9ca31a8372d0c353/addressing/loa_documents/d933b1530bc56c9953cf8ce166da8004/download" - ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) - async with async_client.addressing.loa_documents.downloads.with_streaming_response.get( - loa_document_id="d933b1530bc56c9953cf8ce166da8004", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as download: - assert not download.is_closed - assert download.http_request.headers.get("X-Stainless-Lang") == "python" - - assert await download.json() == {"foo": "bar"} - assert cast(Any, download.is_closed) is True - assert isinstance(download, AsyncStreamedBinaryAPIResponse) - - assert cast(Any, download.is_closed) is True - - @pytest.mark.skip( - reason="TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489" - ) - @parametrize - @pytest.mark.respx(base_url=base_url) - async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.addressing.loa_documents.downloads.with_raw_response.get( - loa_document_id="d933b1530bc56c9953cf8ce166da8004", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `loa_document_id` but received ''"): - await async_client.addressing.loa_documents.downloads.with_raw_response.get( - loa_document_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) diff --git a/tests/api_resources/addressing/prefixes/bgp/test_bindings.py b/tests/api_resources/addressing/prefixes/bgp/test_bindings.py deleted file mode 100644 index 1fca628ca73..00000000000 --- a/tests/api_resources/addressing/prefixes/bgp/test_bindings.py +++ /dev/null @@ -1,475 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, Optional, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.addressing.prefixes.bgp import ServiceBinding, BindingDeleteResponse - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestBindings: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_create(self, client: Cloudflare) -> None: - binding = client.addressing.prefixes.bgp.bindings.create( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[ServiceBinding], binding, path=["response"]) - - @parametrize - def test_method_create_with_all_params(self, client: Cloudflare) -> None: - binding = client.addressing.prefixes.bgp.bindings.create( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - cidr="192.0.2.0/24", - service_id="2db684ee7ca04e159946fd05b99e1bcd", - ) - assert_matches_type(Optional[ServiceBinding], binding, path=["response"]) - - @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.addressing.prefixes.bgp.bindings.with_raw_response.create( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - binding = response.parse() - assert_matches_type(Optional[ServiceBinding], binding, path=["response"]) - - @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.addressing.prefixes.bgp.bindings.with_streaming_response.create( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - binding = response.parse() - assert_matches_type(Optional[ServiceBinding], binding, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.addressing.prefixes.bgp.bindings.with_raw_response.create( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - client.addressing.prefixes.bgp.bindings.with_raw_response.create( - prefix_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - binding = client.addressing.prefixes.bgp.bindings.list( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(SyncSinglePage[ServiceBinding], binding, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.addressing.prefixes.bgp.bindings.with_raw_response.list( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - binding = response.parse() - assert_matches_type(SyncSinglePage[ServiceBinding], binding, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.addressing.prefixes.bgp.bindings.with_streaming_response.list( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - binding = response.parse() - assert_matches_type(SyncSinglePage[ServiceBinding], binding, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.addressing.prefixes.bgp.bindings.with_raw_response.list( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - client.addressing.prefixes.bgp.bindings.with_raw_response.list( - prefix_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - binding = client.addressing.prefixes.bgp.bindings.delete( - binding_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(BindingDeleteResponse, binding, path=["response"]) - - @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.addressing.prefixes.bgp.bindings.with_raw_response.delete( - binding_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - binding = response.parse() - assert_matches_type(BindingDeleteResponse, binding, path=["response"]) - - @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.addressing.prefixes.bgp.bindings.with_streaming_response.delete( - binding_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - binding = response.parse() - assert_matches_type(BindingDeleteResponse, binding, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.addressing.prefixes.bgp.bindings.with_raw_response.delete( - binding_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - client.addressing.prefixes.bgp.bindings.with_raw_response.delete( - binding_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `binding_id` but received ''"): - client.addressing.prefixes.bgp.bindings.with_raw_response.delete( - binding_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @parametrize - def test_method_get(self, client: Cloudflare) -> None: - binding = client.addressing.prefixes.bgp.bindings.get( - binding_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[ServiceBinding], binding, path=["response"]) - - @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.addressing.prefixes.bgp.bindings.with_raw_response.get( - binding_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - binding = response.parse() - assert_matches_type(Optional[ServiceBinding], binding, path=["response"]) - - @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.addressing.prefixes.bgp.bindings.with_streaming_response.get( - binding_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - binding = response.parse() - assert_matches_type(Optional[ServiceBinding], binding, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.addressing.prefixes.bgp.bindings.with_raw_response.get( - binding_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - client.addressing.prefixes.bgp.bindings.with_raw_response.get( - binding_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `binding_id` but received ''"): - client.addressing.prefixes.bgp.bindings.with_raw_response.get( - binding_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - -class TestAsyncBindings: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: - binding = await async_client.addressing.prefixes.bgp.bindings.create( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[ServiceBinding], binding, path=["response"]) - - @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: - binding = await async_client.addressing.prefixes.bgp.bindings.create( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - cidr="192.0.2.0/24", - service_id="2db684ee7ca04e159946fd05b99e1bcd", - ) - assert_matches_type(Optional[ServiceBinding], binding, path=["response"]) - - @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addressing.prefixes.bgp.bindings.with_raw_response.create( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - binding = await response.parse() - assert_matches_type(Optional[ServiceBinding], binding, path=["response"]) - - @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.addressing.prefixes.bgp.bindings.with_streaming_response.create( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - binding = await response.parse() - assert_matches_type(Optional[ServiceBinding], binding, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.addressing.prefixes.bgp.bindings.with_raw_response.create( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - await async_client.addressing.prefixes.bgp.bindings.with_raw_response.create( - prefix_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - binding = await async_client.addressing.prefixes.bgp.bindings.list( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(AsyncSinglePage[ServiceBinding], binding, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addressing.prefixes.bgp.bindings.with_raw_response.list( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - binding = await response.parse() - assert_matches_type(AsyncSinglePage[ServiceBinding], binding, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.addressing.prefixes.bgp.bindings.with_streaming_response.list( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - binding = await response.parse() - assert_matches_type(AsyncSinglePage[ServiceBinding], binding, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.addressing.prefixes.bgp.bindings.with_raw_response.list( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - await async_client.addressing.prefixes.bgp.bindings.with_raw_response.list( - prefix_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @parametrize - async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - binding = await async_client.addressing.prefixes.bgp.bindings.delete( - binding_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(BindingDeleteResponse, binding, path=["response"]) - - @parametrize - async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addressing.prefixes.bgp.bindings.with_raw_response.delete( - binding_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - binding = await response.parse() - assert_matches_type(BindingDeleteResponse, binding, path=["response"]) - - @parametrize - async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.addressing.prefixes.bgp.bindings.with_streaming_response.delete( - binding_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - binding = await response.parse() - assert_matches_type(BindingDeleteResponse, binding, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.addressing.prefixes.bgp.bindings.with_raw_response.delete( - binding_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - await async_client.addressing.prefixes.bgp.bindings.with_raw_response.delete( - binding_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `binding_id` but received ''"): - await async_client.addressing.prefixes.bgp.bindings.with_raw_response.delete( - binding_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - binding = await async_client.addressing.prefixes.bgp.bindings.get( - binding_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[ServiceBinding], binding, path=["response"]) - - @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addressing.prefixes.bgp.bindings.with_raw_response.get( - binding_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - binding = await response.parse() - assert_matches_type(Optional[ServiceBinding], binding, path=["response"]) - - @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.addressing.prefixes.bgp.bindings.with_streaming_response.get( - binding_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - binding = await response.parse() - assert_matches_type(Optional[ServiceBinding], binding, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.addressing.prefixes.bgp.bindings.with_raw_response.get( - binding_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - await async_client.addressing.prefixes.bgp.bindings.with_raw_response.get( - binding_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `binding_id` but received ''"): - await async_client.addressing.prefixes.bgp.bindings.with_raw_response.get( - binding_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) diff --git a/tests/api_resources/addressing/prefixes/bgp/test_prefixes.py b/tests/api_resources/addressing/prefixes/bgp/test_prefixes.py deleted file mode 100644 index c0486fa677a..00000000000 --- a/tests/api_resources/addressing/prefixes/bgp/test_prefixes.py +++ /dev/null @@ -1,379 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, Optional, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.addressing.prefixes.bgp import BGPPrefix - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestPrefixes: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - prefix = client.addressing.prefixes.bgp.prefixes.list( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(SyncSinglePage[BGPPrefix], prefix, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.addressing.prefixes.bgp.prefixes.with_raw_response.list( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - prefix = response.parse() - assert_matches_type(SyncSinglePage[BGPPrefix], prefix, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.addressing.prefixes.bgp.prefixes.with_streaming_response.list( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - prefix = response.parse() - assert_matches_type(SyncSinglePage[BGPPrefix], prefix, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.addressing.prefixes.bgp.prefixes.with_raw_response.list( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - client.addressing.prefixes.bgp.prefixes.with_raw_response.list( - prefix_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @parametrize - def test_method_edit(self, client: Cloudflare) -> None: - prefix = client.addressing.prefixes.bgp.prefixes.edit( - bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[BGPPrefix], prefix, path=["response"]) - - @parametrize - def test_method_edit_with_all_params(self, client: Cloudflare) -> None: - prefix = client.addressing.prefixes.bgp.prefixes.edit( - bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - on_demand={"advertised": True}, - ) - assert_matches_type(Optional[BGPPrefix], prefix, path=["response"]) - - @parametrize - def test_raw_response_edit(self, client: Cloudflare) -> None: - response = client.addressing.prefixes.bgp.prefixes.with_raw_response.edit( - bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - prefix = response.parse() - assert_matches_type(Optional[BGPPrefix], prefix, path=["response"]) - - @parametrize - def test_streaming_response_edit(self, client: Cloudflare) -> None: - with client.addressing.prefixes.bgp.prefixes.with_streaming_response.edit( - bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - prefix = response.parse() - assert_matches_type(Optional[BGPPrefix], prefix, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_edit(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.addressing.prefixes.bgp.prefixes.with_raw_response.edit( - bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - client.addressing.prefixes.bgp.prefixes.with_raw_response.edit( - bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `bgp_prefix_id` but received ''"): - client.addressing.prefixes.bgp.prefixes.with_raw_response.edit( - bgp_prefix_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @parametrize - def test_method_get(self, client: Cloudflare) -> None: - prefix = client.addressing.prefixes.bgp.prefixes.get( - bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[BGPPrefix], prefix, path=["response"]) - - @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.addressing.prefixes.bgp.prefixes.with_raw_response.get( - bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - prefix = response.parse() - assert_matches_type(Optional[BGPPrefix], prefix, path=["response"]) - - @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.addressing.prefixes.bgp.prefixes.with_streaming_response.get( - bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - prefix = response.parse() - assert_matches_type(Optional[BGPPrefix], prefix, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.addressing.prefixes.bgp.prefixes.with_raw_response.get( - bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - client.addressing.prefixes.bgp.prefixes.with_raw_response.get( - bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `bgp_prefix_id` but received ''"): - client.addressing.prefixes.bgp.prefixes.with_raw_response.get( - bgp_prefix_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - -class TestAsyncPrefixes: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - prefix = await async_client.addressing.prefixes.bgp.prefixes.list( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(AsyncSinglePage[BGPPrefix], prefix, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addressing.prefixes.bgp.prefixes.with_raw_response.list( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - prefix = await response.parse() - assert_matches_type(AsyncSinglePage[BGPPrefix], prefix, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.addressing.prefixes.bgp.prefixes.with_streaming_response.list( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - prefix = await response.parse() - assert_matches_type(AsyncSinglePage[BGPPrefix], prefix, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.addressing.prefixes.bgp.prefixes.with_raw_response.list( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - await async_client.addressing.prefixes.bgp.prefixes.with_raw_response.list( - prefix_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @parametrize - async def test_method_edit(self, async_client: AsyncCloudflare) -> None: - prefix = await async_client.addressing.prefixes.bgp.prefixes.edit( - bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[BGPPrefix], prefix, path=["response"]) - - @parametrize - async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: - prefix = await async_client.addressing.prefixes.bgp.prefixes.edit( - bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - on_demand={"advertised": True}, - ) - assert_matches_type(Optional[BGPPrefix], prefix, path=["response"]) - - @parametrize - async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addressing.prefixes.bgp.prefixes.with_raw_response.edit( - bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - prefix = await response.parse() - assert_matches_type(Optional[BGPPrefix], prefix, path=["response"]) - - @parametrize - async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: - async with async_client.addressing.prefixes.bgp.prefixes.with_streaming_response.edit( - bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - prefix = await response.parse() - assert_matches_type(Optional[BGPPrefix], prefix, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.addressing.prefixes.bgp.prefixes.with_raw_response.edit( - bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - await async_client.addressing.prefixes.bgp.prefixes.with_raw_response.edit( - bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `bgp_prefix_id` but received ''"): - await async_client.addressing.prefixes.bgp.prefixes.with_raw_response.edit( - bgp_prefix_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - prefix = await async_client.addressing.prefixes.bgp.prefixes.get( - bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[BGPPrefix], prefix, path=["response"]) - - @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addressing.prefixes.bgp.prefixes.with_raw_response.get( - bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - prefix = await response.parse() - assert_matches_type(Optional[BGPPrefix], prefix, path=["response"]) - - @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.addressing.prefixes.bgp.prefixes.with_streaming_response.get( - bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - prefix = await response.parse() - assert_matches_type(Optional[BGPPrefix], prefix, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.addressing.prefixes.bgp.prefixes.with_raw_response.get( - bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - await async_client.addressing.prefixes.bgp.prefixes.with_raw_response.get( - bgp_prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `bgp_prefix_id` but received ''"): - await async_client.addressing.prefixes.bgp.prefixes.with_raw_response.get( - bgp_prefix_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - ) diff --git a/tests/api_resources/addressing/prefixes/bgp/test_statuses.py b/tests/api_resources/addressing/prefixes/bgp/test_statuses.py deleted file mode 100644 index 3a1bf7f4e57..00000000000 --- a/tests/api_resources/addressing/prefixes/bgp/test_statuses.py +++ /dev/null @@ -1,224 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, Optional, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.types.addressing.prefixes.bgp import StatusGetResponse, StatusEditResponse - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestStatuses: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_edit(self, client: Cloudflare) -> None: - status = client.addressing.prefixes.bgp.statuses.edit( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - advertised=True, - ) - assert_matches_type(Optional[StatusEditResponse], status, path=["response"]) - - @parametrize - def test_raw_response_edit(self, client: Cloudflare) -> None: - response = client.addressing.prefixes.bgp.statuses.with_raw_response.edit( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - advertised=True, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - status = response.parse() - assert_matches_type(Optional[StatusEditResponse], status, path=["response"]) - - @parametrize - def test_streaming_response_edit(self, client: Cloudflare) -> None: - with client.addressing.prefixes.bgp.statuses.with_streaming_response.edit( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - advertised=True, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - status = response.parse() - assert_matches_type(Optional[StatusEditResponse], status, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_edit(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.addressing.prefixes.bgp.statuses.with_raw_response.edit( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - advertised=True, - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - client.addressing.prefixes.bgp.statuses.with_raw_response.edit( - prefix_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - advertised=True, - ) - - @parametrize - def test_method_get(self, client: Cloudflare) -> None: - status = client.addressing.prefixes.bgp.statuses.get( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[StatusGetResponse], status, path=["response"]) - - @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.addressing.prefixes.bgp.statuses.with_raw_response.get( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - status = response.parse() - assert_matches_type(Optional[StatusGetResponse], status, path=["response"]) - - @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.addressing.prefixes.bgp.statuses.with_streaming_response.get( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - status = response.parse() - assert_matches_type(Optional[StatusGetResponse], status, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.addressing.prefixes.bgp.statuses.with_raw_response.get( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - client.addressing.prefixes.bgp.statuses.with_raw_response.get( - prefix_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - -class TestAsyncStatuses: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_edit(self, async_client: AsyncCloudflare) -> None: - status = await async_client.addressing.prefixes.bgp.statuses.edit( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - advertised=True, - ) - assert_matches_type(Optional[StatusEditResponse], status, path=["response"]) - - @parametrize - async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addressing.prefixes.bgp.statuses.with_raw_response.edit( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - advertised=True, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - status = await response.parse() - assert_matches_type(Optional[StatusEditResponse], status, path=["response"]) - - @parametrize - async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: - async with async_client.addressing.prefixes.bgp.statuses.with_streaming_response.edit( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - advertised=True, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - status = await response.parse() - assert_matches_type(Optional[StatusEditResponse], status, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.addressing.prefixes.bgp.statuses.with_raw_response.edit( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - advertised=True, - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - await async_client.addressing.prefixes.bgp.statuses.with_raw_response.edit( - prefix_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - advertised=True, - ) - - @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - status = await async_client.addressing.prefixes.bgp.statuses.get( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[StatusGetResponse], status, path=["response"]) - - @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addressing.prefixes.bgp.statuses.with_raw_response.get( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - status = await response.parse() - assert_matches_type(Optional[StatusGetResponse], status, path=["response"]) - - @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.addressing.prefixes.bgp.statuses.with_streaming_response.get( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - status = await response.parse() - assert_matches_type(Optional[StatusGetResponse], status, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.addressing.prefixes.bgp.statuses.with_raw_response.get( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): - await async_client.addressing.prefixes.bgp.statuses.with_raw_response.get( - prefix_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) diff --git a/tests/api_resources/addressing/prefixes/test_advertisement_status.py b/tests/api_resources/addressing/prefixes/test_advertisement_status.py new file mode 100644 index 00000000000..49a7236d5d7 --- /dev/null +++ b/tests/api_resources/addressing/prefixes/test_advertisement_status.py @@ -0,0 +1,227 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.addressing.prefixes import ( + AdvertisementStatusGetResponse, + AdvertisementStatusEditResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestAdvertisementStatus: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_edit(self, client: Cloudflare) -> None: + advertisement_status = client.addressing.prefixes.advertisement_status.edit( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + advertised=True, + ) + assert_matches_type(Optional[AdvertisementStatusEditResponse], advertisement_status, path=["response"]) + + @parametrize + def test_raw_response_edit(self, client: Cloudflare) -> None: + response = client.addressing.prefixes.advertisement_status.with_raw_response.edit( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + advertised=True, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + advertisement_status = response.parse() + assert_matches_type(Optional[AdvertisementStatusEditResponse], advertisement_status, path=["response"]) + + @parametrize + def test_streaming_response_edit(self, client: Cloudflare) -> None: + with client.addressing.prefixes.advertisement_status.with_streaming_response.edit( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + advertised=True, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + advertisement_status = response.parse() + assert_matches_type(Optional[AdvertisementStatusEditResponse], advertisement_status, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_edit(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.addressing.prefixes.advertisement_status.with_raw_response.edit( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="", + advertised=True, + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + client.addressing.prefixes.advertisement_status.with_raw_response.edit( + prefix_id="", + account_id="258def64c72dae45f3e4c8516e2111f2", + advertised=True, + ) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + advertisement_status = client.addressing.prefixes.advertisement_status.get( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + assert_matches_type(Optional[AdvertisementStatusGetResponse], advertisement_status, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.addressing.prefixes.advertisement_status.with_raw_response.get( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + advertisement_status = response.parse() + assert_matches_type(Optional[AdvertisementStatusGetResponse], advertisement_status, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.addressing.prefixes.advertisement_status.with_streaming_response.get( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + advertisement_status = response.parse() + assert_matches_type(Optional[AdvertisementStatusGetResponse], advertisement_status, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.addressing.prefixes.advertisement_status.with_raw_response.get( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + client.addressing.prefixes.advertisement_status.with_raw_response.get( + prefix_id="", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + + +class TestAsyncAdvertisementStatus: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_edit(self, async_client: AsyncCloudflare) -> None: + advertisement_status = await async_client.addressing.prefixes.advertisement_status.edit( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + advertised=True, + ) + assert_matches_type(Optional[AdvertisementStatusEditResponse], advertisement_status, path=["response"]) + + @parametrize + async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: + response = await async_client.addressing.prefixes.advertisement_status.with_raw_response.edit( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + advertised=True, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + advertisement_status = await response.parse() + assert_matches_type(Optional[AdvertisementStatusEditResponse], advertisement_status, path=["response"]) + + @parametrize + async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: + async with async_client.addressing.prefixes.advertisement_status.with_streaming_response.edit( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + advertised=True, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + advertisement_status = await response.parse() + assert_matches_type(Optional[AdvertisementStatusEditResponse], advertisement_status, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.addressing.prefixes.advertisement_status.with_raw_response.edit( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="", + advertised=True, + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + await async_client.addressing.prefixes.advertisement_status.with_raw_response.edit( + prefix_id="", + account_id="258def64c72dae45f3e4c8516e2111f2", + advertised=True, + ) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + advertisement_status = await async_client.addressing.prefixes.advertisement_status.get( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + assert_matches_type(Optional[AdvertisementStatusGetResponse], advertisement_status, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.addressing.prefixes.advertisement_status.with_raw_response.get( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + advertisement_status = await response.parse() + assert_matches_type(Optional[AdvertisementStatusGetResponse], advertisement_status, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.addressing.prefixes.advertisement_status.with_streaming_response.get( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + advertisement_status = await response.parse() + assert_matches_type(Optional[AdvertisementStatusGetResponse], advertisement_status, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.addressing.prefixes.advertisement_status.with_raw_response.get( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + await async_client.addressing.prefixes.advertisement_status.with_raw_response.get( + prefix_id="", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) diff --git a/tests/api_resources/addressing/prefixes/test_bgp_prefixes.py b/tests/api_resources/addressing/prefixes/test_bgp_prefixes.py new file mode 100644 index 00000000000..06fe971018a --- /dev/null +++ b/tests/api_resources/addressing/prefixes/test_bgp_prefixes.py @@ -0,0 +1,493 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.addressing.prefixes import BGPPrefix + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestBGPPrefixes: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Cloudflare) -> None: + bgp_prefix = client.addressing.prefixes.bgp_prefixes.create( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Cloudflare) -> None: + bgp_prefix = client.addressing.prefixes.bgp_prefixes.create( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + cidr="192.0.2.0/24", + ) + assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Cloudflare) -> None: + response = client.addressing.prefixes.bgp_prefixes.with_raw_response.create( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + bgp_prefix = response.parse() + assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Cloudflare) -> None: + with client.addressing.prefixes.bgp_prefixes.with_streaming_response.create( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + bgp_prefix = response.parse() + assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.addressing.prefixes.bgp_prefixes.with_raw_response.create( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + client.addressing.prefixes.bgp_prefixes.with_raw_response.create( + prefix_id="", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + bgp_prefix = client.addressing.prefixes.bgp_prefixes.list( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + assert_matches_type(SyncSinglePage[BGPPrefix], bgp_prefix, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.addressing.prefixes.bgp_prefixes.with_raw_response.list( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + bgp_prefix = response.parse() + assert_matches_type(SyncSinglePage[BGPPrefix], bgp_prefix, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.addressing.prefixes.bgp_prefixes.with_streaming_response.list( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + bgp_prefix = response.parse() + assert_matches_type(SyncSinglePage[BGPPrefix], bgp_prefix, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.addressing.prefixes.bgp_prefixes.with_raw_response.list( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + client.addressing.prefixes.bgp_prefixes.with_raw_response.list( + prefix_id="", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + + @parametrize + def test_method_edit(self, client: Cloudflare) -> None: + bgp_prefix = client.addressing.prefixes.bgp_prefixes.edit( + bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) + assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) + + @parametrize + def test_method_edit_with_all_params(self, client: Cloudflare) -> None: + bgp_prefix = client.addressing.prefixes.bgp_prefixes.edit( + bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + on_demand={"advertised": True}, + ) + assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) + + @parametrize + def test_raw_response_edit(self, client: Cloudflare) -> None: + response = client.addressing.prefixes.bgp_prefixes.with_raw_response.edit( + bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + bgp_prefix = response.parse() + assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) + + @parametrize + def test_streaming_response_edit(self, client: Cloudflare) -> None: + with client.addressing.prefixes.bgp_prefixes.with_streaming_response.edit( + bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + bgp_prefix = response.parse() + assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_edit(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.addressing.prefixes.bgp_prefixes.with_raw_response.edit( + bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", + account_id="", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + client.addressing.prefixes.bgp_prefixes.with_raw_response.edit( + bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `bgp_prefix_id` but received ''"): + client.addressing.prefixes.bgp_prefixes.with_raw_response.edit( + bgp_prefix_id="", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + bgp_prefix = client.addressing.prefixes.bgp_prefixes.get( + bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) + assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.addressing.prefixes.bgp_prefixes.with_raw_response.get( + bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + bgp_prefix = response.parse() + assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.addressing.prefixes.bgp_prefixes.with_streaming_response.get( + bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + bgp_prefix = response.parse() + assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.addressing.prefixes.bgp_prefixes.with_raw_response.get( + bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", + account_id="", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + client.addressing.prefixes.bgp_prefixes.with_raw_response.get( + bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `bgp_prefix_id` but received ''"): + client.addressing.prefixes.bgp_prefixes.with_raw_response.get( + bgp_prefix_id="", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) + + +class TestAsyncBGPPrefixes: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncCloudflare) -> None: + bgp_prefix = await async_client.addressing.prefixes.bgp_prefixes.create( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: + bgp_prefix = await async_client.addressing.prefixes.bgp_prefixes.create( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + cidr="192.0.2.0/24", + ) + assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: + response = await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.create( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + bgp_prefix = await response.parse() + assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: + async with async_client.addressing.prefixes.bgp_prefixes.with_streaming_response.create( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + bgp_prefix = await response.parse() + assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.create( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.create( + prefix_id="", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + bgp_prefix = await async_client.addressing.prefixes.bgp_prefixes.list( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + assert_matches_type(AsyncSinglePage[BGPPrefix], bgp_prefix, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.list( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + bgp_prefix = await response.parse() + assert_matches_type(AsyncSinglePage[BGPPrefix], bgp_prefix, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.addressing.prefixes.bgp_prefixes.with_streaming_response.list( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + bgp_prefix = await response.parse() + assert_matches_type(AsyncSinglePage[BGPPrefix], bgp_prefix, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.list( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.list( + prefix_id="", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + + @parametrize + async def test_method_edit(self, async_client: AsyncCloudflare) -> None: + bgp_prefix = await async_client.addressing.prefixes.bgp_prefixes.edit( + bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) + assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) + + @parametrize + async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: + bgp_prefix = await async_client.addressing.prefixes.bgp_prefixes.edit( + bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + on_demand={"advertised": True}, + ) + assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) + + @parametrize + async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: + response = await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.edit( + bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + bgp_prefix = await response.parse() + assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) + + @parametrize + async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: + async with async_client.addressing.prefixes.bgp_prefixes.with_streaming_response.edit( + bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + bgp_prefix = await response.parse() + assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.edit( + bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", + account_id="", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.edit( + bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `bgp_prefix_id` but received ''"): + await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.edit( + bgp_prefix_id="", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + bgp_prefix = await async_client.addressing.prefixes.bgp_prefixes.get( + bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) + assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.get( + bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + bgp_prefix = await response.parse() + assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.addressing.prefixes.bgp_prefixes.with_streaming_response.get( + bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + bgp_prefix = await response.parse() + assert_matches_type(Optional[BGPPrefix], bgp_prefix, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.get( + bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", + account_id="", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.get( + bgp_prefix_id="7009ba364c7a5760798ceb430e603b74", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `bgp_prefix_id` but received ''"): + await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.get( + bgp_prefix_id="", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) diff --git a/tests/api_resources/addressing/prefixes/test_delegations.py b/tests/api_resources/addressing/prefixes/test_delegations.py index dd17a7ac44b..83ec07279cc 100644 --- a/tests/api_resources/addressing/prefixes/test_delegations.py +++ b/tests/api_resources/addressing/prefixes/test_delegations.py @@ -21,8 +21,8 @@ class TestDelegations: @parametrize def test_method_create(self, client: Cloudflare) -> None: delegation = client.addressing.prefixes.delegations.create( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", cidr="192.0.2.0/24", delegated_account_id="b1946ac92492d2347c6235b4d2611184", ) @@ -31,8 +31,8 @@ def test_method_create(self, client: Cloudflare) -> None: @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: response = client.addressing.prefixes.delegations.with_raw_response.create( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", cidr="192.0.2.0/24", delegated_account_id="b1946ac92492d2347c6235b4d2611184", ) @@ -45,8 +45,8 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: with client.addressing.prefixes.delegations.with_streaming_response.create( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", cidr="192.0.2.0/24", delegated_account_id="b1946ac92492d2347c6235b4d2611184", ) as response: @@ -62,7 +62,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: def test_path_params_create(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.addressing.prefixes.delegations.with_raw_response.create( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", account_id="", cidr="192.0.2.0/24", delegated_account_id="b1946ac92492d2347c6235b4d2611184", @@ -71,7 +71,7 @@ def test_path_params_create(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): client.addressing.prefixes.delegations.with_raw_response.create( prefix_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", cidr="192.0.2.0/24", delegated_account_id="b1946ac92492d2347c6235b4d2611184", ) @@ -79,16 +79,16 @@ def test_path_params_create(self, client: Cloudflare) -> None: @parametrize def test_method_list(self, client: Cloudflare) -> None: delegation = client.addressing.prefixes.delegations.list( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert_matches_type(SyncSinglePage[Delegations], delegation, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.addressing.prefixes.delegations.with_raw_response.list( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert response.is_closed is True @@ -99,8 +99,8 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.addressing.prefixes.delegations.with_streaming_response.list( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -114,22 +114,22 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: def test_path_params_list(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.addressing.prefixes.delegations.with_raw_response.list( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): client.addressing.prefixes.delegations.with_raw_response.list( prefix_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) @parametrize def test_method_delete(self, client: Cloudflare) -> None: delegation = client.addressing.prefixes.delegations.delete( delegation_id="d933b1530bc56c9953cf8ce166da8004", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", ) assert_matches_type(Optional[DelegationDeleteResponse], delegation, path=["response"]) @@ -137,8 +137,8 @@ def test_method_delete(self, client: Cloudflare) -> None: def test_raw_response_delete(self, client: Cloudflare) -> None: response = client.addressing.prefixes.delegations.with_raw_response.delete( delegation_id="d933b1530bc56c9953cf8ce166da8004", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", ) assert response.is_closed is True @@ -150,8 +150,8 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: def test_streaming_response_delete(self, client: Cloudflare) -> None: with client.addressing.prefixes.delegations.with_streaming_response.delete( delegation_id="d933b1530bc56c9953cf8ce166da8004", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -167,21 +167,21 @@ def test_path_params_delete(self, client: Cloudflare) -> None: client.addressing.prefixes.delegations.with_raw_response.delete( delegation_id="d933b1530bc56c9953cf8ce166da8004", account_id="", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): client.addressing.prefixes.delegations.with_raw_response.delete( delegation_id="d933b1530bc56c9953cf8ce166da8004", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", prefix_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `delegation_id` but received ''"): client.addressing.prefixes.delegations.with_raw_response.delete( delegation_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", ) @@ -191,8 +191,8 @@ class TestAsyncDelegations: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: delegation = await async_client.addressing.prefixes.delegations.create( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", cidr="192.0.2.0/24", delegated_account_id="b1946ac92492d2347c6235b4d2611184", ) @@ -201,8 +201,8 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.prefixes.delegations.with_raw_response.create( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", cidr="192.0.2.0/24", delegated_account_id="b1946ac92492d2347c6235b4d2611184", ) @@ -215,8 +215,8 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.prefixes.delegations.with_streaming_response.create( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", cidr="192.0.2.0/24", delegated_account_id="b1946ac92492d2347c6235b4d2611184", ) as response: @@ -232,7 +232,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.addressing.prefixes.delegations.with_raw_response.create( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", account_id="", cidr="192.0.2.0/24", delegated_account_id="b1946ac92492d2347c6235b4d2611184", @@ -241,7 +241,7 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): await async_client.addressing.prefixes.delegations.with_raw_response.create( prefix_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", cidr="192.0.2.0/24", delegated_account_id="b1946ac92492d2347c6235b4d2611184", ) @@ -249,16 +249,16 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: delegation = await async_client.addressing.prefixes.delegations.list( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert_matches_type(AsyncSinglePage[Delegations], delegation, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.prefixes.delegations.with_raw_response.list( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert response.is_closed is True @@ -269,8 +269,8 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.prefixes.delegations.with_streaming_response.list( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -284,22 +284,22 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.addressing.prefixes.delegations.with_raw_response.list( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): await async_client.addressing.prefixes.delegations.with_raw_response.list( prefix_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) @parametrize async def test_method_delete(self, async_client: AsyncCloudflare) -> None: delegation = await async_client.addressing.prefixes.delegations.delete( delegation_id="d933b1530bc56c9953cf8ce166da8004", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", ) assert_matches_type(Optional[DelegationDeleteResponse], delegation, path=["response"]) @@ -307,8 +307,8 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.prefixes.delegations.with_raw_response.delete( delegation_id="d933b1530bc56c9953cf8ce166da8004", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", ) assert response.is_closed is True @@ -320,8 +320,8 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.prefixes.delegations.with_streaming_response.delete( delegation_id="d933b1530bc56c9953cf8ce166da8004", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -337,19 +337,19 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: await async_client.addressing.prefixes.delegations.with_raw_response.delete( delegation_id="d933b1530bc56c9953cf8ce166da8004", account_id="", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): await async_client.addressing.prefixes.delegations.with_raw_response.delete( delegation_id="d933b1530bc56c9953cf8ce166da8004", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", prefix_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `delegation_id` but received ''"): await async_client.addressing.prefixes.delegations.with_raw_response.delete( delegation_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", ) diff --git a/tests/api_resources/addressing/prefixes/test_service_bindings.py b/tests/api_resources/addressing/prefixes/test_service_bindings.py new file mode 100644 index 00000000000..98156802f9c --- /dev/null +++ b/tests/api_resources/addressing/prefixes/test_service_bindings.py @@ -0,0 +1,478 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.addressing.prefixes import ( + ServiceBinding, + ServiceBindingDeleteResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestServiceBindings: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Cloudflare) -> None: + service_binding = client.addressing.prefixes.service_bindings.create( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + assert_matches_type(Optional[ServiceBinding], service_binding, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Cloudflare) -> None: + service_binding = client.addressing.prefixes.service_bindings.create( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + cidr="192.0.2.0/24", + service_id="2db684ee7ca04e159946fd05b99e1bcd", + ) + assert_matches_type(Optional[ServiceBinding], service_binding, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Cloudflare) -> None: + response = client.addressing.prefixes.service_bindings.with_raw_response.create( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + service_binding = response.parse() + assert_matches_type(Optional[ServiceBinding], service_binding, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Cloudflare) -> None: + with client.addressing.prefixes.service_bindings.with_streaming_response.create( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + service_binding = response.parse() + assert_matches_type(Optional[ServiceBinding], service_binding, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.addressing.prefixes.service_bindings.with_raw_response.create( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + client.addressing.prefixes.service_bindings.with_raw_response.create( + prefix_id="", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + service_binding = client.addressing.prefixes.service_bindings.list( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + assert_matches_type(SyncSinglePage[ServiceBinding], service_binding, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.addressing.prefixes.service_bindings.with_raw_response.list( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + service_binding = response.parse() + assert_matches_type(SyncSinglePage[ServiceBinding], service_binding, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.addressing.prefixes.service_bindings.with_streaming_response.list( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + service_binding = response.parse() + assert_matches_type(SyncSinglePage[ServiceBinding], service_binding, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.addressing.prefixes.service_bindings.with_raw_response.list( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + client.addressing.prefixes.service_bindings.with_raw_response.list( + prefix_id="", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + + @parametrize + def test_method_delete(self, client: Cloudflare) -> None: + service_binding = client.addressing.prefixes.service_bindings.delete( + binding_id="0429b49b6a5155297b78e75a44b09e14", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) + assert_matches_type(ServiceBindingDeleteResponse, service_binding, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.addressing.prefixes.service_bindings.with_raw_response.delete( + binding_id="0429b49b6a5155297b78e75a44b09e14", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + service_binding = response.parse() + assert_matches_type(ServiceBindingDeleteResponse, service_binding, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.addressing.prefixes.service_bindings.with_streaming_response.delete( + binding_id="0429b49b6a5155297b78e75a44b09e14", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + service_binding = response.parse() + assert_matches_type(ServiceBindingDeleteResponse, service_binding, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.addressing.prefixes.service_bindings.with_raw_response.delete( + binding_id="0429b49b6a5155297b78e75a44b09e14", + account_id="", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + client.addressing.prefixes.service_bindings.with_raw_response.delete( + binding_id="0429b49b6a5155297b78e75a44b09e14", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `binding_id` but received ''"): + client.addressing.prefixes.service_bindings.with_raw_response.delete( + binding_id="", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + service_binding = client.addressing.prefixes.service_bindings.get( + binding_id="0429b49b6a5155297b78e75a44b09e14", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) + assert_matches_type(Optional[ServiceBinding], service_binding, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.addressing.prefixes.service_bindings.with_raw_response.get( + binding_id="0429b49b6a5155297b78e75a44b09e14", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + service_binding = response.parse() + assert_matches_type(Optional[ServiceBinding], service_binding, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.addressing.prefixes.service_bindings.with_streaming_response.get( + binding_id="0429b49b6a5155297b78e75a44b09e14", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + service_binding = response.parse() + assert_matches_type(Optional[ServiceBinding], service_binding, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.addressing.prefixes.service_bindings.with_raw_response.get( + binding_id="0429b49b6a5155297b78e75a44b09e14", + account_id="", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + client.addressing.prefixes.service_bindings.with_raw_response.get( + binding_id="0429b49b6a5155297b78e75a44b09e14", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `binding_id` but received ''"): + client.addressing.prefixes.service_bindings.with_raw_response.get( + binding_id="", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) + + +class TestAsyncServiceBindings: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncCloudflare) -> None: + service_binding = await async_client.addressing.prefixes.service_bindings.create( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + assert_matches_type(Optional[ServiceBinding], service_binding, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: + service_binding = await async_client.addressing.prefixes.service_bindings.create( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + cidr="192.0.2.0/24", + service_id="2db684ee7ca04e159946fd05b99e1bcd", + ) + assert_matches_type(Optional[ServiceBinding], service_binding, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: + response = await async_client.addressing.prefixes.service_bindings.with_raw_response.create( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + service_binding = await response.parse() + assert_matches_type(Optional[ServiceBinding], service_binding, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: + async with async_client.addressing.prefixes.service_bindings.with_streaming_response.create( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + service_binding = await response.parse() + assert_matches_type(Optional[ServiceBinding], service_binding, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.addressing.prefixes.service_bindings.with_raw_response.create( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + await async_client.addressing.prefixes.service_bindings.with_raw_response.create( + prefix_id="", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + service_binding = await async_client.addressing.prefixes.service_bindings.list( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + assert_matches_type(AsyncSinglePage[ServiceBinding], service_binding, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.addressing.prefixes.service_bindings.with_raw_response.list( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + service_binding = await response.parse() + assert_matches_type(AsyncSinglePage[ServiceBinding], service_binding, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.addressing.prefixes.service_bindings.with_streaming_response.list( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + service_binding = await response.parse() + assert_matches_type(AsyncSinglePage[ServiceBinding], service_binding, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.addressing.prefixes.service_bindings.with_raw_response.list( + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + await async_client.addressing.prefixes.service_bindings.with_raw_response.list( + prefix_id="", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + + @parametrize + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + service_binding = await async_client.addressing.prefixes.service_bindings.delete( + binding_id="0429b49b6a5155297b78e75a44b09e14", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) + assert_matches_type(ServiceBindingDeleteResponse, service_binding, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.addressing.prefixes.service_bindings.with_raw_response.delete( + binding_id="0429b49b6a5155297b78e75a44b09e14", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + service_binding = await response.parse() + assert_matches_type(ServiceBindingDeleteResponse, service_binding, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.addressing.prefixes.service_bindings.with_streaming_response.delete( + binding_id="0429b49b6a5155297b78e75a44b09e14", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + service_binding = await response.parse() + assert_matches_type(ServiceBindingDeleteResponse, service_binding, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.addressing.prefixes.service_bindings.with_raw_response.delete( + binding_id="0429b49b6a5155297b78e75a44b09e14", + account_id="", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + await async_client.addressing.prefixes.service_bindings.with_raw_response.delete( + binding_id="0429b49b6a5155297b78e75a44b09e14", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `binding_id` but received ''"): + await async_client.addressing.prefixes.service_bindings.with_raw_response.delete( + binding_id="", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + service_binding = await async_client.addressing.prefixes.service_bindings.get( + binding_id="0429b49b6a5155297b78e75a44b09e14", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) + assert_matches_type(Optional[ServiceBinding], service_binding, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.addressing.prefixes.service_bindings.with_raw_response.get( + binding_id="0429b49b6a5155297b78e75a44b09e14", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + service_binding = await response.parse() + assert_matches_type(Optional[ServiceBinding], service_binding, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.addressing.prefixes.service_bindings.with_streaming_response.get( + binding_id="0429b49b6a5155297b78e75a44b09e14", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + service_binding = await response.parse() + assert_matches_type(Optional[ServiceBinding], service_binding, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.addressing.prefixes.service_bindings.with_raw_response.get( + binding_id="0429b49b6a5155297b78e75a44b09e14", + account_id="", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): + await async_client.addressing.prefixes.service_bindings.with_raw_response.get( + binding_id="0429b49b6a5155297b78e75a44b09e14", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `binding_id` but received ''"): + await async_client.addressing.prefixes.service_bindings.with_raw_response.get( + binding_id="", + account_id="258def64c72dae45f3e4c8516e2111f2", + prefix_id="2af39739cc4e3b5910c918468bb89828", + ) diff --git a/tests/api_resources/addressing/test_address_maps.py b/tests/api_resources/addressing/test_address_maps.py index 217bc4bbe15..ed645091db9 100644 --- a/tests/api_resources/addressing/test_address_maps.py +++ b/tests/api_resources/addressing/test_address_maps.py @@ -26,14 +26,14 @@ class TestAddressMaps: @parametrize def test_method_create(self, client: Cloudflare) -> None: address_map = client.addressing.address_maps.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert_matches_type(Optional[AddressMapCreateResponse], address_map, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: address_map = client.addressing.address_maps.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", description="My Ecommerce zones", enabled=True, ips=["192.0.2.1"], @@ -49,7 +49,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: response = client.addressing.address_maps.with_raw_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert response.is_closed is True @@ -60,7 +60,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: with client.addressing.address_maps.with_streaming_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -80,14 +80,14 @@ def test_path_params_create(self, client: Cloudflare) -> None: @parametrize def test_method_list(self, client: Cloudflare) -> None: address_map = client.addressing.address_maps.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert_matches_type(SyncSinglePage[AddressMap], address_map, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.addressing.address_maps.with_raw_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert response.is_closed is True @@ -98,7 +98,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.addressing.address_maps.with_streaming_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -118,16 +118,16 @@ def test_path_params_list(self, client: Cloudflare) -> None: @parametrize def test_method_delete(self, client: Cloudflare) -> None: address_map = client.addressing.address_maps.delete( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert_matches_type(AddressMapDeleteResponse, address_map, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: response = client.addressing.address_maps.with_raw_response.delete( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert response.is_closed is True @@ -138,8 +138,8 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: with client.addressing.address_maps.with_streaming_response.delete( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="258def64c72dae45f3e4c8516e2111f2", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -153,29 +153,29 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: def test_path_params_delete(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.addressing.address_maps.with_raw_response.delete( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): client.addressing.address_maps.with_raw_response.delete( address_map_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) @parametrize def test_method_edit(self, client: Cloudflare) -> None: address_map = client.addressing.address_maps.edit( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert_matches_type(Optional[AddressMap], address_map, path=["response"]) @parametrize def test_method_edit_with_all_params(self, client: Cloudflare) -> None: address_map = client.addressing.address_maps.edit( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="258def64c72dae45f3e4c8516e2111f2", default_sni="*.example.com", description="My Ecommerce zones", enabled=True, @@ -185,8 +185,8 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: response = client.addressing.address_maps.with_raw_response.edit( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert response.is_closed is True @@ -197,8 +197,8 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: with client.addressing.address_maps.with_streaming_response.edit( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="258def64c72dae45f3e4c8516e2111f2", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -212,29 +212,29 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: def test_path_params_edit(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.addressing.address_maps.with_raw_response.edit( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): client.addressing.address_maps.with_raw_response.edit( address_map_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) @parametrize def test_method_get(self, client: Cloudflare) -> None: address_map = client.addressing.address_maps.get( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert_matches_type(Optional[AddressMapGetResponse], address_map, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: response = client.addressing.address_maps.with_raw_response.get( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert response.is_closed is True @@ -245,8 +245,8 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: with client.addressing.address_maps.with_streaming_response.get( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="258def64c72dae45f3e4c8516e2111f2", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -260,14 +260,14 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.addressing.address_maps.with_raw_response.get( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): client.addressing.address_maps.with_raw_response.get( address_map_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) @@ -277,14 +277,14 @@ class TestAsyncAddressMaps: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: address_map = await async_client.addressing.address_maps.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert_matches_type(Optional[AddressMapCreateResponse], address_map, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: address_map = await async_client.addressing.address_maps.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", description="My Ecommerce zones", enabled=True, ips=["192.0.2.1"], @@ -300,7 +300,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.address_maps.with_raw_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert response.is_closed is True @@ -311,7 +311,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.address_maps.with_streaming_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -331,14 +331,14 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: address_map = await async_client.addressing.address_maps.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert_matches_type(AsyncSinglePage[AddressMap], address_map, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.address_maps.with_raw_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert response.is_closed is True @@ -349,7 +349,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.address_maps.with_streaming_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -369,16 +369,16 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_delete(self, async_client: AsyncCloudflare) -> None: address_map = await async_client.addressing.address_maps.delete( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert_matches_type(AddressMapDeleteResponse, address_map, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.address_maps.with_raw_response.delete( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert response.is_closed is True @@ -389,8 +389,8 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.address_maps.with_streaming_response.delete( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="258def64c72dae45f3e4c8516e2111f2", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -404,29 +404,29 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.addressing.address_maps.with_raw_response.delete( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): await async_client.addressing.address_maps.with_raw_response.delete( address_map_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) @parametrize async def test_method_edit(self, async_client: AsyncCloudflare) -> None: address_map = await async_client.addressing.address_maps.edit( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert_matches_type(Optional[AddressMap], address_map, path=["response"]) @parametrize async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: address_map = await async_client.addressing.address_maps.edit( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="258def64c72dae45f3e4c8516e2111f2", default_sni="*.example.com", description="My Ecommerce zones", enabled=True, @@ -436,8 +436,8 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.address_maps.with_raw_response.edit( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert response.is_closed is True @@ -448,8 +448,8 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.address_maps.with_streaming_response.edit( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="258def64c72dae45f3e4c8516e2111f2", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -463,29 +463,29 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.addressing.address_maps.with_raw_response.edit( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): await async_client.addressing.address_maps.with_raw_response.edit( address_map_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: address_map = await async_client.addressing.address_maps.get( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert_matches_type(Optional[AddressMapGetResponse], address_map, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.address_maps.with_raw_response.get( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert response.is_closed is True @@ -496,8 +496,8 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.address_maps.with_streaming_response.get( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", + account_id="258def64c72dae45f3e4c8516e2111f2", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -511,12 +511,12 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.addressing.address_maps.with_raw_response.get( - address_map_id="023e105f4ecef8ad9ca31a8372d0c353", + address_map_id="055817b111884e0227e1be16a0be6ee0", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `address_map_id` but received ''"): await async_client.addressing.address_maps.with_raw_response.get( address_map_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) diff --git a/tests/api_resources/addressing/test_loa_documents.py b/tests/api_resources/addressing/test_loa_documents.py index b3bc8c3e862..6cfbe04f072 100644 --- a/tests/api_resources/addressing/test_loa_documents.py +++ b/tests/api_resources/addressing/test_loa_documents.py @@ -5,10 +5,18 @@ import os from typing import Any, Optional, cast +import httpx import pytest +from respx import MockRouter from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare._response import ( + BinaryAPIResponse, + AsyncBinaryAPIResponse, + StreamedBinaryAPIResponse, + AsyncStreamedBinaryAPIResponse, +) from cloudflare.types.addressing import LOADocumentCreateResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -21,7 +29,7 @@ class TestLOADocuments: @parametrize def test_method_create(self, client: Cloudflare) -> None: loa_document = client.addressing.loa_documents.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", loa_document="@document.pdf", ) assert_matches_type(Optional[LOADocumentCreateResponse], loa_document, path=["response"]) @@ -30,7 +38,7 @@ def test_method_create(self, client: Cloudflare) -> None: @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: response = client.addressing.loa_documents.with_raw_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", loa_document="@document.pdf", ) @@ -43,7 +51,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: with client.addressing.loa_documents.with_streaming_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", loa_document="@document.pdf", ) as response: assert not response.is_closed @@ -63,6 +71,84 @@ def test_path_params_create(self, client: Cloudflare) -> None: loa_document="@document.pdf", ) + @pytest.mark.skip( + reason="TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489" + ) + @parametrize + @pytest.mark.respx(base_url=base_url) + def test_method_get(self, client: Cloudflare, respx_mock: MockRouter) -> None: + respx_mock.get( + "/accounts/258def64c72dae45f3e4c8516e2111f2/addressing/loa_documents/d933b1530bc56c9953cf8ce166da8004/download" + ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) + loa_document = client.addressing.loa_documents.get( + loa_document_id="d933b1530bc56c9953cf8ce166da8004", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + assert loa_document.is_closed + assert loa_document.json() == {"foo": "bar"} + assert cast(Any, loa_document.is_closed) is True + assert isinstance(loa_document, BinaryAPIResponse) + + @pytest.mark.skip( + reason="TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489" + ) + @parametrize + @pytest.mark.respx(base_url=base_url) + def test_raw_response_get(self, client: Cloudflare, respx_mock: MockRouter) -> None: + respx_mock.get( + "/accounts/258def64c72dae45f3e4c8516e2111f2/addressing/loa_documents/d933b1530bc56c9953cf8ce166da8004/download" + ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) + + loa_document = client.addressing.loa_documents.with_raw_response.get( + loa_document_id="d933b1530bc56c9953cf8ce166da8004", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + + assert loa_document.is_closed is True + assert loa_document.http_request.headers.get("X-Stainless-Lang") == "python" + assert loa_document.json() == {"foo": "bar"} + assert isinstance(loa_document, BinaryAPIResponse) + + @pytest.mark.skip( + reason="TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489" + ) + @parametrize + @pytest.mark.respx(base_url=base_url) + def test_streaming_response_get(self, client: Cloudflare, respx_mock: MockRouter) -> None: + respx_mock.get( + "/accounts/258def64c72dae45f3e4c8516e2111f2/addressing/loa_documents/d933b1530bc56c9953cf8ce166da8004/download" + ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) + with client.addressing.loa_documents.with_streaming_response.get( + loa_document_id="d933b1530bc56c9953cf8ce166da8004", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) as loa_document: + assert not loa_document.is_closed + assert loa_document.http_request.headers.get("X-Stainless-Lang") == "python" + + assert loa_document.json() == {"foo": "bar"} + assert cast(Any, loa_document.is_closed) is True + assert isinstance(loa_document, StreamedBinaryAPIResponse) + + assert cast(Any, loa_document.is_closed) is True + + @pytest.mark.skip( + reason="TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489" + ) + @parametrize + @pytest.mark.respx(base_url=base_url) + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.addressing.loa_documents.with_raw_response.get( + loa_document_id="d933b1530bc56c9953cf8ce166da8004", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `loa_document_id` but received ''"): + client.addressing.loa_documents.with_raw_response.get( + loa_document_id="", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + class TestAsyncLOADocuments: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -71,7 +157,7 @@ class TestAsyncLOADocuments: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: loa_document = await async_client.addressing.loa_documents.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", loa_document="@document.pdf", ) assert_matches_type(Optional[LOADocumentCreateResponse], loa_document, path=["response"]) @@ -80,7 +166,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.loa_documents.with_raw_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", loa_document="@document.pdf", ) @@ -93,7 +179,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.loa_documents.with_streaming_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", loa_document="@document.pdf", ) as response: assert not response.is_closed @@ -112,3 +198,81 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: account_id="", loa_document="@document.pdf", ) + + @pytest.mark.skip( + reason="TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489" + ) + @parametrize + @pytest.mark.respx(base_url=base_url) + async def test_method_get(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None: + respx_mock.get( + "/accounts/258def64c72dae45f3e4c8516e2111f2/addressing/loa_documents/d933b1530bc56c9953cf8ce166da8004/download" + ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) + loa_document = await async_client.addressing.loa_documents.get( + loa_document_id="d933b1530bc56c9953cf8ce166da8004", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + assert loa_document.is_closed + assert await loa_document.json() == {"foo": "bar"} + assert cast(Any, loa_document.is_closed) is True + assert isinstance(loa_document, AsyncBinaryAPIResponse) + + @pytest.mark.skip( + reason="TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489" + ) + @parametrize + @pytest.mark.respx(base_url=base_url) + async def test_raw_response_get(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None: + respx_mock.get( + "/accounts/258def64c72dae45f3e4c8516e2111f2/addressing/loa_documents/d933b1530bc56c9953cf8ce166da8004/download" + ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) + + loa_document = await async_client.addressing.loa_documents.with_raw_response.get( + loa_document_id="d933b1530bc56c9953cf8ce166da8004", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) + + assert loa_document.is_closed is True + assert loa_document.http_request.headers.get("X-Stainless-Lang") == "python" + assert await loa_document.json() == {"foo": "bar"} + assert isinstance(loa_document, AsyncBinaryAPIResponse) + + @pytest.mark.skip( + reason="TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489" + ) + @parametrize + @pytest.mark.respx(base_url=base_url) + async def test_streaming_response_get(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None: + respx_mock.get( + "/accounts/258def64c72dae45f3e4c8516e2111f2/addressing/loa_documents/d933b1530bc56c9953cf8ce166da8004/download" + ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) + async with async_client.addressing.loa_documents.with_streaming_response.get( + loa_document_id="d933b1530bc56c9953cf8ce166da8004", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) as loa_document: + assert not loa_document.is_closed + assert loa_document.http_request.headers.get("X-Stainless-Lang") == "python" + + assert await loa_document.json() == {"foo": "bar"} + assert cast(Any, loa_document.is_closed) is True + assert isinstance(loa_document, AsyncStreamedBinaryAPIResponse) + + assert cast(Any, loa_document.is_closed) is True + + @pytest.mark.skip( + reason="TODO: address broken spotlight error - https://github.com/cloudflare/cloudflare-typescript/actions/runs/9456639475/job/26048931174?pr=498#step:5:489" + ) + @parametrize + @pytest.mark.respx(base_url=base_url) + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.addressing.loa_documents.with_raw_response.get( + loa_document_id="d933b1530bc56c9953cf8ce166da8004", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `loa_document_id` but received ''"): + await async_client.addressing.loa_documents.with_raw_response.get( + loa_document_id="", + account_id="258def64c72dae45f3e4c8516e2111f2", + ) diff --git a/tests/api_resources/addressing/test_prefixes.py b/tests/api_resources/addressing/test_prefixes.py index bf75c6e7bd0..955b4eaa157 100644 --- a/tests/api_resources/addressing/test_prefixes.py +++ b/tests/api_resources/addressing/test_prefixes.py @@ -21,7 +21,7 @@ class TestPrefixes: @parametrize def test_method_create(self, client: Cloudflare) -> None: prefix = client.addressing.prefixes.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", asn=209242, cidr="192.0.2.0/24", loa_document_id="d933b1530bc56c9953cf8ce166da8004", @@ -31,7 +31,7 @@ def test_method_create(self, client: Cloudflare) -> None: @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: response = client.addressing.prefixes.with_raw_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", asn=209242, cidr="192.0.2.0/24", loa_document_id="d933b1530bc56c9953cf8ce166da8004", @@ -45,7 +45,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: with client.addressing.prefixes.with_streaming_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", asn=209242, cidr="192.0.2.0/24", loa_document_id="d933b1530bc56c9953cf8ce166da8004", @@ -71,14 +71,14 @@ def test_path_params_create(self, client: Cloudflare) -> None: @parametrize def test_method_list(self, client: Cloudflare) -> None: prefix = client.addressing.prefixes.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert_matches_type(SyncSinglePage[Prefix], prefix, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.addressing.prefixes.with_raw_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert response.is_closed is True @@ -89,7 +89,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.addressing.prefixes.with_streaming_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -109,16 +109,16 @@ def test_path_params_list(self, client: Cloudflare) -> None: @parametrize def test_method_delete(self, client: Cloudflare) -> None: prefix = client.addressing.prefixes.delete( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert_matches_type(PrefixDeleteResponse, prefix, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: response = client.addressing.prefixes.with_raw_response.delete( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert response.is_closed is True @@ -129,8 +129,8 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: with client.addressing.prefixes.with_streaming_response.delete( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -144,21 +144,21 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: def test_path_params_delete(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.addressing.prefixes.with_raw_response.delete( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): client.addressing.prefixes.with_raw_response.delete( prefix_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) @parametrize def test_method_edit(self, client: Cloudflare) -> None: prefix = client.addressing.prefixes.edit( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", description="Internal test prefix", ) assert_matches_type(Optional[Prefix], prefix, path=["response"]) @@ -166,8 +166,8 @@ def test_method_edit(self, client: Cloudflare) -> None: @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: response = client.addressing.prefixes.with_raw_response.edit( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", description="Internal test prefix", ) @@ -179,8 +179,8 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: with client.addressing.prefixes.with_streaming_response.edit( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", description="Internal test prefix", ) as response: assert not response.is_closed @@ -195,7 +195,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: def test_path_params_edit(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.addressing.prefixes.with_raw_response.edit( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", account_id="", description="Internal test prefix", ) @@ -203,23 +203,23 @@ def test_path_params_edit(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): client.addressing.prefixes.with_raw_response.edit( prefix_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", description="Internal test prefix", ) @parametrize def test_method_get(self, client: Cloudflare) -> None: prefix = client.addressing.prefixes.get( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert_matches_type(Optional[Prefix], prefix, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: response = client.addressing.prefixes.with_raw_response.get( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert response.is_closed is True @@ -230,8 +230,8 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: with client.addressing.prefixes.with_streaming_response.get( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -245,14 +245,14 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.addressing.prefixes.with_raw_response.get( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): client.addressing.prefixes.with_raw_response.get( prefix_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) @@ -262,7 +262,7 @@ class TestAsyncPrefixes: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: prefix = await async_client.addressing.prefixes.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", asn=209242, cidr="192.0.2.0/24", loa_document_id="d933b1530bc56c9953cf8ce166da8004", @@ -272,7 +272,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.prefixes.with_raw_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", asn=209242, cidr="192.0.2.0/24", loa_document_id="d933b1530bc56c9953cf8ce166da8004", @@ -286,7 +286,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.prefixes.with_streaming_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", asn=209242, cidr="192.0.2.0/24", loa_document_id="d933b1530bc56c9953cf8ce166da8004", @@ -312,14 +312,14 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: prefix = await async_client.addressing.prefixes.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert_matches_type(AsyncSinglePage[Prefix], prefix, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.prefixes.with_raw_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert response.is_closed is True @@ -330,7 +330,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.prefixes.with_streaming_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -350,16 +350,16 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_delete(self, async_client: AsyncCloudflare) -> None: prefix = await async_client.addressing.prefixes.delete( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert_matches_type(PrefixDeleteResponse, prefix, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.prefixes.with_raw_response.delete( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert response.is_closed is True @@ -370,8 +370,8 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.prefixes.with_streaming_response.delete( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -385,21 +385,21 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.addressing.prefixes.with_raw_response.delete( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): await async_client.addressing.prefixes.with_raw_response.delete( prefix_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) @parametrize async def test_method_edit(self, async_client: AsyncCloudflare) -> None: prefix = await async_client.addressing.prefixes.edit( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", description="Internal test prefix", ) assert_matches_type(Optional[Prefix], prefix, path=["response"]) @@ -407,8 +407,8 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.prefixes.with_raw_response.edit( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", description="Internal test prefix", ) @@ -420,8 +420,8 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.prefixes.with_streaming_response.edit( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", description="Internal test prefix", ) as response: assert not response.is_closed @@ -436,7 +436,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.addressing.prefixes.with_raw_response.edit( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", account_id="", description="Internal test prefix", ) @@ -444,23 +444,23 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): await async_client.addressing.prefixes.with_raw_response.edit( prefix_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", description="Internal test prefix", ) @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: prefix = await async_client.addressing.prefixes.get( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert_matches_type(Optional[Prefix], prefix, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.prefixes.with_raw_response.get( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert response.is_closed is True @@ -471,8 +471,8 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.prefixes.with_streaming_response.get( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", + account_id="258def64c72dae45f3e4c8516e2111f2", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -486,12 +486,12 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.addressing.prefixes.with_raw_response.get( - prefix_id="023e105f4ecef8ad9ca31a8372d0c353", + prefix_id="2af39739cc4e3b5910c918468bb89828", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_id` but received ''"): await async_client.addressing.prefixes.with_raw_response.get( prefix_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) diff --git a/tests/api_resources/addressing/test_services.py b/tests/api_resources/addressing/test_services.py index e54cb33ece0..8d51e635ff9 100644 --- a/tests/api_resources/addressing/test_services.py +++ b/tests/api_resources/addressing/test_services.py @@ -21,14 +21,14 @@ class TestServices: @parametrize def test_method_list(self, client: Cloudflare) -> None: service = client.addressing.services.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert_matches_type(SyncSinglePage[ServiceListResponse], service, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.addressing.services.with_raw_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert response.is_closed is True @@ -39,7 +39,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.addressing.services.with_streaming_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -63,14 +63,14 @@ class TestAsyncServices: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: service = await async_client.addressing.services.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert_matches_type(AsyncSinglePage[ServiceListResponse], service, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.addressing.services.with_raw_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) assert response.is_closed is True @@ -81,7 +81,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.addressing.services.with_streaming_response.list( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="258def64c72dae45f3e4c8516e2111f2", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/addressing/prefixes/bgp/__init__.py b/tests/api_resources/ai/__init__.py similarity index 100% rename from tests/api_resources/addressing/prefixes/bgp/__init__.py rename to tests/api_resources/ai/__init__.py diff --git a/tests/api_resources/workers/ai/__init__.py b/tests/api_resources/ai/finetunes/__init__.py similarity index 100% rename from tests/api_resources/workers/ai/__init__.py rename to tests/api_resources/ai/finetunes/__init__.py diff --git a/tests/api_resources/ai/finetunes/test_assets.py b/tests/api_resources/ai/finetunes/test_assets.py new file mode 100644 index 00000000000..1a692800031 --- /dev/null +++ b/tests/api_resources/ai/finetunes/test_assets.py @@ -0,0 +1,138 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.ai.finetunes import AssetCreateResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestAssets: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Cloudflare) -> None: + asset = client.ai.finetunes.assets.create( + finetune_id="bc451aef-f723-4b26-a6b2-901afd2e7a8a", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(AssetCreateResponse, asset, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Cloudflare) -> None: + asset = client.ai.finetunes.assets.create( + finetune_id="bc451aef-f723-4b26-a6b2-901afd2e7a8a", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + file=b"raw file contents", + file_name="file_name", + ) + assert_matches_type(AssetCreateResponse, asset, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Cloudflare) -> None: + response = client.ai.finetunes.assets.with_raw_response.create( + finetune_id="bc451aef-f723-4b26-a6b2-901afd2e7a8a", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + asset = response.parse() + assert_matches_type(AssetCreateResponse, asset, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Cloudflare) -> None: + with client.ai.finetunes.assets.with_streaming_response.create( + finetune_id="bc451aef-f723-4b26-a6b2-901afd2e7a8a", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + asset = response.parse() + assert_matches_type(AssetCreateResponse, asset, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.ai.finetunes.assets.with_raw_response.create( + finetune_id="bc451aef-f723-4b26-a6b2-901afd2e7a8a", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `finetune_id` but received ''"): + client.ai.finetunes.assets.with_raw_response.create( + finetune_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + +class TestAsyncAssets: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncCloudflare) -> None: + asset = await async_client.ai.finetunes.assets.create( + finetune_id="bc451aef-f723-4b26-a6b2-901afd2e7a8a", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(AssetCreateResponse, asset, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: + asset = await async_client.ai.finetunes.assets.create( + finetune_id="bc451aef-f723-4b26-a6b2-901afd2e7a8a", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + file=b"raw file contents", + file_name="file_name", + ) + assert_matches_type(AssetCreateResponse, asset, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: + response = await async_client.ai.finetunes.assets.with_raw_response.create( + finetune_id="bc451aef-f723-4b26-a6b2-901afd2e7a8a", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + asset = await response.parse() + assert_matches_type(AssetCreateResponse, asset, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: + async with async_client.ai.finetunes.assets.with_streaming_response.create( + finetune_id="bc451aef-f723-4b26-a6b2-901afd2e7a8a", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + asset = await response.parse() + assert_matches_type(AssetCreateResponse, asset, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.ai.finetunes.assets.with_raw_response.create( + finetune_id="bc451aef-f723-4b26-a6b2-901afd2e7a8a", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `finetune_id` but received ''"): + await async_client.ai.finetunes.assets.with_raw_response.create( + finetune_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) diff --git a/tests/api_resources/ai/finetunes/test_public.py b/tests/api_resources/ai/finetunes/test_public.py new file mode 100644 index 00000000000..cc5f2b658c4 --- /dev/null +++ b/tests/api_resources/ai/finetunes/test_public.py @@ -0,0 +1,119 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.ai.finetunes import PublicListResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestPublic: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + public = client.ai.finetunes.public.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(SyncSinglePage[PublicListResponse], public, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + public = client.ai.finetunes.public.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + limit=0, + offset=0, + order_by="orderBy", + ) + assert_matches_type(SyncSinglePage[PublicListResponse], public, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.ai.finetunes.public.with_raw_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + public = response.parse() + assert_matches_type(SyncSinglePage[PublicListResponse], public, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.ai.finetunes.public.with_streaming_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + public = response.parse() + assert_matches_type(SyncSinglePage[PublicListResponse], public, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.ai.finetunes.public.with_raw_response.list( + account_id="", + ) + + +class TestAsyncPublic: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + public = await async_client.ai.finetunes.public.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(AsyncSinglePage[PublicListResponse], public, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + public = await async_client.ai.finetunes.public.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + limit=0, + offset=0, + order_by="orderBy", + ) + assert_matches_type(AsyncSinglePage[PublicListResponse], public, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.ai.finetunes.public.with_raw_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + public = await response.parse() + assert_matches_type(AsyncSinglePage[PublicListResponse], public, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.ai.finetunes.public.with_streaming_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + public = await response.parse() + assert_matches_type(AsyncSinglePage[PublicListResponse], public, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.ai.finetunes.public.with_raw_response.list( + account_id="", + ) diff --git a/tests/api_resources/workers/ai/models/__init__.py b/tests/api_resources/ai/models/__init__.py similarity index 100% rename from tests/api_resources/workers/ai/models/__init__.py rename to tests/api_resources/ai/models/__init__.py diff --git a/tests/api_resources/workers/ai/models/test_schema.py b/tests/api_resources/ai/models/test_schema.py similarity index 85% rename from tests/api_resources/workers/ai/models/test_schema.py rename to tests/api_resources/ai/models/test_schema.py index a815dc1f7c1..c2592b98979 100644 --- a/tests/api_resources/workers/ai/models/test_schema.py +++ b/tests/api_resources/ai/models/test_schema.py @@ -18,7 +18,7 @@ class TestSchema: @parametrize def test_method_get(self, client: Cloudflare) -> None: - schema = client.workers.ai.models.schema.get( + schema = client.ai.models.schema.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", model="model", ) @@ -26,7 +26,7 @@ def test_method_get(self, client: Cloudflare) -> None: @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.workers.ai.models.schema.with_raw_response.get( + response = client.ai.models.schema.with_raw_response.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", model="model", ) @@ -38,7 +38,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.workers.ai.models.schema.with_streaming_response.get( + with client.ai.models.schema.with_streaming_response.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", model="model", ) as response: @@ -53,7 +53,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @parametrize def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.workers.ai.models.schema.with_raw_response.get( + client.ai.models.schema.with_raw_response.get( account_id="", model="model", ) @@ -64,7 +64,7 @@ class TestAsyncSchema: @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: - schema = await async_client.workers.ai.models.schema.get( + schema = await async_client.ai.models.schema.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", model="model", ) @@ -72,7 +72,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.workers.ai.models.schema.with_raw_response.get( + response = await async_client.ai.models.schema.with_raw_response.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", model="model", ) @@ -84,7 +84,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.workers.ai.models.schema.with_streaming_response.get( + async with async_client.ai.models.schema.with_streaming_response.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", model="model", ) as response: @@ -99,7 +99,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.workers.ai.models.schema.with_raw_response.get( + await async_client.ai.models.schema.with_raw_response.get( account_id="", model="model", ) diff --git a/tests/api_resources/ai/test_authors.py b/tests/api_resources/ai/test_authors.py new file mode 100644 index 00000000000..16cdb1d7750 --- /dev/null +++ b/tests/api_resources/ai/test_authors.py @@ -0,0 +1,98 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestAuthors: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + author = client.ai.authors.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(SyncSinglePage[object], author, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.ai.authors.with_raw_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + author = response.parse() + assert_matches_type(SyncSinglePage[object], author, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.ai.authors.with_streaming_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + author = response.parse() + assert_matches_type(SyncSinglePage[object], author, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.ai.authors.with_raw_response.list( + account_id="", + ) + + +class TestAsyncAuthors: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + author = await async_client.ai.authors.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(AsyncSinglePage[object], author, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.ai.authors.with_raw_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + author = await response.parse() + assert_matches_type(AsyncSinglePage[object], author, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.ai.authors.with_streaming_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + author = await response.parse() + assert_matches_type(AsyncSinglePage[object], author, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.ai.authors.with_raw_response.list( + account_id="", + ) diff --git a/tests/api_resources/ai/test_finetunes.py b/tests/api_resources/ai/test_finetunes.py new file mode 100644 index 00000000000..e01ec841666 --- /dev/null +++ b/tests/api_resources/ai/test_finetunes.py @@ -0,0 +1,212 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.ai import FinetuneListResponse, FinetuneCreateResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestFinetunes: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Cloudflare) -> None: + finetune = client.ai.finetunes.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + model="model", + name="name", + ) + assert_matches_type(FinetuneCreateResponse, finetune, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Cloudflare) -> None: + finetune = client.ai.finetunes.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + model="model", + name="name", + description="description", + public=True, + ) + assert_matches_type(FinetuneCreateResponse, finetune, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Cloudflare) -> None: + response = client.ai.finetunes.with_raw_response.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + model="model", + name="name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + finetune = response.parse() + assert_matches_type(FinetuneCreateResponse, finetune, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Cloudflare) -> None: + with client.ai.finetunes.with_streaming_response.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + model="model", + name="name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + finetune = response.parse() + assert_matches_type(FinetuneCreateResponse, finetune, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.ai.finetunes.with_raw_response.create( + account_id="", + model="model", + name="name", + ) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + finetune = client.ai.finetunes.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(FinetuneListResponse, finetune, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.ai.finetunes.with_raw_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + finetune = response.parse() + assert_matches_type(FinetuneListResponse, finetune, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.ai.finetunes.with_streaming_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + finetune = response.parse() + assert_matches_type(FinetuneListResponse, finetune, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.ai.finetunes.with_raw_response.list( + account_id="", + ) + + +class TestAsyncFinetunes: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncCloudflare) -> None: + finetune = await async_client.ai.finetunes.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + model="model", + name="name", + ) + assert_matches_type(FinetuneCreateResponse, finetune, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: + finetune = await async_client.ai.finetunes.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + model="model", + name="name", + description="description", + public=True, + ) + assert_matches_type(FinetuneCreateResponse, finetune, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: + response = await async_client.ai.finetunes.with_raw_response.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + model="model", + name="name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + finetune = await response.parse() + assert_matches_type(FinetuneCreateResponse, finetune, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: + async with async_client.ai.finetunes.with_streaming_response.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + model="model", + name="name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + finetune = await response.parse() + assert_matches_type(FinetuneCreateResponse, finetune, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.ai.finetunes.with_raw_response.create( + account_id="", + model="model", + name="name", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + finetune = await async_client.ai.finetunes.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(FinetuneListResponse, finetune, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.ai.finetunes.with_raw_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + finetune = await response.parse() + assert_matches_type(FinetuneListResponse, finetune, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.ai.finetunes.with_streaming_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + finetune = await response.parse() + assert_matches_type(FinetuneListResponse, finetune, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.ai.finetunes.with_raw_response.list( + account_id="", + ) diff --git a/tests/api_resources/ai/test_models.py b/tests/api_resources/ai/test_models.py new file mode 100644 index 00000000000..56897b9a250 --- /dev/null +++ b/tests/api_resources/ai/test_models.py @@ -0,0 +1,126 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestModels: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + model = client.ai.models.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(SyncV4PagePaginationArray[object], model, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + model = client.ai.models.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + author="author", + hide_experimental=True, + page=0, + per_page=0, + search="search", + source=0, + task="Text Generation", + ) + assert_matches_type(SyncV4PagePaginationArray[object], model, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.ai.models.with_raw_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + model = response.parse() + assert_matches_type(SyncV4PagePaginationArray[object], model, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.ai.models.with_streaming_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + model = response.parse() + assert_matches_type(SyncV4PagePaginationArray[object], model, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.ai.models.with_raw_response.list( + account_id="", + ) + + +class TestAsyncModels: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + model = await async_client.ai.models.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(AsyncV4PagePaginationArray[object], model, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + model = await async_client.ai.models.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + author="author", + hide_experimental=True, + page=0, + per_page=0, + search="search", + source=0, + task="Text Generation", + ) + assert_matches_type(AsyncV4PagePaginationArray[object], model, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.ai.models.with_raw_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + model = await response.parse() + assert_matches_type(AsyncV4PagePaginationArray[object], model, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.ai.models.with_streaming_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + model = await response.parse() + assert_matches_type(AsyncV4PagePaginationArray[object], model, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.ai.models.with_raw_response.list( + account_id="", + ) diff --git a/tests/api_resources/ai/test_tasks.py b/tests/api_resources/ai/test_tasks.py new file mode 100644 index 00000000000..4383e0af353 --- /dev/null +++ b/tests/api_resources/ai/test_tasks.py @@ -0,0 +1,98 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestTasks: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + task = client.ai.tasks.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(SyncSinglePage[object], task, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.ai.tasks.with_raw_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task = response.parse() + assert_matches_type(SyncSinglePage[object], task, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.ai.tasks.with_streaming_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task = response.parse() + assert_matches_type(SyncSinglePage[object], task, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.ai.tasks.with_raw_response.list( + account_id="", + ) + + +class TestAsyncTasks: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + task = await async_client.ai.tasks.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(AsyncSinglePage[object], task, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.ai.tasks.with_raw_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + task = await response.parse() + assert_matches_type(AsyncSinglePage[object], task, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.ai.tasks.with_streaming_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + task = await response.parse() + assert_matches_type(AsyncSinglePage[object], task, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.ai.tasks.with_raw_response.list( + account_id="", + ) diff --git a/tests/api_resources/ai_gateway/test_datasets.py b/tests/api_resources/ai_gateway/test_datasets.py index b89ce377825..dc7ab2a74c5 100644 --- a/tests/api_resources/ai_gateway/test_datasets.py +++ b/tests/api_resources/ai_gateway/test_datasets.py @@ -246,8 +246,6 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0", enable=True, name="name", - order_by="order_by", - order_by_direction="asc", page=1, per_page=1, search="search", @@ -640,8 +638,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0", enable=True, name="name", - order_by="order_by", - order_by_direction="asc", page=1, per_page=1, search="search", diff --git a/tests/api_resources/ai_gateway/test_evaluations.py b/tests/api_resources/ai_gateway/test_evaluations.py index 6d6566a3b2d..444549e3cef 100644 --- a/tests/api_resources/ai_gateway/test_evaluations.py +++ b/tests/api_resources/ai_gateway/test_evaluations.py @@ -100,8 +100,6 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: gateway_id="my-gateway", account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0", name="name", - order_by="order_by", - order_by_direction="asc", page=1, per_page=1, processed=True, @@ -350,8 +348,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) gateway_id="my-gateway", account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0", name="name", - order_by="order_by", - order_by_direction="asc", page=1, per_page=1, processed=True, diff --git a/tests/api_resources/ai_gateway/test_logs.py b/tests/api_resources/ai_gateway/test_logs.py index 44ff2500f24..4be76ce1282 100644 --- a/tests/api_resources/ai_gateway/test_logs.py +++ b/tests/api_resources/ai_gateway/test_logs.py @@ -42,7 +42,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: feedback=0, filters=[ { - "key": "created_at", + "key": "id", "operator": "eq", "value": ["string"], } @@ -128,7 +128,7 @@ def test_method_delete_with_all_params(self, client: Cloudflare) -> None: account_id="0d37909e38d3e99c29fa2cd343ac421a", filters=[ { - "key": "created_at", + "key": "id", "operator": "eq", "value": ["string"], } @@ -454,7 +454,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) feedback=0, filters=[ { - "key": "created_at", + "key": "id", "operator": "eq", "value": ["string"], } @@ -540,7 +540,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare account_id="0d37909e38d3e99c29fa2cd343ac421a", filters=[ { - "key": "created_at", + "key": "id", "operator": "eq", "value": ["string"], } diff --git a/tests/api_resources/api_gateway/test_operations.py b/tests/api_resources/api_gateway/test_operations.py index 2be09e57fa3..f61103adcc9 100644 --- a/tests/api_resources/api_gateway/test_operations.py +++ b/tests/api_resources/api_gateway/test_operations.py @@ -15,6 +15,7 @@ OperationListResponse, OperationCreateResponse, OperationDeleteResponse, + OperationBulkCreateResponse, OperationBulkDeleteResponse, ) @@ -28,13 +29,9 @@ class TestOperations: def test_method_create(self, client: Cloudflare) -> None: operation = client.api_gateway.operations.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[ - { - "endpoint": "/api/v1/users/{var1}", - "host": "www.example.com", - "method": "GET", - } - ], + endpoint="/api/v1/users/{var1}", + host="www.example.com", + method="GET", ) assert_matches_type(OperationCreateResponse, operation, path=["response"]) @@ -42,13 +39,9 @@ def test_method_create(self, client: Cloudflare) -> None: def test_raw_response_create(self, client: Cloudflare) -> None: response = client.api_gateway.operations.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[ - { - "endpoint": "/api/v1/users/{var1}", - "host": "www.example.com", - "method": "GET", - } - ], + endpoint="/api/v1/users/{var1}", + host="www.example.com", + method="GET", ) assert response.is_closed is True @@ -60,13 +53,9 @@ def test_raw_response_create(self, client: Cloudflare) -> None: def test_streaming_response_create(self, client: Cloudflare) -> None: with client.api_gateway.operations.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[ - { - "endpoint": "/api/v1/users/{var1}", - "host": "www.example.com", - "method": "GET", - } - ], + endpoint="/api/v1/users/{var1}", + host="www.example.com", + method="GET", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -81,13 +70,9 @@ def test_path_params_create(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.api_gateway.operations.with_raw_response.create( zone_id="", - body=[ - { - "endpoint": "/api/v1/users/{var1}", - "host": "www.example.com", - "method": "GET", - } - ], + endpoint="/api/v1/users/{var1}", + host="www.example.com", + method="GET", ) @parametrize @@ -191,6 +176,72 @@ def test_path_params_delete(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) + @parametrize + def test_method_bulk_create(self, client: Cloudflare) -> None: + operation = client.api_gateway.operations.bulk_create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[ + { + "endpoint": "/api/v1/users/{var1}", + "host": "www.example.com", + "method": "GET", + } + ], + ) + assert_matches_type(OperationBulkCreateResponse, operation, path=["response"]) + + @parametrize + def test_raw_response_bulk_create(self, client: Cloudflare) -> None: + response = client.api_gateway.operations.with_raw_response.bulk_create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[ + { + "endpoint": "/api/v1/users/{var1}", + "host": "www.example.com", + "method": "GET", + } + ], + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + operation = response.parse() + assert_matches_type(OperationBulkCreateResponse, operation, path=["response"]) + + @parametrize + def test_streaming_response_bulk_create(self, client: Cloudflare) -> None: + with client.api_gateway.operations.with_streaming_response.bulk_create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[ + { + "endpoint": "/api/v1/users/{var1}", + "host": "www.example.com", + "method": "GET", + } + ], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + operation = response.parse() + assert_matches_type(OperationBulkCreateResponse, operation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_bulk_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.api_gateway.operations.with_raw_response.bulk_create( + zone_id="", + body=[ + { + "endpoint": "/api/v1/users/{var1}", + "host": "www.example.com", + "method": "GET", + } + ], + ) + @parametrize def test_method_bulk_delete(self, client: Cloudflare) -> None: operation = client.api_gateway.operations.bulk_delete( @@ -294,13 +345,9 @@ class TestAsyncOperations: async def test_method_create(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.operations.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[ - { - "endpoint": "/api/v1/users/{var1}", - "host": "www.example.com", - "method": "GET", - } - ], + endpoint="/api/v1/users/{var1}", + host="www.example.com", + method="GET", ) assert_matches_type(OperationCreateResponse, operation, path=["response"]) @@ -308,13 +355,9 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.operations.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[ - { - "endpoint": "/api/v1/users/{var1}", - "host": "www.example.com", - "method": "GET", - } - ], + endpoint="/api/v1/users/{var1}", + host="www.example.com", + method="GET", ) assert response.is_closed is True @@ -326,13 +369,9 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.operations.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[ - { - "endpoint": "/api/v1/users/{var1}", - "host": "www.example.com", - "method": "GET", - } - ], + endpoint="/api/v1/users/{var1}", + host="www.example.com", + method="GET", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -347,13 +386,9 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.api_gateway.operations.with_raw_response.create( zone_id="", - body=[ - { - "endpoint": "/api/v1/users/{var1}", - "host": "www.example.com", - "method": "GET", - } - ], + endpoint="/api/v1/users/{var1}", + host="www.example.com", + method="GET", ) @parametrize @@ -457,6 +492,72 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) + @parametrize + async def test_method_bulk_create(self, async_client: AsyncCloudflare) -> None: + operation = await async_client.api_gateway.operations.bulk_create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[ + { + "endpoint": "/api/v1/users/{var1}", + "host": "www.example.com", + "method": "GET", + } + ], + ) + assert_matches_type(OperationBulkCreateResponse, operation, path=["response"]) + + @parametrize + async def test_raw_response_bulk_create(self, async_client: AsyncCloudflare) -> None: + response = await async_client.api_gateway.operations.with_raw_response.bulk_create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[ + { + "endpoint": "/api/v1/users/{var1}", + "host": "www.example.com", + "method": "GET", + } + ], + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + operation = await response.parse() + assert_matches_type(OperationBulkCreateResponse, operation, path=["response"]) + + @parametrize + async def test_streaming_response_bulk_create(self, async_client: AsyncCloudflare) -> None: + async with async_client.api_gateway.operations.with_streaming_response.bulk_create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[ + { + "endpoint": "/api/v1/users/{var1}", + "host": "www.example.com", + "method": "GET", + } + ], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + operation = await response.parse() + assert_matches_type(OperationBulkCreateResponse, operation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_bulk_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.api_gateway.operations.with_raw_response.bulk_create( + zone_id="", + body=[ + { + "endpoint": "/api/v1/users/{var1}", + "host": "www.example.com", + "method": "GET", + } + ], + ) + @parametrize async def test_method_bulk_delete(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.operations.bulk_delete( diff --git a/tests/api_resources/argo/test_tiered_caching.py b/tests/api_resources/argo/test_tiered_caching.py index 9afbafa5d1c..d91060caa7b 100644 --- a/tests/api_resources/argo/test_tiered_caching.py +++ b/tests/api_resources/argo/test_tiered_caching.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -23,7 +23,7 @@ def test_method_edit(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", value="on", ) - assert_matches_type(TieredCachingEditResponse, tiered_caching, path=["response"]) + assert_matches_type(Optional[TieredCachingEditResponse], tiered_caching, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: @@ -35,7 +35,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" tiered_caching = response.parse() - assert_matches_type(TieredCachingEditResponse, tiered_caching, path=["response"]) + assert_matches_type(Optional[TieredCachingEditResponse], tiered_caching, path=["response"]) @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: @@ -47,7 +47,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" tiered_caching = response.parse() - assert_matches_type(TieredCachingEditResponse, tiered_caching, path=["response"]) + assert_matches_type(Optional[TieredCachingEditResponse], tiered_caching, path=["response"]) assert cast(Any, response.is_closed) is True @@ -64,7 +64,7 @@ def test_method_get(self, client: Cloudflare) -> None: tiered_caching = client.argo.tiered_caching.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(TieredCachingGetResponse, tiered_caching, path=["response"]) + assert_matches_type(Optional[TieredCachingGetResponse], tiered_caching, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -75,7 +75,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" tiered_caching = response.parse() - assert_matches_type(TieredCachingGetResponse, tiered_caching, path=["response"]) + assert_matches_type(Optional[TieredCachingGetResponse], tiered_caching, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -86,7 +86,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" tiered_caching = response.parse() - assert_matches_type(TieredCachingGetResponse, tiered_caching, path=["response"]) + assert_matches_type(Optional[TieredCachingGetResponse], tiered_caching, path=["response"]) assert cast(Any, response.is_closed) is True @@ -107,7 +107,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", value="on", ) - assert_matches_type(TieredCachingEditResponse, tiered_caching, path=["response"]) + assert_matches_type(Optional[TieredCachingEditResponse], tiered_caching, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -119,7 +119,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" tiered_caching = await response.parse() - assert_matches_type(TieredCachingEditResponse, tiered_caching, path=["response"]) + assert_matches_type(Optional[TieredCachingEditResponse], tiered_caching, path=["response"]) @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -131,7 +131,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" tiered_caching = await response.parse() - assert_matches_type(TieredCachingEditResponse, tiered_caching, path=["response"]) + assert_matches_type(Optional[TieredCachingEditResponse], tiered_caching, path=["response"]) assert cast(Any, response.is_closed) is True @@ -148,7 +148,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: tiered_caching = await async_client.argo.tiered_caching.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(TieredCachingGetResponse, tiered_caching, path=["response"]) + assert_matches_type(Optional[TieredCachingGetResponse], tiered_caching, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -159,7 +159,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" tiered_caching = await response.parse() - assert_matches_type(TieredCachingGetResponse, tiered_caching, path=["response"]) + assert_matches_type(Optional[TieredCachingGetResponse], tiered_caching, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -170,7 +170,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" tiered_caching = await response.parse() - assert_matches_type(TieredCachingGetResponse, tiered_caching, path=["response"]) + assert_matches_type(Optional[TieredCachingGetResponse], tiered_caching, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/cache/test_cache_reserve.py b/tests/api_resources/cache/test_cache_reserve.py index 1d1478215cf..1d125319b6f 100644 --- a/tests/api_resources/cache/test_cache_reserve.py +++ b/tests/api_resources/cache/test_cache_reserve.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -28,7 +28,7 @@ def test_method_clear(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(CacheReserveClearResponse, cache_reserve, path=["response"]) + assert_matches_type(Optional[CacheReserveClearResponse], cache_reserve, path=["response"]) @parametrize def test_raw_response_clear(self, client: Cloudflare) -> None: @@ -40,7 +40,7 @@ def test_raw_response_clear(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = response.parse() - assert_matches_type(CacheReserveClearResponse, cache_reserve, path=["response"]) + assert_matches_type(Optional[CacheReserveClearResponse], cache_reserve, path=["response"]) @parametrize def test_streaming_response_clear(self, client: Cloudflare) -> None: @@ -52,7 +52,7 @@ def test_streaming_response_clear(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = response.parse() - assert_matches_type(CacheReserveClearResponse, cache_reserve, path=["response"]) + assert_matches_type(Optional[CacheReserveClearResponse], cache_reserve, path=["response"]) assert cast(Any, response.is_closed) is True @@ -70,7 +70,7 @@ def test_method_edit(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", value="on", ) - assert_matches_type(CacheReserveEditResponse, cache_reserve, path=["response"]) + assert_matches_type(Optional[CacheReserveEditResponse], cache_reserve, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: @@ -82,7 +82,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = response.parse() - assert_matches_type(CacheReserveEditResponse, cache_reserve, path=["response"]) + assert_matches_type(Optional[CacheReserveEditResponse], cache_reserve, path=["response"]) @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: @@ -94,7 +94,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = response.parse() - assert_matches_type(CacheReserveEditResponse, cache_reserve, path=["response"]) + assert_matches_type(Optional[CacheReserveEditResponse], cache_reserve, path=["response"]) assert cast(Any, response.is_closed) is True @@ -111,7 +111,7 @@ def test_method_get(self, client: Cloudflare) -> None: cache_reserve = client.cache.cache_reserve.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CacheReserveGetResponse, cache_reserve, path=["response"]) + assert_matches_type(Optional[CacheReserveGetResponse], cache_reserve, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -122,7 +122,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = response.parse() - assert_matches_type(CacheReserveGetResponse, cache_reserve, path=["response"]) + assert_matches_type(Optional[CacheReserveGetResponse], cache_reserve, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -133,7 +133,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = response.parse() - assert_matches_type(CacheReserveGetResponse, cache_reserve, path=["response"]) + assert_matches_type(Optional[CacheReserveGetResponse], cache_reserve, path=["response"]) assert cast(Any, response.is_closed) is True @@ -149,7 +149,7 @@ def test_method_status(self, client: Cloudflare) -> None: cache_reserve = client.cache.cache_reserve.status( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CacheReserveStatusResponse, cache_reserve, path=["response"]) + assert_matches_type(Optional[CacheReserveStatusResponse], cache_reserve, path=["response"]) @parametrize def test_raw_response_status(self, client: Cloudflare) -> None: @@ -160,7 +160,7 @@ def test_raw_response_status(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = response.parse() - assert_matches_type(CacheReserveStatusResponse, cache_reserve, path=["response"]) + assert_matches_type(Optional[CacheReserveStatusResponse], cache_reserve, path=["response"]) @parametrize def test_streaming_response_status(self, client: Cloudflare) -> None: @@ -171,7 +171,7 @@ def test_streaming_response_status(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = response.parse() - assert_matches_type(CacheReserveStatusResponse, cache_reserve, path=["response"]) + assert_matches_type(Optional[CacheReserveStatusResponse], cache_reserve, path=["response"]) assert cast(Any, response.is_closed) is True @@ -192,7 +192,7 @@ async def test_method_clear(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(CacheReserveClearResponse, cache_reserve, path=["response"]) + assert_matches_type(Optional[CacheReserveClearResponse], cache_reserve, path=["response"]) @parametrize async def test_raw_response_clear(self, async_client: AsyncCloudflare) -> None: @@ -204,7 +204,7 @@ async def test_raw_response_clear(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = await response.parse() - assert_matches_type(CacheReserveClearResponse, cache_reserve, path=["response"]) + assert_matches_type(Optional[CacheReserveClearResponse], cache_reserve, path=["response"]) @parametrize async def test_streaming_response_clear(self, async_client: AsyncCloudflare) -> None: @@ -216,7 +216,7 @@ async def test_streaming_response_clear(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = await response.parse() - assert_matches_type(CacheReserveClearResponse, cache_reserve, path=["response"]) + assert_matches_type(Optional[CacheReserveClearResponse], cache_reserve, path=["response"]) assert cast(Any, response.is_closed) is True @@ -234,7 +234,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", value="on", ) - assert_matches_type(CacheReserveEditResponse, cache_reserve, path=["response"]) + assert_matches_type(Optional[CacheReserveEditResponse], cache_reserve, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -246,7 +246,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = await response.parse() - assert_matches_type(CacheReserveEditResponse, cache_reserve, path=["response"]) + assert_matches_type(Optional[CacheReserveEditResponse], cache_reserve, path=["response"]) @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -258,7 +258,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = await response.parse() - assert_matches_type(CacheReserveEditResponse, cache_reserve, path=["response"]) + assert_matches_type(Optional[CacheReserveEditResponse], cache_reserve, path=["response"]) assert cast(Any, response.is_closed) is True @@ -275,7 +275,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: cache_reserve = await async_client.cache.cache_reserve.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CacheReserveGetResponse, cache_reserve, path=["response"]) + assert_matches_type(Optional[CacheReserveGetResponse], cache_reserve, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -286,7 +286,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = await response.parse() - assert_matches_type(CacheReserveGetResponse, cache_reserve, path=["response"]) + assert_matches_type(Optional[CacheReserveGetResponse], cache_reserve, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -297,7 +297,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = await response.parse() - assert_matches_type(CacheReserveGetResponse, cache_reserve, path=["response"]) + assert_matches_type(Optional[CacheReserveGetResponse], cache_reserve, path=["response"]) assert cast(Any, response.is_closed) is True @@ -313,7 +313,7 @@ async def test_method_status(self, async_client: AsyncCloudflare) -> None: cache_reserve = await async_client.cache.cache_reserve.status( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CacheReserveStatusResponse, cache_reserve, path=["response"]) + assert_matches_type(Optional[CacheReserveStatusResponse], cache_reserve, path=["response"]) @parametrize async def test_raw_response_status(self, async_client: AsyncCloudflare) -> None: @@ -324,7 +324,7 @@ async def test_raw_response_status(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = await response.parse() - assert_matches_type(CacheReserveStatusResponse, cache_reserve, path=["response"]) + assert_matches_type(Optional[CacheReserveStatusResponse], cache_reserve, path=["response"]) @parametrize async def test_streaming_response_status(self, async_client: AsyncCloudflare) -> None: @@ -335,7 +335,7 @@ async def test_streaming_response_status(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = await response.parse() - assert_matches_type(CacheReserveStatusResponse, cache_reserve, path=["response"]) + assert_matches_type(Optional[CacheReserveStatusResponse], cache_reserve, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/cache/test_regional_tiered_cache.py b/tests/api_resources/cache/test_regional_tiered_cache.py index ec3ddfeb861..98deff2adf5 100644 --- a/tests/api_resources/cache/test_regional_tiered_cache.py +++ b/tests/api_resources/cache/test_regional_tiered_cache.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -26,7 +26,7 @@ def test_method_edit(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", value="on", ) - assert_matches_type(RegionalTieredCacheEditResponse, regional_tiered_cache, path=["response"]) + assert_matches_type(Optional[RegionalTieredCacheEditResponse], regional_tiered_cache, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: @@ -38,7 +38,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" regional_tiered_cache = response.parse() - assert_matches_type(RegionalTieredCacheEditResponse, regional_tiered_cache, path=["response"]) + assert_matches_type(Optional[RegionalTieredCacheEditResponse], regional_tiered_cache, path=["response"]) @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: @@ -50,7 +50,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" regional_tiered_cache = response.parse() - assert_matches_type(RegionalTieredCacheEditResponse, regional_tiered_cache, path=["response"]) + assert_matches_type(Optional[RegionalTieredCacheEditResponse], regional_tiered_cache, path=["response"]) assert cast(Any, response.is_closed) is True @@ -67,7 +67,7 @@ def test_method_get(self, client: Cloudflare) -> None: regional_tiered_cache = client.cache.regional_tiered_cache.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(RegionalTieredCacheGetResponse, regional_tiered_cache, path=["response"]) + assert_matches_type(Optional[RegionalTieredCacheGetResponse], regional_tiered_cache, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -78,7 +78,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" regional_tiered_cache = response.parse() - assert_matches_type(RegionalTieredCacheGetResponse, regional_tiered_cache, path=["response"]) + assert_matches_type(Optional[RegionalTieredCacheGetResponse], regional_tiered_cache, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -89,7 +89,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" regional_tiered_cache = response.parse() - assert_matches_type(RegionalTieredCacheGetResponse, regional_tiered_cache, path=["response"]) + assert_matches_type(Optional[RegionalTieredCacheGetResponse], regional_tiered_cache, path=["response"]) assert cast(Any, response.is_closed) is True @@ -110,7 +110,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", value="on", ) - assert_matches_type(RegionalTieredCacheEditResponse, regional_tiered_cache, path=["response"]) + assert_matches_type(Optional[RegionalTieredCacheEditResponse], regional_tiered_cache, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -122,7 +122,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" regional_tiered_cache = await response.parse() - assert_matches_type(RegionalTieredCacheEditResponse, regional_tiered_cache, path=["response"]) + assert_matches_type(Optional[RegionalTieredCacheEditResponse], regional_tiered_cache, path=["response"]) @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -134,7 +134,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" regional_tiered_cache = await response.parse() - assert_matches_type(RegionalTieredCacheEditResponse, regional_tiered_cache, path=["response"]) + assert_matches_type(Optional[RegionalTieredCacheEditResponse], regional_tiered_cache, path=["response"]) assert cast(Any, response.is_closed) is True @@ -151,7 +151,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: regional_tiered_cache = await async_client.cache.regional_tiered_cache.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(RegionalTieredCacheGetResponse, regional_tiered_cache, path=["response"]) + assert_matches_type(Optional[RegionalTieredCacheGetResponse], regional_tiered_cache, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -162,7 +162,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" regional_tiered_cache = await response.parse() - assert_matches_type(RegionalTieredCacheGetResponse, regional_tiered_cache, path=["response"]) + assert_matches_type(Optional[RegionalTieredCacheGetResponse], regional_tiered_cache, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -173,7 +173,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" regional_tiered_cache = await response.parse() - assert_matches_type(RegionalTieredCacheGetResponse, regional_tiered_cache, path=["response"]) + assert_matches_type(Optional[RegionalTieredCacheGetResponse], regional_tiered_cache, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/cache/test_smart_tiered_cache.py b/tests/api_resources/cache/test_smart_tiered_cache.py index b683f9fc4dc..4502fff107d 100644 --- a/tests/api_resources/cache/test_smart_tiered_cache.py +++ b/tests/api_resources/cache/test_smart_tiered_cache.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -26,7 +26,7 @@ def test_method_delete(self, client: Cloudflare) -> None: smart_tiered_cache = client.cache.smart_tiered_cache.delete( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SmartTieredCacheDeleteResponse, smart_tiered_cache, path=["response"]) + assert_matches_type(Optional[SmartTieredCacheDeleteResponse], smart_tiered_cache, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -37,7 +37,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" smart_tiered_cache = response.parse() - assert_matches_type(SmartTieredCacheDeleteResponse, smart_tiered_cache, path=["response"]) + assert_matches_type(Optional[SmartTieredCacheDeleteResponse], smart_tiered_cache, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -48,7 +48,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" smart_tiered_cache = response.parse() - assert_matches_type(SmartTieredCacheDeleteResponse, smart_tiered_cache, path=["response"]) + assert_matches_type(Optional[SmartTieredCacheDeleteResponse], smart_tiered_cache, path=["response"]) assert cast(Any, response.is_closed) is True @@ -65,7 +65,7 @@ def test_method_edit(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", value="on", ) - assert_matches_type(SmartTieredCacheEditResponse, smart_tiered_cache, path=["response"]) + assert_matches_type(Optional[SmartTieredCacheEditResponse], smart_tiered_cache, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: @@ -77,7 +77,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" smart_tiered_cache = response.parse() - assert_matches_type(SmartTieredCacheEditResponse, smart_tiered_cache, path=["response"]) + assert_matches_type(Optional[SmartTieredCacheEditResponse], smart_tiered_cache, path=["response"]) @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: @@ -89,7 +89,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" smart_tiered_cache = response.parse() - assert_matches_type(SmartTieredCacheEditResponse, smart_tiered_cache, path=["response"]) + assert_matches_type(Optional[SmartTieredCacheEditResponse], smart_tiered_cache, path=["response"]) assert cast(Any, response.is_closed) is True @@ -106,7 +106,7 @@ def test_method_get(self, client: Cloudflare) -> None: smart_tiered_cache = client.cache.smart_tiered_cache.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SmartTieredCacheGetResponse, smart_tiered_cache, path=["response"]) + assert_matches_type(Optional[SmartTieredCacheGetResponse], smart_tiered_cache, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -117,7 +117,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" smart_tiered_cache = response.parse() - assert_matches_type(SmartTieredCacheGetResponse, smart_tiered_cache, path=["response"]) + assert_matches_type(Optional[SmartTieredCacheGetResponse], smart_tiered_cache, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -128,7 +128,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" smart_tiered_cache = response.parse() - assert_matches_type(SmartTieredCacheGetResponse, smart_tiered_cache, path=["response"]) + assert_matches_type(Optional[SmartTieredCacheGetResponse], smart_tiered_cache, path=["response"]) assert cast(Any, response.is_closed) is True @@ -148,7 +148,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: smart_tiered_cache = await async_client.cache.smart_tiered_cache.delete( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SmartTieredCacheDeleteResponse, smart_tiered_cache, path=["response"]) + assert_matches_type(Optional[SmartTieredCacheDeleteResponse], smart_tiered_cache, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -159,7 +159,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" smart_tiered_cache = await response.parse() - assert_matches_type(SmartTieredCacheDeleteResponse, smart_tiered_cache, path=["response"]) + assert_matches_type(Optional[SmartTieredCacheDeleteResponse], smart_tiered_cache, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -170,7 +170,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" smart_tiered_cache = await response.parse() - assert_matches_type(SmartTieredCacheDeleteResponse, smart_tiered_cache, path=["response"]) + assert_matches_type(Optional[SmartTieredCacheDeleteResponse], smart_tiered_cache, path=["response"]) assert cast(Any, response.is_closed) is True @@ -187,7 +187,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", value="on", ) - assert_matches_type(SmartTieredCacheEditResponse, smart_tiered_cache, path=["response"]) + assert_matches_type(Optional[SmartTieredCacheEditResponse], smart_tiered_cache, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -199,7 +199,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" smart_tiered_cache = await response.parse() - assert_matches_type(SmartTieredCacheEditResponse, smart_tiered_cache, path=["response"]) + assert_matches_type(Optional[SmartTieredCacheEditResponse], smart_tiered_cache, path=["response"]) @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -211,7 +211,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" smart_tiered_cache = await response.parse() - assert_matches_type(SmartTieredCacheEditResponse, smart_tiered_cache, path=["response"]) + assert_matches_type(Optional[SmartTieredCacheEditResponse], smart_tiered_cache, path=["response"]) assert cast(Any, response.is_closed) is True @@ -228,7 +228,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: smart_tiered_cache = await async_client.cache.smart_tiered_cache.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SmartTieredCacheGetResponse, smart_tiered_cache, path=["response"]) + assert_matches_type(Optional[SmartTieredCacheGetResponse], smart_tiered_cache, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -239,7 +239,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" smart_tiered_cache = await response.parse() - assert_matches_type(SmartTieredCacheGetResponse, smart_tiered_cache, path=["response"]) + assert_matches_type(Optional[SmartTieredCacheGetResponse], smart_tiered_cache, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -250,7 +250,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" smart_tiered_cache = await response.parse() - assert_matches_type(SmartTieredCacheGetResponse, smart_tiered_cache, path=["response"]) + assert_matches_type(Optional[SmartTieredCacheGetResponse], smart_tiered_cache, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/cache/test_variants.py b/tests/api_resources/cache/test_variants.py index c46c601fbb8..9cb7356c449 100644 --- a/tests/api_resources/cache/test_variants.py +++ b/tests/api_resources/cache/test_variants.py @@ -3,13 +3,13 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.cache import CacheVariant, VariantGetResponse, VariantEditResponse +from cloudflare.types.cache import VariantGetResponse, VariantEditResponse, VariantDeleteResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -22,7 +22,7 @@ def test_method_delete(self, client: Cloudflare) -> None: variant = client.cache.variants.delete( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CacheVariant, variant, path=["response"]) + assert_matches_type(Optional[VariantDeleteResponse], variant, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -33,7 +33,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = response.parse() - assert_matches_type(CacheVariant, variant, path=["response"]) + assert_matches_type(Optional[VariantDeleteResponse], variant, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -44,7 +44,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = response.parse() - assert_matches_type(CacheVariant, variant, path=["response"]) + assert_matches_type(Optional[VariantDeleteResponse], variant, path=["response"]) assert cast(Any, response.is_closed) is True @@ -55,14 +55,16 @@ def test_path_params_delete(self, client: Cloudflare) -> None: zone_id="", ) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_method_edit(self, client: Cloudflare) -> None: variant = client.cache.variants.edit( zone_id="023e105f4ecef8ad9ca31a8372d0c353", value={}, ) - assert_matches_type(VariantEditResponse, variant, path=["response"]) + assert_matches_type(Optional[VariantEditResponse], variant, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_method_edit_with_all_params(self, client: Cloudflare) -> None: variant = client.cache.variants.edit( @@ -81,8 +83,9 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: "webp": ["image/jpeg", "image/avif"], }, ) - assert_matches_type(VariantEditResponse, variant, path=["response"]) + assert_matches_type(Optional[VariantEditResponse], variant, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: response = client.cache.variants.with_raw_response.edit( @@ -93,8 +96,9 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = response.parse() - assert_matches_type(VariantEditResponse, variant, path=["response"]) + assert_matches_type(Optional[VariantEditResponse], variant, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: with client.cache.variants.with_streaming_response.edit( @@ -105,10 +109,11 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = response.parse() - assert_matches_type(VariantEditResponse, variant, path=["response"]) + assert_matches_type(Optional[VariantEditResponse], variant, path=["response"]) assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_path_params_edit(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): @@ -117,13 +122,15 @@ def test_path_params_edit(self, client: Cloudflare) -> None: value={}, ) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_method_get(self, client: Cloudflare) -> None: variant = client.cache.variants.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(VariantGetResponse, variant, path=["response"]) + assert_matches_type(Optional[VariantGetResponse], variant, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: response = client.cache.variants.with_raw_response.get( @@ -133,8 +140,9 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = response.parse() - assert_matches_type(VariantGetResponse, variant, path=["response"]) + assert_matches_type(Optional[VariantGetResponse], variant, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: with client.cache.variants.with_streaming_response.get( @@ -144,10 +152,11 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = response.parse() - assert_matches_type(VariantGetResponse, variant, path=["response"]) + assert_matches_type(Optional[VariantGetResponse], variant, path=["response"]) assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): @@ -164,7 +173,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: variant = await async_client.cache.variants.delete( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CacheVariant, variant, path=["response"]) + assert_matches_type(Optional[VariantDeleteResponse], variant, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -175,7 +184,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = await response.parse() - assert_matches_type(CacheVariant, variant, path=["response"]) + assert_matches_type(Optional[VariantDeleteResponse], variant, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -186,7 +195,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = await response.parse() - assert_matches_type(CacheVariant, variant, path=["response"]) + assert_matches_type(Optional[VariantDeleteResponse], variant, path=["response"]) assert cast(Any, response.is_closed) is True @@ -197,14 +206,16 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: zone_id="", ) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_method_edit(self, async_client: AsyncCloudflare) -> None: variant = await async_client.cache.variants.edit( zone_id="023e105f4ecef8ad9ca31a8372d0c353", value={}, ) - assert_matches_type(VariantEditResponse, variant, path=["response"]) + assert_matches_type(Optional[VariantEditResponse], variant, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: variant = await async_client.cache.variants.edit( @@ -223,8 +234,9 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) "webp": ["image/jpeg", "image/avif"], }, ) - assert_matches_type(VariantEditResponse, variant, path=["response"]) + assert_matches_type(Optional[VariantEditResponse], variant, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: response = await async_client.cache.variants.with_raw_response.edit( @@ -235,8 +247,9 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = await response.parse() - assert_matches_type(VariantEditResponse, variant, path=["response"]) + assert_matches_type(Optional[VariantEditResponse], variant, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: async with async_client.cache.variants.with_streaming_response.edit( @@ -247,10 +260,11 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = await response.parse() - assert_matches_type(VariantEditResponse, variant, path=["response"]) + assert_matches_type(Optional[VariantEditResponse], variant, path=["response"]) assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): @@ -259,13 +273,15 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: value={}, ) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: variant = await async_client.cache.variants.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(VariantGetResponse, variant, path=["response"]) + assert_matches_type(Optional[VariantGetResponse], variant, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.cache.variants.with_raw_response.get( @@ -275,8 +291,9 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = await response.parse() - assert_matches_type(VariantGetResponse, variant, path=["response"]) + assert_matches_type(Optional[VariantGetResponse], variant, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.cache.variants.with_streaming_response.get( @@ -286,10 +303,11 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = await response.parse() - assert_matches_type(VariantGetResponse, variant, path=["response"]) + assert_matches_type(Optional[VariantGetResponse], variant, path=["response"]) assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): diff --git a/tests/api_resources/cloud_connector/test_rules.py b/tests/api_resources/cloud_connector/test_rules.py index 3516a2e2848..4c8dbcafd19 100644 --- a/tests/api_resources/cloud_connector/test_rules.py +++ b/tests/api_resources/cloud_connector/test_rules.py @@ -22,7 +22,7 @@ class TestRules: def test_method_update(self, client: Cloudflare) -> None: rule = client.cloud_connector.rules.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[{}], + rules=[{}], ) assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) @@ -30,7 +30,7 @@ def test_method_update(self, client: Cloudflare) -> None: def test_raw_response_update(self, client: Cloudflare) -> None: response = client.cloud_connector.rules.with_raw_response.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[{}], + rules=[{}], ) assert response.is_closed is True @@ -42,7 +42,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: def test_streaming_response_update(self, client: Cloudflare) -> None: with client.cloud_connector.rules.with_streaming_response.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[{}], + rules=[{}], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -57,7 +57,7 @@ def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.cloud_connector.rules.with_raw_response.update( zone_id="", - body=[{}], + rules=[{}], ) @parametrize @@ -106,7 +106,7 @@ class TestAsyncRules: async def test_method_update(self, async_client: AsyncCloudflare) -> None: rule = await async_client.cloud_connector.rules.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[{}], + rules=[{}], ) assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) @@ -114,7 +114,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloud_connector.rules.with_raw_response.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[{}], + rules=[{}], ) assert response.is_closed is True @@ -126,7 +126,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.cloud_connector.rules.with_streaming_response.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[{}], + rules=[{}], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -141,7 +141,7 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.cloud_connector.rules.with_raw_response.update( zone_id="", - body=[{}], + rules=[{}], ) @parametrize diff --git a/tests/api_resources/dns/test_records.py b/tests/api_resources/dns/test_records.py index aa64f3c8ac3..d66e3f1af77 100644 --- a/tests/api_resources/dns/test_records.py +++ b/tests/api_resources/dns/test_records.py @@ -10,15 +10,11 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types.dns import ( - RecordGetResponse, - RecordEditResponse, - RecordListResponse, + RecordResponse, RecordScanResponse, RecordBatchResponse, - RecordCreateResponse, RecordDeleteResponse, RecordImportResponse, - RecordUpdateResponse, ) from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray @@ -34,7 +30,7 @@ def test_method_create_overload_1(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -45,11 +41,15 @@ def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> N content="198.51.100.4", name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="A", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -61,7 +61,7 @@ def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -73,7 +73,7 @@ def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -91,7 +91,7 @@ def test_method_create_overload_2(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -102,11 +102,15 @@ def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> N content="2400:cb00:2049::1", name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="AAAA", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -118,7 +122,7 @@ def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -130,7 +134,7 @@ def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -148,7 +152,7 @@ def test_method_create_overload_3(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -163,11 +167,15 @@ def test_method_create_with_all_params_overload_3(self, client: Cloudflare) -> N }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="CAA", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -179,7 +187,7 @@ def test_raw_response_create_overload_3(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -191,7 +199,7 @@ def test_streaming_response_create_overload_3(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -209,7 +217,7 @@ def test_method_create_overload_4(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -225,11 +233,15 @@ def test_method_create_with_all_params_overload_4(self, client: Cloudflare) -> N }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="CERT", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -241,7 +253,7 @@ def test_raw_response_create_overload_4(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -253,7 +265,7 @@ def test_streaming_response_create_overload_4(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -271,7 +283,7 @@ def test_method_create_overload_5(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -282,12 +294,16 @@ def test_method_create_with_all_params_overload_5(self, client: Cloudflare) -> N content="content", name="example.com", proxied=True, - settings={"flatten_cname": True}, + settings={ + "flatten_cname": True, + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="CNAME", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -299,7 +315,7 @@ def test_raw_response_create_overload_5(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -311,7 +327,7 @@ def test_streaming_response_create_overload_5(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -329,7 +345,7 @@ def test_method_create_overload_6(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -345,11 +361,15 @@ def test_method_create_with_all_params_overload_6(self, client: Cloudflare) -> N }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="DNSKEY", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -361,7 +381,7 @@ def test_raw_response_create_overload_6(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -373,7 +393,7 @@ def test_streaming_response_create_overload_6(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -391,7 +411,7 @@ def test_method_create_overload_7(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -407,11 +427,15 @@ def test_method_create_with_all_params_overload_7(self, client: Cloudflare) -> N }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="DS", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -423,7 +447,7 @@ def test_raw_response_create_overload_7(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -435,7 +459,7 @@ def test_streaming_response_create_overload_7(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -453,7 +477,7 @@ def test_method_create_overload_8(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -468,11 +492,15 @@ def test_method_create_with_all_params_overload_8(self, client: Cloudflare) -> N }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="HTTPS", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -484,7 +512,7 @@ def test_raw_response_create_overload_8(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -496,7 +524,7 @@ def test_streaming_response_create_overload_8(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -514,7 +542,7 @@ def test_method_create_overload_9(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -538,11 +566,15 @@ def test_method_create_with_all_params_overload_9(self, client: Cloudflare) -> N }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="LOC", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -554,7 +586,7 @@ def test_raw_response_create_overload_9(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -566,7 +598,7 @@ def test_streaming_response_create_overload_9(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -584,7 +616,7 @@ def test_method_create_overload_10(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -596,11 +628,15 @@ def test_method_create_with_all_params_overload_10(self, client: Cloudflare) -> name="example.com", priority=10, proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="MX", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -612,7 +648,7 @@ def test_raw_response_create_overload_10(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -624,7 +660,7 @@ def test_streaming_response_create_overload_10(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -642,7 +678,7 @@ def test_method_create_overload_11(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -660,11 +696,15 @@ def test_method_create_with_all_params_overload_11(self, client: Cloudflare) -> }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="NAPTR", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -676,7 +716,7 @@ def test_raw_response_create_overload_11(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -688,7 +728,7 @@ def test_streaming_response_create_overload_11(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -706,7 +746,7 @@ def test_method_create_overload_12(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -717,11 +757,15 @@ def test_method_create_with_all_params_overload_12(self, client: Cloudflare) -> content="ns1.example.com", name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="NS", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -733,7 +777,7 @@ def test_raw_response_create_overload_12(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -745,7 +789,7 @@ def test_streaming_response_create_overload_12(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -763,7 +807,7 @@ def test_method_create_overload_13(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -774,11 +818,15 @@ def test_method_create_with_all_params_overload_13(self, client: Cloudflare) -> content="content", name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="OPENPGPKEY", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -790,7 +838,7 @@ def test_raw_response_create_overload_13(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -802,7 +850,7 @@ def test_streaming_response_create_overload_13(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -820,7 +868,7 @@ def test_method_create_overload_14(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -831,11 +879,15 @@ def test_method_create_with_all_params_overload_14(self, client: Cloudflare) -> content="example.com", name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="PTR", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -847,7 +899,7 @@ def test_raw_response_create_overload_14(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -859,7 +911,7 @@ def test_streaming_response_create_overload_14(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -877,7 +929,7 @@ def test_method_create_overload_15(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -893,11 +945,15 @@ def test_method_create_with_all_params_overload_15(self, client: Cloudflare) -> }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="SMIMEA", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -909,7 +965,7 @@ def test_raw_response_create_overload_15(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -921,7 +977,7 @@ def test_streaming_response_create_overload_15(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -939,7 +995,7 @@ def test_method_create_overload_16(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -955,11 +1011,15 @@ def test_method_create_with_all_params_overload_16(self, client: Cloudflare) -> }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="SRV", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -971,7 +1031,7 @@ def test_raw_response_create_overload_16(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -983,7 +1043,7 @@ def test_streaming_response_create_overload_16(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1001,7 +1061,7 @@ def test_method_create_overload_17(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1016,11 +1076,15 @@ def test_method_create_with_all_params_overload_17(self, client: Cloudflare) -> }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="SSHFP", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1032,7 +1096,7 @@ def test_raw_response_create_overload_17(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1044,7 +1108,7 @@ def test_streaming_response_create_overload_17(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1062,7 +1126,7 @@ def test_method_create_overload_18(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1077,11 +1141,15 @@ def test_method_create_with_all_params_overload_18(self, client: Cloudflare) -> }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="SVCB", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1093,7 +1161,7 @@ def test_raw_response_create_overload_18(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1105,7 +1173,7 @@ def test_streaming_response_create_overload_18(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1123,7 +1191,7 @@ def test_method_create_overload_19(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1139,11 +1207,15 @@ def test_method_create_with_all_params_overload_19(self, client: Cloudflare) -> }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="TLSA", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1155,7 +1227,7 @@ def test_raw_response_create_overload_19(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1167,7 +1239,7 @@ def test_streaming_response_create_overload_19(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1185,7 +1257,7 @@ def test_method_create_overload_20(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1196,11 +1268,15 @@ def test_method_create_with_all_params_overload_20(self, client: Cloudflare) -> content='"v=spf1 include:example.com -all"', name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="TXT", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1212,7 +1288,7 @@ def test_raw_response_create_overload_20(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1224,7 +1300,7 @@ def test_streaming_response_create_overload_20(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1242,7 +1318,7 @@ def test_method_create_overload_21(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1257,11 +1333,15 @@ def test_method_create_with_all_params_overload_21(self, client: Cloudflare) -> name="example.com", priority=10, proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="URI", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1273,7 +1353,7 @@ def test_raw_response_create_overload_21(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1285,7 +1365,7 @@ def test_streaming_response_create_overload_21(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1304,7 +1384,7 @@ def test_method_update_overload_1(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1316,11 +1396,15 @@ def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> N content="198.51.100.4", name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="A", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1333,7 +1417,7 @@ def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1346,7 +1430,7 @@ def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1372,7 +1456,7 @@ def test_method_update_overload_2(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1384,11 +1468,15 @@ def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> N content="2400:cb00:2049::1", name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="AAAA", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1401,7 +1489,7 @@ def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1414,7 +1502,7 @@ def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1440,7 +1528,7 @@ def test_method_update_overload_3(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1456,11 +1544,15 @@ def test_method_update_with_all_params_overload_3(self, client: Cloudflare) -> N }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="CAA", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1473,7 +1565,7 @@ def test_raw_response_update_overload_3(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1486,7 +1578,7 @@ def test_streaming_response_update_overload_3(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1512,7 +1604,7 @@ def test_method_update_overload_4(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1529,11 +1621,15 @@ def test_method_update_with_all_params_overload_4(self, client: Cloudflare) -> N }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="CERT", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1546,7 +1642,7 @@ def test_raw_response_update_overload_4(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1559,7 +1655,7 @@ def test_streaming_response_update_overload_4(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1585,7 +1681,7 @@ def test_method_update_overload_5(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1597,12 +1693,16 @@ def test_method_update_with_all_params_overload_5(self, client: Cloudflare) -> N content="content", name="example.com", proxied=True, - settings={"flatten_cname": True}, + settings={ + "flatten_cname": True, + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="CNAME", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1615,7 +1715,7 @@ def test_raw_response_update_overload_5(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1628,7 +1728,7 @@ def test_streaming_response_update_overload_5(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1654,7 +1754,7 @@ def test_method_update_overload_6(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1671,11 +1771,15 @@ def test_method_update_with_all_params_overload_6(self, client: Cloudflare) -> N }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="DNSKEY", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1688,7 +1792,7 @@ def test_raw_response_update_overload_6(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1701,7 +1805,7 @@ def test_streaming_response_update_overload_6(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1727,7 +1831,7 @@ def test_method_update_overload_7(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1744,11 +1848,15 @@ def test_method_update_with_all_params_overload_7(self, client: Cloudflare) -> N }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="DS", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1761,7 +1869,7 @@ def test_raw_response_update_overload_7(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1774,7 +1882,7 @@ def test_streaming_response_update_overload_7(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1800,7 +1908,7 @@ def test_method_update_overload_8(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1816,11 +1924,15 @@ def test_method_update_with_all_params_overload_8(self, client: Cloudflare) -> N }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="HTTPS", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1833,7 +1945,7 @@ def test_raw_response_update_overload_8(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1846,7 +1958,7 @@ def test_streaming_response_update_overload_8(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1872,7 +1984,7 @@ def test_method_update_overload_9(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1897,11 +2009,15 @@ def test_method_update_with_all_params_overload_9(self, client: Cloudflare) -> N }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="LOC", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1914,7 +2030,7 @@ def test_raw_response_update_overload_9(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1927,7 +2043,7 @@ def test_streaming_response_update_overload_9(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1953,7 +2069,7 @@ def test_method_update_overload_10(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1966,11 +2082,15 @@ def test_method_update_with_all_params_overload_10(self, client: Cloudflare) -> name="example.com", priority=10, proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="MX", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1983,7 +2103,7 @@ def test_raw_response_update_overload_10(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1996,7 +2116,7 @@ def test_streaming_response_update_overload_10(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2022,7 +2142,7 @@ def test_method_update_overload_11(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2041,11 +2161,15 @@ def test_method_update_with_all_params_overload_11(self, client: Cloudflare) -> }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="NAPTR", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2058,7 +2182,7 @@ def test_raw_response_update_overload_11(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2071,7 +2195,7 @@ def test_streaming_response_update_overload_11(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2097,7 +2221,7 @@ def test_method_update_overload_12(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2109,11 +2233,15 @@ def test_method_update_with_all_params_overload_12(self, client: Cloudflare) -> content="ns1.example.com", name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="NS", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2126,7 +2254,7 @@ def test_raw_response_update_overload_12(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2139,7 +2267,7 @@ def test_streaming_response_update_overload_12(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2165,7 +2293,7 @@ def test_method_update_overload_13(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2177,11 +2305,15 @@ def test_method_update_with_all_params_overload_13(self, client: Cloudflare) -> content="content", name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="OPENPGPKEY", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2194,7 +2326,7 @@ def test_raw_response_update_overload_13(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2207,7 +2339,7 @@ def test_streaming_response_update_overload_13(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2233,7 +2365,7 @@ def test_method_update_overload_14(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2245,11 +2377,15 @@ def test_method_update_with_all_params_overload_14(self, client: Cloudflare) -> content="example.com", name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="PTR", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2262,7 +2398,7 @@ def test_raw_response_update_overload_14(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2275,7 +2411,7 @@ def test_streaming_response_update_overload_14(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2301,7 +2437,7 @@ def test_method_update_overload_15(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2318,11 +2454,15 @@ def test_method_update_with_all_params_overload_15(self, client: Cloudflare) -> }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="SMIMEA", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2335,7 +2475,7 @@ def test_raw_response_update_overload_15(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2348,7 +2488,7 @@ def test_streaming_response_update_overload_15(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2374,7 +2514,7 @@ def test_method_update_overload_16(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2391,11 +2531,15 @@ def test_method_update_with_all_params_overload_16(self, client: Cloudflare) -> }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="SRV", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2408,7 +2552,7 @@ def test_raw_response_update_overload_16(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2421,7 +2565,7 @@ def test_streaming_response_update_overload_16(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2447,7 +2591,7 @@ def test_method_update_overload_17(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2463,11 +2607,15 @@ def test_method_update_with_all_params_overload_17(self, client: Cloudflare) -> }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="SSHFP", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2480,7 +2628,7 @@ def test_raw_response_update_overload_17(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2493,7 +2641,7 @@ def test_streaming_response_update_overload_17(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2519,7 +2667,7 @@ def test_method_update_overload_18(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2535,11 +2683,15 @@ def test_method_update_with_all_params_overload_18(self, client: Cloudflare) -> }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="SVCB", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2552,7 +2704,7 @@ def test_raw_response_update_overload_18(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2565,7 +2717,7 @@ def test_streaming_response_update_overload_18(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2591,7 +2743,7 @@ def test_method_update_overload_19(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2608,11 +2760,15 @@ def test_method_update_with_all_params_overload_19(self, client: Cloudflare) -> }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="TLSA", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2625,7 +2781,7 @@ def test_raw_response_update_overload_19(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2638,7 +2794,7 @@ def test_streaming_response_update_overload_19(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2664,7 +2820,7 @@ def test_method_update_overload_20(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2676,11 +2832,15 @@ def test_method_update_with_all_params_overload_20(self, client: Cloudflare) -> content='"v=spf1 include:example.com -all"', name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="TXT", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2693,7 +2853,7 @@ def test_raw_response_update_overload_20(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2706,7 +2866,7 @@ def test_streaming_response_update_overload_20(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2732,7 +2892,7 @@ def test_method_update_overload_21(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2748,11 +2908,15 @@ def test_method_update_with_all_params_overload_21(self, client: Cloudflare) -> name="example.com", priority=10, proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="URI", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2765,7 +2929,7 @@ def test_raw_response_update_overload_21(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -2778,7 +2942,7 @@ def test_streaming_response_update_overload_21(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2797,13 +2961,15 @@ def test_path_params_update_overload_21(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) + @pytest.mark.skip(reason="mock server returns invalid data") @parametrize def test_method_list(self, client: Cloudflare) -> None: record = client.dns.records.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncV4PagePaginationArray[RecordListResponse], record, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[RecordResponse], record, path=["response"]) + @pytest.mark.skip(reason="mock server returns invalid data") @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: record = client.dns.records.list( @@ -2846,8 +3012,9 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: tag_match="any", type="A", ) - assert_matches_type(SyncV4PagePaginationArray[RecordListResponse], record, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[RecordResponse], record, path=["response"]) + @pytest.mark.skip(reason="mock server returns invalid data") @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.list( @@ -2857,8 +3024,9 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(SyncV4PagePaginationArray[RecordListResponse], record, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[RecordResponse], record, path=["response"]) + @pytest.mark.skip(reason="mock server returns invalid data") @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.list( @@ -2868,10 +3036,11 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(SyncV4PagePaginationArray[RecordListResponse], record, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="mock server returns invalid data") @parametrize def test_path_params_list(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): @@ -2947,6 +3116,10 @@ def test_method_batch_with_all_params(self, client: Cloudflare) -> None: "content": "198.51.100.4", "name": "example.com", "proxied": True, + "settings": { + "ipv4_only": True, + "ipv6_only": True, + }, "tags": ["owner:dns-team"], "ttl": 3600, "type": "A", @@ -2959,6 +3132,10 @@ def test_method_batch_with_all_params(self, client: Cloudflare) -> None: "content": "198.51.100.4", "name": "example.com", "proxied": True, + "settings": { + "ipv4_only": True, + "ipv6_only": True, + }, "tags": ["owner:dns-team"], "ttl": 3600, "type": "A", @@ -2970,6 +3147,10 @@ def test_method_batch_with_all_params(self, client: Cloudflare) -> None: "content": "198.51.100.4", "name": "example.com", "proxied": True, + "settings": { + "ipv4_only": True, + "ipv6_only": True, + }, "tags": ["owner:dns-team"], "ttl": 3600, "type": "A", @@ -3020,7 +3201,7 @@ def test_method_edit_overload_1(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3032,11 +3213,15 @@ def test_method_edit_with_all_params_overload_1(self, client: Cloudflare) -> Non content="198.51.100.4", name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="A", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3049,7 +3234,7 @@ def test_raw_response_edit_overload_1(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3062,7 +3247,7 @@ def test_streaming_response_edit_overload_1(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3088,7 +3273,7 @@ def test_method_edit_overload_2(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3100,11 +3285,15 @@ def test_method_edit_with_all_params_overload_2(self, client: Cloudflare) -> Non content="2400:cb00:2049::1", name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="AAAA", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3117,7 +3306,7 @@ def test_raw_response_edit_overload_2(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3130,7 +3319,7 @@ def test_streaming_response_edit_overload_2(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3156,7 +3345,7 @@ def test_method_edit_overload_3(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3172,11 +3361,15 @@ def test_method_edit_with_all_params_overload_3(self, client: Cloudflare) -> Non }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="CAA", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3189,7 +3382,7 @@ def test_raw_response_edit_overload_3(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3202,7 +3395,7 @@ def test_streaming_response_edit_overload_3(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3228,7 +3421,7 @@ def test_method_edit_overload_4(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3245,11 +3438,15 @@ def test_method_edit_with_all_params_overload_4(self, client: Cloudflare) -> Non }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="CERT", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3262,7 +3459,7 @@ def test_raw_response_edit_overload_4(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3275,7 +3472,7 @@ def test_streaming_response_edit_overload_4(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3301,7 +3498,7 @@ def test_method_edit_overload_5(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3313,12 +3510,16 @@ def test_method_edit_with_all_params_overload_5(self, client: Cloudflare) -> Non content="content", name="example.com", proxied=True, - settings={"flatten_cname": True}, + settings={ + "flatten_cname": True, + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="CNAME", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3331,7 +3532,7 @@ def test_raw_response_edit_overload_5(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3344,7 +3545,7 @@ def test_streaming_response_edit_overload_5(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3370,7 +3571,7 @@ def test_method_edit_overload_6(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3387,11 +3588,15 @@ def test_method_edit_with_all_params_overload_6(self, client: Cloudflare) -> Non }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="DNSKEY", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3404,7 +3609,7 @@ def test_raw_response_edit_overload_6(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3417,7 +3622,7 @@ def test_streaming_response_edit_overload_6(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3443,7 +3648,7 @@ def test_method_edit_overload_7(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3460,11 +3665,15 @@ def test_method_edit_with_all_params_overload_7(self, client: Cloudflare) -> Non }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="DS", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3477,7 +3686,7 @@ def test_raw_response_edit_overload_7(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3490,7 +3699,7 @@ def test_streaming_response_edit_overload_7(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3516,7 +3725,7 @@ def test_method_edit_overload_8(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3532,11 +3741,15 @@ def test_method_edit_with_all_params_overload_8(self, client: Cloudflare) -> Non }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="HTTPS", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3549,7 +3762,7 @@ def test_raw_response_edit_overload_8(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3562,7 +3775,7 @@ def test_streaming_response_edit_overload_8(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3588,7 +3801,7 @@ def test_method_edit_overload_9(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3613,11 +3826,15 @@ def test_method_edit_with_all_params_overload_9(self, client: Cloudflare) -> Non }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="LOC", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3630,7 +3847,7 @@ def test_raw_response_edit_overload_9(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3643,7 +3860,7 @@ def test_streaming_response_edit_overload_9(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3669,7 +3886,7 @@ def test_method_edit_overload_10(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3682,11 +3899,15 @@ def test_method_edit_with_all_params_overload_10(self, client: Cloudflare) -> No name="example.com", priority=10, proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="MX", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3699,7 +3920,7 @@ def test_raw_response_edit_overload_10(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3712,7 +3933,7 @@ def test_streaming_response_edit_overload_10(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3738,7 +3959,7 @@ def test_method_edit_overload_11(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3757,11 +3978,15 @@ def test_method_edit_with_all_params_overload_11(self, client: Cloudflare) -> No }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="NAPTR", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3774,7 +3999,7 @@ def test_raw_response_edit_overload_11(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3787,7 +4012,7 @@ def test_streaming_response_edit_overload_11(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3813,7 +4038,7 @@ def test_method_edit_overload_12(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3825,11 +4050,15 @@ def test_method_edit_with_all_params_overload_12(self, client: Cloudflare) -> No content="ns1.example.com", name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="NS", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3842,7 +4071,7 @@ def test_raw_response_edit_overload_12(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3855,7 +4084,7 @@ def test_streaming_response_edit_overload_12(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3881,7 +4110,7 @@ def test_method_edit_overload_13(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3893,11 +4122,15 @@ def test_method_edit_with_all_params_overload_13(self, client: Cloudflare) -> No content="content", name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="OPENPGPKEY", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3910,7 +4143,7 @@ def test_raw_response_edit_overload_13(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3923,7 +4156,7 @@ def test_streaming_response_edit_overload_13(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3949,7 +4182,7 @@ def test_method_edit_overload_14(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3961,11 +4194,15 @@ def test_method_edit_with_all_params_overload_14(self, client: Cloudflare) -> No content="example.com", name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="PTR", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3978,7 +4215,7 @@ def test_raw_response_edit_overload_14(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -3991,7 +4228,7 @@ def test_streaming_response_edit_overload_14(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4017,7 +4254,7 @@ def test_method_edit_overload_15(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4034,11 +4271,15 @@ def test_method_edit_with_all_params_overload_15(self, client: Cloudflare) -> No }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="SMIMEA", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4051,7 +4292,7 @@ def test_raw_response_edit_overload_15(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4064,7 +4305,7 @@ def test_streaming_response_edit_overload_15(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4090,7 +4331,7 @@ def test_method_edit_overload_16(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4107,11 +4348,15 @@ def test_method_edit_with_all_params_overload_16(self, client: Cloudflare) -> No }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="SRV", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4124,7 +4369,7 @@ def test_raw_response_edit_overload_16(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4137,7 +4382,7 @@ def test_streaming_response_edit_overload_16(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4163,7 +4408,7 @@ def test_method_edit_overload_17(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4179,11 +4424,15 @@ def test_method_edit_with_all_params_overload_17(self, client: Cloudflare) -> No }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="SSHFP", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4196,7 +4445,7 @@ def test_raw_response_edit_overload_17(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4209,7 +4458,7 @@ def test_streaming_response_edit_overload_17(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4235,7 +4484,7 @@ def test_method_edit_overload_18(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4251,11 +4500,15 @@ def test_method_edit_with_all_params_overload_18(self, client: Cloudflare) -> No }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="SVCB", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4268,7 +4521,7 @@ def test_raw_response_edit_overload_18(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4281,7 +4534,7 @@ def test_streaming_response_edit_overload_18(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4307,7 +4560,7 @@ def test_method_edit_overload_19(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4324,11 +4577,15 @@ def test_method_edit_with_all_params_overload_19(self, client: Cloudflare) -> No }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="TLSA", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4341,7 +4598,7 @@ def test_raw_response_edit_overload_19(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4354,7 +4611,7 @@ def test_streaming_response_edit_overload_19(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4380,7 +4637,7 @@ def test_method_edit_overload_20(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4392,11 +4649,15 @@ def test_method_edit_with_all_params_overload_20(self, client: Cloudflare) -> No content='"v=spf1 include:example.com -all"', name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="TXT", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4409,7 +4670,7 @@ def test_raw_response_edit_overload_20(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4422,7 +4683,7 @@ def test_streaming_response_edit_overload_20(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4448,7 +4709,7 @@ def test_method_edit_overload_21(self, client: Cloudflare) -> None: dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4464,11 +4725,15 @@ def test_method_edit_with_all_params_overload_21(self, client: Cloudflare) -> No name="example.com", priority=10, proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="URI", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4481,7 +4746,7 @@ def test_raw_response_edit_overload_21(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4494,7 +4759,7 @@ def test_streaming_response_edit_overload_21(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4551,14 +4816,16 @@ def test_path_params_export(self, client: Cloudflare) -> None: zone_id="", ) + @pytest.mark.skip(reason="mock server returns invalid data") @parametrize def test_method_get(self, client: Cloudflare) -> None: record = client.dns.records.get( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordGetResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) + @pytest.mark.skip(reason="mock server returns invalid data") @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.get( @@ -4569,8 +4836,9 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordGetResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) + @pytest.mark.skip(reason="mock server returns invalid data") @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.get( @@ -4581,10 +4849,11 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordGetResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="mock server returns invalid data") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): @@ -4707,7 +4976,7 @@ async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4718,11 +4987,15 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn content="198.51.100.4", name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="A", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4734,7 +5007,7 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4746,7 +5019,7 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4764,7 +5037,7 @@ async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4775,11 +5048,15 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn content="2400:cb00:2049::1", name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="AAAA", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4791,7 +5068,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4803,7 +5080,7 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4821,7 +5098,7 @@ async def test_method_create_overload_3(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4836,11 +5113,15 @@ async def test_method_create_with_all_params_overload_3(self, async_client: Asyn }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="CAA", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4852,7 +5133,7 @@ async def test_raw_response_create_overload_3(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4864,7 +5145,7 @@ async def test_streaming_response_create_overload_3(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4882,7 +5163,7 @@ async def test_method_create_overload_4(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4898,11 +5179,15 @@ async def test_method_create_with_all_params_overload_4(self, async_client: Asyn }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="CERT", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4914,7 +5199,7 @@ async def test_raw_response_create_overload_4(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4926,7 +5211,7 @@ async def test_streaming_response_create_overload_4(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4944,7 +5229,7 @@ async def test_method_create_overload_5(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4955,12 +5240,16 @@ async def test_method_create_with_all_params_overload_5(self, async_client: Asyn content="content", name="example.com", proxied=True, - settings={"flatten_cname": True}, + settings={ + "flatten_cname": True, + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="CNAME", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4972,7 +5261,7 @@ async def test_raw_response_create_overload_5(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -4984,7 +5273,7 @@ async def test_streaming_response_create_overload_5(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5002,7 +5291,7 @@ async def test_method_create_overload_6(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5018,11 +5307,15 @@ async def test_method_create_with_all_params_overload_6(self, async_client: Asyn }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="DNSKEY", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5034,7 +5327,7 @@ async def test_raw_response_create_overload_6(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5046,7 +5339,7 @@ async def test_streaming_response_create_overload_6(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5064,7 +5357,7 @@ async def test_method_create_overload_7(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5080,11 +5373,15 @@ async def test_method_create_with_all_params_overload_7(self, async_client: Asyn }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="DS", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5096,7 +5393,7 @@ async def test_raw_response_create_overload_7(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5108,7 +5405,7 @@ async def test_streaming_response_create_overload_7(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5126,7 +5423,7 @@ async def test_method_create_overload_8(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5141,11 +5438,15 @@ async def test_method_create_with_all_params_overload_8(self, async_client: Asyn }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="HTTPS", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5157,7 +5458,7 @@ async def test_raw_response_create_overload_8(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5169,7 +5470,7 @@ async def test_streaming_response_create_overload_8(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5187,7 +5488,7 @@ async def test_method_create_overload_9(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5211,11 +5512,15 @@ async def test_method_create_with_all_params_overload_9(self, async_client: Asyn }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="LOC", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5227,7 +5532,7 @@ async def test_raw_response_create_overload_9(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5239,7 +5544,7 @@ async def test_streaming_response_create_overload_9(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5257,7 +5562,7 @@ async def test_method_create_overload_10(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5269,11 +5574,15 @@ async def test_method_create_with_all_params_overload_10(self, async_client: Asy name="example.com", priority=10, proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="MX", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5285,7 +5594,7 @@ async def test_raw_response_create_overload_10(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5297,7 +5606,7 @@ async def test_streaming_response_create_overload_10(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5315,7 +5624,7 @@ async def test_method_create_overload_11(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5333,11 +5642,15 @@ async def test_method_create_with_all_params_overload_11(self, async_client: Asy }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="NAPTR", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5349,7 +5662,7 @@ async def test_raw_response_create_overload_11(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5361,7 +5674,7 @@ async def test_streaming_response_create_overload_11(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5379,7 +5692,7 @@ async def test_method_create_overload_12(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5390,11 +5703,15 @@ async def test_method_create_with_all_params_overload_12(self, async_client: Asy content="ns1.example.com", name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="NS", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5406,7 +5723,7 @@ async def test_raw_response_create_overload_12(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5418,7 +5735,7 @@ async def test_streaming_response_create_overload_12(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5436,7 +5753,7 @@ async def test_method_create_overload_13(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5447,11 +5764,15 @@ async def test_method_create_with_all_params_overload_13(self, async_client: Asy content="content", name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="OPENPGPKEY", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5463,7 +5784,7 @@ async def test_raw_response_create_overload_13(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5475,7 +5796,7 @@ async def test_streaming_response_create_overload_13(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5493,7 +5814,7 @@ async def test_method_create_overload_14(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5504,11 +5825,15 @@ async def test_method_create_with_all_params_overload_14(self, async_client: Asy content="example.com", name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="PTR", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5520,7 +5845,7 @@ async def test_raw_response_create_overload_14(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5532,7 +5857,7 @@ async def test_streaming_response_create_overload_14(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5550,7 +5875,7 @@ async def test_method_create_overload_15(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5566,11 +5891,15 @@ async def test_method_create_with_all_params_overload_15(self, async_client: Asy }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="SMIMEA", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5582,7 +5911,7 @@ async def test_raw_response_create_overload_15(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5594,7 +5923,7 @@ async def test_streaming_response_create_overload_15(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5612,7 +5941,7 @@ async def test_method_create_overload_16(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5628,11 +5957,15 @@ async def test_method_create_with_all_params_overload_16(self, async_client: Asy }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="SRV", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5644,7 +5977,7 @@ async def test_raw_response_create_overload_16(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5656,7 +5989,7 @@ async def test_streaming_response_create_overload_16(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5674,7 +6007,7 @@ async def test_method_create_overload_17(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5689,11 +6022,15 @@ async def test_method_create_with_all_params_overload_17(self, async_client: Asy }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="SSHFP", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5705,7 +6042,7 @@ async def test_raw_response_create_overload_17(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5717,7 +6054,7 @@ async def test_streaming_response_create_overload_17(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5735,7 +6072,7 @@ async def test_method_create_overload_18(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5750,11 +6087,15 @@ async def test_method_create_with_all_params_overload_18(self, async_client: Asy }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="SVCB", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5766,7 +6107,7 @@ async def test_raw_response_create_overload_18(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5778,7 +6119,7 @@ async def test_streaming_response_create_overload_18(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5796,7 +6137,7 @@ async def test_method_create_overload_19(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5812,11 +6153,15 @@ async def test_method_create_with_all_params_overload_19(self, async_client: Asy }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="TLSA", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5828,7 +6173,7 @@ async def test_raw_response_create_overload_19(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5840,7 +6185,7 @@ async def test_streaming_response_create_overload_19(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5858,7 +6203,7 @@ async def test_method_create_overload_20(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5869,11 +6214,15 @@ async def test_method_create_with_all_params_overload_20(self, async_client: Asy content='"v=spf1 include:example.com -all"', name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="TXT", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5885,7 +6234,7 @@ async def test_raw_response_create_overload_20(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5897,7 +6246,7 @@ async def test_streaming_response_create_overload_20(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5915,7 +6264,7 @@ async def test_method_create_overload_21(self, async_client: AsyncCloudflare) -> record = await async_client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5930,11 +6279,15 @@ async def test_method_create_with_all_params_overload_21(self, async_client: Asy name="example.com", priority=10, proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="URI", ) - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5946,7 +6299,7 @@ async def test_raw_response_create_overload_21(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5958,7 +6311,7 @@ async def test_streaming_response_create_overload_21(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordCreateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5977,7 +6330,7 @@ async def test_method_update_overload_1(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -5989,11 +6342,15 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn content="198.51.100.4", name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="A", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6006,7 +6363,7 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6019,7 +6376,7 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -6045,7 +6402,7 @@ async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6057,11 +6414,15 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn content="2400:cb00:2049::1", name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="AAAA", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6074,7 +6435,7 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6087,7 +6448,7 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -6113,7 +6474,7 @@ async def test_method_update_overload_3(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6129,11 +6490,15 @@ async def test_method_update_with_all_params_overload_3(self, async_client: Asyn }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="CAA", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6146,7 +6511,7 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6159,7 +6524,7 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -6185,7 +6550,7 @@ async def test_method_update_overload_4(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6202,11 +6567,15 @@ async def test_method_update_with_all_params_overload_4(self, async_client: Asyn }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="CERT", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6219,7 +6588,7 @@ async def test_raw_response_update_overload_4(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6232,7 +6601,7 @@ async def test_streaming_response_update_overload_4(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -6258,7 +6627,7 @@ async def test_method_update_overload_5(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6270,12 +6639,16 @@ async def test_method_update_with_all_params_overload_5(self, async_client: Asyn content="content", name="example.com", proxied=True, - settings={"flatten_cname": True}, + settings={ + "flatten_cname": True, + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="CNAME", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6288,7 +6661,7 @@ async def test_raw_response_update_overload_5(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6301,7 +6674,7 @@ async def test_streaming_response_update_overload_5(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -6327,7 +6700,7 @@ async def test_method_update_overload_6(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6344,11 +6717,15 @@ async def test_method_update_with_all_params_overload_6(self, async_client: Asyn }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="DNSKEY", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6361,7 +6738,7 @@ async def test_raw_response_update_overload_6(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6374,7 +6751,7 @@ async def test_streaming_response_update_overload_6(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -6400,7 +6777,7 @@ async def test_method_update_overload_7(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6417,11 +6794,15 @@ async def test_method_update_with_all_params_overload_7(self, async_client: Asyn }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="DS", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6434,7 +6815,7 @@ async def test_raw_response_update_overload_7(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6447,7 +6828,7 @@ async def test_streaming_response_update_overload_7(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -6473,7 +6854,7 @@ async def test_method_update_overload_8(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6489,11 +6870,15 @@ async def test_method_update_with_all_params_overload_8(self, async_client: Asyn }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="HTTPS", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6506,7 +6891,7 @@ async def test_raw_response_update_overload_8(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6519,7 +6904,7 @@ async def test_streaming_response_update_overload_8(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -6545,7 +6930,7 @@ async def test_method_update_overload_9(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6570,11 +6955,15 @@ async def test_method_update_with_all_params_overload_9(self, async_client: Asyn }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="LOC", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6587,7 +6976,7 @@ async def test_raw_response_update_overload_9(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6600,7 +6989,7 @@ async def test_streaming_response_update_overload_9(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -6626,7 +7015,7 @@ async def test_method_update_overload_10(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6639,11 +7028,15 @@ async def test_method_update_with_all_params_overload_10(self, async_client: Asy name="example.com", priority=10, proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="MX", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6656,7 +7049,7 @@ async def test_raw_response_update_overload_10(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6669,7 +7062,7 @@ async def test_streaming_response_update_overload_10(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -6695,7 +7088,7 @@ async def test_method_update_overload_11(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6714,11 +7107,15 @@ async def test_method_update_with_all_params_overload_11(self, async_client: Asy }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="NAPTR", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6731,7 +7128,7 @@ async def test_raw_response_update_overload_11(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6744,7 +7141,7 @@ async def test_streaming_response_update_overload_11(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -6770,7 +7167,7 @@ async def test_method_update_overload_12(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6782,11 +7179,15 @@ async def test_method_update_with_all_params_overload_12(self, async_client: Asy content="ns1.example.com", name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="NS", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6799,7 +7200,7 @@ async def test_raw_response_update_overload_12(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6812,7 +7213,7 @@ async def test_streaming_response_update_overload_12(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -6838,7 +7239,7 @@ async def test_method_update_overload_13(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6850,11 +7251,15 @@ async def test_method_update_with_all_params_overload_13(self, async_client: Asy content="content", name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="OPENPGPKEY", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6867,7 +7272,7 @@ async def test_raw_response_update_overload_13(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6880,7 +7285,7 @@ async def test_streaming_response_update_overload_13(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -6906,7 +7311,7 @@ async def test_method_update_overload_14(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6918,11 +7323,15 @@ async def test_method_update_with_all_params_overload_14(self, async_client: Asy content="example.com", name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="PTR", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6935,7 +7344,7 @@ async def test_raw_response_update_overload_14(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6948,7 +7357,7 @@ async def test_streaming_response_update_overload_14(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -6974,7 +7383,7 @@ async def test_method_update_overload_15(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -6991,11 +7400,15 @@ async def test_method_update_with_all_params_overload_15(self, async_client: Asy }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="SMIMEA", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7008,7 +7421,7 @@ async def test_raw_response_update_overload_15(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7021,7 +7434,7 @@ async def test_streaming_response_update_overload_15(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -7047,7 +7460,7 @@ async def test_method_update_overload_16(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7064,11 +7477,15 @@ async def test_method_update_with_all_params_overload_16(self, async_client: Asy }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="SRV", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7081,7 +7498,7 @@ async def test_raw_response_update_overload_16(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7094,7 +7511,7 @@ async def test_streaming_response_update_overload_16(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -7120,7 +7537,7 @@ async def test_method_update_overload_17(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7136,11 +7553,15 @@ async def test_method_update_with_all_params_overload_17(self, async_client: Asy }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="SSHFP", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7153,7 +7574,7 @@ async def test_raw_response_update_overload_17(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7166,7 +7587,7 @@ async def test_streaming_response_update_overload_17(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -7192,7 +7613,7 @@ async def test_method_update_overload_18(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7208,11 +7629,15 @@ async def test_method_update_with_all_params_overload_18(self, async_client: Asy }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="SVCB", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7225,7 +7650,7 @@ async def test_raw_response_update_overload_18(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7238,7 +7663,7 @@ async def test_streaming_response_update_overload_18(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -7264,7 +7689,7 @@ async def test_method_update_overload_19(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7281,11 +7706,15 @@ async def test_method_update_with_all_params_overload_19(self, async_client: Asy }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="TLSA", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7298,7 +7727,7 @@ async def test_raw_response_update_overload_19(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7311,7 +7740,7 @@ async def test_streaming_response_update_overload_19(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -7337,7 +7766,7 @@ async def test_method_update_overload_20(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7349,11 +7778,15 @@ async def test_method_update_with_all_params_overload_20(self, async_client: Asy content='"v=spf1 include:example.com -all"', name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="TXT", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7366,7 +7799,7 @@ async def test_raw_response_update_overload_20(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7379,7 +7812,7 @@ async def test_streaming_response_update_overload_20(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -7405,7 +7838,7 @@ async def test_method_update_overload_21(self, async_client: AsyncCloudflare) -> dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7421,11 +7854,15 @@ async def test_method_update_with_all_params_overload_21(self, async_client: Asy name="example.com", priority=10, proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="URI", ) - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7438,7 +7875,7 @@ async def test_raw_response_update_overload_21(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7451,7 +7888,7 @@ async def test_streaming_response_update_overload_21(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordUpdateResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -7470,13 +7907,15 @@ async def test_path_params_update_overload_21(self, async_client: AsyncCloudflar zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) + @pytest.mark.skip(reason="mock server returns invalid data") @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncV4PagePaginationArray[RecordListResponse], record, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[RecordResponse], record, path=["response"]) + @pytest.mark.skip(reason="mock server returns invalid data") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.list( @@ -7519,8 +7958,9 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) tag_match="any", type="A", ) - assert_matches_type(AsyncV4PagePaginationArray[RecordListResponse], record, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[RecordResponse], record, path=["response"]) + @pytest.mark.skip(reason="mock server returns invalid data") @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns.records.with_raw_response.list( @@ -7530,8 +7970,9 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[RecordListResponse], record, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[RecordResponse], record, path=["response"]) + @pytest.mark.skip(reason="mock server returns invalid data") @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.dns.records.with_streaming_response.list( @@ -7541,10 +7982,11 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[RecordListResponse], record, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="mock server returns invalid data") @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): @@ -7620,6 +8062,10 @@ async def test_method_batch_with_all_params(self, async_client: AsyncCloudflare) "content": "198.51.100.4", "name": "example.com", "proxied": True, + "settings": { + "ipv4_only": True, + "ipv6_only": True, + }, "tags": ["owner:dns-team"], "ttl": 3600, "type": "A", @@ -7632,6 +8078,10 @@ async def test_method_batch_with_all_params(self, async_client: AsyncCloudflare) "content": "198.51.100.4", "name": "example.com", "proxied": True, + "settings": { + "ipv4_only": True, + "ipv6_only": True, + }, "tags": ["owner:dns-team"], "ttl": 3600, "type": "A", @@ -7643,6 +8093,10 @@ async def test_method_batch_with_all_params(self, async_client: AsyncCloudflare) "content": "198.51.100.4", "name": "example.com", "proxied": True, + "settings": { + "ipv4_only": True, + "ipv6_only": True, + }, "tags": ["owner:dns-team"], "ttl": 3600, "type": "A", @@ -7693,7 +8147,7 @@ async def test_method_edit_overload_1(self, async_client: AsyncCloudflare) -> No dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7705,11 +8159,15 @@ async def test_method_edit_with_all_params_overload_1(self, async_client: AsyncC content="198.51.100.4", name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="A", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7722,7 +8180,7 @@ async def test_raw_response_edit_overload_1(self, async_client: AsyncCloudflare) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7735,7 +8193,7 @@ async def test_streaming_response_edit_overload_1(self, async_client: AsyncCloud assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -7761,7 +8219,7 @@ async def test_method_edit_overload_2(self, async_client: AsyncCloudflare) -> No dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7773,11 +8231,15 @@ async def test_method_edit_with_all_params_overload_2(self, async_client: AsyncC content="2400:cb00:2049::1", name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="AAAA", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7790,7 +8252,7 @@ async def test_raw_response_edit_overload_2(self, async_client: AsyncCloudflare) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7803,7 +8265,7 @@ async def test_streaming_response_edit_overload_2(self, async_client: AsyncCloud assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -7829,7 +8291,7 @@ async def test_method_edit_overload_3(self, async_client: AsyncCloudflare) -> No dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7845,11 +8307,15 @@ async def test_method_edit_with_all_params_overload_3(self, async_client: AsyncC }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="CAA", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7862,7 +8328,7 @@ async def test_raw_response_edit_overload_3(self, async_client: AsyncCloudflare) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7875,7 +8341,7 @@ async def test_streaming_response_edit_overload_3(self, async_client: AsyncCloud assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -7901,7 +8367,7 @@ async def test_method_edit_overload_4(self, async_client: AsyncCloudflare) -> No dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7918,11 +8384,15 @@ async def test_method_edit_with_all_params_overload_4(self, async_client: AsyncC }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="CERT", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7935,7 +8405,7 @@ async def test_raw_response_edit_overload_4(self, async_client: AsyncCloudflare) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7948,7 +8418,7 @@ async def test_streaming_response_edit_overload_4(self, async_client: AsyncCloud assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -7974,7 +8444,7 @@ async def test_method_edit_overload_5(self, async_client: AsyncCloudflare) -> No dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -7986,12 +8456,16 @@ async def test_method_edit_with_all_params_overload_5(self, async_client: AsyncC content="content", name="example.com", proxied=True, - settings={"flatten_cname": True}, + settings={ + "flatten_cname": True, + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="CNAME", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8004,7 +8478,7 @@ async def test_raw_response_edit_overload_5(self, async_client: AsyncCloudflare) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8017,7 +8491,7 @@ async def test_streaming_response_edit_overload_5(self, async_client: AsyncCloud assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -8043,7 +8517,7 @@ async def test_method_edit_overload_6(self, async_client: AsyncCloudflare) -> No dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8060,11 +8534,15 @@ async def test_method_edit_with_all_params_overload_6(self, async_client: AsyncC }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="DNSKEY", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8077,7 +8555,7 @@ async def test_raw_response_edit_overload_6(self, async_client: AsyncCloudflare) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8090,7 +8568,7 @@ async def test_streaming_response_edit_overload_6(self, async_client: AsyncCloud assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -8116,7 +8594,7 @@ async def test_method_edit_overload_7(self, async_client: AsyncCloudflare) -> No dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8133,11 +8611,15 @@ async def test_method_edit_with_all_params_overload_7(self, async_client: AsyncC }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="DS", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8150,7 +8632,7 @@ async def test_raw_response_edit_overload_7(self, async_client: AsyncCloudflare) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8163,7 +8645,7 @@ async def test_streaming_response_edit_overload_7(self, async_client: AsyncCloud assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -8189,7 +8671,7 @@ async def test_method_edit_overload_8(self, async_client: AsyncCloudflare) -> No dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8205,11 +8687,15 @@ async def test_method_edit_with_all_params_overload_8(self, async_client: AsyncC }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="HTTPS", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8222,7 +8708,7 @@ async def test_raw_response_edit_overload_8(self, async_client: AsyncCloudflare) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8235,7 +8721,7 @@ async def test_streaming_response_edit_overload_8(self, async_client: AsyncCloud assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -8261,7 +8747,7 @@ async def test_method_edit_overload_9(self, async_client: AsyncCloudflare) -> No dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8286,11 +8772,15 @@ async def test_method_edit_with_all_params_overload_9(self, async_client: AsyncC }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="LOC", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8303,7 +8793,7 @@ async def test_raw_response_edit_overload_9(self, async_client: AsyncCloudflare) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8316,7 +8806,7 @@ async def test_streaming_response_edit_overload_9(self, async_client: AsyncCloud assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -8342,7 +8832,7 @@ async def test_method_edit_overload_10(self, async_client: AsyncCloudflare) -> N dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8355,11 +8845,15 @@ async def test_method_edit_with_all_params_overload_10(self, async_client: Async name="example.com", priority=10, proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="MX", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8372,7 +8866,7 @@ async def test_raw_response_edit_overload_10(self, async_client: AsyncCloudflare assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8385,7 +8879,7 @@ async def test_streaming_response_edit_overload_10(self, async_client: AsyncClou assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -8411,7 +8905,7 @@ async def test_method_edit_overload_11(self, async_client: AsyncCloudflare) -> N dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8430,11 +8924,15 @@ async def test_method_edit_with_all_params_overload_11(self, async_client: Async }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="NAPTR", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8447,7 +8945,7 @@ async def test_raw_response_edit_overload_11(self, async_client: AsyncCloudflare assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8460,7 +8958,7 @@ async def test_streaming_response_edit_overload_11(self, async_client: AsyncClou assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -8486,7 +8984,7 @@ async def test_method_edit_overload_12(self, async_client: AsyncCloudflare) -> N dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8498,11 +8996,15 @@ async def test_method_edit_with_all_params_overload_12(self, async_client: Async content="ns1.example.com", name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="NS", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8515,7 +9017,7 @@ async def test_raw_response_edit_overload_12(self, async_client: AsyncCloudflare assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8528,7 +9030,7 @@ async def test_streaming_response_edit_overload_12(self, async_client: AsyncClou assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -8554,7 +9056,7 @@ async def test_method_edit_overload_13(self, async_client: AsyncCloudflare) -> N dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8566,11 +9068,15 @@ async def test_method_edit_with_all_params_overload_13(self, async_client: Async content="content", name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="OPENPGPKEY", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8583,7 +9089,7 @@ async def test_raw_response_edit_overload_13(self, async_client: AsyncCloudflare assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8596,7 +9102,7 @@ async def test_streaming_response_edit_overload_13(self, async_client: AsyncClou assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -8622,7 +9128,7 @@ async def test_method_edit_overload_14(self, async_client: AsyncCloudflare) -> N dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8634,11 +9140,15 @@ async def test_method_edit_with_all_params_overload_14(self, async_client: Async content="example.com", name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="PTR", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8651,7 +9161,7 @@ async def test_raw_response_edit_overload_14(self, async_client: AsyncCloudflare assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8664,7 +9174,7 @@ async def test_streaming_response_edit_overload_14(self, async_client: AsyncClou assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -8690,7 +9200,7 @@ async def test_method_edit_overload_15(self, async_client: AsyncCloudflare) -> N dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8707,11 +9217,15 @@ async def test_method_edit_with_all_params_overload_15(self, async_client: Async }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="SMIMEA", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8724,7 +9238,7 @@ async def test_raw_response_edit_overload_15(self, async_client: AsyncCloudflare assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8737,7 +9251,7 @@ async def test_streaming_response_edit_overload_15(self, async_client: AsyncClou assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -8763,7 +9277,7 @@ async def test_method_edit_overload_16(self, async_client: AsyncCloudflare) -> N dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8780,11 +9294,15 @@ async def test_method_edit_with_all_params_overload_16(self, async_client: Async }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="SRV", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8797,7 +9315,7 @@ async def test_raw_response_edit_overload_16(self, async_client: AsyncCloudflare assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8810,7 +9328,7 @@ async def test_streaming_response_edit_overload_16(self, async_client: AsyncClou assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -8836,7 +9354,7 @@ async def test_method_edit_overload_17(self, async_client: AsyncCloudflare) -> N dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8852,11 +9370,15 @@ async def test_method_edit_with_all_params_overload_17(self, async_client: Async }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="SSHFP", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8869,7 +9391,7 @@ async def test_raw_response_edit_overload_17(self, async_client: AsyncCloudflare assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8882,7 +9404,7 @@ async def test_streaming_response_edit_overload_17(self, async_client: AsyncClou assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -8908,7 +9430,7 @@ async def test_method_edit_overload_18(self, async_client: AsyncCloudflare) -> N dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8924,11 +9446,15 @@ async def test_method_edit_with_all_params_overload_18(self, async_client: Async }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="SVCB", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8941,7 +9467,7 @@ async def test_raw_response_edit_overload_18(self, async_client: AsyncCloudflare assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8954,7 +9480,7 @@ async def test_streaming_response_edit_overload_18(self, async_client: AsyncClou assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -8980,7 +9506,7 @@ async def test_method_edit_overload_19(self, async_client: AsyncCloudflare) -> N dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -8997,11 +9523,15 @@ async def test_method_edit_with_all_params_overload_19(self, async_client: Async }, name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="TLSA", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9014,7 +9544,7 @@ async def test_raw_response_edit_overload_19(self, async_client: AsyncCloudflare assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9027,7 +9557,7 @@ async def test_streaming_response_edit_overload_19(self, async_client: AsyncClou assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -9053,7 +9583,7 @@ async def test_method_edit_overload_20(self, async_client: AsyncCloudflare) -> N dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9065,11 +9595,15 @@ async def test_method_edit_with_all_params_overload_20(self, async_client: Async content='"v=spf1 include:example.com -all"', name="example.com", proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="TXT", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9082,7 +9616,7 @@ async def test_raw_response_edit_overload_20(self, async_client: AsyncCloudflare assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9095,7 +9629,7 @@ async def test_streaming_response_edit_overload_20(self, async_client: AsyncClou assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -9121,7 +9655,7 @@ async def test_method_edit_overload_21(self, async_client: AsyncCloudflare) -> N dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9137,11 +9671,15 @@ async def test_method_edit_with_all_params_overload_21(self, async_client: Async name="example.com", priority=10, proxied=True, + settings={ + "ipv4_only": True, + "ipv6_only": True, + }, tags=["owner:dns-team"], ttl=3600, type="URI", ) - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9154,7 +9692,7 @@ async def test_raw_response_edit_overload_21(self, async_client: AsyncCloudflare assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -9167,7 +9705,7 @@ async def test_streaming_response_edit_overload_21(self, async_client: AsyncClou assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordEditResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True @@ -9224,14 +9762,16 @@ async def test_path_params_export(self, async_client: AsyncCloudflare) -> None: zone_id="", ) + @pytest.mark.skip(reason="mock server returns invalid data") @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.get( dns_record_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecordGetResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) + @pytest.mark.skip(reason="mock server returns invalid data") @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns.records.with_raw_response.get( @@ -9242,8 +9782,9 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordGetResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) + @pytest.mark.skip(reason="mock server returns invalid data") @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.dns.records.with_streaming_response.get( @@ -9254,10 +9795,11 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordGetResponse], record, path=["response"]) + assert_matches_type(Optional[RecordResponse], record, path=["response"]) assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="mock server returns invalid data") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): diff --git a/tests/api_resources/email_security/settings/test_block_senders.py b/tests/api_resources/email_security/settings/test_block_senders.py index 27fc016dbbe..e6bb0a56223 100644 --- a/tests/api_resources/email_security/settings/test_block_senders.py +++ b/tests/api_resources/email_security/settings/test_block_senders.py @@ -25,7 +25,7 @@ class TestBlockSenders: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize - def test_method_create_overload_1(self, client: Cloudflare) -> None: + def test_method_create(self, client: Cloudflare) -> None: block_sender = client.email_security.settings.block_senders.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", is_regex=False, @@ -35,7 +35,7 @@ def test_method_create_overload_1(self, client: Cloudflare) -> None: assert_matches_type(BlockSenderCreateResponse, block_sender, path=["response"]) @parametrize - def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> None: + def test_method_create_with_all_params(self, client: Cloudflare) -> None: block_sender = client.email_security.settings.block_senders.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", is_regex=False, @@ -46,7 +46,7 @@ def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> N assert_matches_type(BlockSenderCreateResponse, block_sender, path=["response"]) @parametrize - def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: + def test_raw_response_create(self, client: Cloudflare) -> None: response = client.email_security.settings.block_senders.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", is_regex=False, @@ -60,7 +60,7 @@ def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: assert_matches_type(BlockSenderCreateResponse, block_sender, path=["response"]) @parametrize - def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: + def test_streaming_response_create(self, client: Cloudflare) -> None: with client.email_security.settings.block_senders.with_streaming_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", is_regex=False, @@ -76,7 +76,7 @@ def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_create_overload_1(self, client: Cloudflare) -> None: + def test_path_params_create(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.email_security.settings.block_senders.with_raw_response.create( account_id="", @@ -85,72 +85,6 @@ def test_path_params_create_overload_1(self, client: Cloudflare) -> None: pattern_type="EMAIL", ) - @parametrize - def test_method_create_overload_2(self, client: Cloudflare) -> None: - block_sender = client.email_security.settings.block_senders.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[ - { - "is_regex": False, - "pattern": "test@example.com", - "pattern_type": "EMAIL", - } - ], - ) - assert_matches_type(BlockSenderCreateResponse, block_sender, path=["response"]) - - @parametrize - def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: - response = client.email_security.settings.block_senders.with_raw_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[ - { - "is_regex": False, - "pattern": "test@example.com", - "pattern_type": "EMAIL", - } - ], - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - block_sender = response.parse() - assert_matches_type(BlockSenderCreateResponse, block_sender, path=["response"]) - - @parametrize - def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: - with client.email_security.settings.block_senders.with_streaming_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[ - { - "is_regex": False, - "pattern": "test@example.com", - "pattern_type": "EMAIL", - } - ], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - block_sender = response.parse() - assert_matches_type(BlockSenderCreateResponse, block_sender, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_create_overload_2(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.email_security.settings.block_senders.with_raw_response.create( - account_id="", - body=[ - { - "is_regex": False, - "pattern": "test@example.com", - "pattern_type": "EMAIL", - } - ], - ) - @parametrize def test_method_list(self, client: Cloudflare) -> None: block_sender = client.email_security.settings.block_senders.list( @@ -345,7 +279,7 @@ class TestAsyncBlockSenders: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize - async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> None: + async def test_method_create(self, async_client: AsyncCloudflare) -> None: block_sender = await async_client.email_security.settings.block_senders.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", is_regex=False, @@ -355,7 +289,7 @@ async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> assert_matches_type(BlockSenderCreateResponse, block_sender, path=["response"]) @parametrize - async def test_method_create_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: + async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: block_sender = await async_client.email_security.settings.block_senders.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", is_regex=False, @@ -366,7 +300,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn assert_matches_type(BlockSenderCreateResponse, block_sender, path=["response"]) @parametrize - async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.email_security.settings.block_senders.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", is_regex=False, @@ -380,7 +314,7 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflar assert_matches_type(BlockSenderCreateResponse, block_sender, path=["response"]) @parametrize - async def test_streaming_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.email_security.settings.block_senders.with_streaming_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", is_regex=False, @@ -396,7 +330,7 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncClo assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_create_overload_1(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.email_security.settings.block_senders.with_raw_response.create( account_id="", @@ -405,72 +339,6 @@ async def test_path_params_create_overload_1(self, async_client: AsyncCloudflare pattern_type="EMAIL", ) - @parametrize - async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> None: - block_sender = await async_client.email_security.settings.block_senders.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[ - { - "is_regex": False, - "pattern": "test@example.com", - "pattern_type": "EMAIL", - } - ], - ) - assert_matches_type(BlockSenderCreateResponse, block_sender, path=["response"]) - - @parametrize - async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: - response = await async_client.email_security.settings.block_senders.with_raw_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[ - { - "is_regex": False, - "pattern": "test@example.com", - "pattern_type": "EMAIL", - } - ], - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - block_sender = await response.parse() - assert_matches_type(BlockSenderCreateResponse, block_sender, path=["response"]) - - @parametrize - async def test_streaming_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: - async with async_client.email_security.settings.block_senders.with_streaming_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[ - { - "is_regex": False, - "pattern": "test@example.com", - "pattern_type": "EMAIL", - } - ], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - block_sender = await response.parse() - assert_matches_type(BlockSenderCreateResponse, block_sender, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_create_overload_2(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.email_security.settings.block_senders.with_raw_response.create( - account_id="", - body=[ - { - "is_regex": False, - "pattern": "test@example.com", - "pattern_type": "EMAIL", - } - ], - ) - @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: block_sender = await async_client.email_security.settings.block_senders.list( diff --git a/tests/api_resources/email_security/settings/test_impersonation_registry.py b/tests/api_resources/email_security/settings/test_impersonation_registry.py index 8a4ad4fbe92..166def7dd1e 100644 --- a/tests/api_resources/email_security/settings/test_impersonation_registry.py +++ b/tests/api_resources/email_security/settings/test_impersonation_registry.py @@ -25,7 +25,7 @@ class TestImpersonationRegistry: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize - def test_method_create_overload_1(self, client: Cloudflare) -> None: + def test_method_create(self, client: Cloudflare) -> None: impersonation_registry = client.email_security.settings.impersonation_registry.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", email="email", @@ -35,7 +35,7 @@ def test_method_create_overload_1(self, client: Cloudflare) -> None: assert_matches_type(ImpersonationRegistryCreateResponse, impersonation_registry, path=["response"]) @parametrize - def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: + def test_raw_response_create(self, client: Cloudflare) -> None: response = client.email_security.settings.impersonation_registry.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", email="email", @@ -49,7 +49,7 @@ def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: assert_matches_type(ImpersonationRegistryCreateResponse, impersonation_registry, path=["response"]) @parametrize - def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: + def test_streaming_response_create(self, client: Cloudflare) -> None: with client.email_security.settings.impersonation_registry.with_streaming_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", email="email", @@ -65,7 +65,7 @@ def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_create_overload_1(self, client: Cloudflare) -> None: + def test_path_params_create(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.email_security.settings.impersonation_registry.with_raw_response.create( account_id="", @@ -74,72 +74,6 @@ def test_path_params_create_overload_1(self, client: Cloudflare) -> None: name="name", ) - @parametrize - def test_method_create_overload_2(self, client: Cloudflare) -> None: - impersonation_registry = client.email_security.settings.impersonation_registry.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[ - { - "email": "email", - "is_email_regex": True, - "name": "name", - } - ], - ) - assert_matches_type(ImpersonationRegistryCreateResponse, impersonation_registry, path=["response"]) - - @parametrize - def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: - response = client.email_security.settings.impersonation_registry.with_raw_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[ - { - "email": "email", - "is_email_regex": True, - "name": "name", - } - ], - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - impersonation_registry = response.parse() - assert_matches_type(ImpersonationRegistryCreateResponse, impersonation_registry, path=["response"]) - - @parametrize - def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: - with client.email_security.settings.impersonation_registry.with_streaming_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[ - { - "email": "email", - "is_email_regex": True, - "name": "name", - } - ], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - impersonation_registry = response.parse() - assert_matches_type(ImpersonationRegistryCreateResponse, impersonation_registry, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_create_overload_2(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.email_security.settings.impersonation_registry.with_raw_response.create( - account_id="", - body=[ - { - "email": "email", - "is_email_regex": True, - "name": "name", - } - ], - ) - @parametrize def test_method_list(self, client: Cloudflare) -> None: impersonation_registry = client.email_security.settings.impersonation_registry.list( @@ -341,7 +275,7 @@ class TestAsyncImpersonationRegistry: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize - async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> None: + async def test_method_create(self, async_client: AsyncCloudflare) -> None: impersonation_registry = await async_client.email_security.settings.impersonation_registry.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", email="email", @@ -351,7 +285,7 @@ async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> assert_matches_type(ImpersonationRegistryCreateResponse, impersonation_registry, path=["response"]) @parametrize - async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.email_security.settings.impersonation_registry.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", email="email", @@ -365,7 +299,7 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflar assert_matches_type(ImpersonationRegistryCreateResponse, impersonation_registry, path=["response"]) @parametrize - async def test_streaming_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.email_security.settings.impersonation_registry.with_streaming_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", email="email", @@ -381,7 +315,7 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncClo assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_create_overload_1(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.email_security.settings.impersonation_registry.with_raw_response.create( account_id="", @@ -390,72 +324,6 @@ async def test_path_params_create_overload_1(self, async_client: AsyncCloudflare name="name", ) - @parametrize - async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> None: - impersonation_registry = await async_client.email_security.settings.impersonation_registry.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[ - { - "email": "email", - "is_email_regex": True, - "name": "name", - } - ], - ) - assert_matches_type(ImpersonationRegistryCreateResponse, impersonation_registry, path=["response"]) - - @parametrize - async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: - response = await async_client.email_security.settings.impersonation_registry.with_raw_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[ - { - "email": "email", - "is_email_regex": True, - "name": "name", - } - ], - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - impersonation_registry = await response.parse() - assert_matches_type(ImpersonationRegistryCreateResponse, impersonation_registry, path=["response"]) - - @parametrize - async def test_streaming_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: - async with async_client.email_security.settings.impersonation_registry.with_streaming_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[ - { - "email": "email", - "is_email_regex": True, - "name": "name", - } - ], - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - impersonation_registry = await response.parse() - assert_matches_type(ImpersonationRegistryCreateResponse, impersonation_registry, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_create_overload_2(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.email_security.settings.impersonation_registry.with_raw_response.create( - account_id="", - body=[ - { - "email": "email", - "is_email_regex": True, - "name": "name", - } - ], - ) - @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: impersonation_registry = await async_client.email_security.settings.impersonation_registry.list( diff --git a/tests/api_resources/email_security/settings/test_trusted_domains.py b/tests/api_resources/email_security/settings/test_trusted_domains.py index 643f33b595d..33d602bb1a4 100644 --- a/tests/api_resources/email_security/settings/test_trusted_domains.py +++ b/tests/api_resources/email_security/settings/test_trusted_domains.py @@ -24,6 +24,7 @@ class TestTrustedDomains: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_method_create_overload_1(self, client: Cloudflare) -> None: trusted_domain = client.email_security.settings.trusted_domains.create( @@ -35,6 +36,7 @@ def test_method_create_overload_1(self, client: Cloudflare) -> None: ) assert_matches_type(TrustedDomainCreateResponse, trusted_domain, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> None: trusted_domain = client.email_security.settings.trusted_domains.create( @@ -47,6 +49,7 @@ def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> N ) assert_matches_type(TrustedDomainCreateResponse, trusted_domain, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: response = client.email_security.settings.trusted_domains.with_raw_response.create( @@ -62,6 +65,7 @@ def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: trusted_domain = response.parse() assert_matches_type(TrustedDomainCreateResponse, trusted_domain, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: with client.email_security.settings.trusted_domains.with_streaming_response.create( @@ -79,6 +83,7 @@ def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_path_params_create_overload_1(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -90,6 +95,7 @@ def test_path_params_create_overload_1(self, client: Cloudflare) -> None: pattern="example.com", ) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_method_create_overload_2(self, client: Cloudflare) -> None: trusted_domain = client.email_security.settings.trusted_domains.create( @@ -105,6 +111,7 @@ def test_method_create_overload_2(self, client: Cloudflare) -> None: ) assert_matches_type(TrustedDomainCreateResponse, trusted_domain, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: response = client.email_security.settings.trusted_domains.with_raw_response.create( @@ -124,6 +131,7 @@ def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: trusted_domain = response.parse() assert_matches_type(TrustedDomainCreateResponse, trusted_domain, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: with client.email_security.settings.trusted_domains.with_streaming_response.create( @@ -145,6 +153,7 @@ def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_path_params_create_overload_2(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -355,6 +364,7 @@ def test_path_params_get(self, client: Cloudflare) -> None: class TestAsyncTrustedDomains: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> None: trusted_domain = await async_client.email_security.settings.trusted_domains.create( @@ -366,6 +376,7 @@ async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> ) assert_matches_type(TrustedDomainCreateResponse, trusted_domain, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_method_create_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: trusted_domain = await async_client.email_security.settings.trusted_domains.create( @@ -378,6 +389,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn ) assert_matches_type(TrustedDomainCreateResponse, trusted_domain, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: response = await async_client.email_security.settings.trusted_domains.with_raw_response.create( @@ -393,6 +405,7 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflar trusted_domain = await response.parse() assert_matches_type(TrustedDomainCreateResponse, trusted_domain, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_streaming_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: async with async_client.email_security.settings.trusted_domains.with_streaming_response.create( @@ -410,6 +423,7 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncClo assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_path_params_create_overload_1(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -421,6 +435,7 @@ async def test_path_params_create_overload_1(self, async_client: AsyncCloudflare pattern="example.com", ) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> None: trusted_domain = await async_client.email_security.settings.trusted_domains.create( @@ -436,6 +451,7 @@ async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> ) assert_matches_type(TrustedDomainCreateResponse, trusted_domain, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: response = await async_client.email_security.settings.trusted_domains.with_raw_response.create( @@ -455,6 +471,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflar trusted_domain = await response.parse() assert_matches_type(TrustedDomainCreateResponse, trusted_domain, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_streaming_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: async with async_client.email_security.settings.trusted_domains.with_streaming_response.create( @@ -476,6 +493,7 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncClo assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_path_params_create_overload_2(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): diff --git a/tests/api_resources/logpush/test_jobs.py b/tests/api_resources/logpush/test_jobs.py index a35edd8c19e..0674d1ec883 100644 --- a/tests/api_resources/logpush/test_jobs.py +++ b/tests/api_resources/logpush/test_jobs.py @@ -126,6 +126,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: max_upload_bytes=5000000, max_upload_interval_seconds=30, max_upload_records=1000, + name="example.com", output_options={ "batch_prefix": "batch_prefix", "batch_suffix": "batch_suffix", @@ -476,6 +477,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare max_upload_bytes=5000000, max_upload_interval_seconds=30, max_upload_records=1000, + name="example.com", output_options={ "batch_prefix": "batch_prefix", "batch_suffix": "batch_suffix", diff --git a/tests/api_resources/logpush/test_validate.py b/tests/api_resources/logpush/test_validate.py index fd2a12df619..3a7d1dbf97c 100644 --- a/tests/api_resources/logpush/test_validate.py +++ b/tests/api_resources/logpush/test_validate.py @@ -12,6 +12,7 @@ from cloudflare.types.logpush import ( ValidateOriginResponse, ValidateDestinationResponse, + ValidateDestinationExistsResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -81,6 +82,67 @@ def test_path_params_destination(self, client: Cloudflare) -> None: account_id="account_id", ) + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_method_destination_exists(self, client: Cloudflare) -> None: + validate = client.logpush.validate.destination_exists( + destination_conf="s3://mybucket/logs?region=us-west-2", + account_id="account_id", + ) + assert_matches_type(Optional[ValidateDestinationExistsResponse], validate, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_method_destination_exists_with_all_params(self, client: Cloudflare) -> None: + validate = client.logpush.validate.destination_exists( + destination_conf="s3://mybucket/logs?region=us-west-2", + account_id="account_id", + ) + assert_matches_type(Optional[ValidateDestinationExistsResponse], validate, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_raw_response_destination_exists(self, client: Cloudflare) -> None: + response = client.logpush.validate.with_raw_response.destination_exists( + destination_conf="s3://mybucket/logs?region=us-west-2", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + validate = response.parse() + assert_matches_type(Optional[ValidateDestinationExistsResponse], validate, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_streaming_response_destination_exists(self, client: Cloudflare) -> None: + with client.logpush.validate.with_streaming_response.destination_exists( + destination_conf="s3://mybucket/logs?region=us-west-2", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + validate = response.parse() + assert_matches_type(Optional[ValidateDestinationExistsResponse], validate, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_path_params_destination_exists(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.logpush.validate.with_raw_response.destination_exists( + destination_conf="s3://mybucket/logs?region=us-west-2", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.logpush.validate.with_raw_response.destination_exists( + destination_conf="s3://mybucket/logs?region=us-west-2", + account_id="account_id", + ) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_method_origin(self, client: Cloudflare) -> None: @@ -207,6 +269,67 @@ async def test_path_params_destination(self, async_client: AsyncCloudflare) -> N account_id="account_id", ) + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_method_destination_exists(self, async_client: AsyncCloudflare) -> None: + validate = await async_client.logpush.validate.destination_exists( + destination_conf="s3://mybucket/logs?region=us-west-2", + account_id="account_id", + ) + assert_matches_type(Optional[ValidateDestinationExistsResponse], validate, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_method_destination_exists_with_all_params(self, async_client: AsyncCloudflare) -> None: + validate = await async_client.logpush.validate.destination_exists( + destination_conf="s3://mybucket/logs?region=us-west-2", + account_id="account_id", + ) + assert_matches_type(Optional[ValidateDestinationExistsResponse], validate, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_raw_response_destination_exists(self, async_client: AsyncCloudflare) -> None: + response = await async_client.logpush.validate.with_raw_response.destination_exists( + destination_conf="s3://mybucket/logs?region=us-west-2", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + validate = await response.parse() + assert_matches_type(Optional[ValidateDestinationExistsResponse], validate, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_streaming_response_destination_exists(self, async_client: AsyncCloudflare) -> None: + async with async_client.logpush.validate.with_streaming_response.destination_exists( + destination_conf="s3://mybucket/logs?region=us-west-2", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + validate = await response.parse() + assert_matches_type(Optional[ValidateDestinationExistsResponse], validate, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_path_params_destination_exists(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.logpush.validate.with_raw_response.destination_exists( + destination_conf="s3://mybucket/logs?region=us-west-2", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.logpush.validate.with_raw_response.destination_exists( + destination_conf="s3://mybucket/logs?region=us-west-2", + account_id="account_id", + ) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_origin(self, async_client: AsyncCloudflare) -> None: diff --git a/tests/api_resources/magic_transit/sites/test_acls.py b/tests/api_resources/magic_transit/sites/test_acls.py index e14f6ccb449..151e289d692 100644 --- a/tests/api_resources/magic_transit/sites/test_acls.py +++ b/tests/api_resources/magic_transit/sites/test_acls.py @@ -52,6 +52,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: description="Allows local traffic between PIN pads and cash register.", forward_locally=True, protocols=["tcp"], + unidirectional=True, ) assert_matches_type(ACL, acl, path=["response"]) @@ -138,6 +139,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: }, name="PIN Pad - Cash Register", protocols=["tcp"], + unidirectional=True, ) assert_matches_type(ACL, acl, path=["response"]) @@ -331,6 +333,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: }, name="PIN Pad - Cash Register", protocols=["tcp"], + unidirectional=True, ) assert_matches_type(ACL, acl, path=["response"]) @@ -481,6 +484,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare description="Allows local traffic between PIN pads and cash register.", forward_locally=True, protocols=["tcp"], + unidirectional=True, ) assert_matches_type(ACL, acl, path=["response"]) @@ -567,6 +571,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare }, name="PIN Pad - Cash Register", protocols=["tcp"], + unidirectional=True, ) assert_matches_type(ACL, acl, path=["response"]) @@ -760,6 +765,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) }, name="PIN Pad - Cash Register", protocols=["tcp"], + unidirectional=True, ) assert_matches_type(ACL, acl, path=["response"]) diff --git a/tests/api_resources/r2/buckets/domains/test_custom.py b/tests/api_resources/r2/buckets/domains/test_custom.py index 3770f95c3f3..87e7d3ccb1f 100644 --- a/tests/api_resources/r2/buckets/domains/test_custom.py +++ b/tests/api_resources/r2/buckets/domains/test_custom.py @@ -45,7 +45,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: enabled=True, zone_id="36ca64a6d92827b8a6b90be344bb1bfd", min_tls="1.0", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(CustomCreateResponse, custom, path=["response"]) @@ -123,7 +123,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: bucket_name="example-bucket", enabled=True, min_tls="1.0", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(CustomUpdateResponse, custom, path=["response"]) @@ -196,7 +196,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: custom = client.r2.buckets.domains.custom.list( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(CustomListResponse, custom, path=["response"]) @@ -260,7 +260,7 @@ def test_method_delete_with_all_params(self, client: Cloudflare) -> None: domain_name="example-domain/custom-domain.com", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="example-bucket", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(CustomDeleteResponse, custom, path=["response"]) @@ -335,7 +335,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: domain_name="example-domain/custom-domain.com", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="example-bucket", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(CustomGetResponse, custom, path=["response"]) @@ -419,7 +419,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare enabled=True, zone_id="36ca64a6d92827b8a6b90be344bb1bfd", min_tls="1.0", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(CustomCreateResponse, custom, path=["response"]) @@ -497,7 +497,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare bucket_name="example-bucket", enabled=True, min_tls="1.0", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(CustomUpdateResponse, custom, path=["response"]) @@ -570,7 +570,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) custom = await async_client.r2.buckets.domains.custom.list( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(CustomListResponse, custom, path=["response"]) @@ -634,7 +634,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare domain_name="example-domain/custom-domain.com", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="example-bucket", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(CustomDeleteResponse, custom, path=["response"]) @@ -709,7 +709,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - domain_name="example-domain/custom-domain.com", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="example-bucket", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(CustomGetResponse, custom, path=["response"]) diff --git a/tests/api_resources/r2/buckets/domains/test_managed.py b/tests/api_resources/r2/buckets/domains/test_managed.py index a1c8f3bc5b0..2d574c1b72a 100644 --- a/tests/api_resources/r2/buckets/domains/test_managed.py +++ b/tests/api_resources/r2/buckets/domains/test_managed.py @@ -34,7 +34,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", enabled=True, - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(ManagedUpdateResponse, managed, path=["response"]) @@ -100,7 +100,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: managed = client.r2.buckets.domains.managed.list( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(ManagedListResponse, managed, path=["response"]) @@ -168,7 +168,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", enabled=True, - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(ManagedUpdateResponse, managed, path=["response"]) @@ -234,7 +234,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) managed = await async_client.r2.buckets.domains.managed.list( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(ManagedListResponse, managed, path=["response"]) diff --git a/tests/api_resources/r2/buckets/event_notifications/configuration/test_queues.py b/tests/api_resources/r2/buckets/event_notifications/configuration/test_queues.py index 870412e34cc..8a8fa2a2102 100644 --- a/tests/api_resources/r2/buckets/event_notifications/configuration/test_queues.py +++ b/tests/api_resources/r2/buckets/event_notifications/configuration/test_queues.py @@ -41,7 +41,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "suffix": ".jpeg", } ], - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(object, queue, path=["response"]) @@ -116,7 +116,7 @@ def test_method_delete_with_all_params(self, client: Cloudflare) -> None: queue_id="queue_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="example-bucket", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(object, queue, path=["response"]) @@ -203,7 +203,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "suffix": ".jpeg", } ], - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(object, queue, path=["response"]) @@ -278,7 +278,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare queue_id="queue_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="example-bucket", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(object, queue, path=["response"]) diff --git a/tests/api_resources/r2/buckets/event_notifications/test_configuration.py b/tests/api_resources/r2/buckets/event_notifications/test_configuration.py index beb978137e8..48c14e93942 100644 --- a/tests/api_resources/r2/buckets/event_notifications/test_configuration.py +++ b/tests/api_resources/r2/buckets/event_notifications/test_configuration.py @@ -32,7 +32,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: configuration = client.r2.buckets.event_notifications.configuration.get( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(ConfigurationGetResponse, configuration, path=["response"]) @@ -98,7 +98,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - configuration = await async_client.r2.buckets.event_notifications.configuration.get( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(ConfigurationGetResponse, configuration, path=["response"]) diff --git a/tests/api_resources/r2/buckets/test_cors.py b/tests/api_resources/r2/buckets/test_cors.py index c64f885d196..4c978af07d5 100644 --- a/tests/api_resources/r2/buckets/test_cors.py +++ b/tests/api_resources/r2/buckets/test_cors.py @@ -44,7 +44,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "max_age_seconds": 3600, } ], - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(object, cors, path=["response"]) @@ -106,7 +106,7 @@ def test_method_delete_with_all_params(self, client: Cloudflare) -> None: cors = client.r2.buckets.cors.delete( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(object, cors, path=["response"]) @@ -168,7 +168,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: cors = client.r2.buckets.cors.get( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(CORSGetResponse, cors, path=["response"]) @@ -246,7 +246,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "max_age_seconds": 3600, } ], - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(object, cors, path=["response"]) @@ -308,7 +308,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare cors = await async_client.r2.buckets.cors.delete( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(object, cors, path=["response"]) @@ -370,7 +370,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - cors = await async_client.r2.buckets.cors.get( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(CORSGetResponse, cors, path=["response"]) diff --git a/tests/api_resources/r2/buckets/test_lifecycle.py b/tests/api_resources/r2/buckets/test_lifecycle.py index a8d7d965613..f377344330f 100644 --- a/tests/api_resources/r2/buckets/test_lifecycle.py +++ b/tests/api_resources/r2/buckets/test_lifecycle.py @@ -60,7 +60,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: ], } ], - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(object, lifecycle, path=["response"]) @@ -122,7 +122,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: lifecycle = client.r2.buckets.lifecycle.get( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(LifecycleGetResponse, lifecycle, path=["response"]) @@ -216,7 +216,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare ], } ], - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(object, lifecycle, path=["response"]) @@ -278,7 +278,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - lifecycle = await async_client.r2.buckets.lifecycle.get( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(LifecycleGetResponse, lifecycle, path=["response"]) diff --git a/tests/api_resources/r2/buckets/test_sippy.py b/tests/api_resources/r2/buckets/test_sippy.py index 3fdc3bec704..6e67aca418d 100644 --- a/tests/api_resources/r2/buckets/test_sippy.py +++ b/tests/api_resources/r2/buckets/test_sippy.py @@ -44,7 +44,7 @@ def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> N "region": "region", "secret_access_key": "secretAccessKey", }, - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(Sippy, sippy, path=["response"]) @@ -117,7 +117,7 @@ def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> N "private_key": "privateKey", "provider": "gcs", }, - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(Sippy, sippy, path=["response"]) @@ -179,7 +179,7 @@ def test_method_delete_with_all_params(self, client: Cloudflare) -> None: sippy = client.r2.buckets.sippy.delete( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(SippyDeleteResponse, sippy, path=["response"]) @@ -241,7 +241,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: sippy = client.r2.buckets.sippy.get( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(Sippy, sippy, path=["response"]) @@ -319,7 +319,7 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn "region": "region", "secret_access_key": "secretAccessKey", }, - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(Sippy, sippy, path=["response"]) @@ -392,7 +392,7 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn "private_key": "privateKey", "provider": "gcs", }, - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(Sippy, sippy, path=["response"]) @@ -454,7 +454,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare sippy = await async_client.r2.buckets.sippy.delete( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(SippyDeleteResponse, sippy, path=["response"]) @@ -516,7 +516,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - sippy = await async_client.r2.buckets.sippy.get( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(Sippy, sippy, path=["response"]) diff --git a/tests/api_resources/r2/test_buckets.py b/tests/api_resources/r2/test_buckets.py index e1713e18824..78d22d35f70 100644 --- a/tests/api_resources/r2/test_buckets.py +++ b/tests/api_resources/r2/test_buckets.py @@ -34,7 +34,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: name="example-bucket", location_hint="apac", storage_class="Standard", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(Bucket, bucket, path=["response"]) @@ -94,7 +94,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: order="name", per_page=1, start_after="my-bucket", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(BucketListResponse, bucket, path=["response"]) @@ -147,7 +147,7 @@ def test_method_delete_with_all_params(self, client: Cloudflare) -> None: bucket = client.r2.buckets.delete( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(object, bucket, path=["response"]) @@ -209,7 +209,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: bucket = client.r2.buckets.get( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(Bucket, bucket, path=["response"]) @@ -277,7 +277,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare name="example-bucket", location_hint="apac", storage_class="Standard", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(Bucket, bucket, path=["response"]) @@ -337,7 +337,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) order="name", per_page=1, start_after="my-bucket", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(BucketListResponse, bucket, path=["response"]) @@ -390,7 +390,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare bucket = await async_client.r2.buckets.delete( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(object, bucket, path=["response"]) @@ -452,7 +452,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - bucket = await async_client.r2.buckets.get( bucket_name="example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", - cf_r2_jurisdiction="default", + jurisdiction="default", ) assert_matches_type(Bucket, bucket, path=["response"]) diff --git a/tests/api_resources/radar/ai/bots/test_summary.py b/tests/api_resources/radar/ai/bots/test_summary.py index a9d3715f712..ca5d4e987c0 100644 --- a/tests/api_resources/radar/ai/bots/test_summary.py +++ b/tests/api_resources/radar/ai/bots/test_summary.py @@ -32,6 +32,7 @@ def test_method_user_agent_with_all_params(self, client: Cloudflare) -> None: date_range=["7d"], date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", + limit_per_group=10, location=["string"], name=["string"], ) @@ -75,6 +76,7 @@ async def test_method_user_agent_with_all_params(self, async_client: AsyncCloudf date_range=["7d"], date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", + limit_per_group=10, location=["string"], name=["string"], ) diff --git a/tests/api_resources/radar/ai/test_timeseries_groups.py b/tests/api_resources/radar/ai/test_timeseries_groups.py index 51184d25d05..94ccc123297 100644 --- a/tests/api_resources/radar/ai/test_timeseries_groups.py +++ b/tests/api_resources/radar/ai/test_timeseries_groups.py @@ -33,7 +33,7 @@ def test_method_user_agent_with_all_params(self, client: Cloudflare) -> None: date_range=["7d"], date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", - limit_per_group=4, + limit_per_group=10, location=["string"], name=["string"], ) @@ -78,7 +78,7 @@ async def test_method_user_agent_with_all_params(self, async_client: AsyncCloudf date_range=["7d"], date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", - limit_per_group=4, + limit_per_group=10, location=["string"], name=["string"], ) diff --git a/tests/api_resources/radar/as112/test_summary.py b/tests/api_resources/radar/as112/test_summary.py index caffb58e7bb..d5956baed72 100644 --- a/tests/api_resources/radar/as112/test_summary.py +++ b/tests/api_resources/radar/as112/test_summary.py @@ -195,6 +195,7 @@ def test_method_query_type_with_all_params(self, client: Cloudflare) -> None: date_range=["7d"], date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", + limit_per_group=10, location=["string"], name=["string"], ) @@ -234,6 +235,7 @@ def test_method_response_codes_with_all_params(self, client: Cloudflare) -> None date_range=["7d"], date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", + limit_per_group=10, location=["string"], name=["string"], ) @@ -433,6 +435,7 @@ async def test_method_query_type_with_all_params(self, async_client: AsyncCloudf date_range=["7d"], date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", + limit_per_group=10, location=["string"], name=["string"], ) @@ -472,6 +475,7 @@ async def test_method_response_codes_with_all_params(self, async_client: AsyncCl date_range=["7d"], date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", + limit_per_group=10, location=["string"], name=["string"], ) diff --git a/tests/api_resources/radar/as112/test_timeseries_groups.py b/tests/api_resources/radar/as112/test_timeseries_groups.py index 703a7fd254f..26adfcf7eab 100644 --- a/tests/api_resources/radar/as112/test_timeseries_groups.py +++ b/tests/api_resources/radar/as112/test_timeseries_groups.py @@ -200,6 +200,7 @@ def test_method_query_type_with_all_params(self, client: Cloudflare) -> None: date_range=["7d"], date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", + limit_per_group=10, location=["string"], name=["string"], ) @@ -240,6 +241,7 @@ def test_method_response_codes_with_all_params(self, client: Cloudflare) -> None date_range=["7d"], date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", + limit_per_group=10, location=["string"], name=["string"], ) @@ -444,6 +446,7 @@ async def test_method_query_type_with_all_params(self, async_client: AsyncCloudf date_range=["7d"], date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", + limit_per_group=10, location=["string"], name=["string"], ) @@ -484,6 +487,7 @@ async def test_method_response_codes_with_all_params(self, async_client: AsyncCl date_range=["7d"], date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", + limit_per_group=10, location=["string"], name=["string"], ) diff --git a/tests/api_resources/radar/attacks/layer3/test_summary.py b/tests/api_resources/radar/attacks/layer3/test_summary.py index dd0ffe08b6c..6e0d57be6a1 100644 --- a/tests/api_resources/radar/attacks/layer3/test_summary.py +++ b/tests/api_resources/radar/attacks/layer3/test_summary.py @@ -241,6 +241,7 @@ def test_method_vector_with_all_params(self, client: Cloudflare) -> None: direction="ORIGIN", format="JSON", ip_version=["IPv4"], + limit_per_group=10, location=["string"], name=["string"], protocol=["UDP"], @@ -487,6 +488,7 @@ async def test_method_vector_with_all_params(self, async_client: AsyncCloudflare direction="ORIGIN", format="JSON", ip_version=["IPv4"], + limit_per_group=10, location=["string"], name=["string"], protocol=["UDP"], diff --git a/tests/api_resources/radar/attacks/layer3/test_timeseries_groups.py b/tests/api_resources/radar/attacks/layer3/test_timeseries_groups.py index 0fd0a3e6c90..258338056b5 100644 --- a/tests/api_resources/radar/attacks/layer3/test_timeseries_groups.py +++ b/tests/api_resources/radar/attacks/layer3/test_timeseries_groups.py @@ -169,7 +169,7 @@ def test_method_industry_with_all_params(self, client: Cloudflare) -> None: direction="ORIGIN", format="JSON", ip_version=["IPv4"], - limit_per_group=4, + limit_per_group=10, location=["string"], name=["string"], normalization="PERCENTAGE", @@ -297,7 +297,7 @@ def test_method_vector_with_all_params(self, client: Cloudflare) -> None: direction="ORIGIN", format="JSON", ip_version=["IPv4"], - limit_per_group=4, + limit_per_group=10, location=["string"], name=["string"], normalization="PERCENTAGE", @@ -341,7 +341,7 @@ def test_method_vertical_with_all_params(self, client: Cloudflare) -> None: direction="ORIGIN", format="JSON", ip_version=["IPv4"], - limit_per_group=4, + limit_per_group=10, location=["string"], name=["string"], normalization="PERCENTAGE", @@ -515,7 +515,7 @@ async def test_method_industry_with_all_params(self, async_client: AsyncCloudfla direction="ORIGIN", format="JSON", ip_version=["IPv4"], - limit_per_group=4, + limit_per_group=10, location=["string"], name=["string"], normalization="PERCENTAGE", @@ -643,7 +643,7 @@ async def test_method_vector_with_all_params(self, async_client: AsyncCloudflare direction="ORIGIN", format="JSON", ip_version=["IPv4"], - limit_per_group=4, + limit_per_group=10, location=["string"], name=["string"], normalization="PERCENTAGE", @@ -687,7 +687,7 @@ async def test_method_vertical_with_all_params(self, async_client: AsyncCloudfla direction="ORIGIN", format="JSON", ip_version=["IPv4"], - limit_per_group=4, + limit_per_group=10, location=["string"], name=["string"], normalization="PERCENTAGE", diff --git a/tests/api_resources/radar/attacks/layer7/test_summary.py b/tests/api_resources/radar/attacks/layer7/test_summary.py index 64b5d969caf..694c8f4497c 100644 --- a/tests/api_resources/radar/attacks/layer7/test_summary.py +++ b/tests/api_resources/radar/attacks/layer7/test_summary.py @@ -80,6 +80,7 @@ def test_method_http_method_with_all_params(self, client: Cloudflare) -> None: format="JSON", http_version=["HTTPv1"], ip_version=["IPv4"], + limit_per_group=10, location=["string"], mitigation_product=["DDOS"], name=["string"], @@ -207,6 +208,7 @@ def test_method_managed_rules_with_all_params(self, client: Cloudflare) -> None: http_method=["GET"], http_version=["HTTPv1"], ip_version=["IPv4"], + limit_per_group=10, location=["string"], mitigation_product=["DDOS"], name=["string"], @@ -250,6 +252,7 @@ def test_method_mitigation_product_with_all_params(self, client: Cloudflare) -> http_method=["GET"], http_version=["HTTPv1"], ip_version=["IPv4"], + limit_per_group=10, location=["string"], name=["string"], ) @@ -334,6 +337,7 @@ async def test_method_http_method_with_all_params(self, async_client: AsyncCloud format="JSON", http_version=["HTTPv1"], ip_version=["IPv4"], + limit_per_group=10, location=["string"], mitigation_product=["DDOS"], name=["string"], @@ -461,6 +465,7 @@ async def test_method_managed_rules_with_all_params(self, async_client: AsyncClo http_method=["GET"], http_version=["HTTPv1"], ip_version=["IPv4"], + limit_per_group=10, location=["string"], mitigation_product=["DDOS"], name=["string"], @@ -504,6 +509,7 @@ async def test_method_mitigation_product_with_all_params(self, async_client: Asy http_method=["GET"], http_version=["HTTPv1"], ip_version=["IPv4"], + limit_per_group=10, location=["string"], name=["string"], ) diff --git a/tests/api_resources/radar/attacks/layer7/test_timeseries_groups.py b/tests/api_resources/radar/attacks/layer7/test_timeseries_groups.py index 54a36ba067e..853d11fb63c 100644 --- a/tests/api_resources/radar/attacks/layer7/test_timeseries_groups.py +++ b/tests/api_resources/radar/attacks/layer7/test_timeseries_groups.py @@ -84,6 +84,7 @@ def test_method_http_method_with_all_params(self, client: Cloudflare) -> None: format="JSON", http_version=["HTTPv1"], ip_version=["IPv4"], + limit_per_group=10, location=["string"], mitigation_product=["DDOS"], name=["string"], @@ -173,7 +174,7 @@ def test_method_industry_with_all_params(self, client: Cloudflare) -> None: http_method=["GET"], http_version=["HTTPv1"], ip_version=["IPv4"], - limit_per_group=4, + limit_per_group=10, location=["string"], mitigation_product=["DDOS"], name=["string"], @@ -263,6 +264,7 @@ def test_method_managed_rules_with_all_params(self, client: Cloudflare) -> None: http_method=["GET"], http_version=["HTTPv1"], ip_version=["IPv4"], + limit_per_group=10, location=["string"], mitigation_product=["DDOS"], name=["string"], @@ -308,6 +310,7 @@ def test_method_mitigation_product_with_all_params(self, client: Cloudflare) -> http_method=["GET"], http_version=["HTTPv1"], ip_version=["IPv4"], + limit_per_group=10, location=["string"], name=["string"], normalization="PERCENTAGE", @@ -352,7 +355,7 @@ def test_method_vertical_with_all_params(self, client: Cloudflare) -> None: http_method=["GET"], http_version=["HTTPv1"], ip_version=["IPv4"], - limit_per_group=4, + limit_per_group=10, location=["string"], mitigation_product=["DDOS"], name=["string"], @@ -441,6 +444,7 @@ async def test_method_http_method_with_all_params(self, async_client: AsyncCloud format="JSON", http_version=["HTTPv1"], ip_version=["IPv4"], + limit_per_group=10, location=["string"], mitigation_product=["DDOS"], name=["string"], @@ -530,7 +534,7 @@ async def test_method_industry_with_all_params(self, async_client: AsyncCloudfla http_method=["GET"], http_version=["HTTPv1"], ip_version=["IPv4"], - limit_per_group=4, + limit_per_group=10, location=["string"], mitigation_product=["DDOS"], name=["string"], @@ -620,6 +624,7 @@ async def test_method_managed_rules_with_all_params(self, async_client: AsyncClo http_method=["GET"], http_version=["HTTPv1"], ip_version=["IPv4"], + limit_per_group=10, location=["string"], mitigation_product=["DDOS"], name=["string"], @@ -665,6 +670,7 @@ async def test_method_mitigation_product_with_all_params(self, async_client: Asy http_method=["GET"], http_version=["HTTPv1"], ip_version=["IPv4"], + limit_per_group=10, location=["string"], name=["string"], normalization="PERCENTAGE", @@ -709,7 +715,7 @@ async def test_method_vertical_with_all_params(self, async_client: AsyncCloudfla http_method=["GET"], http_version=["HTTPv1"], ip_version=["IPv4"], - limit_per_group=4, + limit_per_group=10, location=["string"], mitigation_product=["DDOS"], name=["string"], diff --git a/tests/api_resources/radar/http/test_timeseries_groups.py b/tests/api_resources/radar/http/test_timeseries_groups.py index 8c0d3decdd5..8789e6c61ed 100644 --- a/tests/api_resources/radar/http/test_timeseries_groups.py +++ b/tests/api_resources/radar/http/test_timeseries_groups.py @@ -95,7 +95,7 @@ def test_method_browser_with_all_params(self, client: Cloudflare) -> None: http_protocol=["HTTP"], http_version=["HTTPv1"], ip_version=["IPv4"], - limit_per_group=4, + limit_per_group=10, location=["string"], name=["string"], os=["WINDOWS"], @@ -143,6 +143,7 @@ def test_method_browser_family_with_all_params(self, client: Cloudflare) -> None http_protocol=["HTTP"], http_version=["HTTPv1"], ip_version=["IPv4"], + limit_per_group=10, location=["string"], name=["string"], os=["WINDOWS"], @@ -563,7 +564,7 @@ async def test_method_browser_with_all_params(self, async_client: AsyncCloudflar http_protocol=["HTTP"], http_version=["HTTPv1"], ip_version=["IPv4"], - limit_per_group=4, + limit_per_group=10, location=["string"], name=["string"], os=["WINDOWS"], @@ -611,6 +612,7 @@ async def test_method_browser_family_with_all_params(self, async_client: AsyncCl http_protocol=["HTTP"], http_version=["HTTPv1"], ip_version=["IPv4"], + limit_per_group=10, location=["string"], name=["string"], os=["WINDOWS"], diff --git a/tests/api_resources/radar/ranking/test_domain.py b/tests/api_resources/radar/ranking/test_domain.py index b67fc2b8ad7..26021593dd9 100644 --- a/tests/api_resources/radar/ranking/test_domain.py +++ b/tests/api_resources/radar/ranking/test_domain.py @@ -9,6 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare._utils import parse_date from cloudflare.types.radar.ranking import DomainGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -28,8 +29,9 @@ def test_method_get(self, client: Cloudflare) -> None: def test_method_get_with_all_params(self, client: Cloudflare) -> None: domain = client.radar.ranking.domain.get( domain="google.com", - date=["string"], + date=[parse_date("2019-12-27")], format="JSON", + include_top_locations=True, limit=5, name=["string"], ranking_type="POPULAR", @@ -82,8 +84,9 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: domain = await async_client.radar.ranking.domain.get( domain="google.com", - date=["string"], + date=[parse_date("2019-12-27")], format="JSON", + include_top_locations=True, limit=5, name=["string"], ranking_type="POPULAR", diff --git a/tests/api_resources/radar/test_ranking.py b/tests/api_resources/radar/test_ranking.py index 9e4b188e021..6608571dbd3 100644 --- a/tests/api_resources/radar/test_ranking.py +++ b/tests/api_resources/radar/test_ranking.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare._utils import parse_datetime +from cloudflare._utils import parse_date, parse_datetime from cloudflare.types.radar import ( RankingTopResponse, RankingTimeseriesGroupsResponse, @@ -69,7 +69,7 @@ def test_method_top(self, client: Cloudflare) -> None: @parametrize def test_method_top_with_all_params(self, client: Cloudflare) -> None: ranking = client.radar.ranking.top( - date=["string"], + date=[parse_date("2019-12-27")], format="JSON", limit=5, location=["string"], @@ -150,7 +150,7 @@ async def test_method_top(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_top_with_all_params(self, async_client: AsyncCloudflare) -> None: ranking = await async_client.radar.ranking.top( - date=["string"], + date=[parse_date("2019-12-27")], format="JSON", limit=5, location=["string"], diff --git a/tests/api_resources/rulesets/test_rules.py b/tests/api_resources/rulesets/test_rules.py index 117eee8c295..d57aa588aa2 100644 --- a/tests/api_resources/rulesets/test_rules.py +++ b/tests/api_resources/rulesets/test_rules.py @@ -1411,16 +1411,7 @@ def test_method_create_with_all_params_overload_15(self, client: Cloudflare) -> "include": ["string"], }, "host": {"resolved": True}, - "query_string": { - "exclude": { - "all": True, - "list": ["string"], - }, - "include": { - "all": True, - "list": ["string"], - }, - }, + "query_string": {"include": {"list": ["foo", "bar"]}}, "user": { "device_type": True, "geo": True, @@ -3468,16 +3459,7 @@ def test_method_edit_with_all_params_overload_15(self, client: Cloudflare) -> No "include": ["string"], }, "host": {"resolved": True}, - "query_string": { - "exclude": { - "all": True, - "list": ["string"], - }, - "include": { - "all": True, - "list": ["string"], - }, - }, + "query_string": {"include": {"list": ["foo", "bar"]}}, "user": { "device_type": True, "geo": True, @@ -5304,16 +5286,7 @@ async def test_method_create_with_all_params_overload_15(self, async_client: Asy "include": ["string"], }, "host": {"resolved": True}, - "query_string": { - "exclude": { - "all": True, - "list": ["string"], - }, - "include": { - "all": True, - "list": ["string"], - }, - }, + "query_string": {"include": {"list": ["foo", "bar"]}}, "user": { "device_type": True, "geo": True, @@ -7361,16 +7334,7 @@ async def test_method_edit_with_all_params_overload_15(self, async_client: Async "include": ["string"], }, "host": {"resolved": True}, - "query_string": { - "exclude": { - "all": True, - "list": ["string"], - }, - "include": { - "all": True, - "list": ["string"], - }, - }, + "query_string": {"include": {"list": ["foo", "bar"]}}, "user": { "device_type": True, "geo": True, diff --git a/tests/api_resources/spectrum/test_apps.py b/tests/api_resources/spectrum/test_apps.py index a5109d18f6a..406363c48d8 100644 --- a/tests/api_resources/spectrum/test_apps.py +++ b/tests/api_resources/spectrum/test_apps.py @@ -383,6 +383,7 @@ def test_path_params_update_overload_2(self, client: Cloudflare) -> None: protocol="tcp/22", ) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_method_list(self, client: Cloudflare) -> None: app = client.spectrum.apps.list( @@ -390,6 +391,7 @@ def test_method_list(self, client: Cloudflare) -> None: ) assert_matches_type(SyncV4PagePaginationArray[Optional[AppListResponse]], app, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: app = client.spectrum.apps.list( @@ -401,6 +403,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: ) assert_matches_type(SyncV4PagePaginationArray[Optional[AppListResponse]], app, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.spectrum.apps.with_raw_response.list( @@ -412,6 +415,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: app = response.parse() assert_matches_type(SyncV4PagePaginationArray[Optional[AppListResponse]], app, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.spectrum.apps.with_streaming_response.list( @@ -425,6 +429,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize def test_path_params_list(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): @@ -891,6 +896,7 @@ async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare protocol="tcp/22", ) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: app = await async_client.spectrum.apps.list( @@ -898,6 +904,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: ) assert_matches_type(AsyncV4PagePaginationArray[Optional[AppListResponse]], app, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: app = await async_client.spectrum.apps.list( @@ -909,6 +916,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) ) assert_matches_type(AsyncV4PagePaginationArray[Optional[AppListResponse]], app, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.spectrum.apps.with_raw_response.list( @@ -920,6 +928,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: app = await response.parse() assert_matches_type(AsyncV4PagePaginationArray[Optional[AppListResponse]], app, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.spectrum.apps.with_streaming_response.list( @@ -933,6 +942,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate HTTP 422 errors on test suite") @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): diff --git a/tests/api_resources/test_abuse_reports.py b/tests/api_resources/test_abuse_reports.py new file mode 100644 index 00000000000..ff8d92dee38 --- /dev/null +++ b/tests/api_resources/test_abuse_reports.py @@ -0,0 +1,243 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestAbuseReports: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") + @parametrize + def test_method_create(self, client: Cloudflare) -> None: + abuse_report = client.abuse_reports.create( + report_type="abuse_dmca", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + act="abuse_dmca", + email="email", + email2="email2", + host_notification="send", + ncmec_notification="send", + owner_notification="send", + urls="urls", + ) + assert_matches_type(str, abuse_report, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") + @parametrize + def test_method_create_with_all_params(self, client: Cloudflare) -> None: + abuse_report = client.abuse_reports.create( + report_type="abuse_dmca", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + act="abuse_dmca", + email="email", + email2="email2", + host_notification="send", + ncmec_notification="send", + owner_notification="send", + urls="urls", + address1="x", + agent_name="x", + agree=0, + city="x", + comments="x", + company="x", + country="x", + destination_ips="destination_ips", + justification="x", + name="x", + ncsei_subject_representation=True, + original_work="x", + ports_protocols="ports_protocols", + signature="signature", + source_ips="source_ips", + state="x", + tele="x", + title="x", + trademark_number="x", + trademark_office="x", + trademark_symbol="x", + ) + assert_matches_type(str, abuse_report, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") + @parametrize + def test_raw_response_create(self, client: Cloudflare) -> None: + response = client.abuse_reports.with_raw_response.create( + report_type="abuse_dmca", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + act="abuse_dmca", + email="email", + email2="email2", + host_notification="send", + ncmec_notification="send", + owner_notification="send", + urls="urls", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + abuse_report = response.parse() + assert_matches_type(str, abuse_report, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") + @parametrize + def test_streaming_response_create(self, client: Cloudflare) -> None: + with client.abuse_reports.with_streaming_response.create( + report_type="abuse_dmca", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + act="abuse_dmca", + email="email", + email2="email2", + host_notification="send", + ncmec_notification="send", + owner_notification="send", + urls="urls", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + abuse_report = response.parse() + assert_matches_type(str, abuse_report, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") + @parametrize + def test_path_params_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.abuse_reports.with_raw_response.create( + report_type="abuse_dmca", + account_id="", + act="abuse_dmca", + email="email", + email2="email2", + host_notification="send", + ncmec_notification="send", + owner_notification="send", + urls="urls", + ) + + +class TestAsyncAbuseReports: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") + @parametrize + async def test_method_create(self, async_client: AsyncCloudflare) -> None: + abuse_report = await async_client.abuse_reports.create( + report_type="abuse_dmca", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + act="abuse_dmca", + email="email", + email2="email2", + host_notification="send", + ncmec_notification="send", + owner_notification="send", + urls="urls", + ) + assert_matches_type(str, abuse_report, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: + abuse_report = await async_client.abuse_reports.create( + report_type="abuse_dmca", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + act="abuse_dmca", + email="email", + email2="email2", + host_notification="send", + ncmec_notification="send", + owner_notification="send", + urls="urls", + address1="x", + agent_name="x", + agree=0, + city="x", + comments="x", + company="x", + country="x", + destination_ips="destination_ips", + justification="x", + name="x", + ncsei_subject_representation=True, + original_work="x", + ports_protocols="ports_protocols", + signature="signature", + source_ips="source_ips", + state="x", + tele="x", + title="x", + trademark_number="x", + trademark_office="x", + trademark_symbol="x", + ) + assert_matches_type(str, abuse_report, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") + @parametrize + async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: + response = await async_client.abuse_reports.with_raw_response.create( + report_type="abuse_dmca", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + act="abuse_dmca", + email="email", + email2="email2", + host_notification="send", + ncmec_notification="send", + owner_notification="send", + urls="urls", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + abuse_report = await response.parse() + assert_matches_type(str, abuse_report, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") + @parametrize + async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: + async with async_client.abuse_reports.with_streaming_response.create( + report_type="abuse_dmca", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + act="abuse_dmca", + email="email", + email2="email2", + host_notification="send", + ncmec_notification="send", + owner_notification="send", + urls="urls", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + abuse_report = await response.parse() + assert_matches_type(str, abuse_report, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") + @parametrize + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.abuse_reports.with_raw_response.create( + report_type="abuse_dmca", + account_id="", + act="abuse_dmca", + email="email", + email2="email2", + host_notification="send", + ncmec_notification="send", + owner_notification="send", + urls="urls", + ) diff --git a/tests/api_resources/workers/test_ai.py b/tests/api_resources/test_ai.py similarity index 87% rename from tests/api_resources/workers/test_ai.py rename to tests/api_resources/test_ai.py index 4f9e0996455..ab8fa8cc49c 100644 --- a/tests/api_resources/workers/test_ai.py +++ b/tests/api_resources/test_ai.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.workers import AIRunResponse +from cloudflare.types.ai import AIRunResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,7 +19,7 @@ class TestAI: @parametrize def test_method_run_overload_1(self, client: Cloudflare) -> None: - ai = client.workers.ai.run( + ai = client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", text="x", @@ -28,7 +28,7 @@ def test_method_run_overload_1(self, client: Cloudflare) -> None: @parametrize def test_raw_response_run_overload_1(self, client: Cloudflare) -> None: - response = client.workers.ai.with_raw_response.run( + response = client.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", text="x", @@ -41,7 +41,7 @@ def test_raw_response_run_overload_1(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_run_overload_1(self, client: Cloudflare) -> None: - with client.workers.ai.with_streaming_response.run( + with client.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", text="x", @@ -57,14 +57,14 @@ def test_streaming_response_run_overload_1(self, client: Cloudflare) -> None: @parametrize def test_path_params_run_overload_1(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.workers.ai.with_raw_response.run( + client.ai.with_raw_response.run( model_name="model_name", account_id="", text="x", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - client.workers.ai.with_raw_response.run( + client.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", text="x", @@ -72,7 +72,7 @@ def test_path_params_run_overload_1(self, client: Cloudflare) -> None: @parametrize def test_method_run_overload_2(self, client: Cloudflare) -> None: - ai = client.workers.ai.run( + ai = client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -81,7 +81,7 @@ def test_method_run_overload_2(self, client: Cloudflare) -> None: @parametrize def test_method_run_with_all_params_overload_2(self, client: Cloudflare) -> None: - ai = client.workers.ai.run( + ai = client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -100,7 +100,7 @@ def test_method_run_with_all_params_overload_2(self, client: Cloudflare) -> None @parametrize def test_raw_response_run_overload_2(self, client: Cloudflare) -> None: - response = client.workers.ai.with_raw_response.run( + response = client.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -113,7 +113,7 @@ def test_raw_response_run_overload_2(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_run_overload_2(self, client: Cloudflare) -> None: - with client.workers.ai.with_streaming_response.run( + with client.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -129,14 +129,14 @@ def test_streaming_response_run_overload_2(self, client: Cloudflare) -> None: @parametrize def test_path_params_run_overload_2(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.workers.ai.with_raw_response.run( + client.ai.with_raw_response.run( model_name="model_name", account_id="", prompt="x", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - client.workers.ai.with_raw_response.run( + client.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -144,7 +144,7 @@ def test_path_params_run_overload_2(self, client: Cloudflare) -> None: @parametrize def test_method_run_overload_3(self, client: Cloudflare) -> None: - ai = client.workers.ai.run( + ai = client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -153,7 +153,7 @@ def test_method_run_overload_3(self, client: Cloudflare) -> None: @parametrize def test_method_run_with_all_params_overload_3(self, client: Cloudflare) -> None: - ai = client.workers.ai.run( + ai = client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -163,7 +163,7 @@ def test_method_run_with_all_params_overload_3(self, client: Cloudflare) -> None @parametrize def test_raw_response_run_overload_3(self, client: Cloudflare) -> None: - response = client.workers.ai.with_raw_response.run( + response = client.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -176,7 +176,7 @@ def test_raw_response_run_overload_3(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_run_overload_3(self, client: Cloudflare) -> None: - with client.workers.ai.with_streaming_response.run( + with client.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -192,14 +192,14 @@ def test_streaming_response_run_overload_3(self, client: Cloudflare) -> None: @parametrize def test_path_params_run_overload_3(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.workers.ai.with_raw_response.run( + client.ai.with_raw_response.run( model_name="model_name", account_id="", prompt="x", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - client.workers.ai.with_raw_response.run( + client.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -207,7 +207,7 @@ def test_path_params_run_overload_3(self, client: Cloudflare) -> None: @parametrize def test_method_run_overload_4(self, client: Cloudflare) -> None: - ai = client.workers.ai.run( + ai = client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", text="x", @@ -216,7 +216,7 @@ def test_method_run_overload_4(self, client: Cloudflare) -> None: @parametrize def test_raw_response_run_overload_4(self, client: Cloudflare) -> None: - response = client.workers.ai.with_raw_response.run( + response = client.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", text="x", @@ -229,7 +229,7 @@ def test_raw_response_run_overload_4(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_run_overload_4(self, client: Cloudflare) -> None: - with client.workers.ai.with_streaming_response.run( + with client.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", text="x", @@ -245,14 +245,14 @@ def test_streaming_response_run_overload_4(self, client: Cloudflare) -> None: @parametrize def test_path_params_run_overload_4(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.workers.ai.with_raw_response.run( + client.ai.with_raw_response.run( model_name="model_name", account_id="", text="x", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - client.workers.ai.with_raw_response.run( + client.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", text="x", @@ -260,7 +260,7 @@ def test_path_params_run_overload_4(self, client: Cloudflare) -> None: @parametrize def test_method_run_overload_5(self, client: Cloudflare) -> None: - ai = client.workers.ai.run( + ai = client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", audio=[0], @@ -269,7 +269,7 @@ def test_method_run_overload_5(self, client: Cloudflare) -> None: @parametrize def test_method_run_with_all_params_overload_5(self, client: Cloudflare) -> None: - ai = client.workers.ai.run( + ai = client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", audio=[0], @@ -280,7 +280,7 @@ def test_method_run_with_all_params_overload_5(self, client: Cloudflare) -> None @parametrize def test_raw_response_run_overload_5(self, client: Cloudflare) -> None: - response = client.workers.ai.with_raw_response.run( + response = client.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", audio=[0], @@ -293,7 +293,7 @@ def test_raw_response_run_overload_5(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_run_overload_5(self, client: Cloudflare) -> None: - with client.workers.ai.with_streaming_response.run( + with client.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", audio=[0], @@ -309,14 +309,14 @@ def test_streaming_response_run_overload_5(self, client: Cloudflare) -> None: @parametrize def test_path_params_run_overload_5(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.workers.ai.with_raw_response.run( + client.ai.with_raw_response.run( model_name="model_name", account_id="", audio=[0], ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - client.workers.ai.with_raw_response.run( + client.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", audio=[0], @@ -324,7 +324,7 @@ def test_path_params_run_overload_5(self, client: Cloudflare) -> None: @parametrize def test_method_run_overload_6(self, client: Cloudflare) -> None: - ai = client.workers.ai.run( + ai = client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -333,7 +333,7 @@ def test_method_run_overload_6(self, client: Cloudflare) -> None: @parametrize def test_raw_response_run_overload_6(self, client: Cloudflare) -> None: - response = client.workers.ai.with_raw_response.run( + response = client.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -346,7 +346,7 @@ def test_raw_response_run_overload_6(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_run_overload_6(self, client: Cloudflare) -> None: - with client.workers.ai.with_streaming_response.run( + with client.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -362,14 +362,14 @@ def test_streaming_response_run_overload_6(self, client: Cloudflare) -> None: @parametrize def test_path_params_run_overload_6(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.workers.ai.with_raw_response.run( + client.ai.with_raw_response.run( model_name="model_name", account_id="", image=[0], ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - client.workers.ai.with_raw_response.run( + client.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -377,7 +377,7 @@ def test_path_params_run_overload_6(self, client: Cloudflare) -> None: @parametrize def test_method_run_overload_7(self, client: Cloudflare) -> None: - ai = client.workers.ai.run( + ai = client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -385,7 +385,7 @@ def test_method_run_overload_7(self, client: Cloudflare) -> None: @parametrize def test_method_run_with_all_params_overload_7(self, client: Cloudflare) -> None: - ai = client.workers.ai.run( + ai = client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -394,7 +394,7 @@ def test_method_run_with_all_params_overload_7(self, client: Cloudflare) -> None @parametrize def test_raw_response_run_overload_7(self, client: Cloudflare) -> None: - response = client.workers.ai.with_raw_response.run( + response = client.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -406,7 +406,7 @@ def test_raw_response_run_overload_7(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_run_overload_7(self, client: Cloudflare) -> None: - with client.workers.ai.with_streaming_response.run( + with client.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -421,20 +421,20 @@ def test_streaming_response_run_overload_7(self, client: Cloudflare) -> None: @parametrize def test_path_params_run_overload_7(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.workers.ai.with_raw_response.run( + client.ai.with_raw_response.run( model_name="model_name", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - client.workers.ai.with_raw_response.run( + client.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @parametrize def test_method_run_overload_8(self, client: Cloudflare) -> None: - ai = client.workers.ai.run( + ai = client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -443,7 +443,7 @@ def test_method_run_overload_8(self, client: Cloudflare) -> None: @parametrize def test_method_run_with_all_params_overload_8(self, client: Cloudflare) -> None: - ai = client.workers.ai.run( + ai = client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -463,7 +463,7 @@ def test_method_run_with_all_params_overload_8(self, client: Cloudflare) -> None @parametrize def test_raw_response_run_overload_8(self, client: Cloudflare) -> None: - response = client.workers.ai.with_raw_response.run( + response = client.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -476,7 +476,7 @@ def test_raw_response_run_overload_8(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_run_overload_8(self, client: Cloudflare) -> None: - with client.workers.ai.with_streaming_response.run( + with client.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -492,14 +492,14 @@ def test_streaming_response_run_overload_8(self, client: Cloudflare) -> None: @parametrize def test_path_params_run_overload_8(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.workers.ai.with_raw_response.run( + client.ai.with_raw_response.run( model_name="model_name", account_id="", prompt="x", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - client.workers.ai.with_raw_response.run( + client.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -507,7 +507,7 @@ def test_path_params_run_overload_8(self, client: Cloudflare) -> None: @parametrize def test_method_run_overload_9(self, client: Cloudflare) -> None: - ai = client.workers.ai.run( + ai = client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", messages=[ @@ -521,7 +521,7 @@ def test_method_run_overload_9(self, client: Cloudflare) -> None: @parametrize def test_method_run_with_all_params_overload_9(self, client: Cloudflare) -> None: - ai = client.workers.ai.run( + ai = client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", messages=[ @@ -566,7 +566,7 @@ def test_method_run_with_all_params_overload_9(self, client: Cloudflare) -> None @parametrize def test_raw_response_run_overload_9(self, client: Cloudflare) -> None: - response = client.workers.ai.with_raw_response.run( + response = client.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", messages=[ @@ -584,7 +584,7 @@ def test_raw_response_run_overload_9(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_run_overload_9(self, client: Cloudflare) -> None: - with client.workers.ai.with_streaming_response.run( + with client.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", messages=[ @@ -605,7 +605,7 @@ def test_streaming_response_run_overload_9(self, client: Cloudflare) -> None: @parametrize def test_path_params_run_overload_9(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.workers.ai.with_raw_response.run( + client.ai.with_raw_response.run( model_name="model_name", account_id="", messages=[ @@ -617,7 +617,7 @@ def test_path_params_run_overload_9(self, client: Cloudflare) -> None: ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - client.workers.ai.with_raw_response.run( + client.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", messages=[ @@ -630,7 +630,7 @@ def test_path_params_run_overload_9(self, client: Cloudflare) -> None: @parametrize def test_method_run_overload_10(self, client: Cloudflare) -> None: - ai = client.workers.ai.run( + ai = client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", target_lang="target_lang", @@ -640,7 +640,7 @@ def test_method_run_overload_10(self, client: Cloudflare) -> None: @parametrize def test_method_run_with_all_params_overload_10(self, client: Cloudflare) -> None: - ai = client.workers.ai.run( + ai = client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", target_lang="target_lang", @@ -651,7 +651,7 @@ def test_method_run_with_all_params_overload_10(self, client: Cloudflare) -> Non @parametrize def test_raw_response_run_overload_10(self, client: Cloudflare) -> None: - response = client.workers.ai.with_raw_response.run( + response = client.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", target_lang="target_lang", @@ -665,7 +665,7 @@ def test_raw_response_run_overload_10(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_run_overload_10(self, client: Cloudflare) -> None: - with client.workers.ai.with_streaming_response.run( + with client.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", target_lang="target_lang", @@ -682,7 +682,7 @@ def test_streaming_response_run_overload_10(self, client: Cloudflare) -> None: @parametrize def test_path_params_run_overload_10(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.workers.ai.with_raw_response.run( + client.ai.with_raw_response.run( model_name="model_name", account_id="", target_lang="target_lang", @@ -690,7 +690,7 @@ def test_path_params_run_overload_10(self, client: Cloudflare) -> None: ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - client.workers.ai.with_raw_response.run( + client.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", target_lang="target_lang", @@ -699,7 +699,7 @@ def test_path_params_run_overload_10(self, client: Cloudflare) -> None: @parametrize def test_method_run_overload_11(self, client: Cloudflare) -> None: - ai = client.workers.ai.run( + ai = client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", input_text="x", @@ -708,7 +708,7 @@ def test_method_run_overload_11(self, client: Cloudflare) -> None: @parametrize def test_method_run_with_all_params_overload_11(self, client: Cloudflare) -> None: - ai = client.workers.ai.run( + ai = client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", input_text="x", @@ -718,7 +718,7 @@ def test_method_run_with_all_params_overload_11(self, client: Cloudflare) -> Non @parametrize def test_raw_response_run_overload_11(self, client: Cloudflare) -> None: - response = client.workers.ai.with_raw_response.run( + response = client.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", input_text="x", @@ -731,7 +731,7 @@ def test_raw_response_run_overload_11(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_run_overload_11(self, client: Cloudflare) -> None: - with client.workers.ai.with_streaming_response.run( + with client.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", input_text="x", @@ -747,14 +747,14 @@ def test_streaming_response_run_overload_11(self, client: Cloudflare) -> None: @parametrize def test_path_params_run_overload_11(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.workers.ai.with_raw_response.run( + client.ai.with_raw_response.run( model_name="model_name", account_id="", input_text="x", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - client.workers.ai.with_raw_response.run( + client.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", input_text="x", @@ -762,7 +762,7 @@ def test_path_params_run_overload_11(self, client: Cloudflare) -> None: @parametrize def test_method_run_overload_12(self, client: Cloudflare) -> None: - ai = client.workers.ai.run( + ai = client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -771,7 +771,7 @@ def test_method_run_overload_12(self, client: Cloudflare) -> None: @parametrize def test_method_run_with_all_params_overload_12(self, client: Cloudflare) -> None: - ai = client.workers.ai.run( + ai = client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -784,7 +784,7 @@ def test_method_run_with_all_params_overload_12(self, client: Cloudflare) -> Non @parametrize def test_raw_response_run_overload_12(self, client: Cloudflare) -> None: - response = client.workers.ai.with_raw_response.run( + response = client.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -797,7 +797,7 @@ def test_raw_response_run_overload_12(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_run_overload_12(self, client: Cloudflare) -> None: - with client.workers.ai.with_streaming_response.run( + with client.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -813,14 +813,14 @@ def test_streaming_response_run_overload_12(self, client: Cloudflare) -> None: @parametrize def test_path_params_run_overload_12(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.workers.ai.with_raw_response.run( + client.ai.with_raw_response.run( model_name="model_name", account_id="", image=[0], ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - client.workers.ai.with_raw_response.run( + client.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -832,7 +832,7 @@ class TestAsyncAI: @parametrize async def test_method_run_overload_1(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.workers.ai.run( + ai = await async_client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", text="x", @@ -841,7 +841,7 @@ async def test_method_run_overload_1(self, async_client: AsyncCloudflare) -> Non @parametrize async def test_raw_response_run_overload_1(self, async_client: AsyncCloudflare) -> None: - response = await async_client.workers.ai.with_raw_response.run( + response = await async_client.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", text="x", @@ -854,7 +854,7 @@ async def test_raw_response_run_overload_1(self, async_client: AsyncCloudflare) @parametrize async def test_streaming_response_run_overload_1(self, async_client: AsyncCloudflare) -> None: - async with async_client.workers.ai.with_streaming_response.run( + async with async_client.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", text="x", @@ -870,14 +870,14 @@ async def test_streaming_response_run_overload_1(self, async_client: AsyncCloudf @parametrize async def test_path_params_run_overload_1(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.workers.ai.with_raw_response.run( + await async_client.ai.with_raw_response.run( model_name="model_name", account_id="", text="x", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - await async_client.workers.ai.with_raw_response.run( + await async_client.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", text="x", @@ -885,7 +885,7 @@ async def test_path_params_run_overload_1(self, async_client: AsyncCloudflare) - @parametrize async def test_method_run_overload_2(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.workers.ai.run( + ai = await async_client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -894,7 +894,7 @@ async def test_method_run_overload_2(self, async_client: AsyncCloudflare) -> Non @parametrize async def test_method_run_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.workers.ai.run( + ai = await async_client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -913,7 +913,7 @@ async def test_method_run_with_all_params_overload_2(self, async_client: AsyncCl @parametrize async def test_raw_response_run_overload_2(self, async_client: AsyncCloudflare) -> None: - response = await async_client.workers.ai.with_raw_response.run( + response = await async_client.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -926,7 +926,7 @@ async def test_raw_response_run_overload_2(self, async_client: AsyncCloudflare) @parametrize async def test_streaming_response_run_overload_2(self, async_client: AsyncCloudflare) -> None: - async with async_client.workers.ai.with_streaming_response.run( + async with async_client.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -942,14 +942,14 @@ async def test_streaming_response_run_overload_2(self, async_client: AsyncCloudf @parametrize async def test_path_params_run_overload_2(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.workers.ai.with_raw_response.run( + await async_client.ai.with_raw_response.run( model_name="model_name", account_id="", prompt="x", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - await async_client.workers.ai.with_raw_response.run( + await async_client.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -957,7 +957,7 @@ async def test_path_params_run_overload_2(self, async_client: AsyncCloudflare) - @parametrize async def test_method_run_overload_3(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.workers.ai.run( + ai = await async_client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -966,7 +966,7 @@ async def test_method_run_overload_3(self, async_client: AsyncCloudflare) -> Non @parametrize async def test_method_run_with_all_params_overload_3(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.workers.ai.run( + ai = await async_client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -976,7 +976,7 @@ async def test_method_run_with_all_params_overload_3(self, async_client: AsyncCl @parametrize async def test_raw_response_run_overload_3(self, async_client: AsyncCloudflare) -> None: - response = await async_client.workers.ai.with_raw_response.run( + response = await async_client.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -989,7 +989,7 @@ async def test_raw_response_run_overload_3(self, async_client: AsyncCloudflare) @parametrize async def test_streaming_response_run_overload_3(self, async_client: AsyncCloudflare) -> None: - async with async_client.workers.ai.with_streaming_response.run( + async with async_client.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -1005,14 +1005,14 @@ async def test_streaming_response_run_overload_3(self, async_client: AsyncCloudf @parametrize async def test_path_params_run_overload_3(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.workers.ai.with_raw_response.run( + await async_client.ai.with_raw_response.run( model_name="model_name", account_id="", prompt="x", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - await async_client.workers.ai.with_raw_response.run( + await async_client.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -1020,7 +1020,7 @@ async def test_path_params_run_overload_3(self, async_client: AsyncCloudflare) - @parametrize async def test_method_run_overload_4(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.workers.ai.run( + ai = await async_client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", text="x", @@ -1029,7 +1029,7 @@ async def test_method_run_overload_4(self, async_client: AsyncCloudflare) -> Non @parametrize async def test_raw_response_run_overload_4(self, async_client: AsyncCloudflare) -> None: - response = await async_client.workers.ai.with_raw_response.run( + response = await async_client.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", text="x", @@ -1042,7 +1042,7 @@ async def test_raw_response_run_overload_4(self, async_client: AsyncCloudflare) @parametrize async def test_streaming_response_run_overload_4(self, async_client: AsyncCloudflare) -> None: - async with async_client.workers.ai.with_streaming_response.run( + async with async_client.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", text="x", @@ -1058,14 +1058,14 @@ async def test_streaming_response_run_overload_4(self, async_client: AsyncCloudf @parametrize async def test_path_params_run_overload_4(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.workers.ai.with_raw_response.run( + await async_client.ai.with_raw_response.run( model_name="model_name", account_id="", text="x", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - await async_client.workers.ai.with_raw_response.run( + await async_client.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", text="x", @@ -1073,7 +1073,7 @@ async def test_path_params_run_overload_4(self, async_client: AsyncCloudflare) - @parametrize async def test_method_run_overload_5(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.workers.ai.run( + ai = await async_client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", audio=[0], @@ -1082,7 +1082,7 @@ async def test_method_run_overload_5(self, async_client: AsyncCloudflare) -> Non @parametrize async def test_method_run_with_all_params_overload_5(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.workers.ai.run( + ai = await async_client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", audio=[0], @@ -1093,7 +1093,7 @@ async def test_method_run_with_all_params_overload_5(self, async_client: AsyncCl @parametrize async def test_raw_response_run_overload_5(self, async_client: AsyncCloudflare) -> None: - response = await async_client.workers.ai.with_raw_response.run( + response = await async_client.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", audio=[0], @@ -1106,7 +1106,7 @@ async def test_raw_response_run_overload_5(self, async_client: AsyncCloudflare) @parametrize async def test_streaming_response_run_overload_5(self, async_client: AsyncCloudflare) -> None: - async with async_client.workers.ai.with_streaming_response.run( + async with async_client.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", audio=[0], @@ -1122,14 +1122,14 @@ async def test_streaming_response_run_overload_5(self, async_client: AsyncCloudf @parametrize async def test_path_params_run_overload_5(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.workers.ai.with_raw_response.run( + await async_client.ai.with_raw_response.run( model_name="model_name", account_id="", audio=[0], ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - await async_client.workers.ai.with_raw_response.run( + await async_client.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", audio=[0], @@ -1137,7 +1137,7 @@ async def test_path_params_run_overload_5(self, async_client: AsyncCloudflare) - @parametrize async def test_method_run_overload_6(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.workers.ai.run( + ai = await async_client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -1146,7 +1146,7 @@ async def test_method_run_overload_6(self, async_client: AsyncCloudflare) -> Non @parametrize async def test_raw_response_run_overload_6(self, async_client: AsyncCloudflare) -> None: - response = await async_client.workers.ai.with_raw_response.run( + response = await async_client.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -1159,7 +1159,7 @@ async def test_raw_response_run_overload_6(self, async_client: AsyncCloudflare) @parametrize async def test_streaming_response_run_overload_6(self, async_client: AsyncCloudflare) -> None: - async with async_client.workers.ai.with_streaming_response.run( + async with async_client.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -1175,14 +1175,14 @@ async def test_streaming_response_run_overload_6(self, async_client: AsyncCloudf @parametrize async def test_path_params_run_overload_6(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.workers.ai.with_raw_response.run( + await async_client.ai.with_raw_response.run( model_name="model_name", account_id="", image=[0], ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - await async_client.workers.ai.with_raw_response.run( + await async_client.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -1190,7 +1190,7 @@ async def test_path_params_run_overload_6(self, async_client: AsyncCloudflare) - @parametrize async def test_method_run_overload_7(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.workers.ai.run( + ai = await async_client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -1198,7 +1198,7 @@ async def test_method_run_overload_7(self, async_client: AsyncCloudflare) -> Non @parametrize async def test_method_run_with_all_params_overload_7(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.workers.ai.run( + ai = await async_client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -1207,7 +1207,7 @@ async def test_method_run_with_all_params_overload_7(self, async_client: AsyncCl @parametrize async def test_raw_response_run_overload_7(self, async_client: AsyncCloudflare) -> None: - response = await async_client.workers.ai.with_raw_response.run( + response = await async_client.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -1219,7 +1219,7 @@ async def test_raw_response_run_overload_7(self, async_client: AsyncCloudflare) @parametrize async def test_streaming_response_run_overload_7(self, async_client: AsyncCloudflare) -> None: - async with async_client.workers.ai.with_streaming_response.run( + async with async_client.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -1234,20 +1234,20 @@ async def test_streaming_response_run_overload_7(self, async_client: AsyncCloudf @parametrize async def test_path_params_run_overload_7(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.workers.ai.with_raw_response.run( + await async_client.ai.with_raw_response.run( model_name="model_name", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - await async_client.workers.ai.with_raw_response.run( + await async_client.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @parametrize async def test_method_run_overload_8(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.workers.ai.run( + ai = await async_client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -1256,7 +1256,7 @@ async def test_method_run_overload_8(self, async_client: AsyncCloudflare) -> Non @parametrize async def test_method_run_with_all_params_overload_8(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.workers.ai.run( + ai = await async_client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -1276,7 +1276,7 @@ async def test_method_run_with_all_params_overload_8(self, async_client: AsyncCl @parametrize async def test_raw_response_run_overload_8(self, async_client: AsyncCloudflare) -> None: - response = await async_client.workers.ai.with_raw_response.run( + response = await async_client.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -1289,7 +1289,7 @@ async def test_raw_response_run_overload_8(self, async_client: AsyncCloudflare) @parametrize async def test_streaming_response_run_overload_8(self, async_client: AsyncCloudflare) -> None: - async with async_client.workers.ai.with_streaming_response.run( + async with async_client.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -1305,14 +1305,14 @@ async def test_streaming_response_run_overload_8(self, async_client: AsyncCloudf @parametrize async def test_path_params_run_overload_8(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.workers.ai.with_raw_response.run( + await async_client.ai.with_raw_response.run( model_name="model_name", account_id="", prompt="x", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - await async_client.workers.ai.with_raw_response.run( + await async_client.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", prompt="x", @@ -1320,7 +1320,7 @@ async def test_path_params_run_overload_8(self, async_client: AsyncCloudflare) - @parametrize async def test_method_run_overload_9(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.workers.ai.run( + ai = await async_client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", messages=[ @@ -1334,7 +1334,7 @@ async def test_method_run_overload_9(self, async_client: AsyncCloudflare) -> Non @parametrize async def test_method_run_with_all_params_overload_9(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.workers.ai.run( + ai = await async_client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", messages=[ @@ -1379,7 +1379,7 @@ async def test_method_run_with_all_params_overload_9(self, async_client: AsyncCl @parametrize async def test_raw_response_run_overload_9(self, async_client: AsyncCloudflare) -> None: - response = await async_client.workers.ai.with_raw_response.run( + response = await async_client.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", messages=[ @@ -1397,7 +1397,7 @@ async def test_raw_response_run_overload_9(self, async_client: AsyncCloudflare) @parametrize async def test_streaming_response_run_overload_9(self, async_client: AsyncCloudflare) -> None: - async with async_client.workers.ai.with_streaming_response.run( + async with async_client.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", messages=[ @@ -1418,7 +1418,7 @@ async def test_streaming_response_run_overload_9(self, async_client: AsyncCloudf @parametrize async def test_path_params_run_overload_9(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.workers.ai.with_raw_response.run( + await async_client.ai.with_raw_response.run( model_name="model_name", account_id="", messages=[ @@ -1430,7 +1430,7 @@ async def test_path_params_run_overload_9(self, async_client: AsyncCloudflare) - ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - await async_client.workers.ai.with_raw_response.run( + await async_client.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", messages=[ @@ -1443,7 +1443,7 @@ async def test_path_params_run_overload_9(self, async_client: AsyncCloudflare) - @parametrize async def test_method_run_overload_10(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.workers.ai.run( + ai = await async_client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", target_lang="target_lang", @@ -1453,7 +1453,7 @@ async def test_method_run_overload_10(self, async_client: AsyncCloudflare) -> No @parametrize async def test_method_run_with_all_params_overload_10(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.workers.ai.run( + ai = await async_client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", target_lang="target_lang", @@ -1464,7 +1464,7 @@ async def test_method_run_with_all_params_overload_10(self, async_client: AsyncC @parametrize async def test_raw_response_run_overload_10(self, async_client: AsyncCloudflare) -> None: - response = await async_client.workers.ai.with_raw_response.run( + response = await async_client.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", target_lang="target_lang", @@ -1478,7 +1478,7 @@ async def test_raw_response_run_overload_10(self, async_client: AsyncCloudflare) @parametrize async def test_streaming_response_run_overload_10(self, async_client: AsyncCloudflare) -> None: - async with async_client.workers.ai.with_streaming_response.run( + async with async_client.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", target_lang="target_lang", @@ -1495,7 +1495,7 @@ async def test_streaming_response_run_overload_10(self, async_client: AsyncCloud @parametrize async def test_path_params_run_overload_10(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.workers.ai.with_raw_response.run( + await async_client.ai.with_raw_response.run( model_name="model_name", account_id="", target_lang="target_lang", @@ -1503,7 +1503,7 @@ async def test_path_params_run_overload_10(self, async_client: AsyncCloudflare) ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - await async_client.workers.ai.with_raw_response.run( + await async_client.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", target_lang="target_lang", @@ -1512,7 +1512,7 @@ async def test_path_params_run_overload_10(self, async_client: AsyncCloudflare) @parametrize async def test_method_run_overload_11(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.workers.ai.run( + ai = await async_client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", input_text="x", @@ -1521,7 +1521,7 @@ async def test_method_run_overload_11(self, async_client: AsyncCloudflare) -> No @parametrize async def test_method_run_with_all_params_overload_11(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.workers.ai.run( + ai = await async_client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", input_text="x", @@ -1531,7 +1531,7 @@ async def test_method_run_with_all_params_overload_11(self, async_client: AsyncC @parametrize async def test_raw_response_run_overload_11(self, async_client: AsyncCloudflare) -> None: - response = await async_client.workers.ai.with_raw_response.run( + response = await async_client.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", input_text="x", @@ -1544,7 +1544,7 @@ async def test_raw_response_run_overload_11(self, async_client: AsyncCloudflare) @parametrize async def test_streaming_response_run_overload_11(self, async_client: AsyncCloudflare) -> None: - async with async_client.workers.ai.with_streaming_response.run( + async with async_client.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", input_text="x", @@ -1560,14 +1560,14 @@ async def test_streaming_response_run_overload_11(self, async_client: AsyncCloud @parametrize async def test_path_params_run_overload_11(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.workers.ai.with_raw_response.run( + await async_client.ai.with_raw_response.run( model_name="model_name", account_id="", input_text="x", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - await async_client.workers.ai.with_raw_response.run( + await async_client.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", input_text="x", @@ -1575,7 +1575,7 @@ async def test_path_params_run_overload_11(self, async_client: AsyncCloudflare) @parametrize async def test_method_run_overload_12(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.workers.ai.run( + ai = await async_client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -1584,7 +1584,7 @@ async def test_method_run_overload_12(self, async_client: AsyncCloudflare) -> No @parametrize async def test_method_run_with_all_params_overload_12(self, async_client: AsyncCloudflare) -> None: - ai = await async_client.workers.ai.run( + ai = await async_client.ai.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -1597,7 +1597,7 @@ async def test_method_run_with_all_params_overload_12(self, async_client: AsyncC @parametrize async def test_raw_response_run_overload_12(self, async_client: AsyncCloudflare) -> None: - response = await async_client.workers.ai.with_raw_response.run( + response = await async_client.ai.with_raw_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -1610,7 +1610,7 @@ async def test_raw_response_run_overload_12(self, async_client: AsyncCloudflare) @parametrize async def test_streaming_response_run_overload_12(self, async_client: AsyncCloudflare) -> None: - async with async_client.workers.ai.with_streaming_response.run( + async with async_client.ai.with_streaming_response.run( model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], @@ -1626,14 +1626,14 @@ async def test_streaming_response_run_overload_12(self, async_client: AsyncCloud @parametrize async def test_path_params_run_overload_12(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.workers.ai.with_raw_response.run( + await async_client.ai.with_raw_response.run( model_name="model_name", account_id="", image=[0], ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): - await async_client.workers.ai.with_raw_response.run( + await async_client.ai.with_raw_response.run( model_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], diff --git a/tests/api_resources/test_ai_gateway.py b/tests/api_resources/test_ai_gateway.py index 8c33ce4e9fa..410c03d585f 100644 --- a/tests/api_resources/test_ai_gateway.py +++ b/tests/api_resources/test_ai_gateway.py @@ -211,8 +211,6 @@ def test_method_list(self, client: Cloudflare) -> None: def test_method_list_with_all_params(self, client: Cloudflare) -> None: ai_gateway = client.ai_gateway.list( account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0", - order_by="order_by", - order_by_direction="asc", page=1, per_page=1, search="search", @@ -537,8 +535,6 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: ai_gateway = await async_client.ai_gateway.list( account_id="3ebbcb006d4d46d7bb6a8c7f14676cb0", - order_by="order_by", - order_by_direction="asc", page=1, per_page=1, search="search", diff --git a/tests/api_resources/test_filters.py b/tests/api_resources/test_filters.py index eb126fb8162..c85398c274e 100644 --- a/tests/api_resources/test_filters.py +++ b/tests/api_resources/test_filters.py @@ -293,6 +293,7 @@ def test_path_params_bulk_delete(self, client: Cloudflare) -> None: zone_id="", ) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_method_bulk_update(self, client: Cloudflare) -> None: with pytest.warns(DeprecationWarning): @@ -302,6 +303,7 @@ def test_method_bulk_update(self, client: Cloudflare) -> None: assert_matches_type(Optional[FilterBulkUpdateResponse], filter, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_raw_response_bulk_update(self, client: Cloudflare) -> None: with pytest.warns(DeprecationWarning): @@ -314,6 +316,7 @@ def test_raw_response_bulk_update(self, client: Cloudflare) -> None: filter = response.parse() assert_matches_type(Optional[FilterBulkUpdateResponse], filter, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_streaming_response_bulk_update(self, client: Cloudflare) -> None: with pytest.warns(DeprecationWarning): @@ -328,6 +331,7 @@ def test_streaming_response_bulk_update(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_bulk_update(self, client: Cloudflare) -> None: with pytest.warns(DeprecationWarning): @@ -661,6 +665,7 @@ async def test_path_params_bulk_delete(self, async_client: AsyncCloudflare) -> N zone_id="", ) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_bulk_update(self, async_client: AsyncCloudflare) -> None: with pytest.warns(DeprecationWarning): @@ -670,6 +675,7 @@ async def test_method_bulk_update(self, async_client: AsyncCloudflare) -> None: assert_matches_type(Optional[FilterBulkUpdateResponse], filter, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_raw_response_bulk_update(self, async_client: AsyncCloudflare) -> None: with pytest.warns(DeprecationWarning): @@ -682,6 +688,7 @@ async def test_raw_response_bulk_update(self, async_client: AsyncCloudflare) -> filter = await response.parse() assert_matches_type(Optional[FilterBulkUpdateResponse], filter, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_streaming_response_bulk_update(self, async_client: AsyncCloudflare) -> None: with pytest.warns(DeprecationWarning): @@ -696,6 +703,7 @@ async def test_streaming_response_bulk_update(self, async_client: AsyncCloudflar assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_bulk_update(self, async_client: AsyncCloudflare) -> None: with pytest.warns(DeprecationWarning): diff --git a/tests/api_resources/test_managed_transforms.py b/tests/api_resources/test_managed_transforms.py index 895eb3ee9fa..f00cf76c8b0 100644 --- a/tests/api_resources/test_managed_transforms.py +++ b/tests/api_resources/test_managed_transforms.py @@ -20,17 +20,19 @@ class TestManagedTransforms: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize def test_method_list(self, client: Cloudflare) -> None: managed_transform = client.managed_transforms.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="9f1839b6152d298aca64c4e906b6d074", ) assert_matches_type(ManagedTransformListResponse, managed_transform, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.managed_transforms.with_raw_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="9f1839b6152d298aca64c4e906b6d074", ) assert response.is_closed is True @@ -38,10 +40,11 @@ def test_raw_response_list(self, client: Cloudflare) -> None: managed_transform = response.parse() assert_matches_type(ManagedTransformListResponse, managed_transform, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.managed_transforms.with_streaming_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="9f1839b6152d298aca64c4e906b6d074", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -51,6 +54,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize def test_path_params_list(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): @@ -58,21 +62,85 @@ def test_path_params_list(self, client: Cloudflare) -> None: zone_id="", ) + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") + @parametrize + def test_method_delete(self, client: Cloudflare) -> None: + managed_transform = client.managed_transforms.delete( + zone_id="9f1839b6152d298aca64c4e906b6d074", + ) + assert managed_transform is None + + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") + @parametrize + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.managed_transforms.with_raw_response.delete( + zone_id="9f1839b6152d298aca64c4e906b6d074", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + managed_transform = response.parse() + assert managed_transform is None + + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") + @parametrize + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.managed_transforms.with_streaming_response.delete( + zone_id="9f1839b6152d298aca64c4e906b6d074", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + managed_transform = response.parse() + assert managed_transform is None + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") + @parametrize + def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.managed_transforms.with_raw_response.delete( + zone_id="", + ) + + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize def test_method_edit(self, client: Cloudflare) -> None: managed_transform = client.managed_transforms.edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - managed_request_headers=[{}], - managed_response_headers=[{}], + zone_id="9f1839b6152d298aca64c4e906b6d074", + managed_request_headers=[ + { + "id": "add_bot_protection_headers", + "enabled": True, + } + ], + managed_response_headers=[ + { + "id": "add_security_headers", + "enabled": True, + } + ], ) assert_matches_type(ManagedTransformEditResponse, managed_transform, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: response = client.managed_transforms.with_raw_response.edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - managed_request_headers=[{}], - managed_response_headers=[{}], + zone_id="9f1839b6152d298aca64c4e906b6d074", + managed_request_headers=[ + { + "id": "add_bot_protection_headers", + "enabled": True, + } + ], + managed_response_headers=[ + { + "id": "add_security_headers", + "enabled": True, + } + ], ) assert response.is_closed is True @@ -80,12 +148,23 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: managed_transform = response.parse() assert_matches_type(ManagedTransformEditResponse, managed_transform, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: with client.managed_transforms.with_streaming_response.edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - managed_request_headers=[{}], - managed_response_headers=[{}], + zone_id="9f1839b6152d298aca64c4e906b6d074", + managed_request_headers=[ + { + "id": "add_bot_protection_headers", + "enabled": True, + } + ], + managed_response_headers=[ + { + "id": "add_security_headers", + "enabled": True, + } + ], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -95,30 +174,43 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize def test_path_params_edit(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.managed_transforms.with_raw_response.edit( zone_id="", - managed_request_headers=[{}], - managed_response_headers=[{}], + managed_request_headers=[ + { + "id": "add_bot_protection_headers", + "enabled": True, + } + ], + managed_response_headers=[ + { + "id": "add_security_headers", + "enabled": True, + } + ], ) class TestAsyncManagedTransforms: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: managed_transform = await async_client.managed_transforms.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="9f1839b6152d298aca64c4e906b6d074", ) assert_matches_type(ManagedTransformListResponse, managed_transform, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.managed_transforms.with_raw_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="9f1839b6152d298aca64c4e906b6d074", ) assert response.is_closed is True @@ -126,10 +218,11 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: managed_transform = await response.parse() assert_matches_type(ManagedTransformListResponse, managed_transform, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.managed_transforms.with_streaming_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="9f1839b6152d298aca64c4e906b6d074", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -139,6 +232,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): @@ -146,21 +240,85 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: zone_id="", ) + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") + @parametrize + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + managed_transform = await async_client.managed_transforms.delete( + zone_id="9f1839b6152d298aca64c4e906b6d074", + ) + assert managed_transform is None + + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") + @parametrize + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.managed_transforms.with_raw_response.delete( + zone_id="9f1839b6152d298aca64c4e906b6d074", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + managed_transform = await response.parse() + assert managed_transform is None + + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.managed_transforms.with_streaming_response.delete( + zone_id="9f1839b6152d298aca64c4e906b6d074", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + managed_transform = await response.parse() + assert managed_transform is None + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") + @parametrize + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.managed_transforms.with_raw_response.delete( + zone_id="", + ) + + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize async def test_method_edit(self, async_client: AsyncCloudflare) -> None: managed_transform = await async_client.managed_transforms.edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - managed_request_headers=[{}], - managed_response_headers=[{}], + zone_id="9f1839b6152d298aca64c4e906b6d074", + managed_request_headers=[ + { + "id": "add_bot_protection_headers", + "enabled": True, + } + ], + managed_response_headers=[ + { + "id": "add_security_headers", + "enabled": True, + } + ], ) assert_matches_type(ManagedTransformEditResponse, managed_transform, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: response = await async_client.managed_transforms.with_raw_response.edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - managed_request_headers=[{}], - managed_response_headers=[{}], + zone_id="9f1839b6152d298aca64c4e906b6d074", + managed_request_headers=[ + { + "id": "add_bot_protection_headers", + "enabled": True, + } + ], + managed_response_headers=[ + { + "id": "add_security_headers", + "enabled": True, + } + ], ) assert response.is_closed is True @@ -168,12 +326,23 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: managed_transform = await response.parse() assert_matches_type(ManagedTransformEditResponse, managed_transform, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: async with async_client.managed_transforms.with_streaming_response.edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - managed_request_headers=[{}], - managed_response_headers=[{}], + zone_id="9f1839b6152d298aca64c4e906b6d074", + managed_request_headers=[ + { + "id": "add_bot_protection_headers", + "enabled": True, + } + ], + managed_response_headers=[ + { + "id": "add_security_headers", + "enabled": True, + } + ], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -183,11 +352,22 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.managed_transforms.with_raw_response.edit( zone_id="", - managed_request_headers=[{}], - managed_response_headers=[{}], + managed_request_headers=[ + { + "id": "add_bot_protection_headers", + "enabled": True, + } + ], + managed_response_headers=[ + { + "id": "add_security_headers", + "enabled": True, + } + ], ) diff --git a/tests/api_resources/test_origin_post_quantum_encryption.py b/tests/api_resources/test_origin_post_quantum_encryption.py index 7b671649427..5be62d7556c 100644 --- a/tests/api_resources/test_origin_post_quantum_encryption.py +++ b/tests/api_resources/test_origin_post_quantum_encryption.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -28,7 +28,7 @@ def test_method_update(self, client: Cloudflare) -> None: value="preferred", ) assert_matches_type( - OriginPostQuantumEncryptionUpdateResponse, origin_post_quantum_encryption, path=["response"] + Optional[OriginPostQuantumEncryptionUpdateResponse], origin_post_quantum_encryption, path=["response"] ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -43,7 +43,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_post_quantum_encryption = response.parse() assert_matches_type( - OriginPostQuantumEncryptionUpdateResponse, origin_post_quantum_encryption, path=["response"] + Optional[OriginPostQuantumEncryptionUpdateResponse], origin_post_quantum_encryption, path=["response"] ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -58,7 +58,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: origin_post_quantum_encryption = response.parse() assert_matches_type( - OriginPostQuantumEncryptionUpdateResponse, origin_post_quantum_encryption, path=["response"] + Optional[OriginPostQuantumEncryptionUpdateResponse], origin_post_quantum_encryption, path=["response"] ) assert cast(Any, response.is_closed) is True @@ -78,7 +78,9 @@ def test_method_get(self, client: Cloudflare) -> None: origin_post_quantum_encryption = client.origin_post_quantum_encryption.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(OriginPostQuantumEncryptionGetResponse, origin_post_quantum_encryption, path=["response"]) + assert_matches_type( + Optional[OriginPostQuantumEncryptionGetResponse], origin_post_quantum_encryption, path=["response"] + ) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -90,7 +92,9 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_post_quantum_encryption = response.parse() - assert_matches_type(OriginPostQuantumEncryptionGetResponse, origin_post_quantum_encryption, path=["response"]) + assert_matches_type( + Optional[OriginPostQuantumEncryptionGetResponse], origin_post_quantum_encryption, path=["response"] + ) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -103,7 +107,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: origin_post_quantum_encryption = response.parse() assert_matches_type( - OriginPostQuantumEncryptionGetResponse, origin_post_quantum_encryption, path=["response"] + Optional[OriginPostQuantumEncryptionGetResponse], origin_post_quantum_encryption, path=["response"] ) assert cast(Any, response.is_closed) is True @@ -128,7 +132,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: value="preferred", ) assert_matches_type( - OriginPostQuantumEncryptionUpdateResponse, origin_post_quantum_encryption, path=["response"] + Optional[OriginPostQuantumEncryptionUpdateResponse], origin_post_quantum_encryption, path=["response"] ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -143,7 +147,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_post_quantum_encryption = await response.parse() assert_matches_type( - OriginPostQuantumEncryptionUpdateResponse, origin_post_quantum_encryption, path=["response"] + Optional[OriginPostQuantumEncryptionUpdateResponse], origin_post_quantum_encryption, path=["response"] ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -158,7 +162,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> origin_post_quantum_encryption = await response.parse() assert_matches_type( - OriginPostQuantumEncryptionUpdateResponse, origin_post_quantum_encryption, path=["response"] + Optional[OriginPostQuantumEncryptionUpdateResponse], origin_post_quantum_encryption, path=["response"] ) assert cast(Any, response.is_closed) is True @@ -178,7 +182,9 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: origin_post_quantum_encryption = await async_client.origin_post_quantum_encryption.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(OriginPostQuantumEncryptionGetResponse, origin_post_quantum_encryption, path=["response"]) + assert_matches_type( + Optional[OriginPostQuantumEncryptionGetResponse], origin_post_quantum_encryption, path=["response"] + ) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -190,7 +196,9 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_post_quantum_encryption = await response.parse() - assert_matches_type(OriginPostQuantumEncryptionGetResponse, origin_post_quantum_encryption, path=["response"]) + assert_matches_type( + Optional[OriginPostQuantumEncryptionGetResponse], origin_post_quantum_encryption, path=["response"] + ) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -203,7 +211,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No origin_post_quantum_encryption = await response.parse() assert_matches_type( - OriginPostQuantumEncryptionGetResponse, origin_post_quantum_encryption, path=["response"] + Optional[OriginPostQuantumEncryptionGetResponse], origin_post_quantum_encryption, path=["response"] ) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_url_normalization.py b/tests/api_resources/test_url_normalization.py index bd0ad470a31..961a3f7b78d 100644 --- a/tests/api_resources/test_url_normalization.py +++ b/tests/api_resources/test_url_normalization.py @@ -20,26 +20,23 @@ class TestURLNormalization: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize def test_method_update(self, client: Cloudflare) -> None: url_normalization = client.url_normalization.update( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(URLNormalizationUpdateResponse, url_normalization, path=["response"]) - - @parametrize - def test_method_update_with_all_params(self, client: Cloudflare) -> None: - url_normalization = client.url_normalization.update( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="9f1839b6152d298aca64c4e906b6d074", scope="incoming", type="cloudflare", ) assert_matches_type(URLNormalizationUpdateResponse, url_normalization, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: response = client.url_normalization.with_raw_response.update( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="9f1839b6152d298aca64c4e906b6d074", + scope="incoming", + type="cloudflare", ) assert response.is_closed is True @@ -47,10 +44,13 @@ def test_raw_response_update(self, client: Cloudflare) -> None: url_normalization = response.parse() assert_matches_type(URLNormalizationUpdateResponse, url_normalization, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: with client.url_normalization.with_streaming_response.update( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="9f1839b6152d298aca64c4e906b6d074", + scope="incoming", + type="cloudflare", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -60,24 +60,71 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.url_normalization.with_raw_response.update( zone_id="", + scope="incoming", + type="cloudflare", + ) + + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") + @parametrize + def test_method_delete(self, client: Cloudflare) -> None: + url_normalization = client.url_normalization.delete( + zone_id="9f1839b6152d298aca64c4e906b6d074", + ) + assert url_normalization is None + + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") + @parametrize + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.url_normalization.with_raw_response.delete( + zone_id="9f1839b6152d298aca64c4e906b6d074", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + url_normalization = response.parse() + assert url_normalization is None + + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") + @parametrize + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.url_normalization.with_streaming_response.delete( + zone_id="9f1839b6152d298aca64c4e906b6d074", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + url_normalization = response.parse() + assert url_normalization is None + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") + @parametrize + def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.url_normalization.with_raw_response.delete( + zone_id="", ) + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize def test_method_get(self, client: Cloudflare) -> None: url_normalization = client.url_normalization.get( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="9f1839b6152d298aca64c4e906b6d074", ) assert_matches_type(URLNormalizationGetResponse, url_normalization, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: response = client.url_normalization.with_raw_response.get( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="9f1839b6152d298aca64c4e906b6d074", ) assert response.is_closed is True @@ -85,10 +132,11 @@ def test_raw_response_get(self, client: Cloudflare) -> None: url_normalization = response.parse() assert_matches_type(URLNormalizationGetResponse, url_normalization, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: with client.url_normalization.with_streaming_response.get( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="9f1839b6152d298aca64c4e906b6d074", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -98,6 +146,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): @@ -109,26 +158,23 @@ def test_path_params_get(self, client: Cloudflare) -> None: class TestAsyncURLNormalization: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize async def test_method_update(self, async_client: AsyncCloudflare) -> None: url_normalization = await async_client.url_normalization.update( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(URLNormalizationUpdateResponse, url_normalization, path=["response"]) - - @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: - url_normalization = await async_client.url_normalization.update( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="9f1839b6152d298aca64c4e906b6d074", scope="incoming", type="cloudflare", ) assert_matches_type(URLNormalizationUpdateResponse, url_normalization, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.url_normalization.with_raw_response.update( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="9f1839b6152d298aca64c4e906b6d074", + scope="incoming", + type="cloudflare", ) assert response.is_closed is True @@ -136,10 +182,13 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: url_normalization = await response.parse() assert_matches_type(URLNormalizationUpdateResponse, url_normalization, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.url_normalization.with_streaming_response.update( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="9f1839b6152d298aca64c4e906b6d074", + scope="incoming", + type="cloudflare", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -149,24 +198,71 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.url_normalization.with_raw_response.update( zone_id="", + scope="incoming", + type="cloudflare", + ) + + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") + @parametrize + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + url_normalization = await async_client.url_normalization.delete( + zone_id="9f1839b6152d298aca64c4e906b6d074", + ) + assert url_normalization is None + + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") + @parametrize + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.url_normalization.with_raw_response.delete( + zone_id="9f1839b6152d298aca64c4e906b6d074", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + url_normalization = await response.parse() + assert url_normalization is None + + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.url_normalization.with_streaming_response.delete( + zone_id="9f1839b6152d298aca64c4e906b6d074", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + url_normalization = await response.parse() + assert url_normalization is None + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") + @parametrize + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.url_normalization.with_raw_response.delete( + zone_id="", ) + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: url_normalization = await async_client.url_normalization.get( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="9f1839b6152d298aca64c4e906b6d074", ) assert_matches_type(URLNormalizationGetResponse, url_normalization, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.url_normalization.with_raw_response.get( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="9f1839b6152d298aca64c4e906b6d074", ) assert response.is_closed is True @@ -174,10 +270,11 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: url_normalization = await response.parse() assert_matches_type(URLNormalizationGetResponse, url_normalization, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.url_normalization.with_streaming_response.get( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="9f1839b6152d298aca64c4e906b6d074", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -187,6 +284,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate unauthorized HTTP response") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): diff --git a/tests/api_resources/test_waiting_rooms.py b/tests/api_resources/test_waiting_rooms.py index fb3506d55e7..73949870677 100644 --- a/tests/api_resources/test_waiting_rooms.py +++ b/tests/api_resources/test_waiting_rooms.py @@ -63,6 +63,8 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: queueing_status_code=200, session_duration=1, suspended=True, + turnstile_action="log", + turnstile_mode="off", ) assert_matches_type(WaitingRoom, waiting_room, path=["response"]) @@ -153,6 +155,8 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: queueing_status_code=200, session_duration=1, suspended=True, + turnstile_action="log", + turnstile_mode="off", ) assert_matches_type(WaitingRoom, waiting_room, path=["response"]) @@ -351,6 +355,8 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: queueing_status_code=200, session_duration=1, suspended=True, + turnstile_action="log", + turnstile_mode="off", ) assert_matches_type(WaitingRoom, waiting_room, path=["response"]) @@ -504,6 +510,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare queueing_status_code=200, session_duration=1, suspended=True, + turnstile_action="log", + turnstile_mode="off", ) assert_matches_type(WaitingRoom, waiting_room, path=["response"]) @@ -594,6 +602,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare queueing_status_code=200, session_duration=1, suspended=True, + turnstile_action="log", + turnstile_mode="off", ) assert_matches_type(WaitingRoom, waiting_room, path=["response"]) @@ -792,6 +802,8 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) queueing_status_code=200, session_duration=1, suspended=True, + turnstile_action="log", + turnstile_mode="off", ) assert_matches_type(WaitingRoom, waiting_room, path=["response"]) diff --git a/tests/api_resources/url_scanner/test_responses.py b/tests/api_resources/url_scanner/test_responses.py index 5fe0f1eb19e..1690ba966df 100644 --- a/tests/api_resources/url_scanner/test_responses.py +++ b/tests/api_resources/url_scanner/test_responses.py @@ -19,16 +19,16 @@ class TestResponses: @parametrize def test_method_get(self, client: Cloudflare) -> None: response = client.url_scanner.responses.get( - response_id="responseId", - account_id="accountId", + response_id="response_id", + account_id="account_id", ) assert_matches_type(str, response, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: http_response = client.url_scanner.responses.with_raw_response.get( - response_id="responseId", - account_id="accountId", + response_id="response_id", + account_id="account_id", ) assert http_response.is_closed is True @@ -39,8 +39,8 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: with client.url_scanner.responses.with_streaming_response.get( - response_id="responseId", - account_id="accountId", + response_id="response_id", + account_id="account_id", ) as http_response: assert not http_response.is_closed assert http_response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -54,14 +54,14 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.url_scanner.responses.with_raw_response.get( - response_id="responseId", + response_id="response_id", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `response_id` but received ''"): client.url_scanner.responses.with_raw_response.get( response_id="", - account_id="accountId", + account_id="account_id", ) @@ -71,16 +71,16 @@ class TestAsyncResponses: @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.url_scanner.responses.get( - response_id="responseId", - account_id="accountId", + response_id="response_id", + account_id="account_id", ) assert_matches_type(str, response, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: http_response = await async_client.url_scanner.responses.with_raw_response.get( - response_id="responseId", - account_id="accountId", + response_id="response_id", + account_id="account_id", ) assert http_response.is_closed is True @@ -91,8 +91,8 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.url_scanner.responses.with_streaming_response.get( - response_id="responseId", - account_id="accountId", + response_id="response_id", + account_id="account_id", ) as http_response: assert not http_response.is_closed assert http_response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -106,12 +106,12 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.url_scanner.responses.with_raw_response.get( - response_id="responseId", + response_id="response_id", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `response_id` but received ''"): await async_client.url_scanner.responses.with_raw_response.get( response_id="", - account_id="accountId", + account_id="account_id", ) diff --git a/tests/api_resources/url_scanner/test_scans.py b/tests/api_resources/url_scanner/test_scans.py index eb8d6e905a9..aaa1385a9bb 100644 --- a/tests/api_resources/url_scanner/test_scans.py +++ b/tests/api_resources/url_scanner/test_scans.py @@ -33,7 +33,7 @@ class TestScans: @parametrize def test_method_create(self, client: Cloudflare) -> None: scan = client.url_scanner.scans.create( - account_id="accountId", + account_id="account_id", url="https://www.example.com", ) assert_matches_type(str, scan, path=["response"]) @@ -41,7 +41,7 @@ def test_method_create(self, client: Cloudflare) -> None: @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: scan = client.url_scanner.scans.create( - account_id="accountId", + account_id="account_id", url="https://www.example.com", customagent="customagent", custom_headers={"foo": "string"}, @@ -54,7 +54,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: response = client.url_scanner.scans.with_raw_response.create( - account_id="accountId", + account_id="account_id", url="https://www.example.com", ) @@ -66,7 +66,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: with client.url_scanner.scans.with_streaming_response.create( - account_id="accountId", + account_id="account_id", url="https://www.example.com", ) as response: assert not response.is_closed @@ -88,14 +88,14 @@ def test_path_params_create(self, client: Cloudflare) -> None: @parametrize def test_method_list(self, client: Cloudflare) -> None: scan = client.url_scanner.scans.list( - account_id="accountId", + account_id="account_id", ) assert_matches_type(ScanListResponse, scan, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: scan = client.url_scanner.scans.list( - account_id="accountId", + account_id="account_id", q="q", size=100, ) @@ -104,7 +104,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.url_scanner.scans.with_raw_response.list( - account_id="accountId", + account_id="account_id", ) assert response.is_closed is True @@ -115,7 +115,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.url_scanner.scans.with_streaming_response.list( - account_id="accountId", + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -135,7 +135,7 @@ def test_path_params_list(self, client: Cloudflare) -> None: @parametrize def test_method_bulk_create(self, client: Cloudflare) -> None: scan = client.url_scanner.scans.bulk_create( - account_id="accountId", + account_id="account_id", body=[{"url": "https://www.example.com"}], ) assert_matches_type(ScanBulkCreateResponse, scan, path=["response"]) @@ -143,7 +143,7 @@ def test_method_bulk_create(self, client: Cloudflare) -> None: @parametrize def test_raw_response_bulk_create(self, client: Cloudflare) -> None: response = client.url_scanner.scans.with_raw_response.bulk_create( - account_id="accountId", + account_id="account_id", body=[{"url": "https://www.example.com"}], ) @@ -155,7 +155,7 @@ def test_raw_response_bulk_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_bulk_create(self, client: Cloudflare) -> None: with client.url_scanner.scans.with_streaming_response.bulk_create( - account_id="accountId", + account_id="account_id", body=[{"url": "https://www.example.com"}], ) as response: assert not response.is_closed @@ -178,7 +178,7 @@ def test_path_params_bulk_create(self, client: Cloudflare) -> None: def test_method_dom(self, client: Cloudflare) -> None: scan = client.url_scanner.scans.dom( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="accountId", + account_id="account_id", ) assert_matches_type(str, scan, path=["response"]) @@ -186,7 +186,7 @@ def test_method_dom(self, client: Cloudflare) -> None: def test_raw_response_dom(self, client: Cloudflare) -> None: response = client.url_scanner.scans.with_raw_response.dom( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="accountId", + account_id="account_id", ) assert response.is_closed is True @@ -198,7 +198,7 @@ def test_raw_response_dom(self, client: Cloudflare) -> None: def test_streaming_response_dom(self, client: Cloudflare) -> None: with client.url_scanner.scans.with_streaming_response.dom( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="accountId", + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -219,22 +219,24 @@ def test_path_params_dom(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `scan_id` but received ''"): client.url_scanner.scans.with_raw_response.dom( scan_id="", - account_id="accountId", + account_id="account_id", ) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_method_get(self, client: Cloudflare) -> None: scan = client.url_scanner.scans.get( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="accountId", + account_id="account_id", ) assert_matches_type(ScanGetResponse, scan, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: response = client.url_scanner.scans.with_raw_response.get( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="accountId", + account_id="account_id", ) assert response.is_closed is True @@ -242,11 +244,12 @@ def test_raw_response_get(self, client: Cloudflare) -> None: scan = response.parse() assert_matches_type(ScanGetResponse, scan, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: with client.url_scanner.scans.with_streaming_response.get( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="accountId", + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -256,6 +259,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -267,14 +271,14 @@ def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `scan_id` but received ''"): client.url_scanner.scans.with_raw_response.get( scan_id="", - account_id="accountId", + account_id="account_id", ) @parametrize def test_method_har(self, client: Cloudflare) -> None: scan = client.url_scanner.scans.har( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="accountId", + account_id="account_id", ) assert_matches_type(ScanHARResponse, scan, path=["response"]) @@ -282,7 +286,7 @@ def test_method_har(self, client: Cloudflare) -> None: def test_raw_response_har(self, client: Cloudflare) -> None: response = client.url_scanner.scans.with_raw_response.har( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="accountId", + account_id="account_id", ) assert response.is_closed is True @@ -294,7 +298,7 @@ def test_raw_response_har(self, client: Cloudflare) -> None: def test_streaming_response_har(self, client: Cloudflare) -> None: with client.url_scanner.scans.with_streaming_response.har( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="accountId", + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -315,18 +319,18 @@ def test_path_params_har(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `scan_id` but received ''"): client.url_scanner.scans.with_raw_response.har( scan_id="", - account_id="accountId", + account_id="account_id", ) @parametrize @pytest.mark.respx(base_url=base_url) def test_method_screenshot(self, client: Cloudflare, respx_mock: MockRouter) -> None: - respx_mock.get("/accounts/accountId/urlscanner/v2/screenshots/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e.png").mock( + respx_mock.get("/accounts/account_id/urlscanner/v2/screenshots/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e.png").mock( return_value=httpx.Response(200, json={"foo": "bar"}) ) scan = client.url_scanner.scans.screenshot( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="accountId", + account_id="account_id", ) assert scan.is_closed assert scan.json() == {"foo": "bar"} @@ -336,12 +340,12 @@ def test_method_screenshot(self, client: Cloudflare, respx_mock: MockRouter) -> @parametrize @pytest.mark.respx(base_url=base_url) def test_method_screenshot_with_all_params(self, client: Cloudflare, respx_mock: MockRouter) -> None: - respx_mock.get("/accounts/accountId/urlscanner/v2/screenshots/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e.png").mock( + respx_mock.get("/accounts/account_id/urlscanner/v2/screenshots/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e.png").mock( return_value=httpx.Response(200, json={"foo": "bar"}) ) scan = client.url_scanner.scans.screenshot( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="accountId", + account_id="account_id", resolution="desktop", ) assert scan.is_closed @@ -352,13 +356,13 @@ def test_method_screenshot_with_all_params(self, client: Cloudflare, respx_mock: @parametrize @pytest.mark.respx(base_url=base_url) def test_raw_response_screenshot(self, client: Cloudflare, respx_mock: MockRouter) -> None: - respx_mock.get("/accounts/accountId/urlscanner/v2/screenshots/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e.png").mock( + respx_mock.get("/accounts/account_id/urlscanner/v2/screenshots/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e.png").mock( return_value=httpx.Response(200, json={"foo": "bar"}) ) scan = client.url_scanner.scans.with_raw_response.screenshot( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="accountId", + account_id="account_id", ) assert scan.is_closed is True @@ -369,12 +373,12 @@ def test_raw_response_screenshot(self, client: Cloudflare, respx_mock: MockRoute @parametrize @pytest.mark.respx(base_url=base_url) def test_streaming_response_screenshot(self, client: Cloudflare, respx_mock: MockRouter) -> None: - respx_mock.get("/accounts/accountId/urlscanner/v2/screenshots/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e.png").mock( + respx_mock.get("/accounts/account_id/urlscanner/v2/screenshots/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e.png").mock( return_value=httpx.Response(200, json={"foo": "bar"}) ) with client.url_scanner.scans.with_streaming_response.screenshot( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="accountId", + account_id="account_id", ) as scan: assert not scan.is_closed assert scan.http_request.headers.get("X-Stainless-Lang") == "python" @@ -397,7 +401,7 @@ def test_path_params_screenshot(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `scan_id` but received ''"): client.url_scanner.scans.with_raw_response.screenshot( scan_id="", - account_id="accountId", + account_id="account_id", ) @@ -407,7 +411,7 @@ class TestAsyncScans: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: scan = await async_client.url_scanner.scans.create( - account_id="accountId", + account_id="account_id", url="https://www.example.com", ) assert_matches_type(str, scan, path=["response"]) @@ -415,7 +419,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: scan = await async_client.url_scanner.scans.create( - account_id="accountId", + account_id="account_id", url="https://www.example.com", customagent="customagent", custom_headers={"foo": "string"}, @@ -428,7 +432,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.url_scanner.scans.with_raw_response.create( - account_id="accountId", + account_id="account_id", url="https://www.example.com", ) @@ -440,7 +444,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.url_scanner.scans.with_streaming_response.create( - account_id="accountId", + account_id="account_id", url="https://www.example.com", ) as response: assert not response.is_closed @@ -462,14 +466,14 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: scan = await async_client.url_scanner.scans.list( - account_id="accountId", + account_id="account_id", ) assert_matches_type(ScanListResponse, scan, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: scan = await async_client.url_scanner.scans.list( - account_id="accountId", + account_id="account_id", q="q", size=100, ) @@ -478,7 +482,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.url_scanner.scans.with_raw_response.list( - account_id="accountId", + account_id="account_id", ) assert response.is_closed is True @@ -489,7 +493,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.url_scanner.scans.with_streaming_response.list( - account_id="accountId", + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -509,7 +513,7 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_bulk_create(self, async_client: AsyncCloudflare) -> None: scan = await async_client.url_scanner.scans.bulk_create( - account_id="accountId", + account_id="account_id", body=[{"url": "https://www.example.com"}], ) assert_matches_type(ScanBulkCreateResponse, scan, path=["response"]) @@ -517,7 +521,7 @@ async def test_method_bulk_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_bulk_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.url_scanner.scans.with_raw_response.bulk_create( - account_id="accountId", + account_id="account_id", body=[{"url": "https://www.example.com"}], ) @@ -529,7 +533,7 @@ async def test_raw_response_bulk_create(self, async_client: AsyncCloudflare) -> @parametrize async def test_streaming_response_bulk_create(self, async_client: AsyncCloudflare) -> None: async with async_client.url_scanner.scans.with_streaming_response.bulk_create( - account_id="accountId", + account_id="account_id", body=[{"url": "https://www.example.com"}], ) as response: assert not response.is_closed @@ -552,7 +556,7 @@ async def test_path_params_bulk_create(self, async_client: AsyncCloudflare) -> N async def test_method_dom(self, async_client: AsyncCloudflare) -> None: scan = await async_client.url_scanner.scans.dom( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="accountId", + account_id="account_id", ) assert_matches_type(str, scan, path=["response"]) @@ -560,7 +564,7 @@ async def test_method_dom(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_dom(self, async_client: AsyncCloudflare) -> None: response = await async_client.url_scanner.scans.with_raw_response.dom( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="accountId", + account_id="account_id", ) assert response.is_closed is True @@ -572,7 +576,7 @@ async def test_raw_response_dom(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_dom(self, async_client: AsyncCloudflare) -> None: async with async_client.url_scanner.scans.with_streaming_response.dom( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="accountId", + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -593,22 +597,24 @@ async def test_path_params_dom(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `scan_id` but received ''"): await async_client.url_scanner.scans.with_raw_response.dom( scan_id="", - account_id="accountId", + account_id="account_id", ) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: scan = await async_client.url_scanner.scans.get( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="accountId", + account_id="account_id", ) assert_matches_type(ScanGetResponse, scan, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.url_scanner.scans.with_raw_response.get( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="accountId", + account_id="account_id", ) assert response.is_closed is True @@ -616,11 +622,12 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: scan = await response.parse() assert_matches_type(ScanGetResponse, scan, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.url_scanner.scans.with_streaming_response.get( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="accountId", + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -630,6 +637,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -641,14 +649,14 @@ async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `scan_id` but received ''"): await async_client.url_scanner.scans.with_raw_response.get( scan_id="", - account_id="accountId", + account_id="account_id", ) @parametrize async def test_method_har(self, async_client: AsyncCloudflare) -> None: scan = await async_client.url_scanner.scans.har( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="accountId", + account_id="account_id", ) assert_matches_type(ScanHARResponse, scan, path=["response"]) @@ -656,7 +664,7 @@ async def test_method_har(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_har(self, async_client: AsyncCloudflare) -> None: response = await async_client.url_scanner.scans.with_raw_response.har( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="accountId", + account_id="account_id", ) assert response.is_closed is True @@ -668,7 +676,7 @@ async def test_raw_response_har(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_har(self, async_client: AsyncCloudflare) -> None: async with async_client.url_scanner.scans.with_streaming_response.har( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="accountId", + account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -689,18 +697,18 @@ async def test_path_params_har(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `scan_id` but received ''"): await async_client.url_scanner.scans.with_raw_response.har( scan_id="", - account_id="accountId", + account_id="account_id", ) @parametrize @pytest.mark.respx(base_url=base_url) async def test_method_screenshot(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None: - respx_mock.get("/accounts/accountId/urlscanner/v2/screenshots/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e.png").mock( + respx_mock.get("/accounts/account_id/urlscanner/v2/screenshots/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e.png").mock( return_value=httpx.Response(200, json={"foo": "bar"}) ) scan = await async_client.url_scanner.scans.screenshot( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="accountId", + account_id="account_id", ) assert scan.is_closed assert await scan.json() == {"foo": "bar"} @@ -712,12 +720,12 @@ async def test_method_screenshot(self, async_client: AsyncCloudflare, respx_mock async def test_method_screenshot_with_all_params( self, async_client: AsyncCloudflare, respx_mock: MockRouter ) -> None: - respx_mock.get("/accounts/accountId/urlscanner/v2/screenshots/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e.png").mock( + respx_mock.get("/accounts/account_id/urlscanner/v2/screenshots/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e.png").mock( return_value=httpx.Response(200, json={"foo": "bar"}) ) scan = await async_client.url_scanner.scans.screenshot( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="accountId", + account_id="account_id", resolution="desktop", ) assert scan.is_closed @@ -728,13 +736,13 @@ async def test_method_screenshot_with_all_params( @parametrize @pytest.mark.respx(base_url=base_url) async def test_raw_response_screenshot(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None: - respx_mock.get("/accounts/accountId/urlscanner/v2/screenshots/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e.png").mock( + respx_mock.get("/accounts/account_id/urlscanner/v2/screenshots/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e.png").mock( return_value=httpx.Response(200, json={"foo": "bar"}) ) scan = await async_client.url_scanner.scans.with_raw_response.screenshot( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="accountId", + account_id="account_id", ) assert scan.is_closed is True @@ -745,12 +753,12 @@ async def test_raw_response_screenshot(self, async_client: AsyncCloudflare, resp @parametrize @pytest.mark.respx(base_url=base_url) async def test_streaming_response_screenshot(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None: - respx_mock.get("/accounts/accountId/urlscanner/v2/screenshots/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e.png").mock( + respx_mock.get("/accounts/account_id/urlscanner/v2/screenshots/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e.png").mock( return_value=httpx.Response(200, json={"foo": "bar"}) ) async with async_client.url_scanner.scans.with_streaming_response.screenshot( scan_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - account_id="accountId", + account_id="account_id", ) as scan: assert not scan.is_closed assert scan.http_request.headers.get("X-Stainless-Lang") == "python" @@ -773,5 +781,5 @@ async def test_path_params_screenshot(self, async_client: AsyncCloudflare) -> No with pytest.raises(ValueError, match=r"Expected a non-empty value for `scan_id` but received ''"): await async_client.url_scanner.scans.with_raw_response.screenshot( scan_id="", - account_id="accountId", + account_id="account_id", ) diff --git a/tests/api_resources/user/test_tokens.py b/tests/api_resources/user/test_tokens.py index 81169dc8e56..3ad7952d607 100644 --- a/tests/api_resources/user/test_tokens.py +++ b/tests/api_resources/user/test_tokens.py @@ -33,7 +33,10 @@ def test_method_create(self, client: Cloudflare) -> None: { "effect": "allow", "permission_groups": [{}, {}], - "resources": {}, + "resources": { + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }, } ], ) @@ -62,8 +65,8 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: }, ], "resources": { - "resource": "resource", - "scope": "scope", + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", }, } ], @@ -87,7 +90,10 @@ def test_raw_response_create(self, client: Cloudflare) -> None: { "effect": "allow", "permission_groups": [{}, {}], - "resources": {}, + "resources": { + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }, } ], ) @@ -106,7 +112,10 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: { "effect": "allow", "permission_groups": [{}, {}], - "resources": {}, + "resources": { + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }, } ], ) as response: @@ -158,8 +167,8 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: }, ], "resources": { - "resource": "resource", - "scope": "scope", + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", }, } ], @@ -364,7 +373,10 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: { "effect": "allow", "permission_groups": [{}, {}], - "resources": {}, + "resources": { + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }, } ], ) @@ -393,8 +405,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare }, ], "resources": { - "resource": "resource", - "scope": "scope", + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", }, } ], @@ -418,7 +430,10 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: { "effect": "allow", "permission_groups": [{}, {}], - "resources": {}, + "resources": { + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }, } ], ) @@ -437,7 +452,10 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> { "effect": "allow", "permission_groups": [{}, {}], - "resources": {}, + "resources": { + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }, } ], ) as response: @@ -489,8 +507,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare }, ], "resources": { - "resource": "resource", - "scope": "scope", + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", }, } ], diff --git a/tests/api_resources/vectorize/test_indexes.py b/tests/api_resources/vectorize/test_indexes.py index 97fe5c1b9e8..272871b4418 100644 --- a/tests/api_resources/vectorize/test_indexes.py +++ b/tests/api_resources/vectorize/test_indexes.py @@ -141,7 +141,7 @@ def test_method_delete(self, client: Cloudflare) -> None: index_name="example-index", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(IndexDeleteResponse, index, path=["response"]) + assert_matches_type(Optional[IndexDeleteResponse], index, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -153,7 +153,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" index = response.parse() - assert_matches_type(IndexDeleteResponse, index, path=["response"]) + assert_matches_type(Optional[IndexDeleteResponse], index, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -165,7 +165,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" index = response.parse() - assert_matches_type(IndexDeleteResponse, index, path=["response"]) + assert_matches_type(Optional[IndexDeleteResponse], index, path=["response"]) assert cast(Any, response.is_closed) is True @@ -717,7 +717,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: index_name="example-index", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(IndexDeleteResponse, index, path=["response"]) + assert_matches_type(Optional[IndexDeleteResponse], index, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -729,7 +729,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" index = await response.parse() - assert_matches_type(IndexDeleteResponse, index, path=["response"]) + assert_matches_type(Optional[IndexDeleteResponse], index, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -741,7 +741,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" index = await response.parse() - assert_matches_type(IndexDeleteResponse, index, path=["response"]) + assert_matches_type(Optional[IndexDeleteResponse], index, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/workers/scripts/test_content.py b/tests/api_resources/workers/scripts/test_content.py index 24a9e4d4cf5..9f7629d9227 100644 --- a/tests/api_resources/workers/scripts/test_content.py +++ b/tests/api_resources/workers/scripts/test_content.py @@ -31,6 +31,7 @@ def test_method_update(self, client: Cloudflare) -> None: content = client.workers.scripts.content.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", + metadata={}, ) assert_matches_type(Optional[Script], content, path=["response"]) @@ -40,7 +41,6 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: content = client.workers.scripts.content.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", - any_part_name=[b"raw file contents"], metadata={ "body_part": "worker.js", "main_module": "worker.js", @@ -56,6 +56,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: response = client.workers.scripts.content.with_raw_response.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", + metadata={}, ) assert response.is_closed is True @@ -69,6 +70,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: with client.workers.scripts.content.with_streaming_response.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", + metadata={}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -85,12 +87,14 @@ def test_path_params_update(self, client: Cloudflare) -> None: client.workers.scripts.content.with_raw_response.update( script_name="this-is_my_script-01", account_id="", + metadata={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): client.workers.scripts.content.with_raw_response.update( script_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", + metadata={}, ) @parametrize @@ -169,6 +173,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: content = await async_client.workers.scripts.content.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", + metadata={}, ) assert_matches_type(Optional[Script], content, path=["response"]) @@ -178,7 +183,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare content = await async_client.workers.scripts.content.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", - any_part_name=[b"raw file contents"], metadata={ "body_part": "worker.js", "main_module": "worker.js", @@ -194,6 +198,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.workers.scripts.content.with_raw_response.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", + metadata={}, ) assert response.is_closed is True @@ -207,6 +212,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> async with async_client.workers.scripts.content.with_streaming_response.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", + metadata={}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -223,12 +229,14 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: await async_client.workers.scripts.content.with_raw_response.update( script_name="this-is_my_script-01", account_id="", + metadata={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): await async_client.workers.scripts.content.with_raw_response.update( script_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", + metadata={}, ) @parametrize diff --git a/tests/api_resources/workers/scripts/test_versions.py b/tests/api_resources/workers/scripts/test_versions.py index 1525f49c746..5fbc0e71d33 100644 --- a/tests/api_resources/workers/scripts/test_versions.py +++ b/tests/api_resources/workers/scripts/test_versions.py @@ -28,6 +28,7 @@ def test_method_create(self, client: Cloudflare) -> None: version = client.workers.scripts.versions.create( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", + metadata={"main_module": "worker.js"}, ) assert_matches_type(Optional[VersionCreateResponse], version, path=["response"]) @@ -37,8 +38,8 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: version = client.workers.scripts.versions.create( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", - any_part_name=[b"raw file contents"], metadata={ + "main_module": "worker.js", "annotations": { "workers_message": "Fixed worker code.", "workers_tag": "workers/tag", @@ -46,14 +47,12 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "bindings": [ { "name": "MY_ENV_VAR", - "text": "my_data", "type": "plain_text", } ], - "compatibility_date": "2023-07-25", - "compatibility_flags": ["string"], + "compatibility_date": "2021-01-01", + "compatibility_flags": ["nodejs_compat"], "keep_bindings": ["string"], - "main_module": "worker.js", "usage_model": "standard", }, ) @@ -65,6 +64,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: response = client.workers.scripts.versions.with_raw_response.create( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", + metadata={"main_module": "worker.js"}, ) assert response.is_closed is True @@ -78,6 +78,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: with client.workers.scripts.versions.with_streaming_response.create( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", + metadata={"main_module": "worker.js"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -94,12 +95,14 @@ def test_path_params_create(self, client: Cloudflare) -> None: client.workers.scripts.versions.with_raw_response.create( script_name="this-is_my_script-01", account_id="", + metadata={"main_module": "worker.js"}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): client.workers.scripts.versions.with_raw_response.create( script_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", + metadata={"main_module": "worker.js"}, ) @parametrize @@ -231,6 +234,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: version = await async_client.workers.scripts.versions.create( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", + metadata={"main_module": "worker.js"}, ) assert_matches_type(Optional[VersionCreateResponse], version, path=["response"]) @@ -240,8 +244,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare version = await async_client.workers.scripts.versions.create( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", - any_part_name=[b"raw file contents"], metadata={ + "main_module": "worker.js", "annotations": { "workers_message": "Fixed worker code.", "workers_tag": "workers/tag", @@ -249,14 +253,12 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "bindings": [ { "name": "MY_ENV_VAR", - "text": "my_data", "type": "plain_text", } ], - "compatibility_date": "2023-07-25", - "compatibility_flags": ["string"], + "compatibility_date": "2021-01-01", + "compatibility_flags": ["nodejs_compat"], "keep_bindings": ["string"], - "main_module": "worker.js", "usage_model": "standard", }, ) @@ -268,6 +270,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.workers.scripts.versions.with_raw_response.create( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", + metadata={"main_module": "worker.js"}, ) assert response.is_closed is True @@ -281,6 +284,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> async with async_client.workers.scripts.versions.with_streaming_response.create( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", + metadata={"main_module": "worker.js"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -297,12 +301,14 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: await async_client.workers.scripts.versions.with_raw_response.create( script_name="this-is_my_script-01", account_id="", + metadata={"main_module": "worker.js"}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): await async_client.workers.scripts.versions.with_raw_response.create( script_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", + metadata={"main_module": "worker.js"}, ) @parametrize diff --git a/tests/api_resources/workers/test_routes.py b/tests/api_resources/workers/test_routes.py new file mode 100644 index 00000000000..86895a348ba --- /dev/null +++ b/tests/api_resources/workers/test_routes.py @@ -0,0 +1,525 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.workers import ( + RouteGetResponse, + RouteListResponse, + RouteCreateResponse, + RouteDeleteResponse, + RouteUpdateResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestRoutes: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Cloudflare) -> None: + route = client.workers.routes.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + pattern="example.net/*", + ) + assert_matches_type(RouteCreateResponse, route, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Cloudflare) -> None: + route = client.workers.routes.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + pattern="example.net/*", + script="this-is_my_script-01", + ) + assert_matches_type(RouteCreateResponse, route, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Cloudflare) -> None: + response = client.workers.routes.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + pattern="example.net/*", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + route = response.parse() + assert_matches_type(RouteCreateResponse, route, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Cloudflare) -> None: + with client.workers.routes.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + pattern="example.net/*", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + route = response.parse() + assert_matches_type(RouteCreateResponse, route, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.workers.routes.with_raw_response.create( + zone_id="", + pattern="example.net/*", + ) + + @parametrize + def test_method_update(self, client: Cloudflare) -> None: + route = client.workers.routes.update( + route_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + pattern="example.net/*", + ) + assert_matches_type(Optional[RouteUpdateResponse], route, path=["response"]) + + @parametrize + def test_method_update_with_all_params(self, client: Cloudflare) -> None: + route = client.workers.routes.update( + route_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + pattern="example.net/*", + script="this-is_my_script-01", + ) + assert_matches_type(Optional[RouteUpdateResponse], route, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Cloudflare) -> None: + response = client.workers.routes.with_raw_response.update( + route_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + pattern="example.net/*", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + route = response.parse() + assert_matches_type(Optional[RouteUpdateResponse], route, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Cloudflare) -> None: + with client.workers.routes.with_streaming_response.update( + route_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + pattern="example.net/*", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + route = response.parse() + assert_matches_type(Optional[RouteUpdateResponse], route, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.workers.routes.with_raw_response.update( + route_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + pattern="example.net/*", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `route_id` but received ''"): + client.workers.routes.with_raw_response.update( + route_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + pattern="example.net/*", + ) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + route = client.workers.routes.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(SyncSinglePage[RouteListResponse], route, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.workers.routes.with_raw_response.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + route = response.parse() + assert_matches_type(SyncSinglePage[RouteListResponse], route, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.workers.routes.with_streaming_response.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + route = response.parse() + assert_matches_type(SyncSinglePage[RouteListResponse], route, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.workers.routes.with_raw_response.list( + zone_id="", + ) + + @parametrize + def test_method_delete(self, client: Cloudflare) -> None: + route = client.workers.routes.delete( + route_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(RouteDeleteResponse, route, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.workers.routes.with_raw_response.delete( + route_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + route = response.parse() + assert_matches_type(RouteDeleteResponse, route, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.workers.routes.with_streaming_response.delete( + route_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + route = response.parse() + assert_matches_type(RouteDeleteResponse, route, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.workers.routes.with_raw_response.delete( + route_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `route_id` but received ''"): + client.workers.routes.with_raw_response.delete( + route_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + route = client.workers.routes.get( + route_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[RouteGetResponse], route, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.workers.routes.with_raw_response.get( + route_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + route = response.parse() + assert_matches_type(Optional[RouteGetResponse], route, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.workers.routes.with_streaming_response.get( + route_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + route = response.parse() + assert_matches_type(Optional[RouteGetResponse], route, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.workers.routes.with_raw_response.get( + route_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `route_id` but received ''"): + client.workers.routes.with_raw_response.get( + route_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + +class TestAsyncRoutes: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncCloudflare) -> None: + route = await async_client.workers.routes.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + pattern="example.net/*", + ) + assert_matches_type(RouteCreateResponse, route, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: + route = await async_client.workers.routes.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + pattern="example.net/*", + script="this-is_my_script-01", + ) + assert_matches_type(RouteCreateResponse, route, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.routes.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + pattern="example.net/*", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + route = await response.parse() + assert_matches_type(RouteCreateResponse, route, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.routes.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + pattern="example.net/*", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + route = await response.parse() + assert_matches_type(RouteCreateResponse, route, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.workers.routes.with_raw_response.create( + zone_id="", + pattern="example.net/*", + ) + + @parametrize + async def test_method_update(self, async_client: AsyncCloudflare) -> None: + route = await async_client.workers.routes.update( + route_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + pattern="example.net/*", + ) + assert_matches_type(Optional[RouteUpdateResponse], route, path=["response"]) + + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: + route = await async_client.workers.routes.update( + route_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + pattern="example.net/*", + script="this-is_my_script-01", + ) + assert_matches_type(Optional[RouteUpdateResponse], route, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.routes.with_raw_response.update( + route_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + pattern="example.net/*", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + route = await response.parse() + assert_matches_type(Optional[RouteUpdateResponse], route, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.routes.with_streaming_response.update( + route_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + pattern="example.net/*", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + route = await response.parse() + assert_matches_type(Optional[RouteUpdateResponse], route, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.workers.routes.with_raw_response.update( + route_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + pattern="example.net/*", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `route_id` but received ''"): + await async_client.workers.routes.with_raw_response.update( + route_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + pattern="example.net/*", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + route = await async_client.workers.routes.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(AsyncSinglePage[RouteListResponse], route, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.routes.with_raw_response.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + route = await response.parse() + assert_matches_type(AsyncSinglePage[RouteListResponse], route, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.routes.with_streaming_response.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + route = await response.parse() + assert_matches_type(AsyncSinglePage[RouteListResponse], route, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.workers.routes.with_raw_response.list( + zone_id="", + ) + + @parametrize + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + route = await async_client.workers.routes.delete( + route_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(RouteDeleteResponse, route, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.routes.with_raw_response.delete( + route_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + route = await response.parse() + assert_matches_type(RouteDeleteResponse, route, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.routes.with_streaming_response.delete( + route_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + route = await response.parse() + assert_matches_type(RouteDeleteResponse, route, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.workers.routes.with_raw_response.delete( + route_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `route_id` but received ''"): + await async_client.workers.routes.with_raw_response.delete( + route_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + route = await async_client.workers.routes.get( + route_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[RouteGetResponse], route, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.routes.with_raw_response.get( + route_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + route = await response.parse() + assert_matches_type(Optional[RouteGetResponse], route, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.routes.with_streaming_response.get( + route_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + route = await response.parse() + assert_matches_type(Optional[RouteGetResponse], route, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.workers.routes.with_raw_response.get( + route_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `route_id` but received ''"): + await async_client.workers.routes.with_raw_response.get( + route_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) diff --git a/tests/api_resources/workers/test_scripts.py b/tests/api_resources/workers/test_scripts.py index f031908950b..342dd8c9531 100644 --- a/tests/api_resources/workers/test_scripts.py +++ b/tests/api_resources/workers/test_scripts.py @@ -5,20 +5,15 @@ import os from typing import Any, Optional, cast -import httpx import pytest -from respx import MockRouter from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare._response import ( - BinaryAPIResponse, - AsyncBinaryAPIResponse, - StreamedBinaryAPIResponse, - AsyncStreamedBinaryAPIResponse, -) from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.workers import Script, ScriptUpdateResponse +from cloudflare.types.workers import ( + Script, + ScriptUpdateResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -28,21 +23,20 @@ class TestScripts: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_update_overload_1(self, client: Cloudflare) -> None: + def test_method_update(self, client: Cloudflare) -> None: script = client.workers.scripts.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", + metadata={}, ) assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> None: + def test_method_update_with_all_params(self, client: Cloudflare) -> None: script = client.workers.scripts.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", - rollback_to="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - any_part_name=[b"raw file contents"], metadata={ "assets": { "config": { @@ -59,8 +53,8 @@ def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> N } ], "body_part": "worker.js", - "compatibility_date": "2023-07-25", - "compatibility_flags": ["string"], + "compatibility_date": "2021-01-01", + "compatibility_flags": ["nodejs_compat"], "keep_assets": False, "keep_bindings": ["string"], "logpush": False, @@ -98,18 +92,18 @@ def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> N "namespace": "my-namespace", } ], - "usage_model": "bundled", - "version_tags": {"foo": "string"}, + "usage_model": "standard", }, ) assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: + def test_raw_response_update(self, client: Cloudflare) -> None: response = client.workers.scripts.with_raw_response.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", + metadata={}, ) assert response.is_closed is True @@ -119,10 +113,11 @@ def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: + def test_streaming_response_update(self, client: Cloudflare) -> None: with client.workers.scripts.with_streaming_response.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", + metadata={}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -134,80 +129,19 @@ def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_path_params_update_overload_1(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.workers.scripts.with_raw_response.update( - script_name="this-is_my_script-01", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): - client.workers.scripts.with_raw_response.update( - script_name="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - def test_method_update_overload_2(self, client: Cloudflare) -> None: - script = client.workers.scripts.update( - script_name="this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> None: - script = client.workers.scripts.update( - script_name="this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - rollback_to="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - message="message", - ) - assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: - response = client.workers.scripts.with_raw_response.update( - script_name="this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - script = response.parse() - assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: - with client.workers.scripts.with_streaming_response.update( - script_name="this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - script = response.parse() - assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - def test_path_params_update_overload_2(self, client: Cloudflare) -> None: + def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.workers.scripts.with_raw_response.update( script_name="this-is_my_script-01", account_id="", + metadata={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): client.workers.scripts.with_raw_response.update( script_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", + metadata={}, ) @parametrize @@ -306,58 +240,40 @@ def test_path_params_delete(self, client: Cloudflare) -> None: ) @parametrize - @pytest.mark.respx(base_url=base_url) - def test_method_get(self, client: Cloudflare, respx_mock: MockRouter) -> None: - respx_mock.get("/accounts/023e105f4ecef8ad9ca31a8372d0c353/workers/scripts/this-is_my_script-01").mock( - return_value=httpx.Response(200, json={"foo": "bar"}) - ) + def test_method_get(self, client: Cloudflare) -> None: script = client.workers.scripts.get( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert script.is_closed - assert script.json() == {"foo": "bar"} - assert cast(Any, script.is_closed) is True - assert isinstance(script, BinaryAPIResponse) + assert_matches_type(str, script, path=["response"]) @parametrize - @pytest.mark.respx(base_url=base_url) - def test_raw_response_get(self, client: Cloudflare, respx_mock: MockRouter) -> None: - respx_mock.get("/accounts/023e105f4ecef8ad9ca31a8372d0c353/workers/scripts/this-is_my_script-01").mock( - return_value=httpx.Response(200, json={"foo": "bar"}) - ) - - script = client.workers.scripts.with_raw_response.get( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.workers.scripts.with_raw_response.get( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert script.is_closed is True - assert script.http_request.headers.get("X-Stainless-Lang") == "python" - assert script.json() == {"foo": "bar"} - assert isinstance(script, BinaryAPIResponse) + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + script = response.parse() + assert_matches_type(str, script, path=["response"]) @parametrize - @pytest.mark.respx(base_url=base_url) - def test_streaming_response_get(self, client: Cloudflare, respx_mock: MockRouter) -> None: - respx_mock.get("/accounts/023e105f4ecef8ad9ca31a8372d0c353/workers/scripts/this-is_my_script-01").mock( - return_value=httpx.Response(200, json={"foo": "bar"}) - ) + def test_streaming_response_get(self, client: Cloudflare) -> None: with client.workers.scripts.with_streaming_response.get( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as script: - assert not script.is_closed - assert script.http_request.headers.get("X-Stainless-Lang") == "python" + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - assert script.json() == {"foo": "bar"} - assert cast(Any, script.is_closed) is True - assert isinstance(script, StreamedBinaryAPIResponse) + script = response.parse() + assert_matches_type(str, script, path=["response"]) - assert cast(Any, script.is_closed) is True + assert cast(Any, response.is_closed) is True @parametrize - @pytest.mark.respx(base_url=base_url) def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.workers.scripts.with_raw_response.get( @@ -377,21 +293,20 @@ class TestAsyncScripts: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_method_update_overload_1(self, async_client: AsyncCloudflare) -> None: + async def test_method_update(self, async_client: AsyncCloudflare) -> None: script = await async_client.workers.scripts.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", + metadata={}, ) assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_method_update_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: + async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: script = await async_client.workers.scripts.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", - rollback_to="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - any_part_name=[b"raw file contents"], metadata={ "assets": { "config": { @@ -408,8 +323,8 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn } ], "body_part": "worker.js", - "compatibility_date": "2023-07-25", - "compatibility_flags": ["string"], + "compatibility_date": "2021-01-01", + "compatibility_flags": ["nodejs_compat"], "keep_assets": False, "keep_bindings": ["string"], "logpush": False, @@ -447,18 +362,18 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn "namespace": "my-namespace", } ], - "usage_model": "bundled", - "version_tags": {"foo": "string"}, + "usage_model": "standard", }, ) assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.workers.scripts.with_raw_response.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", + metadata={}, ) assert response.is_closed is True @@ -468,10 +383,11 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflar @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_streaming_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.workers.scripts.with_streaming_response.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", + metadata={}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -483,80 +399,19 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_path_params_update_overload_1(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.workers.scripts.with_raw_response.update( - script_name="this-is_my_script-01", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): - await async_client.workers.scripts.with_raw_response.update( - script_name="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> None: - script = await async_client.workers.scripts.update( - script_name="this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - async def test_method_update_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: - script = await async_client.workers.scripts.update( - script_name="this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - rollback_to="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - message="message", - ) - assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: - response = await async_client.workers.scripts.with_raw_response.update( - script_name="this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - script = await response.parse() - assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - async def test_streaming_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: - async with async_client.workers.scripts.with_streaming_response.update( - script_name="this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - script = await response.parse() - assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.workers.scripts.with_raw_response.update( script_name="this-is_my_script-01", account_id="", + metadata={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): await async_client.workers.scripts.with_raw_response.update( script_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", + metadata={}, ) @parametrize @@ -655,58 +510,40 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: ) @parametrize - @pytest.mark.respx(base_url=base_url) - async def test_method_get(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None: - respx_mock.get("/accounts/023e105f4ecef8ad9ca31a8372d0c353/workers/scripts/this-is_my_script-01").mock( - return_value=httpx.Response(200, json={"foo": "bar"}) - ) + async def test_method_get(self, async_client: AsyncCloudflare) -> None: script = await async_client.workers.scripts.get( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert script.is_closed - assert await script.json() == {"foo": "bar"} - assert cast(Any, script.is_closed) is True - assert isinstance(script, AsyncBinaryAPIResponse) + assert_matches_type(str, script, path=["response"]) @parametrize - @pytest.mark.respx(base_url=base_url) - async def test_raw_response_get(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None: - respx_mock.get("/accounts/023e105f4ecef8ad9ca31a8372d0c353/workers/scripts/this-is_my_script-01").mock( - return_value=httpx.Response(200, json={"foo": "bar"}) - ) - - script = await async_client.workers.scripts.with_raw_response.get( + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.scripts.with_raw_response.get( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert script.is_closed is True - assert script.http_request.headers.get("X-Stainless-Lang") == "python" - assert await script.json() == {"foo": "bar"} - assert isinstance(script, AsyncBinaryAPIResponse) + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + script = await response.parse() + assert_matches_type(str, script, path=["response"]) @parametrize - @pytest.mark.respx(base_url=base_url) - async def test_streaming_response_get(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None: - respx_mock.get("/accounts/023e105f4ecef8ad9ca31a8372d0c353/workers/scripts/this-is_my_script-01").mock( - return_value=httpx.Response(200, json={"foo": "bar"}) - ) + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.workers.scripts.with_streaming_response.get( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as script: - assert not script.is_closed - assert script.http_request.headers.get("X-Stainless-Lang") == "python" + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - assert await script.json() == {"foo": "bar"} - assert cast(Any, script.is_closed) is True - assert isinstance(script, AsyncStreamedBinaryAPIResponse) + script = await response.parse() + assert_matches_type(str, script, path=["response"]) - assert cast(Any, script.is_closed) is True + assert cast(Any, response.is_closed) is True @parametrize - @pytest.mark.respx(base_url=base_url) async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.workers.scripts.with_raw_response.get( diff --git a/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_asset_upload.py b/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_asset_upload.py new file mode 100644 index 00000000000..e709c6dc236 --- /dev/null +++ b/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_asset_upload.py @@ -0,0 +1,176 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.workers_for_platforms.dispatch.namespaces.scripts import ( + AssetUploadCreateResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestAssetUpload: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Cloudflare) -> None: + asset_upload = client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.create( + script_name="this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + ) + assert_matches_type(Optional[AssetUploadCreateResponse], asset_upload, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Cloudflare) -> None: + asset_upload = client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.create( + script_name="this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + manifest={ + "foo": { + "hash": "hash", + "size": 0, + } + }, + ) + assert_matches_type(Optional[AssetUploadCreateResponse], asset_upload, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Cloudflare) -> None: + response = client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.with_raw_response.create( + script_name="this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + asset_upload = response.parse() + assert_matches_type(Optional[AssetUploadCreateResponse], asset_upload, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Cloudflare) -> None: + with client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.with_streaming_response.create( + script_name="this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + asset_upload = response.parse() + assert_matches_type(Optional[AssetUploadCreateResponse], asset_upload, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.with_raw_response.create( + script_name="this-is_my_script-01", + account_id="", + dispatch_namespace="my-dispatch-namespace", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dispatch_namespace` but received ''"): + client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.with_raw_response.create( + script_name="this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): + client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.with_raw_response.create( + script_name="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + ) + + +class TestAsyncAssetUpload: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncCloudflare) -> None: + asset_upload = await async_client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.create( + script_name="this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + ) + assert_matches_type(Optional[AssetUploadCreateResponse], asset_upload, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: + asset_upload = await async_client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.create( + script_name="this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + manifest={ + "foo": { + "hash": "hash", + "size": 0, + } + }, + ) + assert_matches_type(Optional[AssetUploadCreateResponse], asset_upload, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: + response = ( + await async_client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.with_raw_response.create( + script_name="this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + ) + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + asset_upload = await response.parse() + assert_matches_type(Optional[AssetUploadCreateResponse], asset_upload, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.with_streaming_response.create( + script_name="this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + asset_upload = await response.parse() + assert_matches_type(Optional[AssetUploadCreateResponse], asset_upload, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.with_raw_response.create( + script_name="this-is_my_script-01", + account_id="", + dispatch_namespace="my-dispatch-namespace", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dispatch_namespace` but received ''"): + await async_client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.with_raw_response.create( + script_name="this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): + await async_client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.with_raw_response.create( + script_name="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + ) diff --git a/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_content.py b/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_content.py index b869d42a76e..822e7f80d7a 100644 --- a/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_content.py +++ b/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_content.py @@ -32,6 +32,7 @@ def test_method_update(self, client: Cloudflare) -> None: script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", + metadata={}, ) assert_matches_type(Optional[Script], content, path=["response"]) @@ -42,7 +43,6 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", - any_part_name=[b"raw file contents"], metadata={ "body_part": "worker.js", "main_module": "worker.js", @@ -59,6 +59,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", + metadata={}, ) assert response.is_closed is True @@ -73,6 +74,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", + metadata={}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -90,6 +92,7 @@ def test_path_params_update(self, client: Cloudflare) -> None: script_name="this-is_my_script-01", account_id="", dispatch_namespace="my-dispatch-namespace", + metadata={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dispatch_namespace` but received ''"): @@ -97,6 +100,7 @@ def test_path_params_update(self, client: Cloudflare) -> None: script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="", + metadata={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): @@ -104,6 +108,7 @@ def test_path_params_update(self, client: Cloudflare) -> None: script_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", + metadata={}, ) @parametrize @@ -195,6 +200,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", + metadata={}, ) assert_matches_type(Optional[Script], content, path=["response"]) @@ -205,7 +211,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", - any_part_name=[b"raw file contents"], metadata={ "body_part": "worker.js", "main_module": "worker.js", @@ -223,6 +228,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", + metadata={}, ) ) @@ -238,6 +244,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", + metadata={}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -255,6 +262,7 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: script_name="this-is_my_script-01", account_id="", dispatch_namespace="my-dispatch-namespace", + metadata={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dispatch_namespace` but received ''"): @@ -262,6 +270,7 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="", + metadata={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): @@ -269,6 +278,7 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: script_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", + metadata={}, ) @parametrize diff --git a/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_settings.py b/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_settings.py index 50a6f309b63..b3a2e96a5d1 100644 --- a/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_settings.py +++ b/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_settings.py @@ -38,9 +38,14 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", settings={ - "bindings": [{"type": "kv_namespace"}], - "compatibility_date": "2022-04-05", - "compatibility_flags": ["formdata_parser_supports_files"], + "bindings": [ + { + "name": "MY_ENV_VAR", + "type": "plain_text", + } + ], + "compatibility_date": "2021-01-01", + "compatibility_flags": ["nodejs_compat"], "limits": {"cpu_ms": 50}, "logpush": False, "migrations": { @@ -76,7 +81,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: "namespace": "my-namespace", } ], - "usage_model": "unbound", + "usage_model": "standard", }, ) assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @@ -217,9 +222,14 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", settings={ - "bindings": [{"type": "kv_namespace"}], - "compatibility_date": "2022-04-05", - "compatibility_flags": ["formdata_parser_supports_files"], + "bindings": [ + { + "name": "MY_ENV_VAR", + "type": "plain_text", + } + ], + "compatibility_date": "2021-01-01", + "compatibility_flags": ["nodejs_compat"], "limits": {"cpu_ms": 50}, "logpush": False, "migrations": { @@ -255,7 +265,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) "namespace": "my-namespace", } ], - "usage_model": "unbound", + "usage_model": "standard", }, ) assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) diff --git a/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py b/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py index c5c287cfdab..cfec51aadc0 100644 --- a/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py +++ b/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py @@ -22,22 +22,22 @@ class TestScripts: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_update_overload_1(self, client: Cloudflare) -> None: + def test_method_update(self, client: Cloudflare) -> None: script = client.workers_for_platforms.dispatch.namespaces.scripts.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", + metadata={}, ) assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> None: + def test_method_update_with_all_params(self, client: Cloudflare) -> None: script = client.workers_for_platforms.dispatch.namespaces.scripts.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", - any_part_name=[b"raw file contents"], metadata={ "assets": { "config": { @@ -54,8 +54,8 @@ def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> N } ], "body_part": "worker.js", - "compatibility_date": "2023-07-25", - "compatibility_flags": ["string"], + "compatibility_date": "2021-01-01", + "compatibility_flags": ["nodejs_compat"], "keep_assets": False, "keep_bindings": ["string"], "logpush": False, @@ -93,19 +93,19 @@ def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> N "namespace": "my-namespace", } ], - "usage_model": "bundled", - "version_tags": {"foo": "string"}, + "usage_model": "standard", }, ) assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: + def test_raw_response_update(self, client: Cloudflare) -> None: response = client.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", + metadata={}, ) assert response.is_closed is True @@ -115,11 +115,12 @@ def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: + def test_streaming_response_update(self, client: Cloudflare) -> None: with client.workers_for_platforms.dispatch.namespaces.scripts.with_streaming_response.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", + metadata={}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -131,87 +132,13 @@ def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_path_params_update_overload_1(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( - script_name="this-is_my_script-01", - account_id="", - dispatch_namespace="my-dispatch-namespace", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `dispatch_namespace` but received ''"): - client.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( - script_name="this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dispatch_namespace="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): - client.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( - script_name="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dispatch_namespace="my-dispatch-namespace", - ) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - def test_method_update_overload_2(self, client: Cloudflare) -> None: - script = client.workers_for_platforms.dispatch.namespaces.scripts.update( - script_name="this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dispatch_namespace="my-dispatch-namespace", - ) - assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> None: - script = client.workers_for_platforms.dispatch.namespaces.scripts.update( - script_name="this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dispatch_namespace="my-dispatch-namespace", - message="message", - ) - assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: - response = client.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( - script_name="this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dispatch_namespace="my-dispatch-namespace", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - script = response.parse() - assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: - with client.workers_for_platforms.dispatch.namespaces.scripts.with_streaming_response.update( - script_name="this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dispatch_namespace="my-dispatch-namespace", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - script = response.parse() - assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - def test_path_params_update_overload_2(self, client: Cloudflare) -> None: + def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( script_name="this-is_my_script-01", account_id="", dispatch_namespace="my-dispatch-namespace", + metadata={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dispatch_namespace` but received ''"): @@ -219,6 +146,7 @@ def test_path_params_update_overload_2(self, client: Cloudflare) -> None: script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="", + metadata={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): @@ -226,6 +154,7 @@ def test_path_params_update_overload_2(self, client: Cloudflare) -> None: script_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", + metadata={}, ) @parametrize @@ -364,22 +293,22 @@ class TestAsyncScripts: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_method_update_overload_1(self, async_client: AsyncCloudflare) -> None: + async def test_method_update(self, async_client: AsyncCloudflare) -> None: script = await async_client.workers_for_platforms.dispatch.namespaces.scripts.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", + metadata={}, ) assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_method_update_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: + async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: script = await async_client.workers_for_platforms.dispatch.namespaces.scripts.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", - any_part_name=[b"raw file contents"], metadata={ "assets": { "config": { @@ -396,8 +325,8 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn } ], "body_part": "worker.js", - "compatibility_date": "2023-07-25", - "compatibility_flags": ["string"], + "compatibility_date": "2021-01-01", + "compatibility_flags": ["nodejs_compat"], "keep_assets": False, "keep_bindings": ["string"], "logpush": False, @@ -435,94 +364,19 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn "namespace": "my-namespace", } ], - "usage_model": "bundled", - "version_tags": {"foo": "string"}, + "usage_model": "standard", }, ) assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: - response = await async_client.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( - script_name="this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dispatch_namespace="my-dispatch-namespace", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - script = await response.parse() - assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - async def test_streaming_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: - async with async_client.workers_for_platforms.dispatch.namespaces.scripts.with_streaming_response.update( - script_name="this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dispatch_namespace="my-dispatch-namespace", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - script = await response.parse() - assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - async def test_path_params_update_overload_1(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( - script_name="this-is_my_script-01", - account_id="", - dispatch_namespace="my-dispatch-namespace", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `dispatch_namespace` but received ''"): - await async_client.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( - script_name="this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dispatch_namespace="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): - await async_client.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( - script_name="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dispatch_namespace="my-dispatch-namespace", - ) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> None: - script = await async_client.workers_for_platforms.dispatch.namespaces.scripts.update( - script_name="this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dispatch_namespace="my-dispatch-namespace", - ) - assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - async def test_method_update_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: - script = await async_client.workers_for_platforms.dispatch.namespaces.scripts.update( - script_name="this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dispatch_namespace="my-dispatch-namespace", - message="message", - ) - assert_matches_type(Optional[ScriptUpdateResponse], script, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", + metadata={}, ) assert response.is_closed is True @@ -532,11 +386,12 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflar @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_streaming_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.workers_for_platforms.dispatch.namespaces.scripts.with_streaming_response.update( script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", + metadata={}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -548,12 +403,13 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( script_name="this-is_my_script-01", account_id="", dispatch_namespace="my-dispatch-namespace", + metadata={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dispatch_namespace` but received ''"): @@ -561,6 +417,7 @@ async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="", + metadata={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): @@ -568,6 +425,7 @@ async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare script_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", + metadata={}, ) @parametrize diff --git a/tests/api_resources/zero_trust/access/infrastructure/test_targets.py b/tests/api_resources/zero_trust/access/infrastructure/test_targets.py index 6d6fec64674..263003e2c00 100644 --- a/tests/api_resources/zero_trust/access/infrastructure/test_targets.py +++ b/tests/api_resources/zero_trust/access/infrastructure/test_targets.py @@ -178,11 +178,16 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: target = client.zero_trust.access.infrastructure.targets.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", created_after=parse_datetime("2019-12-27T18:11:19.117Z"), + created_before=parse_datetime("2019-12-27T18:11:19.117Z"), + direction="asc", hostname="hostname", hostname_contains="hostname_contains", ip_v4="ip_v4", ip_v6="ip_v6", + ips=["string"], modified_after=parse_datetime("2019-12-27T18:11:19.117Z"), + modified_before=parse_datetime("2019-12-27T18:11:19.117Z"), + order="hostname", page=1, per_page=1, virtual_network_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", @@ -573,11 +578,16 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) target = await async_client.zero_trust.access.infrastructure.targets.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", created_after=parse_datetime("2019-12-27T18:11:19.117Z"), + created_before=parse_datetime("2019-12-27T18:11:19.117Z"), + direction="asc", hostname="hostname", hostname_contains="hostname_contains", ip_v4="ip_v4", ip_v6="ip_v6", + ips=["string"], modified_after=parse_datetime("2019-12-27T18:11:19.117Z"), + modified_before=parse_datetime("2019-12-27T18:11:19.117Z"), + order="hostname", page=1, per_page=1, virtual_network_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", diff --git a/tests/api_resources/zero_trust/access/test_applications.py b/tests/api_resources/zero_trust/access/test_applications.py index 17ca2921b84..3b041b0653f 100644 --- a/tests/api_resources/zero_trust/access/test_applications.py +++ b/tests/api_resources/zero_trust/access/test_applications.py @@ -69,16 +69,28 @@ def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> N "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -340,16 +352,28 @@ def test_method_create_with_all_params_overload_3(self, client: Cloudflare) -> N "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -490,16 +514,28 @@ def test_method_create_with_all_params_overload_4(self, client: Cloudflare) -> N "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -1183,16 +1219,28 @@ def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> N "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -1480,16 +1528,28 @@ def test_method_update_with_all_params_overload_3(self, client: Cloudflare) -> N "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -1644,16 +1704,28 @@ def test_method_update_with_all_params_overload_4(self, client: Cloudflare) -> N "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -2682,16 +2754,28 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -2953,16 +3037,28 @@ async def test_method_create_with_all_params_overload_3(self, async_client: Asyn "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -3103,16 +3199,28 @@ async def test_method_create_with_all_params_overload_4(self, async_client: Asyn "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -3796,16 +3904,28 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -4093,16 +4213,28 @@ async def test_method_update_with_all_params_overload_3(self, async_client: Asyn "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, @@ -4257,16 +4389,28 @@ async def test_method_update_with_all_params_overload_4(self, async_client: Asyn "uri": "test.anotherexample.com/staff", }, { - "type": "public", - "uri": "10.5.0.2", + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "10.5.0.3/32:1234-4321", + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", }, { - "type": "public", - "uri": "private-sni.example.com", + "cidr": "cidr", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", }, ], enable_binding_cookie=True, diff --git a/tests/api_resources/zero_trust/access/test_gateway_ca.py b/tests/api_resources/zero_trust/access/test_gateway_ca.py new file mode 100644 index 00000000000..723be698029 --- /dev/null +++ b/tests/api_resources/zero_trust/access/test_gateway_ca.py @@ -0,0 +1,271 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.zero_trust.access import GatewayCAListResponse, GatewayCACreateResponse, GatewayCADeleteResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestGatewayCA: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Cloudflare) -> None: + gateway_ca = client.zero_trust.access.gateway_ca.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[GatewayCACreateResponse], gateway_ca, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Cloudflare) -> None: + response = client.zero_trust.access.gateway_ca.with_raw_response.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + gateway_ca = response.parse() + assert_matches_type(Optional[GatewayCACreateResponse], gateway_ca, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Cloudflare) -> None: + with client.zero_trust.access.gateway_ca.with_streaming_response.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + gateway_ca = response.parse() + assert_matches_type(Optional[GatewayCACreateResponse], gateway_ca, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.access.gateway_ca.with_raw_response.create( + account_id="", + ) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + gateway_ca = client.zero_trust.access.gateway_ca.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(SyncSinglePage[GatewayCAListResponse], gateway_ca, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.zero_trust.access.gateway_ca.with_raw_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + gateway_ca = response.parse() + assert_matches_type(SyncSinglePage[GatewayCAListResponse], gateway_ca, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.zero_trust.access.gateway_ca.with_streaming_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + gateway_ca = response.parse() + assert_matches_type(SyncSinglePage[GatewayCAListResponse], gateway_ca, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.access.gateway_ca.with_raw_response.list( + account_id="", + ) + + @parametrize + def test_method_delete(self, client: Cloudflare) -> None: + gateway_ca = client.zero_trust.access.gateway_ca.delete( + certificate_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[GatewayCADeleteResponse], gateway_ca, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.zero_trust.access.gateway_ca.with_raw_response.delete( + certificate_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + gateway_ca = response.parse() + assert_matches_type(Optional[GatewayCADeleteResponse], gateway_ca, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.zero_trust.access.gateway_ca.with_streaming_response.delete( + certificate_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + gateway_ca = response.parse() + assert_matches_type(Optional[GatewayCADeleteResponse], gateway_ca, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.access.gateway_ca.with_raw_response.delete( + certificate_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `certificate_id` but received ''"): + client.zero_trust.access.gateway_ca.with_raw_response.delete( + certificate_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + +class TestAsyncGatewayCA: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncCloudflare) -> None: + gateway_ca = await async_client.zero_trust.access.gateway_ca.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[GatewayCACreateResponse], gateway_ca, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.access.gateway_ca.with_raw_response.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + gateway_ca = await response.parse() + assert_matches_type(Optional[GatewayCACreateResponse], gateway_ca, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.access.gateway_ca.with_streaming_response.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + gateway_ca = await response.parse() + assert_matches_type(Optional[GatewayCACreateResponse], gateway_ca, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.access.gateway_ca.with_raw_response.create( + account_id="", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + gateway_ca = await async_client.zero_trust.access.gateway_ca.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(AsyncSinglePage[GatewayCAListResponse], gateway_ca, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.access.gateway_ca.with_raw_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + gateway_ca = await response.parse() + assert_matches_type(AsyncSinglePage[GatewayCAListResponse], gateway_ca, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.access.gateway_ca.with_streaming_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + gateway_ca = await response.parse() + assert_matches_type(AsyncSinglePage[GatewayCAListResponse], gateway_ca, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.access.gateway_ca.with_raw_response.list( + account_id="", + ) + + @parametrize + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + gateway_ca = await async_client.zero_trust.access.gateway_ca.delete( + certificate_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[GatewayCADeleteResponse], gateway_ca, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.access.gateway_ca.with_raw_response.delete( + certificate_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + gateway_ca = await response.parse() + assert_matches_type(Optional[GatewayCADeleteResponse], gateway_ca, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.access.gateway_ca.with_streaming_response.delete( + certificate_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + gateway_ca = await response.parse() + assert_matches_type(Optional[GatewayCADeleteResponse], gateway_ca, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.access.gateway_ca.with_raw_response.delete( + certificate_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `certificate_id` but received ''"): + await async_client.zero_trust.access.gateway_ca.with_raw_response.delete( + certificate_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) diff --git a/tests/api_resources/zero_trust/devices/policies/default/test_certificates.py b/tests/api_resources/zero_trust/devices/policies/default/test_certificates.py index f616978a857..b94cf6d8191 100644 --- a/tests/api_resources/zero_trust/devices/policies/default/test_certificates.py +++ b/tests/api_resources/zero_trust/devices/policies/default/test_certificates.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -26,7 +26,7 @@ def test_method_edit(self, client: Cloudflare) -> None: zone_id="699d98642c564d2e855e9661899b7252", enabled=True, ) - assert_matches_type(CertificateEditResponse, certificate, path=["response"]) + assert_matches_type(Optional[CertificateEditResponse], certificate, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: @@ -38,7 +38,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = response.parse() - assert_matches_type(CertificateEditResponse, certificate, path=["response"]) + assert_matches_type(Optional[CertificateEditResponse], certificate, path=["response"]) @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: @@ -50,7 +50,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = response.parse() - assert_matches_type(CertificateEditResponse, certificate, path=["response"]) + assert_matches_type(Optional[CertificateEditResponse], certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -67,7 +67,7 @@ def test_method_get(self, client: Cloudflare) -> None: certificate = client.zero_trust.devices.policies.default.certificates.get( zone_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(CertificateGetResponse, certificate, path=["response"]) + assert_matches_type(Optional[CertificateGetResponse], certificate, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -78,7 +78,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = response.parse() - assert_matches_type(CertificateGetResponse, certificate, path=["response"]) + assert_matches_type(Optional[CertificateGetResponse], certificate, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -89,7 +89,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = response.parse() - assert_matches_type(CertificateGetResponse, certificate, path=["response"]) + assert_matches_type(Optional[CertificateGetResponse], certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -110,7 +110,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: zone_id="699d98642c564d2e855e9661899b7252", enabled=True, ) - assert_matches_type(CertificateEditResponse, certificate, path=["response"]) + assert_matches_type(Optional[CertificateEditResponse], certificate, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -122,7 +122,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = await response.parse() - assert_matches_type(CertificateEditResponse, certificate, path=["response"]) + assert_matches_type(Optional[CertificateEditResponse], certificate, path=["response"]) @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -134,7 +134,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = await response.parse() - assert_matches_type(CertificateEditResponse, certificate, path=["response"]) + assert_matches_type(Optional[CertificateEditResponse], certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -151,7 +151,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: certificate = await async_client.zero_trust.devices.policies.default.certificates.get( zone_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(CertificateGetResponse, certificate, path=["response"]) + assert_matches_type(Optional[CertificateGetResponse], certificate, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -162,7 +162,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = await response.parse() - assert_matches_type(CertificateGetResponse, certificate, path=["response"]) + assert_matches_type(Optional[CertificateGetResponse], certificate, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -173,7 +173,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = await response.parse() - assert_matches_type(CertificateGetResponse, certificate, path=["response"]) + assert_matches_type(Optional[CertificateGetResponse], certificate, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/devices/posture/test_integrations.py b/tests/api_resources/zero_trust/devices/posture/test_integrations.py index 6ad1c0fabd0..35efacf4282 100644 --- a/tests/api_resources/zero_trust/devices/posture/test_integrations.py +++ b/tests/api_resources/zero_trust/devices/posture/test_integrations.py @@ -155,7 +155,7 @@ def test_method_delete(self, client: Cloudflare) -> None: integration_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(IntegrationDeleteResponse, integration, path=["response"]) + assert_matches_type(Optional[IntegrationDeleteResponse], integration, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -167,7 +167,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" integration = response.parse() - assert_matches_type(IntegrationDeleteResponse, integration, path=["response"]) + assert_matches_type(Optional[IntegrationDeleteResponse], integration, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -179,7 +179,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" integration = response.parse() - assert_matches_type(IntegrationDeleteResponse, integration, path=["response"]) + assert_matches_type(Optional[IntegrationDeleteResponse], integration, path=["response"]) assert cast(Any, response.is_closed) is True @@ -448,7 +448,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: integration_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(IntegrationDeleteResponse, integration, path=["response"]) + assert_matches_type(Optional[IntegrationDeleteResponse], integration, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -460,7 +460,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" integration = await response.parse() - assert_matches_type(IntegrationDeleteResponse, integration, path=["response"]) + assert_matches_type(Optional[IntegrationDeleteResponse], integration, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -472,7 +472,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" integration = await response.parse() - assert_matches_type(IntegrationDeleteResponse, integration, path=["response"]) + assert_matches_type(Optional[IntegrationDeleteResponse], integration, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/devices/test_revoke.py b/tests/api_resources/zero_trust/devices/test_revoke.py index abfc42857d4..d093db0d2e7 100644 --- a/tests/api_resources/zero_trust/devices/test_revoke.py +++ b/tests/api_resources/zero_trust/devices/test_revoke.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -23,7 +23,7 @@ def test_method_create(self, client: Cloudflare) -> None: account_id="699d98642c564d2e855e9661899b7252", body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], ) - assert_matches_type(RevokeCreateResponse, revoke, path=["response"]) + assert_matches_type(Optional[RevokeCreateResponse], revoke, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -35,7 +35,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" revoke = response.parse() - assert_matches_type(RevokeCreateResponse, revoke, path=["response"]) + assert_matches_type(Optional[RevokeCreateResponse], revoke, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -47,7 +47,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" revoke = response.parse() - assert_matches_type(RevokeCreateResponse, revoke, path=["response"]) + assert_matches_type(Optional[RevokeCreateResponse], revoke, path=["response"]) assert cast(Any, response.is_closed) is True @@ -69,7 +69,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: account_id="699d98642c564d2e855e9661899b7252", body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], ) - assert_matches_type(RevokeCreateResponse, revoke, path=["response"]) + assert_matches_type(Optional[RevokeCreateResponse], revoke, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -81,7 +81,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" revoke = await response.parse() - assert_matches_type(RevokeCreateResponse, revoke, path=["response"]) + assert_matches_type(Optional[RevokeCreateResponse], revoke, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -93,7 +93,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" revoke = await response.parse() - assert_matches_type(RevokeCreateResponse, revoke, path=["response"]) + assert_matches_type(Optional[RevokeCreateResponse], revoke, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/devices/test_unrevoke.py b/tests/api_resources/zero_trust/devices/test_unrevoke.py index 1c0bc2acdf5..9196cb931f8 100644 --- a/tests/api_resources/zero_trust/devices/test_unrevoke.py +++ b/tests/api_resources/zero_trust/devices/test_unrevoke.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -23,7 +23,7 @@ def test_method_create(self, client: Cloudflare) -> None: account_id="699d98642c564d2e855e9661899b7252", body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], ) - assert_matches_type(UnrevokeCreateResponse, unrevoke, path=["response"]) + assert_matches_type(Optional[UnrevokeCreateResponse], unrevoke, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -35,7 +35,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" unrevoke = response.parse() - assert_matches_type(UnrevokeCreateResponse, unrevoke, path=["response"]) + assert_matches_type(Optional[UnrevokeCreateResponse], unrevoke, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -47,7 +47,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" unrevoke = response.parse() - assert_matches_type(UnrevokeCreateResponse, unrevoke, path=["response"]) + assert_matches_type(Optional[UnrevokeCreateResponse], unrevoke, path=["response"]) assert cast(Any, response.is_closed) is True @@ -69,7 +69,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: account_id="699d98642c564d2e855e9661899b7252", body=["f174e90a-fafe-4643-bbbc-4a0ed4fc8415"], ) - assert_matches_type(UnrevokeCreateResponse, unrevoke, path=["response"]) + assert_matches_type(Optional[UnrevokeCreateResponse], unrevoke, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -81,7 +81,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" unrevoke = await response.parse() - assert_matches_type(UnrevokeCreateResponse, unrevoke, path=["response"]) + assert_matches_type(Optional[UnrevokeCreateResponse], unrevoke, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -93,7 +93,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" unrevoke = await response.parse() - assert_matches_type(UnrevokeCreateResponse, unrevoke, path=["response"]) + assert_matches_type(Optional[UnrevokeCreateResponse], unrevoke, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/dex/commands/test_devices.py b/tests/api_resources/zero_trust/dex/commands/test_devices.py new file mode 100644 index 00000000000..be6707c9e2a --- /dev/null +++ b/tests/api_resources/zero_trust/dex/commands/test_devices.py @@ -0,0 +1,135 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.pagination import SyncV4PagePagination, AsyncV4PagePagination +from cloudflare.types.zero_trust.dex.commands import DeviceListResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestDevices: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + device = client.zero_trust.dex.commands.devices.list( + account_id="01a7362d577a6c3019a474fd6f485823", + page=1, + per_page=1, + ) + assert_matches_type(SyncV4PagePagination[Optional[DeviceListResponse]], device, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + device = client.zero_trust.dex.commands.devices.list( + account_id="01a7362d577a6c3019a474fd6f485823", + page=1, + per_page=1, + search="search", + ) + assert_matches_type(SyncV4PagePagination[Optional[DeviceListResponse]], device, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.zero_trust.dex.commands.devices.with_raw_response.list( + account_id="01a7362d577a6c3019a474fd6f485823", + page=1, + per_page=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + device = response.parse() + assert_matches_type(SyncV4PagePagination[Optional[DeviceListResponse]], device, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.zero_trust.dex.commands.devices.with_streaming_response.list( + account_id="01a7362d577a6c3019a474fd6f485823", + page=1, + per_page=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + device = response.parse() + assert_matches_type(SyncV4PagePagination[Optional[DeviceListResponse]], device, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.dex.commands.devices.with_raw_response.list( + account_id="", + page=1, + per_page=1, + ) + + +class TestAsyncDevices: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + device = await async_client.zero_trust.dex.commands.devices.list( + account_id="01a7362d577a6c3019a474fd6f485823", + page=1, + per_page=1, + ) + assert_matches_type(AsyncV4PagePagination[Optional[DeviceListResponse]], device, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + device = await async_client.zero_trust.dex.commands.devices.list( + account_id="01a7362d577a6c3019a474fd6f485823", + page=1, + per_page=1, + search="search", + ) + assert_matches_type(AsyncV4PagePagination[Optional[DeviceListResponse]], device, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.dex.commands.devices.with_raw_response.list( + account_id="01a7362d577a6c3019a474fd6f485823", + page=1, + per_page=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + device = await response.parse() + assert_matches_type(AsyncV4PagePagination[Optional[DeviceListResponse]], device, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.dex.commands.devices.with_streaming_response.list( + account_id="01a7362d577a6c3019a474fd6f485823", + page=1, + per_page=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + device = await response.parse() + assert_matches_type(AsyncV4PagePagination[Optional[DeviceListResponse]], device, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.dex.commands.devices.with_raw_response.list( + account_id="", + page=1, + per_page=1, + ) diff --git a/tests/api_resources/zero_trust/dex/commands/test_downloads.py b/tests/api_resources/zero_trust/dex/commands/test_downloads.py index b2a9133f988..66711dbdd5a 100644 --- a/tests/api_resources/zero_trust/dex/commands/test_downloads.py +++ b/tests/api_resources/zero_trust/dex/commands/test_downloads.py @@ -27,7 +27,7 @@ class TestDownloads: @pytest.mark.respx(base_url=base_url) def test_method_get(self, client: Cloudflare, respx_mock: MockRouter) -> None: respx_mock.get( - "/accounts/01a7362d577a6c3019a474fd6f485823/commands/5758fefe-ae7e-4538-a39b-1fef6abcb909/downloads/filename" + "/accounts/01a7362d577a6c3019a474fd6f485823/dex/commands/5758fefe-ae7e-4538-a39b-1fef6abcb909/downloads/filename" ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) download = client.zero_trust.dex.commands.downloads.get( filename="filename", @@ -43,7 +43,7 @@ def test_method_get(self, client: Cloudflare, respx_mock: MockRouter) -> None: @pytest.mark.respx(base_url=base_url) def test_raw_response_get(self, client: Cloudflare, respx_mock: MockRouter) -> None: respx_mock.get( - "/accounts/01a7362d577a6c3019a474fd6f485823/commands/5758fefe-ae7e-4538-a39b-1fef6abcb909/downloads/filename" + "/accounts/01a7362d577a6c3019a474fd6f485823/dex/commands/5758fefe-ae7e-4538-a39b-1fef6abcb909/downloads/filename" ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) download = client.zero_trust.dex.commands.downloads.with_raw_response.get( @@ -61,7 +61,7 @@ def test_raw_response_get(self, client: Cloudflare, respx_mock: MockRouter) -> N @pytest.mark.respx(base_url=base_url) def test_streaming_response_get(self, client: Cloudflare, respx_mock: MockRouter) -> None: respx_mock.get( - "/accounts/01a7362d577a6c3019a474fd6f485823/commands/5758fefe-ae7e-4538-a39b-1fef6abcb909/downloads/filename" + "/accounts/01a7362d577a6c3019a474fd6f485823/dex/commands/5758fefe-ae7e-4538-a39b-1fef6abcb909/downloads/filename" ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) with client.zero_trust.dex.commands.downloads.with_streaming_response.get( filename="filename", @@ -109,7 +109,7 @@ class TestAsyncDownloads: @pytest.mark.respx(base_url=base_url) async def test_method_get(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None: respx_mock.get( - "/accounts/01a7362d577a6c3019a474fd6f485823/commands/5758fefe-ae7e-4538-a39b-1fef6abcb909/downloads/filename" + "/accounts/01a7362d577a6c3019a474fd6f485823/dex/commands/5758fefe-ae7e-4538-a39b-1fef6abcb909/downloads/filename" ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) download = await async_client.zero_trust.dex.commands.downloads.get( filename="filename", @@ -125,7 +125,7 @@ async def test_method_get(self, async_client: AsyncCloudflare, respx_mock: MockR @pytest.mark.respx(base_url=base_url) async def test_raw_response_get(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None: respx_mock.get( - "/accounts/01a7362d577a6c3019a474fd6f485823/commands/5758fefe-ae7e-4538-a39b-1fef6abcb909/downloads/filename" + "/accounts/01a7362d577a6c3019a474fd6f485823/dex/commands/5758fefe-ae7e-4538-a39b-1fef6abcb909/downloads/filename" ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) download = await async_client.zero_trust.dex.commands.downloads.with_raw_response.get( @@ -143,7 +143,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare, respx_mock: @pytest.mark.respx(base_url=base_url) async def test_streaming_response_get(self, async_client: AsyncCloudflare, respx_mock: MockRouter) -> None: respx_mock.get( - "/accounts/01a7362d577a6c3019a474fd6f485823/commands/5758fefe-ae7e-4538-a39b-1fef6abcb909/downloads/filename" + "/accounts/01a7362d577a6c3019a474fd6f485823/dex/commands/5758fefe-ae7e-4538-a39b-1fef6abcb909/downloads/filename" ).mock(return_value=httpx.Response(200, json={"foo": "bar"})) async with async_client.zero_trust.dex.commands.downloads.with_streaming_response.get( filename="filename", diff --git a/tests/api_resources/zero_trust/dex/commands/test_users.py b/tests/api_resources/zero_trust/dex/commands/test_users.py new file mode 100644 index 00000000000..0f8b674a2d6 --- /dev/null +++ b/tests/api_resources/zero_trust/dex/commands/test_users.py @@ -0,0 +1,114 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.zero_trust.dex.commands import UserListResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestUsers: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + user = client.zero_trust.dex.commands.users.list( + account_id="01a7362d577a6c3019a474fd6f485823", + ) + assert_matches_type(Optional[UserListResponse], user, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + user = client.zero_trust.dex.commands.users.list( + account_id="01a7362d577a6c3019a474fd6f485823", + search="search", + ) + assert_matches_type(Optional[UserListResponse], user, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.zero_trust.dex.commands.users.with_raw_response.list( + account_id="01a7362d577a6c3019a474fd6f485823", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user = response.parse() + assert_matches_type(Optional[UserListResponse], user, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.zero_trust.dex.commands.users.with_streaming_response.list( + account_id="01a7362d577a6c3019a474fd6f485823", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user = response.parse() + assert_matches_type(Optional[UserListResponse], user, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.dex.commands.users.with_raw_response.list( + account_id="", + ) + + +class TestAsyncUsers: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + user = await async_client.zero_trust.dex.commands.users.list( + account_id="01a7362d577a6c3019a474fd6f485823", + ) + assert_matches_type(Optional[UserListResponse], user, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + user = await async_client.zero_trust.dex.commands.users.list( + account_id="01a7362d577a6c3019a474fd6f485823", + search="search", + ) + assert_matches_type(Optional[UserListResponse], user, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.dex.commands.users.with_raw_response.list( + account_id="01a7362d577a6c3019a474fd6f485823", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user = await response.parse() + assert_matches_type(Optional[UserListResponse], user, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.dex.commands.users.with_streaming_response.list( + account_id="01a7362d577a6c3019a474fd6f485823", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user = await response.parse() + assert_matches_type(Optional[UserListResponse], user, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.dex.commands.users.with_raw_response.list( + account_id="", + ) diff --git a/tests/api_resources/zero_trust/dlp/datasets/test_versions.py b/tests/api_resources/zero_trust/dlp/datasets/test_versions.py index 423c366940d..c37528d256f 100755 --- a/tests/api_resources/zero_trust/dlp/datasets/test_versions.py +++ b/tests/api_resources/zero_trust/dlp/datasets/test_versions.py @@ -17,6 +17,7 @@ class TestVersions: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_method_create(self, client: Cloudflare) -> None: version = client.zero_trust.dlp.datasets.versions.create( @@ -27,6 +28,7 @@ def test_method_create(self, client: Cloudflare) -> None: ) assert_matches_type(Optional[VersionCreateResponse], version, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: response = client.zero_trust.dlp.datasets.versions.with_raw_response.create( @@ -41,6 +43,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: version = response.parse() assert_matches_type(Optional[VersionCreateResponse], version, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: with client.zero_trust.dlp.datasets.versions.with_streaming_response.create( @@ -57,6 +60,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -79,6 +83,7 @@ def test_path_params_create(self, client: Cloudflare) -> None: class TestAsyncVersions: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: version = await async_client.zero_trust.dlp.datasets.versions.create( @@ -89,6 +94,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: ) assert_matches_type(Optional[VersionCreateResponse], version, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.dlp.datasets.versions.with_raw_response.create( @@ -103,6 +109,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: version = await response.parse() assert_matches_type(Optional[VersionCreateResponse], version, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.dlp.datasets.versions.with_streaming_response.create( @@ -119,6 +126,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): diff --git a/src/cloudflare/types/workers/ai/__init__.py b/tests/api_resources/zero_trust/dlp/email/__init__.py similarity index 70% rename from src/cloudflare/types/workers/ai/__init__.py rename to tests/api_resources/zero_trust/dlp/email/__init__.py index f8ee8b14b1c..fd8019a9a1a 100644 --- a/src/cloudflare/types/workers/ai/__init__.py +++ b/tests/api_resources/zero_trust/dlp/email/__init__.py @@ -1,3 +1 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations diff --git a/tests/api_resources/zero_trust/dlp/email/test_account_mapping.py b/tests/api_resources/zero_trust/dlp/email/test_account_mapping.py new file mode 100644 index 00000000000..8c0e9f1aaad --- /dev/null +++ b/tests/api_resources/zero_trust/dlp/email/test_account_mapping.py @@ -0,0 +1,225 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.zero_trust.dlp.email import ( + AccountMappingGetResponse, + AccountMappingCreateResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestAccountMapping: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_method_create(self, client: Cloudflare) -> None: + account_mapping = client.zero_trust.dlp.email.account_mapping.create( + account_id="account_id", + auth_requirements={ + "allowed_microsoft_organizations": ["string"], + "type": "Org", + }, + ) + assert_matches_type(Optional[AccountMappingCreateResponse], account_mapping, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_raw_response_create(self, client: Cloudflare) -> None: + response = client.zero_trust.dlp.email.account_mapping.with_raw_response.create( + account_id="account_id", + auth_requirements={ + "allowed_microsoft_organizations": ["string"], + "type": "Org", + }, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + account_mapping = response.parse() + assert_matches_type(Optional[AccountMappingCreateResponse], account_mapping, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_streaming_response_create(self, client: Cloudflare) -> None: + with client.zero_trust.dlp.email.account_mapping.with_streaming_response.create( + account_id="account_id", + auth_requirements={ + "allowed_microsoft_organizations": ["string"], + "type": "Org", + }, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + account_mapping = response.parse() + assert_matches_type(Optional[AccountMappingCreateResponse], account_mapping, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_path_params_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.dlp.email.account_mapping.with_raw_response.create( + account_id="", + auth_requirements={ + "allowed_microsoft_organizations": ["string"], + "type": "Org", + }, + ) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + account_mapping = client.zero_trust.dlp.email.account_mapping.get( + account_id="account_id", + ) + assert_matches_type(Optional[AccountMappingGetResponse], account_mapping, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.zero_trust.dlp.email.account_mapping.with_raw_response.get( + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + account_mapping = response.parse() + assert_matches_type(Optional[AccountMappingGetResponse], account_mapping, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.zero_trust.dlp.email.account_mapping.with_streaming_response.get( + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + account_mapping = response.parse() + assert_matches_type(Optional[AccountMappingGetResponse], account_mapping, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.dlp.email.account_mapping.with_raw_response.get( + account_id="", + ) + + +class TestAsyncAccountMapping: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_method_create(self, async_client: AsyncCloudflare) -> None: + account_mapping = await async_client.zero_trust.dlp.email.account_mapping.create( + account_id="account_id", + auth_requirements={ + "allowed_microsoft_organizations": ["string"], + "type": "Org", + }, + ) + assert_matches_type(Optional[AccountMappingCreateResponse], account_mapping, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.dlp.email.account_mapping.with_raw_response.create( + account_id="account_id", + auth_requirements={ + "allowed_microsoft_organizations": ["string"], + "type": "Org", + }, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + account_mapping = await response.parse() + assert_matches_type(Optional[AccountMappingCreateResponse], account_mapping, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.dlp.email.account_mapping.with_streaming_response.create( + account_id="account_id", + auth_requirements={ + "allowed_microsoft_organizations": ["string"], + "type": "Org", + }, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + account_mapping = await response.parse() + assert_matches_type(Optional[AccountMappingCreateResponse], account_mapping, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.dlp.email.account_mapping.with_raw_response.create( + account_id="", + auth_requirements={ + "allowed_microsoft_organizations": ["string"], + "type": "Org", + }, + ) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + account_mapping = await async_client.zero_trust.dlp.email.account_mapping.get( + account_id="account_id", + ) + assert_matches_type(Optional[AccountMappingGetResponse], account_mapping, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.dlp.email.account_mapping.with_raw_response.get( + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + account_mapping = await response.parse() + assert_matches_type(Optional[AccountMappingGetResponse], account_mapping, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.dlp.email.account_mapping.with_streaming_response.get( + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + account_mapping = await response.parse() + assert_matches_type(Optional[AccountMappingGetResponse], account_mapping, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.dlp.email.account_mapping.with_raw_response.get( + account_id="", + ) diff --git a/tests/api_resources/zero_trust/dlp/email/test_rules.py b/tests/api_resources/zero_trust/dlp/email/test_rules.py new file mode 100644 index 00000000000..f64c4040aa6 --- /dev/null +++ b/tests/api_resources/zero_trust/dlp/email/test_rules.py @@ -0,0 +1,820 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.zero_trust.dlp.email import ( + RuleGetResponse, + RuleListResponse, + RuleCreateResponse, + RuleDeleteResponse, + RuleUpdateResponse, + RuleBulkEditResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestRules: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Cloudflare) -> None: + rule = client.zero_trust.dlp.email.rules.create( + account_id="account_id", + action={"action": "Block"}, + conditions=[ + { + "operator": "InList", + "selector": "Recipients", + "value": {}, + } + ], + enabled=True, + name="name", + ) + assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Cloudflare) -> None: + rule = client.zero_trust.dlp.email.rules.create( + account_id="account_id", + action={ + "action": "Block", + "message": "message", + }, + conditions=[ + { + "operator": "InList", + "selector": "Recipients", + "value": {}, + } + ], + enabled=True, + name="name", + description="description", + ) + assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Cloudflare) -> None: + response = client.zero_trust.dlp.email.rules.with_raw_response.create( + account_id="account_id", + action={"action": "Block"}, + conditions=[ + { + "operator": "InList", + "selector": "Recipients", + "value": {}, + } + ], + enabled=True, + name="name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = response.parse() + assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Cloudflare) -> None: + with client.zero_trust.dlp.email.rules.with_streaming_response.create( + account_id="account_id", + action={"action": "Block"}, + conditions=[ + { + "operator": "InList", + "selector": "Recipients", + "value": {}, + } + ], + enabled=True, + name="name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = response.parse() + assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.dlp.email.rules.with_raw_response.create( + account_id="", + action={"action": "Block"}, + conditions=[ + { + "operator": "InList", + "selector": "Recipients", + "value": {}, + } + ], + enabled=True, + name="name", + ) + + @parametrize + def test_method_update(self, client: Cloudflare) -> None: + rule = client.zero_trust.dlp.email.rules.update( + rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + action={"action": "Block"}, + conditions=[ + { + "operator": "InList", + "selector": "Recipients", + "value": {}, + } + ], + enabled=True, + name="name", + ) + assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + + @parametrize + def test_method_update_with_all_params(self, client: Cloudflare) -> None: + rule = client.zero_trust.dlp.email.rules.update( + rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + action={ + "action": "Block", + "message": "message", + }, + conditions=[ + { + "operator": "InList", + "selector": "Recipients", + "value": {}, + } + ], + enabled=True, + name="name", + description="description", + ) + assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Cloudflare) -> None: + response = client.zero_trust.dlp.email.rules.with_raw_response.update( + rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + action={"action": "Block"}, + conditions=[ + { + "operator": "InList", + "selector": "Recipients", + "value": {}, + } + ], + enabled=True, + name="name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = response.parse() + assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Cloudflare) -> None: + with client.zero_trust.dlp.email.rules.with_streaming_response.update( + rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + action={"action": "Block"}, + conditions=[ + { + "operator": "InList", + "selector": "Recipients", + "value": {}, + } + ], + enabled=True, + name="name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = response.parse() + assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.dlp.email.rules.with_raw_response.update( + rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="", + action={"action": "Block"}, + conditions=[ + { + "operator": "InList", + "selector": "Recipients", + "value": {}, + } + ], + enabled=True, + name="name", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + client.zero_trust.dlp.email.rules.with_raw_response.update( + rule_id="", + account_id="account_id", + action={"action": "Block"}, + conditions=[ + { + "operator": "InList", + "selector": "Recipients", + "value": {}, + } + ], + enabled=True, + name="name", + ) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + rule = client.zero_trust.dlp.email.rules.list( + account_id="account_id", + ) + assert_matches_type(SyncSinglePage[RuleListResponse], rule, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.zero_trust.dlp.email.rules.with_raw_response.list( + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = response.parse() + assert_matches_type(SyncSinglePage[RuleListResponse], rule, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.zero_trust.dlp.email.rules.with_streaming_response.list( + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = response.parse() + assert_matches_type(SyncSinglePage[RuleListResponse], rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.dlp.email.rules.with_raw_response.list( + account_id="", + ) + + @parametrize + def test_method_delete(self, client: Cloudflare) -> None: + rule = client.zero_trust.dlp.email.rules.delete( + rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) + assert_matches_type(Optional[RuleDeleteResponse], rule, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.zero_trust.dlp.email.rules.with_raw_response.delete( + rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = response.parse() + assert_matches_type(Optional[RuleDeleteResponse], rule, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.zero_trust.dlp.email.rules.with_streaming_response.delete( + rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = response.parse() + assert_matches_type(Optional[RuleDeleteResponse], rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.dlp.email.rules.with_raw_response.delete( + rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + client.zero_trust.dlp.email.rules.with_raw_response.delete( + rule_id="", + account_id="account_id", + ) + + @parametrize + def test_method_bulk_edit(self, client: Cloudflare) -> None: + rule = client.zero_trust.dlp.email.rules.bulk_edit( + account_id="account_id", + new_priorities={"foo": 0}, + ) + assert_matches_type(Optional[RuleBulkEditResponse], rule, path=["response"]) + + @parametrize + def test_raw_response_bulk_edit(self, client: Cloudflare) -> None: + response = client.zero_trust.dlp.email.rules.with_raw_response.bulk_edit( + account_id="account_id", + new_priorities={"foo": 0}, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = response.parse() + assert_matches_type(Optional[RuleBulkEditResponse], rule, path=["response"]) + + @parametrize + def test_streaming_response_bulk_edit(self, client: Cloudflare) -> None: + with client.zero_trust.dlp.email.rules.with_streaming_response.bulk_edit( + account_id="account_id", + new_priorities={"foo": 0}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = response.parse() + assert_matches_type(Optional[RuleBulkEditResponse], rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_bulk_edit(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.dlp.email.rules.with_raw_response.bulk_edit( + account_id="", + new_priorities={"foo": 0}, + ) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + rule = client.zero_trust.dlp.email.rules.get( + rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) + assert_matches_type(Optional[RuleGetResponse], rule, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.zero_trust.dlp.email.rules.with_raw_response.get( + rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = response.parse() + assert_matches_type(Optional[RuleGetResponse], rule, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.zero_trust.dlp.email.rules.with_streaming_response.get( + rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = response.parse() + assert_matches_type(Optional[RuleGetResponse], rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.dlp.email.rules.with_raw_response.get( + rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + client.zero_trust.dlp.email.rules.with_raw_response.get( + rule_id="", + account_id="account_id", + ) + + +class TestAsyncRules: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.zero_trust.dlp.email.rules.create( + account_id="account_id", + action={"action": "Block"}, + conditions=[ + { + "operator": "InList", + "selector": "Recipients", + "value": {}, + } + ], + enabled=True, + name="name", + ) + assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.zero_trust.dlp.email.rules.create( + account_id="account_id", + action={ + "action": "Block", + "message": "message", + }, + conditions=[ + { + "operator": "InList", + "selector": "Recipients", + "value": {}, + } + ], + enabled=True, + name="name", + description="description", + ) + assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.dlp.email.rules.with_raw_response.create( + account_id="account_id", + action={"action": "Block"}, + conditions=[ + { + "operator": "InList", + "selector": "Recipients", + "value": {}, + } + ], + enabled=True, + name="name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = await response.parse() + assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.dlp.email.rules.with_streaming_response.create( + account_id="account_id", + action={"action": "Block"}, + conditions=[ + { + "operator": "InList", + "selector": "Recipients", + "value": {}, + } + ], + enabled=True, + name="name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = await response.parse() + assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.dlp.email.rules.with_raw_response.create( + account_id="", + action={"action": "Block"}, + conditions=[ + { + "operator": "InList", + "selector": "Recipients", + "value": {}, + } + ], + enabled=True, + name="name", + ) + + @parametrize + async def test_method_update(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.zero_trust.dlp.email.rules.update( + rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + action={"action": "Block"}, + conditions=[ + { + "operator": "InList", + "selector": "Recipients", + "value": {}, + } + ], + enabled=True, + name="name", + ) + assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.zero_trust.dlp.email.rules.update( + rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + action={ + "action": "Block", + "message": "message", + }, + conditions=[ + { + "operator": "InList", + "selector": "Recipients", + "value": {}, + } + ], + enabled=True, + name="name", + description="description", + ) + assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.dlp.email.rules.with_raw_response.update( + rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + action={"action": "Block"}, + conditions=[ + { + "operator": "InList", + "selector": "Recipients", + "value": {}, + } + ], + enabled=True, + name="name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = await response.parse() + assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.dlp.email.rules.with_streaming_response.update( + rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + action={"action": "Block"}, + conditions=[ + { + "operator": "InList", + "selector": "Recipients", + "value": {}, + } + ], + enabled=True, + name="name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = await response.parse() + assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.dlp.email.rules.with_raw_response.update( + rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="", + action={"action": "Block"}, + conditions=[ + { + "operator": "InList", + "selector": "Recipients", + "value": {}, + } + ], + enabled=True, + name="name", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + await async_client.zero_trust.dlp.email.rules.with_raw_response.update( + rule_id="", + account_id="account_id", + action={"action": "Block"}, + conditions=[ + { + "operator": "InList", + "selector": "Recipients", + "value": {}, + } + ], + enabled=True, + name="name", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.zero_trust.dlp.email.rules.list( + account_id="account_id", + ) + assert_matches_type(AsyncSinglePage[RuleListResponse], rule, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.dlp.email.rules.with_raw_response.list( + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = await response.parse() + assert_matches_type(AsyncSinglePage[RuleListResponse], rule, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.dlp.email.rules.with_streaming_response.list( + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = await response.parse() + assert_matches_type(AsyncSinglePage[RuleListResponse], rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.dlp.email.rules.with_raw_response.list( + account_id="", + ) + + @parametrize + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.zero_trust.dlp.email.rules.delete( + rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) + assert_matches_type(Optional[RuleDeleteResponse], rule, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.dlp.email.rules.with_raw_response.delete( + rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = await response.parse() + assert_matches_type(Optional[RuleDeleteResponse], rule, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.dlp.email.rules.with_streaming_response.delete( + rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = await response.parse() + assert_matches_type(Optional[RuleDeleteResponse], rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.dlp.email.rules.with_raw_response.delete( + rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + await async_client.zero_trust.dlp.email.rules.with_raw_response.delete( + rule_id="", + account_id="account_id", + ) + + @parametrize + async def test_method_bulk_edit(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.zero_trust.dlp.email.rules.bulk_edit( + account_id="account_id", + new_priorities={"foo": 0}, + ) + assert_matches_type(Optional[RuleBulkEditResponse], rule, path=["response"]) + + @parametrize + async def test_raw_response_bulk_edit(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.dlp.email.rules.with_raw_response.bulk_edit( + account_id="account_id", + new_priorities={"foo": 0}, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = await response.parse() + assert_matches_type(Optional[RuleBulkEditResponse], rule, path=["response"]) + + @parametrize + async def test_streaming_response_bulk_edit(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.dlp.email.rules.with_streaming_response.bulk_edit( + account_id="account_id", + new_priorities={"foo": 0}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = await response.parse() + assert_matches_type(Optional[RuleBulkEditResponse], rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_bulk_edit(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.dlp.email.rules.with_raw_response.bulk_edit( + account_id="", + new_priorities={"foo": 0}, + ) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.zero_trust.dlp.email.rules.get( + rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) + assert_matches_type(Optional[RuleGetResponse], rule, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.dlp.email.rules.with_raw_response.get( + rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = await response.parse() + assert_matches_type(Optional[RuleGetResponse], rule, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.dlp.email.rules.with_streaming_response.get( + rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = await response.parse() + assert_matches_type(Optional[RuleGetResponse], rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.dlp.email.rules.with_raw_response.get( + rule_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + await async_client.zero_trust.dlp.email.rules.with_raw_response.get( + rule_id="", + account_id="account_id", + ) diff --git a/tests/api_resources/zero_trust/dlp/test_entries.py b/tests/api_resources/zero_trust/dlp/test_entries.py index cf41c61b9f9..d0a651e7f92 100644 --- a/tests/api_resources/zero_trust/dlp/test_entries.py +++ b/tests/api_resources/zero_trust/dlp/test_entries.py @@ -91,6 +91,7 @@ def test_path_params_create(self, client: Cloudflare) -> None: profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_method_update_overload_1(self, client: Cloudflare) -> None: entry = client.zero_trust.dlp.entries.update( @@ -102,6 +103,7 @@ def test_method_update_overload_1(self, client: Cloudflare) -> None: ) assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> None: entry = client.zero_trust.dlp.entries.update( @@ -117,6 +119,7 @@ def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> N ) assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: response = client.zero_trust.dlp.entries.with_raw_response.update( @@ -132,6 +135,7 @@ def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: entry = response.parse() assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: with client.zero_trust.dlp.entries.with_streaming_response.update( @@ -149,6 +153,7 @@ def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_1(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -169,6 +174,7 @@ def test_path_params_update_overload_1(self, client: Cloudflare) -> None: type="custom", ) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_method_update_overload_2(self, client: Cloudflare) -> None: entry = client.zero_trust.dlp.entries.update( @@ -178,6 +184,7 @@ def test_method_update_overload_2(self, client: Cloudflare) -> None: ) assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> None: entry = client.zero_trust.dlp.entries.update( @@ -188,6 +195,7 @@ def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> N ) assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: response = client.zero_trust.dlp.entries.with_raw_response.update( @@ -201,6 +209,7 @@ def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: entry = response.parse() assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: with client.zero_trust.dlp.entries.with_streaming_response.update( @@ -216,6 +225,7 @@ def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_2(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -232,6 +242,7 @@ def test_path_params_update_overload_2(self, client: Cloudflare) -> None: type="predefined", ) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_method_update_overload_3(self, client: Cloudflare) -> None: entry = client.zero_trust.dlp.entries.update( @@ -241,6 +252,7 @@ def test_method_update_overload_3(self, client: Cloudflare) -> None: ) assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_method_update_with_all_params_overload_3(self, client: Cloudflare) -> None: entry = client.zero_trust.dlp.entries.update( @@ -251,6 +263,7 @@ def test_method_update_with_all_params_overload_3(self, client: Cloudflare) -> N ) assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_raw_response_update_overload_3(self, client: Cloudflare) -> None: response = client.zero_trust.dlp.entries.with_raw_response.update( @@ -264,6 +277,7 @@ def test_raw_response_update_overload_3(self, client: Cloudflare) -> None: entry = response.parse() assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_streaming_response_update_overload_3(self, client: Cloudflare) -> None: with client.zero_trust.dlp.entries.with_streaming_response.update( @@ -279,6 +293,7 @@ def test_streaming_response_update_overload_3(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_3(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -501,6 +516,7 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_update_overload_1(self, async_client: AsyncCloudflare) -> None: entry = await async_client.zero_trust.dlp.entries.update( @@ -512,6 +528,7 @@ async def test_method_update_overload_1(self, async_client: AsyncCloudflare) -> ) assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_update_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: entry = await async_client.zero_trust.dlp.entries.update( @@ -527,6 +544,7 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn ) assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.dlp.entries.with_raw_response.update( @@ -542,6 +560,7 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflar entry = await response.parse() assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_streaming_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.dlp.entries.with_streaming_response.update( @@ -559,6 +578,7 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncClo assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_1(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -579,6 +599,7 @@ async def test_path_params_update_overload_1(self, async_client: AsyncCloudflare type="custom", ) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> None: entry = await async_client.zero_trust.dlp.entries.update( @@ -588,6 +609,7 @@ async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> ) assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_update_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: entry = await async_client.zero_trust.dlp.entries.update( @@ -598,6 +620,7 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn ) assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.dlp.entries.with_raw_response.update( @@ -611,6 +634,7 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflar entry = await response.parse() assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_streaming_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.dlp.entries.with_streaming_response.update( @@ -626,6 +650,7 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncClo assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -642,6 +667,7 @@ async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare type="predefined", ) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_update_overload_3(self, async_client: AsyncCloudflare) -> None: entry = await async_client.zero_trust.dlp.entries.update( @@ -651,6 +677,7 @@ async def test_method_update_overload_3(self, async_client: AsyncCloudflare) -> ) assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_update_with_all_params_overload_3(self, async_client: AsyncCloudflare) -> None: entry = await async_client.zero_trust.dlp.entries.update( @@ -661,6 +688,7 @@ async def test_method_update_with_all_params_overload_3(self, async_client: Asyn ) assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_raw_response_update_overload_3(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.dlp.entries.with_raw_response.update( @@ -674,6 +702,7 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncCloudflar entry = await response.parse() assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_streaming_response_update_overload_3(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.dlp.entries.with_streaming_response.update( @@ -689,6 +718,7 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncClo assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_3(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): diff --git a/tests/api_resources/zero_trust/gateway/test_lists.py b/tests/api_resources/zero_trust/gateway/test_lists.py index 5448c53e5b9..4c81584d3e3 100644 --- a/tests/api_resources/zero_trust/gateway/test_lists.py +++ b/tests/api_resources/zero_trust/gateway/test_lists.py @@ -99,6 +99,12 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: account_id="699d98642c564d2e855e9661899b7252", name="Admin Serial Numbers", description="The serial numbers for administrators", + items=[ + { + "description": "Austin office IP", + "value": "8GE8721REF", + } + ], ) assert_matches_type(Optional[GatewayList], list_, path=["response"]) @@ -433,6 +439,12 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare account_id="699d98642c564d2e855e9661899b7252", name="Admin Serial Numbers", description="The serial numbers for administrators", + items=[ + { + "description": "Austin office IP", + "value": "8GE8721REF", + } + ], ) assert_matches_type(Optional[GatewayList], list_, path=["response"]) diff --git a/tests/api_resources/zero_trust/gateway/test_rules.py b/tests/api_resources/zero_trust/gateway/test_rules.py index 8852212a8b5..e1ed5506b92 100644 --- a/tests/api_resources/zero_trust/gateway/test_rules.py +++ b/tests/api_resources/zero_trust/gateway/test_rules.py @@ -105,6 +105,10 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "override_ips": ["1.1.1.1", "2.2.2.2"], "payload_log": {"enabled": True}, "quarantine": {"file_types": ["exe"]}, + "resolve_dns_internally": { + "fallback": "none", + "view_id": "view_id", + }, "resolve_dns_through_cloudflare": True, "untrusted_cert": {"action": "pass_through"}, }, @@ -245,6 +249,10 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "override_ips": ["1.1.1.1", "2.2.2.2"], "payload_log": {"enabled": True}, "quarantine": {"file_types": ["exe"]}, + "resolve_dns_internally": { + "fallback": "none", + "view_id": "view_id", + }, "resolve_dns_through_cloudflare": True, "untrusted_cert": {"action": "pass_through"}, }, @@ -580,6 +588,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "override_ips": ["1.1.1.1", "2.2.2.2"], "payload_log": {"enabled": True}, "quarantine": {"file_types": ["exe"]}, + "resolve_dns_internally": { + "fallback": "none", + "view_id": "view_id", + }, "resolve_dns_through_cloudflare": True, "untrusted_cert": {"action": "pass_through"}, }, @@ -720,6 +732,10 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "override_ips": ["1.1.1.1", "2.2.2.2"], "payload_log": {"enabled": True}, "quarantine": {"file_types": ["exe"]}, + "resolve_dns_internally": { + "fallback": "none", + "view_id": "view_id", + }, "resolve_dns_through_cloudflare": True, "untrusted_cert": {"action": "pass_through"}, }, diff --git a/tests/api_resources/zero_trust/organizations/test_doh.py b/tests/api_resources/zero_trust/organizations/test_doh.py index 3b0c04a90dc..58ac94ae30a 100644 --- a/tests/api_resources/zero_trust/organizations/test_doh.py +++ b/tests/api_resources/zero_trust/organizations/test_doh.py @@ -28,7 +28,7 @@ def test_method_update(self, client: Cloudflare) -> None: def test_method_update_with_all_params(self, client: Cloudflare) -> None: doh = client.zero_trust.organizations.doh.update( account_id="023e105f4ecef8ad9ca31a8372d0c353", - jwt_duration="800h", + doh_jwt_duration="800h", service_token_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ) assert_matches_type(Optional[DOHUpdateResponse], doh, path=["response"]) @@ -117,7 +117,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: doh = await async_client.zero_trust.organizations.doh.update( account_id="023e105f4ecef8ad9ca31a8372d0c353", - jwt_duration="800h", + doh_jwt_duration="800h", service_token_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ) assert_matches_type(Optional[DOHUpdateResponse], doh, path=["response"]) diff --git a/tests/api_resources/zero_trust/test_devices.py b/tests/api_resources/zero_trust/test_devices.py index f814c7c80bc..e806fd8d30e 100644 --- a/tests/api_resources/zero_trust/test_devices.py +++ b/tests/api_resources/zero_trust/test_devices.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -62,7 +62,7 @@ def test_method_get(self, client: Cloudflare) -> None: device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(DeviceGetResponse, device, path=["response"]) + assert_matches_type(Optional[DeviceGetResponse], device, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -74,7 +74,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" device = response.parse() - assert_matches_type(DeviceGetResponse, device, path=["response"]) + assert_matches_type(Optional[DeviceGetResponse], device, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -86,7 +86,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" device = response.parse() - assert_matches_type(DeviceGetResponse, device, path=["response"]) + assert_matches_type(Optional[DeviceGetResponse], device, path=["response"]) assert cast(Any, response.is_closed) is True @@ -152,7 +152,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: device_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(DeviceGetResponse, device, path=["response"]) + assert_matches_type(Optional[DeviceGetResponse], device, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -164,7 +164,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" device = await response.parse() - assert_matches_type(DeviceGetResponse, device, path=["response"]) + assert_matches_type(Optional[DeviceGetResponse], device, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -176,7 +176,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" device = await response.parse() - assert_matches_type(DeviceGetResponse, device, path=["response"]) + assert_matches_type(Optional[DeviceGetResponse], device, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zones/test_holds.py b/tests/api_resources/zones/test_holds.py index c49066aee53..b34e5066342 100644 --- a/tests/api_resources/zones/test_holds.py +++ b/tests/api_resources/zones/test_holds.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest @@ -68,7 +68,7 @@ def test_method_delete(self, client: Cloudflare) -> None: hold = client.zones.holds.delete( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ZoneHold], hold, path=["response"]) + assert_matches_type(ZoneHold, hold, path=["response"]) @parametrize def test_method_delete_with_all_params(self, client: Cloudflare) -> None: @@ -76,7 +76,7 @@ def test_method_delete_with_all_params(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", hold_after="hold_after", ) - assert_matches_type(Optional[ZoneHold], hold, path=["response"]) + assert_matches_type(ZoneHold, hold, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -87,7 +87,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" hold = response.parse() - assert_matches_type(Optional[ZoneHold], hold, path=["response"]) + assert_matches_type(ZoneHold, hold, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -98,7 +98,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" hold = response.parse() - assert_matches_type(Optional[ZoneHold], hold, path=["response"]) + assert_matches_type(ZoneHold, hold, path=["response"]) assert cast(Any, response.is_closed) is True @@ -109,6 +109,53 @@ def test_path_params_delete(self, client: Cloudflare) -> None: zone_id="", ) + @parametrize + def test_method_edit(self, client: Cloudflare) -> None: + hold = client.zones.holds.edit( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(ZoneHold, hold, path=["response"]) + + @parametrize + def test_method_edit_with_all_params(self, client: Cloudflare) -> None: + hold = client.zones.holds.edit( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + hold_after="2023-01-31T15:56:36+00:00", + include_subdomains=True, + ) + assert_matches_type(ZoneHold, hold, path=["response"]) + + @parametrize + def test_raw_response_edit(self, client: Cloudflare) -> None: + response = client.zones.holds.with_raw_response.edit( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + hold = response.parse() + assert_matches_type(ZoneHold, hold, path=["response"]) + + @parametrize + def test_streaming_response_edit(self, client: Cloudflare) -> None: + with client.zones.holds.with_streaming_response.edit( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + hold = response.parse() + assert_matches_type(ZoneHold, hold, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_edit(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zones.holds.with_raw_response.edit( + zone_id="", + ) + @parametrize def test_method_get(self, client: Cloudflare) -> None: hold = client.zones.holds.get( @@ -202,7 +249,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: hold = await async_client.zones.holds.delete( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ZoneHold], hold, path=["response"]) + assert_matches_type(ZoneHold, hold, path=["response"]) @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -210,7 +257,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare zone_id="023e105f4ecef8ad9ca31a8372d0c353", hold_after="hold_after", ) - assert_matches_type(Optional[ZoneHold], hold, path=["response"]) + assert_matches_type(ZoneHold, hold, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -221,7 +268,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" hold = await response.parse() - assert_matches_type(Optional[ZoneHold], hold, path=["response"]) + assert_matches_type(ZoneHold, hold, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -232,7 +279,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" hold = await response.parse() - assert_matches_type(Optional[ZoneHold], hold, path=["response"]) + assert_matches_type(ZoneHold, hold, path=["response"]) assert cast(Any, response.is_closed) is True @@ -243,6 +290,53 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: zone_id="", ) + @parametrize + async def test_method_edit(self, async_client: AsyncCloudflare) -> None: + hold = await async_client.zones.holds.edit( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(ZoneHold, hold, path=["response"]) + + @parametrize + async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: + hold = await async_client.zones.holds.edit( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + hold_after="2023-01-31T15:56:36+00:00", + include_subdomains=True, + ) + assert_matches_type(ZoneHold, hold, path=["response"]) + + @parametrize + async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zones.holds.with_raw_response.edit( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + hold = await response.parse() + assert_matches_type(ZoneHold, hold, path=["response"]) + + @parametrize + async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: + async with async_client.zones.holds.with_streaming_response.edit( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + hold = await response.parse() + assert_matches_type(ZoneHold, hold, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zones.holds.with_raw_response.edit( + zone_id="", + ) + @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: hold = await async_client.zones.holds.get( From ad523ed021a683ccd3a8e9c58f4f90013a8872d2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 16 Jan 2025 18:40:37 +0000 Subject: [PATCH 011/358] feat(api): api update (#2369) --- .stats.yml | 4 +- api.md | 33 ++- .../resources/hyperdrive/configs.py | 66 +++--- src/cloudflare/resources/rulesets/rulesets.py | 48 ++++- .../access/infrastructure/targets.py | 10 +- .../zero_trust/dex/commands/__init__.py | 14 -- .../zero_trust/dex/commands/commands.py | 32 --- .../zero_trust/dex/commands/users.py | 189 ------------------ src/cloudflare/types/hyperdrive/__init__.py | 5 + .../types/hyperdrive/config_create_params.py | 4 +- .../hyperdrive/config_create_response.py | 16 ++ .../types/hyperdrive/config_edit_params.py | 4 +- .../types/hyperdrive/config_edit_response.py | 16 ++ .../types/hyperdrive/config_get_response.py | 16 ++ .../types/hyperdrive/config_list_response.py | 16 ++ .../types/hyperdrive/config_update_params.py | 4 +- .../hyperdrive/config_update_response.py | 16 ++ src/cloudflare/types/hyperdrive/hyperdrive.py | 4 +- src/cloudflare/types/rulesets/__init__.py | 1 + .../types/rulesets/ruleset_list_params.py | 21 ++ .../types/zero_trust/dex/commands/__init__.py | 2 - .../dex/commands/device_list_response.py | 6 + .../dex/commands/user_list_params.py | 14 -- .../dex/commands/user_list_response.py | 14 -- .../types/zero_trust/gateway/rule_setting.py | 55 ++++- .../zero_trust/gateway/rule_setting_param.py | 53 ++++- .../api_resources/hyperdrive/test_configs.py | 80 ++++---- tests/api_resources/test_rulesets.py | 22 +- .../zero_trust/dex/commands/test_users.py | 114 ----------- .../zero_trust/gateway/test_rules.py | 28 +++ 30 files changed, 402 insertions(+), 505 deletions(-) delete mode 100644 src/cloudflare/resources/zero_trust/dex/commands/users.py create mode 100644 src/cloudflare/types/hyperdrive/config_create_response.py create mode 100644 src/cloudflare/types/hyperdrive/config_edit_response.py create mode 100644 src/cloudflare/types/hyperdrive/config_get_response.py create mode 100644 src/cloudflare/types/hyperdrive/config_list_response.py create mode 100644 src/cloudflare/types/hyperdrive/config_update_response.py create mode 100644 src/cloudflare/types/rulesets/ruleset_list_params.py delete mode 100644 src/cloudflare/types/zero_trust/dex/commands/user_list_params.py delete mode 100644 src/cloudflare/types/zero_trust/dex/commands/user_list_response.py delete mode 100644 tests/api_resources/zero_trust/dex/commands/test_users.py diff --git a/.stats.yml b/.stats.yml index 3b06a3c53b3..f689a46efff 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 1494 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-817b1412335b2bc367169247bf8a10b29dbadb82b77df71df5ef5f3470fc974b.yml +configured_endpoints: 1493 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5e32fa5d8d6040e3c40095cc73f64d0a3b7a88824f57f5a2667663297a9f3113.yml diff --git a/api.md b/api.md index 23c7913ee2d..32d555aac3a 100644 --- a/api.md +++ b/api.md @@ -2928,7 +2928,7 @@ Methods: - client.rulesets.create(\*, account_id, zone_id, \*\*params) -> RulesetCreateResponse - client.rulesets.update(ruleset_id, \*, account_id, zone_id, \*\*params) -> RulesetUpdateResponse -- client.rulesets.list(\*, account_id, zone_id) -> SyncSinglePage[RulesetListResponse] +- client.rulesets.list(\*, account_id, zone_id, \*\*params) -> SyncCursorPagination[RulesetListResponse] - client.rulesets.delete(ruleset_id, \*, account_id, zone_id) -> None - client.rulesets.get(ruleset_id, \*, account_id, zone_id) -> RulesetGetResponse @@ -5654,18 +5654,6 @@ Methods: - client.zero_trust.dex.commands.create(\*, account_id, \*\*params) -> Optional[CommandCreateResponse] - client.zero_trust.dex.commands.list(\*, account_id, \*\*params) -> SyncV4PagePagination[Optional[CommandListResponse]] -#### Users - -Types: - -```python -from cloudflare.types.zero_trust.dex.commands import UserListResponse -``` - -Methods: - -- client.zero_trust.dex.commands.users.list(\*, account_id, \*\*params) -> Optional[UserListResponse] - #### Devices Types: @@ -6519,17 +6507,24 @@ from cloudflare.types.hyperdrive import Configuration, Hyperdrive Types: ```python -from cloudflare.types.hyperdrive import ConfigDeleteResponse +from cloudflare.types.hyperdrive import ( + ConfigCreateResponse, + ConfigUpdateResponse, + ConfigListResponse, + ConfigDeleteResponse, + ConfigEditResponse, + ConfigGetResponse, +) ``` Methods: -- client.hyperdrive.configs.create(\*, account_id, \*\*params) -> Hyperdrive -- client.hyperdrive.configs.update(hyperdrive_id, \*, account_id, \*\*params) -> Hyperdrive -- client.hyperdrive.configs.list(\*, account_id) -> SyncSinglePage[Hyperdrive] +- client.hyperdrive.configs.create(\*, account_id, \*\*params) -> ConfigCreateResponse +- client.hyperdrive.configs.update(hyperdrive_id, \*, account_id, \*\*params) -> ConfigUpdateResponse +- client.hyperdrive.configs.list(\*, account_id) -> SyncSinglePage[ConfigListResponse] - client.hyperdrive.configs.delete(hyperdrive_id, \*, account_id) -> object -- client.hyperdrive.configs.edit(hyperdrive_id, \*, account_id, \*\*params) -> Hyperdrive -- client.hyperdrive.configs.get(hyperdrive_id, \*, account_id) -> Hyperdrive +- client.hyperdrive.configs.edit(hyperdrive_id, \*, account_id, \*\*params) -> ConfigEditResponse +- client.hyperdrive.configs.get(hyperdrive_id, \*, account_id) -> ConfigGetResponse # RUM diff --git a/src/cloudflare/resources/hyperdrive/configs.py b/src/cloudflare/resources/hyperdrive/configs.py index 65d373db9f4..b82e2139e3f 100644 --- a/src/cloudflare/resources/hyperdrive/configs.py +++ b/src/cloudflare/resources/hyperdrive/configs.py @@ -23,7 +23,11 @@ from ...pagination import SyncSinglePage, AsyncSinglePage from ..._base_client import AsyncPaginator, make_request_options from ...types.hyperdrive import config_edit_params, config_create_params, config_update_params -from ...types.hyperdrive.hyperdrive import Hyperdrive +from ...types.hyperdrive.config_get_response import ConfigGetResponse +from ...types.hyperdrive.config_edit_response import ConfigEditResponse +from ...types.hyperdrive.config_list_response import ConfigListResponse +from ...types.hyperdrive.config_create_response import ConfigCreateResponse +from ...types.hyperdrive.config_update_response import ConfigUpdateResponse __all__ = ["ConfigsResource", "AsyncConfigsResource"] @@ -61,7 +65,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Hyperdrive: + ) -> ConfigCreateResponse: """ Creates and returns a new Hyperdrive configuration. @@ -93,9 +97,9 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Hyperdrive]._unwrapper, + post_parser=ResultWrapper[ConfigCreateResponse]._unwrapper, ), - cast_to=cast(Type[Hyperdrive], ResultWrapper[Hyperdrive]), + cast_to=cast(Type[ConfigCreateResponse], ResultWrapper[ConfigCreateResponse]), ) def update( @@ -112,7 +116,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Hyperdrive: + ) -> ConfigUpdateResponse: """ Updates and returns the specified Hyperdrive configuration. @@ -148,9 +152,9 @@ def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Hyperdrive]._unwrapper, + post_parser=ResultWrapper[ConfigUpdateResponse]._unwrapper, ), - cast_to=cast(Type[Hyperdrive], ResultWrapper[Hyperdrive]), + cast_to=cast(Type[ConfigUpdateResponse], ResultWrapper[ConfigUpdateResponse]), ) def list( @@ -163,7 +167,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[Hyperdrive]: + ) -> SyncSinglePage[ConfigListResponse]: """ Returns a list of Hyperdrives @@ -182,11 +186,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/hyperdrive/configs", - page=SyncSinglePage[Hyperdrive], + page=SyncSinglePage[ConfigListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=Hyperdrive, + model=ConfigListResponse, ) def delete( @@ -247,7 +251,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Hyperdrive: + ) -> ConfigEditResponse: """Patches and returns the specified Hyperdrive configuration. Custom caching @@ -285,9 +289,9 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Hyperdrive]._unwrapper, + post_parser=ResultWrapper[ConfigEditResponse]._unwrapper, ), - cast_to=cast(Type[Hyperdrive], ResultWrapper[Hyperdrive]), + cast_to=cast(Type[ConfigEditResponse], ResultWrapper[ConfigEditResponse]), ) def get( @@ -301,7 +305,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Hyperdrive: + ) -> ConfigGetResponse: """ Returns the specified Hyperdrive configuration. @@ -329,9 +333,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Hyperdrive]._unwrapper, + post_parser=ResultWrapper[ConfigGetResponse]._unwrapper, ), - cast_to=cast(Type[Hyperdrive], ResultWrapper[Hyperdrive]), + cast_to=cast(Type[ConfigGetResponse], ResultWrapper[ConfigGetResponse]), ) @@ -368,7 +372,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Hyperdrive: + ) -> ConfigCreateResponse: """ Creates and returns a new Hyperdrive configuration. @@ -400,9 +404,9 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Hyperdrive]._unwrapper, + post_parser=ResultWrapper[ConfigCreateResponse]._unwrapper, ), - cast_to=cast(Type[Hyperdrive], ResultWrapper[Hyperdrive]), + cast_to=cast(Type[ConfigCreateResponse], ResultWrapper[ConfigCreateResponse]), ) async def update( @@ -419,7 +423,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Hyperdrive: + ) -> ConfigUpdateResponse: """ Updates and returns the specified Hyperdrive configuration. @@ -455,9 +459,9 @@ async def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Hyperdrive]._unwrapper, + post_parser=ResultWrapper[ConfigUpdateResponse]._unwrapper, ), - cast_to=cast(Type[Hyperdrive], ResultWrapper[Hyperdrive]), + cast_to=cast(Type[ConfigUpdateResponse], ResultWrapper[ConfigUpdateResponse]), ) def list( @@ -470,7 +474,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[Hyperdrive, AsyncSinglePage[Hyperdrive]]: + ) -> AsyncPaginator[ConfigListResponse, AsyncSinglePage[ConfigListResponse]]: """ Returns a list of Hyperdrives @@ -489,11 +493,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/hyperdrive/configs", - page=AsyncSinglePage[Hyperdrive], + page=AsyncSinglePage[ConfigListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=Hyperdrive, + model=ConfigListResponse, ) async def delete( @@ -554,7 +558,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Hyperdrive: + ) -> ConfigEditResponse: """Patches and returns the specified Hyperdrive configuration. Custom caching @@ -592,9 +596,9 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Hyperdrive]._unwrapper, + post_parser=ResultWrapper[ConfigEditResponse]._unwrapper, ), - cast_to=cast(Type[Hyperdrive], ResultWrapper[Hyperdrive]), + cast_to=cast(Type[ConfigEditResponse], ResultWrapper[ConfigEditResponse]), ) async def get( @@ -608,7 +612,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Hyperdrive: + ) -> ConfigGetResponse: """ Returns the specified Hyperdrive configuration. @@ -636,9 +640,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Hyperdrive]._unwrapper, + post_parser=ResultWrapper[ConfigGetResponse]._unwrapper, ), - cast_to=cast(Type[Hyperdrive], ResultWrapper[Hyperdrive]), + cast_to=cast(Type[ConfigGetResponse], ResultWrapper[ConfigGetResponse]), ) diff --git a/src/cloudflare/resources/rulesets/rulesets.py b/src/cloudflare/resources/rulesets/rulesets.py index d7bdec60504..c51a5044fed 100644 --- a/src/cloudflare/resources/rulesets/rulesets.py +++ b/src/cloudflare/resources/rulesets/rulesets.py @@ -36,7 +36,7 @@ async_to_streamed_response_wrapper, ) from ..._wrappers import ResultWrapper -from ...pagination import SyncSinglePage, AsyncSinglePage +from ...pagination import SyncCursorPagination, AsyncCursorPagination from .phases.phases import ( PhasesResource, AsyncPhasesResource, @@ -46,7 +46,7 @@ AsyncPhasesResourceWithStreamingResponse, ) from ..._base_client import AsyncPaginator, make_request_options -from ...types.rulesets import Kind, Phase, ruleset_create_params, ruleset_update_params +from ...types.rulesets import Kind, Phase, ruleset_list_params, ruleset_create_params, ruleset_update_params from ...types.rulesets.kind import Kind from ...types.rulesets.phase import Phase from ...types.rulesets.ruleset_get_response import RulesetGetResponse @@ -253,13 +253,15 @@ def list( *, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, + cursor: str | NotGiven = NOT_GIVEN, + per_page: int | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[RulesetListResponse]: + ) -> SyncCursorPagination[RulesetListResponse]: """ Fetches all rulesets. @@ -268,6 +270,10 @@ def list( zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + cursor: Cursor to use for the next page. + + per_page: Number of rulesets to return per page. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -290,9 +296,19 @@ def list( account_or_zone_id = zone_id return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/rulesets", - page=SyncSinglePage[RulesetListResponse], + page=SyncCursorPagination[RulesetListResponse], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "cursor": cursor, + "per_page": per_page, + }, + ruleset_list_params.RulesetListParams, + ), ), model=RulesetListResponse, ) @@ -605,13 +621,15 @@ def list( *, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, + cursor: str | NotGiven = NOT_GIVEN, + per_page: int | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[RulesetListResponse, AsyncSinglePage[RulesetListResponse]]: + ) -> AsyncPaginator[RulesetListResponse, AsyncCursorPagination[RulesetListResponse]]: """ Fetches all rulesets. @@ -620,6 +638,10 @@ def list( zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + cursor: Cursor to use for the next page. + + per_page: Number of rulesets to return per page. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -642,9 +664,19 @@ def list( account_or_zone_id = zone_id return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/rulesets", - page=AsyncSinglePage[RulesetListResponse], + page=AsyncCursorPagination[RulesetListResponse], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "cursor": cursor, + "per_page": per_page, + }, + ruleset_list_params.RulesetListParams, + ), ), model=RulesetListResponse, ) diff --git a/src/cloudflare/resources/zero_trust/access/infrastructure/targets.py b/src/cloudflare/resources/zero_trust/access/infrastructure/targets.py index ff0a4df5312..e6865b5b221 100644 --- a/src/cloudflare/resources/zero_trust/access/infrastructure/targets.py +++ b/src/cloudflare/resources/zero_trust/access/infrastructure/targets.py @@ -199,9 +199,8 @@ def list( ) -> SyncV4PagePaginationArray[TargetListResponse]: """Lists and sorts an account’s targets. - Filters are optional and are ORed - together. However, when a timestamp is specified with both its before and after - counterparts, the timestamp filters are ANDed. + Filters are optional and are ANDed + together. Args: account_id: Account identifier @@ -595,9 +594,8 @@ def list( ) -> AsyncPaginator[TargetListResponse, AsyncV4PagePaginationArray[TargetListResponse]]: """Lists and sorts an account’s targets. - Filters are optional and are ORed - together. However, when a timestamp is specified with both its before and after - counterparts, the timestamp filters are ANDed. + Filters are optional and are ANDed + together. Args: account_id: Account identifier diff --git a/src/cloudflare/resources/zero_trust/dex/commands/__init__.py b/src/cloudflare/resources/zero_trust/dex/commands/__init__.py index 1cf551c58ba..c144add2581 100644 --- a/src/cloudflare/resources/zero_trust/dex/commands/__init__.py +++ b/src/cloudflare/resources/zero_trust/dex/commands/__init__.py @@ -8,14 +8,6 @@ QuotaResourceWithStreamingResponse, AsyncQuotaResourceWithStreamingResponse, ) -from .users import ( - UsersResource, - AsyncUsersResource, - UsersResourceWithRawResponse, - AsyncUsersResourceWithRawResponse, - UsersResourceWithStreamingResponse, - AsyncUsersResourceWithStreamingResponse, -) from .devices import ( DevicesResource, AsyncDevicesResource, @@ -42,12 +34,6 @@ ) __all__ = [ - "UsersResource", - "AsyncUsersResource", - "UsersResourceWithRawResponse", - "AsyncUsersResourceWithRawResponse", - "UsersResourceWithStreamingResponse", - "AsyncUsersResourceWithStreamingResponse", "DevicesResource", "AsyncDevicesResource", "DevicesResourceWithRawResponse", diff --git a/src/cloudflare/resources/zero_trust/dex/commands/commands.py b/src/cloudflare/resources/zero_trust/dex/commands/commands.py index 7f887f8e617..675e75e0b31 100644 --- a/src/cloudflare/resources/zero_trust/dex/commands/commands.py +++ b/src/cloudflare/resources/zero_trust/dex/commands/commands.py @@ -16,14 +16,6 @@ QuotaResourceWithStreamingResponse, AsyncQuotaResourceWithStreamingResponse, ) -from .users import ( - UsersResource, - AsyncUsersResource, - UsersResourceWithRawResponse, - AsyncUsersResourceWithRawResponse, - UsersResourceWithStreamingResponse, - AsyncUsersResourceWithStreamingResponse, -) from .devices import ( DevicesResource, AsyncDevicesResource, @@ -64,10 +56,6 @@ class CommandsResource(SyncAPIResource): - @cached_property - def users(self) -> UsersResource: - return UsersResource(self._client) - @cached_property def devices(self) -> DevicesResource: return DevicesResource(self._client) @@ -217,10 +205,6 @@ def list( class AsyncCommandsResource(AsyncAPIResource): - @cached_property - def users(self) -> AsyncUsersResource: - return AsyncUsersResource(self._client) - @cached_property def devices(self) -> AsyncDevicesResource: return AsyncDevicesResource(self._client) @@ -380,10 +364,6 @@ def __init__(self, commands: CommandsResource) -> None: commands.list, ) - @cached_property - def users(self) -> UsersResourceWithRawResponse: - return UsersResourceWithRawResponse(self._commands.users) - @cached_property def devices(self) -> DevicesResourceWithRawResponse: return DevicesResourceWithRawResponse(self._commands.devices) @@ -408,10 +388,6 @@ def __init__(self, commands: AsyncCommandsResource) -> None: commands.list, ) - @cached_property - def users(self) -> AsyncUsersResourceWithRawResponse: - return AsyncUsersResourceWithRawResponse(self._commands.users) - @cached_property def devices(self) -> AsyncDevicesResourceWithRawResponse: return AsyncDevicesResourceWithRawResponse(self._commands.devices) @@ -436,10 +412,6 @@ def __init__(self, commands: CommandsResource) -> None: commands.list, ) - @cached_property - def users(self) -> UsersResourceWithStreamingResponse: - return UsersResourceWithStreamingResponse(self._commands.users) - @cached_property def devices(self) -> DevicesResourceWithStreamingResponse: return DevicesResourceWithStreamingResponse(self._commands.devices) @@ -464,10 +436,6 @@ def __init__(self, commands: AsyncCommandsResource) -> None: commands.list, ) - @cached_property - def users(self) -> AsyncUsersResourceWithStreamingResponse: - return AsyncUsersResourceWithStreamingResponse(self._commands.users) - @cached_property def devices(self) -> AsyncDevicesResourceWithStreamingResponse: return AsyncDevicesResourceWithStreamingResponse(self._commands.devices) diff --git a/src/cloudflare/resources/zero_trust/dex/commands/users.py b/src/cloudflare/resources/zero_trust/dex/commands/users.py deleted file mode 100644 index 7c9308df318..00000000000 --- a/src/cloudflare/resources/zero_trust/dex/commands/users.py +++ /dev/null @@ -1,189 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Type, Optional, cast - -import httpx - -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ....._utils import ( - maybe_transform, - async_maybe_transform, -) -from ....._compat import cached_property -from ....._resource import SyncAPIResource, AsyncAPIResource -from ....._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ....._wrappers import ResultWrapper -from ....._base_client import make_request_options -from .....types.zero_trust.dex.commands import user_list_params -from .....types.zero_trust.dex.commands.user_list_response import UserListResponse - -__all__ = ["UsersResource", "AsyncUsersResource"] - - -class UsersResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> UsersResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return UsersResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> UsersResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return UsersResourceWithStreamingResponse(self) - - def list( - self, - *, - account_id: str, - search: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[UserListResponse]: - """ - List users emails associated with devices with WARP client support for remote - captures which have been connected in the last 1 hour. - - Args: - search: filter user emails by search - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get( - f"/accounts/{account_id}/dex/commands/users", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform({"search": search}, user_list_params.UserListParams), - post_parser=ResultWrapper[Optional[UserListResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[UserListResponse]], ResultWrapper[UserListResponse]), - ) - - -class AsyncUsersResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncUsersResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncUsersResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncUsersResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncUsersResourceWithStreamingResponse(self) - - async def list( - self, - *, - account_id: str, - search: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[UserListResponse]: - """ - List users emails associated with devices with WARP client support for remote - captures which have been connected in the last 1 hour. - - Args: - search: filter user emails by search - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._get( - f"/accounts/{account_id}/dex/commands/users", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform({"search": search}, user_list_params.UserListParams), - post_parser=ResultWrapper[Optional[UserListResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[UserListResponse]], ResultWrapper[UserListResponse]), - ) - - -class UsersResourceWithRawResponse: - def __init__(self, users: UsersResource) -> None: - self._users = users - - self.list = to_raw_response_wrapper( - users.list, - ) - - -class AsyncUsersResourceWithRawResponse: - def __init__(self, users: AsyncUsersResource) -> None: - self._users = users - - self.list = async_to_raw_response_wrapper( - users.list, - ) - - -class UsersResourceWithStreamingResponse: - def __init__(self, users: UsersResource) -> None: - self._users = users - - self.list = to_streamed_response_wrapper( - users.list, - ) - - -class AsyncUsersResourceWithStreamingResponse: - def __init__(self, users: AsyncUsersResource) -> None: - self._users = users - - self.list = async_to_streamed_response_wrapper( - users.list, - ) diff --git a/src/cloudflare/types/hyperdrive/__init__.py b/src/cloudflare/types/hyperdrive/__init__.py index dea31023f50..91e983052a0 100644 --- a/src/cloudflare/types/hyperdrive/__init__.py +++ b/src/cloudflare/types/hyperdrive/__init__.py @@ -4,5 +4,10 @@ from .hyperdrive import Hyperdrive as Hyperdrive from .config_edit_params import ConfigEditParams as ConfigEditParams +from .config_get_response import ConfigGetResponse as ConfigGetResponse from .config_create_params import ConfigCreateParams as ConfigCreateParams +from .config_edit_response import ConfigEditResponse as ConfigEditResponse +from .config_list_response import ConfigListResponse as ConfigListResponse from .config_update_params import ConfigUpdateParams as ConfigUpdateParams +from .config_create_response import ConfigCreateResponse as ConfigCreateResponse +from .config_update_response import ConfigUpdateResponse as ConfigUpdateResponse diff --git a/src/cloudflare/types/hyperdrive/config_create_params.py b/src/cloudflare/types/hyperdrive/config_create_params.py index 875ac8cbc44..479ceac25c3 100644 --- a/src/cloudflare/types/hyperdrive/config_create_params.py +++ b/src/cloudflare/types/hyperdrive/config_create_params.py @@ -52,7 +52,9 @@ class OriginPublicDatabase(TypedDict, total=False): class OriginAccessProtectedDatabaseBehindCloudflareTunnel(TypedDict, total=False): access_client_id: Required[str] - """The Client ID of the Access token to use when connecting to the origin database""" + """ + The Client ID of the Access token to use when connecting to the origin database. + """ access_client_secret: Required[str] """ diff --git a/src/cloudflare/types/hyperdrive/config_create_response.py b/src/cloudflare/types/hyperdrive/config_create_response.py new file mode 100644 index 00000000000..62eb72fa4a4 --- /dev/null +++ b/src/cloudflare/types/hyperdrive/config_create_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from .hyperdrive import Hyperdrive + +__all__ = ["ConfigCreateResponse"] + + +class ConfigCreateResponse(Hyperdrive): + created_on: Optional[datetime] = None + """When the Hyperdrive configuration was created.""" + + modified_on: Optional[datetime] = None + """When the Hyperdrive configuration was last modified.""" diff --git a/src/cloudflare/types/hyperdrive/config_edit_params.py b/src/cloudflare/types/hyperdrive/config_edit_params.py index 3da7908a426..a84932552af 100644 --- a/src/cloudflare/types/hyperdrive/config_edit_params.py +++ b/src/cloudflare/types/hyperdrive/config_edit_params.py @@ -81,7 +81,9 @@ class OriginHyperdriveHyperdriveInternetOrigin(TypedDict, total=False): class OriginHyperdriveHyperdriveOverAccessOrigin(TypedDict, total=False): access_client_id: Required[str] - """The Client ID of the Access token to use when connecting to the origin database""" + """ + The Client ID of the Access token to use when connecting to the origin database. + """ access_client_secret: Required[str] """ diff --git a/src/cloudflare/types/hyperdrive/config_edit_response.py b/src/cloudflare/types/hyperdrive/config_edit_response.py new file mode 100644 index 00000000000..606afbb9217 --- /dev/null +++ b/src/cloudflare/types/hyperdrive/config_edit_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from .hyperdrive import Hyperdrive + +__all__ = ["ConfigEditResponse"] + + +class ConfigEditResponse(Hyperdrive): + created_on: Optional[datetime] = None + """When the Hyperdrive configuration was created.""" + + modified_on: Optional[datetime] = None + """When the Hyperdrive configuration was last modified.""" diff --git a/src/cloudflare/types/hyperdrive/config_get_response.py b/src/cloudflare/types/hyperdrive/config_get_response.py new file mode 100644 index 00000000000..41d7ed270ba --- /dev/null +++ b/src/cloudflare/types/hyperdrive/config_get_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from .hyperdrive import Hyperdrive + +__all__ = ["ConfigGetResponse"] + + +class ConfigGetResponse(Hyperdrive): + created_on: Optional[datetime] = None + """When the Hyperdrive configuration was created.""" + + modified_on: Optional[datetime] = None + """When the Hyperdrive configuration was last modified.""" diff --git a/src/cloudflare/types/hyperdrive/config_list_response.py b/src/cloudflare/types/hyperdrive/config_list_response.py new file mode 100644 index 00000000000..b3230cc4820 --- /dev/null +++ b/src/cloudflare/types/hyperdrive/config_list_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from .hyperdrive import Hyperdrive + +__all__ = ["ConfigListResponse"] + + +class ConfigListResponse(Hyperdrive): + created_on: Optional[datetime] = None + """When the Hyperdrive configuration was created.""" + + modified_on: Optional[datetime] = None + """When the Hyperdrive configuration was last modified.""" diff --git a/src/cloudflare/types/hyperdrive/config_update_params.py b/src/cloudflare/types/hyperdrive/config_update_params.py index 4f6c97650a5..e5677f427fe 100644 --- a/src/cloudflare/types/hyperdrive/config_update_params.py +++ b/src/cloudflare/types/hyperdrive/config_update_params.py @@ -52,7 +52,9 @@ class OriginPublicDatabase(TypedDict, total=False): class OriginAccessProtectedDatabaseBehindCloudflareTunnel(TypedDict, total=False): access_client_id: Required[str] - """The Client ID of the Access token to use when connecting to the origin database""" + """ + The Client ID of the Access token to use when connecting to the origin database. + """ access_client_secret: Required[str] """ diff --git a/src/cloudflare/types/hyperdrive/config_update_response.py b/src/cloudflare/types/hyperdrive/config_update_response.py new file mode 100644 index 00000000000..484f886e2ed --- /dev/null +++ b/src/cloudflare/types/hyperdrive/config_update_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from .hyperdrive import Hyperdrive + +__all__ = ["ConfigUpdateResponse"] + + +class ConfigUpdateResponse(Hyperdrive): + created_on: Optional[datetime] = None + """When the Hyperdrive configuration was created.""" + + modified_on: Optional[datetime] = None + """When the Hyperdrive configuration was last modified.""" diff --git a/src/cloudflare/types/hyperdrive/hyperdrive.py b/src/cloudflare/types/hyperdrive/hyperdrive.py index e04be08fbcb..7e86822c1ee 100644 --- a/src/cloudflare/types/hyperdrive/hyperdrive.py +++ b/src/cloudflare/types/hyperdrive/hyperdrive.py @@ -35,7 +35,9 @@ class OriginPublicDatabase(BaseModel): class OriginAccessProtectedDatabaseBehindCloudflareTunnel(BaseModel): access_client_id: str - """The Client ID of the Access token to use when connecting to the origin database""" + """ + The Client ID of the Access token to use when connecting to the origin database. + """ database: str """The name of your origin database.""" diff --git a/src/cloudflare/types/rulesets/__init__.py b/src/cloudflare/types/rulesets/__init__.py index 7d59836d8e0..24d5f8e30d0 100644 --- a/src/cloudflare/types/rulesets/__init__.py +++ b/src/cloudflare/types/rulesets/__init__.py @@ -31,6 +31,7 @@ from .rule_edit_response import RuleEditResponse as RuleEditResponse from .phase_update_params import PhaseUpdateParams as PhaseUpdateParams from .redirect_rule_param import RedirectRuleParam as RedirectRuleParam +from .ruleset_list_params import RulesetListParams as RulesetListParams from .rule_create_response import RuleCreateResponse as RuleCreateResponse from .rule_delete_response import RuleDeleteResponse as RuleDeleteResponse from .ruleset_get_response import RulesetGetResponse as RulesetGetResponse diff --git a/src/cloudflare/types/rulesets/ruleset_list_params.py b/src/cloudflare/types/rulesets/ruleset_list_params.py new file mode 100644 index 00000000000..5c3e7343104 --- /dev/null +++ b/src/cloudflare/types/rulesets/ruleset_list_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["RulesetListParams"] + + +class RulesetListParams(TypedDict, total=False): + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + cursor: str + """Cursor to use for the next page.""" + + per_page: int + """Number of rulesets to return per page.""" diff --git a/src/cloudflare/types/zero_trust/dex/commands/__init__.py b/src/cloudflare/types/zero_trust/dex/commands/__init__.py index cf51077364d..325668bbdb3 100644 --- a/src/cloudflare/types/zero_trust/dex/commands/__init__.py +++ b/src/cloudflare/types/zero_trust/dex/commands/__init__.py @@ -2,8 +2,6 @@ from __future__ import annotations -from .user_list_params import UserListParams as UserListParams from .device_list_params import DeviceListParams as DeviceListParams from .quota_get_response import QuotaGetResponse as QuotaGetResponse -from .user_list_response import UserListResponse as UserListResponse from .device_list_response import DeviceListResponse as DeviceListResponse diff --git a/src/cloudflare/types/zero_trust/dex/commands/device_list_response.py b/src/cloudflare/types/zero_trust/dex/commands/device_list_response.py index 5fb1c642279..0e85164ecb0 100644 --- a/src/cloudflare/types/zero_trust/dex/commands/device_list_response.py +++ b/src/cloudflare/types/zero_trust/dex/commands/device_list_response.py @@ -16,6 +16,12 @@ class Device(BaseModel): device_name: Optional[str] = FieldInfo(alias="deviceName", default=None) """Device identifier (human readable)""" + eligible: Optional[bool] = None + """Whether the device is eligible for remote captures""" + + ineligible_reason: Optional[str] = FieldInfo(alias="ineligibleReason", default=None) + """If the device is not eligible, the reason why.""" + person_email: Optional[str] = FieldInfo(alias="personEmail", default=None) """User contact email address""" diff --git a/src/cloudflare/types/zero_trust/dex/commands/user_list_params.py b/src/cloudflare/types/zero_trust/dex/commands/user_list_params.py deleted file mode 100644 index 753ca290284..00000000000 --- a/src/cloudflare/types/zero_trust/dex/commands/user_list_params.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["UserListParams"] - - -class UserListParams(TypedDict, total=False): - account_id: Required[str] - - search: str - """filter user emails by search""" diff --git a/src/cloudflare/types/zero_trust/dex/commands/user_list_response.py b/src/cloudflare/types/zero_trust/dex/commands/user_list_response.py deleted file mode 100644 index d2394cc4a99..00000000000 --- a/src/cloudflare/types/zero_trust/dex/commands/user_list_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ....._models import BaseModel - -__all__ = ["UserListResponse"] - - -class UserListResponse(BaseModel): - user_emails: Optional[List[str]] = FieldInfo(alias="userEmails", default=None) - """List of user emails""" diff --git a/src/cloudflare/types/zero_trust/gateway/rule_setting.py b/src/cloudflare/types/zero_trust/gateway/rule_setting.py index 3d73a0b442c..82aa8607440 100644 --- a/src/cloudflare/types/zero_trust/gateway/rule_setting.py +++ b/src/cloudflare/types/zero_trust/gateway/rule_setting.py @@ -3,6 +3,8 @@ from typing import Dict, List, Optional from typing_extensions import Literal +from pydantic import Field as FieldInfo + from ...._models import BaseModel from .dns_resolver_settings_v4 import DNSResolverSettingsV4 from .dns_resolver_settings_v6 import DNSResolverSettingsV6 @@ -29,20 +31,63 @@ class AuditSSH(BaseModel): class BISOAdminControls(BaseModel): + copy_: Optional[Literal["enabled", "disabled", "remote_only"]] = FieldInfo(alias="copy", default=None) + """Configure whether copy is enabled or not. + + When set with "remote_only", copying isolated content from the remote browser to + the user's local clipboard is disabled. When absent, copy is enabled. Only + applies when `version == "v2"`. + """ + dcp: Optional[bool] = None - """Set to false to enable copy-pasting.""" + """Set to false to enable copy-pasting. Only applies when `version == "v1"`.""" dd: Optional[bool] = None - """Set to false to enable downloading.""" + """Set to false to enable downloading. Only applies when `version == "v1"`.""" dk: Optional[bool] = None - """Set to false to enable keyboard usage.""" + """Set to false to enable keyboard usage. Only applies when `version == "v1"`.""" + + download: Optional[Literal["enabled", "disabled"]] = None + """Configure whether downloading enabled or not. + + When absent, downloading is enabled. Only applies when `version == "v2"`. + """ dp: Optional[bool] = None - """Set to false to enable printing.""" + """Set to false to enable printing. Only applies when `version == "v1"`.""" du: Optional[bool] = None - """Set to false to enable uploading.""" + """Set to false to enable uploading. Only applies when `version == "v1"`.""" + + keyboard: Optional[Literal["enabled", "disabled"]] = None + """Configure whether keyboard usage is enabled or not. + + When absent, keyboard usage is enabled. Only applies when `version == "v2"`. + """ + + paste: Optional[Literal["enabled", "disabled", "remote_only"]] = None + """Configure whether pasting is enabled or not. + + When set with "remote_only", pasting content from the user's local clipboard + into isolated pages is disabled. When absent, paste is enabled. Only applies + when `version == "v2"`. + """ + + printing: Optional[Literal["enabled", "disabled"]] = None + """Configure whether printing is enabled or not. + + When absent, printing is enabled. Only applies when `version == "v2"`. + """ + + upload: Optional[Literal["enabled", "disabled"]] = None + """Configure whether uploading is enabled or not. + + When absent, uploading is enabled. Only applies when `version == "v2"`. + """ + + version: Optional[Literal["v1", "v2"]] = None + """Indicates which version of the browser isolation controls should apply.""" class CheckSession(BaseModel): diff --git a/src/cloudflare/types/zero_trust/gateway/rule_setting_param.py b/src/cloudflare/types/zero_trust/gateway/rule_setting_param.py index 6f3884920e2..68257df6bde 100644 --- a/src/cloudflare/types/zero_trust/gateway/rule_setting_param.py +++ b/src/cloudflare/types/zero_trust/gateway/rule_setting_param.py @@ -30,20 +30,63 @@ class AuditSSH(TypedDict, total=False): class BISOAdminControls(TypedDict, total=False): + copy: Literal["enabled", "disabled", "remote_only"] + """Configure whether copy is enabled or not. + + When set with "remote_only", copying isolated content from the remote browser to + the user's local clipboard is disabled. When absent, copy is enabled. Only + applies when `version == "v2"`. + """ + dcp: bool - """Set to false to enable copy-pasting.""" + """Set to false to enable copy-pasting. Only applies when `version == "v1"`.""" dd: bool - """Set to false to enable downloading.""" + """Set to false to enable downloading. Only applies when `version == "v1"`.""" dk: bool - """Set to false to enable keyboard usage.""" + """Set to false to enable keyboard usage. Only applies when `version == "v1"`.""" + + download: Literal["enabled", "disabled"] + """Configure whether downloading enabled or not. + + When absent, downloading is enabled. Only applies when `version == "v2"`. + """ dp: bool - """Set to false to enable printing.""" + """Set to false to enable printing. Only applies when `version == "v1"`.""" du: bool - """Set to false to enable uploading.""" + """Set to false to enable uploading. Only applies when `version == "v1"`.""" + + keyboard: Literal["enabled", "disabled"] + """Configure whether keyboard usage is enabled or not. + + When absent, keyboard usage is enabled. Only applies when `version == "v2"`. + """ + + paste: Literal["enabled", "disabled", "remote_only"] + """Configure whether pasting is enabled or not. + + When set with "remote_only", pasting content from the user's local clipboard + into isolated pages is disabled. When absent, paste is enabled. Only applies + when `version == "v2"`. + """ + + printing: Literal["enabled", "disabled"] + """Configure whether printing is enabled or not. + + When absent, printing is enabled. Only applies when `version == "v2"`. + """ + + upload: Literal["enabled", "disabled"] + """Configure whether uploading is enabled or not. + + When absent, uploading is enabled. Only applies when `version == "v2"`. + """ + + version: Literal["v1", "v2"] + """Indicates which version of the browser isolation controls should apply.""" class CheckSession(TypedDict, total=False): diff --git a/tests/api_resources/hyperdrive/test_configs.py b/tests/api_resources/hyperdrive/test_configs.py index 78c494c37c2..ff8cebe0702 100644 --- a/tests/api_resources/hyperdrive/test_configs.py +++ b/tests/api_resources/hyperdrive/test_configs.py @@ -10,7 +10,13 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.hyperdrive import Hyperdrive +from cloudflare.types.hyperdrive import ( + ConfigGetResponse, + ConfigEditResponse, + ConfigListResponse, + ConfigCreateResponse, + ConfigUpdateResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -33,7 +39,7 @@ def test_method_create(self, client: Cloudflare) -> None: "user": "postgres", }, ) - assert_matches_type(Hyperdrive, config, path=["response"]) + assert_matches_type(ConfigCreateResponse, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -51,7 +57,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: }, caching={"disabled": True}, ) - assert_matches_type(Hyperdrive, config, path=["response"]) + assert_matches_type(ConfigCreateResponse, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -72,7 +78,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(Hyperdrive, config, path=["response"]) + assert_matches_type(ConfigCreateResponse, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -93,7 +99,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(Hyperdrive, config, path=["response"]) + assert_matches_type(ConfigCreateResponse, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -130,7 +136,7 @@ def test_method_update(self, client: Cloudflare) -> None: "user": "postgres", }, ) - assert_matches_type(Hyperdrive, config, path=["response"]) + assert_matches_type(ConfigUpdateResponse, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -149,7 +155,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: }, caching={"disabled": True}, ) - assert_matches_type(Hyperdrive, config, path=["response"]) + assert_matches_type(ConfigUpdateResponse, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -171,7 +177,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(Hyperdrive, config, path=["response"]) + assert_matches_type(ConfigUpdateResponse, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -193,7 +199,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(Hyperdrive, config, path=["response"]) + assert_matches_type(ConfigUpdateResponse, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -235,7 +241,7 @@ def test_method_list(self, client: Cloudflare) -> None: config = client.hyperdrive.configs.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[Hyperdrive], config, path=["response"]) + assert_matches_type(SyncSinglePage[ConfigListResponse], config, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: @@ -246,7 +252,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(SyncSinglePage[Hyperdrive], config, path=["response"]) + assert_matches_type(SyncSinglePage[ConfigListResponse], config, path=["response"]) @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: @@ -257,7 +263,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(SyncSinglePage[Hyperdrive], config, path=["response"]) + assert_matches_type(SyncSinglePage[ConfigListResponse], config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -323,7 +329,7 @@ def test_method_edit(self, client: Cloudflare) -> None: hyperdrive_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Hyperdrive, config, path=["response"]) + assert_matches_type(ConfigEditResponse, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -340,7 +346,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: "user": "postgres", }, ) - assert_matches_type(Hyperdrive, config, path=["response"]) + assert_matches_type(ConfigEditResponse, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -353,7 +359,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(Hyperdrive, config, path=["response"]) + assert_matches_type(ConfigEditResponse, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -366,7 +372,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(Hyperdrive, config, path=["response"]) + assert_matches_type(ConfigEditResponse, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -391,7 +397,7 @@ def test_method_get(self, client: Cloudflare) -> None: hyperdrive_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Hyperdrive, config, path=["response"]) + assert_matches_type(ConfigGetResponse, config, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -403,7 +409,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(Hyperdrive, config, path=["response"]) + assert_matches_type(ConfigGetResponse, config, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -415,7 +421,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(Hyperdrive, config, path=["response"]) + assert_matches_type(ConfigGetResponse, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -452,7 +458,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: "user": "postgres", }, ) - assert_matches_type(Hyperdrive, config, path=["response"]) + assert_matches_type(ConfigCreateResponse, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -470,7 +476,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare }, caching={"disabled": True}, ) - assert_matches_type(Hyperdrive, config, path=["response"]) + assert_matches_type(ConfigCreateResponse, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -491,7 +497,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(Hyperdrive, config, path=["response"]) + assert_matches_type(ConfigCreateResponse, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -512,7 +518,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(Hyperdrive, config, path=["response"]) + assert_matches_type(ConfigCreateResponse, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -549,7 +555,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: "user": "postgres", }, ) - assert_matches_type(Hyperdrive, config, path=["response"]) + assert_matches_type(ConfigUpdateResponse, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -568,7 +574,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare }, caching={"disabled": True}, ) - assert_matches_type(Hyperdrive, config, path=["response"]) + assert_matches_type(ConfigUpdateResponse, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -590,7 +596,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(Hyperdrive, config, path=["response"]) + assert_matches_type(ConfigUpdateResponse, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -612,7 +618,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(Hyperdrive, config, path=["response"]) + assert_matches_type(ConfigUpdateResponse, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -654,7 +660,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: config = await async_client.hyperdrive.configs.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[Hyperdrive], config, path=["response"]) + assert_matches_type(AsyncSinglePage[ConfigListResponse], config, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @@ -665,7 +671,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(AsyncSinglePage[Hyperdrive], config, path=["response"]) + assert_matches_type(AsyncSinglePage[ConfigListResponse], config, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: @@ -676,7 +682,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(AsyncSinglePage[Hyperdrive], config, path=["response"]) + assert_matches_type(AsyncSinglePage[ConfigListResponse], config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -742,7 +748,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: hyperdrive_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Hyperdrive, config, path=["response"]) + assert_matches_type(ConfigEditResponse, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -759,7 +765,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) "user": "postgres", }, ) - assert_matches_type(Hyperdrive, config, path=["response"]) + assert_matches_type(ConfigEditResponse, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -772,7 +778,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(Hyperdrive, config, path=["response"]) + assert_matches_type(ConfigEditResponse, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -785,7 +791,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(Hyperdrive, config, path=["response"]) + assert_matches_type(ConfigEditResponse, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -810,7 +816,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: hyperdrive_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Hyperdrive, config, path=["response"]) + assert_matches_type(ConfigGetResponse, config, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -822,7 +828,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(Hyperdrive, config, path=["response"]) + assert_matches_type(ConfigGetResponse, config, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -834,7 +840,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(Hyperdrive, config, path=["response"]) + assert_matches_type(ConfigGetResponse, config, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_rulesets.py b/tests/api_resources/test_rulesets.py index ea223e86d25..766fdff4697 100644 --- a/tests/api_resources/test_rulesets.py +++ b/tests/api_resources/test_rulesets.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.pagination import SyncCursorPagination, AsyncCursorPagination from cloudflare.types.rulesets import ( RulesetGetResponse, RulesetListResponse, @@ -249,15 +249,17 @@ def test_method_list(self, client: Cloudflare) -> None: ruleset = client.rulesets.list( account_id="account_id", ) - assert_matches_type(SyncSinglePage[RulesetListResponse], ruleset, path=["response"]) + assert_matches_type(SyncCursorPagination[RulesetListResponse], ruleset, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: ruleset = client.rulesets.list( account_id="account_id", + cursor="dGhpc2lzYW5leGFtcGxlCg", + per_page=3, ) - assert_matches_type(SyncSinglePage[RulesetListResponse], ruleset, path=["response"]) + assert_matches_type(SyncCursorPagination[RulesetListResponse], ruleset, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -269,7 +271,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ruleset = response.parse() - assert_matches_type(SyncSinglePage[RulesetListResponse], ruleset, path=["response"]) + assert_matches_type(SyncCursorPagination[RulesetListResponse], ruleset, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -281,7 +283,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ruleset = response.parse() - assert_matches_type(SyncSinglePage[RulesetListResponse], ruleset, path=["response"]) + assert_matches_type(SyncCursorPagination[RulesetListResponse], ruleset, path=["response"]) assert cast(Any, response.is_closed) is True @@ -662,15 +664,17 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: ruleset = await async_client.rulesets.list( account_id="account_id", ) - assert_matches_type(AsyncSinglePage[RulesetListResponse], ruleset, path=["response"]) + assert_matches_type(AsyncCursorPagination[RulesetListResponse], ruleset, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: ruleset = await async_client.rulesets.list( account_id="account_id", + cursor="dGhpc2lzYW5leGFtcGxlCg", + per_page=3, ) - assert_matches_type(AsyncSinglePage[RulesetListResponse], ruleset, path=["response"]) + assert_matches_type(AsyncCursorPagination[RulesetListResponse], ruleset, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -682,7 +686,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ruleset = await response.parse() - assert_matches_type(AsyncSinglePage[RulesetListResponse], ruleset, path=["response"]) + assert_matches_type(AsyncCursorPagination[RulesetListResponse], ruleset, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -694,7 +698,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" ruleset = await response.parse() - assert_matches_type(AsyncSinglePage[RulesetListResponse], ruleset, path=["response"]) + assert_matches_type(AsyncCursorPagination[RulesetListResponse], ruleset, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/dex/commands/test_users.py b/tests/api_resources/zero_trust/dex/commands/test_users.py deleted file mode 100644 index 0f8b674a2d6..00000000000 --- a/tests/api_resources/zero_trust/dex/commands/test_users.py +++ /dev/null @@ -1,114 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, Optional, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.types.zero_trust.dex.commands import UserListResponse - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestUsers: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - user = client.zero_trust.dex.commands.users.list( - account_id="01a7362d577a6c3019a474fd6f485823", - ) - assert_matches_type(Optional[UserListResponse], user, path=["response"]) - - @parametrize - def test_method_list_with_all_params(self, client: Cloudflare) -> None: - user = client.zero_trust.dex.commands.users.list( - account_id="01a7362d577a6c3019a474fd6f485823", - search="search", - ) - assert_matches_type(Optional[UserListResponse], user, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.zero_trust.dex.commands.users.with_raw_response.list( - account_id="01a7362d577a6c3019a474fd6f485823", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - user = response.parse() - assert_matches_type(Optional[UserListResponse], user, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.zero_trust.dex.commands.users.with_streaming_response.list( - account_id="01a7362d577a6c3019a474fd6f485823", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - user = response.parse() - assert_matches_type(Optional[UserListResponse], user, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.dex.commands.users.with_raw_response.list( - account_id="", - ) - - -class TestAsyncUsers: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - user = await async_client.zero_trust.dex.commands.users.list( - account_id="01a7362d577a6c3019a474fd6f485823", - ) - assert_matches_type(Optional[UserListResponse], user, path=["response"]) - - @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: - user = await async_client.zero_trust.dex.commands.users.list( - account_id="01a7362d577a6c3019a474fd6f485823", - search="search", - ) - assert_matches_type(Optional[UserListResponse], user, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.dex.commands.users.with_raw_response.list( - account_id="01a7362d577a6c3019a474fd6f485823", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - user = await response.parse() - assert_matches_type(Optional[UserListResponse], user, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.dex.commands.users.with_streaming_response.list( - account_id="01a7362d577a6c3019a474fd6f485823", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - user = await response.parse() - assert_matches_type(Optional[UserListResponse], user, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.dex.commands.users.with_raw_response.list( - account_id="", - ) diff --git a/tests/api_resources/zero_trust/gateway/test_rules.py b/tests/api_resources/zero_trust/gateway/test_rules.py index e1ed5506b92..21f857c75bd 100644 --- a/tests/api_resources/zero_trust/gateway/test_rules.py +++ b/tests/api_resources/zero_trust/gateway/test_rules.py @@ -52,11 +52,18 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "allow_child_bypass": False, "audit_ssh": {"command_logging": False}, "biso_admin_controls": { + "copy": "enabled", "dcp": False, "dd": False, "dk": False, + "download": "enabled", "dp": False, "du": False, + "keyboard": "enabled", + "paste": "enabled", + "printing": "enabled", + "upload": "enabled", + "version": "v1", }, "block_page_enabled": True, "block_reason": "This website is a security risk", @@ -196,11 +203,18 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "allow_child_bypass": False, "audit_ssh": {"command_logging": False}, "biso_admin_controls": { + "copy": "enabled", "dcp": False, "dd": False, "dk": False, + "download": "enabled", "dp": False, "du": False, + "keyboard": "enabled", + "paste": "enabled", + "printing": "enabled", + "upload": "enabled", + "version": "v1", }, "block_page_enabled": True, "block_reason": "This website is a security risk", @@ -535,11 +549,18 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "allow_child_bypass": False, "audit_ssh": {"command_logging": False}, "biso_admin_controls": { + "copy": "enabled", "dcp": False, "dd": False, "dk": False, + "download": "enabled", "dp": False, "du": False, + "keyboard": "enabled", + "paste": "enabled", + "printing": "enabled", + "upload": "enabled", + "version": "v1", }, "block_page_enabled": True, "block_reason": "This website is a security risk", @@ -679,11 +700,18 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "allow_child_bypass": False, "audit_ssh": {"command_logging": False}, "biso_admin_controls": { + "copy": "enabled", "dcp": False, "dd": False, "dk": False, + "download": "enabled", "dp": False, "du": False, + "keyboard": "enabled", + "paste": "enabled", + "printing": "enabled", + "upload": "enabled", + "version": "v1", }, "block_page_enabled": True, "block_reason": "This website is a security risk", From 814e590d14dbd5918b80b618521976362cca4618 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 16 Jan 2025 18:44:29 +0000 Subject: [PATCH 012/358] feat(api): api update (#2370) --- .stats.yml | 2 +- .../zero_trust/devices/policies/custom/custom.py | 8 ++++---- .../zero_trust/devices/policies/default/default.py | 4 ++-- .../zero_trust/devices/policies/custom_create_params.py | 2 +- .../zero_trust/devices/policies/custom_edit_params.py | 2 +- .../zero_trust/devices/policies/default_edit_params.py | 2 +- .../zero_trust/devices/policies/default_edit_response.py | 2 +- .../zero_trust/devices/policies/default_get_response.py | 2 +- .../types/zero_trust/devices/settings_policy.py | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.stats.yml b/.stats.yml index f689a46efff..8b036a53257 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1493 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5e32fa5d8d6040e3c40095cc73f64d0a3b7a88824f57f5a2667663297a9f3113.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-623d5dbee9e55ad6d5225ac6ef4179daffbd4c309abdd1095857747a0b46ec13.yml diff --git a/src/cloudflare/resources/zero_trust/devices/policies/custom/custom.py b/src/cloudflare/resources/zero_trust/devices/policies/custom/custom.py index c8c35645b59..07fb5b5294c 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/custom/custom.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/custom/custom.py @@ -133,7 +133,7 @@ def create( allowed_to_leave: Whether to allow devices to leave the organization. - auto_connect: The amount of time in minutes to reconnect after having been disabled. + auto_connect: The amount of time in seconds to reconnect after having been disabled. captive_portal: Turn on the captive portal after the specified amount of time. @@ -324,7 +324,7 @@ def edit( allowed_to_leave: Whether to allow devices to leave the organization. - auto_connect: The amount of time in minutes to reconnect after having been disabled. + auto_connect: The amount of time in seconds to reconnect after having been disabled. captive_portal: Turn on the captive portal after the specified amount of time. @@ -519,7 +519,7 @@ async def create( allowed_to_leave: Whether to allow devices to leave the organization. - auto_connect: The amount of time in minutes to reconnect after having been disabled. + auto_connect: The amount of time in seconds to reconnect after having been disabled. captive_portal: Turn on the captive portal after the specified amount of time. @@ -710,7 +710,7 @@ async def edit( allowed_to_leave: Whether to allow devices to leave the organization. - auto_connect: The amount of time in minutes to reconnect after having been disabled. + auto_connect: The amount of time in seconds to reconnect after having been disabled. captive_portal: Turn on the captive portal after the specified amount of time. diff --git a/src/cloudflare/resources/zero_trust/devices/policies/default/default.py b/src/cloudflare/resources/zero_trust/devices/policies/default/default.py index 5c0f7e71e53..1e25bc54c0f 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/default/default.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/default/default.py @@ -129,7 +129,7 @@ def edit( allowed_to_leave: Whether to allow devices to leave the organization. - auto_connect: The amount of time in minutes to reconnect after having been disabled. + auto_connect: The amount of time in seconds to reconnect after having been disabled. captive_portal: Turn on the captive portal after the specified amount of time. @@ -290,7 +290,7 @@ async def edit( allowed_to_leave: Whether to allow devices to leave the organization. - auto_connect: The amount of time in minutes to reconnect after having been disabled. + auto_connect: The amount of time in seconds to reconnect after having been disabled. captive_portal: Turn on the captive portal after the specified amount of time. diff --git a/src/cloudflare/types/zero_trust/devices/policies/custom_create_params.py b/src/cloudflare/types/zero_trust/devices/policies/custom_create_params.py index 0966e1f9ef4..d8ae4b09f98 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/custom_create_params.py +++ b/src/cloudflare/types/zero_trust/devices/policies/custom_create_params.py @@ -36,7 +36,7 @@ class CustomCreateParams(TypedDict, total=False): """Whether to allow devices to leave the organization.""" auto_connect: float - """The amount of time in minutes to reconnect after having been disabled.""" + """The amount of time in seconds to reconnect after having been disabled.""" captive_portal: float """Turn on the captive portal after the specified amount of time.""" diff --git a/src/cloudflare/types/zero_trust/devices/policies/custom_edit_params.py b/src/cloudflare/types/zero_trust/devices/policies/custom_edit_params.py index 0af314e554e..3f5d0618429 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/custom_edit_params.py +++ b/src/cloudflare/types/zero_trust/devices/policies/custom_edit_params.py @@ -23,7 +23,7 @@ class CustomEditParams(TypedDict, total=False): """Whether to allow devices to leave the organization.""" auto_connect: float - """The amount of time in minutes to reconnect after having been disabled.""" + """The amount of time in seconds to reconnect after having been disabled.""" captive_portal: float """Turn on the captive portal after the specified amount of time.""" diff --git a/src/cloudflare/types/zero_trust/devices/policies/default_edit_params.py b/src/cloudflare/types/zero_trust/devices/policies/default_edit_params.py index ffe565848af..a8da2673535 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/default_edit_params.py +++ b/src/cloudflare/types/zero_trust/devices/policies/default_edit_params.py @@ -23,7 +23,7 @@ class DefaultEditParams(TypedDict, total=False): """Whether to allow devices to leave the organization.""" auto_connect: float - """The amount of time in minutes to reconnect after having been disabled.""" + """The amount of time in seconds to reconnect after having been disabled.""" captive_portal: float """Turn on the captive portal after the specified amount of time.""" diff --git a/src/cloudflare/types/zero_trust/devices/policies/default_edit_response.py b/src/cloudflare/types/zero_trust/devices/policies/default_edit_response.py index 81d01419835..2b837a1f4f2 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/default_edit_response.py +++ b/src/cloudflare/types/zero_trust/devices/policies/default_edit_response.py @@ -32,7 +32,7 @@ class DefaultEditResponse(BaseModel): """Whether to allow devices to leave the organization.""" auto_connect: Optional[float] = None - """The amount of time in minutes to reconnect after having been disabled.""" + """The amount of time in seconds to reconnect after having been disabled.""" captive_portal: Optional[float] = None """Turn on the captive portal after the specified amount of time.""" diff --git a/src/cloudflare/types/zero_trust/devices/policies/default_get_response.py b/src/cloudflare/types/zero_trust/devices/policies/default_get_response.py index 858e398cbf9..a88250c4286 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/default_get_response.py +++ b/src/cloudflare/types/zero_trust/devices/policies/default_get_response.py @@ -32,7 +32,7 @@ class DefaultGetResponse(BaseModel): """Whether to allow devices to leave the organization.""" auto_connect: Optional[float] = None - """The amount of time in minutes to reconnect after having been disabled.""" + """The amount of time in seconds to reconnect after having been disabled.""" captive_portal: Optional[float] = None """Turn on the captive portal after the specified amount of time.""" diff --git a/src/cloudflare/types/zero_trust/devices/settings_policy.py b/src/cloudflare/types/zero_trust/devices/settings_policy.py index 3ec41eef919..d8e810c70b1 100644 --- a/src/cloudflare/types/zero_trust/devices/settings_policy.py +++ b/src/cloudflare/types/zero_trust/devices/settings_policy.py @@ -40,7 +40,7 @@ class SettingsPolicy(BaseModel): """Whether to allow devices to leave the organization.""" auto_connect: Optional[float] = None - """The amount of time in minutes to reconnect after having been disabled.""" + """The amount of time in seconds to reconnect after having been disabled.""" captive_portal: Optional[float] = None """Turn on the captive portal after the specified amount of time.""" From 5a1da872ed6f63a533fbbad8225da90bec0d9204 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 16 Jan 2025 19:34:41 +0000 Subject: [PATCH 013/358] chore(internal): bump pyright dependency (#2371) --- requirements-dev.lock | 2 +- src/cloudflare/_response.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/requirements-dev.lock b/requirements-dev.lock index 56871377eec..633e6e0aadc 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -67,7 +67,7 @@ pydantic-core==2.27.1 # via pydantic pygments==2.18.0 # via rich -pyright==1.1.391 +pyright==1.1.392.post0 pytest==8.3.3 # via pytest-asyncio pytest-asyncio==0.24.0 diff --git a/src/cloudflare/_response.py b/src/cloudflare/_response.py index c0db87171ff..ef0c36a96ea 100644 --- a/src/cloudflare/_response.py +++ b/src/cloudflare/_response.py @@ -210,7 +210,13 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: raise ValueError(f"Subclasses of httpx.Response cannot be passed to `cast_to`") return cast(R, response) - if inspect.isclass(origin) and not issubclass(origin, BaseModel) and issubclass(origin, pydantic.BaseModel): + if ( + inspect.isclass( + origin # pyright: ignore[reportUnknownArgumentType] + ) + and not issubclass(origin, BaseModel) + and issubclass(origin, pydantic.BaseModel) + ): raise TypeError( "Pydantic models must subclass our base model type, e.g. `from cloudflare import BaseModel`" ) From 067f84285a7ab07ac08d65297cd14357068800fb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 16 Jan 2025 20:11:42 +0000 Subject: [PATCH 014/358] refactor: quote more recursive references (#2372) --- src/cloudflare/types/request_tracers/trace.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/cloudflare/types/request_tracers/trace.py b/src/cloudflare/types/request_tracers/trace.py index 873b2412404..194a007e285 100644 --- a/src/cloudflare/types/request_tracers/trace.py +++ b/src/cloudflare/types/request_tracers/trace.py @@ -2,16 +2,10 @@ from __future__ import annotations -from typing_extensions import TYPE_CHECKING, List, TypeAlias, TypeAliasType - -from ..._compat import PYDANTIC_V2 +from typing_extensions import List, TypeAlias __all__ = ["Trace"] - -if TYPE_CHECKING or PYDANTIC_V2: - Trace = TypeAliasType("Trace", List["TraceItem"]) -else: - Trace: TypeAlias = List["TraceItem"] +Trace: TypeAlias = List["TraceItem"] from .trace_item import TraceItem From 80f6319192e3be066dc37e0ac6df80434e98f27d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Jan 2025 00:32:46 +0000 Subject: [PATCH 015/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 8b036a53257..b240645beb7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1493 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-623d5dbee9e55ad6d5225ac6ef4179daffbd4c309abdd1095857747a0b46ec13.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bac30cf3609d26642f1dadb7fdadadeb8c854cb52f64dd6be1cc82fa45ffc465.yml From ec0fdaaab93642fb32f7a7b50a45e4b62cb78d76 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Jan 2025 16:53:50 +0000 Subject: [PATCH 016/358] feat(api): api update (#2375) --- .stats.yml | 2 +- src/cloudflare/types/zero_trust/access/service_token.py | 2 ++ .../types/zero_trust/organizations/doh_get_response.py | 2 ++ .../types/zero_trust/organizations/doh_update_response.py | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index b240645beb7..0d30d49d72e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1493 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bac30cf3609d26642f1dadb7fdadadeb8c854cb52f64dd6be1cc82fa45ffc465.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-443edbd0e6675b5d9ccef1192c2f36ecd69cbe5d896c00e15d172a2ab8eb5702.yml diff --git a/src/cloudflare/types/zero_trust/access/service_token.py b/src/cloudflare/types/zero_trust/access/service_token.py index d67695749a2..51d7c5000dc 100644 --- a/src/cloudflare/types/zero_trust/access/service_token.py +++ b/src/cloudflare/types/zero_trust/access/service_token.py @@ -29,6 +29,8 @@ class ServiceToken(BaseModel): expires_at: Optional[datetime] = None + last_seen_at: Optional[datetime] = None + name: Optional[str] = None """The name of the service token.""" diff --git a/src/cloudflare/types/zero_trust/organizations/doh_get_response.py b/src/cloudflare/types/zero_trust/organizations/doh_get_response.py index adb3be9867c..841eca85676 100644 --- a/src/cloudflare/types/zero_trust/organizations/doh_get_response.py +++ b/src/cloudflare/types/zero_trust/organizations/doh_get_response.py @@ -37,6 +37,8 @@ class DOHGetResponse(BaseModel): expires_at: Optional[datetime] = None + last_seen_at: Optional[datetime] = None + name: Optional[str] = None """The name of the service token.""" diff --git a/src/cloudflare/types/zero_trust/organizations/doh_update_response.py b/src/cloudflare/types/zero_trust/organizations/doh_update_response.py index 128469eebb3..bd5ca5d225a 100644 --- a/src/cloudflare/types/zero_trust/organizations/doh_update_response.py +++ b/src/cloudflare/types/zero_trust/organizations/doh_update_response.py @@ -37,6 +37,8 @@ class DOHUpdateResponse(BaseModel): expires_at: Optional[datetime] = None + last_seen_at: Optional[datetime] = None + name: Optional[str] = None """The name of the service token.""" From 736380f5d1e0c255fa438213f5f55b0d65929170 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Jan 2025 20:12:03 +0000 Subject: [PATCH 017/358] feat(api): api update (#2376) --- .stats.yml | 2 +- src/cloudflare/resources/zones/settings.py | 238 ++- .../types/zones/setting_edit_params.py | 51 + .../types/zones/setting_edit_response.py | 51 + .../types/zones/setting_get_response.py | 51 + tests/api_resources/zones/test_settings.py | 1272 +++++++++++------ 6 files changed, 1218 insertions(+), 447 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0d30d49d72e..eccc2a13dd8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1493 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-443edbd0e6675b5d9ccef1192c2f36ecd69cbe5d896c00e15d172a2ab8eb5702.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8805f41543cd932919c724a99b62b453bb8ab19e1a58a0305bd2b32b3d59c677.yml diff --git a/src/cloudflare/resources/zones/settings.py b/src/cloudflare/resources/zones/settings.py index 416796be704..050ba0ee6bd 100644 --- a/src/cloudflare/resources/zones/settings.py +++ b/src/cloudflare/resources/zones/settings.py @@ -125,6 +125,43 @@ def edit( """ ... + @overload + def edit( + self, + setting_id: str, + *, + zone_id: str, + id: Literal["aegis"], + value: setting_edit_params.ZonesCacheRulesAegisValue | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[SettingEditResponse]: + """ + Updates a single zone setting by the identifier + + Args: + zone_id: Identifier + + setting_id: Setting name + + id: ID of the zone setting. + + value: Value of the zone setting. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + @overload def edit( self, @@ -1249,6 +1286,80 @@ def edit( """ ... + @overload + def edit( + self, + setting_id: str, + *, + zone_id: str, + id: Literal["origin_h2_max_streams"], + value: int | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[SettingEditResponse]: + """ + Updates a single zone setting by the identifier + + Args: + zone_id: Identifier + + setting_id: Setting name + + id: Value of the zone setting. + + value: Value of the Origin H2 Max Streams Setting. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def edit( + self, + setting_id: str, + *, + zone_id: str, + id: Literal["origin_max_http_version"], + value: Literal["2", "1"] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[SettingEditResponse]: + """ + Updates a single zone setting by the identifier + + Args: + zone_id: Identifier + + setting_id: Setting name + + id: Value of the zone setting. + + value: Value of the Origin Max HTTP Version Setting. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + @overload def edit( self, @@ -2063,7 +2174,7 @@ def edit( """ ... - @required_args(["zone_id", "id", "value"], ["zone_id"]) + @required_args(["zone_id", "id", "value"], ["zone_id", "id"], ["zone_id"]) def edit( self, setting_id: str, @@ -2071,6 +2182,7 @@ def edit( zone_id: str, id: Literal["0rtt"] | Literal["advanced_ddos"] + | Literal["aegis"] | Literal["always_online"] | Literal["always_use_https"] | Literal["automatic_https_rewrites"] @@ -2100,6 +2212,8 @@ def edit( | Literal["opportunistic_onion"] | Literal["orange_to_orange"] | Literal["origin_error_page_pass_thru"] + | Literal["origin_h2_max_streams"] + | Literal["origin_max_http_version"] | Literal["polish"] | Literal["prefetch_preload"] | Literal["proxy_read_timeout"] @@ -2124,6 +2238,7 @@ def edit( | Literal["websockets"] | NotGiven = NOT_GIVEN, value: Literal["on", "off"] + | setting_edit_params.ZonesCacheRulesAegisValue | Literal[ 0, 30, @@ -2186,6 +2301,8 @@ def edit( | Literal[100, 200, 500] | Literal["1.0", "1.1", "1.2", "1.3"] | setting_edit_params.NELValue + | int + | Literal["2", "1"] | Literal["off", "lossless", "lossy"] | float | Literal["off", "add_header", "overwrite_header"] @@ -2376,6 +2493,43 @@ async def edit( """ ... + @overload + async def edit( + self, + setting_id: str, + *, + zone_id: str, + id: Literal["aegis"], + value: setting_edit_params.ZonesCacheRulesAegisValue | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[SettingEditResponse]: + """ + Updates a single zone setting by the identifier + + Args: + zone_id: Identifier + + setting_id: Setting name + + id: ID of the zone setting. + + value: Value of the zone setting. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + @overload async def edit( self, @@ -3500,6 +3654,80 @@ async def edit( """ ... + @overload + async def edit( + self, + setting_id: str, + *, + zone_id: str, + id: Literal["origin_h2_max_streams"], + value: int | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[SettingEditResponse]: + """ + Updates a single zone setting by the identifier + + Args: + zone_id: Identifier + + setting_id: Setting name + + id: Value of the zone setting. + + value: Value of the Origin H2 Max Streams Setting. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def edit( + self, + setting_id: str, + *, + zone_id: str, + id: Literal["origin_max_http_version"], + value: Literal["2", "1"] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[SettingEditResponse]: + """ + Updates a single zone setting by the identifier + + Args: + zone_id: Identifier + + setting_id: Setting name + + id: Value of the zone setting. + + value: Value of the Origin Max HTTP Version Setting. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + @overload async def edit( self, @@ -4314,7 +4542,7 @@ async def edit( """ ... - @required_args(["zone_id", "id", "value"], ["zone_id"]) + @required_args(["zone_id", "id", "value"], ["zone_id", "id"], ["zone_id"]) async def edit( self, setting_id: str, @@ -4322,6 +4550,7 @@ async def edit( zone_id: str, id: Literal["0rtt"] | Literal["advanced_ddos"] + | Literal["aegis"] | Literal["always_online"] | Literal["always_use_https"] | Literal["automatic_https_rewrites"] @@ -4351,6 +4580,8 @@ async def edit( | Literal["opportunistic_onion"] | Literal["orange_to_orange"] | Literal["origin_error_page_pass_thru"] + | Literal["origin_h2_max_streams"] + | Literal["origin_max_http_version"] | Literal["polish"] | Literal["prefetch_preload"] | Literal["proxy_read_timeout"] @@ -4375,6 +4606,7 @@ async def edit( | Literal["websockets"] | NotGiven = NOT_GIVEN, value: Literal["on", "off"] + | setting_edit_params.ZonesCacheRulesAegisValue | Literal[ 0, 30, @@ -4437,6 +4669,8 @@ async def edit( | Literal[100, 200, 500] | Literal["1.0", "1.1", "1.2", "1.3"] | setting_edit_params.NELValue + | int + | Literal["2", "1"] | Literal["off", "lossless", "lossy"] | float | Literal["off", "add_header", "overwrite_header"] diff --git a/src/cloudflare/types/zones/setting_edit_params.py b/src/cloudflare/types/zones/setting_edit_params.py index 37906fe334f..3aa35a79908 100644 --- a/src/cloudflare/types/zones/setting_edit_params.py +++ b/src/cloudflare/types/zones/setting_edit_params.py @@ -11,6 +11,8 @@ "SettingEditParams", "ZeroRTT", "AdvancedDDoS", + "ZonesCacheRulesAegis", + "ZonesCacheRulesAegisValue", "AlwaysOnline", "ZonesSchemasAlwaysUseHTTPS", "ZonesSchemasAutomaticHTTPSRewrites", @@ -41,6 +43,8 @@ "OpportunisticOnion", "OrangeToOrange", "ZonesSchemasOriginErrorPagePassThru", + "ZonesCacheRulesOriginH2MaxStreams", + "ZonesCacheRulesOriginMaxHTTPVersion", "ZonesSchemasPolish", "PrefetchPreload", "ProxyReadTimeout", @@ -90,6 +94,28 @@ class AdvancedDDoS(TypedDict, total=False): """Current value of the zone setting.""" +class ZonesCacheRulesAegis(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + id: Required[Literal["aegis"]] + """ID of the zone setting.""" + + value: ZonesCacheRulesAegisValue + """Value of the zone setting.""" + + +class ZonesCacheRulesAegisValue(TypedDict, total=False): + enabled: bool + """Whether the feature is enabled or not.""" + + pool_id: str + """ + Egress pool id which refers to a grouping of dedicated egress IPs through which + Cloudflare will connect to origin. + """ + + class AlwaysOnline(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -470,6 +496,28 @@ class ZonesSchemasOriginErrorPagePassThru(TypedDict, total=False): """Current value of the zone setting.""" +class ZonesCacheRulesOriginH2MaxStreams(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + id: Required[Literal["origin_h2_max_streams"]] + """Value of the zone setting.""" + + value: int + """Value of the Origin H2 Max Streams Setting.""" + + +class ZonesCacheRulesOriginMaxHTTPVersion(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + id: Required[Literal["origin_max_http_version"]] + """Value of the zone setting.""" + + value: Literal["2", "1"] + """Value of the Origin Max HTTP Version Setting.""" + + class ZonesSchemasPolish(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -737,6 +785,7 @@ class Websocket(TypedDict, total=False): SettingEditParams: TypeAlias = Union[ ZeroRTT, AdvancedDDoS, + ZonesCacheRulesAegis, AlwaysOnline, ZonesSchemasAlwaysUseHTTPS, ZonesSchemasAutomaticHTTPSRewrites, @@ -766,6 +815,8 @@ class Websocket(TypedDict, total=False): OpportunisticOnion, OrangeToOrange, ZonesSchemasOriginErrorPagePassThru, + ZonesCacheRulesOriginH2MaxStreams, + ZonesCacheRulesOriginMaxHTTPVersion, ZonesSchemasPolish, PrefetchPreload, ProxyReadTimeout, diff --git a/src/cloudflare/types/zones/setting_edit_response.py b/src/cloudflare/types/zones/setting_edit_response.py index 7b3e1c84f27..fd0ee081db1 100644 --- a/src/cloudflare/types/zones/setting_edit_response.py +++ b/src/cloudflare/types/zones/setting_edit_response.py @@ -37,6 +37,8 @@ __all__ = [ "SettingEditResponse", + "ZonesCacheRulesAegis", + "ZonesCacheRulesAegisValue", "ZonesSchemasAlwaysUseHTTPS", "ZonesSchemasAutomaticHTTPSRewrites", "ZonesSchemasBrowserCacheTTL", @@ -50,6 +52,8 @@ "ZonesSchemasMirage", "ZonesSchemasOpportunisticEncryption", "ZonesSchemasOriginErrorPagePassThru", + "ZonesCacheRulesOriginH2MaxStreams", + "ZonesCacheRulesOriginMaxHTTPVersion", "ZonesSchemasPolish", "ZonesReplaceInsecureJS", "ZonesSchemasResponseBuffering", @@ -65,6 +69,28 @@ ] +class ZonesCacheRulesAegisValue(BaseModel): + enabled: Optional[bool] = None + """Whether the feature is enabled or not.""" + + pool_id: Optional[str] = None + """ + Egress pool id which refers to a grouping of dedicated egress IPs through which + Cloudflare will connect to origin. + """ + + +class ZonesCacheRulesAegis(BaseModel): + id: Literal["aegis"] + """ID of the zone setting.""" + + modified_on: Optional[datetime] = None + """Last time this setting was modified.""" + + value: Optional[ZonesCacheRulesAegisValue] = None + """Value of the zone setting.""" + + class ZonesSchemasAlwaysUseHTTPS(BaseModel): id: Literal["always_use_https"] """ID of the zone setting.""" @@ -337,6 +363,28 @@ class ZonesSchemasOriginErrorPagePassThru(BaseModel): """last time this setting was modified.""" +class ZonesCacheRulesOriginH2MaxStreams(BaseModel): + id: Literal["origin_h2_max_streams"] + """Value of the zone setting.""" + + modified_on: Optional[datetime] = None + """Last time this setting was modified.""" + + value: Optional[int] = None + """Value of the Origin H2 Max Streams Setting.""" + + +class ZonesCacheRulesOriginMaxHTTPVersion(BaseModel): + id: Literal["origin_max_http_version"] + """Value of the zone setting.""" + + modified_on: Optional[datetime] = None + """Last time this setting was modified.""" + + value: Optional[Literal["2", "1"]] = None + """Value of the Origin Max HTTP Version Setting.""" + + class ZonesSchemasPolish(BaseModel): id: Literal["polish"] """ID of the zone setting.""" @@ -544,6 +592,7 @@ class ZonesSchemasWAF(BaseModel): SettingEditResponse: TypeAlias = Union[ ZeroRTT, AdvancedDDoS, + ZonesCacheRulesAegis, AlwaysOnline, ZonesSchemasAlwaysUseHTTPS, ZonesSchemasAutomaticHTTPSRewrites, @@ -573,6 +622,8 @@ class ZonesSchemasWAF(BaseModel): OpportunisticOnion, OrangeToOrange, ZonesSchemasOriginErrorPagePassThru, + ZonesCacheRulesOriginH2MaxStreams, + ZonesCacheRulesOriginMaxHTTPVersion, ZonesSchemasPolish, PrefetchPreload, ProxyReadTimeout, diff --git a/src/cloudflare/types/zones/setting_get_response.py b/src/cloudflare/types/zones/setting_get_response.py index dd80d1c66ab..f7fd9fbeee5 100644 --- a/src/cloudflare/types/zones/setting_get_response.py +++ b/src/cloudflare/types/zones/setting_get_response.py @@ -37,6 +37,8 @@ __all__ = [ "SettingGetResponse", + "ZonesCacheRulesAegis", + "ZonesCacheRulesAegisValue", "ZonesSchemasAlwaysUseHTTPS", "ZonesSchemasAutomaticHTTPSRewrites", "ZonesSchemasBrowserCacheTTL", @@ -50,6 +52,8 @@ "ZonesSchemasMirage", "ZonesSchemasOpportunisticEncryption", "ZonesSchemasOriginErrorPagePassThru", + "ZonesCacheRulesOriginH2MaxStreams", + "ZonesCacheRulesOriginMaxHTTPVersion", "ZonesSchemasPolish", "ZonesReplaceInsecureJS", "ZonesSchemasResponseBuffering", @@ -65,6 +69,28 @@ ] +class ZonesCacheRulesAegisValue(BaseModel): + enabled: Optional[bool] = None + """Whether the feature is enabled or not.""" + + pool_id: Optional[str] = None + """ + Egress pool id which refers to a grouping of dedicated egress IPs through which + Cloudflare will connect to origin. + """ + + +class ZonesCacheRulesAegis(BaseModel): + id: Literal["aegis"] + """ID of the zone setting.""" + + modified_on: Optional[datetime] = None + """Last time this setting was modified.""" + + value: Optional[ZonesCacheRulesAegisValue] = None + """Value of the zone setting.""" + + class ZonesSchemasAlwaysUseHTTPS(BaseModel): id: Literal["always_use_https"] """ID of the zone setting.""" @@ -337,6 +363,28 @@ class ZonesSchemasOriginErrorPagePassThru(BaseModel): """last time this setting was modified.""" +class ZonesCacheRulesOriginH2MaxStreams(BaseModel): + id: Literal["origin_h2_max_streams"] + """Value of the zone setting.""" + + modified_on: Optional[datetime] = None + """Last time this setting was modified.""" + + value: Optional[int] = None + """Value of the Origin H2 Max Streams Setting.""" + + +class ZonesCacheRulesOriginMaxHTTPVersion(BaseModel): + id: Literal["origin_max_http_version"] + """Value of the zone setting.""" + + modified_on: Optional[datetime] = None + """Last time this setting was modified.""" + + value: Optional[Literal["2", "1"]] = None + """Value of the Origin Max HTTP Version Setting.""" + + class ZonesSchemasPolish(BaseModel): id: Literal["polish"] """ID of the zone setting.""" @@ -544,6 +592,7 @@ class ZonesSchemasWAF(BaseModel): SettingGetResponse: TypeAlias = Union[ ZeroRTT, AdvancedDDoS, + ZonesCacheRulesAegis, AlwaysOnline, ZonesSchemasAlwaysUseHTTPS, ZonesSchemasAutomaticHTTPSRewrites, @@ -573,6 +622,8 @@ class ZonesSchemasWAF(BaseModel): OpportunisticOnion, OrangeToOrange, ZonesSchemasOriginErrorPagePassThru, + ZonesCacheRulesOriginH2MaxStreams, + ZonesCacheRulesOriginMaxHTTPVersion, ZonesSchemasPolish, PrefetchPreload, ProxyReadTimeout, diff --git a/tests/api_resources/zones/test_settings.py b/tests/api_resources/zones/test_settings.py index ed69c0bcb07..e3342d699c7 100644 --- a/tests/api_resources/zones/test_settings.py +++ b/tests/api_resources/zones/test_settings.py @@ -138,6 +138,72 @@ def test_path_params_edit_overload_2(self, client: Cloudflare) -> None: @parametrize def test_method_edit_overload_3(self, client: Cloudflare) -> None: + setting = client.zones.settings.edit( + setting_id="always_online", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="aegis", + ) + assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) + + @parametrize + def test_method_edit_with_all_params_overload_3(self, client: Cloudflare) -> None: + setting = client.zones.settings.edit( + setting_id="always_online", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="aegis", + value={ + "enabled": True, + "pool_id": "pool-id", + }, + ) + assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) + + @parametrize + def test_raw_response_edit_overload_3(self, client: Cloudflare) -> None: + response = client.zones.settings.with_raw_response.edit( + setting_id="always_online", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="aegis", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + setting = response.parse() + assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) + + @parametrize + def test_streaming_response_edit_overload_3(self, client: Cloudflare) -> None: + with client.zones.settings.with_streaming_response.edit( + setting_id="always_online", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="aegis", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + setting = response.parse() + assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_edit_overload_3(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zones.settings.with_raw_response.edit( + setting_id="always_online", + zone_id="", + id="aegis", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"): + client.zones.settings.with_raw_response.edit( + setting_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="aegis", + ) + + @parametrize + def test_method_edit_overload_4(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -147,7 +213,7 @@ def test_method_edit_overload_3(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_3(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_4(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -161,7 +227,7 @@ def test_raw_response_edit_overload_3(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_3(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_4(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -177,7 +243,7 @@ def test_streaming_response_edit_overload_3(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_3(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_4(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -195,7 +261,7 @@ def test_path_params_edit_overload_3(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_4(self, client: Cloudflare) -> None: + def test_method_edit_overload_5(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -205,7 +271,7 @@ def test_method_edit_overload_4(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_4(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_5(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -219,7 +285,7 @@ def test_raw_response_edit_overload_4(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_4(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_5(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -235,7 +301,7 @@ def test_streaming_response_edit_overload_4(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_4(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_5(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -253,7 +319,7 @@ def test_path_params_edit_overload_4(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_5(self, client: Cloudflare) -> None: + def test_method_edit_overload_6(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -263,7 +329,7 @@ def test_method_edit_overload_5(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_5(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_6(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -277,7 +343,7 @@ def test_raw_response_edit_overload_5(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_5(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_6(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -293,7 +359,7 @@ def test_streaming_response_edit_overload_5(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_5(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_6(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -311,7 +377,7 @@ def test_path_params_edit_overload_5(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_6(self, client: Cloudflare) -> None: + def test_method_edit_overload_7(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -321,7 +387,7 @@ def test_method_edit_overload_6(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_6(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_7(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -335,7 +401,7 @@ def test_raw_response_edit_overload_6(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_6(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_7(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -351,7 +417,7 @@ def test_streaming_response_edit_overload_6(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_6(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_7(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -369,7 +435,7 @@ def test_path_params_edit_overload_6(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_7(self, client: Cloudflare) -> None: + def test_method_edit_overload_8(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -379,7 +445,7 @@ def test_method_edit_overload_7(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_7(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_8(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -393,7 +459,7 @@ def test_raw_response_edit_overload_7(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_7(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_8(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -409,7 +475,7 @@ def test_streaming_response_edit_overload_7(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_7(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_8(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -427,7 +493,7 @@ def test_path_params_edit_overload_7(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_8(self, client: Cloudflare) -> None: + def test_method_edit_overload_9(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -437,7 +503,7 @@ def test_method_edit_overload_8(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_8(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_9(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -451,7 +517,7 @@ def test_raw_response_edit_overload_8(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_8(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_9(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -467,7 +533,7 @@ def test_streaming_response_edit_overload_8(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_8(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_9(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -485,7 +551,7 @@ def test_path_params_edit_overload_8(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_9(self, client: Cloudflare) -> None: + def test_method_edit_overload_10(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -495,7 +561,7 @@ def test_method_edit_overload_9(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_9(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_10(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -509,7 +575,7 @@ def test_raw_response_edit_overload_9(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_9(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_10(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -525,7 +591,7 @@ def test_streaming_response_edit_overload_9(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_9(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_10(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -543,7 +609,7 @@ def test_path_params_edit_overload_9(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_10(self, client: Cloudflare) -> None: + def test_method_edit_overload_11(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -553,7 +619,7 @@ def test_method_edit_overload_10(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_10(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_11(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -567,7 +633,7 @@ def test_raw_response_edit_overload_10(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_10(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_11(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -583,7 +649,7 @@ def test_streaming_response_edit_overload_10(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_10(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_11(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -601,7 +667,7 @@ def test_path_params_edit_overload_10(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_11(self, client: Cloudflare) -> None: + def test_method_edit_overload_12(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -611,7 +677,7 @@ def test_method_edit_overload_11(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_11(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_12(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -625,7 +691,7 @@ def test_raw_response_edit_overload_11(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_11(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_12(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -641,7 +707,7 @@ def test_streaming_response_edit_overload_11(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_11(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_12(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -659,7 +725,7 @@ def test_path_params_edit_overload_11(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_12(self, client: Cloudflare) -> None: + def test_method_edit_overload_13(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -669,7 +735,7 @@ def test_method_edit_overload_12(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_12(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_13(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -683,7 +749,7 @@ def test_raw_response_edit_overload_12(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_12(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_13(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -699,7 +765,7 @@ def test_streaming_response_edit_overload_12(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_12(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_13(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -717,7 +783,7 @@ def test_path_params_edit_overload_12(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_13(self, client: Cloudflare) -> None: + def test_method_edit_overload_14(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -727,7 +793,7 @@ def test_method_edit_overload_13(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_13(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_14(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -741,7 +807,7 @@ def test_raw_response_edit_overload_13(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_13(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_14(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -757,7 +823,7 @@ def test_streaming_response_edit_overload_13(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_13(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_14(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -775,7 +841,7 @@ def test_path_params_edit_overload_13(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_14(self, client: Cloudflare) -> None: + def test_method_edit_overload_15(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -785,7 +851,7 @@ def test_method_edit_overload_14(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_14(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_15(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -799,7 +865,7 @@ def test_raw_response_edit_overload_14(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_14(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_15(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -815,7 +881,7 @@ def test_streaming_response_edit_overload_14(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_14(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_15(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -833,7 +899,7 @@ def test_path_params_edit_overload_14(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_15(self, client: Cloudflare) -> None: + def test_method_edit_overload_16(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -843,7 +909,7 @@ def test_method_edit_overload_15(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_15(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_16(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -857,7 +923,7 @@ def test_raw_response_edit_overload_15(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_15(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_16(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -873,7 +939,7 @@ def test_streaming_response_edit_overload_15(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_15(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_16(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -891,7 +957,7 @@ def test_path_params_edit_overload_15(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_16(self, client: Cloudflare) -> None: + def test_method_edit_overload_17(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -901,7 +967,7 @@ def test_method_edit_overload_16(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_16(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_17(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -915,7 +981,7 @@ def test_raw_response_edit_overload_16(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_16(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_17(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -931,7 +997,7 @@ def test_streaming_response_edit_overload_16(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_16(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_17(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -949,7 +1015,7 @@ def test_path_params_edit_overload_16(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_17(self, client: Cloudflare) -> None: + def test_method_edit_overload_18(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -959,7 +1025,7 @@ def test_method_edit_overload_17(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_17(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_18(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -973,7 +1039,7 @@ def test_raw_response_edit_overload_17(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_17(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_18(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -989,7 +1055,7 @@ def test_streaming_response_edit_overload_17(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_17(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_18(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -1007,7 +1073,7 @@ def test_path_params_edit_overload_17(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_18(self, client: Cloudflare) -> None: + def test_method_edit_overload_19(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1017,7 +1083,7 @@ def test_method_edit_overload_18(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_18(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_19(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1031,7 +1097,7 @@ def test_raw_response_edit_overload_18(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_18(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_19(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1047,7 +1113,7 @@ def test_streaming_response_edit_overload_18(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_18(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_19(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -1065,7 +1131,7 @@ def test_path_params_edit_overload_18(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_19(self, client: Cloudflare) -> None: + def test_method_edit_overload_20(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1075,7 +1141,7 @@ def test_method_edit_overload_19(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_19(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_20(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1089,7 +1155,7 @@ def test_raw_response_edit_overload_19(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_19(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_20(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1105,7 +1171,7 @@ def test_streaming_response_edit_overload_19(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_19(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_20(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -1123,7 +1189,7 @@ def test_path_params_edit_overload_19(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_20(self, client: Cloudflare) -> None: + def test_method_edit_overload_21(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1133,7 +1199,7 @@ def test_method_edit_overload_20(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_20(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_21(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1147,7 +1213,7 @@ def test_raw_response_edit_overload_20(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_20(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_21(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1163,7 +1229,7 @@ def test_streaming_response_edit_overload_20(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_20(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_21(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -1181,7 +1247,7 @@ def test_path_params_edit_overload_20(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_21(self, client: Cloudflare) -> None: + def test_method_edit_overload_22(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1191,7 +1257,7 @@ def test_method_edit_overload_21(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_21(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_22(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1205,7 +1271,7 @@ def test_raw_response_edit_overload_21(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_21(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_22(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1221,7 +1287,7 @@ def test_streaming_response_edit_overload_21(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_21(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_22(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -1239,7 +1305,7 @@ def test_path_params_edit_overload_21(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_22(self, client: Cloudflare) -> None: + def test_method_edit_overload_23(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1249,7 +1315,7 @@ def test_method_edit_overload_22(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_22(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_23(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1263,7 +1329,7 @@ def test_raw_response_edit_overload_22(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_22(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_23(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1279,7 +1345,7 @@ def test_streaming_response_edit_overload_22(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_22(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_23(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -1297,7 +1363,7 @@ def test_path_params_edit_overload_22(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_23(self, client: Cloudflare) -> None: + def test_method_edit_overload_24(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1307,7 +1373,7 @@ def test_method_edit_overload_23(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_23(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_24(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1321,7 +1387,7 @@ def test_raw_response_edit_overload_23(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_23(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_24(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1337,7 +1403,7 @@ def test_streaming_response_edit_overload_23(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_23(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_24(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -1355,7 +1421,7 @@ def test_path_params_edit_overload_23(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_24(self, client: Cloudflare) -> None: + def test_method_edit_overload_25(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1365,7 +1431,7 @@ def test_method_edit_overload_24(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_24(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_25(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1379,7 +1445,7 @@ def test_raw_response_edit_overload_24(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_24(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_25(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1395,7 +1461,7 @@ def test_streaming_response_edit_overload_24(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_24(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_25(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -1413,7 +1479,7 @@ def test_path_params_edit_overload_24(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_25(self, client: Cloudflare) -> None: + def test_method_edit_overload_26(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1423,7 +1489,7 @@ def test_method_edit_overload_25(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_25(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_26(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1437,7 +1503,7 @@ def test_raw_response_edit_overload_25(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_25(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_26(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1453,7 +1519,7 @@ def test_streaming_response_edit_overload_25(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_25(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_26(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -1471,7 +1537,7 @@ def test_path_params_edit_overload_25(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_26(self, client: Cloudflare) -> None: + def test_method_edit_overload_27(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1481,7 +1547,7 @@ def test_method_edit_overload_26(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_26(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_27(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1495,7 +1561,7 @@ def test_raw_response_edit_overload_26(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_26(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_27(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1511,7 +1577,7 @@ def test_streaming_response_edit_overload_26(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_26(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_27(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -1529,7 +1595,7 @@ def test_path_params_edit_overload_26(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_27(self, client: Cloudflare) -> None: + def test_method_edit_overload_28(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1539,7 +1605,7 @@ def test_method_edit_overload_27(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_method_edit_with_all_params_overload_27(self, client: Cloudflare) -> None: + def test_method_edit_with_all_params_overload_28(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1549,7 +1615,7 @@ def test_method_edit_with_all_params_overload_27(self, client: Cloudflare) -> No assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_27(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_28(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1563,7 +1629,7 @@ def test_raw_response_edit_overload_27(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_27(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_28(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1579,7 +1645,7 @@ def test_streaming_response_edit_overload_27(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_27(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_28(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -1597,7 +1663,7 @@ def test_path_params_edit_overload_27(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_28(self, client: Cloudflare) -> None: + def test_method_edit_overload_29(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1607,7 +1673,7 @@ def test_method_edit_overload_28(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_28(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_29(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1621,7 +1687,7 @@ def test_raw_response_edit_overload_28(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_28(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_29(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1637,7 +1703,7 @@ def test_streaming_response_edit_overload_28(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_28(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_29(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -1655,7 +1721,7 @@ def test_path_params_edit_overload_28(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_29(self, client: Cloudflare) -> None: + def test_method_edit_overload_30(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1665,7 +1731,7 @@ def test_method_edit_overload_29(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_29(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_30(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1679,7 +1745,7 @@ def test_raw_response_edit_overload_29(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_29(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_30(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1695,7 +1761,7 @@ def test_streaming_response_edit_overload_29(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_29(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_30(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -1713,7 +1779,7 @@ def test_path_params_edit_overload_29(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_30(self, client: Cloudflare) -> None: + def test_method_edit_overload_31(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1723,7 +1789,7 @@ def test_method_edit_overload_30(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_30(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_31(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1737,7 +1803,7 @@ def test_raw_response_edit_overload_30(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_30(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_31(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1753,7 +1819,7 @@ def test_streaming_response_edit_overload_30(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_30(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_31(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -1771,7 +1837,7 @@ def test_path_params_edit_overload_30(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_31(self, client: Cloudflare) -> None: + def test_method_edit_overload_32(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1781,7 +1847,7 @@ def test_method_edit_overload_31(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_31(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_32(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1795,7 +1861,7 @@ def test_raw_response_edit_overload_31(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_31(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_32(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1811,7 +1877,7 @@ def test_streaming_response_edit_overload_31(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_31(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_32(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -1829,7 +1895,133 @@ def test_path_params_edit_overload_31(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_32(self, client: Cloudflare) -> None: + def test_method_edit_overload_33(self, client: Cloudflare) -> None: + setting = client.zones.settings.edit( + setting_id="always_online", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="origin_h2_max_streams", + ) + assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) + + @parametrize + def test_method_edit_with_all_params_overload_33(self, client: Cloudflare) -> None: + setting = client.zones.settings.edit( + setting_id="always_online", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="origin_h2_max_streams", + value=50, + ) + assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) + + @parametrize + def test_raw_response_edit_overload_33(self, client: Cloudflare) -> None: + response = client.zones.settings.with_raw_response.edit( + setting_id="always_online", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="origin_h2_max_streams", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + setting = response.parse() + assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) + + @parametrize + def test_streaming_response_edit_overload_33(self, client: Cloudflare) -> None: + with client.zones.settings.with_streaming_response.edit( + setting_id="always_online", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="origin_h2_max_streams", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + setting = response.parse() + assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_edit_overload_33(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zones.settings.with_raw_response.edit( + setting_id="always_online", + zone_id="", + id="origin_h2_max_streams", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"): + client.zones.settings.with_raw_response.edit( + setting_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="origin_h2_max_streams", + ) + + @parametrize + def test_method_edit_overload_34(self, client: Cloudflare) -> None: + setting = client.zones.settings.edit( + setting_id="always_online", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="origin_max_http_version", + ) + assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) + + @parametrize + def test_method_edit_with_all_params_overload_34(self, client: Cloudflare) -> None: + setting = client.zones.settings.edit( + setting_id="always_online", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="origin_max_http_version", + value="2", + ) + assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) + + @parametrize + def test_raw_response_edit_overload_34(self, client: Cloudflare) -> None: + response = client.zones.settings.with_raw_response.edit( + setting_id="always_online", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="origin_max_http_version", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + setting = response.parse() + assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) + + @parametrize + def test_streaming_response_edit_overload_34(self, client: Cloudflare) -> None: + with client.zones.settings.with_streaming_response.edit( + setting_id="always_online", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="origin_max_http_version", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + setting = response.parse() + assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_edit_overload_34(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zones.settings.with_raw_response.edit( + setting_id="always_online", + zone_id="", + id="origin_max_http_version", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"): + client.zones.settings.with_raw_response.edit( + setting_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="origin_max_http_version", + ) + + @parametrize + def test_method_edit_overload_35(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1839,7 +2031,7 @@ def test_method_edit_overload_32(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_32(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_35(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1853,7 +2045,7 @@ def test_raw_response_edit_overload_32(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_32(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_35(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1869,7 +2061,7 @@ def test_streaming_response_edit_overload_32(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_32(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_35(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -1887,7 +2079,7 @@ def test_path_params_edit_overload_32(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_33(self, client: Cloudflare) -> None: + def test_method_edit_overload_36(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1897,7 +2089,7 @@ def test_method_edit_overload_33(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_33(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_36(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1911,7 +2103,7 @@ def test_raw_response_edit_overload_33(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_33(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_36(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1927,7 +2119,7 @@ def test_streaming_response_edit_overload_33(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_33(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_36(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -1945,7 +2137,7 @@ def test_path_params_edit_overload_33(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_34(self, client: Cloudflare) -> None: + def test_method_edit_overload_37(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1955,7 +2147,7 @@ def test_method_edit_overload_34(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_34(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_37(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1969,7 +2161,7 @@ def test_raw_response_edit_overload_34(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_34(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_37(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -1985,7 +2177,7 @@ def test_streaming_response_edit_overload_34(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_34(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_37(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -2003,7 +2195,7 @@ def test_path_params_edit_overload_34(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_35(self, client: Cloudflare) -> None: + def test_method_edit_overload_38(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2013,7 +2205,7 @@ def test_method_edit_overload_35(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_35(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_38(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2027,7 +2219,7 @@ def test_raw_response_edit_overload_35(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_35(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_38(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2043,7 +2235,7 @@ def test_streaming_response_edit_overload_35(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_35(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_38(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -2061,7 +2253,7 @@ def test_path_params_edit_overload_35(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_36(self, client: Cloudflare) -> None: + def test_method_edit_overload_39(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2071,7 +2263,7 @@ def test_method_edit_overload_36(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_36(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_39(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2085,7 +2277,7 @@ def test_raw_response_edit_overload_36(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_36(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_39(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2101,7 +2293,7 @@ def test_streaming_response_edit_overload_36(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_36(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_39(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -2119,7 +2311,7 @@ def test_path_params_edit_overload_36(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_37(self, client: Cloudflare) -> None: + def test_method_edit_overload_40(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2129,7 +2321,7 @@ def test_method_edit_overload_37(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_37(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_40(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2143,7 +2335,7 @@ def test_raw_response_edit_overload_37(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_37(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_40(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2159,7 +2351,7 @@ def test_streaming_response_edit_overload_37(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_37(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_40(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -2177,7 +2369,7 @@ def test_path_params_edit_overload_37(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_38(self, client: Cloudflare) -> None: + def test_method_edit_overload_41(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2187,7 +2379,7 @@ def test_method_edit_overload_38(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_38(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_41(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2201,7 +2393,7 @@ def test_raw_response_edit_overload_38(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_38(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_41(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2217,7 +2409,7 @@ def test_streaming_response_edit_overload_38(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_38(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_41(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -2235,7 +2427,7 @@ def test_path_params_edit_overload_38(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_39(self, client: Cloudflare) -> None: + def test_method_edit_overload_42(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2252,7 +2444,7 @@ def test_method_edit_overload_39(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_39(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_42(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2273,7 +2465,7 @@ def test_raw_response_edit_overload_39(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_39(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_42(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2296,7 +2488,7 @@ def test_streaming_response_edit_overload_39(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_39(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_42(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -2328,7 +2520,7 @@ def test_path_params_edit_overload_39(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_40(self, client: Cloudflare) -> None: + def test_method_edit_overload_43(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2338,7 +2530,7 @@ def test_method_edit_overload_40(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_method_edit_with_all_params_overload_40(self, client: Cloudflare) -> None: + def test_method_edit_with_all_params_overload_43(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2356,7 +2548,7 @@ def test_method_edit_with_all_params_overload_40(self, client: Cloudflare) -> No assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_40(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_43(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2370,7 +2562,7 @@ def test_raw_response_edit_overload_40(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_40(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_43(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2386,7 +2578,7 @@ def test_streaming_response_edit_overload_40(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_40(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_43(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -2404,7 +2596,7 @@ def test_path_params_edit_overload_40(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_41(self, client: Cloudflare) -> None: + def test_method_edit_overload_44(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2414,7 +2606,7 @@ def test_method_edit_overload_41(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_41(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_44(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2428,7 +2620,7 @@ def test_raw_response_edit_overload_41(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_41(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_44(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2444,7 +2636,7 @@ def test_streaming_response_edit_overload_41(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_41(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_44(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -2462,7 +2654,7 @@ def test_path_params_edit_overload_41(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_42(self, client: Cloudflare) -> None: + def test_method_edit_overload_45(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2472,7 +2664,7 @@ def test_method_edit_overload_42(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_42(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_45(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2486,7 +2678,7 @@ def test_raw_response_edit_overload_42(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_42(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_45(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2502,7 +2694,7 @@ def test_streaming_response_edit_overload_42(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_42(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_45(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -2520,7 +2712,7 @@ def test_path_params_edit_overload_42(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_43(self, client: Cloudflare) -> None: + def test_method_edit_overload_46(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2530,7 +2722,7 @@ def test_method_edit_overload_43(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_43(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_46(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2544,7 +2736,7 @@ def test_raw_response_edit_overload_43(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_43(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_46(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2560,7 +2752,7 @@ def test_streaming_response_edit_overload_43(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_43(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_46(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -2578,7 +2770,7 @@ def test_path_params_edit_overload_43(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_44(self, client: Cloudflare) -> None: + def test_method_edit_overload_47(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2588,7 +2780,7 @@ def test_method_edit_overload_44(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_44(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_47(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2602,7 +2794,7 @@ def test_raw_response_edit_overload_44(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_44(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_47(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2618,7 +2810,7 @@ def test_streaming_response_edit_overload_44(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_44(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_47(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -2636,7 +2828,7 @@ def test_path_params_edit_overload_44(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_45(self, client: Cloudflare) -> None: + def test_method_edit_overload_48(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2646,7 +2838,7 @@ def test_method_edit_overload_45(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_45(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_48(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2660,7 +2852,7 @@ def test_raw_response_edit_overload_45(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_45(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_48(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2676,7 +2868,7 @@ def test_streaming_response_edit_overload_45(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_45(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_48(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -2694,7 +2886,7 @@ def test_path_params_edit_overload_45(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_46(self, client: Cloudflare) -> None: + def test_method_edit_overload_49(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2702,7 +2894,7 @@ def test_method_edit_overload_46(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_method_edit_with_all_params_overload_46(self, client: Cloudflare) -> None: + def test_method_edit_with_all_params_overload_49(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2712,7 +2904,7 @@ def test_method_edit_with_all_params_overload_46(self, client: Cloudflare) -> No assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_46(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_49(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2724,7 +2916,7 @@ def test_raw_response_edit_overload_46(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_46(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_49(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2738,7 +2930,7 @@ def test_streaming_response_edit_overload_46(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_46(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_49(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -2752,7 +2944,7 @@ def test_path_params_edit_overload_46(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_47(self, client: Cloudflare) -> None: + def test_method_edit_overload_50(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2762,7 +2954,7 @@ def test_method_edit_overload_47(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_47(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_50(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2776,7 +2968,7 @@ def test_raw_response_edit_overload_47(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_47(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_50(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2792,7 +2984,7 @@ def test_streaming_response_edit_overload_47(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_47(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_50(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -2810,7 +3002,7 @@ def test_path_params_edit_overload_47(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_48(self, client: Cloudflare) -> None: + def test_method_edit_overload_51(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2820,7 +3012,7 @@ def test_method_edit_overload_48(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_48(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_51(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2834,7 +3026,7 @@ def test_raw_response_edit_overload_48(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_48(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_51(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2850,7 +3042,7 @@ def test_streaming_response_edit_overload_48(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_48(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_51(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -2868,7 +3060,7 @@ def test_path_params_edit_overload_48(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_49(self, client: Cloudflare) -> None: + def test_method_edit_overload_52(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2878,7 +3070,7 @@ def test_method_edit_overload_49(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_49(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_52(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2892,7 +3084,7 @@ def test_raw_response_edit_overload_49(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_49(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_52(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2908,7 +3100,7 @@ def test_streaming_response_edit_overload_49(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_49(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_52(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -2926,7 +3118,7 @@ def test_path_params_edit_overload_49(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_50(self, client: Cloudflare) -> None: + def test_method_edit_overload_53(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2936,7 +3128,7 @@ def test_method_edit_overload_50(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_50(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_53(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2950,7 +3142,7 @@ def test_raw_response_edit_overload_50(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_50(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_53(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2966,7 +3158,7 @@ def test_streaming_response_edit_overload_50(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_50(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_53(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -2984,7 +3176,7 @@ def test_path_params_edit_overload_50(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_51(self, client: Cloudflare) -> None: + def test_method_edit_overload_54(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2994,7 +3186,7 @@ def test_method_edit_overload_51(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_51(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_54(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3008,7 +3200,7 @@ def test_raw_response_edit_overload_51(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_51(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_54(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3024,7 +3216,7 @@ def test_streaming_response_edit_overload_51(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_51(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_54(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -3042,7 +3234,7 @@ def test_path_params_edit_overload_51(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_52(self, client: Cloudflare) -> None: + def test_method_edit_overload_55(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3052,7 +3244,7 @@ def test_method_edit_overload_52(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_52(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_55(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3066,7 +3258,7 @@ def test_raw_response_edit_overload_52(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_52(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_55(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3082,7 +3274,7 @@ def test_streaming_response_edit_overload_52(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_52(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_55(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -3100,7 +3292,7 @@ def test_path_params_edit_overload_52(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_53(self, client: Cloudflare) -> None: + def test_method_edit_overload_56(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3110,7 +3302,7 @@ def test_method_edit_overload_53(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_53(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_56(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3124,7 +3316,7 @@ def test_raw_response_edit_overload_53(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_53(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_56(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3140,7 +3332,7 @@ def test_streaming_response_edit_overload_53(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_53(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_56(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -3327,6 +3519,72 @@ async def test_path_params_edit_overload_2(self, async_client: AsyncCloudflare) @parametrize async def test_method_edit_overload_3(self, async_client: AsyncCloudflare) -> None: + setting = await async_client.zones.settings.edit( + setting_id="always_online", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="aegis", + ) + assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) + + @parametrize + async def test_method_edit_with_all_params_overload_3(self, async_client: AsyncCloudflare) -> None: + setting = await async_client.zones.settings.edit( + setting_id="always_online", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="aegis", + value={ + "enabled": True, + "pool_id": "pool-id", + }, + ) + assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) + + @parametrize + async def test_raw_response_edit_overload_3(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zones.settings.with_raw_response.edit( + setting_id="always_online", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="aegis", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + setting = await response.parse() + assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) + + @parametrize + async def test_streaming_response_edit_overload_3(self, async_client: AsyncCloudflare) -> None: + async with async_client.zones.settings.with_streaming_response.edit( + setting_id="always_online", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="aegis", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + setting = await response.parse() + assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_edit_overload_3(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zones.settings.with_raw_response.edit( + setting_id="always_online", + zone_id="", + id="aegis", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"): + await async_client.zones.settings.with_raw_response.edit( + setting_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="aegis", + ) + + @parametrize + async def test_method_edit_overload_4(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3336,7 +3594,7 @@ async def test_method_edit_overload_3(self, async_client: AsyncCloudflare) -> No assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_3(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_4(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3350,7 +3608,7 @@ async def test_raw_response_edit_overload_3(self, async_client: AsyncCloudflare) assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_3(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_4(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3366,7 +3624,7 @@ async def test_streaming_response_edit_overload_3(self, async_client: AsyncCloud assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_3(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_4(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -3384,7 +3642,7 @@ async def test_path_params_edit_overload_3(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_4(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_5(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3394,7 +3652,7 @@ async def test_method_edit_overload_4(self, async_client: AsyncCloudflare) -> No assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_4(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_5(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3408,7 +3666,7 @@ async def test_raw_response_edit_overload_4(self, async_client: AsyncCloudflare) assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_4(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_5(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3424,7 +3682,7 @@ async def test_streaming_response_edit_overload_4(self, async_client: AsyncCloud assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_4(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_5(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -3442,7 +3700,7 @@ async def test_path_params_edit_overload_4(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_5(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_6(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3452,7 +3710,7 @@ async def test_method_edit_overload_5(self, async_client: AsyncCloudflare) -> No assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_5(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_6(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3466,7 +3724,7 @@ async def test_raw_response_edit_overload_5(self, async_client: AsyncCloudflare) assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_5(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_6(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3482,7 +3740,7 @@ async def test_streaming_response_edit_overload_5(self, async_client: AsyncCloud assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_5(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_6(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -3500,7 +3758,7 @@ async def test_path_params_edit_overload_5(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_6(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_7(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3510,7 +3768,7 @@ async def test_method_edit_overload_6(self, async_client: AsyncCloudflare) -> No assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_6(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_7(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3524,7 +3782,7 @@ async def test_raw_response_edit_overload_6(self, async_client: AsyncCloudflare) assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_6(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_7(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3540,7 +3798,7 @@ async def test_streaming_response_edit_overload_6(self, async_client: AsyncCloud assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_6(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_7(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -3558,7 +3816,7 @@ async def test_path_params_edit_overload_6(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_7(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_8(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3568,7 +3826,7 @@ async def test_method_edit_overload_7(self, async_client: AsyncCloudflare) -> No assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_7(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_8(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3582,7 +3840,7 @@ async def test_raw_response_edit_overload_7(self, async_client: AsyncCloudflare) assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_7(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_8(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3598,7 +3856,7 @@ async def test_streaming_response_edit_overload_7(self, async_client: AsyncCloud assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_7(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_8(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -3616,7 +3874,7 @@ async def test_path_params_edit_overload_7(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_8(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_9(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3626,7 +3884,7 @@ async def test_method_edit_overload_8(self, async_client: AsyncCloudflare) -> No assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_8(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_9(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3640,7 +3898,7 @@ async def test_raw_response_edit_overload_8(self, async_client: AsyncCloudflare) assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_8(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_9(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3656,7 +3914,7 @@ async def test_streaming_response_edit_overload_8(self, async_client: AsyncCloud assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_8(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_9(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -3674,7 +3932,7 @@ async def test_path_params_edit_overload_8(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_9(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_10(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3684,7 +3942,7 @@ async def test_method_edit_overload_9(self, async_client: AsyncCloudflare) -> No assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_9(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_10(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3698,7 +3956,7 @@ async def test_raw_response_edit_overload_9(self, async_client: AsyncCloudflare) assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_9(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_10(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3714,7 +3972,7 @@ async def test_streaming_response_edit_overload_9(self, async_client: AsyncCloud assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_9(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_10(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -3732,7 +3990,7 @@ async def test_path_params_edit_overload_9(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_10(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_11(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3742,7 +4000,7 @@ async def test_method_edit_overload_10(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_10(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_11(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3756,7 +4014,7 @@ async def test_raw_response_edit_overload_10(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_10(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_11(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3772,7 +4030,7 @@ async def test_streaming_response_edit_overload_10(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_10(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_11(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -3790,7 +4048,7 @@ async def test_path_params_edit_overload_10(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_11(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_12(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3800,7 +4058,7 @@ async def test_method_edit_overload_11(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_11(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_12(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3814,7 +4072,7 @@ async def test_raw_response_edit_overload_11(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_11(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_12(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3830,7 +4088,7 @@ async def test_streaming_response_edit_overload_11(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_11(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_12(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -3848,7 +4106,7 @@ async def test_path_params_edit_overload_11(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_12(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_13(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3858,7 +4116,7 @@ async def test_method_edit_overload_12(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_12(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_13(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3872,7 +4130,7 @@ async def test_raw_response_edit_overload_12(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_12(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_13(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3888,7 +4146,7 @@ async def test_streaming_response_edit_overload_12(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_12(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_13(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -3906,7 +4164,7 @@ async def test_path_params_edit_overload_12(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_13(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_14(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3916,7 +4174,7 @@ async def test_method_edit_overload_13(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_13(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_14(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3930,7 +4188,7 @@ async def test_raw_response_edit_overload_13(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_13(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_14(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3946,7 +4204,7 @@ async def test_streaming_response_edit_overload_13(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_13(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_14(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -3964,7 +4222,7 @@ async def test_path_params_edit_overload_13(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_14(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_15(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3974,7 +4232,7 @@ async def test_method_edit_overload_14(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_14(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_15(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3988,7 +4246,7 @@ async def test_raw_response_edit_overload_14(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_14(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_15(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4004,7 +4262,7 @@ async def test_streaming_response_edit_overload_14(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_14(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_15(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -4022,7 +4280,7 @@ async def test_path_params_edit_overload_14(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_15(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_16(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4032,7 +4290,7 @@ async def test_method_edit_overload_15(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_15(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_16(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4046,7 +4304,7 @@ async def test_raw_response_edit_overload_15(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_15(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_16(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4062,7 +4320,7 @@ async def test_streaming_response_edit_overload_15(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_15(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_16(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -4080,7 +4338,7 @@ async def test_path_params_edit_overload_15(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_16(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_17(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4090,7 +4348,7 @@ async def test_method_edit_overload_16(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_16(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_17(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4104,7 +4362,7 @@ async def test_raw_response_edit_overload_16(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_16(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_17(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4120,7 +4378,7 @@ async def test_streaming_response_edit_overload_16(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_16(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_17(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -4138,7 +4396,7 @@ async def test_path_params_edit_overload_16(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_17(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_18(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4148,7 +4406,7 @@ async def test_method_edit_overload_17(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_17(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_18(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4162,7 +4420,7 @@ async def test_raw_response_edit_overload_17(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_17(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_18(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4178,7 +4436,7 @@ async def test_streaming_response_edit_overload_17(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_17(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_18(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -4196,7 +4454,7 @@ async def test_path_params_edit_overload_17(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_18(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_19(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4206,7 +4464,7 @@ async def test_method_edit_overload_18(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_18(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_19(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4220,7 +4478,7 @@ async def test_raw_response_edit_overload_18(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_18(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_19(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4236,7 +4494,7 @@ async def test_streaming_response_edit_overload_18(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_18(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_19(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -4254,7 +4512,7 @@ async def test_path_params_edit_overload_18(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_19(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_20(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4264,7 +4522,7 @@ async def test_method_edit_overload_19(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_19(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_20(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4278,7 +4536,7 @@ async def test_raw_response_edit_overload_19(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_19(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_20(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4294,7 +4552,7 @@ async def test_streaming_response_edit_overload_19(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_19(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_20(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -4312,7 +4570,7 @@ async def test_path_params_edit_overload_19(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_20(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_21(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4322,7 +4580,7 @@ async def test_method_edit_overload_20(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_20(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_21(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4336,7 +4594,7 @@ async def test_raw_response_edit_overload_20(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_20(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_21(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4352,7 +4610,7 @@ async def test_streaming_response_edit_overload_20(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_20(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_21(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -4370,7 +4628,7 @@ async def test_path_params_edit_overload_20(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_21(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_22(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4380,7 +4638,7 @@ async def test_method_edit_overload_21(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_21(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_22(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4394,7 +4652,7 @@ async def test_raw_response_edit_overload_21(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_21(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_22(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4410,7 +4668,7 @@ async def test_streaming_response_edit_overload_21(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_21(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_22(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -4428,7 +4686,7 @@ async def test_path_params_edit_overload_21(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_22(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_23(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4438,7 +4696,7 @@ async def test_method_edit_overload_22(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_22(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_23(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4452,7 +4710,7 @@ async def test_raw_response_edit_overload_22(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_22(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_23(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4468,7 +4726,7 @@ async def test_streaming_response_edit_overload_22(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_22(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_23(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -4486,7 +4744,7 @@ async def test_path_params_edit_overload_22(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_23(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_24(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4496,7 +4754,7 @@ async def test_method_edit_overload_23(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_23(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_24(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4510,7 +4768,7 @@ async def test_raw_response_edit_overload_23(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_23(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_24(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4526,7 +4784,7 @@ async def test_streaming_response_edit_overload_23(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_23(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_24(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -4544,7 +4802,7 @@ async def test_path_params_edit_overload_23(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_24(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_25(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4554,7 +4812,7 @@ async def test_method_edit_overload_24(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_24(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_25(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4568,7 +4826,7 @@ async def test_raw_response_edit_overload_24(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_24(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_25(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4584,7 +4842,7 @@ async def test_streaming_response_edit_overload_24(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_24(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_25(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -4602,7 +4860,7 @@ async def test_path_params_edit_overload_24(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_25(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_26(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4612,7 +4870,7 @@ async def test_method_edit_overload_25(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_25(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_26(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4626,7 +4884,7 @@ async def test_raw_response_edit_overload_25(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_25(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_26(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4642,7 +4900,7 @@ async def test_streaming_response_edit_overload_25(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_25(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_26(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -4660,7 +4918,7 @@ async def test_path_params_edit_overload_25(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_26(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_27(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4670,7 +4928,7 @@ async def test_method_edit_overload_26(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_26(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_27(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4684,7 +4942,7 @@ async def test_raw_response_edit_overload_26(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_26(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_27(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4700,7 +4958,7 @@ async def test_streaming_response_edit_overload_26(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_26(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_27(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -4718,7 +4976,7 @@ async def test_path_params_edit_overload_26(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_27(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_28(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4728,7 +4986,7 @@ async def test_method_edit_overload_27(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_method_edit_with_all_params_overload_27(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_with_all_params_overload_28(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4738,7 +4996,7 @@ async def test_method_edit_with_all_params_overload_27(self, async_client: Async assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_27(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_28(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4752,7 +5010,7 @@ async def test_raw_response_edit_overload_27(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_27(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_28(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -4768,7 +5026,7 @@ async def test_streaming_response_edit_overload_27(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_27(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_28(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -4781,26 +5039,142 @@ async def test_path_params_edit_overload_27(self, async_client: AsyncCloudflare) await async_client.zones.settings.with_raw_response.edit( setting_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="nel", - value={}, + id="nel", + value={}, + ) + + @parametrize + async def test_method_edit_overload_29(self, async_client: AsyncCloudflare) -> None: + setting = await async_client.zones.settings.edit( + setting_id="always_online", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="opportunistic_encryption", + value="on", + ) + assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) + + @parametrize + async def test_raw_response_edit_overload_29(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zones.settings.with_raw_response.edit( + setting_id="always_online", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="opportunistic_encryption", + value="on", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + setting = await response.parse() + assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) + + @parametrize + async def test_streaming_response_edit_overload_29(self, async_client: AsyncCloudflare) -> None: + async with async_client.zones.settings.with_streaming_response.edit( + setting_id="always_online", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="opportunistic_encryption", + value="on", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + setting = await response.parse() + assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_edit_overload_29(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zones.settings.with_raw_response.edit( + setting_id="always_online", + zone_id="", + id="opportunistic_encryption", + value="on", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"): + await async_client.zones.settings.with_raw_response.edit( + setting_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="opportunistic_encryption", + value="on", + ) + + @parametrize + async def test_method_edit_overload_30(self, async_client: AsyncCloudflare) -> None: + setting = await async_client.zones.settings.edit( + setting_id="always_online", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="opportunistic_onion", + value="on", + ) + assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) + + @parametrize + async def test_raw_response_edit_overload_30(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zones.settings.with_raw_response.edit( + setting_id="always_online", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="opportunistic_onion", + value="on", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + setting = await response.parse() + assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) + + @parametrize + async def test_streaming_response_edit_overload_30(self, async_client: AsyncCloudflare) -> None: + async with async_client.zones.settings.with_streaming_response.edit( + setting_id="always_online", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="opportunistic_onion", + value="on", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + setting = await response.parse() + assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_edit_overload_30(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zones.settings.with_raw_response.edit( + setting_id="always_online", + zone_id="", + id="opportunistic_onion", + value="on", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"): + await async_client.zones.settings.with_raw_response.edit( + setting_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="opportunistic_onion", + value="on", ) @parametrize - async def test_method_edit_overload_28(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_31(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="opportunistic_encryption", + id="orange_to_orange", value="on", ) assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_28(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_31(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="opportunistic_encryption", + id="orange_to_orange", value="on", ) @@ -4810,11 +5184,11 @@ async def test_raw_response_edit_overload_28(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_28(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_31(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="opportunistic_encryption", + id="orange_to_orange", value="on", ) as response: assert not response.is_closed @@ -4826,12 +5200,12 @@ async def test_streaming_response_edit_overload_28(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_28(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_31(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="", - id="opportunistic_encryption", + id="orange_to_orange", value="on", ) @@ -4839,26 +5213,26 @@ async def test_path_params_edit_overload_28(self, async_client: AsyncCloudflare) await async_client.zones.settings.with_raw_response.edit( setting_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="opportunistic_encryption", + id="orange_to_orange", value="on", ) @parametrize - async def test_method_edit_overload_29(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_32(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="opportunistic_onion", + id="origin_error_page_pass_thru", value="on", ) assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_29(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_32(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="opportunistic_onion", + id="origin_error_page_pass_thru", value="on", ) @@ -4868,11 +5242,11 @@ async def test_raw_response_edit_overload_29(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_29(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_32(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="opportunistic_onion", + id="origin_error_page_pass_thru", value="on", ) as response: assert not response.is_closed @@ -4884,12 +5258,12 @@ async def test_streaming_response_edit_overload_29(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_29(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_32(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="", - id="opportunistic_onion", + id="origin_error_page_pass_thru", value="on", ) @@ -4897,27 +5271,35 @@ async def test_path_params_edit_overload_29(self, async_client: AsyncCloudflare) await async_client.zones.settings.with_raw_response.edit( setting_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="opportunistic_onion", + id="origin_error_page_pass_thru", value="on", ) @parametrize - async def test_method_edit_overload_30(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_33(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="orange_to_orange", - value="on", + id="origin_h2_max_streams", ) assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_30(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_with_all_params_overload_33(self, async_client: AsyncCloudflare) -> None: + setting = await async_client.zones.settings.edit( + setting_id="always_online", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="origin_h2_max_streams", + value=50, + ) + assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) + + @parametrize + async def test_raw_response_edit_overload_33(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="orange_to_orange", - value="on", + id="origin_h2_max_streams", ) assert response.is_closed is True @@ -4926,12 +5308,11 @@ async def test_raw_response_edit_overload_30(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_30(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_33(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="orange_to_orange", - value="on", + id="origin_h2_max_streams", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -4942,40 +5323,46 @@ async def test_streaming_response_edit_overload_30(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_30(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_33(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="", - id="orange_to_orange", - value="on", + id="origin_h2_max_streams", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="orange_to_orange", - value="on", + id="origin_h2_max_streams", ) @parametrize - async def test_method_edit_overload_31(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_34(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="origin_error_page_pass_thru", - value="on", + id="origin_max_http_version", ) assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_31(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_with_all_params_overload_34(self, async_client: AsyncCloudflare) -> None: + setting = await async_client.zones.settings.edit( + setting_id="always_online", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="origin_max_http_version", + value="2", + ) + assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) + + @parametrize + async def test_raw_response_edit_overload_34(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="origin_error_page_pass_thru", - value="on", + id="origin_max_http_version", ) assert response.is_closed is True @@ -4984,12 +5371,11 @@ async def test_raw_response_edit_overload_31(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_31(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_34(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="origin_error_page_pass_thru", - value="on", + id="origin_max_http_version", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -5000,25 +5386,23 @@ async def test_streaming_response_edit_overload_31(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_31(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_34(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="", - id="origin_error_page_pass_thru", - value="on", + id="origin_max_http_version", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="origin_error_page_pass_thru", - value="on", + id="origin_max_http_version", ) @parametrize - async def test_method_edit_overload_32(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_35(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5028,7 +5412,7 @@ async def test_method_edit_overload_32(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_32(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_35(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5042,7 +5426,7 @@ async def test_raw_response_edit_overload_32(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_32(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_35(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5058,7 +5442,7 @@ async def test_streaming_response_edit_overload_32(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_32(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_35(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -5076,7 +5460,7 @@ async def test_path_params_edit_overload_32(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_33(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_36(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5086,7 +5470,7 @@ async def test_method_edit_overload_33(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_33(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_36(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5100,7 +5484,7 @@ async def test_raw_response_edit_overload_33(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_33(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_36(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5116,7 +5500,7 @@ async def test_streaming_response_edit_overload_33(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_33(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_36(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -5134,7 +5518,7 @@ async def test_path_params_edit_overload_33(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_34(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_37(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5144,7 +5528,7 @@ async def test_method_edit_overload_34(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_34(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_37(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5158,7 +5542,7 @@ async def test_raw_response_edit_overload_34(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_34(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_37(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5174,7 +5558,7 @@ async def test_streaming_response_edit_overload_34(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_34(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_37(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -5192,7 +5576,7 @@ async def test_path_params_edit_overload_34(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_35(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_38(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5202,7 +5586,7 @@ async def test_method_edit_overload_35(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_35(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_38(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5216,7 +5600,7 @@ async def test_raw_response_edit_overload_35(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_35(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_38(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5232,7 +5616,7 @@ async def test_streaming_response_edit_overload_35(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_35(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_38(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -5250,7 +5634,7 @@ async def test_path_params_edit_overload_35(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_36(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_39(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5260,7 +5644,7 @@ async def test_method_edit_overload_36(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_36(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_39(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5274,7 +5658,7 @@ async def test_raw_response_edit_overload_36(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_36(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_39(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5290,7 +5674,7 @@ async def test_streaming_response_edit_overload_36(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_36(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_39(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -5308,7 +5692,7 @@ async def test_path_params_edit_overload_36(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_37(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_40(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5318,7 +5702,7 @@ async def test_method_edit_overload_37(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_37(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_40(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5332,7 +5716,7 @@ async def test_raw_response_edit_overload_37(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_37(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_40(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5348,7 +5732,7 @@ async def test_streaming_response_edit_overload_37(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_37(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_40(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -5366,7 +5750,7 @@ async def test_path_params_edit_overload_37(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_38(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_41(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5376,7 +5760,7 @@ async def test_method_edit_overload_38(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_38(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_41(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5390,7 +5774,7 @@ async def test_raw_response_edit_overload_38(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_38(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_41(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5406,7 +5790,7 @@ async def test_streaming_response_edit_overload_38(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_38(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_41(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -5424,7 +5808,7 @@ async def test_path_params_edit_overload_38(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_39(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_42(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5441,7 +5825,7 @@ async def test_method_edit_overload_39(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_39(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_42(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5462,7 +5846,7 @@ async def test_raw_response_edit_overload_39(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_39(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_42(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5485,7 +5869,7 @@ async def test_streaming_response_edit_overload_39(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_39(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_42(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -5517,7 +5901,7 @@ async def test_path_params_edit_overload_39(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_40(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_43(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5527,7 +5911,7 @@ async def test_method_edit_overload_40(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_method_edit_with_all_params_overload_40(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_with_all_params_overload_43(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5545,7 +5929,7 @@ async def test_method_edit_with_all_params_overload_40(self, async_client: Async assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_40(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_43(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5559,7 +5943,7 @@ async def test_raw_response_edit_overload_40(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_40(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_43(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5575,7 +5959,7 @@ async def test_streaming_response_edit_overload_40(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_40(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_43(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -5593,7 +5977,7 @@ async def test_path_params_edit_overload_40(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_41(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_44(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5603,7 +5987,7 @@ async def test_method_edit_overload_41(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_41(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_44(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5617,7 +6001,7 @@ async def test_raw_response_edit_overload_41(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_41(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_44(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5633,7 +6017,7 @@ async def test_streaming_response_edit_overload_41(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_41(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_44(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -5651,7 +6035,7 @@ async def test_path_params_edit_overload_41(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_42(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_45(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5661,7 +6045,7 @@ async def test_method_edit_overload_42(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_42(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_45(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5675,7 +6059,7 @@ async def test_raw_response_edit_overload_42(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_42(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_45(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5691,7 +6075,7 @@ async def test_streaming_response_edit_overload_42(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_42(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_45(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -5709,7 +6093,7 @@ async def test_path_params_edit_overload_42(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_43(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_46(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5719,7 +6103,7 @@ async def test_method_edit_overload_43(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_43(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_46(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5733,7 +6117,7 @@ async def test_raw_response_edit_overload_43(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_43(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_46(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5749,7 +6133,7 @@ async def test_streaming_response_edit_overload_43(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_43(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_46(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -5767,7 +6151,7 @@ async def test_path_params_edit_overload_43(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_44(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_47(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5777,7 +6161,7 @@ async def test_method_edit_overload_44(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_44(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_47(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5791,7 +6175,7 @@ async def test_raw_response_edit_overload_44(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_44(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_47(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5807,7 +6191,7 @@ async def test_streaming_response_edit_overload_44(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_44(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_47(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -5825,7 +6209,7 @@ async def test_path_params_edit_overload_44(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_45(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_48(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5835,7 +6219,7 @@ async def test_method_edit_overload_45(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_45(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_48(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5849,7 +6233,7 @@ async def test_raw_response_edit_overload_45(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_45(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_48(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5865,7 +6249,7 @@ async def test_streaming_response_edit_overload_45(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_45(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_48(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -5883,7 +6267,7 @@ async def test_path_params_edit_overload_45(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_46(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_49(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5891,7 +6275,7 @@ async def test_method_edit_overload_46(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_method_edit_with_all_params_overload_46(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_with_all_params_overload_49(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5901,7 +6285,7 @@ async def test_method_edit_with_all_params_overload_46(self, async_client: Async assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_46(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_49(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5913,7 +6297,7 @@ async def test_raw_response_edit_overload_46(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_46(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_49(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5927,7 +6311,7 @@ async def test_streaming_response_edit_overload_46(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_46(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_49(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -5941,7 +6325,7 @@ async def test_path_params_edit_overload_46(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_47(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_50(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5951,7 +6335,7 @@ async def test_method_edit_overload_47(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_47(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_50(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5965,7 +6349,7 @@ async def test_raw_response_edit_overload_47(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_47(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_50(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5981,7 +6365,7 @@ async def test_streaming_response_edit_overload_47(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_47(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_50(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -5999,7 +6383,7 @@ async def test_path_params_edit_overload_47(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_48(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_51(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6009,7 +6393,7 @@ async def test_method_edit_overload_48(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_48(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_51(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6023,7 +6407,7 @@ async def test_raw_response_edit_overload_48(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_48(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_51(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6039,7 +6423,7 @@ async def test_streaming_response_edit_overload_48(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_48(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_51(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -6057,7 +6441,7 @@ async def test_path_params_edit_overload_48(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_49(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_52(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6067,7 +6451,7 @@ async def test_method_edit_overload_49(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_49(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_52(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6081,7 +6465,7 @@ async def test_raw_response_edit_overload_49(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_49(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_52(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6097,7 +6481,7 @@ async def test_streaming_response_edit_overload_49(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_49(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_52(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -6115,7 +6499,7 @@ async def test_path_params_edit_overload_49(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_50(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_53(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6125,7 +6509,7 @@ async def test_method_edit_overload_50(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_50(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_53(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6139,7 +6523,7 @@ async def test_raw_response_edit_overload_50(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_50(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_53(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6155,7 +6539,7 @@ async def test_streaming_response_edit_overload_50(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_50(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_53(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -6173,7 +6557,7 @@ async def test_path_params_edit_overload_50(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_51(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_54(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6183,7 +6567,7 @@ async def test_method_edit_overload_51(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_51(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_54(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6197,7 +6581,7 @@ async def test_raw_response_edit_overload_51(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_51(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_54(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6213,7 +6597,7 @@ async def test_streaming_response_edit_overload_51(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_51(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_54(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -6231,7 +6615,7 @@ async def test_path_params_edit_overload_51(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_52(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_55(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6241,7 +6625,7 @@ async def test_method_edit_overload_52(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_52(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_55(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6255,7 +6639,7 @@ async def test_raw_response_edit_overload_52(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_52(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_55(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6271,7 +6655,7 @@ async def test_streaming_response_edit_overload_52(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_52(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_55(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -6289,7 +6673,7 @@ async def test_path_params_edit_overload_52(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_53(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_56(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6299,7 +6683,7 @@ async def test_method_edit_overload_53(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_53(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_56(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6313,7 +6697,7 @@ async def test_raw_response_edit_overload_53(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_53(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_56(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6329,7 +6713,7 @@ async def test_streaming_response_edit_overload_53(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_53(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_56(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", From 58c37196749e1c0185971353e498be1d01e018cc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 20 Jan 2025 06:05:52 +0000 Subject: [PATCH 018/358] chore(internal): codegen related update (#2377) --- tests/api_resources/zero_trust/tunnels/test_configurations.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/api_resources/zero_trust/tunnels/test_configurations.py b/tests/api_resources/zero_trust/tunnels/test_configurations.py index eb601aa3bbc..df4e73e663f 100644 --- a/tests/api_resources/zero_trust/tunnels/test_configurations.py +++ b/tests/api_resources/zero_trust/tunnels/test_configurations.py @@ -81,6 +81,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "tcp_keep_alive": 0, "tls_timeout": 0, }, + "warp_routing": {"enabled": True}, }, ) assert_matches_type(Optional[ConfigurationUpdateResponse], configuration, path=["response"]) @@ -238,6 +239,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "tcp_keep_alive": 0, "tls_timeout": 0, }, + "warp_routing": {"enabled": True}, }, ) assert_matches_type(Optional[ConfigurationUpdateResponse], configuration, path=["response"]) From 3b33306186b533706072a704da897147c365c793 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 20 Jan 2025 06:28:19 +0000 Subject: [PATCH 019/358] chore(internal): codegen related update (#2378) --- api.md | 2 +- .../resources/resource_sharing/recipients.py | 32 ++++++++--------- .../zero_trust/organizations/organizations.py | 24 ++++++------- .../recipient_create_params.py | 4 +-- .../organization_revoke_users_params.py | 4 +-- .../resource_sharing/test_recipients.py | 36 +++++++++---------- .../zero_trust/test_organizations.py | 8 ++--- 7 files changed, 55 insertions(+), 55 deletions(-) diff --git a/api.md b/api.md index 32d555aac3a..a037b01601c 100644 --- a/api.md +++ b/api.md @@ -8405,7 +8405,7 @@ from cloudflare.types.resource_sharing import ( Methods: -- client.resource_sharing.recipients.create(share_id, \*, path_account_id, \*\*params) -> Optional[RecipientCreateResponse] +- client.resource_sharing.recipients.create(share_id, \*, account_id_1, \*\*params) -> Optional[RecipientCreateResponse] - client.resource_sharing.recipients.list(share_id, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[RecipientListResponse] - client.resource_sharing.recipients.delete(recipient_id, \*, account_id, share_id) -> Optional[RecipientDeleteResponse] - client.resource_sharing.recipients.get(recipient_id, \*, account_id, share_id) -> Optional[RecipientGetResponse] diff --git a/src/cloudflare/resources/resource_sharing/recipients.py b/src/cloudflare/resources/resource_sharing/recipients.py index 396111d8ca4..df13e5c8e5d 100644 --- a/src/cloudflare/resources/resource_sharing/recipients.py +++ b/src/cloudflare/resources/resource_sharing/recipients.py @@ -55,8 +55,8 @@ def create( self, share_id: str, *, - path_account_id: str, - body_account_id: str | NotGiven = NOT_GIVEN, + account_id_1: str, + account_id_2: str | NotGiven = NOT_GIVEN, organization_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -69,11 +69,11 @@ def create( Create a new share recipient Args: - path_account_id: Account identifier. + account_id_1: Account identifier. share_id: Share identifier tag. - body_account_id: Account identifier. + account_id_2: Account identifier. organization_id: Organization identifier. @@ -85,15 +85,15 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if not path_account_id: - raise ValueError(f"Expected a non-empty value for `path_account_id` but received {path_account_id!r}") + if not account_id_1: + raise ValueError(f"Expected a non-empty value for `account_id_1` but received {account_id_1!r}") if not share_id: raise ValueError(f"Expected a non-empty value for `share_id` but received {share_id!r}") return self._post( - f"/accounts/{path_account_id}/shares/{share_id}/recipients", + f"/accounts/{account_id_1}/shares/{share_id}/recipients", body=maybe_transform( { - "body_account_id": body_account_id, + "account_id_2": account_id_2, "organization_id": organization_id, }, recipient_create_params.RecipientCreateParams, @@ -289,8 +289,8 @@ async def create( self, share_id: str, *, - path_account_id: str, - body_account_id: str | NotGiven = NOT_GIVEN, + account_id_1: str, + account_id_2: str | NotGiven = NOT_GIVEN, organization_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -303,11 +303,11 @@ async def create( Create a new share recipient Args: - path_account_id: Account identifier. + account_id_1: Account identifier. share_id: Share identifier tag. - body_account_id: Account identifier. + account_id_2: Account identifier. organization_id: Organization identifier. @@ -319,15 +319,15 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if not path_account_id: - raise ValueError(f"Expected a non-empty value for `path_account_id` but received {path_account_id!r}") + if not account_id_1: + raise ValueError(f"Expected a non-empty value for `account_id_1` but received {account_id_1!r}") if not share_id: raise ValueError(f"Expected a non-empty value for `share_id` but received {share_id!r}") return await self._post( - f"/accounts/{path_account_id}/shares/{share_id}/recipients", + f"/accounts/{account_id_1}/shares/{share_id}/recipients", body=await async_maybe_transform( { - "body_account_id": body_account_id, + "account_id_2": account_id_2, "organization_id": organization_id, }, recipient_create_params.RecipientCreateParams, diff --git a/src/cloudflare/resources/zero_trust/organizations/organizations.py b/src/cloudflare/resources/zero_trust/organizations/organizations.py index 8590795d427..11d6d12ee6b 100644 --- a/src/cloudflare/resources/zero_trust/organizations/organizations.py +++ b/src/cloudflare/resources/zero_trust/organizations/organizations.py @@ -335,8 +335,8 @@ def revoke_users( email: str, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, - query_devices: bool | NotGiven = NOT_GIVEN, - body_devices: bool | NotGiven = NOT_GIVEN, + devices_1: bool | NotGiven = NOT_GIVEN, + devices_2: bool | NotGiven = NOT_GIVEN, user_uid: str | NotGiven = NOT_GIVEN, warp_session_reauth: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -356,9 +356,9 @@ def revoke_users( zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. - query_devices: When set to `true`, all devices associated with the user will be revoked. + devices_1: When set to `true`, all devices associated with the user will be revoked. - body_devices: When set to `true`, all devices associated with the user will be revoked. + devices_2: When set to `true`, all devices associated with the user will be revoked. user_uid: The uuid of the user to revoke. @@ -391,7 +391,7 @@ def revoke_users( body=maybe_transform( { "email": email, - "body_devices": body_devices, + "devices_2": devices_2, "user_uid": user_uid, "warp_session_reauth": warp_session_reauth, }, @@ -403,7 +403,7 @@ def revoke_users( extra_body=extra_body, timeout=timeout, query=maybe_transform( - {"query_devices": query_devices}, organization_revoke_users_params.OrganizationRevokeUsersParams + {"devices_1": devices_1}, organization_revoke_users_params.OrganizationRevokeUsersParams ), post_parser=ResultWrapper[Optional[OrganizationRevokeUsersResponse]]._unwrapper, ), @@ -707,8 +707,8 @@ async def revoke_users( email: str, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, - query_devices: bool | NotGiven = NOT_GIVEN, - body_devices: bool | NotGiven = NOT_GIVEN, + devices_1: bool | NotGiven = NOT_GIVEN, + devices_2: bool | NotGiven = NOT_GIVEN, user_uid: str | NotGiven = NOT_GIVEN, warp_session_reauth: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -728,9 +728,9 @@ async def revoke_users( zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. - query_devices: When set to `true`, all devices associated with the user will be revoked. + devices_1: When set to `true`, all devices associated with the user will be revoked. - body_devices: When set to `true`, all devices associated with the user will be revoked. + devices_2: When set to `true`, all devices associated with the user will be revoked. user_uid: The uuid of the user to revoke. @@ -763,7 +763,7 @@ async def revoke_users( body=await async_maybe_transform( { "email": email, - "body_devices": body_devices, + "devices_2": devices_2, "user_uid": user_uid, "warp_session_reauth": warp_session_reauth, }, @@ -775,7 +775,7 @@ async def revoke_users( extra_body=extra_body, timeout=timeout, query=await async_maybe_transform( - {"query_devices": query_devices}, organization_revoke_users_params.OrganizationRevokeUsersParams + {"devices_1": devices_1}, organization_revoke_users_params.OrganizationRevokeUsersParams ), post_parser=ResultWrapper[Optional[OrganizationRevokeUsersResponse]]._unwrapper, ), diff --git a/src/cloudflare/types/resource_sharing/recipient_create_params.py b/src/cloudflare/types/resource_sharing/recipient_create_params.py index 58b143bcada..5e3ad6609ab 100644 --- a/src/cloudflare/types/resource_sharing/recipient_create_params.py +++ b/src/cloudflare/types/resource_sharing/recipient_create_params.py @@ -10,10 +10,10 @@ class RecipientCreateParams(TypedDict, total=False): - path_account_id: Required[Annotated[str, PropertyInfo(alias="account_id")]] + account_id_1: Required[Annotated[str, PropertyInfo(alias="account_id")]] """Account identifier.""" - body_account_id: Annotated[str, PropertyInfo(alias="account_id")] + account_id_2: Annotated[str, PropertyInfo(alias="account_id")] """Account identifier.""" organization_id: str diff --git a/src/cloudflare/types/zero_trust/organization_revoke_users_params.py b/src/cloudflare/types/zero_trust/organization_revoke_users_params.py index d9467bcd648..819fbb33331 100644 --- a/src/cloudflare/types/zero_trust/organization_revoke_users_params.py +++ b/src/cloudflare/types/zero_trust/organization_revoke_users_params.py @@ -19,10 +19,10 @@ class OrganizationRevokeUsersParams(TypedDict, total=False): zone_id: str """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" - query_devices: Annotated[bool, PropertyInfo(alias="devices")] + devices_1: Annotated[bool, PropertyInfo(alias="devices")] """When set to `true`, all devices associated with the user will be revoked.""" - body_devices: Annotated[bool, PropertyInfo(alias="devices")] + devices_2: Annotated[bool, PropertyInfo(alias="devices")] """When set to `true`, all devices associated with the user will be revoked.""" user_uid: str diff --git a/tests/api_resources/resource_sharing/test_recipients.py b/tests/api_resources/resource_sharing/test_recipients.py index 15de2199620..a1e665de8b4 100644 --- a/tests/api_resources/resource_sharing/test_recipients.py +++ b/tests/api_resources/resource_sharing/test_recipients.py @@ -27,7 +27,7 @@ class TestRecipients: def test_method_create(self, client: Cloudflare) -> None: recipient = client.resource_sharing.recipients.create( share_id="3fd85f74b32742f1bff64a85009dda07", - path_account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id_1="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[RecipientCreateResponse], recipient, path=["response"]) @@ -35,8 +35,8 @@ def test_method_create(self, client: Cloudflare) -> None: def test_method_create_with_all_params(self, client: Cloudflare) -> None: recipient = client.resource_sharing.recipients.create( share_id="3fd85f74b32742f1bff64a85009dda07", - path_account_id="023e105f4ecef8ad9ca31a8372d0c353", - body_account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id_1="023e105f4ecef8ad9ca31a8372d0c353", + account_id_2="023e105f4ecef8ad9ca31a8372d0c353", organization_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[RecipientCreateResponse], recipient, path=["response"]) @@ -45,7 +45,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_create(self, client: Cloudflare) -> None: response = client.resource_sharing.recipients.with_raw_response.create( share_id="3fd85f74b32742f1bff64a85009dda07", - path_account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id_1="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -57,7 +57,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: def test_streaming_response_create(self, client: Cloudflare) -> None: with client.resource_sharing.recipients.with_streaming_response.create( share_id="3fd85f74b32742f1bff64a85009dda07", - path_account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id_1="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -69,17 +69,17 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: @parametrize def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_account_id` but received ''"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id_1` but received ''"): client.resource_sharing.recipients.with_raw_response.create( share_id="3fd85f74b32742f1bff64a85009dda07", - path_account_id="", - body_account_id="", + account_id_1="", + account_id_2="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `share_id` but received ''"): client.resource_sharing.recipients.with_raw_response.create( share_id="", - path_account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id_1="023e105f4ecef8ad9ca31a8372d0c353", ) @parametrize @@ -268,7 +268,7 @@ class TestAsyncRecipients: async def test_method_create(self, async_client: AsyncCloudflare) -> None: recipient = await async_client.resource_sharing.recipients.create( share_id="3fd85f74b32742f1bff64a85009dda07", - path_account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id_1="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[RecipientCreateResponse], recipient, path=["response"]) @@ -276,8 +276,8 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: recipient = await async_client.resource_sharing.recipients.create( share_id="3fd85f74b32742f1bff64a85009dda07", - path_account_id="023e105f4ecef8ad9ca31a8372d0c353", - body_account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id_1="023e105f4ecef8ad9ca31a8372d0c353", + account_id_2="023e105f4ecef8ad9ca31a8372d0c353", organization_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[RecipientCreateResponse], recipient, path=["response"]) @@ -286,7 +286,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.resource_sharing.recipients.with_raw_response.create( share_id="3fd85f74b32742f1bff64a85009dda07", - path_account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id_1="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -298,7 +298,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.resource_sharing.recipients.with_streaming_response.create( share_id="3fd85f74b32742f1bff64a85009dda07", - path_account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id_1="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -310,17 +310,17 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> @parametrize async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_account_id` but received ''"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id_1` but received ''"): await async_client.resource_sharing.recipients.with_raw_response.create( share_id="3fd85f74b32742f1bff64a85009dda07", - path_account_id="", - body_account_id="", + account_id_1="", + account_id_2="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `share_id` but received ''"): await async_client.resource_sharing.recipients.with_raw_response.create( share_id="", - path_account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id_1="023e105f4ecef8ad9ca31a8372d0c353", ) @parametrize diff --git a/tests/api_resources/zero_trust/test_organizations.py b/tests/api_resources/zero_trust/test_organizations.py index fb6bc127b49..b88937228fd 100644 --- a/tests/api_resources/zero_trust/test_organizations.py +++ b/tests/api_resources/zero_trust/test_organizations.py @@ -246,8 +246,8 @@ def test_method_revoke_users_with_all_params(self, client: Cloudflare) -> None: organization = client.zero_trust.organizations.revoke_users( email="test@example.com", account_id="account_id", - query_devices=True, - body_devices=True, + devices_1=True, + devices_2=True, user_uid="699d98642c564d2e855e9661899b7252", warp_session_reauth=True, ) @@ -526,8 +526,8 @@ async def test_method_revoke_users_with_all_params(self, async_client: AsyncClou organization = await async_client.zero_trust.organizations.revoke_users( email="test@example.com", account_id="account_id", - query_devices=True, - body_devices=True, + devices_1=True, + devices_2=True, user_uid="699d98642c564d2e855e9661899b7252", warp_session_reauth=True, ) From 89cf0735bdfea06565243afd1c909724098d0523 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 20 Jan 2025 10:10:47 +0000 Subject: [PATCH 020/358] docs(raw responses): fix duplicate `the` (#2379) --- src/cloudflare/resources/abuse_reports.py | 4 ++-- src/cloudflare/resources/accounts/accounts.py | 4 ++-- src/cloudflare/resources/accounts/logs/audit.py | 4 ++-- src/cloudflare/resources/accounts/logs/logs.py | 4 ++-- src/cloudflare/resources/accounts/members.py | 4 ++-- src/cloudflare/resources/accounts/roles.py | 4 ++-- src/cloudflare/resources/accounts/subscriptions.py | 4 ++-- src/cloudflare/resources/accounts/tokens/permission_groups.py | 4 ++-- src/cloudflare/resources/accounts/tokens/tokens.py | 4 ++-- src/cloudflare/resources/accounts/tokens/value.py | 4 ++-- src/cloudflare/resources/acm/acm.py | 4 ++-- src/cloudflare/resources/acm/total_tls.py | 4 ++-- src/cloudflare/resources/addressing/address_maps/accounts.py | 4 ++-- .../resources/addressing/address_maps/address_maps.py | 4 ++-- src/cloudflare/resources/addressing/address_maps/ips.py | 4 ++-- src/cloudflare/resources/addressing/address_maps/zones.py | 4 ++-- src/cloudflare/resources/addressing/addressing.py | 4 ++-- src/cloudflare/resources/addressing/loa_documents.py | 4 ++-- .../resources/addressing/prefixes/advertisement_status.py | 4 ++-- src/cloudflare/resources/addressing/prefixes/bgp_prefixes.py | 4 ++-- src/cloudflare/resources/addressing/prefixes/delegations.py | 4 ++-- src/cloudflare/resources/addressing/prefixes/prefixes.py | 4 ++-- .../resources/addressing/prefixes/service_bindings.py | 4 ++-- .../addressing/regional_hostnames/regional_hostnames.py | 4 ++-- .../resources/addressing/regional_hostnames/regions.py | 4 ++-- src/cloudflare/resources/addressing/services.py | 4 ++-- src/cloudflare/resources/ai/ai.py | 4 ++-- src/cloudflare/resources/ai/authors.py | 4 ++-- src/cloudflare/resources/ai/finetunes/assets.py | 4 ++-- src/cloudflare/resources/ai/finetunes/finetunes.py | 4 ++-- src/cloudflare/resources/ai/finetunes/public.py | 4 ++-- src/cloudflare/resources/ai/models/models.py | 4 ++-- src/cloudflare/resources/ai/models/schema.py | 4 ++-- src/cloudflare/resources/ai/tasks.py | 4 ++-- src/cloudflare/resources/ai_gateway/ai_gateway.py | 4 ++-- src/cloudflare/resources/ai_gateway/datasets.py | 4 ++-- src/cloudflare/resources/ai_gateway/evaluation_types.py | 4 ++-- src/cloudflare/resources/ai_gateway/evaluations.py | 4 ++-- src/cloudflare/resources/ai_gateway/logs.py | 4 ++-- src/cloudflare/resources/alerting/alerting.py | 4 ++-- src/cloudflare/resources/alerting/available_alerts.py | 4 ++-- .../resources/alerting/destinations/destinations.py | 4 ++-- src/cloudflare/resources/alerting/destinations/eligible.py | 4 ++-- src/cloudflare/resources/alerting/destinations/pagerduty.py | 4 ++-- src/cloudflare/resources/alerting/destinations/webhooks.py | 4 ++-- src/cloudflare/resources/alerting/history.py | 4 ++-- src/cloudflare/resources/alerting/policies.py | 4 ++-- src/cloudflare/resources/api_gateway/api_gateway.py | 4 ++-- src/cloudflare/resources/api_gateway/configurations.py | 4 ++-- src/cloudflare/resources/api_gateway/discovery/discovery.py | 4 ++-- src/cloudflare/resources/api_gateway/discovery/operations.py | 4 ++-- .../api_gateway/expression_template/expression_template.py | 4 ++-- .../resources/api_gateway/expression_template/fallthrough.py | 4 ++-- src/cloudflare/resources/api_gateway/operations/operations.py | 4 ++-- .../resources/api_gateway/operations/schema_validation.py | 4 ++-- src/cloudflare/resources/api_gateway/schemas.py | 4 ++-- .../resources/api_gateway/settings/schema_validation.py | 4 ++-- src/cloudflare/resources/api_gateway/settings/settings.py | 4 ++-- src/cloudflare/resources/api_gateway/user_schemas/hosts.py | 4 ++-- .../resources/api_gateway/user_schemas/operations.py | 4 ++-- .../resources/api_gateway/user_schemas/user_schemas.py | 4 ++-- src/cloudflare/resources/argo/argo.py | 4 ++-- src/cloudflare/resources/argo/smart_routing.py | 4 ++-- src/cloudflare/resources/argo/tiered_caching.py | 4 ++-- src/cloudflare/resources/audit_logs.py | 4 ++-- src/cloudflare/resources/billing/billing.py | 4 ++-- src/cloudflare/resources/billing/profiles.py | 4 ++-- src/cloudflare/resources/bot_management.py | 4 ++-- src/cloudflare/resources/botnet_feed/asn.py | 4 ++-- src/cloudflare/resources/botnet_feed/botnet_feed.py | 4 ++-- src/cloudflare/resources/botnet_feed/configs/asn.py | 4 ++-- src/cloudflare/resources/botnet_feed/configs/configs.py | 4 ++-- src/cloudflare/resources/brand_protection.py | 4 ++-- src/cloudflare/resources/cache/cache.py | 4 ++-- src/cloudflare/resources/cache/cache_reserve.py | 4 ++-- src/cloudflare/resources/cache/regional_tiered_cache.py | 4 ++-- src/cloudflare/resources/cache/smart_tiered_cache.py | 4 ++-- src/cloudflare/resources/cache/variants.py | 4 ++-- src/cloudflare/resources/calls/calls.py | 4 ++-- src/cloudflare/resources/calls/sfu.py | 4 ++-- src/cloudflare/resources/calls/turn.py | 4 ++-- .../certificate_authorities/certificate_authorities.py | 4 ++-- .../certificate_authorities/hostname_associations.py | 4 ++-- src/cloudflare/resources/client_certificates.py | 4 ++-- src/cloudflare/resources/cloud_connector/cloud_connector.py | 4 ++-- src/cloudflare/resources/cloud_connector/rules.py | 4 ++-- src/cloudflare/resources/cloudforce_one/cloudforce_one.py | 4 ++-- src/cloudflare/resources/cloudforce_one/requests/assets.py | 4 ++-- src/cloudflare/resources/cloudforce_one/requests/message.py | 4 ++-- src/cloudflare/resources/cloudforce_one/requests/priority.py | 4 ++-- src/cloudflare/resources/cloudforce_one/requests/requests.py | 4 ++-- src/cloudflare/resources/content_scanning/content_scanning.py | 4 ++-- src/cloudflare/resources/content_scanning/payloads.py | 4 ++-- src/cloudflare/resources/content_scanning/settings.py | 4 ++-- .../resources/custom_certificates/custom_certificates.py | 4 ++-- src/cloudflare/resources/custom_certificates/prioritize.py | 4 ++-- src/cloudflare/resources/custom_hostnames/custom_hostnames.py | 4 ++-- src/cloudflare/resources/custom_hostnames/fallback_origin.py | 4 ++-- src/cloudflare/resources/custom_nameservers.py | 4 ++-- src/cloudflare/resources/d1/d1.py | 4 ++-- src/cloudflare/resources/d1/database.py | 4 ++-- src/cloudflare/resources/dcv_delegation.py | 4 ++-- src/cloudflare/resources/diagnostics/diagnostics.py | 4 ++-- src/cloudflare/resources/diagnostics/traceroutes.py | 4 ++-- src/cloudflare/resources/dns/analytics/analytics.py | 4 ++-- src/cloudflare/resources/dns/analytics/reports/bytimes.py | 4 ++-- src/cloudflare/resources/dns/analytics/reports/reports.py | 4 ++-- src/cloudflare/resources/dns/dns.py | 4 ++-- src/cloudflare/resources/dns/dnssec.py | 4 ++-- src/cloudflare/resources/dns/records.py | 4 ++-- src/cloudflare/resources/dns/settings/settings.py | 4 ++-- src/cloudflare/resources/dns/settings/views.py | 4 ++-- src/cloudflare/resources/dns/zone_transfers/acls.py | 4 ++-- src/cloudflare/resources/dns/zone_transfers/force_axfr.py | 4 ++-- src/cloudflare/resources/dns/zone_transfers/incoming.py | 4 ++-- .../resources/dns/zone_transfers/outgoing/outgoing.py | 4 ++-- .../resources/dns/zone_transfers/outgoing/status.py | 4 ++-- src/cloudflare/resources/dns/zone_transfers/peers.py | 4 ++-- src/cloudflare/resources/dns/zone_transfers/tsigs.py | 4 ++-- src/cloudflare/resources/dns/zone_transfers/zone_transfers.py | 4 ++-- src/cloudflare/resources/dns_firewall/analytics/analytics.py | 4 ++-- .../resources/dns_firewall/analytics/reports/bytimes.py | 4 ++-- .../resources/dns_firewall/analytics/reports/reports.py | 4 ++-- src/cloudflare/resources/dns_firewall/dns_firewall.py | 4 ++-- src/cloudflare/resources/dns_firewall/reverse_dns.py | 4 ++-- src/cloudflare/resources/durable_objects/durable_objects.py | 4 ++-- .../resources/durable_objects/namespaces/namespaces.py | 4 ++-- .../resources/durable_objects/namespaces/objects.py | 4 ++-- src/cloudflare/resources/email_routing/addresses.py | 4 ++-- src/cloudflare/resources/email_routing/dns.py | 4 ++-- src/cloudflare/resources/email_routing/email_routing.py | 4 ++-- src/cloudflare/resources/email_routing/rules/catch_alls.py | 4 ++-- src/cloudflare/resources/email_routing/rules/rules.py | 4 ++-- src/cloudflare/resources/email_security/email_security.py | 4 ++-- .../resources/email_security/investigate/detections.py | 4 ++-- .../resources/email_security/investigate/investigate.py | 4 ++-- src/cloudflare/resources/email_security/investigate/move.py | 4 ++-- .../resources/email_security/investigate/preview.py | 4 ++-- src/cloudflare/resources/email_security/investigate/raw.py | 4 ++-- .../resources/email_security/investigate/reclassify.py | 4 ++-- .../resources/email_security/investigate/release.py | 4 ++-- src/cloudflare/resources/email_security/investigate/trace.py | 4 ++-- .../resources/email_security/settings/allow_policies.py | 4 ++-- .../resources/email_security/settings/block_senders.py | 4 ++-- src/cloudflare/resources/email_security/settings/domains.py | 4 ++-- .../email_security/settings/impersonation_registry.py | 4 ++-- src/cloudflare/resources/email_security/settings/settings.py | 4 ++-- .../resources/email_security/settings/trusted_domains.py | 4 ++-- src/cloudflare/resources/email_security/submissions.py | 4 ++-- src/cloudflare/resources/filters.py | 4 ++-- src/cloudflare/resources/firewall/access_rules.py | 4 ++-- src/cloudflare/resources/firewall/firewall.py | 4 ++-- src/cloudflare/resources/firewall/lockdowns.py | 4 ++-- src/cloudflare/resources/firewall/rules.py | 4 ++-- src/cloudflare/resources/firewall/ua_rules.py | 4 ++-- src/cloudflare/resources/firewall/waf/overrides.py | 4 ++-- src/cloudflare/resources/firewall/waf/packages/groups.py | 4 ++-- src/cloudflare/resources/firewall/waf/packages/packages.py | 4 ++-- src/cloudflare/resources/firewall/waf/packages/rules.py | 4 ++-- src/cloudflare/resources/firewall/waf/waf.py | 4 ++-- src/cloudflare/resources/healthchecks/healthchecks.py | 4 ++-- src/cloudflare/resources/healthchecks/previews.py | 4 ++-- src/cloudflare/resources/hostnames/hostnames.py | 4 ++-- src/cloudflare/resources/hostnames/settings/settings.py | 4 ++-- src/cloudflare/resources/hostnames/settings/tls.py | 4 ++-- src/cloudflare/resources/hyperdrive/configs.py | 4 ++-- src/cloudflare/resources/hyperdrive/hyperdrive.py | 4 ++-- src/cloudflare/resources/iam/iam.py | 4 ++-- src/cloudflare/resources/iam/permission_groups.py | 4 ++-- src/cloudflare/resources/iam/resource_groups.py | 4 ++-- src/cloudflare/resources/images/images.py | 4 ++-- src/cloudflare/resources/images/v1/blobs.py | 4 ++-- src/cloudflare/resources/images/v1/keys.py | 4 ++-- src/cloudflare/resources/images/v1/stats.py | 4 ++-- src/cloudflare/resources/images/v1/v1.py | 4 ++-- src/cloudflare/resources/images/v1/variants.py | 4 ++-- src/cloudflare/resources/images/v2/direct_uploads.py | 4 ++-- src/cloudflare/resources/images/v2/v2.py | 4 ++-- src/cloudflare/resources/intel/asn/asn.py | 4 ++-- src/cloudflare/resources/intel/asn/subnets.py | 4 ++-- .../intel/attack_surface_report/attack_surface_report.py | 4 ++-- .../resources/intel/attack_surface_report/issue_types.py | 4 ++-- .../resources/intel/attack_surface_report/issues.py | 4 ++-- src/cloudflare/resources/intel/dns.py | 4 ++-- src/cloudflare/resources/intel/domain_history.py | 4 ++-- src/cloudflare/resources/intel/domains/bulks.py | 4 ++-- src/cloudflare/resources/intel/domains/domains.py | 4 ++-- src/cloudflare/resources/intel/indicator_feeds/downloads.py | 4 ++-- .../resources/intel/indicator_feeds/indicator_feeds.py | 4 ++-- src/cloudflare/resources/intel/indicator_feeds/permissions.py | 4 ++-- src/cloudflare/resources/intel/indicator_feeds/snapshots.py | 4 ++-- src/cloudflare/resources/intel/intel.py | 4 ++-- src/cloudflare/resources/intel/ip_lists.py | 4 ++-- src/cloudflare/resources/intel/ips.py | 4 ++-- src/cloudflare/resources/intel/miscategorizations.py | 4 ++-- src/cloudflare/resources/intel/sinkholes.py | 4 ++-- src/cloudflare/resources/intel/whois.py | 4 ++-- src/cloudflare/resources/ips.py | 4 ++-- src/cloudflare/resources/keyless_certificates.py | 4 ++-- src/cloudflare/resources/kv/kv.py | 4 ++-- src/cloudflare/resources/kv/namespaces/analytics.py | 4 ++-- src/cloudflare/resources/kv/namespaces/keys.py | 4 ++-- src/cloudflare/resources/kv/namespaces/metadata.py | 4 ++-- src/cloudflare/resources/kv/namespaces/namespaces.py | 4 ++-- src/cloudflare/resources/kv/namespaces/values.py | 4 ++-- .../resources/leaked_credential_checks/detections.py | 4 ++-- .../leaked_credential_checks/leaked_credential_checks.py | 4 ++-- src/cloudflare/resources/load_balancers/load_balancers.py | 4 ++-- src/cloudflare/resources/load_balancers/monitors/monitors.py | 4 ++-- src/cloudflare/resources/load_balancers/monitors/previews.py | 4 ++-- .../resources/load_balancers/monitors/references.py | 4 ++-- src/cloudflare/resources/load_balancers/pools/health.py | 4 ++-- src/cloudflare/resources/load_balancers/pools/pools.py | 4 ++-- src/cloudflare/resources/load_balancers/pools/references.py | 4 ++-- src/cloudflare/resources/load_balancers/previews.py | 4 ++-- src/cloudflare/resources/load_balancers/regions.py | 4 ++-- src/cloudflare/resources/load_balancers/searches.py | 4 ++-- src/cloudflare/resources/logpush/datasets/datasets.py | 4 ++-- src/cloudflare/resources/logpush/datasets/fields.py | 4 ++-- src/cloudflare/resources/logpush/datasets/jobs.py | 4 ++-- src/cloudflare/resources/logpush/edge.py | 4 ++-- src/cloudflare/resources/logpush/jobs.py | 4 ++-- src/cloudflare/resources/logpush/logpush.py | 4 ++-- src/cloudflare/resources/logpush/ownership.py | 4 ++-- src/cloudflare/resources/logpush/validate.py | 4 ++-- src/cloudflare/resources/logs/control/cmb/cmb.py | 4 ++-- src/cloudflare/resources/logs/control/cmb/config.py | 4 ++-- src/cloudflare/resources/logs/control/control.py | 4 ++-- src/cloudflare/resources/logs/control/retention.py | 4 ++-- src/cloudflare/resources/logs/logs.py | 4 ++-- src/cloudflare/resources/logs/rayid.py | 4 ++-- src/cloudflare/resources/logs/received/fields.py | 4 ++-- src/cloudflare/resources/logs/received/received.py | 4 ++-- .../resources/magic_network_monitoring/configs/configs.py | 4 ++-- .../resources/magic_network_monitoring/configs/full.py | 4 ++-- .../magic_network_monitoring/magic_network_monitoring.py | 4 ++-- .../magic_network_monitoring/rules/advertisements.py | 4 ++-- .../resources/magic_network_monitoring/rules/rules.py | 4 ++-- src/cloudflare/resources/magic_transit/apps.py | 4 ++-- src/cloudflare/resources/magic_transit/cf_interconnects.py | 4 ++-- src/cloudflare/resources/magic_transit/connectors.py | 4 ++-- src/cloudflare/resources/magic_transit/gre_tunnels.py | 4 ++-- src/cloudflare/resources/magic_transit/ipsec_tunnels.py | 4 ++-- src/cloudflare/resources/magic_transit/magic_transit.py | 4 ++-- src/cloudflare/resources/magic_transit/pcaps/download.py | 4 ++-- src/cloudflare/resources/magic_transit/pcaps/ownership.py | 4 ++-- src/cloudflare/resources/magic_transit/pcaps/pcaps.py | 4 ++-- src/cloudflare/resources/magic_transit/routes.py | 4 ++-- src/cloudflare/resources/magic_transit/sites/acls.py | 4 ++-- src/cloudflare/resources/magic_transit/sites/lans.py | 4 ++-- src/cloudflare/resources/magic_transit/sites/sites.py | 4 ++-- src/cloudflare/resources/magic_transit/sites/wans.py | 4 ++-- src/cloudflare/resources/managed_transforms.py | 4 ++-- src/cloudflare/resources/memberships.py | 4 ++-- src/cloudflare/resources/mtls_certificates/associations.py | 4 ++-- .../resources/mtls_certificates/mtls_certificates.py | 4 ++-- src/cloudflare/resources/origin_ca_certificates.py | 4 ++-- src/cloudflare/resources/origin_post_quantum_encryption.py | 4 ++-- .../origin_tls_client_auth/hostnames/certificates.py | 4 ++-- .../resources/origin_tls_client_auth/hostnames/hostnames.py | 4 ++-- .../origin_tls_client_auth/origin_tls_client_auth.py | 4 ++-- src/cloudflare/resources/origin_tls_client_auth/settings.py | 4 ++-- src/cloudflare/resources/page_rules.py | 4 ++-- src/cloudflare/resources/page_shield/connections.py | 4 ++-- src/cloudflare/resources/page_shield/cookies.py | 4 ++-- src/cloudflare/resources/page_shield/page_shield.py | 4 ++-- src/cloudflare/resources/page_shield/policies.py | 4 ++-- src/cloudflare/resources/page_shield/scripts.py | 4 ++-- src/cloudflare/resources/pages/pages.py | 4 ++-- .../resources/pages/projects/deployments/deployments.py | 4 ++-- .../resources/pages/projects/deployments/history/history.py | 4 ++-- .../resources/pages/projects/deployments/history/logs.py | 4 ++-- src/cloudflare/resources/pages/projects/domains.py | 4 ++-- src/cloudflare/resources/pages/projects/projects.py | 4 ++-- src/cloudflare/resources/queues/consumers.py | 4 ++-- src/cloudflare/resources/queues/messages.py | 4 ++-- src/cloudflare/resources/queues/queues.py | 4 ++-- src/cloudflare/resources/r2/buckets/buckets.py | 4 ++-- src/cloudflare/resources/r2/buckets/cors.py | 4 ++-- src/cloudflare/resources/r2/buckets/domains/custom.py | 4 ++-- src/cloudflare/resources/r2/buckets/domains/domains.py | 4 ++-- src/cloudflare/resources/r2/buckets/domains/managed.py | 4 ++-- .../event_notifications/configuration/configuration.py | 4 ++-- .../r2/buckets/event_notifications/configuration/queues.py | 4 ++-- .../r2/buckets/event_notifications/event_notifications.py | 4 ++-- src/cloudflare/resources/r2/buckets/lifecycle.py | 4 ++-- src/cloudflare/resources/r2/buckets/sippy.py | 4 ++-- src/cloudflare/resources/r2/r2.py | 4 ++-- src/cloudflare/resources/r2/temporary_credentials.py | 4 ++-- src/cloudflare/resources/radar/ai/ai.py | 4 ++-- src/cloudflare/resources/radar/ai/bots/bots.py | 4 ++-- src/cloudflare/resources/radar/ai/bots/summary.py | 4 ++-- src/cloudflare/resources/radar/ai/timeseries_groups.py | 4 ++-- src/cloudflare/resources/radar/annotations/annotations.py | 4 ++-- src/cloudflare/resources/radar/annotations/outages.py | 4 ++-- src/cloudflare/resources/radar/as112/as112.py | 4 ++-- src/cloudflare/resources/radar/as112/summary.py | 4 ++-- src/cloudflare/resources/radar/as112/timeseries_groups.py | 4 ++-- src/cloudflare/resources/radar/as112/top.py | 4 ++-- src/cloudflare/resources/radar/attacks/attacks.py | 4 ++-- src/cloudflare/resources/radar/attacks/layer3/layer3.py | 4 ++-- src/cloudflare/resources/radar/attacks/layer3/summary.py | 4 ++-- .../resources/radar/attacks/layer3/timeseries_groups.py | 4 ++-- .../resources/radar/attacks/layer3/top/locations.py | 4 ++-- src/cloudflare/resources/radar/attacks/layer3/top/top.py | 4 ++-- src/cloudflare/resources/radar/attacks/layer7/layer7.py | 4 ++-- src/cloudflare/resources/radar/attacks/layer7/summary.py | 4 ++-- .../resources/radar/attacks/layer7/timeseries_groups.py | 4 ++-- src/cloudflare/resources/radar/attacks/layer7/top/ases.py | 4 ++-- .../resources/radar/attacks/layer7/top/locations.py | 4 ++-- src/cloudflare/resources/radar/attacks/layer7/top/top.py | 4 ++-- src/cloudflare/resources/radar/bgp/bgp.py | 4 ++-- src/cloudflare/resources/radar/bgp/hijacks/events.py | 4 ++-- src/cloudflare/resources/radar/bgp/hijacks/hijacks.py | 4 ++-- src/cloudflare/resources/radar/bgp/ips.py | 4 ++-- src/cloudflare/resources/radar/bgp/leaks/events.py | 4 ++-- src/cloudflare/resources/radar/bgp/leaks/leaks.py | 4 ++-- src/cloudflare/resources/radar/bgp/routes.py | 4 ++-- src/cloudflare/resources/radar/bgp/top/ases.py | 4 ++-- src/cloudflare/resources/radar/bgp/top/top.py | 4 ++-- src/cloudflare/resources/radar/datasets.py | 4 ++-- src/cloudflare/resources/radar/dns/dns.py | 4 ++-- src/cloudflare/resources/radar/dns/top.py | 4 ++-- src/cloudflare/resources/radar/email/email.py | 4 ++-- src/cloudflare/resources/radar/email/routing/routing.py | 4 ++-- src/cloudflare/resources/radar/email/routing/summary.py | 4 ++-- .../resources/radar/email/routing/timeseries_groups.py | 4 ++-- src/cloudflare/resources/radar/email/security/security.py | 4 ++-- src/cloudflare/resources/radar/email/security/summary.py | 4 ++-- .../resources/radar/email/security/timeseries_groups.py | 4 ++-- .../resources/radar/email/security/top/tlds/malicious.py | 4 ++-- .../resources/radar/email/security/top/tlds/spam.py | 4 ++-- .../resources/radar/email/security/top/tlds/spoof.py | 4 ++-- .../resources/radar/email/security/top/tlds/tlds.py | 4 ++-- src/cloudflare/resources/radar/email/security/top/top.py | 4 ++-- src/cloudflare/resources/radar/entities/asns.py | 4 ++-- src/cloudflare/resources/radar/entities/entities.py | 4 ++-- src/cloudflare/resources/radar/entities/locations.py | 4 ++-- src/cloudflare/resources/radar/http/ases/ases.py | 4 ++-- src/cloudflare/resources/radar/http/ases/bot_class.py | 4 ++-- src/cloudflare/resources/radar/http/ases/browser_family.py | 4 ++-- src/cloudflare/resources/radar/http/ases/device_type.py | 4 ++-- src/cloudflare/resources/radar/http/ases/http_method.py | 4 ++-- src/cloudflare/resources/radar/http/ases/http_protocol.py | 4 ++-- src/cloudflare/resources/radar/http/ases/ip_version.py | 4 ++-- src/cloudflare/resources/radar/http/ases/os.py | 4 ++-- src/cloudflare/resources/radar/http/ases/tls_version.py | 4 ++-- src/cloudflare/resources/radar/http/http.py | 4 ++-- src/cloudflare/resources/radar/http/locations/bot_class.py | 4 ++-- .../resources/radar/http/locations/browser_family.py | 4 ++-- src/cloudflare/resources/radar/http/locations/device_type.py | 4 ++-- src/cloudflare/resources/radar/http/locations/http_method.py | 4 ++-- .../resources/radar/http/locations/http_protocol.py | 4 ++-- src/cloudflare/resources/radar/http/locations/ip_version.py | 4 ++-- src/cloudflare/resources/radar/http/locations/locations.py | 4 ++-- src/cloudflare/resources/radar/http/locations/os.py | 4 ++-- src/cloudflare/resources/radar/http/locations/tls_version.py | 4 ++-- src/cloudflare/resources/radar/http/summary.py | 4 ++-- src/cloudflare/resources/radar/http/timeseries_groups.py | 4 ++-- src/cloudflare/resources/radar/http/top.py | 4 ++-- src/cloudflare/resources/radar/netflows/netflows.py | 4 ++-- src/cloudflare/resources/radar/netflows/top.py | 4 ++-- src/cloudflare/resources/radar/quality/iqi.py | 4 ++-- src/cloudflare/resources/radar/quality/quality.py | 4 ++-- src/cloudflare/resources/radar/quality/speed/speed.py | 4 ++-- src/cloudflare/resources/radar/quality/speed/top.py | 4 ++-- src/cloudflare/resources/radar/radar.py | 4 ++-- src/cloudflare/resources/radar/ranking/domain.py | 4 ++-- src/cloudflare/resources/radar/ranking/ranking.py | 4 ++-- src/cloudflare/resources/radar/search.py | 4 ++-- src/cloudflare/resources/radar/tcp_resets_timeouts.py | 4 ++-- src/cloudflare/resources/radar/traffic_anomalies/locations.py | 4 ++-- .../resources/radar/traffic_anomalies/traffic_anomalies.py | 4 ++-- src/cloudflare/resources/radar/verified_bots/top.py | 4 ++-- src/cloudflare/resources/radar/verified_bots/verified_bots.py | 4 ++-- src/cloudflare/resources/rate_limits.py | 4 ++-- src/cloudflare/resources/registrar/domains.py | 4 ++-- src/cloudflare/resources/registrar/registrar.py | 4 ++-- src/cloudflare/resources/request_tracers/request_tracers.py | 4 ++-- src/cloudflare/resources/request_tracers/traces.py | 4 ++-- src/cloudflare/resources/resource_sharing/recipients.py | 4 ++-- src/cloudflare/resources/resource_sharing/resource_sharing.py | 4 ++-- src/cloudflare/resources/resource_sharing/resources.py | 4 ++-- src/cloudflare/resources/rules/lists/bulk_operations.py | 4 ++-- src/cloudflare/resources/rules/lists/items.py | 4 ++-- src/cloudflare/resources/rules/lists/lists.py | 4 ++-- src/cloudflare/resources/rules/rules.py | 4 ++-- src/cloudflare/resources/rulesets/phases/phases.py | 4 ++-- src/cloudflare/resources/rulesets/phases/versions.py | 4 ++-- src/cloudflare/resources/rulesets/rules.py | 4 ++-- src/cloudflare/resources/rulesets/rulesets.py | 4 ++-- src/cloudflare/resources/rulesets/versions.py | 4 ++-- src/cloudflare/resources/rum/rules.py | 4 ++-- src/cloudflare/resources/rum/rum.py | 4 ++-- src/cloudflare/resources/rum/site_info.py | 4 ++-- src/cloudflare/resources/security_txt.py | 4 ++-- src/cloudflare/resources/snippets/content.py | 4 ++-- src/cloudflare/resources/snippets/rules.py | 4 ++-- src/cloudflare/resources/snippets/snippets.py | 4 ++-- .../resources/spectrum/analytics/aggregates/aggregates.py | 4 ++-- .../resources/spectrum/analytics/aggregates/currents.py | 4 ++-- src/cloudflare/resources/spectrum/analytics/analytics.py | 4 ++-- src/cloudflare/resources/spectrum/analytics/events/bytimes.py | 4 ++-- src/cloudflare/resources/spectrum/analytics/events/events.py | 4 ++-- .../resources/spectrum/analytics/events/summaries.py | 4 ++-- src/cloudflare/resources/spectrum/apps.py | 4 ++-- src/cloudflare/resources/spectrum/spectrum.py | 4 ++-- src/cloudflare/resources/speed/availabilities.py | 4 ++-- src/cloudflare/resources/speed/pages/pages.py | 4 ++-- src/cloudflare/resources/speed/pages/tests.py | 4 ++-- src/cloudflare/resources/speed/schedule.py | 4 ++-- src/cloudflare/resources/speed/speed.py | 4 ++-- src/cloudflare/resources/ssl/analyze.py | 4 ++-- .../resources/ssl/certificate_packs/certificate_packs.py | 4 ++-- src/cloudflare/resources/ssl/certificate_packs/quota.py | 4 ++-- src/cloudflare/resources/ssl/recommendations.py | 4 ++-- src/cloudflare/resources/ssl/ssl.py | 4 ++-- src/cloudflare/resources/ssl/universal/settings.py | 4 ++-- src/cloudflare/resources/ssl/universal/universal.py | 4 ++-- src/cloudflare/resources/ssl/verification.py | 4 ++-- src/cloudflare/resources/stream/audio_tracks.py | 4 ++-- src/cloudflare/resources/stream/captions/captions.py | 4 ++-- src/cloudflare/resources/stream/captions/language/language.py | 4 ++-- src/cloudflare/resources/stream/captions/language/vtt.py | 4 ++-- src/cloudflare/resources/stream/clip.py | 4 ++-- src/cloudflare/resources/stream/copy.py | 4 ++-- src/cloudflare/resources/stream/direct_upload.py | 4 ++-- src/cloudflare/resources/stream/downloads.py | 4 ++-- src/cloudflare/resources/stream/embed.py | 4 ++-- src/cloudflare/resources/stream/keys.py | 4 ++-- src/cloudflare/resources/stream/live_inputs/live_inputs.py | 4 ++-- src/cloudflare/resources/stream/live_inputs/outputs.py | 4 ++-- src/cloudflare/resources/stream/stream.py | 4 ++-- src/cloudflare/resources/stream/token.py | 4 ++-- src/cloudflare/resources/stream/videos.py | 4 ++-- src/cloudflare/resources/stream/watermarks.py | 4 ++-- src/cloudflare/resources/stream/webhooks.py | 4 ++-- src/cloudflare/resources/turnstile/turnstile.py | 4 ++-- src/cloudflare/resources/turnstile/widgets.py | 4 ++-- src/cloudflare/resources/url_normalization.py | 4 ++-- src/cloudflare/resources/url_scanner/responses.py | 4 ++-- src/cloudflare/resources/url_scanner/scans.py | 4 ++-- src/cloudflare/resources/url_scanner/url_scanner.py | 4 ++-- src/cloudflare/resources/user/audit_logs.py | 4 ++-- src/cloudflare/resources/user/billing/billing.py | 4 ++-- src/cloudflare/resources/user/billing/history.py | 4 ++-- src/cloudflare/resources/user/billing/profile.py | 4 ++-- src/cloudflare/resources/user/invites.py | 4 ++-- src/cloudflare/resources/user/organizations.py | 4 ++-- src/cloudflare/resources/user/subscriptions.py | 4 ++-- src/cloudflare/resources/user/tokens/permission_groups.py | 4 ++-- src/cloudflare/resources/user/tokens/tokens.py | 4 ++-- src/cloudflare/resources/user/tokens/value.py | 4 ++-- src/cloudflare/resources/user/user.py | 4 ++-- src/cloudflare/resources/vectorize/indexes/indexes.py | 4 ++-- src/cloudflare/resources/vectorize/indexes/metadata_index.py | 4 ++-- src/cloudflare/resources/vectorize/vectorize.py | 4 ++-- src/cloudflare/resources/waiting_rooms/events/details.py | 4 ++-- src/cloudflare/resources/waiting_rooms/events/events.py | 4 ++-- src/cloudflare/resources/waiting_rooms/page.py | 4 ++-- src/cloudflare/resources/waiting_rooms/rules.py | 4 ++-- src/cloudflare/resources/waiting_rooms/settings.py | 4 ++-- src/cloudflare/resources/waiting_rooms/statuses.py | 4 ++-- src/cloudflare/resources/waiting_rooms/waiting_rooms.py | 4 ++-- src/cloudflare/resources/web3/hostnames/hostnames.py | 4 ++-- .../ipfs_universal_paths/content_lists/content_lists.py | 4 ++-- .../hostnames/ipfs_universal_paths/content_lists/entries.py | 4 ++-- .../hostnames/ipfs_universal_paths/ipfs_universal_paths.py | 4 ++-- src/cloudflare/resources/web3/web3.py | 4 ++-- src/cloudflare/resources/workers/account_settings.py | 4 ++-- src/cloudflare/resources/workers/assets/assets.py | 4 ++-- src/cloudflare/resources/workers/assets/upload.py | 4 ++-- src/cloudflare/resources/workers/domains.py | 4 ++-- src/cloudflare/resources/workers/routes.py | 4 ++-- src/cloudflare/resources/workers/scripts/assets/assets.py | 4 ++-- src/cloudflare/resources/workers/scripts/assets/upload.py | 4 ++-- src/cloudflare/resources/workers/scripts/content.py | 4 ++-- src/cloudflare/resources/workers/scripts/deployments.py | 4 ++-- src/cloudflare/resources/workers/scripts/schedules.py | 4 ++-- src/cloudflare/resources/workers/scripts/scripts.py | 4 ++-- src/cloudflare/resources/workers/scripts/settings.py | 4 ++-- src/cloudflare/resources/workers/scripts/subdomain.py | 4 ++-- src/cloudflare/resources/workers/scripts/tail.py | 4 ++-- src/cloudflare/resources/workers/scripts/versions.py | 4 ++-- src/cloudflare/resources/workers/subdomains.py | 4 ++-- src/cloudflare/resources/workers/workers.py | 4 ++-- .../resources/workers_for_platforms/dispatch/dispatch.py | 4 ++-- .../workers_for_platforms/dispatch/namespaces/namespaces.py | 4 ++-- .../dispatch/namespaces/scripts/asset_upload.py | 4 ++-- .../dispatch/namespaces/scripts/bindings.py | 4 ++-- .../dispatch/namespaces/scripts/content.py | 4 ++-- .../dispatch/namespaces/scripts/scripts.py | 4 ++-- .../dispatch/namespaces/scripts/secrets.py | 4 ++-- .../dispatch/namespaces/scripts/settings.py | 4 ++-- .../workers_for_platforms/dispatch/namespaces/scripts/tags.py | 4 ++-- .../resources/workers_for_platforms/workers_for_platforms.py | 4 ++-- src/cloudflare/resources/workflows/instances/instances.py | 4 ++-- src/cloudflare/resources/workflows/instances/status.py | 4 ++-- src/cloudflare/resources/workflows/versions.py | 4 ++-- src/cloudflare/resources/workflows/workflows.py | 4 ++-- src/cloudflare/resources/zero_trust/access/access.py | 4 ++-- .../resources/zero_trust/access/applications/applications.py | 4 ++-- .../resources/zero_trust/access/applications/cas.py | 4 ++-- .../resources/zero_trust/access/applications/policies.py | 4 ++-- .../access/applications/policy_tests/policy_tests.py | 4 ++-- .../zero_trust/access/applications/policy_tests/users.py | 4 ++-- .../zero_trust/access/applications/user_policy_checks.py | 4 ++-- src/cloudflare/resources/zero_trust/access/bookmarks.py | 4 ++-- .../resources/zero_trust/access/certificates/certificates.py | 4 ++-- .../resources/zero_trust/access/certificates/settings.py | 4 ++-- src/cloudflare/resources/zero_trust/access/custom_pages.py | 4 ++-- src/cloudflare/resources/zero_trust/access/gateway_ca.py | 4 ++-- src/cloudflare/resources/zero_trust/access/groups.py | 4 ++-- .../zero_trust/access/infrastructure/infrastructure.py | 4 ++-- .../resources/zero_trust/access/infrastructure/targets.py | 4 ++-- src/cloudflare/resources/zero_trust/access/keys.py | 4 ++-- .../resources/zero_trust/access/logs/access_requests.py | 4 ++-- src/cloudflare/resources/zero_trust/access/logs/logs.py | 4 ++-- src/cloudflare/resources/zero_trust/access/policies.py | 4 ++-- src/cloudflare/resources/zero_trust/access/service_tokens.py | 4 ++-- src/cloudflare/resources/zero_trust/access/tags.py | 4 ++-- .../resources/zero_trust/access/users/active_sessions.py | 4 ++-- .../resources/zero_trust/access/users/failed_logins.py | 4 ++-- .../resources/zero_trust/access/users/last_seen_identity.py | 4 ++-- src/cloudflare/resources/zero_trust/access/users/users.py | 4 ++-- src/cloudflare/resources/zero_trust/connectivity_settings.py | 4 ++-- src/cloudflare/resources/zero_trust/devices/devices.py | 4 ++-- src/cloudflare/resources/zero_trust/devices/dex_tests.py | 4 ++-- src/cloudflare/resources/zero_trust/devices/fleet_status.py | 4 ++-- src/cloudflare/resources/zero_trust/devices/networks.py | 4 ++-- src/cloudflare/resources/zero_trust/devices/override_codes.py | 4 ++-- .../resources/zero_trust/devices/policies/custom/custom.py | 4 ++-- .../resources/zero_trust/devices/policies/custom/excludes.py | 4 ++-- .../zero_trust/devices/policies/custom/fallback_domains.py | 4 ++-- .../resources/zero_trust/devices/policies/custom/includes.py | 4 ++-- .../zero_trust/devices/policies/default/certificates.py | 4 ++-- .../resources/zero_trust/devices/policies/default/default.py | 4 ++-- .../resources/zero_trust/devices/policies/default/excludes.py | 4 ++-- .../zero_trust/devices/policies/default/fallback_domains.py | 4 ++-- .../resources/zero_trust/devices/policies/default/includes.py | 4 ++-- .../resources/zero_trust/devices/policies/policies.py | 4 ++-- .../resources/zero_trust/devices/posture/integrations.py | 4 ++-- .../resources/zero_trust/devices/posture/posture.py | 4 ++-- src/cloudflare/resources/zero_trust/devices/revoke.py | 4 ++-- src/cloudflare/resources/zero_trust/devices/settings.py | 4 ++-- src/cloudflare/resources/zero_trust/devices/unrevoke.py | 4 ++-- src/cloudflare/resources/zero_trust/dex/colos.py | 4 ++-- src/cloudflare/resources/zero_trust/dex/commands/commands.py | 4 ++-- src/cloudflare/resources/zero_trust/dex/commands/devices.py | 4 ++-- src/cloudflare/resources/zero_trust/dex/commands/downloads.py | 4 ++-- src/cloudflare/resources/zero_trust/dex/commands/quota.py | 4 ++-- src/cloudflare/resources/zero_trust/dex/dex.py | 4 ++-- .../resources/zero_trust/dex/fleet_status/devices.py | 4 ++-- .../resources/zero_trust/dex/fleet_status/fleet_status.py | 4 ++-- .../resources/zero_trust/dex/http_tests/http_tests.py | 4 ++-- .../resources/zero_trust/dex/http_tests/percentiles.py | 4 ++-- src/cloudflare/resources/zero_trust/dex/tests/tests.py | 4 ++-- .../resources/zero_trust/dex/tests/unique_devices.py | 4 ++-- .../zero_trust/dex/traceroute_test_results/network_path.py | 4 ++-- .../dex/traceroute_test_results/traceroute_test_results.py | 4 ++-- src/cloudflare/resources/zero_trust/dex/traceroute_tests.py | 4 ++-- src/cloudflare/resources/zero_trust/dlp/datasets/datasets.py | 4 ++-- src/cloudflare/resources/zero_trust/dlp/datasets/upload.py | 4 ++-- .../resources/zero_trust/dlp/datasets/versions/entries.py | 4 ++-- .../resources/zero_trust/dlp/datasets/versions/versions.py | 4 ++-- src/cloudflare/resources/zero_trust/dlp/dlp.py | 4 ++-- .../resources/zero_trust/dlp/email/account_mapping.py | 4 ++-- src/cloudflare/resources/zero_trust/dlp/email/email.py | 4 ++-- src/cloudflare/resources/zero_trust/dlp/email/rules.py | 4 ++-- src/cloudflare/resources/zero_trust/dlp/entries.py | 4 ++-- src/cloudflare/resources/zero_trust/dlp/limits.py | 4 ++-- src/cloudflare/resources/zero_trust/dlp/patterns.py | 4 ++-- src/cloudflare/resources/zero_trust/dlp/payload_logs.py | 4 ++-- src/cloudflare/resources/zero_trust/dlp/profiles/custom.py | 4 ++-- .../resources/zero_trust/dlp/profiles/predefined.py | 4 ++-- src/cloudflare/resources/zero_trust/dlp/profiles/profiles.py | 4 ++-- src/cloudflare/resources/zero_trust/gateway/app_types.py | 4 ++-- .../resources/zero_trust/gateway/audit_ssh_settings.py | 4 ++-- src/cloudflare/resources/zero_trust/gateway/categories.py | 4 ++-- src/cloudflare/resources/zero_trust/gateway/certificates.py | 4 ++-- .../zero_trust/gateway/configurations/configurations.py | 4 ++-- .../zero_trust/gateway/configurations/custom_certificate.py | 4 ++-- src/cloudflare/resources/zero_trust/gateway/gateway.py | 4 ++-- src/cloudflare/resources/zero_trust/gateway/lists/items.py | 4 ++-- src/cloudflare/resources/zero_trust/gateway/lists/lists.py | 4 ++-- src/cloudflare/resources/zero_trust/gateway/locations.py | 4 ++-- src/cloudflare/resources/zero_trust/gateway/logging.py | 4 ++-- .../resources/zero_trust/gateway/proxy_endpoints.py | 4 ++-- src/cloudflare/resources/zero_trust/gateway/rules.py | 4 ++-- src/cloudflare/resources/zero_trust/identity_providers.py | 4 ++-- src/cloudflare/resources/zero_trust/networks/networks.py | 4 ++-- src/cloudflare/resources/zero_trust/networks/routes/ips.py | 4 ++-- .../resources/zero_trust/networks/routes/networks.py | 4 ++-- src/cloudflare/resources/zero_trust/networks/routes/routes.py | 4 ++-- .../resources/zero_trust/networks/virtual_networks.py | 4 ++-- src/cloudflare/resources/zero_trust/organizations/doh.py | 4 ++-- .../resources/zero_trust/organizations/organizations.py | 4 ++-- .../resources/zero_trust/risk_scoring/behaviours.py | 4 ++-- .../zero_trust/risk_scoring/integrations/integrations.py | 4 ++-- .../zero_trust/risk_scoring/integrations/references.py | 4 ++-- .../resources/zero_trust/risk_scoring/risk_scoring.py | 4 ++-- src/cloudflare/resources/zero_trust/risk_scoring/summary.py | 4 ++-- src/cloudflare/resources/zero_trust/seats.py | 4 ++-- src/cloudflare/resources/zero_trust/tunnels/configurations.py | 4 ++-- src/cloudflare/resources/zero_trust/tunnels/connections.py | 4 ++-- src/cloudflare/resources/zero_trust/tunnels/connectors.py | 4 ++-- src/cloudflare/resources/zero_trust/tunnels/management.py | 4 ++-- src/cloudflare/resources/zero_trust/tunnels/token.py | 4 ++-- src/cloudflare/resources/zero_trust/tunnels/tunnels.py | 4 ++-- src/cloudflare/resources/zero_trust/tunnels/warp_connector.py | 4 ++-- src/cloudflare/resources/zero_trust/zero_trust.py | 4 ++-- src/cloudflare/resources/zones/activation_check.py | 4 ++-- src/cloudflare/resources/zones/custom_nameservers.py | 4 ++-- src/cloudflare/resources/zones/holds.py | 4 ++-- src/cloudflare/resources/zones/plans.py | 4 ++-- src/cloudflare/resources/zones/rate_plans.py | 4 ++-- src/cloudflare/resources/zones/settings.py | 4 ++-- src/cloudflare/resources/zones/subscriptions.py | 4 ++-- src/cloudflare/resources/zones/zones.py | 4 ++-- 619 files changed, 1238 insertions(+), 1238 deletions(-) diff --git a/src/cloudflare/resources/abuse_reports.py b/src/cloudflare/resources/abuse_reports.py index a81ce3c43a6..da2da1d6197 100644 --- a/src/cloudflare/resources/abuse_reports.py +++ b/src/cloudflare/resources/abuse_reports.py @@ -32,7 +32,7 @@ class AbuseReportsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> AbuseReportsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -246,7 +246,7 @@ class AsyncAbuseReportsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncAbuseReportsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/accounts/accounts.py b/src/cloudflare/resources/accounts/accounts.py index eba792cbcc5..d59d809d688 100644 --- a/src/cloudflare/resources/accounts/accounts.py +++ b/src/cloudflare/resources/accounts/accounts.py @@ -94,7 +94,7 @@ def logs(self) -> LogsResource: @cached_property def with_raw_response(self) -> AccountsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -377,7 +377,7 @@ def logs(self) -> AsyncLogsResource: @cached_property def with_raw_response(self) -> AsyncAccountsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/accounts/logs/audit.py b/src/cloudflare/resources/accounts/logs/audit.py index 7375f4199ec..d5ea8076548 100644 --- a/src/cloudflare/resources/accounts/logs/audit.py +++ b/src/cloudflare/resources/accounts/logs/audit.py @@ -30,7 +30,7 @@ class AuditResource(SyncAPIResource): @cached_property def with_raw_response(self) -> AuditResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -212,7 +212,7 @@ class AsyncAuditResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncAuditResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/accounts/logs/logs.py b/src/cloudflare/resources/accounts/logs/logs.py index 475921543aa..69595caf7a3 100644 --- a/src/cloudflare/resources/accounts/logs/logs.py +++ b/src/cloudflare/resources/accounts/logs/logs.py @@ -24,7 +24,7 @@ def audit(self) -> AuditResource: @cached_property def with_raw_response(self) -> LogsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def audit(self) -> AsyncAuditResource: @cached_property def with_raw_response(self) -> AsyncLogsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/accounts/members.py b/src/cloudflare/resources/accounts/members.py index ed54745beb2..1565d83d173 100644 --- a/src/cloudflare/resources/accounts/members.py +++ b/src/cloudflare/resources/accounts/members.py @@ -36,7 +36,7 @@ class MembersResource(SyncAPIResource): @cached_property def with_raw_response(self) -> MembersResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -424,7 +424,7 @@ class AsyncMembersResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncMembersResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/accounts/roles.py b/src/cloudflare/resources/accounts/roles.py index 1fcaa9c487c..d7ef52252b4 100644 --- a/src/cloudflare/resources/accounts/roles.py +++ b/src/cloudflare/resources/accounts/roles.py @@ -27,7 +27,7 @@ class RolesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> RolesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -128,7 +128,7 @@ class AsyncRolesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncRolesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/accounts/subscriptions.py b/src/cloudflare/resources/accounts/subscriptions.py index 1bf69681bd2..89df486f34c 100644 --- a/src/cloudflare/resources/accounts/subscriptions.py +++ b/src/cloudflare/resources/accounts/subscriptions.py @@ -36,7 +36,7 @@ class SubscriptionsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SubscriptionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -263,7 +263,7 @@ class AsyncSubscriptionsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSubscriptionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/accounts/tokens/permission_groups.py b/src/cloudflare/resources/accounts/tokens/permission_groups.py index 591870ebe7f..75bddadceaf 100644 --- a/src/cloudflare/resources/accounts/tokens/permission_groups.py +++ b/src/cloudflare/resources/accounts/tokens/permission_groups.py @@ -23,7 +23,7 @@ class PermissionGroupsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> PermissionGroupsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -80,7 +80,7 @@ class AsyncPermissionGroupsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncPermissionGroupsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/accounts/tokens/tokens.py b/src/cloudflare/resources/accounts/tokens/tokens.py index 1ab9da980d8..a5065793784 100644 --- a/src/cloudflare/resources/accounts/tokens/tokens.py +++ b/src/cloudflare/resources/accounts/tokens/tokens.py @@ -62,7 +62,7 @@ def value(self) -> ValueResource: @cached_property def with_raw_response(self) -> TokensResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -409,7 +409,7 @@ def value(self) -> AsyncValueResource: @cached_property def with_raw_response(self) -> AsyncTokensResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/accounts/tokens/value.py b/src/cloudflare/resources/accounts/tokens/value.py index 59dac86db7c..94034ab2a7d 100644 --- a/src/cloudflare/resources/accounts/tokens/value.py +++ b/src/cloudflare/resources/accounts/tokens/value.py @@ -31,7 +31,7 @@ class ValueResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ValueResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -98,7 +98,7 @@ class AsyncValueResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncValueResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/acm/acm.py b/src/cloudflare/resources/acm/acm.py index 97cc4b05fa2..4d576c8fa13 100644 --- a/src/cloudflare/resources/acm/acm.py +++ b/src/cloudflare/resources/acm/acm.py @@ -24,7 +24,7 @@ def total_tls(self) -> TotalTLSResource: @cached_property def with_raw_response(self) -> ACMResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def total_tls(self) -> AsyncTotalTLSResource: @cached_property def with_raw_response(self) -> AsyncACMResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/acm/total_tls.py b/src/cloudflare/resources/acm/total_tls.py index 1eded706d28..2d0e550ccf5 100644 --- a/src/cloudflare/resources/acm/total_tls.py +++ b/src/cloudflare/resources/acm/total_tls.py @@ -33,7 +33,7 @@ class TotalTLSResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TotalTLSResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -146,7 +146,7 @@ class AsyncTotalTLSResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTotalTLSResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/addressing/address_maps/accounts.py b/src/cloudflare/resources/addressing/address_maps/accounts.py index a5279ff240c..d30e053c698 100644 --- a/src/cloudflare/resources/addressing/address_maps/accounts.py +++ b/src/cloudflare/resources/addressing/address_maps/accounts.py @@ -29,7 +29,7 @@ class AccountsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> AccountsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -132,7 +132,7 @@ class AsyncAccountsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncAccountsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/addressing/address_maps/address_maps.py b/src/cloudflare/resources/addressing/address_maps/address_maps.py index b3a6fda77c9..e2dd8d9111d 100644 --- a/src/cloudflare/resources/addressing/address_maps/address_maps.py +++ b/src/cloudflare/resources/addressing/address_maps/address_maps.py @@ -71,7 +71,7 @@ def zones(self) -> ZonesResource: @cached_property def with_raw_response(self) -> AddressMapsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -354,7 +354,7 @@ def zones(self) -> AsyncZonesResource: @cached_property def with_raw_response(self) -> AsyncAddressMapsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/addressing/address_maps/ips.py b/src/cloudflare/resources/addressing/address_maps/ips.py index 15c999ab654..c17ae0f81bc 100644 --- a/src/cloudflare/resources/addressing/address_maps/ips.py +++ b/src/cloudflare/resources/addressing/address_maps/ips.py @@ -29,7 +29,7 @@ class IPsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> IPsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -142,7 +142,7 @@ class AsyncIPsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncIPsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/addressing/address_maps/zones.py b/src/cloudflare/resources/addressing/address_maps/zones.py index d7f859f2617..b0813f207c3 100644 --- a/src/cloudflare/resources/addressing/address_maps/zones.py +++ b/src/cloudflare/resources/addressing/address_maps/zones.py @@ -29,7 +29,7 @@ class ZonesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ZonesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -142,7 +142,7 @@ class AsyncZonesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncZonesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/addressing/addressing.py b/src/cloudflare/resources/addressing/addressing.py index 65ac3b59c70..2ddc2d78362 100644 --- a/src/cloudflare/resources/addressing/addressing.py +++ b/src/cloudflare/resources/addressing/addressing.py @@ -72,7 +72,7 @@ def prefixes(self) -> PrefixesResource: @cached_property def with_raw_response(self) -> AddressingResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -113,7 +113,7 @@ def prefixes(self) -> AsyncPrefixesResource: @cached_property def with_raw_response(self) -> AsyncAddressingResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/addressing/loa_documents.py b/src/cloudflare/resources/addressing/loa_documents.py index c4db454b8c2..47abb0af10f 100644 --- a/src/cloudflare/resources/addressing/loa_documents.py +++ b/src/cloudflare/resources/addressing/loa_documents.py @@ -39,7 +39,7 @@ class LOADocumentsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> LOADocumentsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -148,7 +148,7 @@ class AsyncLOADocumentsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncLOADocumentsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/addressing/prefixes/advertisement_status.py b/src/cloudflare/resources/addressing/prefixes/advertisement_status.py index 4ca0b677f15..c8ce2f9fb6b 100644 --- a/src/cloudflare/resources/addressing/prefixes/advertisement_status.py +++ b/src/cloudflare/resources/addressing/prefixes/advertisement_status.py @@ -32,7 +32,7 @@ class AdvertisementStatusResource(SyncAPIResource): @cached_property def with_raw_response(self) -> AdvertisementStatusResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -156,7 +156,7 @@ class AsyncAdvertisementStatusResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncAdvertisementStatusResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/addressing/prefixes/bgp_prefixes.py b/src/cloudflare/resources/addressing/prefixes/bgp_prefixes.py index 3f65acd83ad..f933e12539e 100644 --- a/src/cloudflare/resources/addressing/prefixes/bgp_prefixes.py +++ b/src/cloudflare/resources/addressing/prefixes/bgp_prefixes.py @@ -32,7 +32,7 @@ class BGPPrefixesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> BGPPrefixesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -249,7 +249,7 @@ class AsyncBGPPrefixesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncBGPPrefixesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/addressing/prefixes/delegations.py b/src/cloudflare/resources/addressing/prefixes/delegations.py index 93870db9319..6c1e409eef1 100644 --- a/src/cloudflare/resources/addressing/prefixes/delegations.py +++ b/src/cloudflare/resources/addressing/prefixes/delegations.py @@ -33,7 +33,7 @@ class DelegationsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> DelegationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -201,7 +201,7 @@ class AsyncDelegationsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncDelegationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/addressing/prefixes/prefixes.py b/src/cloudflare/resources/addressing/prefixes/prefixes.py index b9620460953..6c9f5435bec 100644 --- a/src/cloudflare/resources/addressing/prefixes/prefixes.py +++ b/src/cloudflare/resources/addressing/prefixes/prefixes.py @@ -81,7 +81,7 @@ def delegations(self) -> DelegationsResource: @cached_property def with_raw_response(self) -> PrefixesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -342,7 +342,7 @@ def delegations(self) -> AsyncDelegationsResource: @cached_property def with_raw_response(self) -> AsyncPrefixesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/addressing/prefixes/service_bindings.py b/src/cloudflare/resources/addressing/prefixes/service_bindings.py index c5be5b730ca..053cdd351c4 100644 --- a/src/cloudflare/resources/addressing/prefixes/service_bindings.py +++ b/src/cloudflare/resources/addressing/prefixes/service_bindings.py @@ -33,7 +33,7 @@ class ServiceBindingsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ServiceBindingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -256,7 +256,7 @@ class AsyncServiceBindingsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncServiceBindingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/addressing/regional_hostnames/regional_hostnames.py b/src/cloudflare/resources/addressing/regional_hostnames/regional_hostnames.py index 6df921030ff..ed9b3b46be5 100644 --- a/src/cloudflare/resources/addressing/regional_hostnames/regional_hostnames.py +++ b/src/cloudflare/resources/addressing/regional_hostnames/regional_hostnames.py @@ -48,7 +48,7 @@ def regions(self) -> RegionsResource: @cached_property def with_raw_response(self) -> RegionalHostnamesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -303,7 +303,7 @@ def regions(self) -> AsyncRegionsResource: @cached_property def with_raw_response(self) -> AsyncRegionalHostnamesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/addressing/regional_hostnames/regions.py b/src/cloudflare/resources/addressing/regional_hostnames/regions.py index 16d9deac419..f0c69f1b81f 100644 --- a/src/cloudflare/resources/addressing/regional_hostnames/regions.py +++ b/src/cloudflare/resources/addressing/regional_hostnames/regions.py @@ -24,7 +24,7 @@ class RegionsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> RegionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -81,7 +81,7 @@ class AsyncRegionsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncRegionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/addressing/services.py b/src/cloudflare/resources/addressing/services.py index e73f0c62298..799ce7f0980 100644 --- a/src/cloudflare/resources/addressing/services.py +++ b/src/cloudflare/resources/addressing/services.py @@ -24,7 +24,7 @@ class ServicesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ServicesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -84,7 +84,7 @@ class AsyncServicesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncServicesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/ai/ai.py b/src/cloudflare/resources/ai/ai.py index 396a1360fe9..9d148a6b655 100644 --- a/src/cloudflare/resources/ai/ai.py +++ b/src/cloudflare/resources/ai/ai.py @@ -81,7 +81,7 @@ def models(self) -> ModelsResource: @cached_property def with_raw_response(self) -> AIResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -833,7 +833,7 @@ def models(self) -> AsyncModelsResource: @cached_property def with_raw_response(self) -> AsyncAIResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/ai/authors.py b/src/cloudflare/resources/ai/authors.py index ecf213ff048..f5c5ce9877d 100644 --- a/src/cloudflare/resources/ai/authors.py +++ b/src/cloudflare/resources/ai/authors.py @@ -23,7 +23,7 @@ class AuthorsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> AuthorsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -78,7 +78,7 @@ class AsyncAuthorsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncAuthorsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/ai/finetunes/assets.py b/src/cloudflare/resources/ai/finetunes/assets.py index dfeb072ae01..7df434bb081 100644 --- a/src/cloudflare/resources/ai/finetunes/assets.py +++ b/src/cloudflare/resources/ai/finetunes/assets.py @@ -33,7 +33,7 @@ class AssetsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> AssetsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -109,7 +109,7 @@ class AsyncAssetsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncAssetsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/ai/finetunes/finetunes.py b/src/cloudflare/resources/ai/finetunes/finetunes.py index 1cdef4efc51..51bac25f1b5 100644 --- a/src/cloudflare/resources/ai/finetunes/finetunes.py +++ b/src/cloudflare/resources/ai/finetunes/finetunes.py @@ -56,7 +56,7 @@ def public(self) -> PublicResource: @cached_property def with_raw_response(self) -> FinetunesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -172,7 +172,7 @@ def public(self) -> AsyncPublicResource: @cached_property def with_raw_response(self) -> AsyncFinetunesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/ai/finetunes/public.py b/src/cloudflare/resources/ai/finetunes/public.py index 74c49e747fa..c8d542c985e 100644 --- a/src/cloudflare/resources/ai/finetunes/public.py +++ b/src/cloudflare/resources/ai/finetunes/public.py @@ -26,7 +26,7 @@ class PublicResource(SyncAPIResource): @cached_property def with_raw_response(self) -> PublicResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -101,7 +101,7 @@ class AsyncPublicResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncPublicResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/ai/models/models.py b/src/cloudflare/resources/ai/models/models.py index 66a2394f641..74f1ac1ad34 100644 --- a/src/cloudflare/resources/ai/models/models.py +++ b/src/cloudflare/resources/ai/models/models.py @@ -37,7 +37,7 @@ def schema(self) -> SchemaResource: @cached_property def with_raw_response(self) -> ModelsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -128,7 +128,7 @@ def schema(self) -> AsyncSchemaResource: @cached_property def with_raw_response(self) -> AsyncModelsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/ai/models/schema.py b/src/cloudflare/resources/ai/models/schema.py index be4afa7007f..9b62769bf19 100644 --- a/src/cloudflare/resources/ai/models/schema.py +++ b/src/cloudflare/resources/ai/models/schema.py @@ -30,7 +30,7 @@ class SchemaResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SchemaResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -92,7 +92,7 @@ class AsyncSchemaResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSchemaResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/ai/tasks.py b/src/cloudflare/resources/ai/tasks.py index c2b6cae396a..16b130e6805 100644 --- a/src/cloudflare/resources/ai/tasks.py +++ b/src/cloudflare/resources/ai/tasks.py @@ -23,7 +23,7 @@ class TasksResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TasksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -78,7 +78,7 @@ class AsyncTasksResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTasksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/ai_gateway/ai_gateway.py b/src/cloudflare/resources/ai_gateway/ai_gateway.py index ebbaa17ba8b..1da57375627 100644 --- a/src/cloudflare/resources/ai_gateway/ai_gateway.py +++ b/src/cloudflare/resources/ai_gateway/ai_gateway.py @@ -85,7 +85,7 @@ def evaluations(self) -> EvaluationsResource: @cached_property def with_raw_response(self) -> AIGatewayResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -381,7 +381,7 @@ def evaluations(self) -> AsyncEvaluationsResource: @cached_property def with_raw_response(self) -> AsyncAIGatewayResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/ai_gateway/datasets.py b/src/cloudflare/resources/ai_gateway/datasets.py index 3d58ec297b4..afed3ec86ef 100644 --- a/src/cloudflare/resources/ai_gateway/datasets.py +++ b/src/cloudflare/resources/ai_gateway/datasets.py @@ -36,7 +36,7 @@ class DatasetsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> DatasetsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -315,7 +315,7 @@ class AsyncDatasetsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncDatasetsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/ai_gateway/evaluation_types.py b/src/cloudflare/resources/ai_gateway/evaluation_types.py index 94d76d33826..80f322466ff 100644 --- a/src/cloudflare/resources/ai_gateway/evaluation_types.py +++ b/src/cloudflare/resources/ai_gateway/evaluation_types.py @@ -32,7 +32,7 @@ class EvaluationTypesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> EvaluationTypesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -103,7 +103,7 @@ class AsyncEvaluationTypesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncEvaluationTypesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/ai_gateway/evaluations.py b/src/cloudflare/resources/ai_gateway/evaluations.py index 5dbccd8f358..9fadf2aa944 100644 --- a/src/cloudflare/resources/ai_gateway/evaluations.py +++ b/src/cloudflare/resources/ai_gateway/evaluations.py @@ -35,7 +35,7 @@ class EvaluationsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> EvaluationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -258,7 +258,7 @@ class AsyncEvaluationsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncEvaluationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/ai_gateway/logs.py b/src/cloudflare/resources/ai_gateway/logs.py index 65ac6d95b48..0daa36fc2c6 100644 --- a/src/cloudflare/resources/ai_gateway/logs.py +++ b/src/cloudflare/resources/ai_gateway/logs.py @@ -36,7 +36,7 @@ class LogsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> LogsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -410,7 +410,7 @@ class AsyncLogsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncLogsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/alerting/alerting.py b/src/cloudflare/resources/alerting/alerting.py index 26acc6c7b63..faa242b37cb 100644 --- a/src/cloudflare/resources/alerting/alerting.py +++ b/src/cloudflare/resources/alerting/alerting.py @@ -60,7 +60,7 @@ def policies(self) -> PoliciesResource: @cached_property def with_raw_response(self) -> AlertingResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -97,7 +97,7 @@ def policies(self) -> AsyncPoliciesResource: @cached_property def with_raw_response(self) -> AsyncAlertingResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/alerting/available_alerts.py b/src/cloudflare/resources/alerting/available_alerts.py index 0ef63c9f03f..713f9e8db34 100644 --- a/src/cloudflare/resources/alerting/available_alerts.py +++ b/src/cloudflare/resources/alerting/available_alerts.py @@ -26,7 +26,7 @@ class AvailableAlertsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> AvailableAlertsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -86,7 +86,7 @@ class AsyncAvailableAlertsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncAvailableAlertsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/alerting/destinations/destinations.py b/src/cloudflare/resources/alerting/destinations/destinations.py index d15420aed0f..8e074ffa262 100644 --- a/src/cloudflare/resources/alerting/destinations/destinations.py +++ b/src/cloudflare/resources/alerting/destinations/destinations.py @@ -48,7 +48,7 @@ def webhooks(self) -> WebhooksResource: @cached_property def with_raw_response(self) -> DestinationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -81,7 +81,7 @@ def webhooks(self) -> AsyncWebhooksResource: @cached_property def with_raw_response(self) -> AsyncDestinationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/alerting/destinations/eligible.py b/src/cloudflare/resources/alerting/destinations/eligible.py index 4f73d80b393..b93d17a6409 100644 --- a/src/cloudflare/resources/alerting/destinations/eligible.py +++ b/src/cloudflare/resources/alerting/destinations/eligible.py @@ -26,7 +26,7 @@ class EligibleResource(SyncAPIResource): @cached_property def with_raw_response(self) -> EligibleResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -86,7 +86,7 @@ class AsyncEligibleResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncEligibleResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/alerting/destinations/pagerduty.py b/src/cloudflare/resources/alerting/destinations/pagerduty.py index e59cf6537ad..6e65685bb62 100644 --- a/src/cloudflare/resources/alerting/destinations/pagerduty.py +++ b/src/cloudflare/resources/alerting/destinations/pagerduty.py @@ -29,7 +29,7 @@ class PagerdutyResource(SyncAPIResource): @cached_property def with_raw_response(self) -> PagerdutyResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -207,7 +207,7 @@ class AsyncPagerdutyResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncPagerdutyResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/alerting/destinations/webhooks.py b/src/cloudflare/resources/alerting/destinations/webhooks.py index 5189a7b807d..e5d7f0d1b9c 100644 --- a/src/cloudflare/resources/alerting/destinations/webhooks.py +++ b/src/cloudflare/resources/alerting/destinations/webhooks.py @@ -35,7 +35,7 @@ class WebhooksResource(SyncAPIResource): @cached_property def with_raw_response(self) -> WebhooksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -299,7 +299,7 @@ class AsyncWebhooksResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncWebhooksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/alerting/history.py b/src/cloudflare/resources/alerting/history.py index 29a1fe0f31d..23733d5fa65 100644 --- a/src/cloudflare/resources/alerting/history.py +++ b/src/cloudflare/resources/alerting/history.py @@ -29,7 +29,7 @@ class HistoryResource(SyncAPIResource): @cached_property def with_raw_response(self) -> HistoryResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -115,7 +115,7 @@ class AsyncHistoryResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncHistoryResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/alerting/policies.py b/src/cloudflare/resources/alerting/policies.py index c3f6b52c997..ef3d2331da8 100644 --- a/src/cloudflare/resources/alerting/policies.py +++ b/src/cloudflare/resources/alerting/policies.py @@ -38,7 +38,7 @@ class PoliciesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> PoliciesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -471,7 +471,7 @@ class AsyncPoliciesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncPoliciesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/api_gateway/api_gateway.py b/src/cloudflare/resources/api_gateway/api_gateway.py index 780055b0239..70917610f7d 100644 --- a/src/cloudflare/resources/api_gateway/api_gateway.py +++ b/src/cloudflare/resources/api_gateway/api_gateway.py @@ -96,7 +96,7 @@ def expression_template(self) -> ExpressionTemplateResource: @cached_property def with_raw_response(self) -> APIGatewayResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -145,7 +145,7 @@ def expression_template(self) -> AsyncExpressionTemplateResource: @cached_property def with_raw_response(self) -> AsyncAPIGatewayResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/api_gateway/configurations.py b/src/cloudflare/resources/api_gateway/configurations.py index dafedfedd47..450f5205f0d 100644 --- a/src/cloudflare/resources/api_gateway/configurations.py +++ b/src/cloudflare/resources/api_gateway/configurations.py @@ -33,7 +33,7 @@ class ConfigurationsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ConfigurationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -137,7 +137,7 @@ class AsyncConfigurationsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncConfigurationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/api_gateway/discovery/discovery.py b/src/cloudflare/resources/api_gateway/discovery/discovery.py index 340447b9e82..9c3152dd49b 100644 --- a/src/cloudflare/resources/api_gateway/discovery/discovery.py +++ b/src/cloudflare/resources/api_gateway/discovery/discovery.py @@ -38,7 +38,7 @@ def operations(self) -> OperationsResource: @cached_property def with_raw_response(self) -> DiscoveryResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -103,7 +103,7 @@ def operations(self) -> AsyncOperationsResource: @cached_property def with_raw_response(self) -> AsyncDiscoveryResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/api_gateway/discovery/operations.py b/src/cloudflare/resources/api_gateway/discovery/operations.py index 1994f365d02..f7a8556479a 100644 --- a/src/cloudflare/resources/api_gateway/discovery/operations.py +++ b/src/cloudflare/resources/api_gateway/discovery/operations.py @@ -35,7 +35,7 @@ class OperationsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> OperationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -246,7 +246,7 @@ class AsyncOperationsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncOperationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/api_gateway/expression_template/expression_template.py b/src/cloudflare/resources/api_gateway/expression_template/expression_template.py index 870b06fcc0f..e5173f78539 100644 --- a/src/cloudflare/resources/api_gateway/expression_template/expression_template.py +++ b/src/cloudflare/resources/api_gateway/expression_template/expression_template.py @@ -24,7 +24,7 @@ def fallthrough(self) -> FallthroughResource: @cached_property def with_raw_response(self) -> ExpressionTemplateResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def fallthrough(self) -> AsyncFallthroughResource: @cached_property def with_raw_response(self) -> AsyncExpressionTemplateResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/api_gateway/expression_template/fallthrough.py b/src/cloudflare/resources/api_gateway/expression_template/fallthrough.py index e518de7be3b..1cb60fb64c1 100644 --- a/src/cloudflare/resources/api_gateway/expression_template/fallthrough.py +++ b/src/cloudflare/resources/api_gateway/expression_template/fallthrough.py @@ -31,7 +31,7 @@ class FallthroughResource(SyncAPIResource): @cached_property def with_raw_response(self) -> FallthroughResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -95,7 +95,7 @@ class AsyncFallthroughResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncFallthroughResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/api_gateway/operations/operations.py b/src/cloudflare/resources/api_gateway/operations/operations.py index 2681b95f944..5207f5d0c97 100644 --- a/src/cloudflare/resources/api_gateway/operations/operations.py +++ b/src/cloudflare/resources/api_gateway/operations/operations.py @@ -55,7 +55,7 @@ def schema_validation(self) -> SchemaValidationResource: @cached_property def with_raw_response(self) -> OperationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -394,7 +394,7 @@ def schema_validation(self) -> AsyncSchemaValidationResource: @cached_property def with_raw_response(self) -> AsyncOperationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/api_gateway/operations/schema_validation.py b/src/cloudflare/resources/api_gateway/operations/schema_validation.py index 1aec1379e0e..d08ebba4175 100644 --- a/src/cloudflare/resources/api_gateway/operations/schema_validation.py +++ b/src/cloudflare/resources/api_gateway/operations/schema_validation.py @@ -39,7 +39,7 @@ class SchemaValidationResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SchemaValidationResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -194,7 +194,7 @@ class AsyncSchemaValidationResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSchemaValidationResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/api_gateway/schemas.py b/src/cloudflare/resources/api_gateway/schemas.py index 7b7eb1ef11c..79611e37e5d 100644 --- a/src/cloudflare/resources/api_gateway/schemas.py +++ b/src/cloudflare/resources/api_gateway/schemas.py @@ -32,7 +32,7 @@ class SchemasResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SchemasResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -107,7 +107,7 @@ class AsyncSchemasResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSchemasResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/api_gateway/settings/schema_validation.py b/src/cloudflare/resources/api_gateway/settings/schema_validation.py index 6a984a33529..ccb54128e03 100644 --- a/src/cloudflare/resources/api_gateway/settings/schema_validation.py +++ b/src/cloudflare/resources/api_gateway/settings/schema_validation.py @@ -31,7 +31,7 @@ class SchemaValidationResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SchemaValidationResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -212,7 +212,7 @@ class AsyncSchemaValidationResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSchemaValidationResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/api_gateway/settings/settings.py b/src/cloudflare/resources/api_gateway/settings/settings.py index 8a7e918de87..543c2a869d1 100644 --- a/src/cloudflare/resources/api_gateway/settings/settings.py +++ b/src/cloudflare/resources/api_gateway/settings/settings.py @@ -24,7 +24,7 @@ def schema_validation(self) -> SchemaValidationResource: @cached_property def with_raw_response(self) -> SettingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def schema_validation(self) -> AsyncSchemaValidationResource: @cached_property def with_raw_response(self) -> AsyncSettingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/api_gateway/user_schemas/hosts.py b/src/cloudflare/resources/api_gateway/user_schemas/hosts.py index 1bd4a3f8520..aa9fcadb55f 100644 --- a/src/cloudflare/resources/api_gateway/user_schemas/hosts.py +++ b/src/cloudflare/resources/api_gateway/user_schemas/hosts.py @@ -26,7 +26,7 @@ class HostsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> HostsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -99,7 +99,7 @@ class AsyncHostsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncHostsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/api_gateway/user_schemas/operations.py b/src/cloudflare/resources/api_gateway/user_schemas/operations.py index a2f9a67fd3e..5a9c28fa03d 100644 --- a/src/cloudflare/resources/api_gateway/user_schemas/operations.py +++ b/src/cloudflare/resources/api_gateway/user_schemas/operations.py @@ -29,7 +29,7 @@ class OperationsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> OperationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -132,7 +132,7 @@ class AsyncOperationsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncOperationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py b/src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py index 983cdf40118..35c37f69fb6 100644 --- a/src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py +++ b/src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py @@ -66,7 +66,7 @@ def hosts(self) -> HostsResource: @cached_property def with_raw_response(self) -> UserSchemasResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -353,7 +353,7 @@ def hosts(self) -> AsyncHostsResource: @cached_property def with_raw_response(self) -> AsyncUserSchemasResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/argo/argo.py b/src/cloudflare/resources/argo/argo.py index 3aa821072b3..eb94300db7a 100644 --- a/src/cloudflare/resources/argo/argo.py +++ b/src/cloudflare/resources/argo/argo.py @@ -36,7 +36,7 @@ def tiered_caching(self) -> TieredCachingResource: @cached_property def with_raw_response(self) -> ArgoResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -65,7 +65,7 @@ def tiered_caching(self) -> AsyncTieredCachingResource: @cached_property def with_raw_response(self) -> AsyncArgoResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/argo/smart_routing.py b/src/cloudflare/resources/argo/smart_routing.py index f45d5a4b043..66ae9a42e3a 100644 --- a/src/cloudflare/resources/argo/smart_routing.py +++ b/src/cloudflare/resources/argo/smart_routing.py @@ -33,7 +33,7 @@ class SmartRoutingResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SmartRoutingResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -146,7 +146,7 @@ class AsyncSmartRoutingResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSmartRoutingResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/argo/tiered_caching.py b/src/cloudflare/resources/argo/tiered_caching.py index 066b5a75b53..a598a0d4f6a 100644 --- a/src/cloudflare/resources/argo/tiered_caching.py +++ b/src/cloudflare/resources/argo/tiered_caching.py @@ -33,7 +33,7 @@ class TieredCachingResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TieredCachingResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -156,7 +156,7 @@ class AsyncTieredCachingResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTieredCachingResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/audit_logs.py b/src/cloudflare/resources/audit_logs.py index 8e3020f4b33..bcb31f75e13 100644 --- a/src/cloudflare/resources/audit_logs.py +++ b/src/cloudflare/resources/audit_logs.py @@ -30,7 +30,7 @@ class AuditLogsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> AuditLogsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -137,7 +137,7 @@ class AsyncAuditLogsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncAuditLogsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/billing/billing.py b/src/cloudflare/resources/billing/billing.py index 5146ee841dd..d57c019144e 100644 --- a/src/cloudflare/resources/billing/billing.py +++ b/src/cloudflare/resources/billing/billing.py @@ -24,7 +24,7 @@ def profiles(self) -> ProfilesResource: @cached_property def with_raw_response(self) -> BillingResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def profiles(self) -> AsyncProfilesResource: @cached_property def with_raw_response(self) -> AsyncBillingResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/billing/profiles.py b/src/cloudflare/resources/billing/profiles.py index c025bcb6617..6d97c84a04c 100644 --- a/src/cloudflare/resources/billing/profiles.py +++ b/src/cloudflare/resources/billing/profiles.py @@ -26,7 +26,7 @@ class ProfilesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ProfilesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -86,7 +86,7 @@ class AsyncProfilesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncProfilesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/bot_management.py b/src/cloudflare/resources/bot_management.py index eefa78d028b..f9875019fe6 100644 --- a/src/cloudflare/resources/bot_management.py +++ b/src/cloudflare/resources/bot_management.py @@ -34,7 +34,7 @@ class BotManagementResource(SyncAPIResource): @cached_property def with_raw_response(self) -> BotManagementResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -578,7 +578,7 @@ class AsyncBotManagementResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncBotManagementResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/botnet_feed/asn.py b/src/cloudflare/resources/botnet_feed/asn.py index 88932ab9b7d..15e06d69a8c 100755 --- a/src/cloudflare/resources/botnet_feed/asn.py +++ b/src/cloudflare/resources/botnet_feed/asn.py @@ -33,7 +33,7 @@ class ASNResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ASNResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -139,7 +139,7 @@ class AsyncASNResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncASNResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/botnet_feed/botnet_feed.py b/src/cloudflare/resources/botnet_feed/botnet_feed.py index b61dfc867fc..5f71396a78d 100755 --- a/src/cloudflare/resources/botnet_feed/botnet_feed.py +++ b/src/cloudflare/resources/botnet_feed/botnet_feed.py @@ -36,7 +36,7 @@ def configs(self) -> ConfigsResource: @cached_property def with_raw_response(self) -> BotnetFeedResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -65,7 +65,7 @@ def configs(self) -> AsyncConfigsResource: @cached_property def with_raw_response(self) -> AsyncBotnetFeedResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/botnet_feed/configs/asn.py b/src/cloudflare/resources/botnet_feed/configs/asn.py index 0d948a96a6f..e2f27d024b6 100755 --- a/src/cloudflare/resources/botnet_feed/configs/asn.py +++ b/src/cloudflare/resources/botnet_feed/configs/asn.py @@ -27,7 +27,7 @@ class ASNResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ASNResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -127,7 +127,7 @@ class AsyncASNResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncASNResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/botnet_feed/configs/configs.py b/src/cloudflare/resources/botnet_feed/configs/configs.py index 90d32679557..6fe692cec0c 100755 --- a/src/cloudflare/resources/botnet_feed/configs/configs.py +++ b/src/cloudflare/resources/botnet_feed/configs/configs.py @@ -24,7 +24,7 @@ def asn(self) -> ASNResource: @cached_property def with_raw_response(self) -> ConfigsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def asn(self) -> AsyncASNResource: @cached_property def with_raw_response(self) -> AsyncConfigsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/brand_protection.py b/src/cloudflare/resources/brand_protection.py index 1727851d6e2..a23a6034443 100644 --- a/src/cloudflare/resources/brand_protection.py +++ b/src/cloudflare/resources/brand_protection.py @@ -32,7 +32,7 @@ class BrandProtectionResource(SyncAPIResource): @cached_property def with_raw_response(self) -> BrandProtectionResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -148,7 +148,7 @@ class AsyncBrandProtectionResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncBrandProtectionResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/cache/cache.py b/src/cloudflare/resources/cache/cache.py index 59117ebee07..1c43ba1a400 100644 --- a/src/cloudflare/resources/cache/cache.py +++ b/src/cloudflare/resources/cache/cache.py @@ -81,7 +81,7 @@ def regional_tiered_cache(self) -> RegionalTieredCacheResource: @cached_property def with_raw_response(self) -> CacheResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -803,7 +803,7 @@ def regional_tiered_cache(self) -> AsyncRegionalTieredCacheResource: @cached_property def with_raw_response(self) -> AsyncCacheResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/cache/cache_reserve.py b/src/cloudflare/resources/cache/cache_reserve.py index df5c9f28ccf..faed800a058 100644 --- a/src/cloudflare/resources/cache/cache_reserve.py +++ b/src/cloudflare/resources/cache/cache_reserve.py @@ -35,7 +35,7 @@ class CacheReserveResource(SyncAPIResource): @cached_property def with_raw_response(self) -> CacheReserveResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -234,7 +234,7 @@ class AsyncCacheReserveResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncCacheReserveResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/cache/regional_tiered_cache.py b/src/cloudflare/resources/cache/regional_tiered_cache.py index 69889f46644..8d1bffd5068 100644 --- a/src/cloudflare/resources/cache/regional_tiered_cache.py +++ b/src/cloudflare/resources/cache/regional_tiered_cache.py @@ -33,7 +33,7 @@ class RegionalTieredCacheResource(SyncAPIResource): @cached_property def with_raw_response(self) -> RegionalTieredCacheResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -142,7 +142,7 @@ class AsyncRegionalTieredCacheResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncRegionalTieredCacheResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/cache/smart_tiered_cache.py b/src/cloudflare/resources/cache/smart_tiered_cache.py index 93a2f3510cf..f18d0ebceb9 100644 --- a/src/cloudflare/resources/cache/smart_tiered_cache.py +++ b/src/cloudflare/resources/cache/smart_tiered_cache.py @@ -34,7 +34,7 @@ class SmartTieredCacheResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SmartTieredCacheResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -191,7 +191,7 @@ class AsyncSmartTieredCacheResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSmartTieredCacheResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/cache/variants.py b/src/cloudflare/resources/cache/variants.py index 04b84159e3b..3e98a9e424f 100644 --- a/src/cloudflare/resources/cache/variants.py +++ b/src/cloudflare/resources/cache/variants.py @@ -33,7 +33,7 @@ class VariantsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> VariantsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -187,7 +187,7 @@ class AsyncVariantsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncVariantsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/calls/calls.py b/src/cloudflare/resources/calls/calls.py index 52774492200..426caba933c 100644 --- a/src/cloudflare/resources/calls/calls.py +++ b/src/cloudflare/resources/calls/calls.py @@ -36,7 +36,7 @@ def turn(self) -> TURNResource: @cached_property def with_raw_response(self) -> CallsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -65,7 +65,7 @@ def turn(self) -> AsyncTURNResource: @cached_property def with_raw_response(self) -> AsyncCallsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/calls/sfu.py b/src/cloudflare/resources/calls/sfu.py index 308519974e5..7d3f0e4779a 100644 --- a/src/cloudflare/resources/calls/sfu.py +++ b/src/cloudflare/resources/calls/sfu.py @@ -36,7 +36,7 @@ class SFUResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SFUResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -274,7 +274,7 @@ class AsyncSFUResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSFUResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/calls/turn.py b/src/cloudflare/resources/calls/turn.py index ce8bb0388ee..36151babd35 100644 --- a/src/cloudflare/resources/calls/turn.py +++ b/src/cloudflare/resources/calls/turn.py @@ -36,7 +36,7 @@ class TURNResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TURNResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -268,7 +268,7 @@ class AsyncTURNResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTURNResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/certificate_authorities/certificate_authorities.py b/src/cloudflare/resources/certificate_authorities/certificate_authorities.py index ba040838349..99e853d8f13 100644 --- a/src/cloudflare/resources/certificate_authorities/certificate_authorities.py +++ b/src/cloudflare/resources/certificate_authorities/certificate_authorities.py @@ -24,7 +24,7 @@ def hostname_associations(self) -> HostnameAssociationsResource: @cached_property def with_raw_response(self) -> CertificateAuthoritiesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def hostname_associations(self) -> AsyncHostnameAssociationsResource: @cached_property def with_raw_response(self) -> AsyncCertificateAuthoritiesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/certificate_authorities/hostname_associations.py b/src/cloudflare/resources/certificate_authorities/hostname_associations.py index f3f590854bc..2a5fa044994 100644 --- a/src/cloudflare/resources/certificate_authorities/hostname_associations.py +++ b/src/cloudflare/resources/certificate_authorities/hostname_associations.py @@ -33,7 +33,7 @@ class HostnameAssociationsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> HostnameAssociationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -156,7 +156,7 @@ class AsyncHostnameAssociationsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncHostnameAssociationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/client_certificates.py b/src/cloudflare/resources/client_certificates.py index c03f8d6e5d1..881f23e02e6 100644 --- a/src/cloudflare/resources/client_certificates.py +++ b/src/cloudflare/resources/client_certificates.py @@ -33,7 +33,7 @@ class ClientCertificatesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ClientCertificatesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -312,7 +312,7 @@ class AsyncClientCertificatesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncClientCertificatesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/cloud_connector/cloud_connector.py b/src/cloudflare/resources/cloud_connector/cloud_connector.py index 896e0e9b387..906fee60939 100644 --- a/src/cloudflare/resources/cloud_connector/cloud_connector.py +++ b/src/cloudflare/resources/cloud_connector/cloud_connector.py @@ -24,7 +24,7 @@ def rules(self) -> RulesResource: @cached_property def with_raw_response(self) -> CloudConnectorResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def rules(self) -> AsyncRulesResource: @cached_property def with_raw_response(self) -> AsyncCloudConnectorResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/cloud_connector/rules.py b/src/cloudflare/resources/cloud_connector/rules.py index d067255d0ee..2d32ec5746c 100644 --- a/src/cloudflare/resources/cloud_connector/rules.py +++ b/src/cloudflare/resources/cloud_connector/rules.py @@ -33,7 +33,7 @@ class RulesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> RulesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -133,7 +133,7 @@ class AsyncRulesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncRulesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/cloudforce_one/cloudforce_one.py b/src/cloudflare/resources/cloudforce_one/cloudforce_one.py index 0194bb8910d..45e0e97bffd 100644 --- a/src/cloudflare/resources/cloudforce_one/cloudforce_one.py +++ b/src/cloudflare/resources/cloudforce_one/cloudforce_one.py @@ -24,7 +24,7 @@ def requests(self) -> RequestsResource: @cached_property def with_raw_response(self) -> CloudforceOneResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def requests(self) -> AsyncRequestsResource: @cached_property def with_raw_response(self) -> AsyncCloudforceOneResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/cloudforce_one/requests/assets.py b/src/cloudflare/resources/cloudforce_one/requests/assets.py index 5fcbea931d7..3ba735daf6d 100644 --- a/src/cloudflare/resources/cloudforce_one/requests/assets.py +++ b/src/cloudflare/resources/cloudforce_one/requests/assets.py @@ -34,7 +34,7 @@ class AssetsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> AssetsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -259,7 +259,7 @@ class AsyncAssetsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncAssetsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/cloudforce_one/requests/message.py b/src/cloudflare/resources/cloudforce_one/requests/message.py index 1127fbd6e4d..0a2ba2af0dc 100644 --- a/src/cloudflare/resources/cloudforce_one/requests/message.py +++ b/src/cloudflare/resources/cloudforce_one/requests/message.py @@ -35,7 +35,7 @@ class MessageResource(SyncAPIResource): @cached_property def with_raw_response(self) -> MessageResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -267,7 +267,7 @@ class AsyncMessageResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncMessageResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/cloudforce_one/requests/priority.py b/src/cloudflare/resources/cloudforce_one/requests/priority.py index 8c80893b5d2..29a6f7374ad 100644 --- a/src/cloudflare/resources/cloudforce_one/requests/priority.py +++ b/src/cloudflare/resources/cloudforce_one/requests/priority.py @@ -36,7 +36,7 @@ class PriorityResource(SyncAPIResource): @cached_property def with_raw_response(self) -> PriorityResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -305,7 +305,7 @@ class AsyncPriorityResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncPriorityResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/cloudforce_one/requests/requests.py b/src/cloudflare/resources/cloudforce_one/requests/requests.py index 7391f704017..e286b193820 100644 --- a/src/cloudflare/resources/cloudforce_one/requests/requests.py +++ b/src/cloudflare/resources/cloudforce_one/requests/requests.py @@ -75,7 +75,7 @@ def assets(self) -> AssetsResource: @cached_property def with_raw_response(self) -> RequestsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -529,7 +529,7 @@ def assets(self) -> AsyncAssetsResource: @cached_property def with_raw_response(self) -> AsyncRequestsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/content_scanning/content_scanning.py b/src/cloudflare/resources/content_scanning/content_scanning.py index d649fca7142..66fb40ab3cb 100644 --- a/src/cloudflare/resources/content_scanning/content_scanning.py +++ b/src/cloudflare/resources/content_scanning/content_scanning.py @@ -49,7 +49,7 @@ def settings(self) -> SettingsResource: @cached_property def with_raw_response(self) -> ContentScanningResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -156,7 +156,7 @@ def settings(self) -> AsyncSettingsResource: @cached_property def with_raw_response(self) -> AsyncContentScanningResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/content_scanning/payloads.py b/src/cloudflare/resources/content_scanning/payloads.py index f87c64ee1b9..f4530c909cb 100644 --- a/src/cloudflare/resources/content_scanning/payloads.py +++ b/src/cloudflare/resources/content_scanning/payloads.py @@ -34,7 +34,7 @@ class PayloadsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> PayloadsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -176,7 +176,7 @@ class AsyncPayloadsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncPayloadsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/content_scanning/settings.py b/src/cloudflare/resources/content_scanning/settings.py index 17cbe88d506..86da445732f 100644 --- a/src/cloudflare/resources/content_scanning/settings.py +++ b/src/cloudflare/resources/content_scanning/settings.py @@ -26,7 +26,7 @@ class SettingsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SettingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -86,7 +86,7 @@ class AsyncSettingsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSettingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/custom_certificates/custom_certificates.py b/src/cloudflare/resources/custom_certificates/custom_certificates.py index 6fff2cd6dcf..46a10ed0a04 100644 --- a/src/cloudflare/resources/custom_certificates/custom_certificates.py +++ b/src/cloudflare/resources/custom_certificates/custom_certificates.py @@ -53,7 +53,7 @@ def prioritize(self) -> PrioritizeResource: @cached_property def with_raw_response(self) -> CustomCertificatesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -412,7 +412,7 @@ def prioritize(self) -> AsyncPrioritizeResource: @cached_property def with_raw_response(self) -> AsyncCustomCertificatesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/custom_certificates/prioritize.py b/src/cloudflare/resources/custom_certificates/prioritize.py index 9759313473b..01f292bf754 100644 --- a/src/cloudflare/resources/custom_certificates/prioritize.py +++ b/src/cloudflare/resources/custom_certificates/prioritize.py @@ -31,7 +31,7 @@ class PrioritizeResource(SyncAPIResource): @cached_property def with_raw_response(self) -> PrioritizeResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -97,7 +97,7 @@ class AsyncPrioritizeResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncPrioritizeResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/custom_hostnames/custom_hostnames.py b/src/cloudflare/resources/custom_hostnames/custom_hostnames.py index 34a0517e608..3b5d9488d0c 100644 --- a/src/cloudflare/resources/custom_hostnames/custom_hostnames.py +++ b/src/cloudflare/resources/custom_hostnames/custom_hostnames.py @@ -53,7 +53,7 @@ def fallback_origin(self) -> FallbackOriginResource: @cached_property def with_raw_response(self) -> CustomHostnamesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -375,7 +375,7 @@ def fallback_origin(self) -> AsyncFallbackOriginResource: @cached_property def with_raw_response(self) -> AsyncCustomHostnamesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/custom_hostnames/fallback_origin.py b/src/cloudflare/resources/custom_hostnames/fallback_origin.py index cf7d5303191..69b389c5047 100644 --- a/src/cloudflare/resources/custom_hostnames/fallback_origin.py +++ b/src/cloudflare/resources/custom_hostnames/fallback_origin.py @@ -33,7 +33,7 @@ class FallbackOriginResource(SyncAPIResource): @cached_property def with_raw_response(self) -> FallbackOriginResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -175,7 +175,7 @@ class AsyncFallbackOriginResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncFallbackOriginResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/custom_nameservers.py b/src/cloudflare/resources/custom_nameservers.py index 17fa16ffdb8..25b3d72e34b 100644 --- a/src/cloudflare/resources/custom_nameservers.py +++ b/src/cloudflare/resources/custom_nameservers.py @@ -34,7 +34,7 @@ class CustomNameserversResource(SyncAPIResource): @cached_property def with_raw_response(self) -> CustomNameserversResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -231,7 +231,7 @@ class AsyncCustomNameserversResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncCustomNameserversResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/d1/d1.py b/src/cloudflare/resources/d1/d1.py index 24bef154ab8..514b18eff90 100644 --- a/src/cloudflare/resources/d1/d1.py +++ b/src/cloudflare/resources/d1/d1.py @@ -24,7 +24,7 @@ def database(self) -> DatabaseResource: @cached_property def with_raw_response(self) -> D1ResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def database(self) -> AsyncDatabaseResource: @cached_property def with_raw_response(self) -> AsyncD1ResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/d1/database.py b/src/cloudflare/resources/d1/database.py index c7b7ab4f53e..1dba0e54c8d 100644 --- a/src/cloudflare/resources/d1/database.py +++ b/src/cloudflare/resources/d1/database.py @@ -46,7 +46,7 @@ class DatabaseResource(SyncAPIResource): @cached_property def with_raw_response(self) -> DatabaseResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -593,7 +593,7 @@ class AsyncDatabaseResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncDatabaseResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/dcv_delegation.py b/src/cloudflare/resources/dcv_delegation.py index 7dd2878bc92..97a5e56f9b0 100644 --- a/src/cloudflare/resources/dcv_delegation.py +++ b/src/cloudflare/resources/dcv_delegation.py @@ -26,7 +26,7 @@ class DCVDelegationResource(SyncAPIResource): @cached_property def with_raw_response(self) -> DCVDelegationResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -87,7 +87,7 @@ class AsyncDCVDelegationResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncDCVDelegationResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/diagnostics/diagnostics.py b/src/cloudflare/resources/diagnostics/diagnostics.py index 4cc0693ef4d..e745c5cefb6 100644 --- a/src/cloudflare/resources/diagnostics/diagnostics.py +++ b/src/cloudflare/resources/diagnostics/diagnostics.py @@ -24,7 +24,7 @@ def traceroutes(self) -> TraceroutesResource: @cached_property def with_raw_response(self) -> DiagnosticsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def traceroutes(self) -> AsyncTraceroutesResource: @cached_property def with_raw_response(self) -> AsyncDiagnosticsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/diagnostics/traceroutes.py b/src/cloudflare/resources/diagnostics/traceroutes.py index 158e3f5ab4a..8ef33b25588 100644 --- a/src/cloudflare/resources/diagnostics/traceroutes.py +++ b/src/cloudflare/resources/diagnostics/traceroutes.py @@ -31,7 +31,7 @@ class TraceroutesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TraceroutesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -105,7 +105,7 @@ class AsyncTraceroutesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTraceroutesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/dns/analytics/analytics.py b/src/cloudflare/resources/dns/analytics/analytics.py index f81519e40af..87700f33d41 100644 --- a/src/cloudflare/resources/dns/analytics/analytics.py +++ b/src/cloudflare/resources/dns/analytics/analytics.py @@ -24,7 +24,7 @@ def reports(self) -> ReportsResource: @cached_property def with_raw_response(self) -> AnalyticsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def reports(self) -> AsyncReportsResource: @cached_property def with_raw_response(self) -> AsyncAnalyticsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/dns/analytics/reports/bytimes.py b/src/cloudflare/resources/dns/analytics/reports/bytimes.py index 910d2466048..72d3a4ca994 100644 --- a/src/cloudflare/resources/dns/analytics/reports/bytimes.py +++ b/src/cloudflare/resources/dns/analytics/reports/bytimes.py @@ -33,7 +33,7 @@ class BytimesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> BytimesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -136,7 +136,7 @@ class AsyncBytimesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncBytimesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/dns/analytics/reports/reports.py b/src/cloudflare/resources/dns/analytics/reports/reports.py index 4dde0f7d878..1f594fac3d2 100644 --- a/src/cloudflare/resources/dns/analytics/reports/reports.py +++ b/src/cloudflare/resources/dns/analytics/reports/reports.py @@ -44,7 +44,7 @@ def bytimes(self) -> BytimesResource: @cached_property def with_raw_response(self) -> ReportsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -146,7 +146,7 @@ def bytimes(self) -> AsyncBytimesResource: @cached_property def with_raw_response(self) -> AsyncReportsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/dns/dns.py b/src/cloudflare/resources/dns/dns.py index 07001eea193..a4c4157a412 100644 --- a/src/cloudflare/resources/dns/dns.py +++ b/src/cloudflare/resources/dns/dns.py @@ -72,7 +72,7 @@ def zone_transfers(self) -> ZoneTransfersResource: @cached_property def with_raw_response(self) -> DNSResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -113,7 +113,7 @@ def zone_transfers(self) -> AsyncZoneTransfersResource: @cached_property def with_raw_response(self) -> AsyncDNSResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/dns/dnssec.py b/src/cloudflare/resources/dns/dnssec.py index 28b47ae9b06..746d842ceb8 100644 --- a/src/cloudflare/resources/dns/dnssec.py +++ b/src/cloudflare/resources/dns/dnssec.py @@ -33,7 +33,7 @@ class DNSSECResource(SyncAPIResource): @cached_property def with_raw_response(self) -> DNSSECResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -201,7 +201,7 @@ class AsyncDNSSECResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncDNSSECResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/dns/records.py b/src/cloudflare/resources/dns/records.py index 61a0e3e043d..12304b13aa1 100644 --- a/src/cloudflare/resources/dns/records.py +++ b/src/cloudflare/resources/dns/records.py @@ -52,7 +52,7 @@ class RecordsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> RecordsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -4917,7 +4917,7 @@ class AsyncRecordsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncRecordsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/dns/settings/settings.py b/src/cloudflare/resources/dns/settings/settings.py index 66ea1efd97c..4c218b4bfd9 100644 --- a/src/cloudflare/resources/dns/settings/settings.py +++ b/src/cloudflare/resources/dns/settings/settings.py @@ -44,7 +44,7 @@ def views(self) -> ViewsResource: @cached_property def with_raw_response(self) -> SettingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -175,7 +175,7 @@ def views(self) -> AsyncViewsResource: @cached_property def with_raw_response(self) -> AsyncSettingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/dns/settings/views.py b/src/cloudflare/resources/dns/settings/views.py index 7a2dc39ae70..375150a5f49 100644 --- a/src/cloudflare/resources/dns/settings/views.py +++ b/src/cloudflare/resources/dns/settings/views.py @@ -37,7 +37,7 @@ class ViewsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ViewsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -331,7 +331,7 @@ class AsyncViewsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncViewsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/dns/zone_transfers/acls.py b/src/cloudflare/resources/dns/zone_transfers/acls.py index d84e39f365c..a168a160d8f 100644 --- a/src/cloudflare/resources/dns/zone_transfers/acls.py +++ b/src/cloudflare/resources/dns/zone_transfers/acls.py @@ -33,7 +33,7 @@ class ACLsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ACLsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -279,7 +279,7 @@ class AsyncACLsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncACLsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/dns/zone_transfers/force_axfr.py b/src/cloudflare/resources/dns/zone_transfers/force_axfr.py index 68b9fe2b1d5..29a688338c7 100644 --- a/src/cloudflare/resources/dns/zone_transfers/force_axfr.py +++ b/src/cloudflare/resources/dns/zone_transfers/force_axfr.py @@ -31,7 +31,7 @@ class ForceAXFRResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ForceAXFRResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -91,7 +91,7 @@ class AsyncForceAXFRResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncForceAXFRResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/dns/zone_transfers/incoming.py b/src/cloudflare/resources/dns/zone_transfers/incoming.py index f66aab359b5..f7fe66eb299 100644 --- a/src/cloudflare/resources/dns/zone_transfers/incoming.py +++ b/src/cloudflare/resources/dns/zone_transfers/incoming.py @@ -34,7 +34,7 @@ class IncomingResource(SyncAPIResource): @cached_property def with_raw_response(self) -> IncomingResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -239,7 +239,7 @@ class AsyncIncomingResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncIncomingResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/dns/zone_transfers/outgoing/outgoing.py b/src/cloudflare/resources/dns/zone_transfers/outgoing/outgoing.py index b41a091d97f..1eac09df7df 100644 --- a/src/cloudflare/resources/dns/zone_transfers/outgoing/outgoing.py +++ b/src/cloudflare/resources/dns/zone_transfers/outgoing/outgoing.py @@ -55,7 +55,7 @@ def status(self) -> StatusResource: @cached_property def with_raw_response(self) -> OutgoingResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -372,7 +372,7 @@ def status(self) -> AsyncStatusResource: @cached_property def with_raw_response(self) -> AsyncOutgoingResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/dns/zone_transfers/outgoing/status.py b/src/cloudflare/resources/dns/zone_transfers/outgoing/status.py index 4b2b11372cd..d3d1c06d3d1 100644 --- a/src/cloudflare/resources/dns/zone_transfers/outgoing/status.py +++ b/src/cloudflare/resources/dns/zone_transfers/outgoing/status.py @@ -26,7 +26,7 @@ class StatusResource(SyncAPIResource): @cached_property def with_raw_response(self) -> StatusResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -84,7 +84,7 @@ class AsyncStatusResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncStatusResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/dns/zone_transfers/peers.py b/src/cloudflare/resources/dns/zone_transfers/peers.py index 32eb1de8cb4..f320d5be5af 100644 --- a/src/cloudflare/resources/dns/zone_transfers/peers.py +++ b/src/cloudflare/resources/dns/zone_transfers/peers.py @@ -33,7 +33,7 @@ class PeersResource(SyncAPIResource): @cached_property def with_raw_response(self) -> PeersResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -280,7 +280,7 @@ class AsyncPeersResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncPeersResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/dns/zone_transfers/tsigs.py b/src/cloudflare/resources/dns/zone_transfers/tsigs.py index e172b2cf554..b31bb4fe18f 100644 --- a/src/cloudflare/resources/dns/zone_transfers/tsigs.py +++ b/src/cloudflare/resources/dns/zone_transfers/tsigs.py @@ -33,7 +33,7 @@ class TSIGsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TSIGsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -279,7 +279,7 @@ class AsyncTSIGsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTSIGsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/dns/zone_transfers/zone_transfers.py b/src/cloudflare/resources/dns/zone_transfers/zone_transfers.py index 2176aa7a60d..fd1d79142b9 100644 --- a/src/cloudflare/resources/dns/zone_transfers/zone_transfers.py +++ b/src/cloudflare/resources/dns/zone_transfers/zone_transfers.py @@ -84,7 +84,7 @@ def tsigs(self) -> TSIGsResource: @cached_property def with_raw_response(self) -> ZoneTransfersResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -129,7 +129,7 @@ def tsigs(self) -> AsyncTSIGsResource: @cached_property def with_raw_response(self) -> AsyncZoneTransfersResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/dns_firewall/analytics/analytics.py b/src/cloudflare/resources/dns_firewall/analytics/analytics.py index f81519e40af..87700f33d41 100644 --- a/src/cloudflare/resources/dns_firewall/analytics/analytics.py +++ b/src/cloudflare/resources/dns_firewall/analytics/analytics.py @@ -24,7 +24,7 @@ def reports(self) -> ReportsResource: @cached_property def with_raw_response(self) -> AnalyticsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def reports(self) -> AsyncReportsResource: @cached_property def with_raw_response(self) -> AsyncAnalyticsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/dns_firewall/analytics/reports/bytimes.py b/src/cloudflare/resources/dns_firewall/analytics/reports/bytimes.py index 308483174c4..ff8fee23551 100644 --- a/src/cloudflare/resources/dns_firewall/analytics/reports/bytimes.py +++ b/src/cloudflare/resources/dns_firewall/analytics/reports/bytimes.py @@ -33,7 +33,7 @@ class BytimesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> BytimesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -141,7 +141,7 @@ class AsyncBytimesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncBytimesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/dns_firewall/analytics/reports/reports.py b/src/cloudflare/resources/dns_firewall/analytics/reports/reports.py index 8c33b7cfdd2..75369b1ba80 100644 --- a/src/cloudflare/resources/dns_firewall/analytics/reports/reports.py +++ b/src/cloudflare/resources/dns_firewall/analytics/reports/reports.py @@ -44,7 +44,7 @@ def bytimes(self) -> BytimesResource: @cached_property def with_raw_response(self) -> ReportsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -151,7 +151,7 @@ def bytimes(self) -> AsyncBytimesResource: @cached_property def with_raw_response(self) -> AsyncReportsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/dns_firewall/dns_firewall.py b/src/cloudflare/resources/dns_firewall/dns_firewall.py index b0c5819854c..fe0264c0f89 100644 --- a/src/cloudflare/resources/dns_firewall/dns_firewall.py +++ b/src/cloudflare/resources/dns_firewall/dns_firewall.py @@ -66,7 +66,7 @@ def reverse_dns(self) -> ReverseDNSResource: @cached_property def with_raw_response(self) -> DNSFirewallResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -418,7 +418,7 @@ def reverse_dns(self) -> AsyncReverseDNSResource: @cached_property def with_raw_response(self) -> AsyncDNSFirewallResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/dns_firewall/reverse_dns.py b/src/cloudflare/resources/dns_firewall/reverse_dns.py index a14aedff4c2..23c642d9f1f 100644 --- a/src/cloudflare/resources/dns_firewall/reverse_dns.py +++ b/src/cloudflare/resources/dns_firewall/reverse_dns.py @@ -32,7 +32,7 @@ class ReverseDNSResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ReverseDNSResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -145,7 +145,7 @@ class AsyncReverseDNSResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncReverseDNSResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/durable_objects/durable_objects.py b/src/cloudflare/resources/durable_objects/durable_objects.py index 9e78ad2275b..51d31f138e1 100644 --- a/src/cloudflare/resources/durable_objects/durable_objects.py +++ b/src/cloudflare/resources/durable_objects/durable_objects.py @@ -24,7 +24,7 @@ def namespaces(self) -> NamespacesResource: @cached_property def with_raw_response(self) -> DurableObjectsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def namespaces(self) -> AsyncNamespacesResource: @cached_property def with_raw_response(self) -> AsyncDurableObjectsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/durable_objects/namespaces/namespaces.py b/src/cloudflare/resources/durable_objects/namespaces/namespaces.py index cb9ac81361c..ce6f78da88f 100644 --- a/src/cloudflare/resources/durable_objects/namespaces/namespaces.py +++ b/src/cloudflare/resources/durable_objects/namespaces/namespaces.py @@ -36,7 +36,7 @@ def objects(self) -> ObjectsResource: @cached_property def with_raw_response(self) -> NamespacesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -97,7 +97,7 @@ def objects(self) -> AsyncObjectsResource: @cached_property def with_raw_response(self) -> AsyncNamespacesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/durable_objects/namespaces/objects.py b/src/cloudflare/resources/durable_objects/namespaces/objects.py index 00ca13e1a58..35360905bbf 100644 --- a/src/cloudflare/resources/durable_objects/namespaces/objects.py +++ b/src/cloudflare/resources/durable_objects/namespaces/objects.py @@ -26,7 +26,7 @@ class ObjectsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ObjectsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -107,7 +107,7 @@ class AsyncObjectsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncObjectsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/email_routing/addresses.py b/src/cloudflare/resources/email_routing/addresses.py index e26cbde74d0..f6a173b3d95 100644 --- a/src/cloudflare/resources/email_routing/addresses.py +++ b/src/cloudflare/resources/email_routing/addresses.py @@ -33,7 +33,7 @@ class AddressesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> AddressesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -251,7 +251,7 @@ class AsyncAddressesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncAddressesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/email_routing/dns.py b/src/cloudflare/resources/email_routing/dns.py index a57b2723096..dc2723584b5 100644 --- a/src/cloudflare/resources/email_routing/dns.py +++ b/src/cloudflare/resources/email_routing/dns.py @@ -33,7 +33,7 @@ class DNSResource(SyncAPIResource): @cached_property def with_raw_response(self) -> DNSResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -226,7 +226,7 @@ class AsyncDNSResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncDNSResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/email_routing/email_routing.py b/src/cloudflare/resources/email_routing/email_routing.py index f7611f86486..9d2d44107a3 100644 --- a/src/cloudflare/resources/email_routing/email_routing.py +++ b/src/cloudflare/resources/email_routing/email_routing.py @@ -67,7 +67,7 @@ def addresses(self) -> AddressesResource: @cached_property def with_raw_response(self) -> EmailRoutingResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -224,7 +224,7 @@ def addresses(self) -> AsyncAddressesResource: @cached_property def with_raw_response(self) -> AsyncEmailRoutingResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/email_routing/rules/catch_alls.py b/src/cloudflare/resources/email_routing/rules/catch_alls.py index 7a57e522db9..1b3fa063f63 100644 --- a/src/cloudflare/resources/email_routing/rules/catch_alls.py +++ b/src/cloudflare/resources/email_routing/rules/catch_alls.py @@ -35,7 +35,7 @@ class CatchAllsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> CatchAllsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -156,7 +156,7 @@ class AsyncCatchAllsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncCatchAllsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/email_routing/rules/rules.py b/src/cloudflare/resources/email_routing/rules/rules.py index 57ba8b8cccf..02951aa2987 100644 --- a/src/cloudflare/resources/email_routing/rules/rules.py +++ b/src/cloudflare/resources/email_routing/rules/rules.py @@ -47,7 +47,7 @@ def catch_alls(self) -> CatchAllsResource: @cached_property def with_raw_response(self) -> RulesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -351,7 +351,7 @@ def catch_alls(self) -> AsyncCatchAllsResource: @cached_property def with_raw_response(self) -> AsyncRulesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/email_security/email_security.py b/src/cloudflare/resources/email_security/email_security.py index 77aaf13b7c5..e66c2ed32c6 100644 --- a/src/cloudflare/resources/email_security/email_security.py +++ b/src/cloudflare/resources/email_security/email_security.py @@ -48,7 +48,7 @@ def submissions(self) -> SubmissionsResource: @cached_property def with_raw_response(self) -> EmailSecurityResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -81,7 +81,7 @@ def submissions(self) -> AsyncSubmissionsResource: @cached_property def with_raw_response(self) -> AsyncEmailSecurityResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/email_security/investigate/detections.py b/src/cloudflare/resources/email_security/investigate/detections.py index 5087dfbd0c9..5cdf12ea035 100644 --- a/src/cloudflare/resources/email_security/investigate/detections.py +++ b/src/cloudflare/resources/email_security/investigate/detections.py @@ -26,7 +26,7 @@ class DetectionsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> DetectionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -92,7 +92,7 @@ class AsyncDetectionsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncDetectionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/email_security/investigate/investigate.py b/src/cloudflare/resources/email_security/investigate/investigate.py index ed321b9a335..118994ddfd0 100644 --- a/src/cloudflare/resources/email_security/investigate/investigate.py +++ b/src/cloudflare/resources/email_security/investigate/investigate.py @@ -116,7 +116,7 @@ def release(self) -> ReleaseResource: @cached_property def with_raw_response(self) -> InvestigateResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -326,7 +326,7 @@ def release(self) -> AsyncReleaseResource: @cached_property def with_raw_response(self) -> AsyncInvestigateResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/email_security/investigate/move.py b/src/cloudflare/resources/email_security/investigate/move.py index f3946cd6068..6b335bb8a2e 100644 --- a/src/cloudflare/resources/email_security/investigate/move.py +++ b/src/cloudflare/resources/email_security/investigate/move.py @@ -33,7 +33,7 @@ class MoveResource(SyncAPIResource): @cached_property def with_raw_response(self) -> MoveResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -152,7 +152,7 @@ class AsyncMoveResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncMoveResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/email_security/investigate/preview.py b/src/cloudflare/resources/email_security/investigate/preview.py index 89e653ae889..e7c31ad0564 100644 --- a/src/cloudflare/resources/email_security/investigate/preview.py +++ b/src/cloudflare/resources/email_security/investigate/preview.py @@ -32,7 +32,7 @@ class PreviewResource(SyncAPIResource): @cached_property def with_raw_response(self) -> PreviewResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -141,7 +141,7 @@ class AsyncPreviewResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncPreviewResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/email_security/investigate/raw.py b/src/cloudflare/resources/email_security/investigate/raw.py index b7d68ed3c2d..87b1ad9423a 100644 --- a/src/cloudflare/resources/email_security/investigate/raw.py +++ b/src/cloudflare/resources/email_security/investigate/raw.py @@ -26,7 +26,7 @@ class RawResource(SyncAPIResource): @cached_property def with_raw_response(self) -> RawResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -91,7 +91,7 @@ class AsyncRawResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncRawResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/email_security/investigate/reclassify.py b/src/cloudflare/resources/email_security/investigate/reclassify.py index c4a1a979bcb..d7efe62d3ee 100644 --- a/src/cloudflare/resources/email_security/investigate/reclassify.py +++ b/src/cloudflare/resources/email_security/investigate/reclassify.py @@ -31,7 +31,7 @@ class ReclassifyResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ReclassifyResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -107,7 +107,7 @@ class AsyncReclassifyResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncReclassifyResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/email_security/investigate/release.py b/src/cloudflare/resources/email_security/investigate/release.py index 3bfd15d7dab..59dd5500bff 100644 --- a/src/cloudflare/resources/email_security/investigate/release.py +++ b/src/cloudflare/resources/email_security/investigate/release.py @@ -30,7 +30,7 @@ class ReleaseResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ReleaseResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -94,7 +94,7 @@ class AsyncReleaseResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncReleaseResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/email_security/investigate/trace.py b/src/cloudflare/resources/email_security/investigate/trace.py index 6aec7651835..10fd2ace6d3 100644 --- a/src/cloudflare/resources/email_security/investigate/trace.py +++ b/src/cloudflare/resources/email_security/investigate/trace.py @@ -26,7 +26,7 @@ class TraceResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TraceResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -91,7 +91,7 @@ class AsyncTraceResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTraceResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/email_security/settings/allow_policies.py b/src/cloudflare/resources/email_security/settings/allow_policies.py index bfae3bab2df..9dee64c45f8 100644 --- a/src/cloudflare/resources/email_security/settings/allow_policies.py +++ b/src/cloudflare/resources/email_security/settings/allow_policies.py @@ -41,7 +41,7 @@ class AllowPoliciesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> AllowPoliciesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -379,7 +379,7 @@ class AsyncAllowPoliciesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncAllowPoliciesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/email_security/settings/block_senders.py b/src/cloudflare/resources/email_security/settings/block_senders.py index d540e200fce..a0ddfd89689 100644 --- a/src/cloudflare/resources/email_security/settings/block_senders.py +++ b/src/cloudflare/resources/email_security/settings/block_senders.py @@ -41,7 +41,7 @@ class BlockSendersResource(SyncAPIResource): @cached_property def with_raw_response(self) -> BlockSendersResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -321,7 +321,7 @@ class AsyncBlockSendersResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncBlockSendersResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/email_security/settings/domains.py b/src/cloudflare/resources/email_security/settings/domains.py index 1a92ca4e857..fd13dd469f8 100644 --- a/src/cloudflare/resources/email_security/settings/domains.py +++ b/src/cloudflare/resources/email_security/settings/domains.py @@ -37,7 +37,7 @@ class DomainsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> DomainsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -334,7 +334,7 @@ class AsyncDomainsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncDomainsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/email_security/settings/impersonation_registry.py b/src/cloudflare/resources/email_security/settings/impersonation_registry.py index 29b5532a411..5d6bc0db808 100644 --- a/src/cloudflare/resources/email_security/settings/impersonation_registry.py +++ b/src/cloudflare/resources/email_security/settings/impersonation_registry.py @@ -41,7 +41,7 @@ class ImpersonationRegistryResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ImpersonationRegistryResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -312,7 +312,7 @@ class AsyncImpersonationRegistryResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncImpersonationRegistryResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/email_security/settings/settings.py b/src/cloudflare/resources/email_security/settings/settings.py index 85df275ed99..5e8816863ef 100644 --- a/src/cloudflare/resources/email_security/settings/settings.py +++ b/src/cloudflare/resources/email_security/settings/settings.py @@ -72,7 +72,7 @@ def trusted_domains(self) -> TrustedDomainsResource: @cached_property def with_raw_response(self) -> SettingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -113,7 +113,7 @@ def trusted_domains(self) -> AsyncTrustedDomainsResource: @cached_property def with_raw_response(self) -> AsyncSettingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/email_security/settings/trusted_domains.py b/src/cloudflare/resources/email_security/settings/trusted_domains.py index 9677f9db7f7..0294efa8f81 100644 --- a/src/cloudflare/resources/email_security/settings/trusted_domains.py +++ b/src/cloudflare/resources/email_security/settings/trusted_domains.py @@ -42,7 +42,7 @@ class TrustedDomainsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TrustedDomainsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -396,7 +396,7 @@ class AsyncTrustedDomainsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTrustedDomainsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/email_security/submissions.py b/src/cloudflare/resources/email_security/submissions.py index 9aac055298f..ed644c93d33 100644 --- a/src/cloudflare/resources/email_security/submissions.py +++ b/src/cloudflare/resources/email_security/submissions.py @@ -30,7 +30,7 @@ class SubmissionsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SubmissionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -115,7 +115,7 @@ class AsyncSubmissionsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSubmissionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/filters.py b/src/cloudflare/resources/filters.py index bda722a9a26..3c9ec387a1a 100644 --- a/src/cloudflare/resources/filters.py +++ b/src/cloudflare/resources/filters.py @@ -36,7 +36,7 @@ class FiltersResource(SyncAPIResource): @cached_property def with_raw_response(self) -> FiltersResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -408,7 +408,7 @@ class AsyncFiltersResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncFiltersResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/firewall/access_rules.py b/src/cloudflare/resources/firewall/access_rules.py index 0cc4d0281e2..f24fa52ed74 100644 --- a/src/cloudflare/resources/firewall/access_rules.py +++ b/src/cloudflare/resources/firewall/access_rules.py @@ -37,7 +37,7 @@ class AccessRulesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> AccessRulesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -417,7 +417,7 @@ class AsyncAccessRulesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncAccessRulesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/firewall/firewall.py b/src/cloudflare/resources/firewall/firewall.py index daffc54b2b6..f221580e6d1 100644 --- a/src/cloudflare/resources/firewall/firewall.py +++ b/src/cloudflare/resources/firewall/firewall.py @@ -72,7 +72,7 @@ def waf(self) -> WAFResource: @cached_property def with_raw_response(self) -> FirewallResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -113,7 +113,7 @@ def waf(self) -> AsyncWAFResource: @cached_property def with_raw_response(self) -> AsyncFirewallResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/firewall/lockdowns.py b/src/cloudflare/resources/firewall/lockdowns.py index 94dd5f36c30..9552d8a15ef 100644 --- a/src/cloudflare/resources/firewall/lockdowns.py +++ b/src/cloudflare/resources/firewall/lockdowns.py @@ -36,7 +36,7 @@ class LockdownsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> LockdownsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -355,7 +355,7 @@ class AsyncLockdownsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncLockdownsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/firewall/rules.py b/src/cloudflare/resources/firewall/rules.py index 0fec41375bd..d20a9a45976 100644 --- a/src/cloudflare/resources/firewall/rules.py +++ b/src/cloudflare/resources/firewall/rules.py @@ -46,7 +46,7 @@ class RulesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> RulesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -528,7 +528,7 @@ class AsyncRulesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncRulesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/firewall/ua_rules.py b/src/cloudflare/resources/firewall/ua_rules.py index 479799dc555..c0fcef7b441 100644 --- a/src/cloudflare/resources/firewall/ua_rules.py +++ b/src/cloudflare/resources/firewall/ua_rules.py @@ -37,7 +37,7 @@ class UARulesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> UARulesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -337,7 +337,7 @@ class AsyncUARulesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncUARulesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/firewall/waf/overrides.py b/src/cloudflare/resources/firewall/waf/overrides.py index b7c1fb54be7..246af72aba2 100644 --- a/src/cloudflare/resources/firewall/waf/overrides.py +++ b/src/cloudflare/resources/firewall/waf/overrides.py @@ -40,7 +40,7 @@ class OverridesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> OverridesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -333,7 +333,7 @@ class AsyncOverridesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncOverridesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/firewall/waf/packages/groups.py b/src/cloudflare/resources/firewall/waf/packages/groups.py index 73ad704e0b8..8bf52103d0e 100644 --- a/src/cloudflare/resources/firewall/waf/packages/groups.py +++ b/src/cloudflare/resources/firewall/waf/packages/groups.py @@ -35,7 +35,7 @@ class GroupsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> GroupsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -263,7 +263,7 @@ class AsyncGroupsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncGroupsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/firewall/waf/packages/packages.py b/src/cloudflare/resources/firewall/waf/packages/packages.py index fcbc3cbbba8..38cc33944a6 100644 --- a/src/cloudflare/resources/firewall/waf/packages/packages.py +++ b/src/cloudflare/resources/firewall/waf/packages/packages.py @@ -53,7 +53,7 @@ def rules(self) -> RulesResource: @cached_property def with_raw_response(self) -> PackagesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -202,7 +202,7 @@ def rules(self) -> AsyncRulesResource: @cached_property def with_raw_response(self) -> AsyncPackagesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/firewall/waf/packages/rules.py b/src/cloudflare/resources/firewall/waf/packages/rules.py index 78843dc8cc3..f05c4cd4c26 100644 --- a/src/cloudflare/resources/firewall/waf/packages/rules.py +++ b/src/cloudflare/resources/firewall/waf/packages/rules.py @@ -35,7 +35,7 @@ class RulesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> RulesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -265,7 +265,7 @@ class AsyncRulesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncRulesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/firewall/waf/waf.py b/src/cloudflare/resources/firewall/waf/waf.py index cb86f03df71..fb7d3bc0a5e 100644 --- a/src/cloudflare/resources/firewall/waf/waf.py +++ b/src/cloudflare/resources/firewall/waf/waf.py @@ -36,7 +36,7 @@ def packages(self) -> PackagesResource: @cached_property def with_raw_response(self) -> WAFResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -65,7 +65,7 @@ def packages(self) -> AsyncPackagesResource: @cached_property def with_raw_response(self) -> AsyncWAFResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/healthchecks/healthchecks.py b/src/cloudflare/resources/healthchecks/healthchecks.py index 02deafdad36..371f7837d84 100644 --- a/src/cloudflare/resources/healthchecks/healthchecks.py +++ b/src/cloudflare/resources/healthchecks/healthchecks.py @@ -53,7 +53,7 @@ def previews(self) -> PreviewsResource: @cached_property def with_raw_response(self) -> HealthchecksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -540,7 +540,7 @@ def previews(self) -> AsyncPreviewsResource: @cached_property def with_raw_response(self) -> AsyncHealthchecksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/healthchecks/previews.py b/src/cloudflare/resources/healthchecks/previews.py index cc6d9a91a21..64d89f98401 100644 --- a/src/cloudflare/resources/healthchecks/previews.py +++ b/src/cloudflare/resources/healthchecks/previews.py @@ -35,7 +35,7 @@ class PreviewsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> PreviewsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -248,7 +248,7 @@ class AsyncPreviewsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncPreviewsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/hostnames/hostnames.py b/src/cloudflare/resources/hostnames/hostnames.py index 80ec7252072..aab0b8e2160 100644 --- a/src/cloudflare/resources/hostnames/hostnames.py +++ b/src/cloudflare/resources/hostnames/hostnames.py @@ -24,7 +24,7 @@ def settings(self) -> SettingsResource: @cached_property def with_raw_response(self) -> HostnamesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def settings(self) -> AsyncSettingsResource: @cached_property def with_raw_response(self) -> AsyncHostnamesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/hostnames/settings/settings.py b/src/cloudflare/resources/hostnames/settings/settings.py index b58aa0bd92c..d819fbec1fc 100644 --- a/src/cloudflare/resources/hostnames/settings/settings.py +++ b/src/cloudflare/resources/hostnames/settings/settings.py @@ -24,7 +24,7 @@ def tls(self) -> TLSResource: @cached_property def with_raw_response(self) -> SettingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def tls(self) -> AsyncTLSResource: @cached_property def with_raw_response(self) -> AsyncSettingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/hostnames/settings/tls.py b/src/cloudflare/resources/hostnames/settings/tls.py index 254408df0b9..c40474a516b 100644 --- a/src/cloudflare/resources/hostnames/settings/tls.py +++ b/src/cloudflare/resources/hostnames/settings/tls.py @@ -35,7 +35,7 @@ class TLSResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TLSResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -202,7 +202,7 @@ class AsyncTLSResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTLSResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/hyperdrive/configs.py b/src/cloudflare/resources/hyperdrive/configs.py index b82e2139e3f..cf6097cb044 100644 --- a/src/cloudflare/resources/hyperdrive/configs.py +++ b/src/cloudflare/resources/hyperdrive/configs.py @@ -36,7 +36,7 @@ class ConfigsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ConfigsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -343,7 +343,7 @@ class AsyncConfigsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncConfigsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/hyperdrive/hyperdrive.py b/src/cloudflare/resources/hyperdrive/hyperdrive.py index 827cc7743cc..e1184bb47f0 100644 --- a/src/cloudflare/resources/hyperdrive/hyperdrive.py +++ b/src/cloudflare/resources/hyperdrive/hyperdrive.py @@ -24,7 +24,7 @@ def configs(self) -> ConfigsResource: @cached_property def with_raw_response(self) -> HyperdriveResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def configs(self) -> AsyncConfigsResource: @cached_property def with_raw_response(self) -> AsyncHyperdriveResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/iam/iam.py b/src/cloudflare/resources/iam/iam.py index 8ef0524a538..af426ac7b67 100644 --- a/src/cloudflare/resources/iam/iam.py +++ b/src/cloudflare/resources/iam/iam.py @@ -36,7 +36,7 @@ def resource_groups(self) -> ResourceGroupsResource: @cached_property def with_raw_response(self) -> IAMResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -65,7 +65,7 @@ def resource_groups(self) -> AsyncResourceGroupsResource: @cached_property def with_raw_response(self) -> AsyncIAMResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/iam/permission_groups.py b/src/cloudflare/resources/iam/permission_groups.py index 668d5ef22e3..78236659d72 100644 --- a/src/cloudflare/resources/iam/permission_groups.py +++ b/src/cloudflare/resources/iam/permission_groups.py @@ -26,7 +26,7 @@ class PermissionGroupsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> PermissionGroupsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -153,7 +153,7 @@ class AsyncPermissionGroupsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncPermissionGroupsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/iam/resource_groups.py b/src/cloudflare/resources/iam/resource_groups.py index bc59fdf86a5..463d3d72b20 100644 --- a/src/cloudflare/resources/iam/resource_groups.py +++ b/src/cloudflare/resources/iam/resource_groups.py @@ -35,7 +35,7 @@ class ResourceGroupsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ResourceGroupsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -301,7 +301,7 @@ class AsyncResourceGroupsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncResourceGroupsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/images/images.py b/src/cloudflare/resources/images/images.py index 692ab89c259..89e40405f5b 100644 --- a/src/cloudflare/resources/images/images.py +++ b/src/cloudflare/resources/images/images.py @@ -36,7 +36,7 @@ def v2(self) -> V2Resource: @cached_property def with_raw_response(self) -> ImagesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -65,7 +65,7 @@ def v2(self) -> AsyncV2Resource: @cached_property def with_raw_response(self) -> AsyncImagesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/images/v1/blobs.py b/src/cloudflare/resources/images/v1/blobs.py index 598a262a602..8eb95cd7a1a 100644 --- a/src/cloudflare/resources/images/v1/blobs.py +++ b/src/cloudflare/resources/images/v1/blobs.py @@ -26,7 +26,7 @@ class BlobsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> BlobsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -90,7 +90,7 @@ class AsyncBlobsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncBlobsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/images/v1/keys.py b/src/cloudflare/resources/images/v1/keys.py index 5f0f7f6162b..058413ade7d 100644 --- a/src/cloudflare/resources/images/v1/keys.py +++ b/src/cloudflare/resources/images/v1/keys.py @@ -28,7 +28,7 @@ class KeysResource(SyncAPIResource): @cached_property def with_raw_response(self) -> KeysResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -176,7 +176,7 @@ class AsyncKeysResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncKeysResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/images/v1/stats.py b/src/cloudflare/resources/images/v1/stats.py index 92d0129559c..544d3ff9188 100644 --- a/src/cloudflare/resources/images/v1/stats.py +++ b/src/cloudflare/resources/images/v1/stats.py @@ -26,7 +26,7 @@ class StatsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> StatsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -86,7 +86,7 @@ class AsyncStatsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncStatsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/images/v1/v1.py b/src/cloudflare/resources/images/v1/v1.py index ca83f78ae9e..8955f23f00f 100644 --- a/src/cloudflare/resources/images/v1/v1.py +++ b/src/cloudflare/resources/images/v1/v1.py @@ -82,7 +82,7 @@ def blobs(self) -> BlobsResource: @cached_property def with_raw_response(self) -> V1ResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -398,7 +398,7 @@ def blobs(self) -> AsyncBlobsResource: @cached_property def with_raw_response(self) -> AsyncV1ResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/images/v1/variants.py b/src/cloudflare/resources/images/v1/variants.py index 57fb0e7ef67..86a7c8dadb4 100644 --- a/src/cloudflare/resources/images/v1/variants.py +++ b/src/cloudflare/resources/images/v1/variants.py @@ -35,7 +35,7 @@ class VariantsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> VariantsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -295,7 +295,7 @@ class AsyncVariantsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncVariantsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/images/v2/direct_uploads.py b/src/cloudflare/resources/images/v2/direct_uploads.py index 04c1e4d151e..f47d8193540 100644 --- a/src/cloudflare/resources/images/v2/direct_uploads.py +++ b/src/cloudflare/resources/images/v2/direct_uploads.py @@ -32,7 +32,7 @@ class DirectUploadsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> DirectUploadsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -128,7 +128,7 @@ class AsyncDirectUploadsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncDirectUploadsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/images/v2/v2.py b/src/cloudflare/resources/images/v2/v2.py index 8d934fc798c..91f7cca2429 100644 --- a/src/cloudflare/resources/images/v2/v2.py +++ b/src/cloudflare/resources/images/v2/v2.py @@ -44,7 +44,7 @@ def direct_uploads(self) -> DirectUploadsResource: @cached_property def with_raw_response(self) -> V2ResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -128,7 +128,7 @@ def direct_uploads(self) -> AsyncDirectUploadsResource: @cached_property def with_raw_response(self) -> AsyncV2ResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/intel/asn/asn.py b/src/cloudflare/resources/intel/asn/asn.py index a5e04bd3da6..6c6884d1552 100644 --- a/src/cloudflare/resources/intel/asn/asn.py +++ b/src/cloudflare/resources/intel/asn/asn.py @@ -38,7 +38,7 @@ def subnets(self) -> SubnetsResource: @cached_property def with_raw_response(self) -> ASNResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -104,7 +104,7 @@ def subnets(self) -> AsyncSubnetsResource: @cached_property def with_raw_response(self) -> AsyncASNResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/intel/asn/subnets.py b/src/cloudflare/resources/intel/asn/subnets.py index c747c154597..795cfc1b225 100644 --- a/src/cloudflare/resources/intel/asn/subnets.py +++ b/src/cloudflare/resources/intel/asn/subnets.py @@ -24,7 +24,7 @@ class SubnetsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SubnetsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -81,7 +81,7 @@ class AsyncSubnetsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSubnetsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/intel/attack_surface_report/attack_surface_report.py b/src/cloudflare/resources/intel/attack_surface_report/attack_surface_report.py index 5fc264c24db..36fe0388e71 100644 --- a/src/cloudflare/resources/intel/attack_surface_report/attack_surface_report.py +++ b/src/cloudflare/resources/intel/attack_surface_report/attack_surface_report.py @@ -36,7 +36,7 @@ def issues(self) -> IssuesResource: @cached_property def with_raw_response(self) -> AttackSurfaceReportResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -65,7 +65,7 @@ def issues(self) -> AsyncIssuesResource: @cached_property def with_raw_response(self) -> AsyncAttackSurfaceReportResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/intel/attack_surface_report/issue_types.py b/src/cloudflare/resources/intel/attack_surface_report/issue_types.py index fa48badbde4..11ec7be69bd 100644 --- a/src/cloudflare/resources/intel/attack_surface_report/issue_types.py +++ b/src/cloudflare/resources/intel/attack_surface_report/issue_types.py @@ -26,7 +26,7 @@ class IssueTypesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> IssueTypesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -86,7 +86,7 @@ class AsyncIssueTypesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncIssueTypesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/intel/attack_surface_report/issues.py b/src/cloudflare/resources/intel/attack_surface_report/issues.py index 1bdc2580cc0..dd7fc81a8be 100644 --- a/src/cloudflare/resources/intel/attack_surface_report/issues.py +++ b/src/cloudflare/resources/intel/attack_surface_report/issues.py @@ -44,7 +44,7 @@ class IssuesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> IssuesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -377,7 +377,7 @@ class AsyncIssuesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncIssuesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/intel/dns.py b/src/cloudflare/resources/intel/dns.py index 1d6f5b1321d..85b44119b8a 100644 --- a/src/cloudflare/resources/intel/dns.py +++ b/src/cloudflare/resources/intel/dns.py @@ -28,7 +28,7 @@ class DNSResource(SyncAPIResource): @cached_property def with_raw_response(self) -> DNSResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -105,7 +105,7 @@ class AsyncDNSResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncDNSResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/intel/domain_history.py b/src/cloudflare/resources/intel/domain_history.py index 520cea8e26b..69a191555ef 100644 --- a/src/cloudflare/resources/intel/domain_history.py +++ b/src/cloudflare/resources/intel/domain_history.py @@ -31,7 +31,7 @@ class DomainHistoryResource(SyncAPIResource): @cached_property def with_raw_response(self) -> DomainHistoryResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -94,7 +94,7 @@ class AsyncDomainHistoryResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncDomainHistoryResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/intel/domains/bulks.py b/src/cloudflare/resources/intel/domains/bulks.py index 6ca4e2d10ed..aa030f4fe16 100644 --- a/src/cloudflare/resources/intel/domains/bulks.py +++ b/src/cloudflare/resources/intel/domains/bulks.py @@ -31,7 +31,7 @@ class BulksResource(SyncAPIResource): @cached_property def with_raw_response(self) -> BulksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -95,7 +95,7 @@ class AsyncBulksResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncBulksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/intel/domains/domains.py b/src/cloudflare/resources/intel/domains/domains.py index df6bfd6fc03..1a8ec4db0fc 100644 --- a/src/cloudflare/resources/intel/domains/domains.py +++ b/src/cloudflare/resources/intel/domains/domains.py @@ -43,7 +43,7 @@ def bulks(self) -> BulksResource: @cached_property def with_raw_response(self) -> DomainsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -109,7 +109,7 @@ def bulks(self) -> AsyncBulksResource: @cached_property def with_raw_response(self) -> AsyncDomainsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/intel/indicator_feeds/downloads.py b/src/cloudflare/resources/intel/indicator_feeds/downloads.py index 42401a356fa..404782b0df3 100644 --- a/src/cloudflare/resources/intel/indicator_feeds/downloads.py +++ b/src/cloudflare/resources/intel/indicator_feeds/downloads.py @@ -26,7 +26,7 @@ class DownloadsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> DownloadsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -89,7 +89,7 @@ class AsyncDownloadsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncDownloadsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/intel/indicator_feeds/indicator_feeds.py b/src/cloudflare/resources/intel/indicator_feeds/indicator_feeds.py index 9a52a6aea57..cde81760741 100644 --- a/src/cloudflare/resources/intel/indicator_feeds/indicator_feeds.py +++ b/src/cloudflare/resources/intel/indicator_feeds/indicator_feeds.py @@ -71,7 +71,7 @@ def downloads(self) -> DownloadsResource: @cached_property def with_raw_response(self) -> IndicatorFeedsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -340,7 +340,7 @@ def downloads(self) -> AsyncDownloadsResource: @cached_property def with_raw_response(self) -> AsyncIndicatorFeedsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/intel/indicator_feeds/permissions.py b/src/cloudflare/resources/intel/indicator_feeds/permissions.py index b2af4d96409..e3b21f70855 100644 --- a/src/cloudflare/resources/intel/indicator_feeds/permissions.py +++ b/src/cloudflare/resources/intel/indicator_feeds/permissions.py @@ -33,7 +33,7 @@ class PermissionsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> PermissionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -197,7 +197,7 @@ class AsyncPermissionsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncPermissionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/intel/indicator_feeds/snapshots.py b/src/cloudflare/resources/intel/indicator_feeds/snapshots.py index 439d47cbdf1..56b8fb47129 100644 --- a/src/cloudflare/resources/intel/indicator_feeds/snapshots.py +++ b/src/cloudflare/resources/intel/indicator_feeds/snapshots.py @@ -31,7 +31,7 @@ class SnapshotsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SnapshotsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -102,7 +102,7 @@ class AsyncSnapshotsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSnapshotsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/intel/intel.py b/src/cloudflare/resources/intel/intel.py index a581d557b90..91085befdd3 100644 --- a/src/cloudflare/resources/intel/intel.py +++ b/src/cloudflare/resources/intel/intel.py @@ -144,7 +144,7 @@ def attack_surface_report(self) -> AttackSurfaceReportResource: @cached_property def with_raw_response(self) -> IntelResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -209,7 +209,7 @@ def attack_surface_report(self) -> AsyncAttackSurfaceReportResource: @cached_property def with_raw_response(self) -> AsyncIntelResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/intel/ip_lists.py b/src/cloudflare/resources/intel/ip_lists.py index fa67aeaa5e2..4a35366f10b 100644 --- a/src/cloudflare/resources/intel/ip_lists.py +++ b/src/cloudflare/resources/intel/ip_lists.py @@ -26,7 +26,7 @@ class IPListsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> IPListsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -86,7 +86,7 @@ class AsyncIPListsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncIPListsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/intel/ips.py b/src/cloudflare/resources/intel/ips.py index a4dc0498363..ab270a429d2 100644 --- a/src/cloudflare/resources/intel/ips.py +++ b/src/cloudflare/resources/intel/ips.py @@ -31,7 +31,7 @@ class IPsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> IPsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -101,7 +101,7 @@ class AsyncIPsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncIPsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/intel/miscategorizations.py b/src/cloudflare/resources/intel/miscategorizations.py index 0694c325b64..f4fa8a2b072 100644 --- a/src/cloudflare/resources/intel/miscategorizations.py +++ b/src/cloudflare/resources/intel/miscategorizations.py @@ -31,7 +31,7 @@ class MiscategorizationsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> MiscategorizationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -120,7 +120,7 @@ class AsyncMiscategorizationsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncMiscategorizationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/intel/sinkholes.py b/src/cloudflare/resources/intel/sinkholes.py index 676b103ef20..eed9502dec3 100644 --- a/src/cloudflare/resources/intel/sinkholes.py +++ b/src/cloudflare/resources/intel/sinkholes.py @@ -24,7 +24,7 @@ class SinkholesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SinkholesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -81,7 +81,7 @@ class AsyncSinkholesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSinkholesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/intel/whois.py b/src/cloudflare/resources/intel/whois.py index 557df8d82d6..8351881a072 100644 --- a/src/cloudflare/resources/intel/whois.py +++ b/src/cloudflare/resources/intel/whois.py @@ -31,7 +31,7 @@ class WhoisResource(SyncAPIResource): @cached_property def with_raw_response(self) -> WhoisResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -93,7 +93,7 @@ class AsyncWhoisResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncWhoisResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/ips.py b/src/cloudflare/resources/ips.py index 9134f5f93a5..0c2de51fedf 100644 --- a/src/cloudflare/resources/ips.py +++ b/src/cloudflare/resources/ips.py @@ -31,7 +31,7 @@ class IPsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> IPsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -98,7 +98,7 @@ class AsyncIPsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncIPsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/keyless_certificates.py b/src/cloudflare/resources/keyless_certificates.py index d840befbbf4..898441ae15e 100644 --- a/src/cloudflare/resources/keyless_certificates.py +++ b/src/cloudflare/resources/keyless_certificates.py @@ -36,7 +36,7 @@ class KeylessCertificatesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> KeylessCertificatesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -333,7 +333,7 @@ class AsyncKeylessCertificatesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncKeylessCertificatesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/kv/kv.py b/src/cloudflare/resources/kv/kv.py index 021d59fad17..e6c1cc36c57 100644 --- a/src/cloudflare/resources/kv/kv.py +++ b/src/cloudflare/resources/kv/kv.py @@ -24,7 +24,7 @@ def namespaces(self) -> NamespacesResource: @cached_property def with_raw_response(self) -> KVResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def namespaces(self) -> AsyncNamespacesResource: @cached_property def with_raw_response(self) -> AsyncKVResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/kv/namespaces/analytics.py b/src/cloudflare/resources/kv/namespaces/analytics.py index 37867f6365e..bfcbd6d9058 100644 --- a/src/cloudflare/resources/kv/namespaces/analytics.py +++ b/src/cloudflare/resources/kv/namespaces/analytics.py @@ -32,7 +32,7 @@ class AnalyticsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> AnalyticsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -139,7 +139,7 @@ class AsyncAnalyticsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncAnalyticsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/kv/namespaces/keys.py b/src/cloudflare/resources/kv/namespaces/keys.py index a00c6e2c6a2..74f23131457 100644 --- a/src/cloudflare/resources/kv/namespaces/keys.py +++ b/src/cloudflare/resources/kv/namespaces/keys.py @@ -26,7 +26,7 @@ class KeysResource(SyncAPIResource): @cached_property def with_raw_response(self) -> KeysResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -113,7 +113,7 @@ class AsyncKeysResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncKeysResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/kv/namespaces/metadata.py b/src/cloudflare/resources/kv/namespaces/metadata.py index 4a7fbdf960a..fd5a0d2dad7 100644 --- a/src/cloudflare/resources/kv/namespaces/metadata.py +++ b/src/cloudflare/resources/kv/namespaces/metadata.py @@ -26,7 +26,7 @@ class MetadataResource(SyncAPIResource): @cached_property def with_raw_response(self) -> MetadataResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -100,7 +100,7 @@ class AsyncMetadataResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncMetadataResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/kv/namespaces/namespaces.py b/src/cloudflare/resources/kv/namespaces/namespaces.py index fa99d1d498c..c5d42615d89 100644 --- a/src/cloudflare/resources/kv/namespaces/namespaces.py +++ b/src/cloudflare/resources/kv/namespaces/namespaces.py @@ -90,7 +90,7 @@ def values(self) -> ValuesResource: @cached_property def with_raw_response(self) -> NamespacesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -469,7 +469,7 @@ def values(self) -> AsyncValuesResource: @cached_property def with_raw_response(self) -> AsyncNamespacesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/kv/namespaces/values.py b/src/cloudflare/resources/kv/namespaces/values.py index 8d4afac5ae9..a4baf589cea 100644 --- a/src/cloudflare/resources/kv/namespaces/values.py +++ b/src/cloudflare/resources/kv/namespaces/values.py @@ -40,7 +40,7 @@ class ValuesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ValuesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -251,7 +251,7 @@ class AsyncValuesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncValuesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/leaked_credential_checks/detections.py b/src/cloudflare/resources/leaked_credential_checks/detections.py index 958c2a1905f..2665ffb5701 100644 --- a/src/cloudflare/resources/leaked_credential_checks/detections.py +++ b/src/cloudflare/resources/leaked_credential_checks/detections.py @@ -34,7 +34,7 @@ class DetectionsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> DetectionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -244,7 +244,7 @@ class AsyncDetectionsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncDetectionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/leaked_credential_checks/leaked_credential_checks.py b/src/cloudflare/resources/leaked_credential_checks/leaked_credential_checks.py index 23a2ab73a83..ba6460df7d3 100644 --- a/src/cloudflare/resources/leaked_credential_checks/leaked_credential_checks.py +++ b/src/cloudflare/resources/leaked_credential_checks/leaked_credential_checks.py @@ -46,7 +46,7 @@ def detections(self) -> DetectionsResource: @cached_property def with_raw_response(self) -> LeakedCredentialChecksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -155,7 +155,7 @@ def detections(self) -> AsyncDetectionsResource: @cached_property def with_raw_response(self) -> AsyncLeakedCredentialChecksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/load_balancers/load_balancers.py b/src/cloudflare/resources/load_balancers/load_balancers.py index 0285862d2c7..fadca765824 100644 --- a/src/cloudflare/resources/load_balancers/load_balancers.py +++ b/src/cloudflare/resources/load_balancers/load_balancers.py @@ -107,7 +107,7 @@ def searches(self) -> SearchesResource: @cached_property def with_raw_response(self) -> LoadBalancersResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -848,7 +848,7 @@ def searches(self) -> AsyncSearchesResource: @cached_property def with_raw_response(self) -> AsyncLoadBalancersResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/load_balancers/monitors/monitors.py b/src/cloudflare/resources/load_balancers/monitors/monitors.py index b7dbe192fbe..d0124ef7e5b 100644 --- a/src/cloudflare/resources/load_balancers/monitors/monitors.py +++ b/src/cloudflare/resources/load_balancers/monitors/monitors.py @@ -58,7 +58,7 @@ def references(self) -> ReferencesResource: @cached_property def with_raw_response(self) -> MonitorsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -588,7 +588,7 @@ def references(self) -> AsyncReferencesResource: @cached_property def with_raw_response(self) -> AsyncMonitorsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/load_balancers/monitors/previews.py b/src/cloudflare/resources/load_balancers/monitors/previews.py index bcddb93a21f..ff60a835b53 100644 --- a/src/cloudflare/resources/load_balancers/monitors/previews.py +++ b/src/cloudflare/resources/load_balancers/monitors/previews.py @@ -32,7 +32,7 @@ class PreviewsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> PreviewsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -183,7 +183,7 @@ class AsyncPreviewsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncPreviewsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/load_balancers/monitors/references.py b/src/cloudflare/resources/load_balancers/monitors/references.py index 5d84aa4cd03..54e233d0817 100644 --- a/src/cloudflare/resources/load_balancers/monitors/references.py +++ b/src/cloudflare/resources/load_balancers/monitors/references.py @@ -26,7 +26,7 @@ class ReferencesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ReferencesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -89,7 +89,7 @@ class AsyncReferencesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncReferencesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/load_balancers/pools/health.py b/src/cloudflare/resources/load_balancers/pools/health.py index 1b80a29b524..b62a3bfcc60 100644 --- a/src/cloudflare/resources/load_balancers/pools/health.py +++ b/src/cloudflare/resources/load_balancers/pools/health.py @@ -33,7 +33,7 @@ class HealthResource(SyncAPIResource): @cached_property def with_raw_response(self) -> HealthResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -226,7 +226,7 @@ class AsyncHealthResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncHealthResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/load_balancers/pools/pools.py b/src/cloudflare/resources/load_balancers/pools/pools.py index db842db77eb..9465ec04317 100644 --- a/src/cloudflare/resources/load_balancers/pools/pools.py +++ b/src/cloudflare/resources/load_balancers/pools/pools.py @@ -70,7 +70,7 @@ def references(self) -> ReferencesResource: @cached_property def with_raw_response(self) -> PoolsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -613,7 +613,7 @@ def references(self) -> AsyncReferencesResource: @cached_property def with_raw_response(self) -> AsyncPoolsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/load_balancers/pools/references.py b/src/cloudflare/resources/load_balancers/pools/references.py index fae7e8b60ef..fa529b572d7 100644 --- a/src/cloudflare/resources/load_balancers/pools/references.py +++ b/src/cloudflare/resources/load_balancers/pools/references.py @@ -26,7 +26,7 @@ class ReferencesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ReferencesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -89,7 +89,7 @@ class AsyncReferencesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncReferencesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/load_balancers/previews.py b/src/cloudflare/resources/load_balancers/previews.py index 7ec660fcb7c..73f409f054a 100644 --- a/src/cloudflare/resources/load_balancers/previews.py +++ b/src/cloudflare/resources/load_balancers/previews.py @@ -26,7 +26,7 @@ class PreviewsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> PreviewsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -89,7 +89,7 @@ class AsyncPreviewsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncPreviewsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/load_balancers/regions.py b/src/cloudflare/resources/load_balancers/regions.py index 3c03cacef9e..48aada991bf 100644 --- a/src/cloudflare/resources/load_balancers/regions.py +++ b/src/cloudflare/resources/load_balancers/regions.py @@ -33,7 +33,7 @@ class RegionsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> RegionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -170,7 +170,7 @@ class AsyncRegionsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncRegionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/load_balancers/searches.py b/src/cloudflare/resources/load_balancers/searches.py index dae4a4e81f8..cc09d14445d 100644 --- a/src/cloudflare/resources/load_balancers/searches.py +++ b/src/cloudflare/resources/load_balancers/searches.py @@ -31,7 +31,7 @@ class SearchesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SearchesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -102,7 +102,7 @@ class AsyncSearchesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSearchesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/logpush/datasets/datasets.py b/src/cloudflare/resources/logpush/datasets/datasets.py index 7edcda95d4c..2fd38e2140d 100644 --- a/src/cloudflare/resources/logpush/datasets/datasets.py +++ b/src/cloudflare/resources/logpush/datasets/datasets.py @@ -36,7 +36,7 @@ def jobs(self) -> JobsResource: @cached_property def with_raw_response(self) -> DatasetsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -65,7 +65,7 @@ def jobs(self) -> AsyncJobsResource: @cached_property def with_raw_response(self) -> AsyncDatasetsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/logpush/datasets/fields.py b/src/cloudflare/resources/logpush/datasets/fields.py index caf5e43f3a4..ce961045c6f 100644 --- a/src/cloudflare/resources/logpush/datasets/fields.py +++ b/src/cloudflare/resources/logpush/datasets/fields.py @@ -25,7 +25,7 @@ class FieldsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> FieldsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -106,7 +106,7 @@ class AsyncFieldsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncFieldsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/logpush/datasets/jobs.py b/src/cloudflare/resources/logpush/datasets/jobs.py index 2f0fb34f612..f2b6a8ec25e 100644 --- a/src/cloudflare/resources/logpush/datasets/jobs.py +++ b/src/cloudflare/resources/logpush/datasets/jobs.py @@ -26,7 +26,7 @@ class JobsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> JobsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -105,7 +105,7 @@ class AsyncJobsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncJobsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/logpush/edge.py b/src/cloudflare/resources/logpush/edge.py index 10e1ae3c7b6..5d460b18334 100644 --- a/src/cloudflare/resources/logpush/edge.py +++ b/src/cloudflare/resources/logpush/edge.py @@ -32,7 +32,7 @@ class EdgeResource(SyncAPIResource): @cached_property def with_raw_response(self) -> EdgeResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -150,7 +150,7 @@ class AsyncEdgeResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncEdgeResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/logpush/jobs.py b/src/cloudflare/resources/logpush/jobs.py index 76ed1b79c19..eb9296b8012 100644 --- a/src/cloudflare/resources/logpush/jobs.py +++ b/src/cloudflare/resources/logpush/jobs.py @@ -35,7 +35,7 @@ class JobsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> JobsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -475,7 +475,7 @@ class AsyncJobsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncJobsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/logpush/logpush.py b/src/cloudflare/resources/logpush/logpush.py index 11b9fc672e6..c511e905a9b 100644 --- a/src/cloudflare/resources/logpush/logpush.py +++ b/src/cloudflare/resources/logpush/logpush.py @@ -72,7 +72,7 @@ def validate(self) -> ValidateResource: @cached_property def with_raw_response(self) -> LogpushResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -113,7 +113,7 @@ def validate(self) -> AsyncValidateResource: @cached_property def with_raw_response(self) -> AsyncLogpushResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/logpush/ownership.py b/src/cloudflare/resources/logpush/ownership.py index 5e26d1d5e01..d1b236c4082 100644 --- a/src/cloudflare/resources/logpush/ownership.py +++ b/src/cloudflare/resources/logpush/ownership.py @@ -32,7 +32,7 @@ class OwnershipResource(SyncAPIResource): @cached_property def with_raw_response(self) -> OwnershipResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -178,7 +178,7 @@ class AsyncOwnershipResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncOwnershipResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/logpush/validate.py b/src/cloudflare/resources/logpush/validate.py index 34d1803113c..2a8e2e4e524 100644 --- a/src/cloudflare/resources/logpush/validate.py +++ b/src/cloudflare/resources/logpush/validate.py @@ -33,7 +33,7 @@ class ValidateResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ValidateResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -237,7 +237,7 @@ class AsyncValidateResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncValidateResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/logs/control/cmb/cmb.py b/src/cloudflare/resources/logs/control/cmb/cmb.py index f6123d97939..56f946d9c8b 100644 --- a/src/cloudflare/resources/logs/control/cmb/cmb.py +++ b/src/cloudflare/resources/logs/control/cmb/cmb.py @@ -24,7 +24,7 @@ def config(self) -> ConfigResource: @cached_property def with_raw_response(self) -> CmbResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def config(self) -> AsyncConfigResource: @cached_property def with_raw_response(self) -> AsyncCmbResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/logs/control/cmb/config.py b/src/cloudflare/resources/logs/control/cmb/config.py index f172df05fa6..d07c418deb3 100644 --- a/src/cloudflare/resources/logs/control/cmb/config.py +++ b/src/cloudflare/resources/logs/control/cmb/config.py @@ -31,7 +31,7 @@ class ConfigResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ConfigResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -173,7 +173,7 @@ class AsyncConfigResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncConfigResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/logs/control/control.py b/src/cloudflare/resources/logs/control/control.py index 79e5950e9e5..a7881e09753 100644 --- a/src/cloudflare/resources/logs/control/control.py +++ b/src/cloudflare/resources/logs/control/control.py @@ -36,7 +36,7 @@ def cmb(self) -> CmbResource: @cached_property def with_raw_response(self) -> ControlResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -65,7 +65,7 @@ def cmb(self) -> AsyncCmbResource: @cached_property def with_raw_response(self) -> AsyncControlResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/logs/control/retention.py b/src/cloudflare/resources/logs/control/retention.py index 607a7bccf3a..450d9ce4c38 100644 --- a/src/cloudflare/resources/logs/control/retention.py +++ b/src/cloudflare/resources/logs/control/retention.py @@ -32,7 +32,7 @@ class RetentionResource(SyncAPIResource): @cached_property def with_raw_response(self) -> RetentionResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -135,7 +135,7 @@ class AsyncRetentionResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncRetentionResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/logs/logs.py b/src/cloudflare/resources/logs/logs.py index aec8832b960..edf8286a42b 100644 --- a/src/cloudflare/resources/logs/logs.py +++ b/src/cloudflare/resources/logs/logs.py @@ -48,7 +48,7 @@ def received(self) -> ReceivedResource: @cached_property def with_raw_response(self) -> LogsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -81,7 +81,7 @@ def received(self) -> AsyncReceivedResource: @cached_property def with_raw_response(self) -> AsyncLogsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/logs/rayid.py b/src/cloudflare/resources/logs/rayid.py index a89bde01676..662ea9a73c8 100644 --- a/src/cloudflare/resources/logs/rayid.py +++ b/src/cloudflare/resources/logs/rayid.py @@ -31,7 +31,7 @@ class RayIDResource(SyncAPIResource): @cached_property def with_raw_response(self) -> RayIDResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -127,7 +127,7 @@ class AsyncRayIDResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncRayIDResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/logs/received/fields.py b/src/cloudflare/resources/logs/received/fields.py index 73963d8473c..f520728bac7 100644 --- a/src/cloudflare/resources/logs/received/fields.py +++ b/src/cloudflare/resources/logs/received/fields.py @@ -23,7 +23,7 @@ class FieldsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> FieldsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -81,7 +81,7 @@ class AsyncFieldsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncFieldsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/logs/received/received.py b/src/cloudflare/resources/logs/received/received.py index 35bba6afb74..ab9a8e12549 100644 --- a/src/cloudflare/resources/logs/received/received.py +++ b/src/cloudflare/resources/logs/received/received.py @@ -43,7 +43,7 @@ def fields(self) -> FieldsResource: @cached_property def with_raw_response(self) -> ReceivedResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -178,7 +178,7 @@ def fields(self) -> AsyncFieldsResource: @cached_property def with_raw_response(self) -> AsyncReceivedResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/magic_network_monitoring/configs/configs.py b/src/cloudflare/resources/magic_network_monitoring/configs/configs.py index 81996968348..16ef8e84315 100644 --- a/src/cloudflare/resources/magic_network_monitoring/configs/configs.py +++ b/src/cloudflare/resources/magic_network_monitoring/configs/configs.py @@ -43,7 +43,7 @@ def full(self) -> FullResource: @cached_property def with_raw_response(self) -> ConfigsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -308,7 +308,7 @@ def full(self) -> AsyncFullResource: @cached_property def with_raw_response(self) -> AsyncConfigsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/magic_network_monitoring/configs/full.py b/src/cloudflare/resources/magic_network_monitoring/configs/full.py index bdfd8e8bbf6..932d65f37d0 100644 --- a/src/cloudflare/resources/magic_network_monitoring/configs/full.py +++ b/src/cloudflare/resources/magic_network_monitoring/configs/full.py @@ -26,7 +26,7 @@ class FullResource(SyncAPIResource): @cached_property def with_raw_response(self) -> FullResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -84,7 +84,7 @@ class AsyncFullResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncFullResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/magic_network_monitoring/magic_network_monitoring.py b/src/cloudflare/resources/magic_network_monitoring/magic_network_monitoring.py index 350f2492895..4c11d9c6f8a 100644 --- a/src/cloudflare/resources/magic_network_monitoring/magic_network_monitoring.py +++ b/src/cloudflare/resources/magic_network_monitoring/magic_network_monitoring.py @@ -36,7 +36,7 @@ def rules(self) -> RulesResource: @cached_property def with_raw_response(self) -> MagicNetworkMonitoringResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -65,7 +65,7 @@ def rules(self) -> AsyncRulesResource: @cached_property def with_raw_response(self) -> AsyncMagicNetworkMonitoringResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/magic_network_monitoring/rules/advertisements.py b/src/cloudflare/resources/magic_network_monitoring/rules/advertisements.py index 482662f8d5a..7959f445c19 100644 --- a/src/cloudflare/resources/magic_network_monitoring/rules/advertisements.py +++ b/src/cloudflare/resources/magic_network_monitoring/rules/advertisements.py @@ -31,7 +31,7 @@ class AdvertisementsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> AdvertisementsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -97,7 +97,7 @@ class AsyncAdvertisementsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncAdvertisementsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/magic_network_monitoring/rules/rules.py b/src/cloudflare/resources/magic_network_monitoring/rules/rules.py index 80062c1b487..9427a504bc7 100644 --- a/src/cloudflare/resources/magic_network_monitoring/rules/rules.py +++ b/src/cloudflare/resources/magic_network_monitoring/rules/rules.py @@ -44,7 +44,7 @@ def advertisements(self) -> AdvertisementsResource: @cached_property def with_raw_response(self) -> RulesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -420,7 +420,7 @@ def advertisements(self) -> AsyncAdvertisementsResource: @cached_property def with_raw_response(self) -> AsyncRulesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/magic_transit/apps.py b/src/cloudflare/resources/magic_transit/apps.py index 494d16ac656..1bc1a6a000f 100644 --- a/src/cloudflare/resources/magic_transit/apps.py +++ b/src/cloudflare/resources/magic_transit/apps.py @@ -35,7 +35,7 @@ class AppsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> AppsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -261,7 +261,7 @@ class AsyncAppsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncAppsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/magic_transit/cf_interconnects.py b/src/cloudflare/resources/magic_transit/cf_interconnects.py index a7d54b6c147..84fd33b3838 100644 --- a/src/cloudflare/resources/magic_transit/cf_interconnects.py +++ b/src/cloudflare/resources/magic_transit/cf_interconnects.py @@ -37,7 +37,7 @@ class CfInterconnectsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> CfInterconnectsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -302,7 +302,7 @@ class AsyncCfInterconnectsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncCfInterconnectsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/magic_transit/connectors.py b/src/cloudflare/resources/magic_transit/connectors.py index 722bc4dbfd1..d25b76ebd2c 100644 --- a/src/cloudflare/resources/magic_transit/connectors.py +++ b/src/cloudflare/resources/magic_transit/connectors.py @@ -35,7 +35,7 @@ class ConnectorsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ConnectorsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -248,7 +248,7 @@ class AsyncConnectorsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncConnectorsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/magic_transit/gre_tunnels.py b/src/cloudflare/resources/magic_transit/gre_tunnels.py index 1d5a624258c..8c4242e6c0d 100644 --- a/src/cloudflare/resources/magic_transit/gre_tunnels.py +++ b/src/cloudflare/resources/magic_transit/gre_tunnels.py @@ -38,7 +38,7 @@ class GRETunnelsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> GRETunnelsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -425,7 +425,7 @@ class AsyncGRETunnelsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncGRETunnelsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/magic_transit/ipsec_tunnels.py b/src/cloudflare/resources/magic_transit/ipsec_tunnels.py index e59ba9a890a..fc025c7c2e4 100644 --- a/src/cloudflare/resources/magic_transit/ipsec_tunnels.py +++ b/src/cloudflare/resources/magic_transit/ipsec_tunnels.py @@ -44,7 +44,7 @@ class IPSECTunnelsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> IPSECTunnelsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -521,7 +521,7 @@ class AsyncIPSECTunnelsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncIPSECTunnelsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/magic_transit/magic_transit.py b/src/cloudflare/resources/magic_transit/magic_transit.py index 20c5d489320..45cdcf54510 100644 --- a/src/cloudflare/resources/magic_transit/magic_transit.py +++ b/src/cloudflare/resources/magic_transit/magic_transit.py @@ -108,7 +108,7 @@ def pcaps(self) -> PCAPsResource: @cached_property def with_raw_response(self) -> MagicTransitResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -161,7 +161,7 @@ def pcaps(self) -> AsyncPCAPsResource: @cached_property def with_raw_response(self) -> AsyncMagicTransitResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/magic_transit/pcaps/download.py b/src/cloudflare/resources/magic_transit/pcaps/download.py index f37e2497f94..f354fa8c704 100644 --- a/src/cloudflare/resources/magic_transit/pcaps/download.py +++ b/src/cloudflare/resources/magic_transit/pcaps/download.py @@ -26,7 +26,7 @@ class DownloadResource(SyncAPIResource): @cached_property def with_raw_response(self) -> DownloadResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -89,7 +89,7 @@ class AsyncDownloadResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncDownloadResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/magic_transit/pcaps/ownership.py b/src/cloudflare/resources/magic_transit/pcaps/ownership.py index 9b6c8aa9deb..f9fb3922d02 100644 --- a/src/cloudflare/resources/magic_transit/pcaps/ownership.py +++ b/src/cloudflare/resources/magic_transit/pcaps/ownership.py @@ -32,7 +32,7 @@ class OwnershipResource(SyncAPIResource): @cached_property def with_raw_response(self) -> OwnershipResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -228,7 +228,7 @@ class AsyncOwnershipResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncOwnershipResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/magic_transit/pcaps/pcaps.py b/src/cloudflare/resources/magic_transit/pcaps/pcaps.py index 952a6bb2750..ebaa2c63e69 100644 --- a/src/cloudflare/resources/magic_transit/pcaps/pcaps.py +++ b/src/cloudflare/resources/magic_transit/pcaps/pcaps.py @@ -61,7 +61,7 @@ def download(self) -> DownloadResource: @cached_property def with_raw_response(self) -> PCAPsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -330,7 +330,7 @@ def download(self) -> AsyncDownloadResource: @cached_property def with_raw_response(self) -> AsyncPCAPsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/magic_transit/routes.py b/src/cloudflare/resources/magic_transit/routes.py index c8de89a8570..d0a637ce65d 100644 --- a/src/cloudflare/resources/magic_transit/routes.py +++ b/src/cloudflare/resources/magic_transit/routes.py @@ -38,7 +38,7 @@ class RoutesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> RoutesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -387,7 +387,7 @@ class AsyncRoutesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncRoutesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/magic_transit/sites/acls.py b/src/cloudflare/resources/magic_transit/sites/acls.py index a823a5bc933..fbb348cb83e 100644 --- a/src/cloudflare/resources/magic_transit/sites/acls.py +++ b/src/cloudflare/resources/magic_transit/sites/acls.py @@ -34,7 +34,7 @@ class ACLsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ACLsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -432,7 +432,7 @@ class AsyncACLsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncACLsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/magic_transit/sites/lans.py b/src/cloudflare/resources/magic_transit/sites/lans.py index bf430f65e52..12424587962 100644 --- a/src/cloudflare/resources/magic_transit/sites/lans.py +++ b/src/cloudflare/resources/magic_transit/sites/lans.py @@ -40,7 +40,7 @@ class LANsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> LANsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -418,7 +418,7 @@ class AsyncLANsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncLANsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/magic_transit/sites/sites.py b/src/cloudflare/resources/magic_transit/sites/sites.py index c19e39ba7c4..e82dabeb01d 100644 --- a/src/cloudflare/resources/magic_transit/sites/sites.py +++ b/src/cloudflare/resources/magic_transit/sites/sites.py @@ -76,7 +76,7 @@ def wans(self) -> WANsResource: @cached_property def with_raw_response(self) -> SitesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -455,7 +455,7 @@ def wans(self) -> AsyncWANsResource: @cached_property def with_raw_response(self) -> AsyncSitesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/magic_transit/sites/wans.py b/src/cloudflare/resources/magic_transit/sites/wans.py index db254579b46..4598083e7e4 100644 --- a/src/cloudflare/resources/magic_transit/sites/wans.py +++ b/src/cloudflare/resources/magic_transit/sites/wans.py @@ -34,7 +34,7 @@ class WANsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> WANsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -396,7 +396,7 @@ class AsyncWANsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncWANsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/managed_transforms.py b/src/cloudflare/resources/managed_transforms.py index 50bfea9758a..bca259e6f3a 100644 --- a/src/cloudflare/resources/managed_transforms.py +++ b/src/cloudflare/resources/managed_transforms.py @@ -32,7 +32,7 @@ class ManagedTransformsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ManagedTransformsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -180,7 +180,7 @@ class AsyncManagedTransformsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncManagedTransformsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/memberships.py b/src/cloudflare/resources/memberships.py index 3218d44c46d..7afce584e2a 100644 --- a/src/cloudflare/resources/memberships.py +++ b/src/cloudflare/resources/memberships.py @@ -36,7 +36,7 @@ class MembershipsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> MembershipsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -243,7 +243,7 @@ class AsyncMembershipsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncMembershipsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/mtls_certificates/associations.py b/src/cloudflare/resources/mtls_certificates/associations.py index 977905a6078..23f2b9ac2e8 100644 --- a/src/cloudflare/resources/mtls_certificates/associations.py +++ b/src/cloudflare/resources/mtls_certificates/associations.py @@ -26,7 +26,7 @@ class AssociationsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> AssociationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -93,7 +93,7 @@ class AsyncAssociationsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncAssociationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/mtls_certificates/mtls_certificates.py b/src/cloudflare/resources/mtls_certificates/mtls_certificates.py index 5448da93198..fcddfb2afc9 100644 --- a/src/cloudflare/resources/mtls_certificates/mtls_certificates.py +++ b/src/cloudflare/resources/mtls_certificates/mtls_certificates.py @@ -45,7 +45,7 @@ def associations(self) -> AssociationsResource: @cached_property def with_raw_response(self) -> MTLSCertificatesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -259,7 +259,7 @@ def associations(self) -> AsyncAssociationsResource: @cached_property def with_raw_response(self) -> AsyncMTLSCertificatesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/origin_ca_certificates.py b/src/cloudflare/resources/origin_ca_certificates.py index e41ecdc77b7..c5362e9fc68 100644 --- a/src/cloudflare/resources/origin_ca_certificates.py +++ b/src/cloudflare/resources/origin_ca_certificates.py @@ -36,7 +36,7 @@ class OriginCACertificatesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> OriginCACertificatesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -245,7 +245,7 @@ class AsyncOriginCACertificatesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncOriginCACertificatesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/origin_post_quantum_encryption.py b/src/cloudflare/resources/origin_post_quantum_encryption.py index ff991b49d4c..829d0007ae3 100644 --- a/src/cloudflare/resources/origin_post_quantum_encryption.py +++ b/src/cloudflare/resources/origin_post_quantum_encryption.py @@ -37,7 +37,7 @@ class OriginPostQuantumEncryptionResource(SyncAPIResource): @cached_property def with_raw_response(self) -> OriginPostQuantumEncryptionResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -158,7 +158,7 @@ class AsyncOriginPostQuantumEncryptionResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncOriginPostQuantumEncryptionResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/origin_tls_client_auth/hostnames/certificates.py b/src/cloudflare/resources/origin_tls_client_auth/hostnames/certificates.py index a618e0e0124..7686b986206 100644 --- a/src/cloudflare/resources/origin_tls_client_auth/hostnames/certificates.py +++ b/src/cloudflare/resources/origin_tls_client_auth/hostnames/certificates.py @@ -35,7 +35,7 @@ class CertificatesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> CertificatesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -234,7 +234,7 @@ class AsyncCertificatesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncCertificatesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/origin_tls_client_auth/hostnames/hostnames.py b/src/cloudflare/resources/origin_tls_client_auth/hostnames/hostnames.py index 8c4da5282b9..74516f2281e 100644 --- a/src/cloudflare/resources/origin_tls_client_auth/hostnames/hostnames.py +++ b/src/cloudflare/resources/origin_tls_client_auth/hostnames/hostnames.py @@ -44,7 +44,7 @@ def certificates(self) -> CertificatesResource: @cached_property def with_raw_response(self) -> HostnamesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -159,7 +159,7 @@ def certificates(self) -> AsyncCertificatesResource: @cached_property def with_raw_response(self) -> AsyncHostnamesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/origin_tls_client_auth/origin_tls_client_auth.py b/src/cloudflare/resources/origin_tls_client_auth/origin_tls_client_auth.py index 6088a88cfe0..cc72341e8f5 100644 --- a/src/cloudflare/resources/origin_tls_client_auth/origin_tls_client_auth.py +++ b/src/cloudflare/resources/origin_tls_client_auth/origin_tls_client_auth.py @@ -59,7 +59,7 @@ def settings(self) -> SettingsResource: @cached_property def with_raw_response(self) -> OriginTLSClientAuthResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -272,7 +272,7 @@ def settings(self) -> AsyncSettingsResource: @cached_property def with_raw_response(self) -> AsyncOriginTLSClientAuthResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/origin_tls_client_auth/settings.py b/src/cloudflare/resources/origin_tls_client_auth/settings.py index 206d76b6b36..9f0ea463c59 100644 --- a/src/cloudflare/resources/origin_tls_client_auth/settings.py +++ b/src/cloudflare/resources/origin_tls_client_auth/settings.py @@ -32,7 +32,7 @@ class SettingsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SettingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -140,7 +140,7 @@ class AsyncSettingsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSettingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/page_rules.py b/src/cloudflare/resources/page_rules.py index 669798161c2..dd1927dad48 100644 --- a/src/cloudflare/resources/page_rules.py +++ b/src/cloudflare/resources/page_rules.py @@ -40,7 +40,7 @@ class PageRulesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> PageRulesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -417,7 +417,7 @@ class AsyncPageRulesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncPageRulesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/page_shield/connections.py b/src/cloudflare/resources/page_shield/connections.py index c18a2ffc6f2..ade3e22e7ea 100644 --- a/src/cloudflare/resources/page_shield/connections.py +++ b/src/cloudflare/resources/page_shield/connections.py @@ -30,7 +30,7 @@ class ConnectionsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ConnectionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -207,7 +207,7 @@ class AsyncConnectionsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncConnectionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/page_shield/cookies.py b/src/cloudflare/resources/page_shield/cookies.py index 8250d18ce36..ff7033bca30 100644 --- a/src/cloudflare/resources/page_shield/cookies.py +++ b/src/cloudflare/resources/page_shield/cookies.py @@ -31,7 +31,7 @@ class CookiesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> CookiesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -212,7 +212,7 @@ class AsyncCookiesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncCookiesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/page_shield/page_shield.py b/src/cloudflare/resources/page_shield/page_shield.py index a2dbb60eb64..6c70012977a 100644 --- a/src/cloudflare/resources/page_shield/page_shield.py +++ b/src/cloudflare/resources/page_shield/page_shield.py @@ -80,7 +80,7 @@ def cookies(self) -> CookiesResource: @cached_property def with_raw_response(self) -> PageShieldResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -213,7 +213,7 @@ def cookies(self) -> AsyncCookiesResource: @cached_property def with_raw_response(self) -> AsyncPageShieldResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/page_shield/policies.py b/src/cloudflare/resources/page_shield/policies.py index e7066642774..a99e97b54cf 100644 --- a/src/cloudflare/resources/page_shield/policies.py +++ b/src/cloudflare/resources/page_shield/policies.py @@ -36,7 +36,7 @@ class PoliciesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> PoliciesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -313,7 +313,7 @@ class AsyncPoliciesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncPoliciesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/page_shield/scripts.py b/src/cloudflare/resources/page_shield/scripts.py index 2a3f630ba23..02f1a625320 100644 --- a/src/cloudflare/resources/page_shield/scripts.py +++ b/src/cloudflare/resources/page_shield/scripts.py @@ -31,7 +31,7 @@ class ScriptsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ScriptsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -214,7 +214,7 @@ class AsyncScriptsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncScriptsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/pages/pages.py b/src/cloudflare/resources/pages/pages.py index 4d880c318b7..9b22115816f 100644 --- a/src/cloudflare/resources/pages/pages.py +++ b/src/cloudflare/resources/pages/pages.py @@ -24,7 +24,7 @@ def projects(self) -> ProjectsResource: @cached_property def with_raw_response(self) -> PagesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def projects(self) -> AsyncProjectsResource: @cached_property def with_raw_response(self) -> AsyncPagesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/pages/projects/deployments/deployments.py b/src/cloudflare/resources/pages/projects/deployments/deployments.py index aa7f586ff08..ce67383666c 100644 --- a/src/cloudflare/resources/pages/projects/deployments/deployments.py +++ b/src/cloudflare/resources/pages/projects/deployments/deployments.py @@ -50,7 +50,7 @@ def history(self) -> HistoryResource: @cached_property def with_raw_response(self) -> DeploymentsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -380,7 +380,7 @@ def history(self) -> AsyncHistoryResource: @cached_property def with_raw_response(self) -> AsyncDeploymentsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/pages/projects/deployments/history/history.py b/src/cloudflare/resources/pages/projects/deployments/history/history.py index 97fde91aca7..818a16e095d 100644 --- a/src/cloudflare/resources/pages/projects/deployments/history/history.py +++ b/src/cloudflare/resources/pages/projects/deployments/history/history.py @@ -24,7 +24,7 @@ def logs(self) -> LogsResource: @cached_property def with_raw_response(self) -> HistoryResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def logs(self) -> AsyncLogsResource: @cached_property def with_raw_response(self) -> AsyncHistoryResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/pages/projects/deployments/history/logs.py b/src/cloudflare/resources/pages/projects/deployments/history/logs.py index d0e1743c5a2..832547b6ab5 100644 --- a/src/cloudflare/resources/pages/projects/deployments/history/logs.py +++ b/src/cloudflare/resources/pages/projects/deployments/history/logs.py @@ -26,7 +26,7 @@ class LogsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> LogsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -96,7 +96,7 @@ class AsyncLogsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncLogsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/pages/projects/domains.py b/src/cloudflare/resources/pages/projects/domains.py index db10cae25ce..928644ba5d1 100644 --- a/src/cloudflare/resources/pages/projects/domains.py +++ b/src/cloudflare/resources/pages/projects/domains.py @@ -35,7 +35,7 @@ class DomainsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> DomainsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -292,7 +292,7 @@ class AsyncDomainsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncDomainsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/pages/projects/projects.py b/src/cloudflare/resources/pages/projects/projects.py index 39c21168c3d..556100c32ce 100644 --- a/src/cloudflare/resources/pages/projects/projects.py +++ b/src/cloudflare/resources/pages/projects/projects.py @@ -57,7 +57,7 @@ def domains(self) -> DomainsResource: @cached_property def with_raw_response(self) -> ProjectsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -381,7 +381,7 @@ def domains(self) -> AsyncDomainsResource: @cached_property def with_raw_response(self) -> AsyncProjectsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/queues/consumers.py b/src/cloudflare/resources/queues/consumers.py index 16ae47bce91..0c44ae6b0f5 100644 --- a/src/cloudflare/resources/queues/consumers.py +++ b/src/cloudflare/resources/queues/consumers.py @@ -35,7 +35,7 @@ class ConsumersResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ConsumersResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -394,7 +394,7 @@ class AsyncConsumersResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncConsumersResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/queues/messages.py b/src/cloudflare/resources/queues/messages.py index 7359826a3b8..47a3f63f5b0 100644 --- a/src/cloudflare/resources/queues/messages.py +++ b/src/cloudflare/resources/queues/messages.py @@ -32,7 +32,7 @@ class MessagesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> MessagesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -164,7 +164,7 @@ class AsyncMessagesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncMessagesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/queues/queues.py b/src/cloudflare/resources/queues/queues.py index 5345646fe47..deb5d98623f 100644 --- a/src/cloudflare/resources/queues/queues.py +++ b/src/cloudflare/resources/queues/queues.py @@ -57,7 +57,7 @@ def messages(self) -> MessagesResource: @cached_property def with_raw_response(self) -> QueuesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -303,7 +303,7 @@ def messages(self) -> AsyncMessagesResource: @cached_property def with_raw_response(self) -> AsyncQueuesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/r2/buckets/buckets.py b/src/cloudflare/resources/r2/buckets/buckets.py index 042d0b13c48..7772e915c71 100644 --- a/src/cloudflare/resources/r2/buckets/buckets.py +++ b/src/cloudflare/resources/r2/buckets/buckets.py @@ -95,7 +95,7 @@ def sippy(self) -> SippyResource: @cached_property def with_raw_response(self) -> BucketsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -378,7 +378,7 @@ def sippy(self) -> AsyncSippyResource: @cached_property def with_raw_response(self) -> AsyncBucketsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/r2/buckets/cors.py b/src/cloudflare/resources/r2/buckets/cors.py index e56363fc759..3ea528308c0 100644 --- a/src/cloudflare/resources/r2/buckets/cors.py +++ b/src/cloudflare/resources/r2/buckets/cors.py @@ -34,7 +34,7 @@ class CORSResource(SyncAPIResource): @cached_property def with_raw_response(self) -> CORSResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -210,7 +210,7 @@ class AsyncCORSResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncCORSResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/r2/buckets/domains/custom.py b/src/cloudflare/resources/r2/buckets/domains/custom.py index 9a0f624592e..07a09e67a2b 100644 --- a/src/cloudflare/resources/r2/buckets/domains/custom.py +++ b/src/cloudflare/resources/r2/buckets/domains/custom.py @@ -38,7 +38,7 @@ class CustomResource(SyncAPIResource): @cached_property def with_raw_response(self) -> CustomResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -366,7 +366,7 @@ class AsyncCustomResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncCustomResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/r2/buckets/domains/domains.py b/src/cloudflare/resources/r2/buckets/domains/domains.py index 1a063b00f9d..f7f4be6c72f 100644 --- a/src/cloudflare/resources/r2/buckets/domains/domains.py +++ b/src/cloudflare/resources/r2/buckets/domains/domains.py @@ -36,7 +36,7 @@ def managed(self) -> ManagedResource: @cached_property def with_raw_response(self) -> DomainsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -65,7 +65,7 @@ def managed(self) -> AsyncManagedResource: @cached_property def with_raw_response(self) -> AsyncDomainsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/r2/buckets/domains/managed.py b/src/cloudflare/resources/r2/buckets/domains/managed.py index 132d316021b..fd2eb05db6b 100644 --- a/src/cloudflare/resources/r2/buckets/domains/managed.py +++ b/src/cloudflare/resources/r2/buckets/domains/managed.py @@ -35,7 +35,7 @@ class ManagedResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ManagedResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -162,7 +162,7 @@ class AsyncManagedResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncManagedResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/r2/buckets/event_notifications/configuration/configuration.py b/src/cloudflare/resources/r2/buckets/event_notifications/configuration/configuration.py index 400051aa1a9..c5a29f5f723 100644 --- a/src/cloudflare/resources/r2/buckets/event_notifications/configuration/configuration.py +++ b/src/cloudflare/resources/r2/buckets/event_notifications/configuration/configuration.py @@ -40,7 +40,7 @@ def queues(self) -> QueuesResource: @cached_property def with_raw_response(self) -> ConfigurationResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -116,7 +116,7 @@ def queues(self) -> AsyncQueuesResource: @cached_property def with_raw_response(self) -> AsyncConfigurationResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/r2/buckets/event_notifications/configuration/queues.py b/src/cloudflare/resources/r2/buckets/event_notifications/configuration/queues.py index 3b58ade89b8..29e477f3b5e 100644 --- a/src/cloudflare/resources/r2/buckets/event_notifications/configuration/queues.py +++ b/src/cloudflare/resources/r2/buckets/event_notifications/configuration/queues.py @@ -33,7 +33,7 @@ class QueuesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> QueuesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -172,7 +172,7 @@ class AsyncQueuesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncQueuesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/r2/buckets/event_notifications/event_notifications.py b/src/cloudflare/resources/r2/buckets/event_notifications/event_notifications.py index c154553fdaa..51773e46bcd 100644 --- a/src/cloudflare/resources/r2/buckets/event_notifications/event_notifications.py +++ b/src/cloudflare/resources/r2/buckets/event_notifications/event_notifications.py @@ -24,7 +24,7 @@ def configuration(self) -> ConfigurationResource: @cached_property def with_raw_response(self) -> EventNotificationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def configuration(self) -> AsyncConfigurationResource: @cached_property def with_raw_response(self) -> AsyncEventNotificationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/r2/buckets/lifecycle.py b/src/cloudflare/resources/r2/buckets/lifecycle.py index 96385460faf..faeca81a556 100644 --- a/src/cloudflare/resources/r2/buckets/lifecycle.py +++ b/src/cloudflare/resources/r2/buckets/lifecycle.py @@ -34,7 +34,7 @@ class LifecycleResource(SyncAPIResource): @cached_property def with_raw_response(self) -> LifecycleResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -159,7 +159,7 @@ class AsyncLifecycleResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncLifecycleResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/r2/buckets/sippy.py b/src/cloudflare/resources/r2/buckets/sippy.py index ef325b0ef87..112bab78de9 100644 --- a/src/cloudflare/resources/r2/buckets/sippy.py +++ b/src/cloudflare/resources/r2/buckets/sippy.py @@ -36,7 +36,7 @@ class SippyResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SippyResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -284,7 +284,7 @@ class AsyncSippyResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSippyResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/r2/r2.py b/src/cloudflare/resources/r2/r2.py index 2e19154ebd6..63c7b95c21e 100644 --- a/src/cloudflare/resources/r2/r2.py +++ b/src/cloudflare/resources/r2/r2.py @@ -36,7 +36,7 @@ def temporary_credentials(self) -> TemporaryCredentialsResource: @cached_property def with_raw_response(self) -> R2ResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -65,7 +65,7 @@ def temporary_credentials(self) -> AsyncTemporaryCredentialsResource: @cached_property def with_raw_response(self) -> AsyncR2ResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/r2/temporary_credentials.py b/src/cloudflare/resources/r2/temporary_credentials.py index 1f02bf4a861..415465ee5d5 100644 --- a/src/cloudflare/resources/r2/temporary_credentials.py +++ b/src/cloudflare/resources/r2/temporary_credentials.py @@ -32,7 +32,7 @@ class TemporaryCredentialsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TemporaryCredentialsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -122,7 +122,7 @@ class AsyncTemporaryCredentialsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTemporaryCredentialsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/ai/ai.py b/src/cloudflare/resources/radar/ai/ai.py index 4730a3809d5..6ce1832a38b 100644 --- a/src/cloudflare/resources/radar/ai/ai.py +++ b/src/cloudflare/resources/radar/ai/ai.py @@ -36,7 +36,7 @@ def timeseries_groups(self) -> TimeseriesGroupsResource: @cached_property def with_raw_response(self) -> AIResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -65,7 +65,7 @@ def timeseries_groups(self) -> AsyncTimeseriesGroupsResource: @cached_property def with_raw_response(self) -> AsyncAIResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/ai/bots/bots.py b/src/cloudflare/resources/radar/ai/bots/bots.py index e209ad5259a..4f0e47f607f 100644 --- a/src/cloudflare/resources/radar/ai/bots/bots.py +++ b/src/cloudflare/resources/radar/ai/bots/bots.py @@ -24,7 +24,7 @@ def summary(self) -> SummaryResource: @cached_property def with_raw_response(self) -> BotsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def summary(self) -> AsyncSummaryResource: @cached_property def with_raw_response(self) -> AsyncBotsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/ai/bots/summary.py b/src/cloudflare/resources/radar/ai/bots/summary.py index e8a1c0a005a..c875474238f 100644 --- a/src/cloudflare/resources/radar/ai/bots/summary.py +++ b/src/cloudflare/resources/radar/ai/bots/summary.py @@ -33,7 +33,7 @@ class SummaryResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SummaryResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -139,7 +139,7 @@ class AsyncSummaryResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSummaryResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/ai/timeseries_groups.py b/src/cloudflare/resources/radar/ai/timeseries_groups.py index c19b4c1690e..fce630369e8 100644 --- a/src/cloudflare/resources/radar/ai/timeseries_groups.py +++ b/src/cloudflare/resources/radar/ai/timeseries_groups.py @@ -33,7 +33,7 @@ class TimeseriesGroupsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TimeseriesGroupsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -144,7 +144,7 @@ class AsyncTimeseriesGroupsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTimeseriesGroupsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/annotations/annotations.py b/src/cloudflare/resources/radar/annotations/annotations.py index 43fea24af29..256eeb936d2 100644 --- a/src/cloudflare/resources/radar/annotations/annotations.py +++ b/src/cloudflare/resources/radar/annotations/annotations.py @@ -45,7 +45,7 @@ def outages(self) -> OutagesResource: @cached_property def with_raw_response(self) -> AnnotationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -142,7 +142,7 @@ def outages(self) -> AsyncOutagesResource: @cached_property def with_raw_response(self) -> AsyncAnnotationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/annotations/outages.py b/src/cloudflare/resources/radar/annotations/outages.py index 226253f3fab..9c920789a3c 100644 --- a/src/cloudflare/resources/radar/annotations/outages.py +++ b/src/cloudflare/resources/radar/annotations/outages.py @@ -34,7 +34,7 @@ class OutagesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> OutagesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -187,7 +187,7 @@ class AsyncOutagesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncOutagesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/as112/as112.py b/src/cloudflare/resources/radar/as112/as112.py index def256f5a13..094b93b8aad 100644 --- a/src/cloudflare/resources/radar/as112/as112.py +++ b/src/cloudflare/resources/radar/as112/as112.py @@ -69,7 +69,7 @@ def top(self) -> TopResource: @cached_property def with_raw_response(self) -> AS112ResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -187,7 +187,7 @@ def top(self) -> AsyncTopResource: @cached_property def with_raw_response(self) -> AsyncAS112ResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/as112/summary.py b/src/cloudflare/resources/radar/as112/summary.py index 64f1fa64f29..2eefce896cc 100644 --- a/src/cloudflare/resources/radar/as112/summary.py +++ b/src/cloudflare/resources/radar/as112/summary.py @@ -45,7 +45,7 @@ class SummaryResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SummaryResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -550,7 +550,7 @@ class AsyncSummaryResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSummaryResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/as112/timeseries_groups.py b/src/cloudflare/resources/radar/as112/timeseries_groups.py index 4571879b766..818edcc3eea 100644 --- a/src/cloudflare/resources/radar/as112/timeseries_groups.py +++ b/src/cloudflare/resources/radar/as112/timeseries_groups.py @@ -45,7 +45,7 @@ class TimeseriesGroupsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TimeseriesGroupsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -589,7 +589,7 @@ class AsyncTimeseriesGroupsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTimeseriesGroupsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/as112/top.py b/src/cloudflare/resources/radar/as112/top.py index 93591f3a312..9bb43032129 100644 --- a/src/cloudflare/resources/radar/as112/top.py +++ b/src/cloudflare/resources/radar/as112/top.py @@ -36,7 +36,7 @@ class TopResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TopResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -406,7 +406,7 @@ class AsyncTopResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTopResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/attacks/attacks.py b/src/cloudflare/resources/radar/attacks/attacks.py index e09babf13e7..823eafcf5b8 100644 --- a/src/cloudflare/resources/radar/attacks/attacks.py +++ b/src/cloudflare/resources/radar/attacks/attacks.py @@ -36,7 +36,7 @@ def layer7(self) -> Layer7Resource: @cached_property def with_raw_response(self) -> AttacksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -65,7 +65,7 @@ def layer7(self) -> AsyncLayer7Resource: @cached_property def with_raw_response(self) -> AsyncAttacksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/attacks/layer3/layer3.py b/src/cloudflare/resources/radar/attacks/layer3/layer3.py index 695170a13c7..6bca4393fac 100644 --- a/src/cloudflare/resources/radar/attacks/layer3/layer3.py +++ b/src/cloudflare/resources/radar/attacks/layer3/layer3.py @@ -69,7 +69,7 @@ def top(self) -> TopResource: @cached_property def with_raw_response(self) -> Layer3ResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -209,7 +209,7 @@ def top(self) -> AsyncTopResource: @cached_property def with_raw_response(self) -> AsyncLayer3ResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/attacks/layer3/summary.py b/src/cloudflare/resources/radar/attacks/layer3/summary.py index b4f5c7853cc..9a31318ad6f 100644 --- a/src/cloudflare/resources/radar/attacks/layer3/summary.py +++ b/src/cloudflare/resources/radar/attacks/layer3/summary.py @@ -45,7 +45,7 @@ class SummaryResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SummaryResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -573,7 +573,7 @@ class AsyncSummaryResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSummaryResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/attacks/layer3/timeseries_groups.py b/src/cloudflare/resources/radar/attacks/layer3/timeseries_groups.py index 5fc390814b5..5e4bdd99bc1 100644 --- a/src/cloudflare/resources/radar/attacks/layer3/timeseries_groups.py +++ b/src/cloudflare/resources/radar/attacks/layer3/timeseries_groups.py @@ -49,7 +49,7 @@ class TimeseriesGroupsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TimeseriesGroupsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -842,7 +842,7 @@ class AsyncTimeseriesGroupsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTimeseriesGroupsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/attacks/layer3/top/locations.py b/src/cloudflare/resources/radar/attacks/layer3/top/locations.py index ee73cc55572..b2900433339 100644 --- a/src/cloudflare/resources/radar/attacks/layer3/top/locations.py +++ b/src/cloudflare/resources/radar/attacks/layer3/top/locations.py @@ -34,7 +34,7 @@ class LocationsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> LocationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -225,7 +225,7 @@ class AsyncLocationsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncLocationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/attacks/layer3/top/top.py b/src/cloudflare/resources/radar/attacks/layer3/top/top.py index 49205aa6c7b..14ef69d4b41 100644 --- a/src/cloudflare/resources/radar/attacks/layer3/top/top.py +++ b/src/cloudflare/resources/radar/attacks/layer3/top/top.py @@ -47,7 +47,7 @@ def locations(self) -> LocationsResource: @cached_property def with_raw_response(self) -> TopResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -347,7 +347,7 @@ def locations(self) -> AsyncLocationsResource: @cached_property def with_raw_response(self) -> AsyncTopResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/attacks/layer7/layer7.py b/src/cloudflare/resources/radar/attacks/layer7/layer7.py index d1e229e8bdf..61a40334d00 100644 --- a/src/cloudflare/resources/radar/attacks/layer7/layer7.py +++ b/src/cloudflare/resources/radar/attacks/layer7/layer7.py @@ -69,7 +69,7 @@ def top(self) -> TopResource: @cached_property def with_raw_response(self) -> Layer7ResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -274,7 +274,7 @@ def top(self) -> AsyncTopResource: @cached_property def with_raw_response(self) -> AsyncLayer7ResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/attacks/layer7/summary.py b/src/cloudflare/resources/radar/attacks/layer7/summary.py index 69a23e0ced4..ff08b2a712b 100644 --- a/src/cloudflare/resources/radar/attacks/layer7/summary.py +++ b/src/cloudflare/resources/radar/attacks/layer7/summary.py @@ -45,7 +45,7 @@ class SummaryResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SummaryResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -839,7 +839,7 @@ class AsyncSummaryResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSummaryResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/attacks/layer7/timeseries_groups.py b/src/cloudflare/resources/radar/attacks/layer7/timeseries_groups.py index e57361ae51c..3d6a273b082 100644 --- a/src/cloudflare/resources/radar/attacks/layer7/timeseries_groups.py +++ b/src/cloudflare/resources/radar/attacks/layer7/timeseries_groups.py @@ -51,7 +51,7 @@ class TimeseriesGroupsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TimeseriesGroupsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -1240,7 +1240,7 @@ class AsyncTimeseriesGroupsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTimeseriesGroupsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/attacks/layer7/top/ases.py b/src/cloudflare/resources/radar/attacks/layer7/top/ases.py index 35d26625eba..86b39630759 100644 --- a/src/cloudflare/resources/radar/attacks/layer7/top/ases.py +++ b/src/cloudflare/resources/radar/attacks/layer7/top/ases.py @@ -33,7 +33,7 @@ class AsesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> AsesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -205,7 +205,7 @@ class AsyncAsesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncAsesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/attacks/layer7/top/locations.py b/src/cloudflare/resources/radar/attacks/layer7/top/locations.py index 3f09372dfd2..18ba7f902d7 100644 --- a/src/cloudflare/resources/radar/attacks/layer7/top/locations.py +++ b/src/cloudflare/resources/radar/attacks/layer7/top/locations.py @@ -34,7 +34,7 @@ class LocationsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> LocationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -351,7 +351,7 @@ class AsyncLocationsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncLocationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/attacks/layer7/top/top.py b/src/cloudflare/resources/radar/attacks/layer7/top/top.py index 2453dc2bc69..fde5eefb380 100644 --- a/src/cloudflare/resources/radar/attacks/layer7/top/top.py +++ b/src/cloudflare/resources/radar/attacks/layer7/top/top.py @@ -59,7 +59,7 @@ def ases(self) -> AsesResource: @cached_property def with_raw_response(self) -> TopResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -576,7 +576,7 @@ def ases(self) -> AsyncAsesResource: @cached_property def with_raw_response(self) -> AsyncTopResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/bgp/bgp.py b/src/cloudflare/resources/radar/bgp/bgp.py index 69235eb71f3..f6f22267deb 100644 --- a/src/cloudflare/resources/radar/bgp/bgp.py +++ b/src/cloudflare/resources/radar/bgp/bgp.py @@ -93,7 +93,7 @@ def ips(self) -> IPsResource: @cached_property def with_raw_response(self) -> BGPResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -218,7 +218,7 @@ def ips(self) -> AsyncIPsResource: @cached_property def with_raw_response(self) -> AsyncBGPResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/bgp/hijacks/events.py b/src/cloudflare/resources/radar/bgp/hijacks/events.py index 8277e0ed1df..4d64f84b609 100644 --- a/src/cloudflare/resources/radar/bgp/hijacks/events.py +++ b/src/cloudflare/resources/radar/bgp/hijacks/events.py @@ -30,7 +30,7 @@ class EventsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> EventsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -156,7 +156,7 @@ class AsyncEventsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncEventsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/bgp/hijacks/hijacks.py b/src/cloudflare/resources/radar/bgp/hijacks/hijacks.py index a527f3a9707..fcd07088df1 100644 --- a/src/cloudflare/resources/radar/bgp/hijacks/hijacks.py +++ b/src/cloudflare/resources/radar/bgp/hijacks/hijacks.py @@ -24,7 +24,7 @@ def events(self) -> EventsResource: @cached_property def with_raw_response(self) -> HijacksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def events(self) -> AsyncEventsResource: @cached_property def with_raw_response(self) -> AsyncHijacksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/bgp/ips.py b/src/cloudflare/resources/radar/bgp/ips.py index 586ee448d37..81834c20455 100644 --- a/src/cloudflare/resources/radar/bgp/ips.py +++ b/src/cloudflare/resources/radar/bgp/ips.py @@ -33,7 +33,7 @@ class IPsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> IPsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -134,7 +134,7 @@ class AsyncIPsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncIPsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/bgp/leaks/events.py b/src/cloudflare/resources/radar/bgp/leaks/events.py index c5281acbaa5..0803b94e860 100644 --- a/src/cloudflare/resources/radar/bgp/leaks/events.py +++ b/src/cloudflare/resources/radar/bgp/leaks/events.py @@ -30,7 +30,7 @@ class EventsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> EventsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -139,7 +139,7 @@ class AsyncEventsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncEventsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/bgp/leaks/leaks.py b/src/cloudflare/resources/radar/bgp/leaks/leaks.py index c5ab7807bd9..c59e22b325b 100644 --- a/src/cloudflare/resources/radar/bgp/leaks/leaks.py +++ b/src/cloudflare/resources/radar/bgp/leaks/leaks.py @@ -24,7 +24,7 @@ def events(self) -> EventsResource: @cached_property def with_raw_response(self) -> LeaksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def events(self) -> AsyncEventsResource: @cached_property def with_raw_response(self) -> AsyncLeaksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/bgp/routes.py b/src/cloudflare/resources/radar/bgp/routes.py index 6ae840f640c..479efb55eb2 100644 --- a/src/cloudflare/resources/radar/bgp/routes.py +++ b/src/cloudflare/resources/radar/bgp/routes.py @@ -35,7 +35,7 @@ class RoutesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> RoutesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -282,7 +282,7 @@ class AsyncRoutesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncRoutesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/bgp/top/ases.py b/src/cloudflare/resources/radar/bgp/top/ases.py index 8430d0840c2..d727ffafcfb 100644 --- a/src/cloudflare/resources/radar/bgp/top/ases.py +++ b/src/cloudflare/resources/radar/bgp/top/ases.py @@ -34,7 +34,7 @@ class AsesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> AsesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -188,7 +188,7 @@ class AsyncAsesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncAsesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/bgp/top/top.py b/src/cloudflare/resources/radar/bgp/top/top.py index 028d993bf5c..b7b5e4b2da6 100644 --- a/src/cloudflare/resources/radar/bgp/top/top.py +++ b/src/cloudflare/resources/radar/bgp/top/top.py @@ -45,7 +45,7 @@ def ases(self) -> AsesResource: @cached_property def with_raw_response(self) -> TopResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -147,7 +147,7 @@ def ases(self) -> AsyncAsesResource: @cached_property def with_raw_response(self) -> AsyncTopResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/datasets.py b/src/cloudflare/resources/radar/datasets.py index 0cfb5cad2b9..a5d7eec37f2 100644 --- a/src/cloudflare/resources/radar/datasets.py +++ b/src/cloudflare/resources/radar/datasets.py @@ -33,7 +33,7 @@ class DatasetsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> DatasetsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -188,7 +188,7 @@ class AsyncDatasetsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncDatasetsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/dns/dns.py b/src/cloudflare/resources/radar/dns/dns.py index 610ede6686b..ca5b306d0bd 100644 --- a/src/cloudflare/resources/radar/dns/dns.py +++ b/src/cloudflare/resources/radar/dns/dns.py @@ -24,7 +24,7 @@ def top(self) -> TopResource: @cached_property def with_raw_response(self) -> DNSResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def top(self) -> AsyncTopResource: @cached_property def with_raw_response(self) -> AsyncDNSResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/dns/top.py b/src/cloudflare/resources/radar/dns/top.py index 84130954da0..dc827517c6b 100644 --- a/src/cloudflare/resources/radar/dns/top.py +++ b/src/cloudflare/resources/radar/dns/top.py @@ -34,7 +34,7 @@ class TopResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TopResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -230,7 +230,7 @@ class AsyncTopResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTopResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/email/email.py b/src/cloudflare/resources/radar/email/email.py index ecc4d0c11f8..8b7febae4b6 100644 --- a/src/cloudflare/resources/radar/email/email.py +++ b/src/cloudflare/resources/radar/email/email.py @@ -36,7 +36,7 @@ def security(self) -> SecurityResource: @cached_property def with_raw_response(self) -> EmailResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -65,7 +65,7 @@ def security(self) -> AsyncSecurityResource: @cached_property def with_raw_response(self) -> AsyncEmailResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/email/routing/routing.py b/src/cloudflare/resources/radar/email/routing/routing.py index 072cb665a89..9aa2bb27b75 100644 --- a/src/cloudflare/resources/radar/email/routing/routing.py +++ b/src/cloudflare/resources/radar/email/routing/routing.py @@ -36,7 +36,7 @@ def timeseries_groups(self) -> TimeseriesGroupsResource: @cached_property def with_raw_response(self) -> RoutingResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -65,7 +65,7 @@ def timeseries_groups(self) -> AsyncTimeseriesGroupsResource: @cached_property def with_raw_response(self) -> AsyncRoutingResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/email/routing/summary.py b/src/cloudflare/resources/radar/email/routing/summary.py index 21b8ee599b9..a049898dce4 100644 --- a/src/cloudflare/resources/radar/email/routing/summary.py +++ b/src/cloudflare/resources/radar/email/routing/summary.py @@ -45,7 +45,7 @@ class SummaryResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SummaryResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -552,7 +552,7 @@ class AsyncSummaryResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSummaryResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/email/routing/timeseries_groups.py b/src/cloudflare/resources/radar/email/routing/timeseries_groups.py index 804560b992e..61c4de5e245 100644 --- a/src/cloudflare/resources/radar/email/routing/timeseries_groups.py +++ b/src/cloudflare/resources/radar/email/routing/timeseries_groups.py @@ -45,7 +45,7 @@ class TimeseriesGroupsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TimeseriesGroupsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -588,7 +588,7 @@ class AsyncTimeseriesGroupsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTimeseriesGroupsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/email/security/security.py b/src/cloudflare/resources/radar/email/security/security.py index c9446c10867..2a0a223796e 100644 --- a/src/cloudflare/resources/radar/email/security/security.py +++ b/src/cloudflare/resources/radar/email/security/security.py @@ -48,7 +48,7 @@ def timeseries_groups(self) -> TimeseriesGroupsResource: @cached_property def with_raw_response(self) -> SecurityResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -81,7 +81,7 @@ def timeseries_groups(self) -> AsyncTimeseriesGroupsResource: @cached_property def with_raw_response(self) -> AsyncSecurityResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/email/security/summary.py b/src/cloudflare/resources/radar/email/security/summary.py index bc98aa0f153..c2df082e757 100644 --- a/src/cloudflare/resources/radar/email/security/summary.py +++ b/src/cloudflare/resources/radar/email/security/summary.py @@ -51,7 +51,7 @@ class SummaryResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SummaryResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -781,7 +781,7 @@ class AsyncSummaryResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSummaryResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/email/security/timeseries_groups.py b/src/cloudflare/resources/radar/email/security/timeseries_groups.py index d3b5c3eade6..9d1ee856d46 100644 --- a/src/cloudflare/resources/radar/email/security/timeseries_groups.py +++ b/src/cloudflare/resources/radar/email/security/timeseries_groups.py @@ -53,7 +53,7 @@ class TimeseriesGroupsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TimeseriesGroupsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -839,7 +839,7 @@ class AsyncTimeseriesGroupsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTimeseriesGroupsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/email/security/top/tlds/malicious.py b/src/cloudflare/resources/radar/email/security/top/tlds/malicious.py index 77bb57aed32..cd9ed653bd0 100644 --- a/src/cloudflare/resources/radar/email/security/top/tlds/malicious.py +++ b/src/cloudflare/resources/radar/email/security/top/tlds/malicious.py @@ -33,7 +33,7 @@ class MaliciousResource(SyncAPIResource): @cached_property def with_raw_response(self) -> MaliciousResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -148,7 +148,7 @@ class AsyncMaliciousResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncMaliciousResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/email/security/top/tlds/spam.py b/src/cloudflare/resources/radar/email/security/top/tlds/spam.py index ee2a47c0153..4a1c04f15a0 100644 --- a/src/cloudflare/resources/radar/email/security/top/tlds/spam.py +++ b/src/cloudflare/resources/radar/email/security/top/tlds/spam.py @@ -33,7 +33,7 @@ class SpamResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SpamResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -148,7 +148,7 @@ class AsyncSpamResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSpamResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/email/security/top/tlds/spoof.py b/src/cloudflare/resources/radar/email/security/top/tlds/spoof.py index ef0bf9cb9ed..60c42d0c1a9 100644 --- a/src/cloudflare/resources/radar/email/security/top/tlds/spoof.py +++ b/src/cloudflare/resources/radar/email/security/top/tlds/spoof.py @@ -33,7 +33,7 @@ class SpoofResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SpoofResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -148,7 +148,7 @@ class AsyncSpoofResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSpoofResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/email/security/top/tlds/tlds.py b/src/cloudflare/resources/radar/email/security/top/tlds/tlds.py index 8c261dce312..d45089f3adc 100644 --- a/src/cloudflare/resources/radar/email/security/top/tlds/tlds.py +++ b/src/cloudflare/resources/radar/email/security/top/tlds/tlds.py @@ -69,7 +69,7 @@ def spoof(self) -> SpoofResource: @cached_property def with_raw_response(self) -> TldsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -193,7 +193,7 @@ def spoof(self) -> AsyncSpoofResource: @cached_property def with_raw_response(self) -> AsyncTldsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/email/security/top/top.py b/src/cloudflare/resources/radar/email/security/top/top.py index ed40869000e..f6c3ef9d399 100644 --- a/src/cloudflare/resources/radar/email/security/top/top.py +++ b/src/cloudflare/resources/radar/email/security/top/top.py @@ -24,7 +24,7 @@ def tlds(self) -> TldsResource: @cached_property def with_raw_response(self) -> TopResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def tlds(self) -> AsyncTldsResource: @cached_property def with_raw_response(self) -> AsyncTopResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/entities/asns.py b/src/cloudflare/resources/radar/entities/asns.py index 42cba1df21c..c8ff8ed8e22 100644 --- a/src/cloudflare/resources/radar/entities/asns.py +++ b/src/cloudflare/resources/radar/entities/asns.py @@ -35,7 +35,7 @@ class ASNsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ASNsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -263,7 +263,7 @@ class AsyncASNsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncASNsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/entities/entities.py b/src/cloudflare/resources/radar/entities/entities.py index b2b46a9a17d..695496eb3af 100644 --- a/src/cloudflare/resources/radar/entities/entities.py +++ b/src/cloudflare/resources/radar/entities/entities.py @@ -56,7 +56,7 @@ def locations(self) -> LocationsResource: @cached_property def with_raw_response(self) -> EntitiesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -132,7 +132,7 @@ def locations(self) -> AsyncLocationsResource: @cached_property def with_raw_response(self) -> AsyncEntitiesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/entities/locations.py b/src/cloudflare/resources/radar/entities/locations.py index d191ffe53d4..a64b242ac69 100644 --- a/src/cloudflare/resources/radar/entities/locations.py +++ b/src/cloudflare/resources/radar/entities/locations.py @@ -33,7 +33,7 @@ class LocationsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> LocationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -155,7 +155,7 @@ class AsyncLocationsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncLocationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/http/ases/ases.py b/src/cloudflare/resources/radar/http/ases/ases.py index de73a0f3689..73e828d07a7 100644 --- a/src/cloudflare/resources/radar/http/ases/ases.py +++ b/src/cloudflare/resources/radar/http/ases/ases.py @@ -129,7 +129,7 @@ def browser_family(self) -> BrowserFamilyResource: @cached_property def with_raw_response(self) -> AsesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -301,7 +301,7 @@ def browser_family(self) -> AsyncBrowserFamilyResource: @cached_property def with_raw_response(self) -> AsyncAsesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/http/ases/bot_class.py b/src/cloudflare/resources/radar/http/ases/bot_class.py index 53fcc8a14c4..6850fdf96cf 100644 --- a/src/cloudflare/resources/radar/http/ases/bot_class.py +++ b/src/cloudflare/resources/radar/http/ases/bot_class.py @@ -33,7 +33,7 @@ class BotClassResource(SyncAPIResource): @cached_property def with_raw_response(self) -> BotClassResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -175,7 +175,7 @@ class AsyncBotClassResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncBotClassResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/http/ases/browser_family.py b/src/cloudflare/resources/radar/http/ases/browser_family.py index d5e17e2e481..8c0d842f074 100644 --- a/src/cloudflare/resources/radar/http/ases/browser_family.py +++ b/src/cloudflare/resources/radar/http/ases/browser_family.py @@ -33,7 +33,7 @@ class BrowserFamilyResource(SyncAPIResource): @cached_property def with_raw_response(self) -> BrowserFamilyResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -173,7 +173,7 @@ class AsyncBrowserFamilyResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncBrowserFamilyResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/http/ases/device_type.py b/src/cloudflare/resources/radar/http/ases/device_type.py index a7536c678fb..36f269961c0 100644 --- a/src/cloudflare/resources/radar/http/ases/device_type.py +++ b/src/cloudflare/resources/radar/http/ases/device_type.py @@ -33,7 +33,7 @@ class DeviceTypeResource(SyncAPIResource): @cached_property def with_raw_response(self) -> DeviceTypeResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -173,7 +173,7 @@ class AsyncDeviceTypeResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncDeviceTypeResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/http/ases/http_method.py b/src/cloudflare/resources/radar/http/ases/http_method.py index a56bd761aae..afae27fb638 100644 --- a/src/cloudflare/resources/radar/http/ases/http_method.py +++ b/src/cloudflare/resources/radar/http/ases/http_method.py @@ -33,7 +33,7 @@ class HTTPMethodResource(SyncAPIResource): @cached_property def with_raw_response(self) -> HTTPMethodResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -173,7 +173,7 @@ class AsyncHTTPMethodResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncHTTPMethodResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/http/ases/http_protocol.py b/src/cloudflare/resources/radar/http/ases/http_protocol.py index 1284c92e8fa..613777f074f 100644 --- a/src/cloudflare/resources/radar/http/ases/http_protocol.py +++ b/src/cloudflare/resources/radar/http/ases/http_protocol.py @@ -33,7 +33,7 @@ class HTTPProtocolResource(SyncAPIResource): @cached_property def with_raw_response(self) -> HTTPProtocolResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -169,7 +169,7 @@ class AsyncHTTPProtocolResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncHTTPProtocolResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/http/ases/ip_version.py b/src/cloudflare/resources/radar/http/ases/ip_version.py index ae0a5862967..aee722d0eaa 100644 --- a/src/cloudflare/resources/radar/http/ases/ip_version.py +++ b/src/cloudflare/resources/radar/http/ases/ip_version.py @@ -33,7 +33,7 @@ class IPVersionResource(SyncAPIResource): @cached_property def with_raw_response(self) -> IPVersionResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -173,7 +173,7 @@ class AsyncIPVersionResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncIPVersionResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/http/ases/os.py b/src/cloudflare/resources/radar/http/ases/os.py index 9b44483780c..ef59110ac0b 100644 --- a/src/cloudflare/resources/radar/http/ases/os.py +++ b/src/cloudflare/resources/radar/http/ases/os.py @@ -33,7 +33,7 @@ class OSResource(SyncAPIResource): @cached_property def with_raw_response(self) -> OSResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -172,7 +172,7 @@ class AsyncOSResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncOSResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/http/ases/tls_version.py b/src/cloudflare/resources/radar/http/ases/tls_version.py index aaa0390db52..3603964e669 100644 --- a/src/cloudflare/resources/radar/http/ases/tls_version.py +++ b/src/cloudflare/resources/radar/http/ases/tls_version.py @@ -33,7 +33,7 @@ class TLSVersionResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TLSVersionResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -173,7 +173,7 @@ class AsyncTLSVersionResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTLSVersionResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/http/http.py b/src/cloudflare/resources/radar/http/http.py index bd316f3d341..256d212419b 100644 --- a/src/cloudflare/resources/radar/http/http.py +++ b/src/cloudflare/resources/radar/http/http.py @@ -93,7 +93,7 @@ def top(self) -> TopResource: @cached_property def with_raw_response(self) -> HTTPResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -254,7 +254,7 @@ def top(self) -> AsyncTopResource: @cached_property def with_raw_response(self) -> AsyncHTTPResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/http/locations/bot_class.py b/src/cloudflare/resources/radar/http/locations/bot_class.py index c208ebf58e2..8d33f970f8e 100644 --- a/src/cloudflare/resources/radar/http/locations/bot_class.py +++ b/src/cloudflare/resources/radar/http/locations/bot_class.py @@ -33,7 +33,7 @@ class BotClassResource(SyncAPIResource): @cached_property def with_raw_response(self) -> BotClassResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -175,7 +175,7 @@ class AsyncBotClassResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncBotClassResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/http/locations/browser_family.py b/src/cloudflare/resources/radar/http/locations/browser_family.py index d4c4c84c32d..bee94d89c75 100644 --- a/src/cloudflare/resources/radar/http/locations/browser_family.py +++ b/src/cloudflare/resources/radar/http/locations/browser_family.py @@ -33,7 +33,7 @@ class BrowserFamilyResource(SyncAPIResource): @cached_property def with_raw_response(self) -> BrowserFamilyResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -174,7 +174,7 @@ class AsyncBrowserFamilyResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncBrowserFamilyResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/http/locations/device_type.py b/src/cloudflare/resources/radar/http/locations/device_type.py index 9767c3e2d9f..44234522dae 100644 --- a/src/cloudflare/resources/radar/http/locations/device_type.py +++ b/src/cloudflare/resources/radar/http/locations/device_type.py @@ -33,7 +33,7 @@ class DeviceTypeResource(SyncAPIResource): @cached_property def with_raw_response(self) -> DeviceTypeResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -174,7 +174,7 @@ class AsyncDeviceTypeResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncDeviceTypeResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/http/locations/http_method.py b/src/cloudflare/resources/radar/http/locations/http_method.py index 95538576091..d2f9b464437 100644 --- a/src/cloudflare/resources/radar/http/locations/http_method.py +++ b/src/cloudflare/resources/radar/http/locations/http_method.py @@ -33,7 +33,7 @@ class HTTPMethodResource(SyncAPIResource): @cached_property def with_raw_response(self) -> HTTPMethodResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -174,7 +174,7 @@ class AsyncHTTPMethodResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncHTTPMethodResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/http/locations/http_protocol.py b/src/cloudflare/resources/radar/http/locations/http_protocol.py index 7715320cf14..7c5c8f4f644 100644 --- a/src/cloudflare/resources/radar/http/locations/http_protocol.py +++ b/src/cloudflare/resources/radar/http/locations/http_protocol.py @@ -33,7 +33,7 @@ class HTTPProtocolResource(SyncAPIResource): @cached_property def with_raw_response(self) -> HTTPProtocolResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -170,7 +170,7 @@ class AsyncHTTPProtocolResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncHTTPProtocolResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/http/locations/ip_version.py b/src/cloudflare/resources/radar/http/locations/ip_version.py index 8bd102fa3ee..84d25e8135d 100644 --- a/src/cloudflare/resources/radar/http/locations/ip_version.py +++ b/src/cloudflare/resources/radar/http/locations/ip_version.py @@ -33,7 +33,7 @@ class IPVersionResource(SyncAPIResource): @cached_property def with_raw_response(self) -> IPVersionResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -174,7 +174,7 @@ class AsyncIPVersionResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncIPVersionResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/http/locations/locations.py b/src/cloudflare/resources/radar/http/locations/locations.py index 022ce3d63b8..2e47beade9e 100644 --- a/src/cloudflare/resources/radar/http/locations/locations.py +++ b/src/cloudflare/resources/radar/http/locations/locations.py @@ -129,7 +129,7 @@ def browser_family(self) -> BrowserFamilyResource: @cached_property def with_raw_response(self) -> LocationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -301,7 +301,7 @@ def browser_family(self) -> AsyncBrowserFamilyResource: @cached_property def with_raw_response(self) -> AsyncLocationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/http/locations/os.py b/src/cloudflare/resources/radar/http/locations/os.py index 6dc275d159a..f1e8ad2da45 100644 --- a/src/cloudflare/resources/radar/http/locations/os.py +++ b/src/cloudflare/resources/radar/http/locations/os.py @@ -33,7 +33,7 @@ class OSResource(SyncAPIResource): @cached_property def with_raw_response(self) -> OSResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -172,7 +172,7 @@ class AsyncOSResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncOSResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/http/locations/tls_version.py b/src/cloudflare/resources/radar/http/locations/tls_version.py index 6b9b67a72a0..b916c68c4e8 100644 --- a/src/cloudflare/resources/radar/http/locations/tls_version.py +++ b/src/cloudflare/resources/radar/http/locations/tls_version.py @@ -33,7 +33,7 @@ class TLSVersionResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TLSVersionResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -173,7 +173,7 @@ class AsyncTLSVersionResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTLSVersionResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/http/summary.py b/src/cloudflare/resources/radar/http/summary.py index 564ef5bf1ea..6af78371015 100644 --- a/src/cloudflare/resources/radar/http/summary.py +++ b/src/cloudflare/resources/radar/http/summary.py @@ -49,7 +49,7 @@ class SummaryResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SummaryResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -920,7 +920,7 @@ class AsyncSummaryResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSummaryResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/http/timeseries_groups.py b/src/cloudflare/resources/radar/http/timeseries_groups.py index 1b1a6da94db..49a836dc8ae 100644 --- a/src/cloudflare/resources/radar/http/timeseries_groups.py +++ b/src/cloudflare/resources/radar/http/timeseries_groups.py @@ -53,7 +53,7 @@ class TimeseriesGroupsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TimeseriesGroupsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -1214,7 +1214,7 @@ class AsyncTimeseriesGroupsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTimeseriesGroupsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/http/top.py b/src/cloudflare/resources/radar/http/top.py index 188a7c34181..f66f82dc348 100644 --- a/src/cloudflare/resources/radar/http/top.py +++ b/src/cloudflare/resources/radar/http/top.py @@ -34,7 +34,7 @@ class TopResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TopResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -293,7 +293,7 @@ class AsyncTopResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTopResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/netflows/netflows.py b/src/cloudflare/resources/radar/netflows/netflows.py index 430bc802694..0384af11246 100644 --- a/src/cloudflare/resources/radar/netflows/netflows.py +++ b/src/cloudflare/resources/radar/netflows/netflows.py @@ -46,7 +46,7 @@ def top(self) -> TopResource: @cached_property def with_raw_response(self) -> NetflowsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -247,7 +247,7 @@ def top(self) -> AsyncTopResource: @cached_property def with_raw_response(self) -> AsyncNetflowsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/netflows/top.py b/src/cloudflare/resources/radar/netflows/top.py index 944c0ba6620..368f350ac13 100644 --- a/src/cloudflare/resources/radar/netflows/top.py +++ b/src/cloudflare/resources/radar/netflows/top.py @@ -34,7 +34,7 @@ class TopResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TopResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -223,7 +223,7 @@ class AsyncTopResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTopResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/quality/iqi.py b/src/cloudflare/resources/radar/quality/iqi.py index 7181a82a8b5..bcdeb909f41 100644 --- a/src/cloudflare/resources/radar/quality/iqi.py +++ b/src/cloudflare/resources/radar/quality/iqi.py @@ -34,7 +34,7 @@ class IQIResource(SyncAPIResource): @cached_property def with_raw_response(self) -> IQIResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -233,7 +233,7 @@ class AsyncIQIResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncIQIResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/quality/quality.py b/src/cloudflare/resources/radar/quality/quality.py index d4569e2e07d..e7cff1eac89 100644 --- a/src/cloudflare/resources/radar/quality/quality.py +++ b/src/cloudflare/resources/radar/quality/quality.py @@ -36,7 +36,7 @@ def speed(self) -> SpeedResource: @cached_property def with_raw_response(self) -> QualityResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -65,7 +65,7 @@ def speed(self) -> AsyncSpeedResource: @cached_property def with_raw_response(self) -> AsyncQualityResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/quality/speed/speed.py b/src/cloudflare/resources/radar/quality/speed/speed.py index 477cf02a0d6..496dfa907c7 100644 --- a/src/cloudflare/resources/radar/quality/speed/speed.py +++ b/src/cloudflare/resources/radar/quality/speed/speed.py @@ -46,7 +46,7 @@ def top(self) -> TopResource: @cached_property def with_raw_response(self) -> SpeedResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -219,7 +219,7 @@ def top(self) -> AsyncTopResource: @cached_property def with_raw_response(self) -> AsyncSpeedResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/quality/speed/top.py b/src/cloudflare/resources/radar/quality/speed/top.py index e12c9b39da0..827ad096ef9 100644 --- a/src/cloudflare/resources/radar/quality/speed/top.py +++ b/src/cloudflare/resources/radar/quality/speed/top.py @@ -34,7 +34,7 @@ class TopResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TopResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -225,7 +225,7 @@ class AsyncTopResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTopResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/radar.py b/src/cloudflare/resources/radar/radar.py index 35fa81d3b5a..d004421ca4b 100644 --- a/src/cloudflare/resources/radar/radar.py +++ b/src/cloudflare/resources/radar/radar.py @@ -216,7 +216,7 @@ def tcp_resets_timeouts(self) -> TCPResetsTimeoutsResource: @cached_property def with_raw_response(self) -> RadarResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -305,7 +305,7 @@ def tcp_resets_timeouts(self) -> AsyncTCPResetsTimeoutsResource: @cached_property def with_raw_response(self) -> AsyncRadarResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/ranking/domain.py b/src/cloudflare/resources/radar/ranking/domain.py index 1c2e3a87f4f..2f6b40cd8ef 100644 --- a/src/cloudflare/resources/radar/ranking/domain.py +++ b/src/cloudflare/resources/radar/ranking/domain.py @@ -33,7 +33,7 @@ class DomainResource(SyncAPIResource): @cached_property def with_raw_response(self) -> DomainResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -124,7 +124,7 @@ class AsyncDomainResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncDomainResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/ranking/ranking.py b/src/cloudflare/resources/radar/ranking/ranking.py index 86136d7ad46..8670e90e1d1 100644 --- a/src/cloudflare/resources/radar/ranking/ranking.py +++ b/src/cloudflare/resources/radar/ranking/ranking.py @@ -46,7 +46,7 @@ def domain(self) -> DomainResource: @cached_property def with_raw_response(self) -> RankingResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -216,7 +216,7 @@ def domain(self) -> AsyncDomainResource: @cached_property def with_raw_response(self) -> AsyncRankingResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/search.py b/src/cloudflare/resources/radar/search.py index 5feeb0de587..52751f99375 100644 --- a/src/cloudflare/resources/radar/search.py +++ b/src/cloudflare/resources/radar/search.py @@ -32,7 +32,7 @@ class SearchResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SearchResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -116,7 +116,7 @@ class AsyncSearchResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSearchResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/tcp_resets_timeouts.py b/src/cloudflare/resources/radar/tcp_resets_timeouts.py index 74aba8f6142..74c034cc349 100644 --- a/src/cloudflare/resources/radar/tcp_resets_timeouts.py +++ b/src/cloudflare/resources/radar/tcp_resets_timeouts.py @@ -34,7 +34,7 @@ class TCPResetsTimeoutsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TCPResetsTimeoutsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -223,7 +223,7 @@ class AsyncTCPResetsTimeoutsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTCPResetsTimeoutsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/traffic_anomalies/locations.py b/src/cloudflare/resources/radar/traffic_anomalies/locations.py index 81628cf24bb..fb20b5df6f7 100644 --- a/src/cloudflare/resources/radar/traffic_anomalies/locations.py +++ b/src/cloudflare/resources/radar/traffic_anomalies/locations.py @@ -33,7 +33,7 @@ class LocationsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> LocationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -119,7 +119,7 @@ class AsyncLocationsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncLocationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/traffic_anomalies/traffic_anomalies.py b/src/cloudflare/resources/radar/traffic_anomalies/traffic_anomalies.py index 26507905494..eba1dee52cd 100644 --- a/src/cloudflare/resources/radar/traffic_anomalies/traffic_anomalies.py +++ b/src/cloudflare/resources/radar/traffic_anomalies/traffic_anomalies.py @@ -45,7 +45,7 @@ def locations(self) -> LocationsResource: @cached_property def with_raw_response(self) -> TrafficAnomaliesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -147,7 +147,7 @@ def locations(self) -> AsyncLocationsResource: @cached_property def with_raw_response(self) -> AsyncTrafficAnomaliesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/verified_bots/top.py b/src/cloudflare/resources/radar/verified_bots/top.py index 62a03a29a28..4400b19e6fe 100644 --- a/src/cloudflare/resources/radar/verified_bots/top.py +++ b/src/cloudflare/resources/radar/verified_bots/top.py @@ -34,7 +34,7 @@ class TopResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TopResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -222,7 +222,7 @@ class AsyncTopResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTopResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/radar/verified_bots/verified_bots.py b/src/cloudflare/resources/radar/verified_bots/verified_bots.py index 399cd25e539..81deddd4897 100644 --- a/src/cloudflare/resources/radar/verified_bots/verified_bots.py +++ b/src/cloudflare/resources/radar/verified_bots/verified_bots.py @@ -24,7 +24,7 @@ def top(self) -> TopResource: @cached_property def with_raw_response(self) -> VerifiedBotsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def top(self) -> AsyncTopResource: @cached_property def with_raw_response(self) -> AsyncVerifiedBotsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/rate_limits.py b/src/cloudflare/resources/rate_limits.py index 131285b95af..7ccbc8333b4 100644 --- a/src/cloudflare/resources/rate_limits.py +++ b/src/cloudflare/resources/rate_limits.py @@ -34,7 +34,7 @@ class RateLimitsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> RateLimitsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -346,7 +346,7 @@ class AsyncRateLimitsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncRateLimitsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/registrar/domains.py b/src/cloudflare/resources/registrar/domains.py index 8abc5774468..a6ce99f600f 100644 --- a/src/cloudflare/resources/registrar/domains.py +++ b/src/cloudflare/resources/registrar/domains.py @@ -32,7 +32,7 @@ class DomainsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> DomainsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -195,7 +195,7 @@ class AsyncDomainsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncDomainsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/registrar/registrar.py b/src/cloudflare/resources/registrar/registrar.py index aaf8bbc4904..56d801b3e83 100644 --- a/src/cloudflare/resources/registrar/registrar.py +++ b/src/cloudflare/resources/registrar/registrar.py @@ -24,7 +24,7 @@ def domains(self) -> DomainsResource: @cached_property def with_raw_response(self) -> RegistrarResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def domains(self) -> AsyncDomainsResource: @cached_property def with_raw_response(self) -> AsyncRegistrarResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/request_tracers/request_tracers.py b/src/cloudflare/resources/request_tracers/request_tracers.py index a6873e8cec7..c95232ff3e2 100644 --- a/src/cloudflare/resources/request_tracers/request_tracers.py +++ b/src/cloudflare/resources/request_tracers/request_tracers.py @@ -24,7 +24,7 @@ def traces(self) -> TracesResource: @cached_property def with_raw_response(self) -> RequestTracersResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def traces(self) -> AsyncTracesResource: @cached_property def with_raw_response(self) -> AsyncRequestTracersResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/request_tracers/traces.py b/src/cloudflare/resources/request_tracers/traces.py index 1e85c75accd..5a0149f7882 100644 --- a/src/cloudflare/resources/request_tracers/traces.py +++ b/src/cloudflare/resources/request_tracers/traces.py @@ -31,7 +31,7 @@ class TracesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TracesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -126,7 +126,7 @@ class AsyncTracesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTracesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/resource_sharing/recipients.py b/src/cloudflare/resources/resource_sharing/recipients.py index df13e5c8e5d..81415f22963 100644 --- a/src/cloudflare/resources/resource_sharing/recipients.py +++ b/src/cloudflare/resources/resource_sharing/recipients.py @@ -35,7 +35,7 @@ class RecipientsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> RecipientsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -269,7 +269,7 @@ class AsyncRecipientsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncRecipientsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/resource_sharing/resource_sharing.py b/src/cloudflare/resources/resource_sharing/resource_sharing.py index 68a7946efd5..1d882e0abc7 100644 --- a/src/cloudflare/resources/resource_sharing/resource_sharing.py +++ b/src/cloudflare/resources/resource_sharing/resource_sharing.py @@ -65,7 +65,7 @@ def resources(self) -> ResourcesResource: @cached_property def with_raw_response(self) -> ResourceSharingResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -356,7 +356,7 @@ def resources(self) -> AsyncResourcesResource: @cached_property def with_raw_response(self) -> AsyncResourceSharingResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/resource_sharing/resources.py b/src/cloudflare/resources/resource_sharing/resources.py index b1e08158019..83c02f9d1cc 100644 --- a/src/cloudflare/resources/resource_sharing/resources.py +++ b/src/cloudflare/resources/resource_sharing/resources.py @@ -37,7 +37,7 @@ class ResourcesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ResourcesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -341,7 +341,7 @@ class AsyncResourcesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncResourcesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/rules/lists/bulk_operations.py b/src/cloudflare/resources/rules/lists/bulk_operations.py index a0b98827b56..3b0a641e76b 100644 --- a/src/cloudflare/resources/rules/lists/bulk_operations.py +++ b/src/cloudflare/resources/rules/lists/bulk_operations.py @@ -26,7 +26,7 @@ class BulkOperationsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> BulkOperationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -95,7 +95,7 @@ class AsyncBulkOperationsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncBulkOperationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/rules/lists/items.py b/src/cloudflare/resources/rules/lists/items.py index 6245c7c21ce..c4e5707eca3 100644 --- a/src/cloudflare/resources/rules/lists/items.py +++ b/src/cloudflare/resources/rules/lists/items.py @@ -36,7 +36,7 @@ class ItemsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ItemsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -325,7 +325,7 @@ class AsyncItemsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncItemsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/rules/lists/lists.py b/src/cloudflare/resources/rules/lists/lists.py index 379546c4905..3b35e27038a 100644 --- a/src/cloudflare/resources/rules/lists/lists.py +++ b/src/cloudflare/resources/rules/lists/lists.py @@ -58,7 +58,7 @@ def items(self) -> ItemsResource: @cached_property def with_raw_response(self) -> ListsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -316,7 +316,7 @@ def items(self) -> AsyncItemsResource: @cached_property def with_raw_response(self) -> AsyncListsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/rules/rules.py b/src/cloudflare/resources/rules/rules.py index 327dac15b0a..e3d938e4206 100644 --- a/src/cloudflare/resources/rules/rules.py +++ b/src/cloudflare/resources/rules/rules.py @@ -24,7 +24,7 @@ def lists(self) -> ListsResource: @cached_property def with_raw_response(self) -> RulesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def lists(self) -> AsyncListsResource: @cached_property def with_raw_response(self) -> AsyncRulesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/rulesets/phases/phases.py b/src/cloudflare/resources/rulesets/phases/phases.py index a6299543700..5102f9d61c4 100644 --- a/src/cloudflare/resources/rulesets/phases/phases.py +++ b/src/cloudflare/resources/rulesets/phases/phases.py @@ -45,7 +45,7 @@ def versions(self) -> VersionsResource: @cached_property def with_raw_response(self) -> PhasesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -202,7 +202,7 @@ def versions(self) -> AsyncVersionsResource: @cached_property def with_raw_response(self) -> AsyncPhasesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/rulesets/phases/versions.py b/src/cloudflare/resources/rulesets/phases/versions.py index 78a9612b2ff..964a18f3059 100644 --- a/src/cloudflare/resources/rulesets/phases/versions.py +++ b/src/cloudflare/resources/rulesets/phases/versions.py @@ -30,7 +30,7 @@ class VersionsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> VersionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -167,7 +167,7 @@ class AsyncVersionsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncVersionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/rulesets/rules.py b/src/cloudflare/resources/rulesets/rules.py index 6c67f33025d..39f7f0397c2 100644 --- a/src/cloudflare/resources/rulesets/rules.py +++ b/src/cloudflare/resources/rulesets/rules.py @@ -36,7 +36,7 @@ class RulesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> RulesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -2822,7 +2822,7 @@ class AsyncRulesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncRulesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/rulesets/rulesets.py b/src/cloudflare/resources/rulesets/rulesets.py index c51a5044fed..b77367eb398 100644 --- a/src/cloudflare/resources/rulesets/rulesets.py +++ b/src/cloudflare/resources/rulesets/rulesets.py @@ -73,7 +73,7 @@ def versions(self) -> VersionsResource: @cached_property def with_raw_response(self) -> RulesetsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -441,7 +441,7 @@ def versions(self) -> AsyncVersionsResource: @cached_property def with_raw_response(self) -> AsyncRulesetsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/rulesets/versions.py b/src/cloudflare/resources/rulesets/versions.py index 0d424b1c5fd..0e2c5cffa3e 100644 --- a/src/cloudflare/resources/rulesets/versions.py +++ b/src/cloudflare/resources/rulesets/versions.py @@ -28,7 +28,7 @@ class VersionsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> VersionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -224,7 +224,7 @@ class AsyncVersionsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncVersionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/rum/rules.py b/src/cloudflare/resources/rum/rules.py index 4f81b98d586..1f068db47da 100644 --- a/src/cloudflare/resources/rum/rules.py +++ b/src/cloudflare/resources/rum/rules.py @@ -34,7 +34,7 @@ class RulesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> RulesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -332,7 +332,7 @@ class AsyncRulesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncRulesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/rum/rum.py b/src/cloudflare/resources/rum/rum.py index 44831e45fcc..db3568fd766 100644 --- a/src/cloudflare/resources/rum/rum.py +++ b/src/cloudflare/resources/rum/rum.py @@ -36,7 +36,7 @@ def rules(self) -> RulesResource: @cached_property def with_raw_response(self) -> RUMResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -65,7 +65,7 @@ def rules(self) -> AsyncRulesResource: @cached_property def with_raw_response(self) -> AsyncRUMResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/rum/site_info.py b/src/cloudflare/resources/rum/site_info.py index 928d7b48532..4a5c72b4088 100644 --- a/src/cloudflare/resources/rum/site_info.py +++ b/src/cloudflare/resources/rum/site_info.py @@ -34,7 +34,7 @@ class SiteInfoResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SiteInfoResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -318,7 +318,7 @@ class AsyncSiteInfoResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSiteInfoResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/security_txt.py b/src/cloudflare/resources/security_txt.py index df4c5429e05..d629dd96635 100644 --- a/src/cloudflare/resources/security_txt.py +++ b/src/cloudflare/resources/security_txt.py @@ -34,7 +34,7 @@ class SecurityTXTResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SecurityTXTResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -187,7 +187,7 @@ class AsyncSecurityTXTResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSecurityTXTResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/snippets/content.py b/src/cloudflare/resources/snippets/content.py index b45d1003575..92f1ffef2f8 100644 --- a/src/cloudflare/resources/snippets/content.py +++ b/src/cloudflare/resources/snippets/content.py @@ -26,7 +26,7 @@ class ContentResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ContentResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -88,7 +88,7 @@ class AsyncContentResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncContentResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/snippets/rules.py b/src/cloudflare/resources/snippets/rules.py index cef569fa21f..dad75c555a6 100644 --- a/src/cloudflare/resources/snippets/rules.py +++ b/src/cloudflare/resources/snippets/rules.py @@ -34,7 +34,7 @@ class RulesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> RulesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -169,7 +169,7 @@ class AsyncRulesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncRulesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/snippets/snippets.py b/src/cloudflare/resources/snippets/snippets.py index 93258fb8bbd..f77e2da4ae9 100644 --- a/src/cloudflare/resources/snippets/snippets.py +++ b/src/cloudflare/resources/snippets/snippets.py @@ -57,7 +57,7 @@ def rules(self) -> RulesResource: @cached_property def with_raw_response(self) -> SnippetsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -265,7 +265,7 @@ def rules(self) -> AsyncRulesResource: @cached_property def with_raw_response(self) -> AsyncSnippetsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/spectrum/analytics/aggregates/aggregates.py b/src/cloudflare/resources/spectrum/analytics/aggregates/aggregates.py index 0bec4657ca6..53919fb521e 100644 --- a/src/cloudflare/resources/spectrum/analytics/aggregates/aggregates.py +++ b/src/cloudflare/resources/spectrum/analytics/aggregates/aggregates.py @@ -24,7 +24,7 @@ def currents(self) -> CurrentsResource: @cached_property def with_raw_response(self) -> AggregatesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def currents(self) -> AsyncCurrentsResource: @cached_property def with_raw_response(self) -> AsyncAggregatesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/spectrum/analytics/aggregates/currents.py b/src/cloudflare/resources/spectrum/analytics/aggregates/currents.py index c2b8c30fb3d..3880f89097b 100644 --- a/src/cloudflare/resources/spectrum/analytics/aggregates/currents.py +++ b/src/cloudflare/resources/spectrum/analytics/aggregates/currents.py @@ -31,7 +31,7 @@ class CurrentsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> CurrentsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -106,7 +106,7 @@ class AsyncCurrentsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncCurrentsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/spectrum/analytics/analytics.py b/src/cloudflare/resources/spectrum/analytics/analytics.py index 92fead88a80..c9dbd33f6b7 100644 --- a/src/cloudflare/resources/spectrum/analytics/analytics.py +++ b/src/cloudflare/resources/spectrum/analytics/analytics.py @@ -36,7 +36,7 @@ def events(self) -> EventsResource: @cached_property def with_raw_response(self) -> AnalyticsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -65,7 +65,7 @@ def events(self) -> AsyncEventsResource: @cached_property def with_raw_response(self) -> AsyncAnalyticsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/spectrum/analytics/events/bytimes.py b/src/cloudflare/resources/spectrum/analytics/events/bytimes.py index 3b921f3cda1..6cfefed1043 100644 --- a/src/cloudflare/resources/spectrum/analytics/events/bytimes.py +++ b/src/cloudflare/resources/spectrum/analytics/events/bytimes.py @@ -34,7 +34,7 @@ class BytimesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> BytimesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -162,7 +162,7 @@ class AsyncBytimesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncBytimesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/spectrum/analytics/events/events.py b/src/cloudflare/resources/spectrum/analytics/events/events.py index 9a81453dfc3..e0a692e82f7 100644 --- a/src/cloudflare/resources/spectrum/analytics/events/events.py +++ b/src/cloudflare/resources/spectrum/analytics/events/events.py @@ -36,7 +36,7 @@ def summaries(self) -> SummariesResource: @cached_property def with_raw_response(self) -> EventsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -65,7 +65,7 @@ def summaries(self) -> AsyncSummariesResource: @cached_property def with_raw_response(self) -> AsyncEventsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/spectrum/analytics/events/summaries.py b/src/cloudflare/resources/spectrum/analytics/events/summaries.py index bb09f3e15be..773db386dd0 100644 --- a/src/cloudflare/resources/spectrum/analytics/events/summaries.py +++ b/src/cloudflare/resources/spectrum/analytics/events/summaries.py @@ -34,7 +34,7 @@ class SummariesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SummariesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -158,7 +158,7 @@ class AsyncSummariesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSummariesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/spectrum/apps.py b/src/cloudflare/resources/spectrum/apps.py index f725a4b7615..e3a0d6ecc1d 100644 --- a/src/cloudflare/resources/spectrum/apps.py +++ b/src/cloudflare/resources/spectrum/apps.py @@ -42,7 +42,7 @@ class AppsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> AppsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -593,7 +593,7 @@ class AsyncAppsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncAppsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/spectrum/spectrum.py b/src/cloudflare/resources/spectrum/spectrum.py index 1d434fa8172..60e77960d81 100644 --- a/src/cloudflare/resources/spectrum/spectrum.py +++ b/src/cloudflare/resources/spectrum/spectrum.py @@ -36,7 +36,7 @@ def apps(self) -> AppsResource: @cached_property def with_raw_response(self) -> SpectrumResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -65,7 +65,7 @@ def apps(self) -> AsyncAppsResource: @cached_property def with_raw_response(self) -> AsyncSpectrumResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/speed/availabilities.py b/src/cloudflare/resources/speed/availabilities.py index 30c16f4dd12..c625a91fd31 100644 --- a/src/cloudflare/resources/speed/availabilities.py +++ b/src/cloudflare/resources/speed/availabilities.py @@ -26,7 +26,7 @@ class AvailabilitiesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> AvailabilitiesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -86,7 +86,7 @@ class AsyncAvailabilitiesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncAvailabilitiesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/speed/pages/pages.py b/src/cloudflare/resources/speed/pages/pages.py index 9a59d066b06..2062bbe3d69 100644 --- a/src/cloudflare/resources/speed/pages/pages.py +++ b/src/cloudflare/resources/speed/pages/pages.py @@ -47,7 +47,7 @@ def tests(self) -> TestsResource: @cached_property def with_raw_response(self) -> PagesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -199,7 +199,7 @@ def tests(self) -> AsyncTestsResource: @cached_property def with_raw_response(self) -> AsyncPagesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/speed/pages/tests.py b/src/cloudflare/resources/speed/pages/tests.py index 7593b6e5066..09376883903 100644 --- a/src/cloudflare/resources/speed/pages/tests.py +++ b/src/cloudflare/resources/speed/pages/tests.py @@ -36,7 +36,7 @@ class TestsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TestsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -328,7 +328,7 @@ class AsyncTestsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTestsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/speed/schedule.py b/src/cloudflare/resources/speed/schedule.py index 8267ff201ea..a20d6658a5a 100644 --- a/src/cloudflare/resources/speed/schedule.py +++ b/src/cloudflare/resources/speed/schedule.py @@ -34,7 +34,7 @@ class ScheduleResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ScheduleResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -268,7 +268,7 @@ class AsyncScheduleResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncScheduleResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/speed/speed.py b/src/cloudflare/resources/speed/speed.py index 5ef84fb95fe..ce385565aa6 100644 --- a/src/cloudflare/resources/speed/speed.py +++ b/src/cloudflare/resources/speed/speed.py @@ -48,7 +48,7 @@ def pages(self) -> PagesResource: @cached_property def with_raw_response(self) -> SpeedResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -81,7 +81,7 @@ def pages(self) -> AsyncPagesResource: @cached_property def with_raw_response(self) -> AsyncSpeedResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/ssl/analyze.py b/src/cloudflare/resources/ssl/analyze.py index 230139b0165..d5dc8263674 100644 --- a/src/cloudflare/resources/ssl/analyze.py +++ b/src/cloudflare/resources/ssl/analyze.py @@ -32,7 +32,7 @@ class AnalyzeResource(SyncAPIResource): @cached_property def with_raw_response(self) -> AnalyzeResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -109,7 +109,7 @@ class AsyncAnalyzeResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncAnalyzeResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/ssl/certificate_packs/certificate_packs.py b/src/cloudflare/resources/ssl/certificate_packs/certificate_packs.py index c69514bb182..cdaa8e97d33 100644 --- a/src/cloudflare/resources/ssl/certificate_packs/certificate_packs.py +++ b/src/cloudflare/resources/ssl/certificate_packs/certificate_packs.py @@ -48,7 +48,7 @@ def quota(self) -> QuotaResource: @cached_property def with_raw_response(self) -> CertificatePacksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -335,7 +335,7 @@ def quota(self) -> AsyncQuotaResource: @cached_property def with_raw_response(self) -> AsyncCertificatePacksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/ssl/certificate_packs/quota.py b/src/cloudflare/resources/ssl/certificate_packs/quota.py index c126ed41460..610c5f3c628 100644 --- a/src/cloudflare/resources/ssl/certificate_packs/quota.py +++ b/src/cloudflare/resources/ssl/certificate_packs/quota.py @@ -26,7 +26,7 @@ class QuotaResource(SyncAPIResource): @cached_property def with_raw_response(self) -> QuotaResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -86,7 +86,7 @@ class AsyncQuotaResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncQuotaResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/ssl/recommendations.py b/src/cloudflare/resources/ssl/recommendations.py index e5aa28fc082..25a8cf712a0 100644 --- a/src/cloudflare/resources/ssl/recommendations.py +++ b/src/cloudflare/resources/ssl/recommendations.py @@ -26,7 +26,7 @@ class RecommendationsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> RecommendationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -86,7 +86,7 @@ class AsyncRecommendationsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncRecommendationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/ssl/ssl.py b/src/cloudflare/resources/ssl/ssl.py index c0e4299285b..c46c403db8b 100644 --- a/src/cloudflare/resources/ssl/ssl.py +++ b/src/cloudflare/resources/ssl/ssl.py @@ -72,7 +72,7 @@ def verification(self) -> VerificationResource: @cached_property def with_raw_response(self) -> SSLResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -113,7 +113,7 @@ def verification(self) -> AsyncVerificationResource: @cached_property def with_raw_response(self) -> AsyncSSLResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/ssl/universal/settings.py b/src/cloudflare/resources/ssl/universal/settings.py index b3aad100017..49b690e59ca 100644 --- a/src/cloudflare/resources/ssl/universal/settings.py +++ b/src/cloudflare/resources/ssl/universal/settings.py @@ -31,7 +31,7 @@ class SettingsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SettingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -158,7 +158,7 @@ class AsyncSettingsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSettingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/ssl/universal/universal.py b/src/cloudflare/resources/ssl/universal/universal.py index adb3c3b9968..8b2a4868f8d 100644 --- a/src/cloudflare/resources/ssl/universal/universal.py +++ b/src/cloudflare/resources/ssl/universal/universal.py @@ -24,7 +24,7 @@ def settings(self) -> SettingsResource: @cached_property def with_raw_response(self) -> UniversalResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def settings(self) -> AsyncSettingsResource: @cached_property def with_raw_response(self) -> AsyncUniversalResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/ssl/verification.py b/src/cloudflare/resources/ssl/verification.py index f4137009970..0f718890986 100644 --- a/src/cloudflare/resources/ssl/verification.py +++ b/src/cloudflare/resources/ssl/verification.py @@ -33,7 +33,7 @@ class VerificationResource(SyncAPIResource): @cached_property def with_raw_response(self) -> VerificationResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -153,7 +153,7 @@ class AsyncVerificationResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncVerificationResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/stream/audio_tracks.py b/src/cloudflare/resources/stream/audio_tracks.py index db63070af36..377b45aeda9 100644 --- a/src/cloudflare/resources/stream/audio_tracks.py +++ b/src/cloudflare/resources/stream/audio_tracks.py @@ -33,7 +33,7 @@ class AudioTracksResource(SyncAPIResource): @cached_property def with_raw_response(self) -> AudioTracksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -277,7 +277,7 @@ class AsyncAudioTracksResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncAudioTracksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/stream/captions/captions.py b/src/cloudflare/resources/stream/captions/captions.py index d79e258babd..068457a8526 100644 --- a/src/cloudflare/resources/stream/captions/captions.py +++ b/src/cloudflare/resources/stream/captions/captions.py @@ -38,7 +38,7 @@ def language(self) -> LanguageResource: @cached_property def with_raw_response(self) -> CaptionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -107,7 +107,7 @@ def language(self) -> AsyncLanguageResource: @cached_property def with_raw_response(self) -> AsyncCaptionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/stream/captions/language/language.py b/src/cloudflare/resources/stream/captions/language/language.py index 535aea5ceb8..f2d6fae2b2b 100644 --- a/src/cloudflare/resources/stream/captions/language/language.py +++ b/src/cloudflare/resources/stream/captions/language/language.py @@ -44,7 +44,7 @@ def vtt(self) -> VttResource: @cached_property def with_raw_response(self) -> LanguageResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -274,7 +274,7 @@ def vtt(self) -> AsyncVttResource: @cached_property def with_raw_response(self) -> AsyncLanguageResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/stream/captions/language/vtt.py b/src/cloudflare/resources/stream/captions/language/vtt.py index a85bf2eb09e..3343a804b92 100644 --- a/src/cloudflare/resources/stream/captions/language/vtt.py +++ b/src/cloudflare/resources/stream/captions/language/vtt.py @@ -22,7 +22,7 @@ class VttResource(SyncAPIResource): @cached_property def with_raw_response(self) -> VttResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -89,7 +89,7 @@ class AsyncVttResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncVttResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/stream/clip.py b/src/cloudflare/resources/stream/clip.py index ff8bb261aa1..510e77314e9 100644 --- a/src/cloudflare/resources/stream/clip.py +++ b/src/cloudflare/resources/stream/clip.py @@ -32,7 +32,7 @@ class ClipResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ClipResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -140,7 +140,7 @@ class AsyncClipResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncClipResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/stream/copy.py b/src/cloudflare/resources/stream/copy.py index 62175e19fb7..965cb784ff4 100644 --- a/src/cloudflare/resources/stream/copy.py +++ b/src/cloudflare/resources/stream/copy.py @@ -34,7 +34,7 @@ class CopyResource(SyncAPIResource): @cached_property def with_raw_response(self) -> CopyResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -157,7 +157,7 @@ class AsyncCopyResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncCopyResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/stream/direct_upload.py b/src/cloudflare/resources/stream/direct_upload.py index d3b3326a593..58f030fc670 100644 --- a/src/cloudflare/resources/stream/direct_upload.py +++ b/src/cloudflare/resources/stream/direct_upload.py @@ -34,7 +34,7 @@ class DirectUploadResource(SyncAPIResource): @cached_property def with_raw_response(self) -> DirectUploadResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -149,7 +149,7 @@ class AsyncDirectUploadResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncDirectUploadResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/stream/downloads.py b/src/cloudflare/resources/stream/downloads.py index 038d361d7e0..ec2d4d1d06b 100644 --- a/src/cloudflare/resources/stream/downloads.py +++ b/src/cloudflare/resources/stream/downloads.py @@ -31,7 +31,7 @@ class DownloadsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> DownloadsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -186,7 +186,7 @@ class AsyncDownloadsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncDownloadsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/stream/embed.py b/src/cloudflare/resources/stream/embed.py index 9893be8dea6..1f142723fe6 100644 --- a/src/cloudflare/resources/stream/embed.py +++ b/src/cloudflare/resources/stream/embed.py @@ -22,7 +22,7 @@ class EmbedResource(SyncAPIResource): @cached_property def with_raw_response(self) -> EmbedResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -85,7 +85,7 @@ class AsyncEmbedResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncEmbedResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/stream/keys.py b/src/cloudflare/resources/stream/keys.py index b3198bba6a9..061ce9f008d 100644 --- a/src/cloudflare/resources/stream/keys.py +++ b/src/cloudflare/resources/stream/keys.py @@ -33,7 +33,7 @@ class KeysResource(SyncAPIResource): @cached_property def with_raw_response(self) -> KeysResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -181,7 +181,7 @@ class AsyncKeysResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncKeysResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/stream/live_inputs/live_inputs.py b/src/cloudflare/resources/stream/live_inputs/live_inputs.py index afa3a6ff5e1..4564e09f3f5 100644 --- a/src/cloudflare/resources/stream/live_inputs/live_inputs.py +++ b/src/cloudflare/resources/stream/live_inputs/live_inputs.py @@ -44,7 +44,7 @@ def outputs(self) -> OutputsResource: @cached_property def with_raw_response(self) -> LiveInputsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -347,7 +347,7 @@ def outputs(self) -> AsyncOutputsResource: @cached_property def with_raw_response(self) -> AsyncLiveInputsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/stream/live_inputs/outputs.py b/src/cloudflare/resources/stream/live_inputs/outputs.py index ba59104da63..9fd3173851f 100644 --- a/src/cloudflare/resources/stream/live_inputs/outputs.py +++ b/src/cloudflare/resources/stream/live_inputs/outputs.py @@ -32,7 +32,7 @@ class OutputsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> OutputsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -272,7 +272,7 @@ class AsyncOutputsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncOutputsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/stream/stream.py b/src/cloudflare/resources/stream/stream.py index 379ffd55eb1..6931327830d 100644 --- a/src/cloudflare/resources/stream/stream.py +++ b/src/cloudflare/resources/stream/stream.py @@ -192,7 +192,7 @@ def token(self) -> TokenResource: @cached_property def with_raw_response(self) -> StreamResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -594,7 +594,7 @@ def token(self) -> AsyncTokenResource: @cached_property def with_raw_response(self) -> AsyncStreamResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/stream/token.py b/src/cloudflare/resources/stream/token.py index 553e5fc6a00..bfc0628b9c6 100644 --- a/src/cloudflare/resources/stream/token.py +++ b/src/cloudflare/resources/stream/token.py @@ -31,7 +31,7 @@ class TokenResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TokenResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -136,7 +136,7 @@ class AsyncTokenResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTokenResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/stream/videos.py b/src/cloudflare/resources/stream/videos.py index 9db59a1533a..f0e076ff46c 100644 --- a/src/cloudflare/resources/stream/videos.py +++ b/src/cloudflare/resources/stream/videos.py @@ -31,7 +31,7 @@ class VideosResource(SyncAPIResource): @cached_property def with_raw_response(self) -> VideosResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -95,7 +95,7 @@ class AsyncVideosResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncVideosResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/stream/watermarks.py b/src/cloudflare/resources/stream/watermarks.py index 15d48ff96f8..8e41e6afe09 100644 --- a/src/cloudflare/resources/stream/watermarks.py +++ b/src/cloudflare/resources/stream/watermarks.py @@ -33,7 +33,7 @@ class WatermarksResource(SyncAPIResource): @cached_property def with_raw_response(self) -> WatermarksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -260,7 +260,7 @@ class AsyncWatermarksResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncWatermarksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/stream/webhooks.py b/src/cloudflare/resources/stream/webhooks.py index 1ca68138227..58cb390851d 100644 --- a/src/cloudflare/resources/stream/webhooks.py +++ b/src/cloudflare/resources/stream/webhooks.py @@ -31,7 +31,7 @@ class WebhooksResource(SyncAPIResource): @cached_property def with_raw_response(self) -> WebhooksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -173,7 +173,7 @@ class AsyncWebhooksResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncWebhooksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/turnstile/turnstile.py b/src/cloudflare/resources/turnstile/turnstile.py index f30e742b157..46dea4d7e61 100644 --- a/src/cloudflare/resources/turnstile/turnstile.py +++ b/src/cloudflare/resources/turnstile/turnstile.py @@ -24,7 +24,7 @@ def widgets(self) -> WidgetsResource: @cached_property def with_raw_response(self) -> TurnstileResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def widgets(self) -> AsyncWidgetsResource: @cached_property def with_raw_response(self) -> AsyncTurnstileResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/turnstile/widgets.py b/src/cloudflare/resources/turnstile/widgets.py index d78e2b0415f..ef43dc185f0 100644 --- a/src/cloudflare/resources/turnstile/widgets.py +++ b/src/cloudflare/resources/turnstile/widgets.py @@ -40,7 +40,7 @@ class WidgetsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> WidgetsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -443,7 +443,7 @@ class AsyncWidgetsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncWidgetsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/url_normalization.py b/src/cloudflare/resources/url_normalization.py index 87bab9c625e..e19809c70a9 100644 --- a/src/cloudflare/resources/url_normalization.py +++ b/src/cloudflare/resources/url_normalization.py @@ -33,7 +33,7 @@ class URLNormalizationResource(SyncAPIResource): @cached_property def with_raw_response(self) -> URLNormalizationResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -181,7 +181,7 @@ class AsyncURLNormalizationResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncURLNormalizationResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/url_scanner/responses.py b/src/cloudflare/resources/url_scanner/responses.py index 322e44344bc..e1f6f2bda24 100644 --- a/src/cloudflare/resources/url_scanner/responses.py +++ b/src/cloudflare/resources/url_scanner/responses.py @@ -22,7 +22,7 @@ class ResponsesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ResponsesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -86,7 +86,7 @@ class AsyncResponsesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncResponsesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/url_scanner/scans.py b/src/cloudflare/resources/url_scanner/scans.py index dc22dbddda8..fd03055b71c 100644 --- a/src/cloudflare/resources/url_scanner/scans.py +++ b/src/cloudflare/resources/url_scanner/scans.py @@ -44,7 +44,7 @@ class ScansResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ScansResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -409,7 +409,7 @@ class AsyncScansResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncScansResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/url_scanner/url_scanner.py b/src/cloudflare/resources/url_scanner/url_scanner.py index 599de25507c..707140787c7 100644 --- a/src/cloudflare/resources/url_scanner/url_scanner.py +++ b/src/cloudflare/resources/url_scanner/url_scanner.py @@ -36,7 +36,7 @@ def scans(self) -> ScansResource: @cached_property def with_raw_response(self) -> URLScannerResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -65,7 +65,7 @@ def scans(self) -> AsyncScansResource: @cached_property def with_raw_response(self) -> AsyncURLScannerResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/user/audit_logs.py b/src/cloudflare/resources/user/audit_logs.py index b6829de3650..876dd035112 100644 --- a/src/cloudflare/resources/user/audit_logs.py +++ b/src/cloudflare/resources/user/audit_logs.py @@ -30,7 +30,7 @@ class AuditLogsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> AuditLogsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -132,7 +132,7 @@ class AsyncAuditLogsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncAuditLogsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/user/billing/billing.py b/src/cloudflare/resources/user/billing/billing.py index fdebcbda577..3a8ae89257f 100644 --- a/src/cloudflare/resources/user/billing/billing.py +++ b/src/cloudflare/resources/user/billing/billing.py @@ -36,7 +36,7 @@ def profile(self) -> ProfileResource: @cached_property def with_raw_response(self) -> BillingResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -65,7 +65,7 @@ def profile(self) -> AsyncProfileResource: @cached_property def with_raw_response(self) -> AsyncBillingResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/user/billing/history.py b/src/cloudflare/resources/user/billing/history.py index e9cb539cdbe..435fc562da8 100644 --- a/src/cloudflare/resources/user/billing/history.py +++ b/src/cloudflare/resources/user/billing/history.py @@ -30,7 +30,7 @@ class HistoryResource(SyncAPIResource): @cached_property def with_raw_response(self) -> HistoryResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -114,7 +114,7 @@ class AsyncHistoryResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncHistoryResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/user/billing/profile.py b/src/cloudflare/resources/user/billing/profile.py index d76debecc17..c038442b8d1 100644 --- a/src/cloudflare/resources/user/billing/profile.py +++ b/src/cloudflare/resources/user/billing/profile.py @@ -26,7 +26,7 @@ class ProfileResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ProfileResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -70,7 +70,7 @@ class AsyncProfileResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncProfileResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/user/invites.py b/src/cloudflare/resources/user/invites.py index cd850871727..0b3e9f2a4eb 100644 --- a/src/cloudflare/resources/user/invites.py +++ b/src/cloudflare/resources/user/invites.py @@ -33,7 +33,7 @@ class InvitesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> InvitesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -156,7 +156,7 @@ class AsyncInvitesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncInvitesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/user/organizations.py b/src/cloudflare/resources/user/organizations.py index d270dbbffc7..888205b04e5 100644 --- a/src/cloudflare/resources/user/organizations.py +++ b/src/cloudflare/resources/user/organizations.py @@ -31,7 +31,7 @@ class OrganizationsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> OrganizationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -193,7 +193,7 @@ class AsyncOrganizationsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncOrganizationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/user/subscriptions.py b/src/cloudflare/resources/user/subscriptions.py index 97414ec7a20..0d21f3985f5 100644 --- a/src/cloudflare/resources/user/subscriptions.py +++ b/src/cloudflare/resources/user/subscriptions.py @@ -35,7 +35,7 @@ class SubscriptionsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SubscriptionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -171,7 +171,7 @@ class AsyncSubscriptionsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSubscriptionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/user/tokens/permission_groups.py b/src/cloudflare/resources/user/tokens/permission_groups.py index ee5f34394bd..5c601a36471 100644 --- a/src/cloudflare/resources/user/tokens/permission_groups.py +++ b/src/cloudflare/resources/user/tokens/permission_groups.py @@ -23,7 +23,7 @@ class PermissionGroupsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> PermissionGroupsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -64,7 +64,7 @@ class AsyncPermissionGroupsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncPermissionGroupsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/user/tokens/tokens.py b/src/cloudflare/resources/user/tokens/tokens.py index f289d00eecb..6dda5c6ecc9 100644 --- a/src/cloudflare/resources/user/tokens/tokens.py +++ b/src/cloudflare/resources/user/tokens/tokens.py @@ -62,7 +62,7 @@ def value(self) -> ValueResource: @cached_property def with_raw_response(self) -> TokensResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -368,7 +368,7 @@ def value(self) -> AsyncValueResource: @cached_property def with_raw_response(self) -> AsyncTokensResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/user/tokens/value.py b/src/cloudflare/resources/user/tokens/value.py index 4a399fba20a..be97f818c77 100644 --- a/src/cloudflare/resources/user/tokens/value.py +++ b/src/cloudflare/resources/user/tokens/value.py @@ -31,7 +31,7 @@ class ValueResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ValueResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -93,7 +93,7 @@ class AsyncValueResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncValueResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/user/user.py b/src/cloudflare/resources/user/user.py index 5680184c284..bdb764ca40f 100644 --- a/src/cloudflare/resources/user/user.py +++ b/src/cloudflare/resources/user/user.py @@ -102,7 +102,7 @@ def tokens(self) -> TokensResource: @cached_property def with_raw_response(self) -> UserResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -229,7 +229,7 @@ def tokens(self) -> AsyncTokensResource: @cached_property def with_raw_response(self) -> AsyncUserResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/vectorize/indexes/indexes.py b/src/cloudflare/resources/vectorize/indexes/indexes.py index f0f19510cce..80900880a09 100644 --- a/src/cloudflare/resources/vectorize/indexes/indexes.py +++ b/src/cloudflare/resources/vectorize/indexes/indexes.py @@ -58,7 +58,7 @@ def metadata_index(self) -> MetadataIndexResource: @cached_property def with_raw_response(self) -> IndexesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -570,7 +570,7 @@ def metadata_index(self) -> AsyncMetadataIndexResource: @cached_property def with_raw_response(self) -> AsyncIndexesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/vectorize/indexes/metadata_index.py b/src/cloudflare/resources/vectorize/indexes/metadata_index.py index ba9efde5a5c..921cbdeaaff 100644 --- a/src/cloudflare/resources/vectorize/indexes/metadata_index.py +++ b/src/cloudflare/resources/vectorize/indexes/metadata_index.py @@ -34,7 +34,7 @@ class MetadataIndexResource(SyncAPIResource): @cached_property def with_raw_response(self) -> MetadataIndexResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -201,7 +201,7 @@ class AsyncMetadataIndexResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncMetadataIndexResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/vectorize/vectorize.py b/src/cloudflare/resources/vectorize/vectorize.py index dd2961b7b7c..e0dc5e6e4d2 100644 --- a/src/cloudflare/resources/vectorize/vectorize.py +++ b/src/cloudflare/resources/vectorize/vectorize.py @@ -24,7 +24,7 @@ def indexes(self) -> IndexesResource: @cached_property def with_raw_response(self) -> VectorizeResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def indexes(self) -> AsyncIndexesResource: @cached_property def with_raw_response(self) -> AsyncVectorizeResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/waiting_rooms/events/details.py b/src/cloudflare/resources/waiting_rooms/events/details.py index 335b3d88a6a..d400a31ad46 100644 --- a/src/cloudflare/resources/waiting_rooms/events/details.py +++ b/src/cloudflare/resources/waiting_rooms/events/details.py @@ -26,7 +26,7 @@ class DetailsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> DetailsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -94,7 +94,7 @@ class AsyncDetailsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncDetailsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/waiting_rooms/events/events.py b/src/cloudflare/resources/waiting_rooms/events/events.py index 4afc6e89743..df0401a67ba 100644 --- a/src/cloudflare/resources/waiting_rooms/events/events.py +++ b/src/cloudflare/resources/waiting_rooms/events/events.py @@ -45,7 +45,7 @@ def details(self) -> DetailsResource: @cached_property def with_raw_response(self) -> EventsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -581,7 +581,7 @@ def details(self) -> AsyncDetailsResource: @cached_property def with_raw_response(self) -> AsyncEventsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/waiting_rooms/page.py b/src/cloudflare/resources/waiting_rooms/page.py index 295d1ce56aa..32b764ae5d5 100644 --- a/src/cloudflare/resources/waiting_rooms/page.py +++ b/src/cloudflare/resources/waiting_rooms/page.py @@ -31,7 +31,7 @@ class PageResource(SyncAPIResource): @cached_property def with_raw_response(self) -> PageResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -151,7 +151,7 @@ class AsyncPageResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncPageResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/waiting_rooms/rules.py b/src/cloudflare/resources/waiting_rooms/rules.py index 70c25bb8a91..d3f669c2685 100644 --- a/src/cloudflare/resources/waiting_rooms/rules.py +++ b/src/cloudflare/resources/waiting_rooms/rules.py @@ -36,7 +36,7 @@ class RulesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> RulesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -310,7 +310,7 @@ class AsyncRulesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncRulesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/waiting_rooms/settings.py b/src/cloudflare/resources/waiting_rooms/settings.py index c6b3e7ca380..69194fb59ef 100644 --- a/src/cloudflare/resources/waiting_rooms/settings.py +++ b/src/cloudflare/resources/waiting_rooms/settings.py @@ -33,7 +33,7 @@ class SettingsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SettingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -188,7 +188,7 @@ class AsyncSettingsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSettingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/waiting_rooms/statuses.py b/src/cloudflare/resources/waiting_rooms/statuses.py index 1c8cf356f0c..bcd50bc1b39 100644 --- a/src/cloudflare/resources/waiting_rooms/statuses.py +++ b/src/cloudflare/resources/waiting_rooms/statuses.py @@ -26,7 +26,7 @@ class StatusesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> StatusesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -107,7 +107,7 @@ class AsyncStatusesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncStatusesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/waiting_rooms/waiting_rooms.py b/src/cloudflare/resources/waiting_rooms/waiting_rooms.py index 4b9c83a3687..c8d76fc3e2f 100644 --- a/src/cloudflare/resources/waiting_rooms/waiting_rooms.py +++ b/src/cloudflare/resources/waiting_rooms/waiting_rooms.py @@ -101,7 +101,7 @@ def settings(self) -> SettingsResource: @cached_property def with_raw_response(self) -> WaitingRoomsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -1475,7 +1475,7 @@ def settings(self) -> AsyncSettingsResource: @cached_property def with_raw_response(self) -> AsyncWaitingRoomsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/web3/hostnames/hostnames.py b/src/cloudflare/resources/web3/hostnames/hostnames.py index 58357a662aa..b5d7da3ab83 100644 --- a/src/cloudflare/resources/web3/hostnames/hostnames.py +++ b/src/cloudflare/resources/web3/hostnames/hostnames.py @@ -46,7 +46,7 @@ def ipfs_universal_paths(self) -> IPFSUniversalPathsResource: @cached_property def with_raw_response(self) -> HostnamesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -312,7 +312,7 @@ def ipfs_universal_paths(self) -> AsyncIPFSUniversalPathsResource: @cached_property def with_raw_response(self) -> AsyncHostnamesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/content_lists/content_lists.py b/src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/content_lists/content_lists.py index 4e8efa3ddb2..37675c372c8 100644 --- a/src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/content_lists/content_lists.py +++ b/src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/content_lists/content_lists.py @@ -44,7 +44,7 @@ def entries(self) -> EntriesResource: @cached_property def with_raw_response(self) -> ContentListsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -170,7 +170,7 @@ def entries(self) -> AsyncEntriesResource: @cached_property def with_raw_response(self) -> AsyncContentListsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/content_lists/entries.py b/src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/content_lists/entries.py index db47f09b4d8..2991641bdb9 100644 --- a/src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/content_lists/entries.py +++ b/src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/content_lists/entries.py @@ -36,7 +36,7 @@ class EntriesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> EntriesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -332,7 +332,7 @@ class AsyncEntriesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncEntriesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/ipfs_universal_paths.py b/src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/ipfs_universal_paths.py index be95236abf9..87b695bacc2 100644 --- a/src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/ipfs_universal_paths.py +++ b/src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/ipfs_universal_paths.py @@ -24,7 +24,7 @@ def content_lists(self) -> ContentListsResource: @cached_property def with_raw_response(self) -> IPFSUniversalPathsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def content_lists(self) -> AsyncContentListsResource: @cached_property def with_raw_response(self) -> AsyncIPFSUniversalPathsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/web3/web3.py b/src/cloudflare/resources/web3/web3.py index 0e432afac3e..da328969054 100644 --- a/src/cloudflare/resources/web3/web3.py +++ b/src/cloudflare/resources/web3/web3.py @@ -24,7 +24,7 @@ def hostnames(self) -> HostnamesResource: @cached_property def with_raw_response(self) -> Web3ResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def hostnames(self) -> AsyncHostnamesResource: @cached_property def with_raw_response(self) -> AsyncWeb3ResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/workers/account_settings.py b/src/cloudflare/resources/workers/account_settings.py index c20d204f833..453ec1c38d1 100644 --- a/src/cloudflare/resources/workers/account_settings.py +++ b/src/cloudflare/resources/workers/account_settings.py @@ -32,7 +32,7 @@ class AccountSettingsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> AccountSettingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -140,7 +140,7 @@ class AsyncAccountSettingsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncAccountSettingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/workers/assets/assets.py b/src/cloudflare/resources/workers/assets/assets.py index 068626ff331..f26c89d58d3 100644 --- a/src/cloudflare/resources/workers/assets/assets.py +++ b/src/cloudflare/resources/workers/assets/assets.py @@ -24,7 +24,7 @@ def upload(self) -> UploadResource: @cached_property def with_raw_response(self) -> AssetsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def upload(self) -> AsyncUploadResource: @cached_property def with_raw_response(self) -> AsyncAssetsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/workers/assets/upload.py b/src/cloudflare/resources/workers/assets/upload.py index ecc8a178557..320d4092f31 100644 --- a/src/cloudflare/resources/workers/assets/upload.py +++ b/src/cloudflare/resources/workers/assets/upload.py @@ -32,7 +32,7 @@ class UploadResource(SyncAPIResource): @cached_property def with_raw_response(self) -> UploadResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -108,7 +108,7 @@ class AsyncUploadResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncUploadResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/workers/domains.py b/src/cloudflare/resources/workers/domains.py index abe4bb6a398..69eeddf256f 100644 --- a/src/cloudflare/resources/workers/domains.py +++ b/src/cloudflare/resources/workers/domains.py @@ -32,7 +32,7 @@ class DomainsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> DomainsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -262,7 +262,7 @@ class AsyncDomainsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncDomainsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/workers/routes.py b/src/cloudflare/resources/workers/routes.py index 7af10337af1..268070d2fb1 100644 --- a/src/cloudflare/resources/workers/routes.py +++ b/src/cloudflare/resources/workers/routes.py @@ -36,7 +36,7 @@ class RoutesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> RoutesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -278,7 +278,7 @@ class AsyncRoutesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncRoutesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/workers/scripts/assets/assets.py b/src/cloudflare/resources/workers/scripts/assets/assets.py index f5a2e1f5f08..a6f7ceb3d1b 100644 --- a/src/cloudflare/resources/workers/scripts/assets/assets.py +++ b/src/cloudflare/resources/workers/scripts/assets/assets.py @@ -24,7 +24,7 @@ def upload(self) -> UploadResource: @cached_property def with_raw_response(self) -> AssetsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def upload(self) -> AsyncUploadResource: @cached_property def with_raw_response(self) -> AsyncAssetsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/workers/scripts/assets/upload.py b/src/cloudflare/resources/workers/scripts/assets/upload.py index 836583e47f4..cd55d95545b 100644 --- a/src/cloudflare/resources/workers/scripts/assets/upload.py +++ b/src/cloudflare/resources/workers/scripts/assets/upload.py @@ -31,7 +31,7 @@ class UploadResource(SyncAPIResource): @cached_property def with_raw_response(self) -> UploadResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -104,7 +104,7 @@ class AsyncUploadResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncUploadResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/workers/scripts/content.py b/src/cloudflare/resources/workers/scripts/content.py index 09d1d506899..41fa26e276e 100644 --- a/src/cloudflare/resources/workers/scripts/content.py +++ b/src/cloudflare/resources/workers/scripts/content.py @@ -41,7 +41,7 @@ class ContentResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ContentResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -166,7 +166,7 @@ class AsyncContentResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncContentResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/workers/scripts/deployments.py b/src/cloudflare/resources/workers/scripts/deployments.py index ffa63b8f9ac..8a16a470833 100644 --- a/src/cloudflare/resources/workers/scripts/deployments.py +++ b/src/cloudflare/resources/workers/scripts/deployments.py @@ -34,7 +34,7 @@ class DeploymentsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> DeploymentsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -164,7 +164,7 @@ class AsyncDeploymentsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncDeploymentsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/workers/scripts/schedules.py b/src/cloudflare/resources/workers/scripts/schedules.py index 434013ba73b..b87d9f76e7c 100644 --- a/src/cloudflare/resources/workers/scripts/schedules.py +++ b/src/cloudflare/resources/workers/scripts/schedules.py @@ -32,7 +32,7 @@ class SchedulesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SchedulesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -143,7 +143,7 @@ class AsyncSchedulesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSchedulesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/workers/scripts/scripts.py b/src/cloudflare/resources/workers/scripts/scripts.py index 5164db2723c..7738ba71148 100644 --- a/src/cloudflare/resources/workers/scripts/scripts.py +++ b/src/cloudflare/resources/workers/scripts/scripts.py @@ -129,7 +129,7 @@ def versions(self) -> VersionsResource: @cached_property def with_raw_response(self) -> ScriptsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -363,7 +363,7 @@ def versions(self) -> AsyncVersionsResource: @cached_property def with_raw_response(self) -> AsyncScriptsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/workers/scripts/settings.py b/src/cloudflare/resources/workers/scripts/settings.py index fd47aa9a04d..9d9dd01150e 100644 --- a/src/cloudflare/resources/workers/scripts/settings.py +++ b/src/cloudflare/resources/workers/scripts/settings.py @@ -32,7 +32,7 @@ class SettingsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SettingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -162,7 +162,7 @@ class AsyncSettingsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSettingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/workers/scripts/subdomain.py b/src/cloudflare/resources/workers/scripts/subdomain.py index 3ab95584ebd..38ac30aa577 100644 --- a/src/cloudflare/resources/workers/scripts/subdomain.py +++ b/src/cloudflare/resources/workers/scripts/subdomain.py @@ -29,7 +29,7 @@ class SubdomainResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SubdomainResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -144,7 +144,7 @@ class AsyncSubdomainResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSubdomainResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/workers/scripts/tail.py b/src/cloudflare/resources/workers/scripts/tail.py index 91d76d188c1..e4d372da2c0 100644 --- a/src/cloudflare/resources/workers/scripts/tail.py +++ b/src/cloudflare/resources/workers/scripts/tail.py @@ -33,7 +33,7 @@ class TailResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TailResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -189,7 +189,7 @@ class AsyncTailResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTailResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/workers/scripts/versions.py b/src/cloudflare/resources/workers/scripts/versions.py index 749b4f83f55..cd915c1f7c9 100644 --- a/src/cloudflare/resources/workers/scripts/versions.py +++ b/src/cloudflare/resources/workers/scripts/versions.py @@ -34,7 +34,7 @@ class VersionsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> VersionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -219,7 +219,7 @@ class AsyncVersionsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncVersionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/workers/subdomains.py b/src/cloudflare/resources/workers/subdomains.py index 6b7d71ad56d..6910f65c1b2 100644 --- a/src/cloudflare/resources/workers/subdomains.py +++ b/src/cloudflare/resources/workers/subdomains.py @@ -32,7 +32,7 @@ class SubdomainsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SubdomainsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -133,7 +133,7 @@ class AsyncSubdomainsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSubdomainsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/workers/workers.py b/src/cloudflare/resources/workers/workers.py index e167830c87d..7a3a499542f 100644 --- a/src/cloudflare/resources/workers/workers.py +++ b/src/cloudflare/resources/workers/workers.py @@ -84,7 +84,7 @@ def subdomains(self) -> SubdomainsResource: @cached_property def with_raw_response(self) -> WorkersResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -129,7 +129,7 @@ def subdomains(self) -> AsyncSubdomainsResource: @cached_property def with_raw_response(self) -> AsyncWorkersResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/dispatch.py b/src/cloudflare/resources/workers_for_platforms/dispatch/dispatch.py index 2d14a862986..675f72c8787 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/dispatch.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/dispatch.py @@ -24,7 +24,7 @@ def namespaces(self) -> NamespacesResource: @cached_property def with_raw_response(self) -> DispatchResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def namespaces(self) -> AsyncNamespacesResource: @cached_property def with_raw_response(self) -> AsyncDispatchResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/namespaces.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/namespaces.py index 00db79b99cc..37e9b6b07c0 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/namespaces.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/namespaces.py @@ -46,7 +46,7 @@ def scripts(self) -> ScriptsResource: @cached_property def with_raw_response(self) -> NamespacesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -238,7 +238,7 @@ def scripts(self) -> AsyncScriptsResource: @cached_property def with_raw_response(self) -> AsyncNamespacesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/asset_upload.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/asset_upload.py index 4b4e04a0a4e..b54f6c1fbb4 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/asset_upload.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/asset_upload.py @@ -33,7 +33,7 @@ class AssetUploadResource(SyncAPIResource): @cached_property def with_raw_response(self) -> AssetUploadResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -111,7 +111,7 @@ class AsyncAssetUploadResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncAssetUploadResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/bindings.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/bindings.py index ecd9327cebd..6532f30ee21 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/bindings.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/bindings.py @@ -26,7 +26,7 @@ class BindingsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> BindingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -97,7 +97,7 @@ class AsyncBindingsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncBindingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/content.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/content.py index 48a6af6ffc6..49da6102ab3 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/content.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/content.py @@ -41,7 +41,7 @@ class ContentResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ContentResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -177,7 +177,7 @@ class AsyncContentResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncContentResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/scripts.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/scripts.py index 054cb9de7be..3333e61add8 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/scripts.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/scripts.py @@ -104,7 +104,7 @@ def tags(self) -> TagsResource: @cached_property def with_raw_response(self) -> ScriptsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -311,7 +311,7 @@ def tags(self) -> AsyncTagsResource: @cached_property def with_raw_response(self) -> AsyncScriptsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/secrets.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/secrets.py index e9f4ed81ff6..6c6c4d7fbbb 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/secrets.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/secrets.py @@ -35,7 +35,7 @@ class SecretsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SecretsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -223,7 +223,7 @@ class AsyncSecretsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSecretsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/settings.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/settings.py index 6341906d37c..422446a3ad0 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/settings.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/settings.py @@ -32,7 +32,7 @@ class SettingsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SettingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -157,7 +157,7 @@ class AsyncSettingsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSettingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/tags.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/tags.py index 168915d13b3..42ae35e97a5 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/tags.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/tags.py @@ -32,7 +32,7 @@ class TagsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TagsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -206,7 +206,7 @@ class AsyncTagsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTagsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/workers_for_platforms/workers_for_platforms.py b/src/cloudflare/resources/workers_for_platforms/workers_for_platforms.py index ae9cfa96347..b986656be32 100644 --- a/src/cloudflare/resources/workers_for_platforms/workers_for_platforms.py +++ b/src/cloudflare/resources/workers_for_platforms/workers_for_platforms.py @@ -24,7 +24,7 @@ def dispatch(self) -> DispatchResource: @cached_property def with_raw_response(self) -> WorkersForPlatformsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def dispatch(self) -> AsyncDispatchResource: @cached_property def with_raw_response(self) -> AsyncWorkersForPlatformsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/workflows/instances/instances.py b/src/cloudflare/resources/workflows/instances/instances.py index 4afaf0d4e72..05d29386237 100644 --- a/src/cloudflare/resources/workflows/instances/instances.py +++ b/src/cloudflare/resources/workflows/instances/instances.py @@ -48,7 +48,7 @@ def status(self) -> StatusResource: @cached_property def with_raw_response(self) -> InstancesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -227,7 +227,7 @@ def status(self) -> AsyncStatusResource: @cached_property def with_raw_response(self) -> AsyncInstancesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/workflows/instances/status.py b/src/cloudflare/resources/workflows/instances/status.py index b68e6504697..766d412e3e1 100644 --- a/src/cloudflare/resources/workflows/instances/status.py +++ b/src/cloudflare/resources/workflows/instances/status.py @@ -32,7 +32,7 @@ class StatusResource(SyncAPIResource): @cached_property def with_raw_response(self) -> StatusResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -100,7 +100,7 @@ class AsyncStatusResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncStatusResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/workflows/versions.py b/src/cloudflare/resources/workflows/versions.py index a4e4b518df5..d83930116af 100644 --- a/src/cloudflare/resources/workflows/versions.py +++ b/src/cloudflare/resources/workflows/versions.py @@ -30,7 +30,7 @@ class VersionsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> VersionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -143,7 +143,7 @@ class AsyncVersionsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncVersionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/workflows/workflows.py b/src/cloudflare/resources/workflows/workflows.py index 695999d5f25..ee422a767ac 100644 --- a/src/cloudflare/resources/workflows/workflows.py +++ b/src/cloudflare/resources/workflows/workflows.py @@ -58,7 +58,7 @@ def versions(self) -> VersionsResource: @cached_property def with_raw_response(self) -> WorkflowsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -222,7 +222,7 @@ def versions(self) -> AsyncVersionsResource: @cached_property def with_raw_response(self) -> AsyncWorkflowsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/access/access.py b/src/cloudflare/resources/zero_trust/access/access.py index d6aef830815..d2b7804b4a5 100644 --- a/src/cloudflare/resources/zero_trust/access/access.py +++ b/src/cloudflare/resources/zero_trust/access/access.py @@ -168,7 +168,7 @@ def policies(self) -> PoliciesResource: @cached_property def with_raw_response(self) -> AccessResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -241,7 +241,7 @@ def policies(self) -> AsyncPoliciesResource: @cached_property def with_raw_response(self) -> AsyncAccessResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/access/applications/applications.py b/src/cloudflare/resources/zero_trust/access/applications/applications.py index d0c6fa62c7b..87e15f52e56 100644 --- a/src/cloudflare/resources/zero_trust/access/applications/applications.py +++ b/src/cloudflare/resources/zero_trust/access/applications/applications.py @@ -96,7 +96,7 @@ def policy_tests(self) -> PolicyTestsResource: @cached_property def with_raw_response(self) -> ApplicationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -2210,7 +2210,7 @@ def policy_tests(self) -> AsyncPolicyTestsResource: @cached_property def with_raw_response(self) -> AsyncApplicationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/access/applications/cas.py b/src/cloudflare/resources/zero_trust/access/applications/cas.py index bc9acc32378..754f6c8d7e9 100644 --- a/src/cloudflare/resources/zero_trust/access/applications/cas.py +++ b/src/cloudflare/resources/zero_trust/access/applications/cas.py @@ -28,7 +28,7 @@ class CAsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> CAsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -269,7 +269,7 @@ class AsyncCAsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncCAsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/access/applications/policies.py b/src/cloudflare/resources/zero_trust/access/applications/policies.py index 6e4dce502a2..8f7912e0850 100644 --- a/src/cloudflare/resources/zero_trust/access/applications/policies.py +++ b/src/cloudflare/resources/zero_trust/access/applications/policies.py @@ -37,7 +37,7 @@ class PoliciesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> PoliciesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -444,7 +444,7 @@ class AsyncPoliciesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncPoliciesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/access/applications/policy_tests/policy_tests.py b/src/cloudflare/resources/zero_trust/access/applications/policy_tests/policy_tests.py index 6cc53186ea2..a43adaebf58 100755 --- a/src/cloudflare/resources/zero_trust/access/applications/policy_tests/policy_tests.py +++ b/src/cloudflare/resources/zero_trust/access/applications/policy_tests/policy_tests.py @@ -47,7 +47,7 @@ def users(self) -> UsersResource: @cached_property def with_raw_response(self) -> PolicyTestsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -209,7 +209,7 @@ def users(self) -> AsyncUsersResource: @cached_property def with_raw_response(self) -> AsyncPolicyTestsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/access/applications/policy_tests/users.py b/src/cloudflare/resources/zero_trust/access/applications/policy_tests/users.py index d0ddc850702..d3e70844952 100755 --- a/src/cloudflare/resources/zero_trust/access/applications/policy_tests/users.py +++ b/src/cloudflare/resources/zero_trust/access/applications/policy_tests/users.py @@ -23,7 +23,7 @@ class UsersResource(SyncAPIResource): @cached_property def with_raw_response(self) -> UsersResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -84,7 +84,7 @@ class AsyncUsersResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncUsersResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/access/applications/user_policy_checks.py b/src/cloudflare/resources/zero_trust/access/applications/user_policy_checks.py index e3f5edf1ed8..0909f95429c 100644 --- a/src/cloudflare/resources/zero_trust/access/applications/user_policy_checks.py +++ b/src/cloudflare/resources/zero_trust/access/applications/user_policy_checks.py @@ -28,7 +28,7 @@ class UserPolicyChecksResource(SyncAPIResource): @cached_property def with_raw_response(self) -> UserPolicyChecksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -106,7 +106,7 @@ class AsyncUserPolicyChecksResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncUserPolicyChecksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/access/bookmarks.py b/src/cloudflare/resources/zero_trust/access/bookmarks.py index 67317bd3682..c1be862a40c 100644 --- a/src/cloudflare/resources/zero_trust/access/bookmarks.py +++ b/src/cloudflare/resources/zero_trust/access/bookmarks.py @@ -33,7 +33,7 @@ class BookmarksResource(SyncAPIResource): @cached_property def with_raw_response(self) -> BookmarksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -260,7 +260,7 @@ class AsyncBookmarksResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncBookmarksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/access/certificates/certificates.py b/src/cloudflare/resources/zero_trust/access/certificates/certificates.py index e63570adf05..c7715cf4893 100644 --- a/src/cloudflare/resources/zero_trust/access/certificates/certificates.py +++ b/src/cloudflare/resources/zero_trust/access/certificates/certificates.py @@ -46,7 +46,7 @@ def settings(self) -> SettingsResource: @cached_property def with_raw_response(self) -> CertificatesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -373,7 +373,7 @@ def settings(self) -> AsyncSettingsResource: @cached_property def with_raw_response(self) -> AsyncCertificatesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/access/certificates/settings.py b/src/cloudflare/resources/zero_trust/access/certificates/settings.py index a360a93d704..86e37e2bc8e 100644 --- a/src/cloudflare/resources/zero_trust/access/certificates/settings.py +++ b/src/cloudflare/resources/zero_trust/access/certificates/settings.py @@ -33,7 +33,7 @@ class SettingsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SettingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -160,7 +160,7 @@ class AsyncSettingsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSettingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/access/custom_pages.py b/src/cloudflare/resources/zero_trust/access/custom_pages.py index 11bab5dc3cb..7ba05bc5926 100644 --- a/src/cloudflare/resources/zero_trust/access/custom_pages.py +++ b/src/cloudflare/resources/zero_trust/access/custom_pages.py @@ -35,7 +35,7 @@ class CustomPagesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> CustomPagesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -305,7 +305,7 @@ class AsyncCustomPagesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncCustomPagesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/access/gateway_ca.py b/src/cloudflare/resources/zero_trust/access/gateway_ca.py index d349400078f..12007722628 100644 --- a/src/cloudflare/resources/zero_trust/access/gateway_ca.py +++ b/src/cloudflare/resources/zero_trust/access/gateway_ca.py @@ -29,7 +29,7 @@ class GatewayCAResource(SyncAPIResource): @cached_property def with_raw_response(self) -> GatewayCAResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -169,7 +169,7 @@ class AsyncGatewayCAResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncGatewayCAResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/access/groups.py b/src/cloudflare/resources/zero_trust/access/groups.py index 72d5387ce10..2de59b208dc 100644 --- a/src/cloudflare/resources/zero_trust/access/groups.py +++ b/src/cloudflare/resources/zero_trust/access/groups.py @@ -34,7 +34,7 @@ class GroupsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> GroupsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -399,7 +399,7 @@ class AsyncGroupsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncGroupsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/access/infrastructure/infrastructure.py b/src/cloudflare/resources/zero_trust/access/infrastructure/infrastructure.py index af2843cbab3..4bc51c39829 100644 --- a/src/cloudflare/resources/zero_trust/access/infrastructure/infrastructure.py +++ b/src/cloudflare/resources/zero_trust/access/infrastructure/infrastructure.py @@ -24,7 +24,7 @@ def targets(self) -> TargetsResource: @cached_property def with_raw_response(self) -> InfrastructureResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def targets(self) -> AsyncTargetsResource: @cached_property def with_raw_response(self) -> AsyncInfrastructureResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/access/infrastructure/targets.py b/src/cloudflare/resources/zero_trust/access/infrastructure/targets.py index e6865b5b221..22f11c9e6fc 100644 --- a/src/cloudflare/resources/zero_trust/access/infrastructure/targets.py +++ b/src/cloudflare/resources/zero_trust/access/infrastructure/targets.py @@ -43,7 +43,7 @@ class TargetsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TargetsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -438,7 +438,7 @@ class AsyncTargetsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTargetsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/access/keys.py b/src/cloudflare/resources/zero_trust/access/keys.py index 077d3865a5d..577a2bfd165 100644 --- a/src/cloudflare/resources/zero_trust/access/keys.py +++ b/src/cloudflare/resources/zero_trust/access/keys.py @@ -33,7 +33,7 @@ class KeysResource(SyncAPIResource): @cached_property def with_raw_response(self) -> KeysResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -177,7 +177,7 @@ class AsyncKeysResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncKeysResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/access/logs/access_requests.py b/src/cloudflare/resources/zero_trust/access/logs/access_requests.py index 5c308f7b176..6ca018df9d8 100644 --- a/src/cloudflare/resources/zero_trust/access/logs/access_requests.py +++ b/src/cloudflare/resources/zero_trust/access/logs/access_requests.py @@ -33,7 +33,7 @@ class AccessRequestsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> AccessRequestsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -114,7 +114,7 @@ class AsyncAccessRequestsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncAccessRequestsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/access/logs/logs.py b/src/cloudflare/resources/zero_trust/access/logs/logs.py index 945bada8f81..03a9cf3c20d 100644 --- a/src/cloudflare/resources/zero_trust/access/logs/logs.py +++ b/src/cloudflare/resources/zero_trust/access/logs/logs.py @@ -24,7 +24,7 @@ def access_requests(self) -> AccessRequestsResource: @cached_property def with_raw_response(self) -> LogsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def access_requests(self) -> AsyncAccessRequestsResource: @cached_property def with_raw_response(self) -> AsyncLogsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/access/policies.py b/src/cloudflare/resources/zero_trust/access/policies.py index 470ba9d0d59..79e74c3d732 100644 --- a/src/cloudflare/resources/zero_trust/access/policies.py +++ b/src/cloudflare/resources/zero_trust/access/policies.py @@ -39,7 +39,7 @@ class PoliciesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> PoliciesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -383,7 +383,7 @@ class AsyncPoliciesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncPoliciesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/access/service_tokens.py b/src/cloudflare/resources/zero_trust/access/service_tokens.py index c82336ea5f9..67c481fad92 100644 --- a/src/cloudflare/resources/zero_trust/access/service_tokens.py +++ b/src/cloudflare/resources/zero_trust/access/service_tokens.py @@ -38,7 +38,7 @@ class ServiceTokensResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ServiceTokensResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -468,7 +468,7 @@ class AsyncServiceTokensResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncServiceTokensResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/access/tags.py b/src/cloudflare/resources/zero_trust/access/tags.py index 7f039682cc8..0dcb51a176e 100644 --- a/src/cloudflare/resources/zero_trust/access/tags.py +++ b/src/cloudflare/resources/zero_trust/access/tags.py @@ -33,7 +33,7 @@ class TagsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TagsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -269,7 +269,7 @@ class AsyncTagsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTagsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/access/users/active_sessions.py b/src/cloudflare/resources/zero_trust/access/users/active_sessions.py index 068d2b63edf..115f223416b 100644 --- a/src/cloudflare/resources/zero_trust/access/users/active_sessions.py +++ b/src/cloudflare/resources/zero_trust/access/users/active_sessions.py @@ -28,7 +28,7 @@ class ActiveSessionsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ActiveSessionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -137,7 +137,7 @@ class AsyncActiveSessionsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncActiveSessionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/access/users/failed_logins.py b/src/cloudflare/resources/zero_trust/access/users/failed_logins.py index 780e6cd8860..07af664ab1c 100644 --- a/src/cloudflare/resources/zero_trust/access/users/failed_logins.py +++ b/src/cloudflare/resources/zero_trust/access/users/failed_logins.py @@ -24,7 +24,7 @@ class FailedLoginsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> FailedLoginsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -86,7 +86,7 @@ class AsyncFailedLoginsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncFailedLoginsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/access/users/last_seen_identity.py b/src/cloudflare/resources/zero_trust/access/users/last_seen_identity.py index f8873360f77..27bc8e5051f 100644 --- a/src/cloudflare/resources/zero_trust/access/users/last_seen_identity.py +++ b/src/cloudflare/resources/zero_trust/access/users/last_seen_identity.py @@ -26,7 +26,7 @@ class LastSeenIdentityResource(SyncAPIResource): @cached_property def with_raw_response(self) -> LastSeenIdentityResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -91,7 +91,7 @@ class AsyncLastSeenIdentityResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncLastSeenIdentityResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/access/users/users.py b/src/cloudflare/resources/zero_trust/access/users/users.py index 7609bbd3cf5..4d16686dbdb 100644 --- a/src/cloudflare/resources/zero_trust/access/users/users.py +++ b/src/cloudflare/resources/zero_trust/access/users/users.py @@ -62,7 +62,7 @@ def failed_logins(self) -> FailedLoginsResource: @cached_property def with_raw_response(self) -> UsersResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -151,7 +151,7 @@ def failed_logins(self) -> AsyncFailedLoginsResource: @cached_property def with_raw_response(self) -> AsyncUsersResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/connectivity_settings.py b/src/cloudflare/resources/zero_trust/connectivity_settings.py index 8cb4f1c500d..fb97f2ae3c3 100644 --- a/src/cloudflare/resources/zero_trust/connectivity_settings.py +++ b/src/cloudflare/resources/zero_trust/connectivity_settings.py @@ -32,7 +32,7 @@ class ConnectivitySettingsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ConnectivitySettingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -144,7 +144,7 @@ class AsyncConnectivitySettingsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncConnectivitySettingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/devices/devices.py b/src/cloudflare/resources/zero_trust/devices/devices.py index cdb59f224e5..e22fa20a0c1 100644 --- a/src/cloudflare/resources/zero_trust/devices/devices.py +++ b/src/cloudflare/resources/zero_trust/devices/devices.py @@ -136,7 +136,7 @@ def override_codes(self) -> OverrideCodesResource: @cached_property def with_raw_response(self) -> DevicesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -269,7 +269,7 @@ def override_codes(self) -> AsyncOverrideCodesResource: @cached_property def with_raw_response(self) -> AsyncDevicesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/devices/dex_tests.py b/src/cloudflare/resources/zero_trust/devices/dex_tests.py index c7ce0487155..4bd4106a167 100644 --- a/src/cloudflare/resources/zero_trust/devices/dex_tests.py +++ b/src/cloudflare/resources/zero_trust/devices/dex_tests.py @@ -34,7 +34,7 @@ class DEXTestsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> DEXTestsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -318,7 +318,7 @@ class AsyncDEXTestsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncDEXTestsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/devices/fleet_status.py b/src/cloudflare/resources/zero_trust/devices/fleet_status.py index 57b2c298c03..9efbc28a4e7 100644 --- a/src/cloudflare/resources/zero_trust/devices/fleet_status.py +++ b/src/cloudflare/resources/zero_trust/devices/fleet_status.py @@ -28,7 +28,7 @@ class FleetStatusResource(SyncAPIResource): @cached_property def with_raw_response(self) -> FleetStatusResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -108,7 +108,7 @@ class AsyncFleetStatusResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncFleetStatusResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/devices/networks.py b/src/cloudflare/resources/zero_trust/devices/networks.py index b3058631bac..fed874d2057 100644 --- a/src/cloudflare/resources/zero_trust/devices/networks.py +++ b/src/cloudflare/resources/zero_trust/devices/networks.py @@ -34,7 +34,7 @@ class NetworksResource(SyncAPIResource): @cached_property def with_raw_response(self) -> NetworksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -283,7 +283,7 @@ class AsyncNetworksResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncNetworksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/devices/override_codes.py b/src/cloudflare/resources/zero_trust/devices/override_codes.py index a5a9478c3bd..c1e3ba083f9 100644 --- a/src/cloudflare/resources/zero_trust/devices/override_codes.py +++ b/src/cloudflare/resources/zero_trust/devices/override_codes.py @@ -26,7 +26,7 @@ class OverrideCodesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> OverrideCodesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -91,7 +91,7 @@ class AsyncOverrideCodesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncOverrideCodesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/devices/policies/custom/custom.py b/src/cloudflare/resources/zero_trust/devices/policies/custom/custom.py index 07fb5b5294c..08f3e9fe57a 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/custom/custom.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/custom/custom.py @@ -69,7 +69,7 @@ def fallback_domains(self) -> FallbackDomainsResource: @cached_property def with_raw_response(self) -> CustomResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -455,7 +455,7 @@ def fallback_domains(self) -> AsyncFallbackDomainsResource: @cached_property def with_raw_response(self) -> AsyncCustomResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/devices/policies/custom/excludes.py b/src/cloudflare/resources/zero_trust/devices/policies/custom/excludes.py index 5d8b3663ae4..a695ca20aad 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/custom/excludes.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/custom/excludes.py @@ -32,7 +32,7 @@ class ExcludesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ExcludesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -141,7 +141,7 @@ class AsyncExcludesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncExcludesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/devices/policies/custom/fallback_domains.py b/src/cloudflare/resources/zero_trust/devices/policies/custom/fallback_domains.py index 612fbb20dae..4fec2de36f5 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/custom/fallback_domains.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/custom/fallback_domains.py @@ -32,7 +32,7 @@ class FallbackDomainsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> FallbackDomainsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -144,7 +144,7 @@ class AsyncFallbackDomainsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncFallbackDomainsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/devices/policies/custom/includes.py b/src/cloudflare/resources/zero_trust/devices/policies/custom/includes.py index 3254afbe0cc..163274979ca 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/custom/includes.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/custom/includes.py @@ -32,7 +32,7 @@ class IncludesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> IncludesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -141,7 +141,7 @@ class AsyncIncludesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncIncludesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/devices/policies/default/certificates.py b/src/cloudflare/resources/zero_trust/devices/policies/default/certificates.py index d14e2eaa953..27271fc8446 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/default/certificates.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/default/certificates.py @@ -32,7 +32,7 @@ class CertificatesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> CertificatesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -144,7 +144,7 @@ class AsyncCertificatesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncCertificatesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/devices/policies/default/default.py b/src/cloudflare/resources/zero_trust/devices/policies/default/default.py index 1e25bc54c0f..a2935974660 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/default/default.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/default/default.py @@ -80,7 +80,7 @@ def certificates(self) -> CertificatesResource: @cached_property def with_raw_response(self) -> DefaultResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -241,7 +241,7 @@ def certificates(self) -> AsyncCertificatesResource: @cached_property def with_raw_response(self) -> AsyncDefaultResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/devices/policies/default/excludes.py b/src/cloudflare/resources/zero_trust/devices/policies/default/excludes.py index 802eaf9a62a..39a1525a49f 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/default/excludes.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/default/excludes.py @@ -32,7 +32,7 @@ class ExcludesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ExcludesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -129,7 +129,7 @@ class AsyncExcludesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncExcludesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/devices/policies/default/fallback_domains.py b/src/cloudflare/resources/zero_trust/devices/policies/default/fallback_domains.py index 8ad04e35ea1..3014b6f8300 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/default/fallback_domains.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/default/fallback_domains.py @@ -32,7 +32,7 @@ class FallbackDomainsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> FallbackDomainsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -133,7 +133,7 @@ class AsyncFallbackDomainsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncFallbackDomainsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/devices/policies/default/includes.py b/src/cloudflare/resources/zero_trust/devices/policies/default/includes.py index d8383257476..ddefff70346 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/default/includes.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/default/includes.py @@ -32,7 +32,7 @@ class IncludesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> IncludesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -129,7 +129,7 @@ class AsyncIncludesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncIncludesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/devices/policies/policies.py b/src/cloudflare/resources/zero_trust/devices/policies/policies.py index 263539f7358..6486a3daacb 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/policies.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/policies.py @@ -36,7 +36,7 @@ def custom(self) -> CustomResource: @cached_property def with_raw_response(self) -> PoliciesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -65,7 +65,7 @@ def custom(self) -> AsyncCustomResource: @cached_property def with_raw_response(self) -> AsyncPoliciesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/devices/posture/integrations.py b/src/cloudflare/resources/zero_trust/devices/posture/integrations.py index c02ac6559f6..6c0287c1a7c 100644 --- a/src/cloudflare/resources/zero_trust/devices/posture/integrations.py +++ b/src/cloudflare/resources/zero_trust/devices/posture/integrations.py @@ -34,7 +34,7 @@ class IntegrationsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> IntegrationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -306,7 +306,7 @@ class AsyncIntegrationsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncIntegrationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/devices/posture/posture.py b/src/cloudflare/resources/zero_trust/devices/posture/posture.py index ada32cf3d5d..9c84bc85ddd 100644 --- a/src/cloudflare/resources/zero_trust/devices/posture/posture.py +++ b/src/cloudflare/resources/zero_trust/devices/posture/posture.py @@ -48,7 +48,7 @@ def integrations(self) -> IntegrationsResource: @cached_property def with_raw_response(self) -> PostureResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -384,7 +384,7 @@ def integrations(self) -> AsyncIntegrationsResource: @cached_property def with_raw_response(self) -> AsyncPostureResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/devices/revoke.py b/src/cloudflare/resources/zero_trust/devices/revoke.py index 3057bf6c62d..238272972e9 100644 --- a/src/cloudflare/resources/zero_trust/devices/revoke.py +++ b/src/cloudflare/resources/zero_trust/devices/revoke.py @@ -30,7 +30,7 @@ class RevokeResource(SyncAPIResource): @cached_property def with_raw_response(self) -> RevokeResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -97,7 +97,7 @@ class AsyncRevokeResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncRevokeResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/devices/settings.py b/src/cloudflare/resources/zero_trust/devices/settings.py index e9ab1781fee..af5453ca842 100644 --- a/src/cloudflare/resources/zero_trust/devices/settings.py +++ b/src/cloudflare/resources/zero_trust/devices/settings.py @@ -31,7 +31,7 @@ class SettingsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SettingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -215,7 +215,7 @@ class AsyncSettingsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSettingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/devices/unrevoke.py b/src/cloudflare/resources/zero_trust/devices/unrevoke.py index b99f36a0037..4cd1af5f880 100644 --- a/src/cloudflare/resources/zero_trust/devices/unrevoke.py +++ b/src/cloudflare/resources/zero_trust/devices/unrevoke.py @@ -30,7 +30,7 @@ class UnrevokeResource(SyncAPIResource): @cached_property def with_raw_response(self) -> UnrevokeResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -97,7 +97,7 @@ class AsyncUnrevokeResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncUnrevokeResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/dex/colos.py b/src/cloudflare/resources/zero_trust/dex/colos.py index 13fab4eb6ad..deb75fd721a 100644 --- a/src/cloudflare/resources/zero_trust/dex/colos.py +++ b/src/cloudflare/resources/zero_trust/dex/colos.py @@ -27,7 +27,7 @@ class ColosResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ColosResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -105,7 +105,7 @@ class AsyncColosResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncColosResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/dex/commands/commands.py b/src/cloudflare/resources/zero_trust/dex/commands/commands.py index 675e75e0b31..5851caf6fca 100644 --- a/src/cloudflare/resources/zero_trust/dex/commands/commands.py +++ b/src/cloudflare/resources/zero_trust/dex/commands/commands.py @@ -71,7 +71,7 @@ def quota(self) -> QuotaResource: @cached_property def with_raw_response(self) -> CommandsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -220,7 +220,7 @@ def quota(self) -> AsyncQuotaResource: @cached_property def with_raw_response(self) -> AsyncCommandsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/dex/commands/devices.py b/src/cloudflare/resources/zero_trust/dex/commands/devices.py index 4f3b3697c94..978a00cfa12 100644 --- a/src/cloudflare/resources/zero_trust/dex/commands/devices.py +++ b/src/cloudflare/resources/zero_trust/dex/commands/devices.py @@ -28,7 +28,7 @@ class DevicesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> DevicesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -104,7 +104,7 @@ class AsyncDevicesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncDevicesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/dex/commands/downloads.py b/src/cloudflare/resources/zero_trust/dex/commands/downloads.py index 57b8e0320aa..5bc3cfafdbd 100644 --- a/src/cloudflare/resources/zero_trust/dex/commands/downloads.py +++ b/src/cloudflare/resources/zero_trust/dex/commands/downloads.py @@ -26,7 +26,7 @@ class DownloadsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> DownloadsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -90,7 +90,7 @@ class AsyncDownloadsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncDownloadsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/dex/commands/quota.py b/src/cloudflare/resources/zero_trust/dex/commands/quota.py index 8a0ba05b4b3..58afb723bf7 100644 --- a/src/cloudflare/resources/zero_trust/dex/commands/quota.py +++ b/src/cloudflare/resources/zero_trust/dex/commands/quota.py @@ -26,7 +26,7 @@ class QuotaResource(SyncAPIResource): @cached_property def with_raw_response(self) -> QuotaResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -85,7 +85,7 @@ class AsyncQuotaResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncQuotaResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/dex/dex.py b/src/cloudflare/resources/zero_trust/dex/dex.py index db00125451e..85b344d3fbb 100644 --- a/src/cloudflare/resources/zero_trust/dex/dex.py +++ b/src/cloudflare/resources/zero_trust/dex/dex.py @@ -96,7 +96,7 @@ def traceroute_tests(self) -> TracerouteTestsResource: @cached_property def with_raw_response(self) -> DEXResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -145,7 +145,7 @@ def traceroute_tests(self) -> AsyncTracerouteTestsResource: @cached_property def with_raw_response(self) -> AsyncDEXResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/dex/fleet_status/devices.py b/src/cloudflare/resources/zero_trust/dex/fleet_status/devices.py index a308e327b37..b46a240b4e5 100644 --- a/src/cloudflare/resources/zero_trust/dex/fleet_status/devices.py +++ b/src/cloudflare/resources/zero_trust/dex/fleet_status/devices.py @@ -28,7 +28,7 @@ class DevicesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> DevicesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -145,7 +145,7 @@ class AsyncDevicesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncDevicesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/dex/fleet_status/fleet_status.py b/src/cloudflare/resources/zero_trust/dex/fleet_status/fleet_status.py index 5ccfdc617ab..41c842dc9f5 100644 --- a/src/cloudflare/resources/zero_trust/dex/fleet_status/fleet_status.py +++ b/src/cloudflare/resources/zero_trust/dex/fleet_status/fleet_status.py @@ -43,7 +43,7 @@ def devices(self) -> DevicesResource: @cached_property def with_raw_response(self) -> FleetStatusResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -167,7 +167,7 @@ def devices(self) -> AsyncDevicesResource: @cached_property def with_raw_response(self) -> AsyncFleetStatusResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/dex/http_tests/http_tests.py b/src/cloudflare/resources/zero_trust/dex/http_tests/http_tests.py index 75a05f1a04b..0775aca75ce 100644 --- a/src/cloudflare/resources/zero_trust/dex/http_tests/http_tests.py +++ b/src/cloudflare/resources/zero_trust/dex/http_tests/http_tests.py @@ -44,7 +44,7 @@ def percentiles(self) -> PercentilesResource: @cached_property def with_raw_response(self) -> HTTPTestsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -139,7 +139,7 @@ def percentiles(self) -> AsyncPercentilesResource: @cached_property def with_raw_response(self) -> AsyncHTTPTestsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/dex/http_tests/percentiles.py b/src/cloudflare/resources/zero_trust/dex/http_tests/percentiles.py index 61550f43e11..ade7e34de83 100644 --- a/src/cloudflare/resources/zero_trust/dex/http_tests/percentiles.py +++ b/src/cloudflare/resources/zero_trust/dex/http_tests/percentiles.py @@ -31,7 +31,7 @@ class PercentilesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> PercentilesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -118,7 +118,7 @@ class AsyncPercentilesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncPercentilesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/dex/tests/tests.py b/src/cloudflare/resources/zero_trust/dex/tests/tests.py index ee9a837f3e9..09a1dae7547 100644 --- a/src/cloudflare/resources/zero_trust/dex/tests/tests.py +++ b/src/cloudflare/resources/zero_trust/dex/tests/tests.py @@ -42,7 +42,7 @@ def unique_devices(self) -> UniqueDevicesResource: @cached_property def with_raw_response(self) -> TestsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -131,7 +131,7 @@ def unique_devices(self) -> AsyncUniqueDevicesResource: @cached_property def with_raw_response(self) -> AsyncTestsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/dex/tests/unique_devices.py b/src/cloudflare/resources/zero_trust/dex/tests/unique_devices.py index d0e98d42564..d538bc6547c 100644 --- a/src/cloudflare/resources/zero_trust/dex/tests/unique_devices.py +++ b/src/cloudflare/resources/zero_trust/dex/tests/unique_devices.py @@ -31,7 +31,7 @@ class UniqueDevicesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> UniqueDevicesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -104,7 +104,7 @@ class AsyncUniqueDevicesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncUniqueDevicesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/dex/traceroute_test_results/network_path.py b/src/cloudflare/resources/zero_trust/dex/traceroute_test_results/network_path.py index 5d3cf2cbc19..12b3b952b2e 100644 --- a/src/cloudflare/resources/zero_trust/dex/traceroute_test_results/network_path.py +++ b/src/cloudflare/resources/zero_trust/dex/traceroute_test_results/network_path.py @@ -26,7 +26,7 @@ class NetworkPathResource(SyncAPIResource): @cached_property def with_raw_response(self) -> NetworkPathResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -90,7 +90,7 @@ class AsyncNetworkPathResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncNetworkPathResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/dex/traceroute_test_results/traceroute_test_results.py b/src/cloudflare/resources/zero_trust/dex/traceroute_test_results/traceroute_test_results.py index 93ea52d41c1..16bfe1811af 100644 --- a/src/cloudflare/resources/zero_trust/dex/traceroute_test_results/traceroute_test_results.py +++ b/src/cloudflare/resources/zero_trust/dex/traceroute_test_results/traceroute_test_results.py @@ -24,7 +24,7 @@ def network_path(self) -> NetworkPathResource: @cached_property def with_raw_response(self) -> TracerouteTestResultsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -49,7 +49,7 @@ def network_path(self) -> AsyncNetworkPathResource: @cached_property def with_raw_response(self) -> AsyncTracerouteTestResultsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/dex/traceroute_tests.py b/src/cloudflare/resources/zero_trust/dex/traceroute_tests.py index 874c7c069e5..9531607ae30 100644 --- a/src/cloudflare/resources/zero_trust/dex/traceroute_tests.py +++ b/src/cloudflare/resources/zero_trust/dex/traceroute_tests.py @@ -38,7 +38,7 @@ class TracerouteTestsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TracerouteTestsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -260,7 +260,7 @@ class AsyncTracerouteTestsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTracerouteTestsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/dlp/datasets/datasets.py b/src/cloudflare/resources/zero_trust/dlp/datasets/datasets.py index 0c2b730114f..fc7cffe2fb1 100644 --- a/src/cloudflare/resources/zero_trust/dlp/datasets/datasets.py +++ b/src/cloudflare/resources/zero_trust/dlp/datasets/datasets.py @@ -57,7 +57,7 @@ def versions(self) -> VersionsResource: @cached_property def with_raw_response(self) -> DatasetsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -314,7 +314,7 @@ def versions(self) -> AsyncVersionsResource: @cached_property def with_raw_response(self) -> AsyncDatasetsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/dlp/datasets/upload.py b/src/cloudflare/resources/zero_trust/dlp/datasets/upload.py index 53041aa50b1..c50b99af49f 100644 --- a/src/cloudflare/resources/zero_trust/dlp/datasets/upload.py +++ b/src/cloudflare/resources/zero_trust/dlp/datasets/upload.py @@ -32,7 +32,7 @@ class UploadResource(SyncAPIResource): @cached_property def with_raw_response(self) -> UploadResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -140,7 +140,7 @@ class AsyncUploadResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncUploadResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/dlp/datasets/versions/entries.py b/src/cloudflare/resources/zero_trust/dlp/datasets/versions/entries.py index 1069e324b26..4a39f71b32f 100755 --- a/src/cloudflare/resources/zero_trust/dlp/datasets/versions/entries.py +++ b/src/cloudflare/resources/zero_trust/dlp/datasets/versions/entries.py @@ -31,7 +31,7 @@ class EntriesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> EntriesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -100,7 +100,7 @@ class AsyncEntriesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncEntriesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/dlp/datasets/versions/versions.py b/src/cloudflare/resources/zero_trust/dlp/datasets/versions/versions.py index e7057a28874..158c7513cea 100755 --- a/src/cloudflare/resources/zero_trust/dlp/datasets/versions/versions.py +++ b/src/cloudflare/resources/zero_trust/dlp/datasets/versions/versions.py @@ -43,7 +43,7 @@ def entries(self) -> EntriesResource: @cached_property def with_raw_response(self) -> VersionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -114,7 +114,7 @@ def entries(self) -> AsyncEntriesResource: @cached_property def with_raw_response(self) -> AsyncVersionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/dlp/dlp.py b/src/cloudflare/resources/zero_trust/dlp/dlp.py index 2a5da23c2db..3769892598e 100644 --- a/src/cloudflare/resources/zero_trust/dlp/dlp.py +++ b/src/cloudflare/resources/zero_trust/dlp/dlp.py @@ -96,7 +96,7 @@ def entries(self) -> EntriesResource: @cached_property def with_raw_response(self) -> DLPResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -145,7 +145,7 @@ def entries(self) -> AsyncEntriesResource: @cached_property def with_raw_response(self) -> AsyncDLPResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/dlp/email/account_mapping.py b/src/cloudflare/resources/zero_trust/dlp/email/account_mapping.py index d9c04a979d4..1accfc67858 100644 --- a/src/cloudflare/resources/zero_trust/dlp/email/account_mapping.py +++ b/src/cloudflare/resources/zero_trust/dlp/email/account_mapping.py @@ -32,7 +32,7 @@ class AccountMappingResource(SyncAPIResource): @cached_property def with_raw_response(self) -> AccountMappingResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -131,7 +131,7 @@ class AsyncAccountMappingResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncAccountMappingResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/dlp/email/email.py b/src/cloudflare/resources/zero_trust/dlp/email/email.py index 5a860e81a40..08f2c29caa8 100644 --- a/src/cloudflare/resources/zero_trust/dlp/email/email.py +++ b/src/cloudflare/resources/zero_trust/dlp/email/email.py @@ -36,7 +36,7 @@ def rules(self) -> RulesResource: @cached_property def with_raw_response(self) -> EmailResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -65,7 +65,7 @@ def rules(self) -> AsyncRulesResource: @cached_property def with_raw_response(self) -> AsyncEmailResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/dlp/email/rules.py b/src/cloudflare/resources/zero_trust/dlp/email/rules.py index 63906966157..48ad006c13b 100644 --- a/src/cloudflare/resources/zero_trust/dlp/email/rules.py +++ b/src/cloudflare/resources/zero_trust/dlp/email/rules.py @@ -37,7 +37,7 @@ class RulesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> RulesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -322,7 +322,7 @@ class AsyncRulesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncRulesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/dlp/entries.py b/src/cloudflare/resources/zero_trust/dlp/entries.py index 7a4c98b8a22..e75a267b007 100644 --- a/src/cloudflare/resources/zero_trust/dlp/entries.py +++ b/src/cloudflare/resources/zero_trust/dlp/entries.py @@ -38,7 +38,7 @@ class EntriesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> EntriesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -364,7 +364,7 @@ class AsyncEntriesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncEntriesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/dlp/limits.py b/src/cloudflare/resources/zero_trust/dlp/limits.py index 498e70a3b29..ad07e0c670e 100755 --- a/src/cloudflare/resources/zero_trust/dlp/limits.py +++ b/src/cloudflare/resources/zero_trust/dlp/limits.py @@ -26,7 +26,7 @@ class LimitsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> LimitsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -84,7 +84,7 @@ class AsyncLimitsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncLimitsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/dlp/patterns.py b/src/cloudflare/resources/zero_trust/dlp/patterns.py index ce00309a7a6..b7dda0f0fef 100644 --- a/src/cloudflare/resources/zero_trust/dlp/patterns.py +++ b/src/cloudflare/resources/zero_trust/dlp/patterns.py @@ -31,7 +31,7 @@ class PatternsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> PatternsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -112,7 +112,7 @@ class AsyncPatternsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncPatternsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/dlp/payload_logs.py b/src/cloudflare/resources/zero_trust/dlp/payload_logs.py index dcd0577850e..816c1eb9115 100644 --- a/src/cloudflare/resources/zero_trust/dlp/payload_logs.py +++ b/src/cloudflare/resources/zero_trust/dlp/payload_logs.py @@ -32,7 +32,7 @@ class PayloadLogsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> PayloadLogsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -129,7 +129,7 @@ class AsyncPayloadLogsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncPayloadLogsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/dlp/profiles/custom.py b/src/cloudflare/resources/zero_trust/dlp/profiles/custom.py index 22405544849..bfb1ddd4b52 100644 --- a/src/cloudflare/resources/zero_trust/dlp/profiles/custom.py +++ b/src/cloudflare/resources/zero_trust/dlp/profiles/custom.py @@ -35,7 +35,7 @@ class CustomResource(SyncAPIResource): @cached_property def with_raw_response(self) -> CustomResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -342,7 +342,7 @@ class AsyncCustomResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncCustomResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py b/src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py index e0ff3bd8cdb..0ed1ed1b4da 100644 --- a/src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py +++ b/src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py @@ -32,7 +32,7 @@ class PredefinedResource(SyncAPIResource): @cached_property def with_raw_response(self) -> PredefinedResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -162,7 +162,7 @@ class AsyncPredefinedResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncPredefinedResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/dlp/profiles/profiles.py b/src/cloudflare/resources/zero_trust/dlp/profiles/profiles.py index c70baf8e9c2..72b6673a82f 100644 --- a/src/cloudflare/resources/zero_trust/dlp/profiles/profiles.py +++ b/src/cloudflare/resources/zero_trust/dlp/profiles/profiles.py @@ -53,7 +53,7 @@ def predefined(self) -> PredefinedResource: @cached_property def with_raw_response(self) -> ProfilesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -169,7 +169,7 @@ def predefined(self) -> AsyncPredefinedResource: @cached_property def with_raw_response(self) -> AsyncProfilesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/gateway/app_types.py b/src/cloudflare/resources/zero_trust/gateway/app_types.py index 9a4e4b51348..e3060f777db 100644 --- a/src/cloudflare/resources/zero_trust/gateway/app_types.py +++ b/src/cloudflare/resources/zero_trust/gateway/app_types.py @@ -26,7 +26,7 @@ class AppTypesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> AppTypesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -83,7 +83,7 @@ class AsyncAppTypesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncAppTypesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/gateway/audit_ssh_settings.py b/src/cloudflare/resources/zero_trust/gateway/audit_ssh_settings.py index 44a3bb6a3d0..280e06e0c50 100644 --- a/src/cloudflare/resources/zero_trust/gateway/audit_ssh_settings.py +++ b/src/cloudflare/resources/zero_trust/gateway/audit_ssh_settings.py @@ -31,7 +31,7 @@ class AuditSSHSettingsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> AuditSSHSettingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -173,7 +173,7 @@ class AsyncAuditSSHSettingsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncAuditSSHSettingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/gateway/categories.py b/src/cloudflare/resources/zero_trust/gateway/categories.py index dd3d5bcace0..ae356193e4b 100644 --- a/src/cloudflare/resources/zero_trust/gateway/categories.py +++ b/src/cloudflare/resources/zero_trust/gateway/categories.py @@ -24,7 +24,7 @@ class CategoriesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> CategoriesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -81,7 +81,7 @@ class AsyncCategoriesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncCategoriesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/gateway/certificates.py b/src/cloudflare/resources/zero_trust/gateway/certificates.py index 8ad1e321c35..17766dcbaca 100644 --- a/src/cloudflare/resources/zero_trust/gateway/certificates.py +++ b/src/cloudflare/resources/zero_trust/gateway/certificates.py @@ -41,7 +41,7 @@ class CertificatesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> CertificatesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -314,7 +314,7 @@ class AsyncCertificatesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncCertificatesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/gateway/configurations/configurations.py b/src/cloudflare/resources/zero_trust/gateway/configurations/configurations.py index 269e71f769f..b0a63b7be19 100755 --- a/src/cloudflare/resources/zero_trust/gateway/configurations/configurations.py +++ b/src/cloudflare/resources/zero_trust/gateway/configurations/configurations.py @@ -49,7 +49,7 @@ def custom_certificate(self) -> CustomCertificateResource: @cached_property def with_raw_response(self) -> ConfigurationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -198,7 +198,7 @@ def custom_certificate(self) -> AsyncCustomCertificateResource: @cached_property def with_raw_response(self) -> AsyncConfigurationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/gateway/configurations/custom_certificate.py b/src/cloudflare/resources/zero_trust/gateway/configurations/custom_certificate.py index 04acf624768..53ba1e6b2c3 100755 --- a/src/cloudflare/resources/zero_trust/gateway/configurations/custom_certificate.py +++ b/src/cloudflare/resources/zero_trust/gateway/configurations/custom_certificate.py @@ -23,7 +23,7 @@ class CustomCertificateResource(SyncAPIResource): @cached_property def with_raw_response(self) -> CustomCertificateResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -77,7 +77,7 @@ class AsyncCustomCertificateResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncCustomCertificateResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/gateway/gateway.py b/src/cloudflare/resources/zero_trust/gateway/gateway.py index d4477354e20..f7be9368f36 100644 --- a/src/cloudflare/resources/zero_trust/gateway/gateway.py +++ b/src/cloudflare/resources/zero_trust/gateway/gateway.py @@ -147,7 +147,7 @@ def certificates(self) -> CertificatesResource: @cached_property def with_raw_response(self) -> GatewayResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -282,7 +282,7 @@ def certificates(self) -> AsyncCertificatesResource: @cached_property def with_raw_response(self) -> AsyncGatewayResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/gateway/lists/items.py b/src/cloudflare/resources/zero_trust/gateway/lists/items.py index 15eb4178b04..370ed31f789 100644 --- a/src/cloudflare/resources/zero_trust/gateway/lists/items.py +++ b/src/cloudflare/resources/zero_trust/gateway/lists/items.py @@ -24,7 +24,7 @@ class ItemsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ItemsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -84,7 +84,7 @@ class AsyncItemsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncItemsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/gateway/lists/lists.py b/src/cloudflare/resources/zero_trust/gateway/lists/lists.py index 324a7de6194..07b93ba9e1c 100644 --- a/src/cloudflare/resources/zero_trust/gateway/lists/lists.py +++ b/src/cloudflare/resources/zero_trust/gateway/lists/lists.py @@ -47,7 +47,7 @@ def items(self) -> ItemsResource: @cached_property def with_raw_response(self) -> ListsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -371,7 +371,7 @@ def items(self) -> AsyncItemsResource: @cached_property def with_raw_response(self) -> AsyncListsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/gateway/locations.py b/src/cloudflare/resources/zero_trust/gateway/locations.py index c8724f0a819..0d07ab231a0 100644 --- a/src/cloudflare/resources/zero_trust/gateway/locations.py +++ b/src/cloudflare/resources/zero_trust/gateway/locations.py @@ -33,7 +33,7 @@ class LocationsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> LocationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -319,7 +319,7 @@ class AsyncLocationsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncLocationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/gateway/logging.py b/src/cloudflare/resources/zero_trust/gateway/logging.py index df0c01c60b6..8f50a51ec9b 100644 --- a/src/cloudflare/resources/zero_trust/gateway/logging.py +++ b/src/cloudflare/resources/zero_trust/gateway/logging.py @@ -31,7 +31,7 @@ class LoggingResource(SyncAPIResource): @cached_property def with_raw_response(self) -> LoggingResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -140,7 +140,7 @@ class AsyncLoggingResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncLoggingResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/gateway/proxy_endpoints.py b/src/cloudflare/resources/zero_trust/gateway/proxy_endpoints.py index 931ffbc2a9c..9b0726dab09 100644 --- a/src/cloudflare/resources/zero_trust/gateway/proxy_endpoints.py +++ b/src/cloudflare/resources/zero_trust/gateway/proxy_endpoints.py @@ -33,7 +33,7 @@ class ProxyEndpointsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ProxyEndpointsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -274,7 +274,7 @@ class AsyncProxyEndpointsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncProxyEndpointsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/gateway/rules.py b/src/cloudflare/resources/zero_trust/gateway/rules.py index 49c84543bea..337b4beb990 100644 --- a/src/cloudflare/resources/zero_trust/gateway/rules.py +++ b/src/cloudflare/resources/zero_trust/gateway/rules.py @@ -36,7 +36,7 @@ class RulesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> RulesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -454,7 +454,7 @@ class AsyncRulesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncRulesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/identity_providers.py b/src/cloudflare/resources/zero_trust/identity_providers.py index 6a7f284385a..a0cbd6d01e3 100644 --- a/src/cloudflare/resources/zero_trust/identity_providers.py +++ b/src/cloudflare/resources/zero_trust/identity_providers.py @@ -44,7 +44,7 @@ class IdentityProvidersResource(SyncAPIResource): @cached_property def with_raw_response(self) -> IdentityProvidersResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -1770,7 +1770,7 @@ class AsyncIdentityProvidersResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncIdentityProvidersResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/networks/networks.py b/src/cloudflare/resources/zero_trust/networks/networks.py index 5e7dce7e20b..602ba12061d 100644 --- a/src/cloudflare/resources/zero_trust/networks/networks.py +++ b/src/cloudflare/resources/zero_trust/networks/networks.py @@ -36,7 +36,7 @@ def virtual_networks(self) -> VirtualNetworksResource: @cached_property def with_raw_response(self) -> NetworksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -65,7 +65,7 @@ def virtual_networks(self) -> AsyncVirtualNetworksResource: @cached_property def with_raw_response(self) -> AsyncNetworksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/networks/routes/ips.py b/src/cloudflare/resources/zero_trust/networks/routes/ips.py index 871662d9857..c9962fefd10 100644 --- a/src/cloudflare/resources/zero_trust/networks/routes/ips.py +++ b/src/cloudflare/resources/zero_trust/networks/routes/ips.py @@ -31,7 +31,7 @@ class IPsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> IPsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -98,7 +98,7 @@ class AsyncIPsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncIPsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/networks/routes/networks.py b/src/cloudflare/resources/zero_trust/networks/routes/networks.py index 6732790b936..26bd6ae9c4e 100644 --- a/src/cloudflare/resources/zero_trust/networks/routes/networks.py +++ b/src/cloudflare/resources/zero_trust/networks/routes/networks.py @@ -32,7 +32,7 @@ class NetworksResource(SyncAPIResource): @cached_property def with_raw_response(self) -> NetworksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -230,7 +230,7 @@ class AsyncNetworksResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncNetworksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/networks/routes/routes.py b/src/cloudflare/resources/zero_trust/networks/routes/routes.py index 34c24bcd26d..8f395402e15 100644 --- a/src/cloudflare/resources/zero_trust/networks/routes/routes.py +++ b/src/cloudflare/resources/zero_trust/networks/routes/routes.py @@ -58,7 +58,7 @@ def networks(self) -> NetworksResource: @cached_property def with_raw_response(self) -> RoutesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -392,7 +392,7 @@ def networks(self) -> AsyncNetworksResource: @cached_property def with_raw_response(self) -> AsyncRoutesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/networks/virtual_networks.py b/src/cloudflare/resources/zero_trust/networks/virtual_networks.py index 98d6a280a30..91696d534d6 100644 --- a/src/cloudflare/resources/zero_trust/networks/virtual_networks.py +++ b/src/cloudflare/resources/zero_trust/networks/virtual_networks.py @@ -36,7 +36,7 @@ class VirtualNetworksResource(SyncAPIResource): @cached_property def with_raw_response(self) -> VirtualNetworksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -324,7 +324,7 @@ class AsyncVirtualNetworksResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncVirtualNetworksResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/organizations/doh.py b/src/cloudflare/resources/zero_trust/organizations/doh.py index 70518bc0925..cc07c5d59f2 100644 --- a/src/cloudflare/resources/zero_trust/organizations/doh.py +++ b/src/cloudflare/resources/zero_trust/organizations/doh.py @@ -32,7 +32,7 @@ class DOHResource(SyncAPIResource): @cached_property def with_raw_response(self) -> DOHResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -147,7 +147,7 @@ class AsyncDOHResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncDOHResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/organizations/organizations.py b/src/cloudflare/resources/zero_trust/organizations/organizations.py index 11d6d12ee6b..26f8d460463 100644 --- a/src/cloudflare/resources/zero_trust/organizations/organizations.py +++ b/src/cloudflare/resources/zero_trust/organizations/organizations.py @@ -49,7 +49,7 @@ def doh(self) -> DOHResource: @cached_property def with_raw_response(self) -> OrganizationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -421,7 +421,7 @@ def doh(self) -> AsyncDOHResource: @cached_property def with_raw_response(self) -> AsyncOrganizationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/risk_scoring/behaviours.py b/src/cloudflare/resources/zero_trust/risk_scoring/behaviours.py index 4ba0e3d899a..284903ffdf1 100644 --- a/src/cloudflare/resources/zero_trust/risk_scoring/behaviours.py +++ b/src/cloudflare/resources/zero_trust/risk_scoring/behaviours.py @@ -32,7 +32,7 @@ class BehavioursResource(SyncAPIResource): @cached_property def with_raw_response(self) -> BehavioursResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -129,7 +129,7 @@ class AsyncBehavioursResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncBehavioursResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/risk_scoring/integrations/integrations.py b/src/cloudflare/resources/zero_trust/risk_scoring/integrations/integrations.py index a10bbc73322..f0b62444af4 100644 --- a/src/cloudflare/resources/zero_trust/risk_scoring/integrations/integrations.py +++ b/src/cloudflare/resources/zero_trust/risk_scoring/integrations/integrations.py @@ -48,7 +48,7 @@ def references(self) -> ReferencesResource: @cached_property def with_raw_response(self) -> IntegrationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -301,7 +301,7 @@ def references(self) -> AsyncReferencesResource: @cached_property def with_raw_response(self) -> AsyncIntegrationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/risk_scoring/integrations/references.py b/src/cloudflare/resources/zero_trust/risk_scoring/integrations/references.py index 7e525b0a1ef..faf1e16c8f3 100644 --- a/src/cloudflare/resources/zero_trust/risk_scoring/integrations/references.py +++ b/src/cloudflare/resources/zero_trust/risk_scoring/integrations/references.py @@ -26,7 +26,7 @@ class ReferencesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ReferencesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -87,7 +87,7 @@ class AsyncReferencesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncReferencesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/risk_scoring/risk_scoring.py b/src/cloudflare/resources/zero_trust/risk_scoring/risk_scoring.py index 614441af56c..1addfc08b30 100644 --- a/src/cloudflare/resources/zero_trust/risk_scoring/risk_scoring.py +++ b/src/cloudflare/resources/zero_trust/risk_scoring/risk_scoring.py @@ -62,7 +62,7 @@ def integrations(self) -> IntegrationsResource: @cached_property def with_raw_response(self) -> RiskScoringResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -175,7 +175,7 @@ def integrations(self) -> AsyncIntegrationsResource: @cached_property def with_raw_response(self) -> AsyncRiskScoringResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/risk_scoring/summary.py b/src/cloudflare/resources/zero_trust/risk_scoring/summary.py index 4eed71173c5..ad8ad405994 100644 --- a/src/cloudflare/resources/zero_trust/risk_scoring/summary.py +++ b/src/cloudflare/resources/zero_trust/risk_scoring/summary.py @@ -26,7 +26,7 @@ class SummaryResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SummaryResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -84,7 +84,7 @@ class AsyncSummaryResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSummaryResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/seats.py b/src/cloudflare/resources/zero_trust/seats.py index becded9a71e..a054ff308c4 100644 --- a/src/cloudflare/resources/zero_trust/seats.py +++ b/src/cloudflare/resources/zero_trust/seats.py @@ -31,7 +31,7 @@ class SeatsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SeatsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -94,7 +94,7 @@ class AsyncSeatsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSeatsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/tunnels/configurations.py b/src/cloudflare/resources/zero_trust/tunnels/configurations.py index a86da883216..b2f61626590 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/configurations.py +++ b/src/cloudflare/resources/zero_trust/tunnels/configurations.py @@ -32,7 +32,7 @@ class ConfigurationsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ConfigurationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -145,7 +145,7 @@ class AsyncConfigurationsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncConfigurationsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/tunnels/connections.py b/src/cloudflare/resources/zero_trust/tunnels/connections.py index 8fd2c4540ea..76aee5e0274 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/connections.py +++ b/src/cloudflare/resources/zero_trust/tunnels/connections.py @@ -31,7 +31,7 @@ class ConnectionsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ConnectionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -147,7 +147,7 @@ class AsyncConnectionsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncConnectionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/tunnels/connectors.py b/src/cloudflare/resources/zero_trust/tunnels/connectors.py index 58de4adc000..b3ec0ac4218 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/connectors.py +++ b/src/cloudflare/resources/zero_trust/tunnels/connectors.py @@ -26,7 +26,7 @@ class ConnectorsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ConnectorsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -96,7 +96,7 @@ class AsyncConnectorsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncConnectorsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/tunnels/management.py b/src/cloudflare/resources/zero_trust/tunnels/management.py index 64048feffd8..7fadf30409e 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/management.py +++ b/src/cloudflare/resources/zero_trust/tunnels/management.py @@ -32,7 +32,7 @@ class ManagementResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ManagementResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -101,7 +101,7 @@ class AsyncManagementResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncManagementResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/tunnels/token.py b/src/cloudflare/resources/zero_trust/tunnels/token.py index d44339389c1..d27bbf0a9a0 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/token.py +++ b/src/cloudflare/resources/zero_trust/tunnels/token.py @@ -26,7 +26,7 @@ class TokenResource(SyncAPIResource): @cached_property def with_raw_response(self) -> TokenResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -91,7 +91,7 @@ class AsyncTokenResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncTokenResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/tunnels/tunnels.py b/src/cloudflare/resources/zero_trust/tunnels/tunnels.py index 3281a4e8695..f88ccc08f9f 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/tunnels.py +++ b/src/cloudflare/resources/zero_trust/tunnels/tunnels.py @@ -110,7 +110,7 @@ def management(self) -> ManagementResource: @cached_property def with_raw_response(self) -> TunnelsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -465,7 +465,7 @@ def management(self) -> AsyncManagementResource: @cached_property def with_raw_response(self) -> AsyncTunnelsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/tunnels/warp_connector.py b/src/cloudflare/resources/zero_trust/tunnels/warp_connector.py index 3e050849524..c5874232e45 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/warp_connector.py +++ b/src/cloudflare/resources/zero_trust/tunnels/warp_connector.py @@ -43,7 +43,7 @@ class WARPConnectorResource(SyncAPIResource): @cached_property def with_raw_response(self) -> WARPConnectorResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -405,7 +405,7 @@ class AsyncWARPConnectorResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncWARPConnectorResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zero_trust/zero_trust.py b/src/cloudflare/resources/zero_trust/zero_trust.py index 899464403f9..5ebc4ff16ee 100644 --- a/src/cloudflare/resources/zero_trust/zero_trust.py +++ b/src/cloudflare/resources/zero_trust/zero_trust.py @@ -156,7 +156,7 @@ def risk_scoring(self) -> RiskScoringResource: @cached_property def with_raw_response(self) -> ZeroTrustResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -225,7 +225,7 @@ def risk_scoring(self) -> AsyncRiskScoringResource: @cached_property def with_raw_response(self) -> AsyncZeroTrustResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zones/activation_check.py b/src/cloudflare/resources/zones/activation_check.py index e45cc0f3888..80ecc436225 100644 --- a/src/cloudflare/resources/zones/activation_check.py +++ b/src/cloudflare/resources/zones/activation_check.py @@ -26,7 +26,7 @@ class ActivationCheckResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ActivationCheckResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -88,7 +88,7 @@ class AsyncActivationCheckResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncActivationCheckResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zones/custom_nameservers.py b/src/cloudflare/resources/zones/custom_nameservers.py index f84778c1a38..3d6247dac13 100644 --- a/src/cloudflare/resources/zones/custom_nameservers.py +++ b/src/cloudflare/resources/zones/custom_nameservers.py @@ -32,7 +32,7 @@ class CustomNameserversResource(SyncAPIResource): @cached_property def with_raw_response(self) -> CustomNameserversResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -150,7 +150,7 @@ class AsyncCustomNameserversResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncCustomNameserversResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zones/holds.py b/src/cloudflare/resources/zones/holds.py index 50ff188a172..521fde82848 100644 --- a/src/cloudflare/resources/zones/holds.py +++ b/src/cloudflare/resources/zones/holds.py @@ -31,7 +31,7 @@ class HoldsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> HoldsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -245,7 +245,7 @@ class AsyncHoldsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncHoldsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zones/plans.py b/src/cloudflare/resources/zones/plans.py index 7ffca5f422b..26cfd4738c0 100644 --- a/src/cloudflare/resources/zones/plans.py +++ b/src/cloudflare/resources/zones/plans.py @@ -27,7 +27,7 @@ class PlansResource(SyncAPIResource): @cached_property def with_raw_response(self) -> PlansResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -128,7 +128,7 @@ class AsyncPlansResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncPlansResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zones/rate_plans.py b/src/cloudflare/resources/zones/rate_plans.py index 2b23732baeb..12d7c4deaff 100644 --- a/src/cloudflare/resources/zones/rate_plans.py +++ b/src/cloudflare/resources/zones/rate_plans.py @@ -26,7 +26,7 @@ class RatePlansResource(SyncAPIResource): @cached_property def with_raw_response(self) -> RatePlansResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -86,7 +86,7 @@ class AsyncRatePlansResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncRatePlansResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zones/settings.py b/src/cloudflare/resources/zones/settings.py index 050ba0ee6bd..a323075a863 100644 --- a/src/cloudflare/resources/zones/settings.py +++ b/src/cloudflare/resources/zones/settings.py @@ -35,7 +35,7 @@ class SettingsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SettingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -2403,7 +2403,7 @@ class AsyncSettingsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSettingsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zones/subscriptions.py b/src/cloudflare/resources/zones/subscriptions.py index 3218ca9a941..066a3df2199 100644 --- a/src/cloudflare/resources/zones/subscriptions.py +++ b/src/cloudflare/resources/zones/subscriptions.py @@ -35,7 +35,7 @@ class SubscriptionsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> SubscriptionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -214,7 +214,7 @@ class AsyncSubscriptionsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSubscriptionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers diff --git a/src/cloudflare/resources/zones/zones.py b/src/cloudflare/resources/zones/zones.py index 4bbd527826d..16d28b897fb 100644 --- a/src/cloudflare/resources/zones/zones.py +++ b/src/cloudflare/resources/zones/zones.py @@ -119,7 +119,7 @@ def rate_plans(self) -> RatePlansResource: @cached_property def with_raw_response(self) -> ZonesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers @@ -434,7 +434,7 @@ def rate_plans(self) -> AsyncRatePlansResource: @cached_property def with_raw_response(self) -> AsyncZonesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers From d627e93f0ec9ce548a0855774cfa7b80e85ee36a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 20 Jan 2025 20:26:26 +0000 Subject: [PATCH 021/358] fix(tests): make test_get_platform less flaky (#2380) --- tests/test_client.py | 46 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/tests/test_client.py b/tests/test_client.py index 822c4f6731e..6156413f43c 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -5,6 +5,7 @@ import gc import os import json +import time import asyncio import inspect import tracemalloc @@ -1781,3 +1782,48 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: ) assert response.http_request.headers.get("x-stainless-retry-count") == "42" + + def test_get_platform(self) -> None: + # A previous implementation of asyncify could leave threads unterminated when + # used with nest_asyncio. + # + # Since nest_asyncio.apply() is global and cannot be un-applied, this + # test is run in a separate process to avoid affecting other tests. + test_code = dedent(""" + import asyncio + import nest_asyncio + import threading + + from cloudflare._utils import asyncify + from cloudflare._base_client import get_platform + + async def test_main() -> None: + result = await asyncify(get_platform)() + print(result) + for thread in threading.enumerate(): + print(thread.name) + + nest_asyncio.apply() + asyncio.run(test_main()) + """) + with subprocess.Popen( + [sys.executable, "-c", test_code], + text=True, + ) as process: + timeout = 10 # seconds + + start_time = time.monotonic() + while True: + return_code = process.poll() + if return_code is not None: + if return_code != 0: + raise AssertionError("calling get_platform using asyncify resulted in a non-zero exit code") + + # success + break + + if time.monotonic() - start_time > timeout: + process.kill() + raise AssertionError("calling get_platform using asyncify resulted in a hung process") + + time.sleep(0.1) \ No newline at end of file From 6b817fa3dbf134f83a8e4109a59e974569fd3d4f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 20 Jan 2025 12:12:23 +0000 Subject: [PATCH 022/358] chore(internal): avoid pytest-asyncio deprecation warning (#2382) --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 2dcb85b55ab..e4cb7331694 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -128,6 +128,7 @@ testpaths = ["tests"] addopts = "--tb=short" xfail_strict = true asyncio_mode = "auto" +asyncio_default_fixture_loop_scope = "session" filterwarnings = [ "error" ] From 9e58f0082c020957667c6a2a32735b7369f5a952 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 20 Jan 2025 15:38:14 +0000 Subject: [PATCH 023/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index eccc2a13dd8..f41feb42e3f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1493 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8805f41543cd932919c724a99b62b453bb8ab19e1a58a0305bd2b32b3d59c677.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-44581b9482743df3b0ea5bd5f20750f379d2d81d73a8d78eb86e525938fca96e.yml From 4ce230347aaeb14a9539f1f49c0f8e9dcd04dbc9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Jan 2025 00:12:08 +0000 Subject: [PATCH 024/358] feat(custom_ns): mark endpoints as deprecated (#2383) --- .../resources/zones/custom_nameservers.py | 61 ++++-- .../zones/test_custom_nameservers.py | 182 ++++++++++-------- 2 files changed, 149 insertions(+), 94 deletions(-) diff --git a/src/cloudflare/resources/zones/custom_nameservers.py b/src/cloudflare/resources/zones/custom_nameservers.py index 3d6247dac13..906c4f02bc3 100644 --- a/src/cloudflare/resources/zones/custom_nameservers.py +++ b/src/cloudflare/resources/zones/custom_nameservers.py @@ -2,6 +2,7 @@ from __future__ import annotations +import typing_extensions from typing import Type, Optional, cast import httpx @@ -48,6 +49,9 @@ def with_streaming_response(self) -> CustomNameserversResourceWithStreamingRespo """ return CustomNameserversResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [DNS settings API](https://developers.cloudflare.com/api/resources/dns/subresources/settings/methods/put/) instead." + ) def update( self, *, @@ -107,6 +111,9 @@ def update( cast_to=cast(Type[Optional[CustomNameserverUpdateResponse]], ResultWrapper[CustomNameserverUpdateResponse]), ) + @typing_extensions.deprecated( + "Use [DNS settings API](https://developers.cloudflare.com/api/resources/dns/subresources/settings/methods/get/) instead." + ) def get( self, *, @@ -166,6 +173,9 @@ def with_streaming_response(self) -> AsyncCustomNameserversResourceWithStreaming """ return AsyncCustomNameserversResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [DNS settings API](https://developers.cloudflare.com/api/resources/dns/subresources/settings/methods/put/) instead." + ) async def update( self, *, @@ -225,6 +235,9 @@ async def update( cast_to=cast(Type[Optional[CustomNameserverUpdateResponse]], ResultWrapper[CustomNameserverUpdateResponse]), ) + @typing_extensions.deprecated( + "Use [DNS settings API](https://developers.cloudflare.com/api/resources/dns/subresources/settings/methods/get/) instead." + ) async def get( self, *, @@ -268,11 +281,15 @@ class CustomNameserversResourceWithRawResponse: def __init__(self, custom_nameservers: CustomNameserversResource) -> None: self._custom_nameservers = custom_nameservers - self.update = to_raw_response_wrapper( - custom_nameservers.update, + self.update = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + custom_nameservers.update # pyright: ignore[reportDeprecated], + ) ) - self.get = to_raw_response_wrapper( - custom_nameservers.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + custom_nameservers.get # pyright: ignore[reportDeprecated], + ) ) @@ -280,11 +297,15 @@ class AsyncCustomNameserversResourceWithRawResponse: def __init__(self, custom_nameservers: AsyncCustomNameserversResource) -> None: self._custom_nameservers = custom_nameservers - self.update = async_to_raw_response_wrapper( - custom_nameservers.update, + self.update = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + custom_nameservers.update # pyright: ignore[reportDeprecated], + ) ) - self.get = async_to_raw_response_wrapper( - custom_nameservers.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + custom_nameservers.get # pyright: ignore[reportDeprecated], + ) ) @@ -292,11 +313,15 @@ class CustomNameserversResourceWithStreamingResponse: def __init__(self, custom_nameservers: CustomNameserversResource) -> None: self._custom_nameservers = custom_nameservers - self.update = to_streamed_response_wrapper( - custom_nameservers.update, + self.update = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + custom_nameservers.update # pyright: ignore[reportDeprecated], + ) ) - self.get = to_streamed_response_wrapper( - custom_nameservers.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + custom_nameservers.get # pyright: ignore[reportDeprecated], + ) ) @@ -304,9 +329,13 @@ class AsyncCustomNameserversResourceWithStreamingResponse: def __init__(self, custom_nameservers: AsyncCustomNameserversResource) -> None: self._custom_nameservers = custom_nameservers - self.update = async_to_streamed_response_wrapper( - custom_nameservers.update, + self.update = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + custom_nameservers.update # pyright: ignore[reportDeprecated], + ) ) - self.get = async_to_streamed_response_wrapper( - custom_nameservers.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + custom_nameservers.get # pyright: ignore[reportDeprecated], + ) ) diff --git a/tests/api_resources/zones/test_custom_nameservers.py b/tests/api_resources/zones/test_custom_nameservers.py index 74a351762c3..488b9a4cf6d 100644 --- a/tests/api_resources/zones/test_custom_nameservers.py +++ b/tests/api_resources/zones/test_custom_nameservers.py @@ -14,6 +14,8 @@ CustomNameserverUpdateResponse, ) +# pyright: reportDeprecated=false + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -22,25 +24,30 @@ class TestCustomNameservers: @parametrize def test_method_update(self, client: Cloudflare) -> None: - custom_nameserver = client.zones.custom_nameservers.update( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + custom_nameserver = client.zones.custom_nameservers.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[CustomNameserverUpdateResponse], custom_nameserver, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Cloudflare) -> None: - custom_nameserver = client.zones.custom_nameservers.update( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - enabled=True, - ns_set=1, - ) + with pytest.warns(DeprecationWarning): + custom_nameserver = client.zones.custom_nameservers.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + enabled=True, + ns_set=1, + ) + assert_matches_type(Optional[CustomNameserverUpdateResponse], custom_nameserver, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: - response = client.zones.custom_nameservers.with_raw_response.update( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = client.zones.custom_nameservers.with_raw_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -49,36 +56,41 @@ def test_raw_response_update(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: - with client.zones.custom_nameservers.with_streaming_response.update( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.zones.custom_nameservers.with_streaming_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - custom_nameserver = response.parse() - assert_matches_type(Optional[CustomNameserverUpdateResponse], custom_nameserver, path=["response"]) + custom_nameserver = response.parse() + assert_matches_type(Optional[CustomNameserverUpdateResponse], custom_nameserver, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.zones.custom_nameservers.with_raw_response.update( - zone_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zones.custom_nameservers.with_raw_response.update( + zone_id="", + ) @parametrize def test_method_get(self, client: Cloudflare) -> None: - custom_nameserver = client.zones.custom_nameservers.get( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + custom_nameserver = client.zones.custom_nameservers.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(CustomNameserverGetResponse, custom_nameserver, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.zones.custom_nameservers.with_raw_response.get( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = client.zones.custom_nameservers.with_raw_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -87,23 +99,25 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.zones.custom_nameservers.with_streaming_response.get( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.zones.custom_nameservers.with_streaming_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - custom_nameserver = response.parse() - assert_matches_type(CustomNameserverGetResponse, custom_nameserver, path=["response"]) + custom_nameserver = response.parse() + assert_matches_type(CustomNameserverGetResponse, custom_nameserver, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.zones.custom_nameservers.with_raw_response.get( - zone_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zones.custom_nameservers.with_raw_response.get( + zone_id="", + ) class TestAsyncCustomNameservers: @@ -111,25 +125,30 @@ class TestAsyncCustomNameservers: @parametrize async def test_method_update(self, async_client: AsyncCloudflare) -> None: - custom_nameserver = await async_client.zones.custom_nameservers.update( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + custom_nameserver = await async_client.zones.custom_nameservers.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[CustomNameserverUpdateResponse], custom_nameserver, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: - custom_nameserver = await async_client.zones.custom_nameservers.update( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - enabled=True, - ns_set=1, - ) + with pytest.warns(DeprecationWarning): + custom_nameserver = await async_client.zones.custom_nameservers.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + enabled=True, + ns_set=1, + ) + assert_matches_type(Optional[CustomNameserverUpdateResponse], custom_nameserver, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zones.custom_nameservers.with_raw_response.update( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.zones.custom_nameservers.with_raw_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -138,36 +157,41 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: - async with async_client.zones.custom_nameservers.with_streaming_response.update( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.zones.custom_nameservers.with_streaming_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - custom_nameserver = await response.parse() - assert_matches_type(Optional[CustomNameserverUpdateResponse], custom_nameserver, path=["response"]) + custom_nameserver = await response.parse() + assert_matches_type(Optional[CustomNameserverUpdateResponse], custom_nameserver, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.zones.custom_nameservers.with_raw_response.update( - zone_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zones.custom_nameservers.with_raw_response.update( + zone_id="", + ) @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: - custom_nameserver = await async_client.zones.custom_nameservers.get( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + custom_nameserver = await async_client.zones.custom_nameservers.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(CustomNameserverGetResponse, custom_nameserver, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zones.custom_nameservers.with_raw_response.get( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.zones.custom_nameservers.with_raw_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -176,20 +200,22 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.zones.custom_nameservers.with_streaming_response.get( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.zones.custom_nameservers.with_streaming_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - custom_nameserver = await response.parse() - assert_matches_type(CustomNameserverGetResponse, custom_nameserver, path=["response"]) + custom_nameserver = await response.parse() + assert_matches_type(CustomNameserverGetResponse, custom_nameserver, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.zones.custom_nameservers.with_raw_response.get( - zone_id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zones.custom_nameservers.with_raw_response.get( + zone_id="", + ) From 62182c26e3da79c71793804109b925b20a06dc8e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Jan 2025 16:06:21 +0000 Subject: [PATCH 025/358] chore(internal): minor style changes (#2384) --- src/cloudflare/_response.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cloudflare/_response.py b/src/cloudflare/_response.py index ef0c36a96ea..f20e4379a89 100644 --- a/src/cloudflare/_response.py +++ b/src/cloudflare/_response.py @@ -136,6 +136,8 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: if cast_to and is_annotated_type(cast_to): cast_to = extract_type_arg(cast_to, 0) + origin = get_origin(cast_to) or cast_to + if self._is_sse_stream: if to: if not is_stream_class_type(to): @@ -195,8 +197,6 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: if cast_to == bool: return cast(R, response.text.lower() == "true") - origin = get_origin(cast_to) or cast_to - if origin == APIResponse: raise RuntimeError("Unexpected state - cast_to is `APIResponse`") From f5c8571f7abcfada96c29cc73527198123bbacab Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Jan 2025 17:14:56 +0000 Subject: [PATCH 026/358] feat(api): api update (#2385) --- .stats.yml | 2 +- src/cloudflare/types/ai/ai_run_response.py | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index f41feb42e3f..e462794d3e5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1493 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-44581b9482743df3b0ea5bd5f20750f379d2d81d73a8d78eb86e525938fca96e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-45e2bf6da4c3bb8d5a1b7b45606cbb125417f078418c5f0bc542a199cef669a7.yml diff --git a/src/cloudflare/types/ai/ai_run_response.py b/src/cloudflare/types/ai/ai_run_response.py index 7979ab95bd2..a87bf1ce169 100644 --- a/src/cloudflare/types/ai/ai_run_response.py +++ b/src/cloudflare/types/ai/ai_run_response.py @@ -17,6 +17,7 @@ "ObjectDetectionBox", "UnionMember7", "UnionMember7ToolCall", + "UnionMember7Usage", "Translation", "Summarization", "ImageToText", @@ -111,6 +112,17 @@ class UnionMember7ToolCall(BaseModel): """The name of the tool to be called""" +class UnionMember7Usage(BaseModel): + completion_tokens: Optional[float] = None + """Total number of tokens in output""" + + prompt_tokens: Optional[float] = None + """Total number of tokens in input""" + + total_tokens: Optional[float] = None + """Total number of input and output tokens""" + + class UnionMember7(BaseModel): response: Optional[str] = None """The generated text response from the model""" @@ -118,6 +130,9 @@ class UnionMember7(BaseModel): tool_calls: Optional[List[UnionMember7ToolCall]] = None """An array of tool calls requests made during the response generation""" + usage: Optional[UnionMember7Usage] = None + """Usage statistics for the inference request""" + class Translation(BaseModel): translated_text: Optional[str] = None From a1e2ef4b5aac82a5e019943e6c8769a3728e0656 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Jan 2025 21:55:39 +0000 Subject: [PATCH 027/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index e462794d3e5..48bf1100e91 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1493 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-45e2bf6da4c3bb8d5a1b7b45606cbb125417f078418c5f0bc542a199cef669a7.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9c081be96b5affb6d9142aeab2a89b03baee37012734d68258f70cfe5e95040f.yml From 3f326d018afe95abbe09bedf83bdf6134ed0b4bc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Jan 2025 06:12:44 +0000 Subject: [PATCH 028/358] feat(api): api update (#2386) --- .stats.yml | 2 +- src/cloudflare/types/waiting_rooms/status_get_response.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 48bf1100e91..88f5d6eedad 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1493 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9c081be96b5affb6d9142aeab2a89b03baee37012734d68258f70cfe5e95040f.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1e73ee53fddc61d4ddfa1837bcbc2792e682a435439373fff24a718b4d8f7783.yml diff --git a/src/cloudflare/types/waiting_rooms/status_get_response.py b/src/cloudflare/types/waiting_rooms/status_get_response.py index 6114ed2cad0..e9b44502c72 100644 --- a/src/cloudflare/types/waiting_rooms/status_get_response.py +++ b/src/cloudflare/types/waiting_rooms/status_get_response.py @@ -17,4 +17,4 @@ class StatusGetResponse(BaseModel): max_estimated_time_minutes: Optional[int] = None - status: Optional[Literal["event_prequeueing", "not_queueing", "queueing"]] = None + status: Optional[Literal["event_prequeueing", "not_queueing", "queueing", "suspended"]] = None From f129c2a634e664e338ab3e998cc62bb10465a8a0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Jan 2025 19:26:23 +0000 Subject: [PATCH 029/358] chore(tests): exclude unneeded properties (#2387) --- .../api_resources/hyperdrive/test_configs.py | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/tests/api_resources/hyperdrive/test_configs.py b/tests/api_resources/hyperdrive/test_configs.py index ff8cebe0702..45973d90dc5 100644 --- a/tests/api_resources/hyperdrive/test_configs.py +++ b/tests/api_resources/hyperdrive/test_configs.py @@ -33,7 +33,6 @@ def test_method_create(self, client: Cloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", - "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -50,7 +49,6 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", - "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -68,7 +66,6 @@ def test_raw_response_create(self, client: Cloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", - "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -89,7 +86,6 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", - "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -113,7 +109,6 @@ def test_path_params_create(self, client: Cloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", - "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -130,7 +125,6 @@ def test_method_update(self, client: Cloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", - "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -148,7 +142,6 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", - "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -167,7 +160,6 @@ def test_raw_response_update(self, client: Cloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", - "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -189,7 +181,6 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", - "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -214,7 +205,6 @@ def test_path_params_update(self, client: Cloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", - "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -229,7 +219,6 @@ def test_path_params_update(self, client: Cloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", - "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -341,7 +330,6 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: name="example-hyperdrive", origin={ "database": "postgres", - "password": "password", "scheme": "postgres", "user": "postgres", }, @@ -452,7 +440,6 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", - "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -469,7 +456,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare origin={ "database": "postgres", "host": "database.example.com", - "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -487,7 +473,6 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", - "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -508,7 +493,6 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> origin={ "database": "postgres", "host": "database.example.com", - "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -532,7 +516,6 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", - "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -549,7 +532,6 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", - "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -567,7 +549,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare origin={ "database": "postgres", "host": "database.example.com", - "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -586,7 +567,6 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", - "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -608,7 +588,6 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> origin={ "database": "postgres", "host": "database.example.com", - "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -633,7 +612,6 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", - "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -648,7 +626,6 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", - "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -760,7 +737,6 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) name="example-hyperdrive", origin={ "database": "postgres", - "password": "password", "scheme": "postgres", "user": "postgres", }, From 66a855fb699a5038862da2d473198b23475962ee Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 00:27:20 +0000 Subject: [PATCH 030/358] feat(api): api update (#2388) --- .stats.yml | 2 +- src/cloudflare/resources/url_scanner/scans.py | 12 ++--- .../zero_trust/dlp/datasets/upload.py | 6 +-- .../dlp/datasets/versions/entries.py | 6 +-- .../dlp/datasets/upload_edit_params.py | 4 +- .../datasets/versions/entry_create_params.py | 4 +- .../dlp/email/rule_bulk_edit_response.py | 4 +- .../dlp/email/rule_create_params.py | 4 +- .../dlp/email/rule_create_response.py | 4 +- .../dlp/email/rule_delete_response.py | 4 +- .../zero_trust/dlp/email/rule_get_response.py | 4 +- .../dlp/email/rule_list_response.py | 4 +- .../dlp/email/rule_update_params.py | 4 +- .../dlp/email/rule_update_response.py | 4 +- .../zero_trust/dlp/datasets/test_upload.py | 20 ++++----- .../dlp/datasets/versions/test_entries.py | 24 +++++----- .../zero_trust/dlp/email/test_rules.py | 44 +++++++++---------- 17 files changed, 77 insertions(+), 77 deletions(-) diff --git a/.stats.yml b/.stats.yml index 88f5d6eedad..bf1701dbe42 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1493 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1e73ee53fddc61d4ddfa1837bcbc2792e682a435439373fff24a718b4d8f7783.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ed24ef293c8f10ea1c884e533b435244b266e97c6e01211430ac9d39e6daebb0.yml diff --git a/src/cloudflare/resources/url_scanner/scans.py b/src/cloudflare/resources/url_scanner/scans.py index fd03055b71c..703c16ba14e 100644 --- a/src/cloudflare/resources/url_scanner/scans.py +++ b/src/cloudflare/resources/url_scanner/scans.py @@ -149,10 +149,8 @@ def list( "microsoft".
- 'apikey:me AND date:[2024-01 TO 2024-10]': my scans from 2024 January to 2024 October.
- 'page.domain:(blogspot OR www.blogspot)': Searches for scans whose main domain starts with "blogspot" or with - "www.blogspot"
- 'date:>now-7d AND path:okta-sign-in.min.js: scans from the - last 7 days with any request path that ends with "okta-sign-in.min.js"
- - 'page.asn:AS24940 AND hash:xxx': Websites hosted in AS24940 where a resource - with the given hash was downloaded. + "www.blogspot"
- 'page.asn:AS24940 AND hash:xxx': Websites hosted in AS24940 + where a resource with the given hash was downloaded. Args: account_id: Account ID. @@ -514,10 +512,8 @@ async def list( "microsoft".
- 'apikey:me AND date:[2024-01 TO 2024-10]': my scans from 2024 January to 2024 October.
- 'page.domain:(blogspot OR www.blogspot)': Searches for scans whose main domain starts with "blogspot" or with - "www.blogspot"
- 'date:>now-7d AND path:okta-sign-in.min.js: scans from the - last 7 days with any request path that ends with "okta-sign-in.min.js"
- - 'page.asn:AS24940 AND hash:xxx': Websites hosted in AS24940 where a resource - with the given hash was downloaded. + "www.blogspot"
- 'page.asn:AS24940 AND hash:xxx': Websites hosted in AS24940 + where a resource with the given hash was downloaded. Args: account_id: Account ID. diff --git a/src/cloudflare/resources/zero_trust/dlp/datasets/upload.py b/src/cloudflare/resources/zero_trust/dlp/datasets/upload.py index c50b99af49f..1e347a30a66 100644 --- a/src/cloudflare/resources/zero_trust/dlp/datasets/upload.py +++ b/src/cloudflare/resources/zero_trust/dlp/datasets/upload.py @@ -6,7 +6,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes from ....._utils import ( maybe_transform, async_maybe_transform, @@ -94,7 +94,7 @@ def edit( *, account_id: str, dataset_id: str, - body: str, + body: FileTypes, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -202,7 +202,7 @@ async def edit( *, account_id: str, dataset_id: str, - body: str, + body: FileTypes, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/cloudflare/resources/zero_trust/dlp/datasets/versions/entries.py b/src/cloudflare/resources/zero_trust/dlp/datasets/versions/entries.py index 4a39f71b32f..b3627b67bb2 100755 --- a/src/cloudflare/resources/zero_trust/dlp/datasets/versions/entries.py +++ b/src/cloudflare/resources/zero_trust/dlp/datasets/versions/entries.py @@ -6,7 +6,7 @@ import httpx -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes from ......_utils import ( maybe_transform, async_maybe_transform, @@ -54,7 +54,7 @@ def create( account_id: str, dataset_id: str, version: int, - body: str, + body: FileTypes, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -123,7 +123,7 @@ async def create( account_id: str, dataset_id: str, version: int, - body: str, + body: FileTypes, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/cloudflare/types/zero_trust/dlp/datasets/upload_edit_params.py b/src/cloudflare/types/zero_trust/dlp/datasets/upload_edit_params.py index 1a0500f09a4..8370ae917b6 100644 --- a/src/cloudflare/types/zero_trust/dlp/datasets/upload_edit_params.py +++ b/src/cloudflare/types/zero_trust/dlp/datasets/upload_edit_params.py @@ -4,6 +4,8 @@ from typing_extensions import Required, TypedDict +from ....._types import FileTypes + __all__ = ["UploadEditParams"] @@ -12,4 +14,4 @@ class UploadEditParams(TypedDict, total=False): dataset_id: Required[str] - body: Required[str] + body: Required[FileTypes] diff --git a/src/cloudflare/types/zero_trust/dlp/datasets/versions/entry_create_params.py b/src/cloudflare/types/zero_trust/dlp/datasets/versions/entry_create_params.py index 9dbe58ba324..dd55f1227f4 100755 --- a/src/cloudflare/types/zero_trust/dlp/datasets/versions/entry_create_params.py +++ b/src/cloudflare/types/zero_trust/dlp/datasets/versions/entry_create_params.py @@ -4,6 +4,8 @@ from typing_extensions import Required, TypedDict +from ......_types import FileTypes + __all__ = ["EntryCreateParams"] @@ -14,4 +16,4 @@ class EntryCreateParams(TypedDict, total=False): version: Required[int] - body: Required[str] + body: Required[FileTypes] diff --git a/src/cloudflare/types/zero_trust/dlp/email/rule_bulk_edit_response.py b/src/cloudflare/types/zero_trust/dlp/email/rule_bulk_edit_response.py index 55a9db93b90..eb8bd2ef008 100644 --- a/src/cloudflare/types/zero_trust/dlp/email/rule_bulk_edit_response.py +++ b/src/cloudflare/types/zero_trust/dlp/email/rule_bulk_edit_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List, Union, Optional from datetime import datetime from typing_extensions import Literal @@ -20,7 +20,7 @@ class Condition(BaseModel): selector: Literal["Recipients", "Sender", "DLPProfiles"] - value: object + value: Union[List[str], str] class RuleBulkEditResponse(BaseModel): diff --git a/src/cloudflare/types/zero_trust/dlp/email/rule_create_params.py b/src/cloudflare/types/zero_trust/dlp/email/rule_create_params.py index 8d1bf0f8cd2..702360892e8 100644 --- a/src/cloudflare/types/zero_trust/dlp/email/rule_create_params.py +++ b/src/cloudflare/types/zero_trust/dlp/email/rule_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Iterable, Optional +from typing import List, Union, Iterable, Optional from typing_extensions import Literal, Required, TypedDict __all__ = ["RuleCreateParams", "Action", "Condition"] @@ -34,4 +34,4 @@ class Condition(TypedDict, total=False): selector: Required[Literal["Recipients", "Sender", "DLPProfiles"]] - value: Required[object] + value: Required[Union[List[str], str]] diff --git a/src/cloudflare/types/zero_trust/dlp/email/rule_create_response.py b/src/cloudflare/types/zero_trust/dlp/email/rule_create_response.py index 7077679dc93..0562e446176 100644 --- a/src/cloudflare/types/zero_trust/dlp/email/rule_create_response.py +++ b/src/cloudflare/types/zero_trust/dlp/email/rule_create_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List, Union, Optional from datetime import datetime from typing_extensions import Literal @@ -20,7 +20,7 @@ class Condition(BaseModel): selector: Literal["Recipients", "Sender", "DLPProfiles"] - value: object + value: Union[List[str], str] class RuleCreateResponse(BaseModel): diff --git a/src/cloudflare/types/zero_trust/dlp/email/rule_delete_response.py b/src/cloudflare/types/zero_trust/dlp/email/rule_delete_response.py index b67309d5e8a..0b11a409918 100644 --- a/src/cloudflare/types/zero_trust/dlp/email/rule_delete_response.py +++ b/src/cloudflare/types/zero_trust/dlp/email/rule_delete_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List, Union, Optional from datetime import datetime from typing_extensions import Literal @@ -20,7 +20,7 @@ class Condition(BaseModel): selector: Literal["Recipients", "Sender", "DLPProfiles"] - value: object + value: Union[List[str], str] class RuleDeleteResponse(BaseModel): diff --git a/src/cloudflare/types/zero_trust/dlp/email/rule_get_response.py b/src/cloudflare/types/zero_trust/dlp/email/rule_get_response.py index 75681ab045e..316c51deeaf 100644 --- a/src/cloudflare/types/zero_trust/dlp/email/rule_get_response.py +++ b/src/cloudflare/types/zero_trust/dlp/email/rule_get_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List, Union, Optional from datetime import datetime from typing_extensions import Literal @@ -20,7 +20,7 @@ class Condition(BaseModel): selector: Literal["Recipients", "Sender", "DLPProfiles"] - value: object + value: Union[List[str], str] class RuleGetResponse(BaseModel): diff --git a/src/cloudflare/types/zero_trust/dlp/email/rule_list_response.py b/src/cloudflare/types/zero_trust/dlp/email/rule_list_response.py index 0e5913db430..36145177cbb 100644 --- a/src/cloudflare/types/zero_trust/dlp/email/rule_list_response.py +++ b/src/cloudflare/types/zero_trust/dlp/email/rule_list_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List, Union, Optional from datetime import datetime from typing_extensions import Literal @@ -20,7 +20,7 @@ class Condition(BaseModel): selector: Literal["Recipients", "Sender", "DLPProfiles"] - value: object + value: Union[List[str], str] class RuleListResponse(BaseModel): diff --git a/src/cloudflare/types/zero_trust/dlp/email/rule_update_params.py b/src/cloudflare/types/zero_trust/dlp/email/rule_update_params.py index 1bf1e76cf2f..dd1441ce15d 100644 --- a/src/cloudflare/types/zero_trust/dlp/email/rule_update_params.py +++ b/src/cloudflare/types/zero_trust/dlp/email/rule_update_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Iterable, Optional +from typing import List, Union, Iterable, Optional from typing_extensions import Literal, Required, TypedDict __all__ = ["RuleUpdateParams", "Action", "Condition"] @@ -34,4 +34,4 @@ class Condition(TypedDict, total=False): selector: Required[Literal["Recipients", "Sender", "DLPProfiles"]] - value: Required[object] + value: Required[Union[List[str], str]] diff --git a/src/cloudflare/types/zero_trust/dlp/email/rule_update_response.py b/src/cloudflare/types/zero_trust/dlp/email/rule_update_response.py index c1e9f32703d..840c160b6d0 100644 --- a/src/cloudflare/types/zero_trust/dlp/email/rule_update_response.py +++ b/src/cloudflare/types/zero_trust/dlp/email/rule_update_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List, Union, Optional from datetime import datetime from typing_extensions import Literal @@ -20,7 +20,7 @@ class Condition(BaseModel): selector: Literal["Recipients", "Sender", "DLPProfiles"] - value: object + value: Union[List[str], str] class RuleUpdateResponse(BaseModel): diff --git a/tests/api_resources/zero_trust/dlp/datasets/test_upload.py b/tests/api_resources/zero_trust/dlp/datasets/test_upload.py index 4521acb1e12..15c42ee5123 100644 --- a/tests/api_resources/zero_trust/dlp/datasets/test_upload.py +++ b/tests/api_resources/zero_trust/dlp/datasets/test_upload.py @@ -73,7 +73,7 @@ def test_method_edit(self, client: Cloudflare) -> None: version=0, account_id="account_id", dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - body="body", + body=b"raw file contents", ) assert_matches_type(Optional[Dataset], upload, path=["response"]) @@ -84,7 +84,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: version=0, account_id="account_id", dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - body="body", + body=b"raw file contents", ) assert response.is_closed is True @@ -99,7 +99,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: version=0, account_id="account_id", dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - body="body", + body=b"raw file contents", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -117,7 +117,7 @@ def test_path_params_edit(self, client: Cloudflare) -> None: version=0, account_id="", dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - body="body", + body=b"raw file contents", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"): @@ -125,7 +125,7 @@ def test_path_params_edit(self, client: Cloudflare) -> None: version=0, account_id="account_id", dataset_id="", - body="body", + body=b"raw file contents", ) @@ -187,7 +187,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: version=0, account_id="account_id", dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - body="body", + body=b"raw file contents", ) assert_matches_type(Optional[Dataset], upload, path=["response"]) @@ -198,7 +198,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: version=0, account_id="account_id", dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - body="body", + body=b"raw file contents", ) assert response.is_closed is True @@ -213,7 +213,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N version=0, account_id="account_id", dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - body="body", + body=b"raw file contents", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -231,7 +231,7 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: version=0, account_id="", dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - body="body", + body=b"raw file contents", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"): @@ -239,5 +239,5 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: version=0, account_id="account_id", dataset_id="", - body="body", + body=b"raw file contents", ) diff --git a/tests/api_resources/zero_trust/dlp/datasets/versions/test_entries.py b/tests/api_resources/zero_trust/dlp/datasets/versions/test_entries.py index 3b8b388d056..086fcceba69 100755 --- a/tests/api_resources/zero_trust/dlp/datasets/versions/test_entries.py +++ b/tests/api_resources/zero_trust/dlp/datasets/versions/test_entries.py @@ -25,7 +25,7 @@ def test_method_create(self, client: Cloudflare) -> None: account_id="account_id", dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", version=0, - body="body", + body=b"raw file contents", ) assert_matches_type(Optional[EntryCreateResponse], entry, path=["response"]) @@ -37,7 +37,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: account_id="account_id", dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", version=0, - body="body", + body=b"raw file contents", ) assert response.is_closed is True @@ -53,7 +53,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: account_id="account_id", dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", version=0, - body="body", + body=b"raw file contents", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -72,7 +72,7 @@ def test_path_params_create(self, client: Cloudflare) -> None: account_id="", dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", version=0, - body="body", + body=b"raw file contents", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"): @@ -81,7 +81,7 @@ def test_path_params_create(self, client: Cloudflare) -> None: account_id="account_id", dataset_id="", version=0, - body="body", + body=b"raw file contents", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `entry_id` but received ''"): @@ -90,7 +90,7 @@ def test_path_params_create(self, client: Cloudflare) -> None: account_id="account_id", dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", version=0, - body="body", + body=b"raw file contents", ) @@ -105,7 +105,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: account_id="account_id", dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", version=0, - body="body", + body=b"raw file contents", ) assert_matches_type(Optional[EntryCreateResponse], entry, path=["response"]) @@ -117,7 +117,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: account_id="account_id", dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", version=0, - body="body", + body=b"raw file contents", ) assert response.is_closed is True @@ -133,7 +133,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> account_id="account_id", dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", version=0, - body="body", + body=b"raw file contents", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -152,7 +152,7 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: account_id="", dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", version=0, - body="body", + body=b"raw file contents", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"): @@ -161,7 +161,7 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: account_id="account_id", dataset_id="", version=0, - body="body", + body=b"raw file contents", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `entry_id` but received ''"): @@ -170,5 +170,5 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: account_id="account_id", dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", version=0, - body="body", + body=b"raw file contents", ) diff --git a/tests/api_resources/zero_trust/dlp/email/test_rules.py b/tests/api_resources/zero_trust/dlp/email/test_rules.py index f64c4040aa6..e09032dad07 100644 --- a/tests/api_resources/zero_trust/dlp/email/test_rules.py +++ b/tests/api_resources/zero_trust/dlp/email/test_rules.py @@ -34,7 +34,7 @@ def test_method_create(self, client: Cloudflare) -> None: { "operator": "InList", "selector": "Recipients", - "value": {}, + "value": ["string"], } ], enabled=True, @@ -54,7 +54,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: { "operator": "InList", "selector": "Recipients", - "value": {}, + "value": ["string"], } ], enabled=True, @@ -72,7 +72,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: { "operator": "InList", "selector": "Recipients", - "value": {}, + "value": ["string"], } ], enabled=True, @@ -93,7 +93,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: { "operator": "InList", "selector": "Recipients", - "value": {}, + "value": ["string"], } ], enabled=True, @@ -117,7 +117,7 @@ def test_path_params_create(self, client: Cloudflare) -> None: { "operator": "InList", "selector": "Recipients", - "value": {}, + "value": ["string"], } ], enabled=True, @@ -134,7 +134,7 @@ def test_method_update(self, client: Cloudflare) -> None: { "operator": "InList", "selector": "Recipients", - "value": {}, + "value": ["string"], } ], enabled=True, @@ -155,7 +155,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: { "operator": "InList", "selector": "Recipients", - "value": {}, + "value": ["string"], } ], enabled=True, @@ -174,7 +174,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: { "operator": "InList", "selector": "Recipients", - "value": {}, + "value": ["string"], } ], enabled=True, @@ -196,7 +196,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: { "operator": "InList", "selector": "Recipients", - "value": {}, + "value": ["string"], } ], enabled=True, @@ -221,7 +221,7 @@ def test_path_params_update(self, client: Cloudflare) -> None: { "operator": "InList", "selector": "Recipients", - "value": {}, + "value": ["string"], } ], enabled=True, @@ -237,7 +237,7 @@ def test_path_params_update(self, client: Cloudflare) -> None: { "operator": "InList", "selector": "Recipients", - "value": {}, + "value": ["string"], } ], enabled=True, @@ -433,7 +433,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: { "operator": "InList", "selector": "Recipients", - "value": {}, + "value": ["string"], } ], enabled=True, @@ -453,7 +453,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare { "operator": "InList", "selector": "Recipients", - "value": {}, + "value": ["string"], } ], enabled=True, @@ -471,7 +471,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: { "operator": "InList", "selector": "Recipients", - "value": {}, + "value": ["string"], } ], enabled=True, @@ -492,7 +492,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> { "operator": "InList", "selector": "Recipients", - "value": {}, + "value": ["string"], } ], enabled=True, @@ -516,7 +516,7 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: { "operator": "InList", "selector": "Recipients", - "value": {}, + "value": ["string"], } ], enabled=True, @@ -533,7 +533,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: { "operator": "InList", "selector": "Recipients", - "value": {}, + "value": ["string"], } ], enabled=True, @@ -554,7 +554,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare { "operator": "InList", "selector": "Recipients", - "value": {}, + "value": ["string"], } ], enabled=True, @@ -573,7 +573,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: { "operator": "InList", "selector": "Recipients", - "value": {}, + "value": ["string"], } ], enabled=True, @@ -595,7 +595,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> { "operator": "InList", "selector": "Recipients", - "value": {}, + "value": ["string"], } ], enabled=True, @@ -620,7 +620,7 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: { "operator": "InList", "selector": "Recipients", - "value": {}, + "value": ["string"], } ], enabled=True, @@ -636,7 +636,7 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: { "operator": "InList", "selector": "Recipients", - "value": {}, + "value": ["string"], } ], enabled=True, From 1eb872af7857c17cce9e0793c8c36a25cfde4fc8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 00:37:45 +0000 Subject: [PATCH 031/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index bf1701dbe42..baf13047727 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1493 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ed24ef293c8f10ea1c884e533b435244b266e97c6e01211430ac9d39e6daebb0.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4d2ad2efc7849cfa1f1205e3d2b513df805aae225cc968df751a60ecd902d1ab.yml From f615f940bf20b85807cdefc77250dbcd17d8211b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 01:52:14 +0000 Subject: [PATCH 032/358] feat(network_interconnects): add support for endpoints (#2389) --- .stats.yml | 2 +- api.md | 71 ++ src/cloudflare/_client.py | 41 + .../network_interconnects/__init__.py | 75 ++ .../resources/network_interconnects/cnis.py | 645 ++++++++++++++ .../network_interconnects/interconnects.py | 837 ++++++++++++++++++ .../network_interconnects.py | 198 +++++ .../network_interconnects/settings.py | 253 ++++++ .../resources/network_interconnects/slots.py | 319 +++++++ .../types/network_interconnects/__init__.py | 23 + .../cni_create_params.py | 59 ++ .../cni_create_response.py | 67 ++ .../network_interconnects/cni_get_response.py | 67 ++ .../network_interconnects/cni_list_params.py | 20 + .../cni_list_response.py | 73 ++ .../cni_update_params.py | 71 ++ .../cni_update_response.py | 67 ++ .../interconnect_create_params.py | 39 + .../interconnect_create_response.py | 53 ++ .../interconnect_get_response.py | 53 ++ .../interconnect_list_params.py | 23 + .../interconnect_list_response.py | 60 ++ .../interconnect_status_response.py | 36 + .../setting_get_response.py | 11 + .../setting_update_params.py | 14 + .../setting_update_response.py | 11 + .../slot_get_response.py | 30 + .../network_interconnects/slot_list_params.py | 29 + .../slot_list_response.py | 36 + .../network_interconnects/__init__.py | 1 + .../network_interconnects/test_cnis.py | 727 +++++++++++++++ .../test_interconnects.py | 739 ++++++++++++++++ .../network_interconnects/test_settings.py | 190 ++++ .../network_interconnects/test_slots.py | 220 +++++ 34 files changed, 5159 insertions(+), 1 deletion(-) create mode 100644 src/cloudflare/resources/network_interconnects/__init__.py create mode 100644 src/cloudflare/resources/network_interconnects/cnis.py create mode 100644 src/cloudflare/resources/network_interconnects/interconnects.py create mode 100644 src/cloudflare/resources/network_interconnects/network_interconnects.py create mode 100644 src/cloudflare/resources/network_interconnects/settings.py create mode 100644 src/cloudflare/resources/network_interconnects/slots.py create mode 100644 src/cloudflare/types/network_interconnects/__init__.py create mode 100644 src/cloudflare/types/network_interconnects/cni_create_params.py create mode 100644 src/cloudflare/types/network_interconnects/cni_create_response.py create mode 100644 src/cloudflare/types/network_interconnects/cni_get_response.py create mode 100644 src/cloudflare/types/network_interconnects/cni_list_params.py create mode 100644 src/cloudflare/types/network_interconnects/cni_list_response.py create mode 100644 src/cloudflare/types/network_interconnects/cni_update_params.py create mode 100644 src/cloudflare/types/network_interconnects/cni_update_response.py create mode 100644 src/cloudflare/types/network_interconnects/interconnect_create_params.py create mode 100644 src/cloudflare/types/network_interconnects/interconnect_create_response.py create mode 100644 src/cloudflare/types/network_interconnects/interconnect_get_response.py create mode 100644 src/cloudflare/types/network_interconnects/interconnect_list_params.py create mode 100644 src/cloudflare/types/network_interconnects/interconnect_list_response.py create mode 100644 src/cloudflare/types/network_interconnects/interconnect_status_response.py create mode 100644 src/cloudflare/types/network_interconnects/setting_get_response.py create mode 100644 src/cloudflare/types/network_interconnects/setting_update_params.py create mode 100644 src/cloudflare/types/network_interconnects/setting_update_response.py create mode 100644 src/cloudflare/types/network_interconnects/slot_get_response.py create mode 100644 src/cloudflare/types/network_interconnects/slot_list_params.py create mode 100644 src/cloudflare/types/network_interconnects/slot_list_response.py create mode 100644 tests/api_resources/network_interconnects/__init__.py create mode 100644 tests/api_resources/network_interconnects/test_cnis.py create mode 100644 tests/api_resources/network_interconnects/test_interconnects.py create mode 100644 tests/api_resources/network_interconnects/test_settings.py create mode 100644 tests/api_resources/network_interconnects/test_slots.py diff --git a/.stats.yml b/.stats.yml index baf13047727..d0c74d2b890 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 1493 +configured_endpoints: 1508 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4d2ad2efc7849cfa1f1205e3d2b513df805aae225cc968df751a60ecd902d1ab.yml diff --git a/api.md b/api.md index a037b01601c..f2db084f0e4 100644 --- a/api.md +++ b/api.md @@ -3997,6 +3997,77 @@ Methods: - client.magic_network_monitoring.rules.advertisements.edit(rule_id, \*, account_id, \*\*params) -> Optional[Advertisement] +# NetworkInterconnects + +## CNIs + +Types: + +```python +from cloudflare.types.network_interconnects import ( + CNICreateResponse, + CNIUpdateResponse, + CNIListResponse, + CNIGetResponse, +) +``` + +Methods: + +- client.network_interconnects.cnis.create(\*, account_id, \*\*params) -> CNICreateResponse +- client.network_interconnects.cnis.update(cni, \*, account_id, \*\*params) -> CNIUpdateResponse +- client.network_interconnects.cnis.list(\*, account_id, \*\*params) -> CNIListResponse +- client.network_interconnects.cnis.delete(cni, \*, account_id) -> None +- client.network_interconnects.cnis.get(cni, \*, account_id) -> CNIGetResponse + +## Interconnects + +Types: + +```python +from cloudflare.types.network_interconnects import ( + InterconnectCreateResponse, + InterconnectListResponse, + InterconnectGetResponse, + InterconnectStatusResponse, +) +``` + +Methods: + +- client.network_interconnects.interconnects.create(\*, account_id, \*\*params) -> InterconnectCreateResponse +- client.network_interconnects.interconnects.list(\*, account_id, \*\*params) -> InterconnectListResponse +- client.network_interconnects.interconnects.delete(icon, \*, account_id) -> None +- client.network_interconnects.interconnects.get(icon, \*, account_id) -> InterconnectGetResponse +- client.network_interconnects.interconnects.loa(icon, \*, account_id) -> None +- client.network_interconnects.interconnects.status(icon, \*, account_id) -> InterconnectStatusResponse + +## Settings + +Types: + +```python +from cloudflare.types.network_interconnects import SettingUpdateResponse, SettingGetResponse +``` + +Methods: + +- client.network_interconnects.settings.update(\*, account_id, \*\*params) -> SettingUpdateResponse +- client.network_interconnects.settings.get(\*, account_id) -> SettingGetResponse + +## Slots + +Types: + +```python +from cloudflare.types.network_interconnects import SlotListResponse, SlotGetResponse +``` + +Methods: + +- client.network_interconnects.slots.list(\*, account_id, \*\*params) -> SlotListResponse +- client.network_interconnects.slots.get(slot, \*, account_id) -> SlotGetResponse + # MTLSCertificates Types: diff --git a/src/cloudflare/_client.py b/src/cloudflare/_client.py index f48b5ae2359..e2e92d90f55 100644 --- a/src/cloudflare/_client.py +++ b/src/cloudflare/_client.py @@ -115,6 +115,7 @@ client_certificates, custom_certificates, keyless_certificates, + network_interconnects, workers_for_platforms, origin_ca_certificates, origin_tls_client_auth, @@ -210,6 +211,10 @@ CustomCertificatesResource, AsyncCustomCertificatesResource, ) + from .resources.network_interconnects.network_interconnects import ( + NetworkInterconnectsResource, + AsyncNetworkInterconnectsResource, + ) from .resources.workers_for_platforms.workers_for_platforms import ( WorkersForPlatformsResource, AsyncWorkersForPlatformsResource, @@ -616,6 +621,12 @@ def magic_network_monitoring(self) -> MagicNetworkMonitoringResource: return MagicNetworkMonitoringResource(self) + @cached_property + def network_interconnects(self) -> NetworkInterconnectsResource: + from .resources.network_interconnects import NetworkInterconnectsResource + + return NetworkInterconnectsResource(self) + @cached_property def mtls_certificates(self) -> MTLSCertificatesResource: from .resources.mtls_certificates import MTLSCertificatesResource @@ -1387,6 +1398,12 @@ def magic_network_monitoring(self) -> AsyncMagicNetworkMonitoringResource: return AsyncMagicNetworkMonitoringResource(self) + @cached_property + def network_interconnects(self) -> AsyncNetworkInterconnectsResource: + from .resources.network_interconnects import AsyncNetworkInterconnectsResource + + return AsyncNetworkInterconnectsResource(self) + @cached_property def mtls_certificates(self) -> AsyncMTLSCertificatesResource: from .resources.mtls_certificates import AsyncMTLSCertificatesResource @@ -2091,6 +2108,12 @@ def magic_network_monitoring(self) -> magic_network_monitoring.MagicNetworkMonit return MagicNetworkMonitoringResourceWithRawResponse(self._client.magic_network_monitoring) + @cached_property + def network_interconnects(self) -> network_interconnects.NetworkInterconnectsResourceWithRawResponse: + from .resources.network_interconnects import NetworkInterconnectsResourceWithRawResponse + + return NetworkInterconnectsResourceWithRawResponse(self._client.network_interconnects) + @cached_property def mtls_certificates(self) -> mtls_certificates.MTLSCertificatesResourceWithRawResponse: from .resources.mtls_certificates import MTLSCertificatesResourceWithRawResponse @@ -2616,6 +2639,12 @@ def magic_network_monitoring(self) -> magic_network_monitoring.AsyncMagicNetwork return AsyncMagicNetworkMonitoringResourceWithRawResponse(self._client.magic_network_monitoring) + @cached_property + def network_interconnects(self) -> network_interconnects.AsyncNetworkInterconnectsResourceWithRawResponse: + from .resources.network_interconnects import AsyncNetworkInterconnectsResourceWithRawResponse + + return AsyncNetworkInterconnectsResourceWithRawResponse(self._client.network_interconnects) + @cached_property def mtls_certificates(self) -> mtls_certificates.AsyncMTLSCertificatesResourceWithRawResponse: from .resources.mtls_certificates import AsyncMTLSCertificatesResourceWithRawResponse @@ -3141,6 +3170,12 @@ def magic_network_monitoring(self) -> magic_network_monitoring.MagicNetworkMonit return MagicNetworkMonitoringResourceWithStreamingResponse(self._client.magic_network_monitoring) + @cached_property + def network_interconnects(self) -> network_interconnects.NetworkInterconnectsResourceWithStreamingResponse: + from .resources.network_interconnects import NetworkInterconnectsResourceWithStreamingResponse + + return NetworkInterconnectsResourceWithStreamingResponse(self._client.network_interconnects) + @cached_property def mtls_certificates(self) -> mtls_certificates.MTLSCertificatesResourceWithStreamingResponse: from .resources.mtls_certificates import MTLSCertificatesResourceWithStreamingResponse @@ -3670,6 +3705,12 @@ def magic_network_monitoring( return AsyncMagicNetworkMonitoringResourceWithStreamingResponse(self._client.magic_network_monitoring) + @cached_property + def network_interconnects(self) -> network_interconnects.AsyncNetworkInterconnectsResourceWithStreamingResponse: + from .resources.network_interconnects import AsyncNetworkInterconnectsResourceWithStreamingResponse + + return AsyncNetworkInterconnectsResourceWithStreamingResponse(self._client.network_interconnects) + @cached_property def mtls_certificates(self) -> mtls_certificates.AsyncMTLSCertificatesResourceWithStreamingResponse: from .resources.mtls_certificates import AsyncMTLSCertificatesResourceWithStreamingResponse diff --git a/src/cloudflare/resources/network_interconnects/__init__.py b/src/cloudflare/resources/network_interconnects/__init__.py new file mode 100644 index 00000000000..bfd7a1174e2 --- /dev/null +++ b/src/cloudflare/resources/network_interconnects/__init__.py @@ -0,0 +1,75 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .cnis import ( + CNIsResource, + AsyncCNIsResource, + CNIsResourceWithRawResponse, + AsyncCNIsResourceWithRawResponse, + CNIsResourceWithStreamingResponse, + AsyncCNIsResourceWithStreamingResponse, +) +from .slots import ( + SlotsResource, + AsyncSlotsResource, + SlotsResourceWithRawResponse, + AsyncSlotsResourceWithRawResponse, + SlotsResourceWithStreamingResponse, + AsyncSlotsResourceWithStreamingResponse, +) +from .settings import ( + SettingsResource, + AsyncSettingsResource, + SettingsResourceWithRawResponse, + AsyncSettingsResourceWithRawResponse, + SettingsResourceWithStreamingResponse, + AsyncSettingsResourceWithStreamingResponse, +) +from .interconnects import ( + InterconnectsResource, + AsyncInterconnectsResource, + InterconnectsResourceWithRawResponse, + AsyncInterconnectsResourceWithRawResponse, + InterconnectsResourceWithStreamingResponse, + AsyncInterconnectsResourceWithStreamingResponse, +) +from .network_interconnects import ( + NetworkInterconnectsResource, + AsyncNetworkInterconnectsResource, + NetworkInterconnectsResourceWithRawResponse, + AsyncNetworkInterconnectsResourceWithRawResponse, + NetworkInterconnectsResourceWithStreamingResponse, + AsyncNetworkInterconnectsResourceWithStreamingResponse, +) + +__all__ = [ + "CNIsResource", + "AsyncCNIsResource", + "CNIsResourceWithRawResponse", + "AsyncCNIsResourceWithRawResponse", + "CNIsResourceWithStreamingResponse", + "AsyncCNIsResourceWithStreamingResponse", + "InterconnectsResource", + "AsyncInterconnectsResource", + "InterconnectsResourceWithRawResponse", + "AsyncInterconnectsResourceWithRawResponse", + "InterconnectsResourceWithStreamingResponse", + "AsyncInterconnectsResourceWithStreamingResponse", + "SettingsResource", + "AsyncSettingsResource", + "SettingsResourceWithRawResponse", + "AsyncSettingsResourceWithRawResponse", + "SettingsResourceWithStreamingResponse", + "AsyncSettingsResourceWithStreamingResponse", + "SlotsResource", + "AsyncSlotsResource", + "SlotsResourceWithRawResponse", + "AsyncSlotsResourceWithRawResponse", + "SlotsResourceWithStreamingResponse", + "AsyncSlotsResourceWithStreamingResponse", + "NetworkInterconnectsResource", + "AsyncNetworkInterconnectsResource", + "NetworkInterconnectsResourceWithRawResponse", + "AsyncNetworkInterconnectsResourceWithRawResponse", + "NetworkInterconnectsResourceWithStreamingResponse", + "AsyncNetworkInterconnectsResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/network_interconnects/cnis.py b/src/cloudflare/resources/network_interconnects/cnis.py new file mode 100644 index 00000000000..caedf79314b --- /dev/null +++ b/src/cloudflare/resources/network_interconnects/cnis.py @@ -0,0 +1,645 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.network_interconnects import cni_list_params, cni_create_params, cni_update_params +from ...types.network_interconnects.cni_get_response import CNIGetResponse +from ...types.network_interconnects.cni_list_response import CNIListResponse +from ...types.network_interconnects.cni_create_response import CNICreateResponse +from ...types.network_interconnects.cni_update_response import CNIUpdateResponse + +__all__ = ["CNIsResource", "AsyncCNIsResource"] + + +class CNIsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> CNIsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return CNIsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> CNIsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return CNIsResourceWithStreamingResponse(self) + + def create( + self, + *, + account_id: str, + account: str, + interconnect: str, + magic: cni_create_params.Magic, + bgp: cni_create_params.BGP | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CNICreateResponse: + """ + Create a new CNI object + + Args: + account_id: Customer account tag + + account: Customer account tag + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._post( + f"/accounts/{account_id}/cni/cnis", + body=maybe_transform( + { + "account": account, + "interconnect": interconnect, + "magic": magic, + "bgp": bgp, + }, + cni_create_params.CNICreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CNICreateResponse, + ) + + def update( + self, + cni: str, + *, + account_id: str, + id: str, + account: str, + cust_ip: str, + interconnect: str, + magic: cni_update_params.Magic, + p2p_ip: str, + bgp: cni_update_params.BGP | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CNIUpdateResponse: + """ + Modify stored information about a CNI object + + Args: + account_id: Customer account tag + + account: Customer account tag + + cust_ip: Customer end of the point-to-point link + + This should always be inside the same prefix as `p2p_ip`. + + interconnect: Interconnect identifier hosting this CNI + + p2p_ip: Cloudflare end of the point-to-point link + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not cni: + raise ValueError(f"Expected a non-empty value for `cni` but received {cni!r}") + return self._put( + f"/accounts/{account_id}/cni/cnis/{cni}", + body=maybe_transform( + { + "id": id, + "account": account, + "cust_ip": cust_ip, + "interconnect": interconnect, + "magic": magic, + "p2p_ip": p2p_ip, + "bgp": bgp, + }, + cni_update_params.CNIUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CNIUpdateResponse, + ) + + def list( + self, + *, + account_id: str, + cursor: Optional[int] | NotGiven = NOT_GIVEN, + limit: Optional[int] | NotGiven = NOT_GIVEN, + slot: Optional[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CNIListResponse: + """ + List existing CNI objects + + Args: + account_id: Customer account tag + + slot: If specified, only show CNIs associated with the specified slot + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get( + f"/accounts/{account_id}/cni/cnis", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "cursor": cursor, + "limit": limit, + "slot": slot, + }, + cni_list_params.CNIListParams, + ), + ), + cast_to=CNIListResponse, + ) + + def delete( + self, + cni: str, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> None: + """ + Delete a specified CNI object + + Args: + account_id: Customer account tag + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not cni: + raise ValueError(f"Expected a non-empty value for `cni` but received {cni!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return self._delete( + f"/accounts/{account_id}/cni/cnis/{cni}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NoneType, + ) + + def get( + self, + cni: str, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CNIGetResponse: + """ + Get information about a CNI object + + Args: + account_id: Customer account tag + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not cni: + raise ValueError(f"Expected a non-empty value for `cni` but received {cni!r}") + return self._get( + f"/accounts/{account_id}/cni/cnis/{cni}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CNIGetResponse, + ) + + +class AsyncCNIsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncCNIsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncCNIsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncCNIsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncCNIsResourceWithStreamingResponse(self) + + async def create( + self, + *, + account_id: str, + account: str, + interconnect: str, + magic: cni_create_params.Magic, + bgp: cni_create_params.BGP | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CNICreateResponse: + """ + Create a new CNI object + + Args: + account_id: Customer account tag + + account: Customer account tag + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return await self._post( + f"/accounts/{account_id}/cni/cnis", + body=await async_maybe_transform( + { + "account": account, + "interconnect": interconnect, + "magic": magic, + "bgp": bgp, + }, + cni_create_params.CNICreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CNICreateResponse, + ) + + async def update( + self, + cni: str, + *, + account_id: str, + id: str, + account: str, + cust_ip: str, + interconnect: str, + magic: cni_update_params.Magic, + p2p_ip: str, + bgp: cni_update_params.BGP | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CNIUpdateResponse: + """ + Modify stored information about a CNI object + + Args: + account_id: Customer account tag + + account: Customer account tag + + cust_ip: Customer end of the point-to-point link + + This should always be inside the same prefix as `p2p_ip`. + + interconnect: Interconnect identifier hosting this CNI + + p2p_ip: Cloudflare end of the point-to-point link + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not cni: + raise ValueError(f"Expected a non-empty value for `cni` but received {cni!r}") + return await self._put( + f"/accounts/{account_id}/cni/cnis/{cni}", + body=await async_maybe_transform( + { + "id": id, + "account": account, + "cust_ip": cust_ip, + "interconnect": interconnect, + "magic": magic, + "p2p_ip": p2p_ip, + "bgp": bgp, + }, + cni_update_params.CNIUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CNIUpdateResponse, + ) + + async def list( + self, + *, + account_id: str, + cursor: Optional[int] | NotGiven = NOT_GIVEN, + limit: Optional[int] | NotGiven = NOT_GIVEN, + slot: Optional[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CNIListResponse: + """ + List existing CNI objects + + Args: + account_id: Customer account tag + + slot: If specified, only show CNIs associated with the specified slot + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return await self._get( + f"/accounts/{account_id}/cni/cnis", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "cursor": cursor, + "limit": limit, + "slot": slot, + }, + cni_list_params.CNIListParams, + ), + ), + cast_to=CNIListResponse, + ) + + async def delete( + self, + cni: str, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> None: + """ + Delete a specified CNI object + + Args: + account_id: Customer account tag + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not cni: + raise ValueError(f"Expected a non-empty value for `cni` but received {cni!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return await self._delete( + f"/accounts/{account_id}/cni/cnis/{cni}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NoneType, + ) + + async def get( + self, + cni: str, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CNIGetResponse: + """ + Get information about a CNI object + + Args: + account_id: Customer account tag + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not cni: + raise ValueError(f"Expected a non-empty value for `cni` but received {cni!r}") + return await self._get( + f"/accounts/{account_id}/cni/cnis/{cni}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CNIGetResponse, + ) + + +class CNIsResourceWithRawResponse: + def __init__(self, cnis: CNIsResource) -> None: + self._cnis = cnis + + self.create = to_raw_response_wrapper( + cnis.create, + ) + self.update = to_raw_response_wrapper( + cnis.update, + ) + self.list = to_raw_response_wrapper( + cnis.list, + ) + self.delete = to_raw_response_wrapper( + cnis.delete, + ) + self.get = to_raw_response_wrapper( + cnis.get, + ) + + +class AsyncCNIsResourceWithRawResponse: + def __init__(self, cnis: AsyncCNIsResource) -> None: + self._cnis = cnis + + self.create = async_to_raw_response_wrapper( + cnis.create, + ) + self.update = async_to_raw_response_wrapper( + cnis.update, + ) + self.list = async_to_raw_response_wrapper( + cnis.list, + ) + self.delete = async_to_raw_response_wrapper( + cnis.delete, + ) + self.get = async_to_raw_response_wrapper( + cnis.get, + ) + + +class CNIsResourceWithStreamingResponse: + def __init__(self, cnis: CNIsResource) -> None: + self._cnis = cnis + + self.create = to_streamed_response_wrapper( + cnis.create, + ) + self.update = to_streamed_response_wrapper( + cnis.update, + ) + self.list = to_streamed_response_wrapper( + cnis.list, + ) + self.delete = to_streamed_response_wrapper( + cnis.delete, + ) + self.get = to_streamed_response_wrapper( + cnis.get, + ) + + +class AsyncCNIsResourceWithStreamingResponse: + def __init__(self, cnis: AsyncCNIsResource) -> None: + self._cnis = cnis + + self.create = async_to_streamed_response_wrapper( + cnis.create, + ) + self.update = async_to_streamed_response_wrapper( + cnis.update, + ) + self.list = async_to_streamed_response_wrapper( + cnis.list, + ) + self.delete = async_to_streamed_response_wrapper( + cnis.delete, + ) + self.get = async_to_streamed_response_wrapper( + cnis.get, + ) diff --git a/src/cloudflare/resources/network_interconnects/interconnects.py b/src/cloudflare/resources/network_interconnects/interconnects.py new file mode 100644 index 00000000000..7a7fc659b2c --- /dev/null +++ b/src/cloudflare/resources/network_interconnects/interconnects.py @@ -0,0 +1,837 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Any, Optional, cast +from typing_extensions import Literal, overload + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ..._utils import ( + required_args, + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.network_interconnects import interconnect_list_params, interconnect_create_params +from ...types.network_interconnects.interconnect_get_response import InterconnectGetResponse +from ...types.network_interconnects.interconnect_list_response import InterconnectListResponse +from ...types.network_interconnects.interconnect_create_response import InterconnectCreateResponse +from ...types.network_interconnects.interconnect_status_response import InterconnectStatusResponse + +__all__ = ["InterconnectsResource", "AsyncInterconnectsResource"] + + +class InterconnectsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> InterconnectsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return InterconnectsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> InterconnectsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return InterconnectsResourceWithStreamingResponse(self) + + @overload + def create( + self, + *, + account_id: str, + account: str, + slot_id: str, + type: str, + speed: Optional[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> InterconnectCreateResponse: + """ + Create a new interconnect + + Args: + account_id: Customer account tag + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def create( + self, + *, + account_id: str, + account: str, + bandwidth: Literal["50M", "100M", "200M", "300M", "400M", "500M", "1G", "2G", "5G", "10G", "20G", "50G"], + pairing_key: str, + type: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> InterconnectCreateResponse: + """ + Create a new interconnect + + Args: + account_id: Customer account tag + + bandwidth: Bandwidth structure as visible through the customer-facing API. + + pairing_key: Pairing key provided by GCP + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args( + ["account_id", "account", "slot_id", "type"], ["account_id", "account", "bandwidth", "pairing_key", "type"] + ) + def create( + self, + *, + account_id: str, + account: str, + slot_id: str | NotGiven = NOT_GIVEN, + type: str, + speed: Optional[str] | NotGiven = NOT_GIVEN, + bandwidth: Literal["50M", "100M", "200M", "300M", "400M", "500M", "1G", "2G", "5G", "10G", "20G", "50G"] + | NotGiven = NOT_GIVEN, + pairing_key: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> InterconnectCreateResponse: + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return cast( + InterconnectCreateResponse, + self._post( + f"/accounts/{account_id}/cni/interconnects", + body=maybe_transform( + { + "account": account, + "slot_id": slot_id, + "type": type, + "speed": speed, + "bandwidth": bandwidth, + "pairing_key": pairing_key, + }, + interconnect_create_params.InterconnectCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=cast( + Any, InterconnectCreateResponse + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + def list( + self, + *, + account_id: str, + cursor: Optional[int] | NotGiven = NOT_GIVEN, + limit: Optional[int] | NotGiven = NOT_GIVEN, + site: Optional[str] | NotGiven = NOT_GIVEN, + type: Optional[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> InterconnectListResponse: + """ + List existing interconnects + + Args: + account_id: Customer account tag + + site: If specified, only show interconnects located at the given site + + type: If specified, only show interconnects of the given type + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get( + f"/accounts/{account_id}/cni/interconnects", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "cursor": cursor, + "limit": limit, + "site": site, + "type": type, + }, + interconnect_list_params.InterconnectListParams, + ), + ), + cast_to=InterconnectListResponse, + ) + + def delete( + self, + icon: str, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> None: + """ + Delete an interconnect object + + Args: + account_id: Customer account tag + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not icon: + raise ValueError(f"Expected a non-empty value for `icon` but received {icon!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return self._delete( + f"/accounts/{account_id}/cni/interconnects/{icon}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NoneType, + ) + + def get( + self, + icon: str, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> InterconnectGetResponse: + """ + Get information about an interconnect object + + Args: + account_id: Customer account tag + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not icon: + raise ValueError(f"Expected a non-empty value for `icon` but received {icon!r}") + return cast( + InterconnectGetResponse, + self._get( + f"/accounts/{account_id}/cni/interconnects/{icon}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=cast( + Any, InterconnectGetResponse + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + def loa( + self, + icon: str, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> None: + """ + Generate the Letter of Authorization (LOA) for a given interconnect + + Args: + account_id: Customer account tag + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not icon: + raise ValueError(f"Expected a non-empty value for `icon` but received {icon!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return self._get( + f"/accounts/{account_id}/cni/interconnects/{icon}/loa", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NoneType, + ) + + def status( + self, + icon: str, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> InterconnectStatusResponse: + """ + Get the current status of an interconnect object + + Args: + account_id: Customer account tag + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not icon: + raise ValueError(f"Expected a non-empty value for `icon` but received {icon!r}") + return cast( + InterconnectStatusResponse, + self._get( + f"/accounts/{account_id}/cni/interconnects/{icon}/status", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=cast( + Any, InterconnectStatusResponse + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + +class AsyncInterconnectsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncInterconnectsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncInterconnectsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncInterconnectsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncInterconnectsResourceWithStreamingResponse(self) + + @overload + async def create( + self, + *, + account_id: str, + account: str, + slot_id: str, + type: str, + speed: Optional[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> InterconnectCreateResponse: + """ + Create a new interconnect + + Args: + account_id: Customer account tag + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def create( + self, + *, + account_id: str, + account: str, + bandwidth: Literal["50M", "100M", "200M", "300M", "400M", "500M", "1G", "2G", "5G", "10G", "20G", "50G"], + pairing_key: str, + type: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> InterconnectCreateResponse: + """ + Create a new interconnect + + Args: + account_id: Customer account tag + + bandwidth: Bandwidth structure as visible through the customer-facing API. + + pairing_key: Pairing key provided by GCP + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args( + ["account_id", "account", "slot_id", "type"], ["account_id", "account", "bandwidth", "pairing_key", "type"] + ) + async def create( + self, + *, + account_id: str, + account: str, + slot_id: str | NotGiven = NOT_GIVEN, + type: str, + speed: Optional[str] | NotGiven = NOT_GIVEN, + bandwidth: Literal["50M", "100M", "200M", "300M", "400M", "500M", "1G", "2G", "5G", "10G", "20G", "50G"] + | NotGiven = NOT_GIVEN, + pairing_key: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> InterconnectCreateResponse: + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return cast( + InterconnectCreateResponse, + await self._post( + f"/accounts/{account_id}/cni/interconnects", + body=await async_maybe_transform( + { + "account": account, + "slot_id": slot_id, + "type": type, + "speed": speed, + "bandwidth": bandwidth, + "pairing_key": pairing_key, + }, + interconnect_create_params.InterconnectCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=cast( + Any, InterconnectCreateResponse + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + async def list( + self, + *, + account_id: str, + cursor: Optional[int] | NotGiven = NOT_GIVEN, + limit: Optional[int] | NotGiven = NOT_GIVEN, + site: Optional[str] | NotGiven = NOT_GIVEN, + type: Optional[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> InterconnectListResponse: + """ + List existing interconnects + + Args: + account_id: Customer account tag + + site: If specified, only show interconnects located at the given site + + type: If specified, only show interconnects of the given type + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return await self._get( + f"/accounts/{account_id}/cni/interconnects", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "cursor": cursor, + "limit": limit, + "site": site, + "type": type, + }, + interconnect_list_params.InterconnectListParams, + ), + ), + cast_to=InterconnectListResponse, + ) + + async def delete( + self, + icon: str, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> None: + """ + Delete an interconnect object + + Args: + account_id: Customer account tag + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not icon: + raise ValueError(f"Expected a non-empty value for `icon` but received {icon!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return await self._delete( + f"/accounts/{account_id}/cni/interconnects/{icon}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NoneType, + ) + + async def get( + self, + icon: str, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> InterconnectGetResponse: + """ + Get information about an interconnect object + + Args: + account_id: Customer account tag + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not icon: + raise ValueError(f"Expected a non-empty value for `icon` but received {icon!r}") + return cast( + InterconnectGetResponse, + await self._get( + f"/accounts/{account_id}/cni/interconnects/{icon}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=cast( + Any, InterconnectGetResponse + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + async def loa( + self, + icon: str, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> None: + """ + Generate the Letter of Authorization (LOA) for a given interconnect + + Args: + account_id: Customer account tag + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not icon: + raise ValueError(f"Expected a non-empty value for `icon` but received {icon!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return await self._get( + f"/accounts/{account_id}/cni/interconnects/{icon}/loa", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NoneType, + ) + + async def status( + self, + icon: str, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> InterconnectStatusResponse: + """ + Get the current status of an interconnect object + + Args: + account_id: Customer account tag + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not icon: + raise ValueError(f"Expected a non-empty value for `icon` but received {icon!r}") + return cast( + InterconnectStatusResponse, + await self._get( + f"/accounts/{account_id}/cni/interconnects/{icon}/status", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=cast( + Any, InterconnectStatusResponse + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + +class InterconnectsResourceWithRawResponse: + def __init__(self, interconnects: InterconnectsResource) -> None: + self._interconnects = interconnects + + self.create = to_raw_response_wrapper( + interconnects.create, + ) + self.list = to_raw_response_wrapper( + interconnects.list, + ) + self.delete = to_raw_response_wrapper( + interconnects.delete, + ) + self.get = to_raw_response_wrapper( + interconnects.get, + ) + self.loa = to_raw_response_wrapper( + interconnects.loa, + ) + self.status = to_raw_response_wrapper( + interconnects.status, + ) + + +class AsyncInterconnectsResourceWithRawResponse: + def __init__(self, interconnects: AsyncInterconnectsResource) -> None: + self._interconnects = interconnects + + self.create = async_to_raw_response_wrapper( + interconnects.create, + ) + self.list = async_to_raw_response_wrapper( + interconnects.list, + ) + self.delete = async_to_raw_response_wrapper( + interconnects.delete, + ) + self.get = async_to_raw_response_wrapper( + interconnects.get, + ) + self.loa = async_to_raw_response_wrapper( + interconnects.loa, + ) + self.status = async_to_raw_response_wrapper( + interconnects.status, + ) + + +class InterconnectsResourceWithStreamingResponse: + def __init__(self, interconnects: InterconnectsResource) -> None: + self._interconnects = interconnects + + self.create = to_streamed_response_wrapper( + interconnects.create, + ) + self.list = to_streamed_response_wrapper( + interconnects.list, + ) + self.delete = to_streamed_response_wrapper( + interconnects.delete, + ) + self.get = to_streamed_response_wrapper( + interconnects.get, + ) + self.loa = to_streamed_response_wrapper( + interconnects.loa, + ) + self.status = to_streamed_response_wrapper( + interconnects.status, + ) + + +class AsyncInterconnectsResourceWithStreamingResponse: + def __init__(self, interconnects: AsyncInterconnectsResource) -> None: + self._interconnects = interconnects + + self.create = async_to_streamed_response_wrapper( + interconnects.create, + ) + self.list = async_to_streamed_response_wrapper( + interconnects.list, + ) + self.delete = async_to_streamed_response_wrapper( + interconnects.delete, + ) + self.get = async_to_streamed_response_wrapper( + interconnects.get, + ) + self.loa = async_to_streamed_response_wrapper( + interconnects.loa, + ) + self.status = async_to_streamed_response_wrapper( + interconnects.status, + ) diff --git a/src/cloudflare/resources/network_interconnects/network_interconnects.py b/src/cloudflare/resources/network_interconnects/network_interconnects.py new file mode 100644 index 00000000000..3f8d44d1161 --- /dev/null +++ b/src/cloudflare/resources/network_interconnects/network_interconnects.py @@ -0,0 +1,198 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .cnis import ( + CNIsResource, + AsyncCNIsResource, + CNIsResourceWithRawResponse, + AsyncCNIsResourceWithRawResponse, + CNIsResourceWithStreamingResponse, + AsyncCNIsResourceWithStreamingResponse, +) +from .slots import ( + SlotsResource, + AsyncSlotsResource, + SlotsResourceWithRawResponse, + AsyncSlotsResourceWithRawResponse, + SlotsResourceWithStreamingResponse, + AsyncSlotsResourceWithStreamingResponse, +) +from .settings import ( + SettingsResource, + AsyncSettingsResource, + SettingsResourceWithRawResponse, + AsyncSettingsResourceWithRawResponse, + SettingsResourceWithStreamingResponse, + AsyncSettingsResourceWithStreamingResponse, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from .interconnects import ( + InterconnectsResource, + AsyncInterconnectsResource, + InterconnectsResourceWithRawResponse, + AsyncInterconnectsResourceWithRawResponse, + InterconnectsResourceWithStreamingResponse, + AsyncInterconnectsResourceWithStreamingResponse, +) + +__all__ = ["NetworkInterconnectsResource", "AsyncNetworkInterconnectsResource"] + + +class NetworkInterconnectsResource(SyncAPIResource): + @cached_property + def cnis(self) -> CNIsResource: + return CNIsResource(self._client) + + @cached_property + def interconnects(self) -> InterconnectsResource: + return InterconnectsResource(self._client) + + @cached_property + def settings(self) -> SettingsResource: + return SettingsResource(self._client) + + @cached_property + def slots(self) -> SlotsResource: + return SlotsResource(self._client) + + @cached_property + def with_raw_response(self) -> NetworkInterconnectsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return NetworkInterconnectsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> NetworkInterconnectsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return NetworkInterconnectsResourceWithStreamingResponse(self) + + +class AsyncNetworkInterconnectsResource(AsyncAPIResource): + @cached_property + def cnis(self) -> AsyncCNIsResource: + return AsyncCNIsResource(self._client) + + @cached_property + def interconnects(self) -> AsyncInterconnectsResource: + return AsyncInterconnectsResource(self._client) + + @cached_property + def settings(self) -> AsyncSettingsResource: + return AsyncSettingsResource(self._client) + + @cached_property + def slots(self) -> AsyncSlotsResource: + return AsyncSlotsResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncNetworkInterconnectsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncNetworkInterconnectsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncNetworkInterconnectsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncNetworkInterconnectsResourceWithStreamingResponse(self) + + +class NetworkInterconnectsResourceWithRawResponse: + def __init__(self, network_interconnects: NetworkInterconnectsResource) -> None: + self._network_interconnects = network_interconnects + + @cached_property + def cnis(self) -> CNIsResourceWithRawResponse: + return CNIsResourceWithRawResponse(self._network_interconnects.cnis) + + @cached_property + def interconnects(self) -> InterconnectsResourceWithRawResponse: + return InterconnectsResourceWithRawResponse(self._network_interconnects.interconnects) + + @cached_property + def settings(self) -> SettingsResourceWithRawResponse: + return SettingsResourceWithRawResponse(self._network_interconnects.settings) + + @cached_property + def slots(self) -> SlotsResourceWithRawResponse: + return SlotsResourceWithRawResponse(self._network_interconnects.slots) + + +class AsyncNetworkInterconnectsResourceWithRawResponse: + def __init__(self, network_interconnects: AsyncNetworkInterconnectsResource) -> None: + self._network_interconnects = network_interconnects + + @cached_property + def cnis(self) -> AsyncCNIsResourceWithRawResponse: + return AsyncCNIsResourceWithRawResponse(self._network_interconnects.cnis) + + @cached_property + def interconnects(self) -> AsyncInterconnectsResourceWithRawResponse: + return AsyncInterconnectsResourceWithRawResponse(self._network_interconnects.interconnects) + + @cached_property + def settings(self) -> AsyncSettingsResourceWithRawResponse: + return AsyncSettingsResourceWithRawResponse(self._network_interconnects.settings) + + @cached_property + def slots(self) -> AsyncSlotsResourceWithRawResponse: + return AsyncSlotsResourceWithRawResponse(self._network_interconnects.slots) + + +class NetworkInterconnectsResourceWithStreamingResponse: + def __init__(self, network_interconnects: NetworkInterconnectsResource) -> None: + self._network_interconnects = network_interconnects + + @cached_property + def cnis(self) -> CNIsResourceWithStreamingResponse: + return CNIsResourceWithStreamingResponse(self._network_interconnects.cnis) + + @cached_property + def interconnects(self) -> InterconnectsResourceWithStreamingResponse: + return InterconnectsResourceWithStreamingResponse(self._network_interconnects.interconnects) + + @cached_property + def settings(self) -> SettingsResourceWithStreamingResponse: + return SettingsResourceWithStreamingResponse(self._network_interconnects.settings) + + @cached_property + def slots(self) -> SlotsResourceWithStreamingResponse: + return SlotsResourceWithStreamingResponse(self._network_interconnects.slots) + + +class AsyncNetworkInterconnectsResourceWithStreamingResponse: + def __init__(self, network_interconnects: AsyncNetworkInterconnectsResource) -> None: + self._network_interconnects = network_interconnects + + @cached_property + def cnis(self) -> AsyncCNIsResourceWithStreamingResponse: + return AsyncCNIsResourceWithStreamingResponse(self._network_interconnects.cnis) + + @cached_property + def interconnects(self) -> AsyncInterconnectsResourceWithStreamingResponse: + return AsyncInterconnectsResourceWithStreamingResponse(self._network_interconnects.interconnects) + + @cached_property + def settings(self) -> AsyncSettingsResourceWithStreamingResponse: + return AsyncSettingsResourceWithStreamingResponse(self._network_interconnects.settings) + + @cached_property + def slots(self) -> AsyncSlotsResourceWithStreamingResponse: + return AsyncSlotsResourceWithStreamingResponse(self._network_interconnects.slots) diff --git a/src/cloudflare/resources/network_interconnects/settings.py b/src/cloudflare/resources/network_interconnects/settings.py new file mode 100644 index 00000000000..015535d9216 --- /dev/null +++ b/src/cloudflare/resources/network_interconnects/settings.py @@ -0,0 +1,253 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.network_interconnects import setting_update_params +from ...types.network_interconnects.setting_get_response import SettingGetResponse +from ...types.network_interconnects.setting_update_response import SettingUpdateResponse + +__all__ = ["SettingsResource", "AsyncSettingsResource"] + + +class SettingsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> SettingsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return SettingsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> SettingsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return SettingsResourceWithStreamingResponse(self) + + def update( + self, + *, + account_id: str, + default_asn: Optional[int] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SettingUpdateResponse: + """ + Update the current settings for the active account + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._put( + f"/accounts/{account_id}/cni/settings", + body=maybe_transform({"default_asn": default_asn}, setting_update_params.SettingUpdateParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SettingUpdateResponse, + ) + + def get( + self, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SettingGetResponse: + """ + Get the current settings for the active account + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get( + f"/accounts/{account_id}/cni/settings", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SettingGetResponse, + ) + + +class AsyncSettingsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncSettingsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncSettingsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncSettingsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncSettingsResourceWithStreamingResponse(self) + + async def update( + self, + *, + account_id: str, + default_asn: Optional[int] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SettingUpdateResponse: + """ + Update the current settings for the active account + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return await self._put( + f"/accounts/{account_id}/cni/settings", + body=await async_maybe_transform({"default_asn": default_asn}, setting_update_params.SettingUpdateParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SettingUpdateResponse, + ) + + async def get( + self, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SettingGetResponse: + """ + Get the current settings for the active account + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return await self._get( + f"/accounts/{account_id}/cni/settings", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SettingGetResponse, + ) + + +class SettingsResourceWithRawResponse: + def __init__(self, settings: SettingsResource) -> None: + self._settings = settings + + self.update = to_raw_response_wrapper( + settings.update, + ) + self.get = to_raw_response_wrapper( + settings.get, + ) + + +class AsyncSettingsResourceWithRawResponse: + def __init__(self, settings: AsyncSettingsResource) -> None: + self._settings = settings + + self.update = async_to_raw_response_wrapper( + settings.update, + ) + self.get = async_to_raw_response_wrapper( + settings.get, + ) + + +class SettingsResourceWithStreamingResponse: + def __init__(self, settings: SettingsResource) -> None: + self._settings = settings + + self.update = to_streamed_response_wrapper( + settings.update, + ) + self.get = to_streamed_response_wrapper( + settings.get, + ) + + +class AsyncSettingsResourceWithStreamingResponse: + def __init__(self, settings: AsyncSettingsResource) -> None: + self._settings = settings + + self.update = async_to_streamed_response_wrapper( + settings.update, + ) + self.get = async_to_streamed_response_wrapper( + settings.get, + ) diff --git a/src/cloudflare/resources/network_interconnects/slots.py b/src/cloudflare/resources/network_interconnects/slots.py new file mode 100644 index 00000000000..0c9a1801f0a --- /dev/null +++ b/src/cloudflare/resources/network_interconnects/slots.py @@ -0,0 +1,319 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.network_interconnects import slot_list_params +from ...types.network_interconnects.slot_get_response import SlotGetResponse +from ...types.network_interconnects.slot_list_response import SlotListResponse + +__all__ = ["SlotsResource", "AsyncSlotsResource"] + + +class SlotsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> SlotsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return SlotsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> SlotsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return SlotsResourceWithStreamingResponse(self) + + def list( + self, + *, + account_id: str, + address_contains: Optional[str] | NotGiven = NOT_GIVEN, + cursor: Optional[int] | NotGiven = NOT_GIVEN, + limit: Optional[int] | NotGiven = NOT_GIVEN, + occupied: Optional[bool] | NotGiven = NOT_GIVEN, + site: Optional[str] | NotGiven = NOT_GIVEN, + speed: Optional[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SlotListResponse: + """ + Retrieve a list of all slots matching the specified parameters + + Args: + account_id: Customer account tag + + address_contains: If specified, only show slots with the given text in their address field + + occupied: If specified, only show slots with a specific occupied/unoccupied state + + site: If specified, only show slots located at the given site + + speed: If specified, only show slots that support the given speed + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get( + f"/accounts/{account_id}/cni/slots", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "address_contains": address_contains, + "cursor": cursor, + "limit": limit, + "occupied": occupied, + "site": site, + "speed": speed, + }, + slot_list_params.SlotListParams, + ), + ), + cast_to=SlotListResponse, + ) + + def get( + self, + slot: str, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SlotGetResponse: + """ + Get information about the specified slot + + Args: + account_id: Customer account tag + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not slot: + raise ValueError(f"Expected a non-empty value for `slot` but received {slot!r}") + return self._get( + f"/accounts/{account_id}/cni/slots/{slot}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SlotGetResponse, + ) + + +class AsyncSlotsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncSlotsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncSlotsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncSlotsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncSlotsResourceWithStreamingResponse(self) + + async def list( + self, + *, + account_id: str, + address_contains: Optional[str] | NotGiven = NOT_GIVEN, + cursor: Optional[int] | NotGiven = NOT_GIVEN, + limit: Optional[int] | NotGiven = NOT_GIVEN, + occupied: Optional[bool] | NotGiven = NOT_GIVEN, + site: Optional[str] | NotGiven = NOT_GIVEN, + speed: Optional[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SlotListResponse: + """ + Retrieve a list of all slots matching the specified parameters + + Args: + account_id: Customer account tag + + address_contains: If specified, only show slots with the given text in their address field + + occupied: If specified, only show slots with a specific occupied/unoccupied state + + site: If specified, only show slots located at the given site + + speed: If specified, only show slots that support the given speed + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return await self._get( + f"/accounts/{account_id}/cni/slots", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "address_contains": address_contains, + "cursor": cursor, + "limit": limit, + "occupied": occupied, + "site": site, + "speed": speed, + }, + slot_list_params.SlotListParams, + ), + ), + cast_to=SlotListResponse, + ) + + async def get( + self, + slot: str, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SlotGetResponse: + """ + Get information about the specified slot + + Args: + account_id: Customer account tag + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not slot: + raise ValueError(f"Expected a non-empty value for `slot` but received {slot!r}") + return await self._get( + f"/accounts/{account_id}/cni/slots/{slot}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SlotGetResponse, + ) + + +class SlotsResourceWithRawResponse: + def __init__(self, slots: SlotsResource) -> None: + self._slots = slots + + self.list = to_raw_response_wrapper( + slots.list, + ) + self.get = to_raw_response_wrapper( + slots.get, + ) + + +class AsyncSlotsResourceWithRawResponse: + def __init__(self, slots: AsyncSlotsResource) -> None: + self._slots = slots + + self.list = async_to_raw_response_wrapper( + slots.list, + ) + self.get = async_to_raw_response_wrapper( + slots.get, + ) + + +class SlotsResourceWithStreamingResponse: + def __init__(self, slots: SlotsResource) -> None: + self._slots = slots + + self.list = to_streamed_response_wrapper( + slots.list, + ) + self.get = to_streamed_response_wrapper( + slots.get, + ) + + +class AsyncSlotsResourceWithStreamingResponse: + def __init__(self, slots: AsyncSlotsResource) -> None: + self._slots = slots + + self.list = async_to_streamed_response_wrapper( + slots.list, + ) + self.get = async_to_streamed_response_wrapper( + slots.get, + ) diff --git a/src/cloudflare/types/network_interconnects/__init__.py b/src/cloudflare/types/network_interconnects/__init__.py new file mode 100644 index 00000000000..e11165f0e11 --- /dev/null +++ b/src/cloudflare/types/network_interconnects/__init__.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .cni_list_params import CNIListParams as CNIListParams +from .cni_get_response import CNIGetResponse as CNIGetResponse +from .slot_list_params import SlotListParams as SlotListParams +from .cni_create_params import CNICreateParams as CNICreateParams +from .cni_list_response import CNIListResponse as CNIListResponse +from .cni_update_params import CNIUpdateParams as CNIUpdateParams +from .slot_get_response import SlotGetResponse as SlotGetResponse +from .slot_list_response import SlotListResponse as SlotListResponse +from .cni_create_response import CNICreateResponse as CNICreateResponse +from .cni_update_response import CNIUpdateResponse as CNIUpdateResponse +from .setting_get_response import SettingGetResponse as SettingGetResponse +from .setting_update_params import SettingUpdateParams as SettingUpdateParams +from .setting_update_response import SettingUpdateResponse as SettingUpdateResponse +from .interconnect_list_params import InterconnectListParams as InterconnectListParams +from .interconnect_get_response import InterconnectGetResponse as InterconnectGetResponse +from .interconnect_create_params import InterconnectCreateParams as InterconnectCreateParams +from .interconnect_list_response import InterconnectListResponse as InterconnectListResponse +from .interconnect_create_response import InterconnectCreateResponse as InterconnectCreateResponse +from .interconnect_status_response import InterconnectStatusResponse as InterconnectStatusResponse diff --git a/src/cloudflare/types/network_interconnects/cni_create_params.py b/src/cloudflare/types/network_interconnects/cni_create_params.py new file mode 100644 index 00000000000..3ee5f246e0e --- /dev/null +++ b/src/cloudflare/types/network_interconnects/cni_create_params.py @@ -0,0 +1,59 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional +from typing_extensions import Required, TypedDict + +__all__ = ["CNICreateParams", "Magic", "BGP"] + + +class CNICreateParams(TypedDict, total=False): + account_id: Required[str] + """Customer account tag""" + + account: Required[str] + """Customer account tag""" + + interconnect: Required[str] + + magic: Required[Magic] + + bgp: BGP + + +class Magic(TypedDict, total=False): + conduit_name: Required[str] + + description: Required[str] + + mtu: Required[int] + + +class BGP(TypedDict, total=False): + customer_asn: Required[int] + """ASN used on the customer end of the BGP session""" + + extra_prefixes: Required[List[str]] + """Extra set of static prefixes to advertise to the customer's end of the session""" + + md5_key: Optional[str] + """MD5 key to use for session authentication. + + Note that _this is not a security measure_. MD5 is not a valid security + mechanism, and the key is not treated as a secret value. This is _only_ + supported for preventing misconfiguration, not for defending against malicious + attacks. + + The MD5 key, if set, must be of non-zero length and consist only of the + following types of character: + + - ASCII alphanumerics: `[a-zA-Z0-9]` + - Special characters in the set `'!@#$%^&*()+[]{}<>/.,;:_-~`= \\||` + + In other words, MD5 keys may contain any printable ASCII character aside from + newline (0x0A), quotation mark (`"`), vertical tab (0x0B), carriage return + (0x0D), tab (0x09), form feed (0x0C), and the question mark (`?`). Requests + specifying an MD5 key with one or more of these disallowed characters will be + rejected. + """ diff --git a/src/cloudflare/types/network_interconnects/cni_create_response.py b/src/cloudflare/types/network_interconnects/cni_create_response.py new file mode 100644 index 00000000000..308e1c6ba7e --- /dev/null +++ b/src/cloudflare/types/network_interconnects/cni_create_response.py @@ -0,0 +1,67 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["CNICreateResponse", "Magic", "BGP"] + + +class Magic(BaseModel): + conduit_name: str + + description: str + + mtu: int + + +class BGP(BaseModel): + customer_asn: int + """ASN used on the customer end of the BGP session""" + + extra_prefixes: List[str] + """Extra set of static prefixes to advertise to the customer's end of the session""" + + md5_key: Optional[str] = None + """MD5 key to use for session authentication. + + Note that _this is not a security measure_. MD5 is not a valid security + mechanism, and the key is not treated as a secret value. This is _only_ + supported for preventing misconfiguration, not for defending against malicious + attacks. + + The MD5 key, if set, must be of non-zero length and consist only of the + following types of character: + + - ASCII alphanumerics: `[a-zA-Z0-9]` + - Special characters in the set `'!@#$%^&*()+[]{}<>/.,;:_-~`= \\||` + + In other words, MD5 keys may contain any printable ASCII character aside from + newline (0x0A), quotation mark (`"`), vertical tab (0x0B), carriage return + (0x0D), tab (0x09), form feed (0x0C), and the question mark (`?`). Requests + specifying an MD5 key with one or more of these disallowed characters will be + rejected. + """ + + +class CNICreateResponse(BaseModel): + id: str + + account: str + """Customer account tag""" + + cust_ip: str + """Customer end of the point-to-point link + + This should always be inside the same prefix as `p2p_ip`. + """ + + interconnect: str + """Interconnect identifier hosting this CNI""" + + magic: Magic + + p2p_ip: str + """Cloudflare end of the point-to-point link""" + + bgp: Optional[BGP] = None diff --git a/src/cloudflare/types/network_interconnects/cni_get_response.py b/src/cloudflare/types/network_interconnects/cni_get_response.py new file mode 100644 index 00000000000..ef4d36fb726 --- /dev/null +++ b/src/cloudflare/types/network_interconnects/cni_get_response.py @@ -0,0 +1,67 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["CNIGetResponse", "Magic", "BGP"] + + +class Magic(BaseModel): + conduit_name: str + + description: str + + mtu: int + + +class BGP(BaseModel): + customer_asn: int + """ASN used on the customer end of the BGP session""" + + extra_prefixes: List[str] + """Extra set of static prefixes to advertise to the customer's end of the session""" + + md5_key: Optional[str] = None + """MD5 key to use for session authentication. + + Note that _this is not a security measure_. MD5 is not a valid security + mechanism, and the key is not treated as a secret value. This is _only_ + supported for preventing misconfiguration, not for defending against malicious + attacks. + + The MD5 key, if set, must be of non-zero length and consist only of the + following types of character: + + - ASCII alphanumerics: `[a-zA-Z0-9]` + - Special characters in the set `'!@#$%^&*()+[]{}<>/.,;:_-~`= \\||` + + In other words, MD5 keys may contain any printable ASCII character aside from + newline (0x0A), quotation mark (`"`), vertical tab (0x0B), carriage return + (0x0D), tab (0x09), form feed (0x0C), and the question mark (`?`). Requests + specifying an MD5 key with one or more of these disallowed characters will be + rejected. + """ + + +class CNIGetResponse(BaseModel): + id: str + + account: str + """Customer account tag""" + + cust_ip: str + """Customer end of the point-to-point link + + This should always be inside the same prefix as `p2p_ip`. + """ + + interconnect: str + """Interconnect identifier hosting this CNI""" + + magic: Magic + + p2p_ip: str + """Cloudflare end of the point-to-point link""" + + bgp: Optional[BGP] = None diff --git a/src/cloudflare/types/network_interconnects/cni_list_params.py b/src/cloudflare/types/network_interconnects/cni_list_params.py new file mode 100644 index 00000000000..9f1efabf277 --- /dev/null +++ b/src/cloudflare/types/network_interconnects/cni_list_params.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, TypedDict + +__all__ = ["CNIListParams"] + + +class CNIListParams(TypedDict, total=False): + account_id: Required[str] + """Customer account tag""" + + cursor: Optional[int] + + limit: Optional[int] + + slot: Optional[str] + """If specified, only show CNIs associated with the specified slot""" diff --git a/src/cloudflare/types/network_interconnects/cni_list_response.py b/src/cloudflare/types/network_interconnects/cni_list_response.py new file mode 100644 index 00000000000..6d40cbc1c40 --- /dev/null +++ b/src/cloudflare/types/network_interconnects/cni_list_response.py @@ -0,0 +1,73 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["CNIListResponse", "Item", "ItemMagic", "ItemBGP"] + + +class ItemMagic(BaseModel): + conduit_name: str + + description: str + + mtu: int + + +class ItemBGP(BaseModel): + customer_asn: int + """ASN used on the customer end of the BGP session""" + + extra_prefixes: List[str] + """Extra set of static prefixes to advertise to the customer's end of the session""" + + md5_key: Optional[str] = None + """MD5 key to use for session authentication. + + Note that _this is not a security measure_. MD5 is not a valid security + mechanism, and the key is not treated as a secret value. This is _only_ + supported for preventing misconfiguration, not for defending against malicious + attacks. + + The MD5 key, if set, must be of non-zero length and consist only of the + following types of character: + + - ASCII alphanumerics: `[a-zA-Z0-9]` + - Special characters in the set `'!@#$%^&*()+[]{}<>/.,;:_-~`= \\||` + + In other words, MD5 keys may contain any printable ASCII character aside from + newline (0x0A), quotation mark (`"`), vertical tab (0x0B), carriage return + (0x0D), tab (0x09), form feed (0x0C), and the question mark (`?`). Requests + specifying an MD5 key with one or more of these disallowed characters will be + rejected. + """ + + +class Item(BaseModel): + id: str + + account: str + """Customer account tag""" + + cust_ip: str + """Customer end of the point-to-point link + + This should always be inside the same prefix as `p2p_ip`. + """ + + interconnect: str + """Interconnect identifier hosting this CNI""" + + magic: ItemMagic + + p2p_ip: str + """Cloudflare end of the point-to-point link""" + + bgp: Optional[ItemBGP] = None + + +class CNIListResponse(BaseModel): + items: List[Item] + + next: Optional[int] = None diff --git a/src/cloudflare/types/network_interconnects/cni_update_params.py b/src/cloudflare/types/network_interconnects/cni_update_params.py new file mode 100644 index 00000000000..274308e3b02 --- /dev/null +++ b/src/cloudflare/types/network_interconnects/cni_update_params.py @@ -0,0 +1,71 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional +from typing_extensions import Required, TypedDict + +__all__ = ["CNIUpdateParams", "Magic", "BGP"] + + +class CNIUpdateParams(TypedDict, total=False): + account_id: Required[str] + """Customer account tag""" + + id: Required[str] + + account: Required[str] + """Customer account tag""" + + cust_ip: Required[str] + """Customer end of the point-to-point link + + This should always be inside the same prefix as `p2p_ip`. + """ + + interconnect: Required[str] + """Interconnect identifier hosting this CNI""" + + magic: Required[Magic] + + p2p_ip: Required[str] + """Cloudflare end of the point-to-point link""" + + bgp: BGP + + +class Magic(TypedDict, total=False): + conduit_name: Required[str] + + description: Required[str] + + mtu: Required[int] + + +class BGP(TypedDict, total=False): + customer_asn: Required[int] + """ASN used on the customer end of the BGP session""" + + extra_prefixes: Required[List[str]] + """Extra set of static prefixes to advertise to the customer's end of the session""" + + md5_key: Optional[str] + """MD5 key to use for session authentication. + + Note that _this is not a security measure_. MD5 is not a valid security + mechanism, and the key is not treated as a secret value. This is _only_ + supported for preventing misconfiguration, not for defending against malicious + attacks. + + The MD5 key, if set, must be of non-zero length and consist only of the + following types of character: + + - ASCII alphanumerics: `[a-zA-Z0-9]` + - Special characters in the set `'!@#$%^&*()+[]{}<>/.,;:_-~`= \\||` + + In other words, MD5 keys may contain any printable ASCII character aside from + newline (0x0A), quotation mark (`"`), vertical tab (0x0B), carriage return + (0x0D), tab (0x09), form feed (0x0C), and the question mark (`?`). Requests + specifying an MD5 key with one or more of these disallowed characters will be + rejected. + """ diff --git a/src/cloudflare/types/network_interconnects/cni_update_response.py b/src/cloudflare/types/network_interconnects/cni_update_response.py new file mode 100644 index 00000000000..e7201af3d68 --- /dev/null +++ b/src/cloudflare/types/network_interconnects/cni_update_response.py @@ -0,0 +1,67 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["CNIUpdateResponse", "Magic", "BGP"] + + +class Magic(BaseModel): + conduit_name: str + + description: str + + mtu: int + + +class BGP(BaseModel): + customer_asn: int + """ASN used on the customer end of the BGP session""" + + extra_prefixes: List[str] + """Extra set of static prefixes to advertise to the customer's end of the session""" + + md5_key: Optional[str] = None + """MD5 key to use for session authentication. + + Note that _this is not a security measure_. MD5 is not a valid security + mechanism, and the key is not treated as a secret value. This is _only_ + supported for preventing misconfiguration, not for defending against malicious + attacks. + + The MD5 key, if set, must be of non-zero length and consist only of the + following types of character: + + - ASCII alphanumerics: `[a-zA-Z0-9]` + - Special characters in the set `'!@#$%^&*()+[]{}<>/.,;:_-~`= \\||` + + In other words, MD5 keys may contain any printable ASCII character aside from + newline (0x0A), quotation mark (`"`), vertical tab (0x0B), carriage return + (0x0D), tab (0x09), form feed (0x0C), and the question mark (`?`). Requests + specifying an MD5 key with one or more of these disallowed characters will be + rejected. + """ + + +class CNIUpdateResponse(BaseModel): + id: str + + account: str + """Customer account tag""" + + cust_ip: str + """Customer end of the point-to-point link + + This should always be inside the same prefix as `p2p_ip`. + """ + + interconnect: str + """Interconnect identifier hosting this CNI""" + + magic: Magic + + p2p_ip: str + """Cloudflare end of the point-to-point link""" + + bgp: Optional[BGP] = None diff --git a/src/cloudflare/types/network_interconnects/interconnect_create_params.py b/src/cloudflare/types/network_interconnects/interconnect_create_params.py new file mode 100644 index 00000000000..c62824f18c9 --- /dev/null +++ b/src/cloudflare/types/network_interconnects/interconnect_create_params.py @@ -0,0 +1,39 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +__all__ = ["InterconnectCreateParams", "NscInterconnectCreatePhysicalBody", "NscInterconnectCreateGcpPartnerBody"] + + +class NscInterconnectCreatePhysicalBody(TypedDict, total=False): + account_id: Required[str] + """Customer account tag""" + + account: Required[str] + + slot_id: Required[str] + + type: Required[str] + + speed: Optional[str] + + +class NscInterconnectCreateGcpPartnerBody(TypedDict, total=False): + account_id: Required[str] + """Customer account tag""" + + account: Required[str] + + bandwidth: Required[Literal["50M", "100M", "200M", "300M", "400M", "500M", "1G", "2G", "5G", "10G", "20G", "50G"]] + """Bandwidth structure as visible through the customer-facing API.""" + + pairing_key: Required[str] + """Pairing key provided by GCP""" + + type: Required[str] + + +InterconnectCreateParams: TypeAlias = Union[NscInterconnectCreatePhysicalBody, NscInterconnectCreateGcpPartnerBody] diff --git a/src/cloudflare/types/network_interconnects/interconnect_create_response.py b/src/cloudflare/types/network_interconnects/interconnect_create_response.py new file mode 100644 index 00000000000..309764de3ef --- /dev/null +++ b/src/cloudflare/types/network_interconnects/interconnect_create_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel + +__all__ = [ + "InterconnectCreateResponse", + "NscInterconnectPhysicalBody", + "NscInterconnectPhysicalBodyFacility", + "NscInterconnectGcpPartnerBody", +] + + +class NscInterconnectPhysicalBodyFacility(BaseModel): + address: List[str] + + name: str + + +class NscInterconnectPhysicalBody(BaseModel): + account: str + + facility: NscInterconnectPhysicalBodyFacility + + name: str + + site: str + """A Cloudflare site name.""" + + slot_id: str + + speed: str + + type: str + + owner: Optional[str] = None + + +class NscInterconnectGcpPartnerBody(BaseModel): + account: str + + name: str + + region: str + + type: str + + owner: Optional[str] = None + + +InterconnectCreateResponse: TypeAlias = Union[NscInterconnectPhysicalBody, NscInterconnectGcpPartnerBody] diff --git a/src/cloudflare/types/network_interconnects/interconnect_get_response.py b/src/cloudflare/types/network_interconnects/interconnect_get_response.py new file mode 100644 index 00000000000..345079eb625 --- /dev/null +++ b/src/cloudflare/types/network_interconnects/interconnect_get_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel + +__all__ = [ + "InterconnectGetResponse", + "NscInterconnectPhysicalBody", + "NscInterconnectPhysicalBodyFacility", + "NscInterconnectGcpPartnerBody", +] + + +class NscInterconnectPhysicalBodyFacility(BaseModel): + address: List[str] + + name: str + + +class NscInterconnectPhysicalBody(BaseModel): + account: str + + facility: NscInterconnectPhysicalBodyFacility + + name: str + + site: str + """A Cloudflare site name.""" + + slot_id: str + + speed: str + + type: str + + owner: Optional[str] = None + + +class NscInterconnectGcpPartnerBody(BaseModel): + account: str + + name: str + + region: str + + type: str + + owner: Optional[str] = None + + +InterconnectGetResponse: TypeAlias = Union[NscInterconnectPhysicalBody, NscInterconnectGcpPartnerBody] diff --git a/src/cloudflare/types/network_interconnects/interconnect_list_params.py b/src/cloudflare/types/network_interconnects/interconnect_list_params.py new file mode 100644 index 00000000000..1b60b5ce038 --- /dev/null +++ b/src/cloudflare/types/network_interconnects/interconnect_list_params.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, TypedDict + +__all__ = ["InterconnectListParams"] + + +class InterconnectListParams(TypedDict, total=False): + account_id: Required[str] + """Customer account tag""" + + cursor: Optional[int] + + limit: Optional[int] + + site: Optional[str] + """If specified, only show interconnects located at the given site""" + + type: Optional[str] + """If specified, only show interconnects of the given type""" diff --git a/src/cloudflare/types/network_interconnects/interconnect_list_response.py b/src/cloudflare/types/network_interconnects/interconnect_list_response.py new file mode 100644 index 00000000000..264aa5ea7f3 --- /dev/null +++ b/src/cloudflare/types/network_interconnects/interconnect_list_response.py @@ -0,0 +1,60 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel + +__all__ = [ + "InterconnectListResponse", + "Item", + "ItemNscInterconnectPhysicalBody", + "ItemNscInterconnectPhysicalBodyFacility", + "ItemNscInterconnectGcpPartnerBody", +] + + +class ItemNscInterconnectPhysicalBodyFacility(BaseModel): + address: List[str] + + name: str + + +class ItemNscInterconnectPhysicalBody(BaseModel): + account: str + + facility: ItemNscInterconnectPhysicalBodyFacility + + name: str + + site: str + """A Cloudflare site name.""" + + slot_id: str + + speed: str + + type: str + + owner: Optional[str] = None + + +class ItemNscInterconnectGcpPartnerBody(BaseModel): + account: str + + name: str + + region: str + + type: str + + owner: Optional[str] = None + + +Item: TypeAlias = Union[ItemNscInterconnectPhysicalBody, ItemNscInterconnectGcpPartnerBody] + + +class InterconnectListResponse(BaseModel): + items: List[Item] + + next: Optional[int] = None diff --git a/src/cloudflare/types/network_interconnects/interconnect_status_response.py b/src/cloudflare/types/network_interconnects/interconnect_status_response.py new file mode 100644 index 00000000000..6b05cd69e58 --- /dev/null +++ b/src/cloudflare/types/network_interconnects/interconnect_status_response.py @@ -0,0 +1,36 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel + +__all__ = ["InterconnectStatusResponse", "Pending", "Down", "Unhealthy", "Healthy"] + + +class Pending(BaseModel): + state: Literal["Pending"] + + +class Down(BaseModel): + state: Literal["Down"] + + reason: Optional[str] = None + """Diagnostic information, if available""" + + +class Unhealthy(BaseModel): + state: Literal["Unhealthy"] + + reason: Optional[str] = None + """Diagnostic information, if available""" + + +class Healthy(BaseModel): + state: Literal["Healthy"] + + +InterconnectStatusResponse: TypeAlias = Annotated[ + Union[Pending, Down, Unhealthy, Healthy], PropertyInfo(discriminator="state") +] diff --git a/src/cloudflare/types/network_interconnects/setting_get_response.py b/src/cloudflare/types/network_interconnects/setting_get_response.py new file mode 100644 index 00000000000..ab9ebfea50b --- /dev/null +++ b/src/cloudflare/types/network_interconnects/setting_get_response.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["SettingGetResponse"] + + +class SettingGetResponse(BaseModel): + default_asn: Optional[int] = None diff --git a/src/cloudflare/types/network_interconnects/setting_update_params.py b/src/cloudflare/types/network_interconnects/setting_update_params.py new file mode 100644 index 00000000000..f548ca5b4d7 --- /dev/null +++ b/src/cloudflare/types/network_interconnects/setting_update_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, TypedDict + +__all__ = ["SettingUpdateParams"] + + +class SettingUpdateParams(TypedDict, total=False): + account_id: Required[str] + + default_asn: Optional[int] diff --git a/src/cloudflare/types/network_interconnects/setting_update_response.py b/src/cloudflare/types/network_interconnects/setting_update_response.py new file mode 100644 index 00000000000..67c0f720f05 --- /dev/null +++ b/src/cloudflare/types/network_interconnects/setting_update_response.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["SettingUpdateResponse"] + + +class SettingUpdateResponse(BaseModel): + default_asn: Optional[int] = None diff --git a/src/cloudflare/types/network_interconnects/slot_get_response.py b/src/cloudflare/types/network_interconnects/slot_get_response.py new file mode 100644 index 00000000000..40ba2d9f90b --- /dev/null +++ b/src/cloudflare/types/network_interconnects/slot_get_response.py @@ -0,0 +1,30 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["SlotGetResponse", "Facility"] + + +class Facility(BaseModel): + address: List[str] + + name: str + + +class SlotGetResponse(BaseModel): + id: str + """Slot ID""" + + facility: Facility + + occupied: bool + """Whether the slot is occupied or not""" + + site: str + + speed: str + + account: Optional[str] = None + """Customer account tag""" diff --git a/src/cloudflare/types/network_interconnects/slot_list_params.py b/src/cloudflare/types/network_interconnects/slot_list_params.py new file mode 100644 index 00000000000..a788e11fb1e --- /dev/null +++ b/src/cloudflare/types/network_interconnects/slot_list_params.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, TypedDict + +__all__ = ["SlotListParams"] + + +class SlotListParams(TypedDict, total=False): + account_id: Required[str] + """Customer account tag""" + + address_contains: Optional[str] + """If specified, only show slots with the given text in their address field""" + + cursor: Optional[int] + + limit: Optional[int] + + occupied: Optional[bool] + """If specified, only show slots with a specific occupied/unoccupied state""" + + site: Optional[str] + """If specified, only show slots located at the given site""" + + speed: Optional[str] + """If specified, only show slots that support the given speed""" diff --git a/src/cloudflare/types/network_interconnects/slot_list_response.py b/src/cloudflare/types/network_interconnects/slot_list_response.py new file mode 100644 index 00000000000..8eba3c1bc51 --- /dev/null +++ b/src/cloudflare/types/network_interconnects/slot_list_response.py @@ -0,0 +1,36 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["SlotListResponse", "Item", "ItemFacility"] + + +class ItemFacility(BaseModel): + address: List[str] + + name: str + + +class Item(BaseModel): + id: str + """Slot ID""" + + facility: ItemFacility + + occupied: bool + """Whether the slot is occupied or not""" + + site: str + + speed: str + + account: Optional[str] = None + """Customer account tag""" + + +class SlotListResponse(BaseModel): + items: List[Item] + + next: Optional[int] = None diff --git a/tests/api_resources/network_interconnects/__init__.py b/tests/api_resources/network_interconnects/__init__.py new file mode 100644 index 00000000000..fd8019a9a1a --- /dev/null +++ b/tests/api_resources/network_interconnects/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/network_interconnects/test_cnis.py b/tests/api_resources/network_interconnects/test_cnis.py new file mode 100644 index 00000000000..89c5d12579e --- /dev/null +++ b/tests/api_resources/network_interconnects/test_cnis.py @@ -0,0 +1,727 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.network_interconnects import ( + CNIGetResponse, + CNIListResponse, + CNICreateResponse, + CNIUpdateResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestCNIs: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Cloudflare) -> None: + cni = client.network_interconnects.cnis.create( + account_id="account_id", + account="account", + interconnect="interconnect", + magic={ + "conduit_name": "conduit_name", + "description": "description", + "mtu": 0, + }, + ) + assert_matches_type(CNICreateResponse, cni, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Cloudflare) -> None: + cni = client.network_interconnects.cnis.create( + account_id="account_id", + account="account", + interconnect="interconnect", + magic={ + "conduit_name": "conduit_name", + "description": "description", + "mtu": 0, + }, + bgp={ + "customer_asn": 0, + "extra_prefixes": ["string"], + "md5_key": "md5_key", + }, + ) + assert_matches_type(CNICreateResponse, cni, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Cloudflare) -> None: + response = client.network_interconnects.cnis.with_raw_response.create( + account_id="account_id", + account="account", + interconnect="interconnect", + magic={ + "conduit_name": "conduit_name", + "description": "description", + "mtu": 0, + }, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + cni = response.parse() + assert_matches_type(CNICreateResponse, cni, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Cloudflare) -> None: + with client.network_interconnects.cnis.with_streaming_response.create( + account_id="account_id", + account="account", + interconnect="interconnect", + magic={ + "conduit_name": "conduit_name", + "description": "description", + "mtu": 0, + }, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + cni = response.parse() + assert_matches_type(CNICreateResponse, cni, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.network_interconnects.cnis.with_raw_response.create( + account_id="", + account="account", + interconnect="interconnect", + magic={ + "conduit_name": "conduit_name", + "description": "description", + "mtu": 0, + }, + ) + + @parametrize + def test_method_update(self, client: Cloudflare) -> None: + cni = client.network_interconnects.cnis.update( + cni="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account="account", + cust_ip="192.168.3.4/31", + interconnect="interconnect", + magic={ + "conduit_name": "conduit_name", + "description": "description", + "mtu": 0, + }, + p2p_ip="192.168.3.4/31", + ) + assert_matches_type(CNIUpdateResponse, cni, path=["response"]) + + @parametrize + def test_method_update_with_all_params(self, client: Cloudflare) -> None: + cni = client.network_interconnects.cnis.update( + cni="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account="account", + cust_ip="192.168.3.4/31", + interconnect="interconnect", + magic={ + "conduit_name": "conduit_name", + "description": "description", + "mtu": 0, + }, + p2p_ip="192.168.3.4/31", + bgp={ + "customer_asn": 0, + "extra_prefixes": ["string"], + "md5_key": "md5_key", + }, + ) + assert_matches_type(CNIUpdateResponse, cni, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Cloudflare) -> None: + response = client.network_interconnects.cnis.with_raw_response.update( + cni="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account="account", + cust_ip="192.168.3.4/31", + interconnect="interconnect", + magic={ + "conduit_name": "conduit_name", + "description": "description", + "mtu": 0, + }, + p2p_ip="192.168.3.4/31", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + cni = response.parse() + assert_matches_type(CNIUpdateResponse, cni, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Cloudflare) -> None: + with client.network_interconnects.cnis.with_streaming_response.update( + cni="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account="account", + cust_ip="192.168.3.4/31", + interconnect="interconnect", + magic={ + "conduit_name": "conduit_name", + "description": "description", + "mtu": 0, + }, + p2p_ip="192.168.3.4/31", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + cni = response.parse() + assert_matches_type(CNIUpdateResponse, cni, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.network_interconnects.cnis.with_raw_response.update( + cni="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="", + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account="account", + cust_ip="192.168.3.4/31", + interconnect="interconnect", + magic={ + "conduit_name": "conduit_name", + "description": "description", + "mtu": 0, + }, + p2p_ip="192.168.3.4/31", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `cni` but received ''"): + client.network_interconnects.cnis.with_raw_response.update( + cni="", + account_id="account_id", + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account="account", + cust_ip="192.168.3.4/31", + interconnect="interconnect", + magic={ + "conduit_name": "conduit_name", + "description": "description", + "mtu": 0, + }, + p2p_ip="192.168.3.4/31", + ) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + cni = client.network_interconnects.cnis.list( + account_id="account_id", + ) + assert_matches_type(CNIListResponse, cni, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + cni = client.network_interconnects.cnis.list( + account_id="account_id", + cursor=0, + limit=0, + slot="slot", + ) + assert_matches_type(CNIListResponse, cni, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.network_interconnects.cnis.with_raw_response.list( + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + cni = response.parse() + assert_matches_type(CNIListResponse, cni, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.network_interconnects.cnis.with_streaming_response.list( + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + cni = response.parse() + assert_matches_type(CNIListResponse, cni, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.network_interconnects.cnis.with_raw_response.list( + account_id="", + ) + + @parametrize + def test_method_delete(self, client: Cloudflare) -> None: + cni = client.network_interconnects.cnis.delete( + cni="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) + assert cni is None + + @parametrize + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.network_interconnects.cnis.with_raw_response.delete( + cni="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + cni = response.parse() + assert cni is None + + @parametrize + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.network_interconnects.cnis.with_streaming_response.delete( + cni="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + cni = response.parse() + assert cni is None + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.network_interconnects.cnis.with_raw_response.delete( + cni="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `cni` but received ''"): + client.network_interconnects.cnis.with_raw_response.delete( + cni="", + account_id="account_id", + ) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + cni = client.network_interconnects.cnis.get( + cni="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) + assert_matches_type(CNIGetResponse, cni, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.network_interconnects.cnis.with_raw_response.get( + cni="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + cni = response.parse() + assert_matches_type(CNIGetResponse, cni, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.network_interconnects.cnis.with_streaming_response.get( + cni="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + cni = response.parse() + assert_matches_type(CNIGetResponse, cni, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.network_interconnects.cnis.with_raw_response.get( + cni="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `cni` but received ''"): + client.network_interconnects.cnis.with_raw_response.get( + cni="", + account_id="account_id", + ) + + +class TestAsyncCNIs: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncCloudflare) -> None: + cni = await async_client.network_interconnects.cnis.create( + account_id="account_id", + account="account", + interconnect="interconnect", + magic={ + "conduit_name": "conduit_name", + "description": "description", + "mtu": 0, + }, + ) + assert_matches_type(CNICreateResponse, cni, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: + cni = await async_client.network_interconnects.cnis.create( + account_id="account_id", + account="account", + interconnect="interconnect", + magic={ + "conduit_name": "conduit_name", + "description": "description", + "mtu": 0, + }, + bgp={ + "customer_asn": 0, + "extra_prefixes": ["string"], + "md5_key": "md5_key", + }, + ) + assert_matches_type(CNICreateResponse, cni, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: + response = await async_client.network_interconnects.cnis.with_raw_response.create( + account_id="account_id", + account="account", + interconnect="interconnect", + magic={ + "conduit_name": "conduit_name", + "description": "description", + "mtu": 0, + }, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + cni = await response.parse() + assert_matches_type(CNICreateResponse, cni, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: + async with async_client.network_interconnects.cnis.with_streaming_response.create( + account_id="account_id", + account="account", + interconnect="interconnect", + magic={ + "conduit_name": "conduit_name", + "description": "description", + "mtu": 0, + }, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + cni = await response.parse() + assert_matches_type(CNICreateResponse, cni, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.network_interconnects.cnis.with_raw_response.create( + account_id="", + account="account", + interconnect="interconnect", + magic={ + "conduit_name": "conduit_name", + "description": "description", + "mtu": 0, + }, + ) + + @parametrize + async def test_method_update(self, async_client: AsyncCloudflare) -> None: + cni = await async_client.network_interconnects.cnis.update( + cni="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account="account", + cust_ip="192.168.3.4/31", + interconnect="interconnect", + magic={ + "conduit_name": "conduit_name", + "description": "description", + "mtu": 0, + }, + p2p_ip="192.168.3.4/31", + ) + assert_matches_type(CNIUpdateResponse, cni, path=["response"]) + + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: + cni = await async_client.network_interconnects.cnis.update( + cni="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account="account", + cust_ip="192.168.3.4/31", + interconnect="interconnect", + magic={ + "conduit_name": "conduit_name", + "description": "description", + "mtu": 0, + }, + p2p_ip="192.168.3.4/31", + bgp={ + "customer_asn": 0, + "extra_prefixes": ["string"], + "md5_key": "md5_key", + }, + ) + assert_matches_type(CNIUpdateResponse, cni, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + response = await async_client.network_interconnects.cnis.with_raw_response.update( + cni="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account="account", + cust_ip="192.168.3.4/31", + interconnect="interconnect", + magic={ + "conduit_name": "conduit_name", + "description": "description", + "mtu": 0, + }, + p2p_ip="192.168.3.4/31", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + cni = await response.parse() + assert_matches_type(CNIUpdateResponse, cni, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async with async_client.network_interconnects.cnis.with_streaming_response.update( + cni="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account="account", + cust_ip="192.168.3.4/31", + interconnect="interconnect", + magic={ + "conduit_name": "conduit_name", + "description": "description", + "mtu": 0, + }, + p2p_ip="192.168.3.4/31", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + cni = await response.parse() + assert_matches_type(CNIUpdateResponse, cni, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.network_interconnects.cnis.with_raw_response.update( + cni="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="", + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account="account", + cust_ip="192.168.3.4/31", + interconnect="interconnect", + magic={ + "conduit_name": "conduit_name", + "description": "description", + "mtu": 0, + }, + p2p_ip="192.168.3.4/31", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `cni` but received ''"): + await async_client.network_interconnects.cnis.with_raw_response.update( + cni="", + account_id="account_id", + id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account="account", + cust_ip="192.168.3.4/31", + interconnect="interconnect", + magic={ + "conduit_name": "conduit_name", + "description": "description", + "mtu": 0, + }, + p2p_ip="192.168.3.4/31", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + cni = await async_client.network_interconnects.cnis.list( + account_id="account_id", + ) + assert_matches_type(CNIListResponse, cni, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + cni = await async_client.network_interconnects.cnis.list( + account_id="account_id", + cursor=0, + limit=0, + slot="slot", + ) + assert_matches_type(CNIListResponse, cni, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.network_interconnects.cnis.with_raw_response.list( + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + cni = await response.parse() + assert_matches_type(CNIListResponse, cni, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.network_interconnects.cnis.with_streaming_response.list( + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + cni = await response.parse() + assert_matches_type(CNIListResponse, cni, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.network_interconnects.cnis.with_raw_response.list( + account_id="", + ) + + @parametrize + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + cni = await async_client.network_interconnects.cnis.delete( + cni="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) + assert cni is None + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.network_interconnects.cnis.with_raw_response.delete( + cni="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + cni = await response.parse() + assert cni is None + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.network_interconnects.cnis.with_streaming_response.delete( + cni="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + cni = await response.parse() + assert cni is None + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.network_interconnects.cnis.with_raw_response.delete( + cni="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `cni` but received ''"): + await async_client.network_interconnects.cnis.with_raw_response.delete( + cni="", + account_id="account_id", + ) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + cni = await async_client.network_interconnects.cnis.get( + cni="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) + assert_matches_type(CNIGetResponse, cni, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.network_interconnects.cnis.with_raw_response.get( + cni="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + cni = await response.parse() + assert_matches_type(CNIGetResponse, cni, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.network_interconnects.cnis.with_streaming_response.get( + cni="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + cni = await response.parse() + assert_matches_type(CNIGetResponse, cni, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.network_interconnects.cnis.with_raw_response.get( + cni="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `cni` but received ''"): + await async_client.network_interconnects.cnis.with_raw_response.get( + cni="", + account_id="account_id", + ) diff --git a/tests/api_resources/network_interconnects/test_interconnects.py b/tests/api_resources/network_interconnects/test_interconnects.py new file mode 100644 index 00000000000..79d4f5ec681 --- /dev/null +++ b/tests/api_resources/network_interconnects/test_interconnects.py @@ -0,0 +1,739 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.network_interconnects import ( + InterconnectGetResponse, + InterconnectListResponse, + InterconnectCreateResponse, + InterconnectStatusResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestInterconnects: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create_overload_1(self, client: Cloudflare) -> None: + interconnect = client.network_interconnects.interconnects.create( + account_id="account_id", + account="account", + slot_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + type="type", + ) + assert_matches_type(InterconnectCreateResponse, interconnect, path=["response"]) + + @parametrize + def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> None: + interconnect = client.network_interconnects.interconnects.create( + account_id="account_id", + account="account", + slot_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + type="type", + speed="speed", + ) + assert_matches_type(InterconnectCreateResponse, interconnect, path=["response"]) + + @parametrize + def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: + response = client.network_interconnects.interconnects.with_raw_response.create( + account_id="account_id", + account="account", + slot_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + type="type", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + interconnect = response.parse() + assert_matches_type(InterconnectCreateResponse, interconnect, path=["response"]) + + @parametrize + def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: + with client.network_interconnects.interconnects.with_streaming_response.create( + account_id="account_id", + account="account", + slot_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + type="type", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + interconnect = response.parse() + assert_matches_type(InterconnectCreateResponse, interconnect, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_create_overload_1(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.network_interconnects.interconnects.with_raw_response.create( + account_id="", + account="account", + slot_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + type="type", + ) + + @parametrize + def test_method_create_overload_2(self, client: Cloudflare) -> None: + interconnect = client.network_interconnects.interconnects.create( + account_id="account_id", + account="account", + bandwidth="50M", + pairing_key="pairing_key", + type="type", + ) + assert_matches_type(InterconnectCreateResponse, interconnect, path=["response"]) + + @parametrize + def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: + response = client.network_interconnects.interconnects.with_raw_response.create( + account_id="account_id", + account="account", + bandwidth="50M", + pairing_key="pairing_key", + type="type", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + interconnect = response.parse() + assert_matches_type(InterconnectCreateResponse, interconnect, path=["response"]) + + @parametrize + def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: + with client.network_interconnects.interconnects.with_streaming_response.create( + account_id="account_id", + account="account", + bandwidth="50M", + pairing_key="pairing_key", + type="type", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + interconnect = response.parse() + assert_matches_type(InterconnectCreateResponse, interconnect, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_create_overload_2(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.network_interconnects.interconnects.with_raw_response.create( + account_id="", + account="account", + bandwidth="50M", + pairing_key="pairing_key", + type="type", + ) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + interconnect = client.network_interconnects.interconnects.list( + account_id="account_id", + ) + assert_matches_type(InterconnectListResponse, interconnect, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + interconnect = client.network_interconnects.interconnects.list( + account_id="account_id", + cursor=0, + limit=0, + site="site", + type="type", + ) + assert_matches_type(InterconnectListResponse, interconnect, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.network_interconnects.interconnects.with_raw_response.list( + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + interconnect = response.parse() + assert_matches_type(InterconnectListResponse, interconnect, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.network_interconnects.interconnects.with_streaming_response.list( + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + interconnect = response.parse() + assert_matches_type(InterconnectListResponse, interconnect, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.network_interconnects.interconnects.with_raw_response.list( + account_id="", + ) + + @parametrize + def test_method_delete(self, client: Cloudflare) -> None: + interconnect = client.network_interconnects.interconnects.delete( + icon="icon", + account_id="account_id", + ) + assert interconnect is None + + @parametrize + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.network_interconnects.interconnects.with_raw_response.delete( + icon="icon", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + interconnect = response.parse() + assert interconnect is None + + @parametrize + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.network_interconnects.interconnects.with_streaming_response.delete( + icon="icon", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + interconnect = response.parse() + assert interconnect is None + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.network_interconnects.interconnects.with_raw_response.delete( + icon="icon", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `icon` but received ''"): + client.network_interconnects.interconnects.with_raw_response.delete( + icon="", + account_id="account_id", + ) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + interconnect = client.network_interconnects.interconnects.get( + icon="icon", + account_id="account_id", + ) + assert_matches_type(InterconnectGetResponse, interconnect, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.network_interconnects.interconnects.with_raw_response.get( + icon="icon", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + interconnect = response.parse() + assert_matches_type(InterconnectGetResponse, interconnect, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.network_interconnects.interconnects.with_streaming_response.get( + icon="icon", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + interconnect = response.parse() + assert_matches_type(InterconnectGetResponse, interconnect, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.network_interconnects.interconnects.with_raw_response.get( + icon="icon", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `icon` but received ''"): + client.network_interconnects.interconnects.with_raw_response.get( + icon="", + account_id="account_id", + ) + + @parametrize + def test_method_loa(self, client: Cloudflare) -> None: + interconnect = client.network_interconnects.interconnects.loa( + icon="icon", + account_id="account_id", + ) + assert interconnect is None + + @parametrize + def test_raw_response_loa(self, client: Cloudflare) -> None: + response = client.network_interconnects.interconnects.with_raw_response.loa( + icon="icon", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + interconnect = response.parse() + assert interconnect is None + + @parametrize + def test_streaming_response_loa(self, client: Cloudflare) -> None: + with client.network_interconnects.interconnects.with_streaming_response.loa( + icon="icon", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + interconnect = response.parse() + assert interconnect is None + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_loa(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.network_interconnects.interconnects.with_raw_response.loa( + icon="icon", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `icon` but received ''"): + client.network_interconnects.interconnects.with_raw_response.loa( + icon="", + account_id="account_id", + ) + + @parametrize + def test_method_status(self, client: Cloudflare) -> None: + interconnect = client.network_interconnects.interconnects.status( + icon="icon", + account_id="account_id", + ) + assert_matches_type(InterconnectStatusResponse, interconnect, path=["response"]) + + @parametrize + def test_raw_response_status(self, client: Cloudflare) -> None: + response = client.network_interconnects.interconnects.with_raw_response.status( + icon="icon", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + interconnect = response.parse() + assert_matches_type(InterconnectStatusResponse, interconnect, path=["response"]) + + @parametrize + def test_streaming_response_status(self, client: Cloudflare) -> None: + with client.network_interconnects.interconnects.with_streaming_response.status( + icon="icon", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + interconnect = response.parse() + assert_matches_type(InterconnectStatusResponse, interconnect, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_status(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.network_interconnects.interconnects.with_raw_response.status( + icon="icon", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `icon` but received ''"): + client.network_interconnects.interconnects.with_raw_response.status( + icon="", + account_id="account_id", + ) + + +class TestAsyncInterconnects: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> None: + interconnect = await async_client.network_interconnects.interconnects.create( + account_id="account_id", + account="account", + slot_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + type="type", + ) + assert_matches_type(InterconnectCreateResponse, interconnect, path=["response"]) + + @parametrize + async def test_method_create_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: + interconnect = await async_client.network_interconnects.interconnects.create( + account_id="account_id", + account="account", + slot_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + type="type", + speed="speed", + ) + assert_matches_type(InterconnectCreateResponse, interconnect, path=["response"]) + + @parametrize + async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: + response = await async_client.network_interconnects.interconnects.with_raw_response.create( + account_id="account_id", + account="account", + slot_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + type="type", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + interconnect = await response.parse() + assert_matches_type(InterconnectCreateResponse, interconnect, path=["response"]) + + @parametrize + async def test_streaming_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: + async with async_client.network_interconnects.interconnects.with_streaming_response.create( + account_id="account_id", + account="account", + slot_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + type="type", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + interconnect = await response.parse() + assert_matches_type(InterconnectCreateResponse, interconnect, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_create_overload_1(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.network_interconnects.interconnects.with_raw_response.create( + account_id="", + account="account", + slot_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + type="type", + ) + + @parametrize + async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> None: + interconnect = await async_client.network_interconnects.interconnects.create( + account_id="account_id", + account="account", + bandwidth="50M", + pairing_key="pairing_key", + type="type", + ) + assert_matches_type(InterconnectCreateResponse, interconnect, path=["response"]) + + @parametrize + async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: + response = await async_client.network_interconnects.interconnects.with_raw_response.create( + account_id="account_id", + account="account", + bandwidth="50M", + pairing_key="pairing_key", + type="type", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + interconnect = await response.parse() + assert_matches_type(InterconnectCreateResponse, interconnect, path=["response"]) + + @parametrize + async def test_streaming_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: + async with async_client.network_interconnects.interconnects.with_streaming_response.create( + account_id="account_id", + account="account", + bandwidth="50M", + pairing_key="pairing_key", + type="type", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + interconnect = await response.parse() + assert_matches_type(InterconnectCreateResponse, interconnect, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_create_overload_2(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.network_interconnects.interconnects.with_raw_response.create( + account_id="", + account="account", + bandwidth="50M", + pairing_key="pairing_key", + type="type", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + interconnect = await async_client.network_interconnects.interconnects.list( + account_id="account_id", + ) + assert_matches_type(InterconnectListResponse, interconnect, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + interconnect = await async_client.network_interconnects.interconnects.list( + account_id="account_id", + cursor=0, + limit=0, + site="site", + type="type", + ) + assert_matches_type(InterconnectListResponse, interconnect, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.network_interconnects.interconnects.with_raw_response.list( + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + interconnect = await response.parse() + assert_matches_type(InterconnectListResponse, interconnect, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.network_interconnects.interconnects.with_streaming_response.list( + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + interconnect = await response.parse() + assert_matches_type(InterconnectListResponse, interconnect, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.network_interconnects.interconnects.with_raw_response.list( + account_id="", + ) + + @parametrize + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + interconnect = await async_client.network_interconnects.interconnects.delete( + icon="icon", + account_id="account_id", + ) + assert interconnect is None + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.network_interconnects.interconnects.with_raw_response.delete( + icon="icon", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + interconnect = await response.parse() + assert interconnect is None + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.network_interconnects.interconnects.with_streaming_response.delete( + icon="icon", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + interconnect = await response.parse() + assert interconnect is None + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.network_interconnects.interconnects.with_raw_response.delete( + icon="icon", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `icon` but received ''"): + await async_client.network_interconnects.interconnects.with_raw_response.delete( + icon="", + account_id="account_id", + ) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + interconnect = await async_client.network_interconnects.interconnects.get( + icon="icon", + account_id="account_id", + ) + assert_matches_type(InterconnectGetResponse, interconnect, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.network_interconnects.interconnects.with_raw_response.get( + icon="icon", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + interconnect = await response.parse() + assert_matches_type(InterconnectGetResponse, interconnect, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.network_interconnects.interconnects.with_streaming_response.get( + icon="icon", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + interconnect = await response.parse() + assert_matches_type(InterconnectGetResponse, interconnect, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.network_interconnects.interconnects.with_raw_response.get( + icon="icon", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `icon` but received ''"): + await async_client.network_interconnects.interconnects.with_raw_response.get( + icon="", + account_id="account_id", + ) + + @parametrize + async def test_method_loa(self, async_client: AsyncCloudflare) -> None: + interconnect = await async_client.network_interconnects.interconnects.loa( + icon="icon", + account_id="account_id", + ) + assert interconnect is None + + @parametrize + async def test_raw_response_loa(self, async_client: AsyncCloudflare) -> None: + response = await async_client.network_interconnects.interconnects.with_raw_response.loa( + icon="icon", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + interconnect = await response.parse() + assert interconnect is None + + @parametrize + async def test_streaming_response_loa(self, async_client: AsyncCloudflare) -> None: + async with async_client.network_interconnects.interconnects.with_streaming_response.loa( + icon="icon", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + interconnect = await response.parse() + assert interconnect is None + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_loa(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.network_interconnects.interconnects.with_raw_response.loa( + icon="icon", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `icon` but received ''"): + await async_client.network_interconnects.interconnects.with_raw_response.loa( + icon="", + account_id="account_id", + ) + + @parametrize + async def test_method_status(self, async_client: AsyncCloudflare) -> None: + interconnect = await async_client.network_interconnects.interconnects.status( + icon="icon", + account_id="account_id", + ) + assert_matches_type(InterconnectStatusResponse, interconnect, path=["response"]) + + @parametrize + async def test_raw_response_status(self, async_client: AsyncCloudflare) -> None: + response = await async_client.network_interconnects.interconnects.with_raw_response.status( + icon="icon", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + interconnect = await response.parse() + assert_matches_type(InterconnectStatusResponse, interconnect, path=["response"]) + + @parametrize + async def test_streaming_response_status(self, async_client: AsyncCloudflare) -> None: + async with async_client.network_interconnects.interconnects.with_streaming_response.status( + icon="icon", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + interconnect = await response.parse() + assert_matches_type(InterconnectStatusResponse, interconnect, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_status(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.network_interconnects.interconnects.with_raw_response.status( + icon="icon", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `icon` but received ''"): + await async_client.network_interconnects.interconnects.with_raw_response.status( + icon="", + account_id="account_id", + ) diff --git a/tests/api_resources/network_interconnects/test_settings.py b/tests/api_resources/network_interconnects/test_settings.py new file mode 100644 index 00000000000..d5151d269f7 --- /dev/null +++ b/tests/api_resources/network_interconnects/test_settings.py @@ -0,0 +1,190 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.network_interconnects import SettingGetResponse, SettingUpdateResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestSettings: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_update(self, client: Cloudflare) -> None: + setting = client.network_interconnects.settings.update( + account_id="account_id", + ) + assert_matches_type(SettingUpdateResponse, setting, path=["response"]) + + @parametrize + def test_method_update_with_all_params(self, client: Cloudflare) -> None: + setting = client.network_interconnects.settings.update( + account_id="account_id", + default_asn=0, + ) + assert_matches_type(SettingUpdateResponse, setting, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Cloudflare) -> None: + response = client.network_interconnects.settings.with_raw_response.update( + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + setting = response.parse() + assert_matches_type(SettingUpdateResponse, setting, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Cloudflare) -> None: + with client.network_interconnects.settings.with_streaming_response.update( + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + setting = response.parse() + assert_matches_type(SettingUpdateResponse, setting, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.network_interconnects.settings.with_raw_response.update( + account_id="", + ) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + setting = client.network_interconnects.settings.get( + account_id="account_id", + ) + assert_matches_type(SettingGetResponse, setting, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.network_interconnects.settings.with_raw_response.get( + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + setting = response.parse() + assert_matches_type(SettingGetResponse, setting, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.network_interconnects.settings.with_streaming_response.get( + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + setting = response.parse() + assert_matches_type(SettingGetResponse, setting, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.network_interconnects.settings.with_raw_response.get( + account_id="", + ) + + +class TestAsyncSettings: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_update(self, async_client: AsyncCloudflare) -> None: + setting = await async_client.network_interconnects.settings.update( + account_id="account_id", + ) + assert_matches_type(SettingUpdateResponse, setting, path=["response"]) + + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: + setting = await async_client.network_interconnects.settings.update( + account_id="account_id", + default_asn=0, + ) + assert_matches_type(SettingUpdateResponse, setting, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + response = await async_client.network_interconnects.settings.with_raw_response.update( + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + setting = await response.parse() + assert_matches_type(SettingUpdateResponse, setting, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async with async_client.network_interconnects.settings.with_streaming_response.update( + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + setting = await response.parse() + assert_matches_type(SettingUpdateResponse, setting, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.network_interconnects.settings.with_raw_response.update( + account_id="", + ) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + setting = await async_client.network_interconnects.settings.get( + account_id="account_id", + ) + assert_matches_type(SettingGetResponse, setting, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.network_interconnects.settings.with_raw_response.get( + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + setting = await response.parse() + assert_matches_type(SettingGetResponse, setting, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.network_interconnects.settings.with_streaming_response.get( + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + setting = await response.parse() + assert_matches_type(SettingGetResponse, setting, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.network_interconnects.settings.with_raw_response.get( + account_id="", + ) diff --git a/tests/api_resources/network_interconnects/test_slots.py b/tests/api_resources/network_interconnects/test_slots.py new file mode 100644 index 00000000000..6e7b507d51c --- /dev/null +++ b/tests/api_resources/network_interconnects/test_slots.py @@ -0,0 +1,220 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.network_interconnects import SlotGetResponse, SlotListResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestSlots: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + slot = client.network_interconnects.slots.list( + account_id="account_id", + ) + assert_matches_type(SlotListResponse, slot, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + slot = client.network_interconnects.slots.list( + account_id="account_id", + address_contains="address_contains", + cursor=0, + limit=0, + occupied=True, + site="site", + speed="speed", + ) + assert_matches_type(SlotListResponse, slot, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.network_interconnects.slots.with_raw_response.list( + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + slot = response.parse() + assert_matches_type(SlotListResponse, slot, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.network_interconnects.slots.with_streaming_response.list( + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + slot = response.parse() + assert_matches_type(SlotListResponse, slot, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.network_interconnects.slots.with_raw_response.list( + account_id="", + ) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + slot = client.network_interconnects.slots.get( + slot="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) + assert_matches_type(SlotGetResponse, slot, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.network_interconnects.slots.with_raw_response.get( + slot="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + slot = response.parse() + assert_matches_type(SlotGetResponse, slot, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.network_interconnects.slots.with_streaming_response.get( + slot="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + slot = response.parse() + assert_matches_type(SlotGetResponse, slot, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.network_interconnects.slots.with_raw_response.get( + slot="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `slot` but received ''"): + client.network_interconnects.slots.with_raw_response.get( + slot="", + account_id="account_id", + ) + + +class TestAsyncSlots: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + slot = await async_client.network_interconnects.slots.list( + account_id="account_id", + ) + assert_matches_type(SlotListResponse, slot, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + slot = await async_client.network_interconnects.slots.list( + account_id="account_id", + address_contains="address_contains", + cursor=0, + limit=0, + occupied=True, + site="site", + speed="speed", + ) + assert_matches_type(SlotListResponse, slot, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.network_interconnects.slots.with_raw_response.list( + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + slot = await response.parse() + assert_matches_type(SlotListResponse, slot, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.network_interconnects.slots.with_streaming_response.list( + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + slot = await response.parse() + assert_matches_type(SlotListResponse, slot, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.network_interconnects.slots.with_raw_response.list( + account_id="", + ) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + slot = await async_client.network_interconnects.slots.get( + slot="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) + assert_matches_type(SlotGetResponse, slot, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.network_interconnects.slots.with_raw_response.get( + slot="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + slot = await response.parse() + assert_matches_type(SlotGetResponse, slot, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.network_interconnects.slots.with_streaming_response.get( + slot="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + slot = await response.parse() + assert_matches_type(SlotGetResponse, slot, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.network_interconnects.slots.with_raw_response.get( + slot="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `slot` but received ''"): + await async_client.network_interconnects.slots.with_raw_response.get( + slot="", + account_id="account_id", + ) From 5188fdb686f21fbc414a97cc6629d43c09b2062d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 10:44:43 +0000 Subject: [PATCH 033/358] feat(api): api update (#2390) --- .stats.yml | 2 +- .../email_security/settings/domains.py | 8 +++++++ .../settings/domain_edit_response.py | 22 ++++++++++++++++++- .../settings/domain_get_response.py | 22 ++++++++++++++++++- .../settings/domain_list_params.py | 3 +++ .../settings/domain_list_response.py | 22 ++++++++++++++++++- .../email_security/settings/test_domains.py | 2 ++ 7 files changed, 77 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index d0c74d2b890..bb29cf6c11e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1508 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4d2ad2efc7849cfa1f1205e3d2b513df805aae225cc968df751a60ecd902d1ab.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8a886fe980d03dce34f4bbfd3d40277e65cdb1997e06ffd220c0721fcbd63110.yml diff --git a/src/cloudflare/resources/email_security/settings/domains.py b/src/cloudflare/resources/email_security/settings/domains.py index fd13dd469f8..e409adf9ef3 100644 --- a/src/cloudflare/resources/email_security/settings/domains.py +++ b/src/cloudflare/resources/email_security/settings/domains.py @@ -57,6 +57,7 @@ def list( self, *, account_id: str, + active_delivery_mode: Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"] | NotGiven = NOT_GIVEN, allowed_delivery_mode: Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"] | NotGiven = NOT_GIVEN, direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, domain: List[str] | NotGiven = NOT_GIVEN, @@ -77,6 +78,8 @@ def list( Args: account_id: Account Identifier + active_delivery_mode: Filters response to domains with the currently active delivery mode. + allowed_delivery_mode: Filters response to domains with the provided delivery mode. direction: The sorting direction. @@ -113,6 +116,7 @@ def list( timeout=timeout, query=maybe_transform( { + "active_delivery_mode": active_delivery_mode, "allowed_delivery_mode": allowed_delivery_mode, "direction": direction, "domain": domain, @@ -354,6 +358,7 @@ def list( self, *, account_id: str, + active_delivery_mode: Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"] | NotGiven = NOT_GIVEN, allowed_delivery_mode: Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"] | NotGiven = NOT_GIVEN, direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, domain: List[str] | NotGiven = NOT_GIVEN, @@ -374,6 +379,8 @@ def list( Args: account_id: Account Identifier + active_delivery_mode: Filters response to domains with the currently active delivery mode. + allowed_delivery_mode: Filters response to domains with the provided delivery mode. direction: The sorting direction. @@ -410,6 +417,7 @@ def list( timeout=timeout, query=maybe_transform( { + "active_delivery_mode": active_delivery_mode, "allowed_delivery_mode": allowed_delivery_mode, "direction": direction, "domain": domain, diff --git a/src/cloudflare/types/email_security/settings/domain_edit_response.py b/src/cloudflare/types/email_security/settings/domain_edit_response.py index 8ea6d9f2e97..4d1434e9510 100644 --- a/src/cloudflare/types/email_security/settings/domain_edit_response.py +++ b/src/cloudflare/types/email_security/settings/domain_edit_response.py @@ -6,7 +6,23 @@ from ...._models import BaseModel -__all__ = ["DomainEditResponse"] +__all__ = ["DomainEditResponse", "Authorization", "EmailsProcessed"] + + +class Authorization(BaseModel): + authorized: bool + + timestamp: datetime + + status_message: Optional[str] = None + + +class EmailsProcessed(BaseModel): + timestamp: datetime + + total_emails_processed: int + + total_emails_processed_previous: int class DomainEditResponse(BaseModel): @@ -42,6 +58,10 @@ class DomainEditResponse(BaseModel): transport: str + authorization: Optional[Authorization] = None + + emails_processed: Optional[EmailsProcessed] = None + folder: Optional[Literal["AllItems", "Inbox"]] = None inbox_provider: Optional[Literal["Microsoft", "Google"]] = None diff --git a/src/cloudflare/types/email_security/settings/domain_get_response.py b/src/cloudflare/types/email_security/settings/domain_get_response.py index 7943664ea15..21085e3e549 100644 --- a/src/cloudflare/types/email_security/settings/domain_get_response.py +++ b/src/cloudflare/types/email_security/settings/domain_get_response.py @@ -6,7 +6,23 @@ from ...._models import BaseModel -__all__ = ["DomainGetResponse"] +__all__ = ["DomainGetResponse", "Authorization", "EmailsProcessed"] + + +class Authorization(BaseModel): + authorized: bool + + timestamp: datetime + + status_message: Optional[str] = None + + +class EmailsProcessed(BaseModel): + timestamp: datetime + + total_emails_processed: int + + total_emails_processed_previous: int class DomainGetResponse(BaseModel): @@ -42,6 +58,10 @@ class DomainGetResponse(BaseModel): transport: str + authorization: Optional[Authorization] = None + + emails_processed: Optional[EmailsProcessed] = None + folder: Optional[Literal["AllItems", "Inbox"]] = None inbox_provider: Optional[Literal["Microsoft", "Google"]] = None diff --git a/src/cloudflare/types/email_security/settings/domain_list_params.py b/src/cloudflare/types/email_security/settings/domain_list_params.py index c6b3345325d..c1916c9e660 100644 --- a/src/cloudflare/types/email_security/settings/domain_list_params.py +++ b/src/cloudflare/types/email_security/settings/domain_list_params.py @@ -12,6 +12,9 @@ class DomainListParams(TypedDict, total=False): account_id: Required[str] """Account Identifier""" + active_delivery_mode: Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"] + """Filters response to domains with the currently active delivery mode.""" + allowed_delivery_mode: Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"] """Filters response to domains with the provided delivery mode.""" diff --git a/src/cloudflare/types/email_security/settings/domain_list_response.py b/src/cloudflare/types/email_security/settings/domain_list_response.py index cf7eb4380ce..e7cb9573374 100644 --- a/src/cloudflare/types/email_security/settings/domain_list_response.py +++ b/src/cloudflare/types/email_security/settings/domain_list_response.py @@ -6,7 +6,23 @@ from ...._models import BaseModel -__all__ = ["DomainListResponse"] +__all__ = ["DomainListResponse", "Authorization", "EmailsProcessed"] + + +class Authorization(BaseModel): + authorized: bool + + timestamp: datetime + + status_message: Optional[str] = None + + +class EmailsProcessed(BaseModel): + timestamp: datetime + + total_emails_processed: int + + total_emails_processed_previous: int class DomainListResponse(BaseModel): @@ -42,6 +58,10 @@ class DomainListResponse(BaseModel): transport: str + authorization: Optional[Authorization] = None + + emails_processed: Optional[EmailsProcessed] = None + folder: Optional[Literal["AllItems", "Inbox"]] = None inbox_provider: Optional[Literal["Microsoft", "Google"]] = None diff --git a/tests/api_resources/email_security/settings/test_domains.py b/tests/api_resources/email_security/settings/test_domains.py index b6668368e0a..1277461c4ad 100644 --- a/tests/api_resources/email_security/settings/test_domains.py +++ b/tests/api_resources/email_security/settings/test_domains.py @@ -35,6 +35,7 @@ def test_method_list(self, client: Cloudflare) -> None: def test_method_list_with_all_params(self, client: Cloudflare) -> None: domain = client.email_security.settings.domains.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", + active_delivery_mode="DIRECT", allowed_delivery_mode="DIRECT", direction="asc", domain=["string"], @@ -276,6 +277,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: domain = await async_client.email_security.settings.domains.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", + active_delivery_mode="DIRECT", allowed_delivery_mode="DIRECT", direction="asc", domain=["string"], From 903338e60a30b212b570864662ab034089735292 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 11:56:33 +0000 Subject: [PATCH 034/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index bb29cf6c11e..edf78914683 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1508 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8a886fe980d03dce34f4bbfd3d40277e65cdb1997e06ffd220c0721fcbd63110.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b563aad649b96c13baaeb0d2066d90421d4db37141f05f45d3bcc51693fc0a3e.yml From 2fd92132e94383e496436fdd0a651b26b185d008 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 13:16:52 +0000 Subject: [PATCH 035/358] chore(internal): minor formatting changes (#2391) --- .github/workflows/ci.yml | 2 ++ scripts/bootstrap | 2 +- scripts/lint | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d8463e3a020..835c7af1ead 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,6 +35,7 @@ jobs: - name: Run lints run: ./scripts/lint + test: name: test runs-on: ubuntu-latest @@ -56,6 +57,7 @@ jobs: - name: Run tests run: ./scripts/test + examples: name: examples runs-on: ubuntu-latest diff --git a/scripts/bootstrap b/scripts/bootstrap index 8c5c60eba34..e84fe62c380 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -4,7 +4,7 @@ set -e cd "$(dirname "$0")/.." -if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then +if ! command -v rye >/dev/null 2>&1 && [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then brew bundle check >/dev/null 2>&1 || { echo "==> Installing Homebrew dependencies…" brew bundle diff --git a/scripts/lint b/scripts/lint index aa39f69ffbd..9ad76783d44 100755 --- a/scripts/lint +++ b/scripts/lint @@ -9,4 +9,3 @@ rye run lint echo "==> Making sure it imports" rye run python -c 'import cloudflare' - From 3f43e49d35c3993398207e7c0669be425768235b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 14:27:02 +0000 Subject: [PATCH 036/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index edf78914683..278ae83c1cf 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1508 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b563aad649b96c13baaeb0d2066d90421d4db37141f05f45d3bcc51693fc0a3e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-caa1534a099501a7cea3c6aa9e98098f2f32457f599e42e2744dc2a7d8f4eeec.yml From 0ebf39dd33cd2073edeceafd60ee9f748a15f8a1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 15:17:45 +0000 Subject: [PATCH 037/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 278ae83c1cf..8f6f2071c54 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1508 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-caa1534a099501a7cea3c6aa9e98098f2f32457f599e42e2744dc2a7d8f4eeec.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b9d1e410625002fb2fa27d7d00c232f2aea9c22f0141ccfbc717ed94aefb9804.yml From a6af67a08dbd010b5874060ef41531faeebc8e91 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 15:25:33 +0000 Subject: [PATCH 038/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 8f6f2071c54..278ae83c1cf 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1508 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b9d1e410625002fb2fa27d7d00c232f2aea9c22f0141ccfbc717ed94aefb9804.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-caa1534a099501a7cea3c6aa9e98098f2f32457f599e42e2744dc2a7d8f4eeec.yml From be2ad4933521e40d352e0e7a0963a03d42fb9df6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 15:42:32 +0000 Subject: [PATCH 039/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 278ae83c1cf..8f6f2071c54 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1508 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-caa1534a099501a7cea3c6aa9e98098f2f32457f599e42e2744dc2a7d8f4eeec.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b9d1e410625002fb2fa27d7d00c232f2aea9c22f0141ccfbc717ed94aefb9804.yml From 0904d61db486bef5eaf0e92f669fff4bd4054633 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 16:40:49 +0000 Subject: [PATCH 040/358] feat(api): api update (#2393) --- .stats.yml | 2 +- src/cloudflare/types/workers/script_update_params.py | 7 +++++++ .../dispatch/namespaces/script_update_params.py | 7 +++++++ tests/api_resources/workers/test_scripts.py | 2 ++ .../dispatch/namespaces/test_scripts.py | 2 ++ 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 8f6f2071c54..5df07f3a564 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1508 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b9d1e410625002fb2fa27d7d00c232f2aea9c22f0141ccfbc717ed94aefb9804.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-db443ead2321c518913c39aebcf830d4ad1d7d8fd95d81971fa73c87efc17df9.yml diff --git a/src/cloudflare/types/workers/script_update_params.py b/src/cloudflare/types/workers/script_update_params.py index 3bac9979ed1..d2477230159 100644 --- a/src/cloudflare/types/workers/script_update_params.py +++ b/src/cloudflare/types/workers/script_update_params.py @@ -62,6 +62,13 @@ class MetadataAssetsConfig(TypedDict, total=False): is no Worker script. """ + run_worker_first: bool + """When true, requests will always invoke the Worker script. + + Otherwise, attempt to serve an asset matching the request, falling back to the + Worker script. + """ + serve_directly: bool """ When true and the incoming request matches an asset, that will be served instead diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py index 0470a9fe602..4d531281723 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py @@ -65,6 +65,13 @@ class MetadataAssetsConfig(TypedDict, total=False): is no Worker script. """ + run_worker_first: bool + """When true, requests will always invoke the Worker script. + + Otherwise, attempt to serve an asset matching the request, falling back to the + Worker script. + """ + serve_directly: bool """ When true and the incoming request matches an asset, that will be served instead diff --git a/tests/api_resources/workers/test_scripts.py b/tests/api_resources/workers/test_scripts.py index 342dd8c9531..00f0d53b953 100644 --- a/tests/api_resources/workers/test_scripts.py +++ b/tests/api_resources/workers/test_scripts.py @@ -42,6 +42,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "config": { "html_handling": "auto-trailing-slash", "not_found_handling": "none", + "run_worker_first": False, "serve_directly": True, }, "jwt": "jwt", @@ -312,6 +313,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "config": { "html_handling": "auto-trailing-slash", "not_found_handling": "none", + "run_worker_first": False, "serve_directly": True, }, "jwt": "jwt", diff --git a/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py b/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py index cfec51aadc0..feb536104b4 100644 --- a/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py +++ b/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py @@ -43,6 +43,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "config": { "html_handling": "auto-trailing-slash", "not_found_handling": "none", + "run_worker_first": False, "serve_directly": True, }, "jwt": "jwt", @@ -314,6 +315,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "config": { "html_handling": "auto-trailing-slash", "not_found_handling": "none", + "run_worker_first": False, "serve_directly": True, }, "jwt": "jwt", From a96ec8840f236ff54b76d59b4eaf540bd30f1e43 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 19:52:23 +0000 Subject: [PATCH 041/358] feat(api): api update (#2394) --- .stats.yml | 2 +- .../types/magic_transit/sites/acl_configuration.py | 10 +++++++++- .../magic_transit/sites/acl_configuration_param.py | 10 +++++++++- tests/api_resources/magic_transit/sites/test_acls.py | 12 ++++++++++++ 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5df07f3a564..5e039a1b884 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1508 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-db443ead2321c518913c39aebcf830d4ad1d7d8fd95d81971fa73c87efc17df9.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-82a521194000c6d0b051c53d886330d610a9966c8f1f00c1ae82a7889328ff40.yml diff --git a/src/cloudflare/types/magic_transit/sites/acl_configuration.py b/src/cloudflare/types/magic_transit/sites/acl_configuration.py index 6c934b500b5..99457cdecbf 100644 --- a/src/cloudflare/types/magic_transit/sites/acl_configuration.py +++ b/src/cloudflare/types/magic_transit/sites/acl_configuration.py @@ -15,10 +15,18 @@ class ACLConfiguration(BaseModel): lan_name: Optional[str] = None """The name of the LAN based on the provided lan_id.""" + port_ranges: Optional[List[str]] = None + """Array of port ranges on the provided LAN that will be included in the ACL. + + If no ports or port rangess are provided, communication on any port on this LAN + is allowed. + """ + ports: Optional[List[int]] = None """Array of ports on the provided LAN that will be included in the ACL. - If no ports are provided, communication on any port on this LAN is allowed. + If no ports or port ranges are provided, communication on any port on this LAN + is allowed. """ subnets: Optional[List[Subnet]] = None diff --git a/src/cloudflare/types/magic_transit/sites/acl_configuration_param.py b/src/cloudflare/types/magic_transit/sites/acl_configuration_param.py index a674c65a27f..5127703e6b8 100644 --- a/src/cloudflare/types/magic_transit/sites/acl_configuration_param.py +++ b/src/cloudflare/types/magic_transit/sites/acl_configuration_param.py @@ -17,10 +17,18 @@ class ACLConfigurationParam(TypedDict, total=False): lan_name: str """The name of the LAN based on the provided lan_id.""" + port_ranges: List[str] + """Array of port ranges on the provided LAN that will be included in the ACL. + + If no ports or port rangess are provided, communication on any port on this LAN + is allowed. + """ + ports: Iterable[int] """Array of ports on the provided LAN that will be included in the ACL. - If no ports are provided, communication on any port on this LAN is allowed. + If no ports or port ranges are provided, communication on any port on this LAN + is allowed. """ subnets: List[Subnet] diff --git a/tests/api_resources/magic_transit/sites/test_acls.py b/tests/api_resources/magic_transit/sites/test_acls.py index 151e289d692..d6c31f71bc6 100644 --- a/tests/api_resources/magic_transit/sites/test_acls.py +++ b/tests/api_resources/magic_transit/sites/test_acls.py @@ -39,12 +39,14 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: lan_1={ "lan_id": "lan_id", "lan_name": "lan_name", + "port_ranges": ["8080-9000"], "ports": [1], "subnets": ["192.0.2.1"], }, lan_2={ "lan_id": "lan_id", "lan_name": "lan_name", + "port_ranges": ["8080-9000"], "ports": [1], "subnets": ["192.0.2.1"], }, @@ -128,12 +130,14 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: lan_1={ "lan_id": "lan_id", "lan_name": "lan_name", + "port_ranges": ["8080-9000"], "ports": [1], "subnets": ["192.0.2.1"], }, lan_2={ "lan_id": "lan_id", "lan_name": "lan_name", + "port_ranges": ["8080-9000"], "ports": [1], "subnets": ["192.0.2.1"], }, @@ -322,12 +326,14 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: lan_1={ "lan_id": "lan_id", "lan_name": "lan_name", + "port_ranges": ["8080-9000"], "ports": [1], "subnets": ["192.0.2.1"], }, lan_2={ "lan_id": "lan_id", "lan_name": "lan_name", + "port_ranges": ["8080-9000"], "ports": [1], "subnets": ["192.0.2.1"], }, @@ -471,12 +477,14 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare lan_1={ "lan_id": "lan_id", "lan_name": "lan_name", + "port_ranges": ["8080-9000"], "ports": [1], "subnets": ["192.0.2.1"], }, lan_2={ "lan_id": "lan_id", "lan_name": "lan_name", + "port_ranges": ["8080-9000"], "ports": [1], "subnets": ["192.0.2.1"], }, @@ -560,12 +568,14 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare lan_1={ "lan_id": "lan_id", "lan_name": "lan_name", + "port_ranges": ["8080-9000"], "ports": [1], "subnets": ["192.0.2.1"], }, lan_2={ "lan_id": "lan_id", "lan_name": "lan_name", + "port_ranges": ["8080-9000"], "ports": [1], "subnets": ["192.0.2.1"], }, @@ -754,12 +764,14 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) lan_1={ "lan_id": "lan_id", "lan_name": "lan_name", + "port_ranges": ["8080-9000"], "ports": [1], "subnets": ["192.0.2.1"], }, lan_2={ "lan_id": "lan_id", "lan_name": "lan_name", + "port_ranges": ["8080-9000"], "ports": [1], "subnets": ["192.0.2.1"], }, From 416a601bc306da2ff46610f599077baac3b4239f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 22:34:12 +0000 Subject: [PATCH 042/358] feat(api): api update (#2395) --- .stats.yml | 2 +- .../resources/vectorize/indexes/indexes.py | 10 ++-- .../types/vectorize/index_insert_params.py | 3 +- .../types/vectorize/index_upsert_params.py | 3 +- tests/api_resources/vectorize/test_indexes.py | 48 +++++++++---------- 5 files changed, 32 insertions(+), 34 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5e039a1b884..f1dc1196a26 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1508 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-82a521194000c6d0b051c53d886330d610a9966c8f1f00c1ae82a7889328ff40.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-93781888ccca411928a3826373dfd7531806fd2eb4c35de249b142676f00b56f.yml diff --git a/src/cloudflare/resources/vectorize/indexes/indexes.py b/src/cloudflare/resources/vectorize/indexes/indexes.py index 80900880a09..378eef38881 100644 --- a/src/cloudflare/resources/vectorize/indexes/indexes.py +++ b/src/cloudflare/resources/vectorize/indexes/indexes.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( maybe_transform, async_maybe_transform, @@ -392,7 +392,7 @@ def insert( index_name: str, *, account_id: str, - body: FileTypes, + body: str, unparsable_behavior: Literal["error", "discard"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -513,7 +513,7 @@ def upsert( index_name: str, *, account_id: str, - body: FileTypes, + body: str, unparsable_behavior: Literal["error", "discard"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -904,7 +904,7 @@ async def insert( index_name: str, *, account_id: str, - body: FileTypes, + body: str, unparsable_behavior: Literal["error", "discard"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1025,7 +1025,7 @@ async def upsert( index_name: str, *, account_id: str, - body: FileTypes, + body: str, unparsable_behavior: Literal["error", "discard"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. diff --git a/src/cloudflare/types/vectorize/index_insert_params.py b/src/cloudflare/types/vectorize/index_insert_params.py index 2a793667035..572bd796158 100644 --- a/src/cloudflare/types/vectorize/index_insert_params.py +++ b/src/cloudflare/types/vectorize/index_insert_params.py @@ -4,7 +4,6 @@ from typing_extensions import Literal, Required, Annotated, TypedDict -from ..._types import FileTypes from ..._utils import PropertyInfo __all__ = ["IndexInsertParams"] @@ -14,7 +13,7 @@ class IndexInsertParams(TypedDict, total=False): account_id: Required[str] """Identifier""" - body: Required[FileTypes] + body: Required[str] """ndjson file containing vectors to insert.""" unparsable_behavior: Annotated[Literal["error", "discard"], PropertyInfo(alias="unparsable-behavior")] diff --git a/src/cloudflare/types/vectorize/index_upsert_params.py b/src/cloudflare/types/vectorize/index_upsert_params.py index 5e7dc3f3b55..9a459a18a44 100644 --- a/src/cloudflare/types/vectorize/index_upsert_params.py +++ b/src/cloudflare/types/vectorize/index_upsert_params.py @@ -4,7 +4,6 @@ from typing_extensions import Literal, Required, Annotated, TypedDict -from ..._types import FileTypes from ..._utils import PropertyInfo __all__ = ["IndexUpsertParams"] @@ -14,7 +13,7 @@ class IndexUpsertParams(TypedDict, total=False): account_id: Required[str] """Identifier""" - body: Required[FileTypes] + body: Required[str] """ndjson file containing vectors to upsert.""" unparsable_behavior: Annotated[Literal["error", "discard"], PropertyInfo(alias="unparsable-behavior")] diff --git a/tests/api_resources/vectorize/test_indexes.py b/tests/api_resources/vectorize/test_indexes.py index 272871b4418..1a27050902d 100644 --- a/tests/api_resources/vectorize/test_indexes.py +++ b/tests/api_resources/vectorize/test_indexes.py @@ -399,7 +399,7 @@ def test_method_insert(self, client: Cloudflare) -> None: index = client.vectorize.indexes.insert( index_name="example-index", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=b"raw file contents", + body="@/path/to/vectors.ndjson", ) assert_matches_type(Optional[IndexInsertResponse], index, path=["response"]) @@ -409,7 +409,7 @@ def test_method_insert_with_all_params(self, client: Cloudflare) -> None: index = client.vectorize.indexes.insert( index_name="example-index", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=b"raw file contents", + body="@/path/to/vectors.ndjson", unparsable_behavior="error", ) assert_matches_type(Optional[IndexInsertResponse], index, path=["response"]) @@ -420,7 +420,7 @@ def test_raw_response_insert(self, client: Cloudflare) -> None: response = client.vectorize.indexes.with_raw_response.insert( index_name="example-index", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=b"raw file contents", + body="@/path/to/vectors.ndjson", ) assert response.is_closed is True @@ -434,7 +434,7 @@ def test_streaming_response_insert(self, client: Cloudflare) -> None: with client.vectorize.indexes.with_streaming_response.insert( index_name="example-index", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=b"raw file contents", + body="@/path/to/vectors.ndjson", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -451,14 +451,14 @@ def test_path_params_insert(self, client: Cloudflare) -> None: client.vectorize.indexes.with_raw_response.insert( index_name="example-index", account_id="", - body=b"raw file contents", + body="@/path/to/vectors.ndjson", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `index_name` but received ''"): client.vectorize.indexes.with_raw_response.insert( index_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=b"raw file contents", + body="@/path/to/vectors.ndjson", ) @parametrize @@ -536,7 +536,7 @@ def test_method_upsert(self, client: Cloudflare) -> None: index = client.vectorize.indexes.upsert( index_name="example-index", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=b"raw file contents", + body="@/path/to/vectors.ndjson", ) assert_matches_type(Optional[IndexUpsertResponse], index, path=["response"]) @@ -546,7 +546,7 @@ def test_method_upsert_with_all_params(self, client: Cloudflare) -> None: index = client.vectorize.indexes.upsert( index_name="example-index", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=b"raw file contents", + body="@/path/to/vectors.ndjson", unparsable_behavior="error", ) assert_matches_type(Optional[IndexUpsertResponse], index, path=["response"]) @@ -557,7 +557,7 @@ def test_raw_response_upsert(self, client: Cloudflare) -> None: response = client.vectorize.indexes.with_raw_response.upsert( index_name="example-index", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=b"raw file contents", + body="@/path/to/vectors.ndjson", ) assert response.is_closed is True @@ -571,7 +571,7 @@ def test_streaming_response_upsert(self, client: Cloudflare) -> None: with client.vectorize.indexes.with_streaming_response.upsert( index_name="example-index", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=b"raw file contents", + body="@/path/to/vectors.ndjson", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -588,14 +588,14 @@ def test_path_params_upsert(self, client: Cloudflare) -> None: client.vectorize.indexes.with_raw_response.upsert( index_name="example-index", account_id="", - body=b"raw file contents", + body="@/path/to/vectors.ndjson", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `index_name` but received ''"): client.vectorize.indexes.with_raw_response.upsert( index_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=b"raw file contents", + body="@/path/to/vectors.ndjson", ) @@ -975,7 +975,7 @@ async def test_method_insert(self, async_client: AsyncCloudflare) -> None: index = await async_client.vectorize.indexes.insert( index_name="example-index", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=b"raw file contents", + body="@/path/to/vectors.ndjson", ) assert_matches_type(Optional[IndexInsertResponse], index, path=["response"]) @@ -985,7 +985,7 @@ async def test_method_insert_with_all_params(self, async_client: AsyncCloudflare index = await async_client.vectorize.indexes.insert( index_name="example-index", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=b"raw file contents", + body="@/path/to/vectors.ndjson", unparsable_behavior="error", ) assert_matches_type(Optional[IndexInsertResponse], index, path=["response"]) @@ -996,7 +996,7 @@ async def test_raw_response_insert(self, async_client: AsyncCloudflare) -> None: response = await async_client.vectorize.indexes.with_raw_response.insert( index_name="example-index", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=b"raw file contents", + body="@/path/to/vectors.ndjson", ) assert response.is_closed is True @@ -1010,7 +1010,7 @@ async def test_streaming_response_insert(self, async_client: AsyncCloudflare) -> async with async_client.vectorize.indexes.with_streaming_response.insert( index_name="example-index", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=b"raw file contents", + body="@/path/to/vectors.ndjson", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1027,14 +1027,14 @@ async def test_path_params_insert(self, async_client: AsyncCloudflare) -> None: await async_client.vectorize.indexes.with_raw_response.insert( index_name="example-index", account_id="", - body=b"raw file contents", + body="@/path/to/vectors.ndjson", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `index_name` but received ''"): await async_client.vectorize.indexes.with_raw_response.insert( index_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=b"raw file contents", + body="@/path/to/vectors.ndjson", ) @parametrize @@ -1112,7 +1112,7 @@ async def test_method_upsert(self, async_client: AsyncCloudflare) -> None: index = await async_client.vectorize.indexes.upsert( index_name="example-index", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=b"raw file contents", + body="@/path/to/vectors.ndjson", ) assert_matches_type(Optional[IndexUpsertResponse], index, path=["response"]) @@ -1122,7 +1122,7 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncCloudflare index = await async_client.vectorize.indexes.upsert( index_name="example-index", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=b"raw file contents", + body="@/path/to/vectors.ndjson", unparsable_behavior="error", ) assert_matches_type(Optional[IndexUpsertResponse], index, path=["response"]) @@ -1133,7 +1133,7 @@ async def test_raw_response_upsert(self, async_client: AsyncCloudflare) -> None: response = await async_client.vectorize.indexes.with_raw_response.upsert( index_name="example-index", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=b"raw file contents", + body="@/path/to/vectors.ndjson", ) assert response.is_closed is True @@ -1147,7 +1147,7 @@ async def test_streaming_response_upsert(self, async_client: AsyncCloudflare) -> async with async_client.vectorize.indexes.with_streaming_response.upsert( index_name="example-index", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=b"raw file contents", + body="@/path/to/vectors.ndjson", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1164,12 +1164,12 @@ async def test_path_params_upsert(self, async_client: AsyncCloudflare) -> None: await async_client.vectorize.indexes.with_raw_response.upsert( index_name="example-index", account_id="", - body=b"raw file contents", + body="@/path/to/vectors.ndjson", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `index_name` but received ''"): await async_client.vectorize.indexes.with_raw_response.upsert( index_name="", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=b"raw file contents", + body="@/path/to/vectors.ndjson", ) From 35c62631f9e1bbb3d6d572688a60fa039690a067 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 23:44:54 +0000 Subject: [PATCH 043/358] feat(api): api update (#2396) --- .stats.yml | 2 +- src/cloudflare/resources/ai/ai.py | 52 ++++++++++++++++++++++-- src/cloudflare/types/ai/ai_run_params.py | 26 ++++++++++++ tests/api_resources/test_ai.py | 12 ++++++ 4 files changed, 87 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index f1dc1196a26..99c0461cc75 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1508 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-93781888ccca411928a3826373dfd7531806fd2eb4c35de249b142676f00b56f.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ac165d4964ca2ce8972ff49caf15d7f0d11b3ee052b35a32ee3b3111fe77bef3.yml diff --git a/src/cloudflare/resources/ai/ai.py b/src/cloudflare/resources/ai/ai.py index 9d148a6b655..16ce8cbd61a 100644 --- a/src/cloudflare/resources/ai/ai.py +++ b/src/cloudflare/resources/ai/ai.py @@ -656,10 +656,16 @@ def run( *, account_id: str, image: Iterable[float], + frequency_penalty: float | NotGiven = NOT_GIVEN, max_tokens: int | NotGiven = NOT_GIVEN, + presence_penalty: float | NotGiven = NOT_GIVEN, prompt: str | NotGiven = NOT_GIVEN, raw: bool | NotGiven = NOT_GIVEN, + repetition_penalty: float | NotGiven = NOT_GIVEN, + seed: float | NotGiven = NOT_GIVEN, temperature: float | NotGiven = NOT_GIVEN, + top_k: float | NotGiven = NOT_GIVEN, + top_p: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -682,16 +688,32 @@ def run( image: An array of integers that represent the image data constrained to 8-bit unsigned integer values + frequency_penalty: Decreases the likelihood of the model repeating the same lines verbatim. + max_tokens: The maximum number of tokens to generate in the response. + presence_penalty: Increases the likelihood of the model introducing new topics. + prompt: The input text prompt for the model to generate a response. raw: If true, a chat template is not applied and you must adhere to the specific model's expected formatting. + repetition_penalty: Penalty for repeated tokens; higher values discourage repetition. + + seed: Random seed for reproducibility of the generation. + temperature: Controls the randomness of the output; higher values produce more random results. + top_k: Limits the AI to choose from the top 'k' most probable words. Lower values make + responses more focused; higher values introduce more variety and potential + surprises. + + top_p: Controls the creativity of the AI's responses by adjusting how many possible + words it considers. Lower values make outputs more predictable; higher values + allow for more varied and creative responses. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -726,7 +748,7 @@ def run( mask: Iterable[float] | NotGiven = NOT_GIVEN, negative_prompt: str | NotGiven = NOT_GIVEN, num_steps: int | NotGiven = NOT_GIVEN, - seed: int | NotGiven = NOT_GIVEN, + seed: int | float | NotGiven = NOT_GIVEN, strength: float | NotGiven = NOT_GIVEN, width: int | NotGiven = NOT_GIVEN, lang: str | NotGiven = NOT_GIVEN, @@ -741,7 +763,7 @@ def run( repetition_penalty: float | NotGiven = NOT_GIVEN, stream: bool | NotGiven = NOT_GIVEN, temperature: float | NotGiven = NOT_GIVEN, - top_k: int | NotGiven = NOT_GIVEN, + top_k: int | float | NotGiven = NOT_GIVEN, top_p: float | NotGiven = NOT_GIVEN, messages: Iterable[ai_run_params.MessagesMessage] | NotGiven = NOT_GIVEN, functions: Iterable[ai_run_params.MessagesFunction] | NotGiven = NOT_GIVEN, @@ -1408,10 +1430,16 @@ async def run( *, account_id: str, image: Iterable[float], + frequency_penalty: float | NotGiven = NOT_GIVEN, max_tokens: int | NotGiven = NOT_GIVEN, + presence_penalty: float | NotGiven = NOT_GIVEN, prompt: str | NotGiven = NOT_GIVEN, raw: bool | NotGiven = NOT_GIVEN, + repetition_penalty: float | NotGiven = NOT_GIVEN, + seed: float | NotGiven = NOT_GIVEN, temperature: float | NotGiven = NOT_GIVEN, + top_k: float | NotGiven = NOT_GIVEN, + top_p: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1434,16 +1462,32 @@ async def run( image: An array of integers that represent the image data constrained to 8-bit unsigned integer values + frequency_penalty: Decreases the likelihood of the model repeating the same lines verbatim. + max_tokens: The maximum number of tokens to generate in the response. + presence_penalty: Increases the likelihood of the model introducing new topics. + prompt: The input text prompt for the model to generate a response. raw: If true, a chat template is not applied and you must adhere to the specific model's expected formatting. + repetition_penalty: Penalty for repeated tokens; higher values discourage repetition. + + seed: Random seed for reproducibility of the generation. + temperature: Controls the randomness of the output; higher values produce more random results. + top_k: Limits the AI to choose from the top 'k' most probable words. Lower values make + responses more focused; higher values introduce more variety and potential + surprises. + + top_p: Controls the creativity of the AI's responses by adjusting how many possible + words it considers. Lower values make outputs more predictable; higher values + allow for more varied and creative responses. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1478,7 +1522,7 @@ async def run( mask: Iterable[float] | NotGiven = NOT_GIVEN, negative_prompt: str | NotGiven = NOT_GIVEN, num_steps: int | NotGiven = NOT_GIVEN, - seed: int | NotGiven = NOT_GIVEN, + seed: int | float | NotGiven = NOT_GIVEN, strength: float | NotGiven = NOT_GIVEN, width: int | NotGiven = NOT_GIVEN, lang: str | NotGiven = NOT_GIVEN, @@ -1493,7 +1537,7 @@ async def run( repetition_penalty: float | NotGiven = NOT_GIVEN, stream: bool | NotGiven = NOT_GIVEN, temperature: float | NotGiven = NOT_GIVEN, - top_k: int | NotGiven = NOT_GIVEN, + top_k: int | float | NotGiven = NOT_GIVEN, top_p: float | NotGiven = NOT_GIVEN, messages: Iterable[ai_run_params.MessagesMessage] | NotGiven = NOT_GIVEN, functions: Iterable[ai_run_params.MessagesFunction] | NotGiven = NOT_GIVEN, diff --git a/src/cloudflare/types/ai/ai_run_params.py b/src/cloudflare/types/ai/ai_run_params.py index 397cce5947f..2027ea80b4b 100644 --- a/src/cloudflare/types/ai/ai_run_params.py +++ b/src/cloudflare/types/ai/ai_run_params.py @@ -377,9 +377,15 @@ class ImageToText(TypedDict, total=False): integer values """ + frequency_penalty: float + """Decreases the likelihood of the model repeating the same lines verbatim.""" + max_tokens: int """The maximum number of tokens to generate in the response.""" + presence_penalty: float + """Increases the likelihood of the model introducing new topics.""" + prompt: str """The input text prompt for the model to generate a response.""" @@ -389,12 +395,32 @@ class ImageToText(TypedDict, total=False): model's expected formatting. """ + repetition_penalty: float + """Penalty for repeated tokens; higher values discourage repetition.""" + + seed: float + """Random seed for reproducibility of the generation.""" + temperature: float """ Controls the randomness of the output; higher values produce more random results. """ + top_k: float + """Limits the AI to choose from the top 'k' most probable words. + + Lower values make responses more focused; higher values introduce more variety + and potential surprises. + """ + + top_p: float + """ + Controls the creativity of the AI's responses by adjusting how many possible + words it considers. Lower values make outputs more predictable; higher values + allow for more varied and creative responses. + """ + AIRunParams: TypeAlias = Union[ TextClassification, diff --git a/tests/api_resources/test_ai.py b/tests/api_resources/test_ai.py index ab8fa8cc49c..ed27ad26aca 100644 --- a/tests/api_resources/test_ai.py +++ b/tests/api_resources/test_ai.py @@ -775,10 +775,16 @@ def test_method_run_with_all_params_overload_12(self, client: Cloudflare) -> Non model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], + frequency_penalty=0, max_tokens=0, + presence_penalty=0, prompt="prompt", raw=True, + repetition_penalty=0, + seed=0, temperature=0, + top_k=0, + top_p=0, ) assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) @@ -1588,10 +1594,16 @@ async def test_method_run_with_all_params_overload_12(self, async_client: AsyncC model_name="model_name", account_id="023e105f4ecef8ad9ca31a8372d0c353", image=[0], + frequency_penalty=0, max_tokens=0, + presence_penalty=0, prompt="prompt", raw=True, + repetition_penalty=0, + seed=0, temperature=0, + top_k=0, + top_p=0, ) assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) From a2181558d118246a38f806c2c554618ec18e8848 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 24 Jan 2025 10:35:34 +0000 Subject: [PATCH 044/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 99c0461cc75..9ff12acbafa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1508 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ac165d4964ca2ce8972ff49caf15d7f0d11b3ee052b35a32ee3b3111fe77bef3.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bc60197588d3f199481d8107cd85189ef798eaf150d8c55e809be937c0542507.yml From 37c80eb6f3c83612bcaab219a64d7ecb03dc60b7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 24 Jan 2025 15:43:29 +0000 Subject: [PATCH 045/358] chore(internal): codegen related update (#2397) --- tests/api_resources/zero_trust/tunnels/test_configurations.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/api_resources/zero_trust/tunnels/test_configurations.py b/tests/api_resources/zero_trust/tunnels/test_configurations.py index df4e73e663f..eb601aa3bbc 100644 --- a/tests/api_resources/zero_trust/tunnels/test_configurations.py +++ b/tests/api_resources/zero_trust/tunnels/test_configurations.py @@ -81,7 +81,6 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "tcp_keep_alive": 0, "tls_timeout": 0, }, - "warp_routing": {"enabled": True}, }, ) assert_matches_type(Optional[ConfigurationUpdateResponse], configuration, path=["response"]) @@ -239,7 +238,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "tcp_keep_alive": 0, "tls_timeout": 0, }, - "warp_routing": {"enabled": True}, }, ) assert_matches_type(Optional[ConfigurationUpdateResponse], configuration, path=["response"]) From f3bec6768227098761d64f841446aba3f1c9fa18 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 24 Jan 2025 16:22:45 +0000 Subject: [PATCH 046/358] feat(api): api update (#2398) --- .stats.yml | 2 +- src/cloudflare/types/alerting/mechanism.py | 24 +++++-- .../types/alerting/mechanism_param.py | 25 ++++++-- tests/api_resources/alerting/test_policies.py | 64 +++++-------------- 4 files changed, 55 insertions(+), 60 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9ff12acbafa..2e10e9ccc0d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1508 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bc60197588d3f199481d8107cd85189ef798eaf150d8c55e809be937c0542507.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-af20b95a31279c374d10db6b99abfb69221518a5339ac1864f4a87a18c358701.yml diff --git a/src/cloudflare/types/alerting/mechanism.py b/src/cloudflare/types/alerting/mechanism.py index e19d43a7525..ab8ee1d6a8c 100644 --- a/src/cloudflare/types/alerting/mechanism.py +++ b/src/cloudflare/types/alerting/mechanism.py @@ -1,16 +1,30 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Optional -from typing_extensions import TypeAlias +from typing import List, Optional from ..._models import BaseModel -__all__ = ["Mechanism", "MechanismItem"] +__all__ = ["Mechanism", "Email", "Pagerduty", "Webhook"] -class MechanismItem(BaseModel): +class Email(BaseModel): + id: Optional[str] = None + """The email address""" + + +class Pagerduty(BaseModel): id: Optional[str] = None """UUID""" -Mechanism: TypeAlias = Dict[str, List[MechanismItem]] +class Webhook(BaseModel): + id: Optional[str] = None + """UUID""" + + +class Mechanism(BaseModel): + email: Optional[List[Email]] = None + + pagerduty: Optional[List[Pagerduty]] = None + + webhooks: Optional[List[Webhook]] = None diff --git a/src/cloudflare/types/alerting/mechanism_param.py b/src/cloudflare/types/alerting/mechanism_param.py index 7d64d335f0b..8790a9fb478 100644 --- a/src/cloudflare/types/alerting/mechanism_param.py +++ b/src/cloudflare/types/alerting/mechanism_param.py @@ -2,15 +2,28 @@ from __future__ import annotations -from typing import Dict, Iterable -from typing_extensions import TypeAlias, TypedDict +from typing import Iterable +from typing_extensions import TypedDict -__all__ = ["MechanismParam", "MechanismParamItem"] +__all__ = ["MechanismParam", "Email", "Pagerduty", "Webhook"] -class MechanismParamItem(TypedDict, total=False): +class Email(TypedDict, total=False): id: str - """UUID""" + """The email address""" -MechanismParam: TypeAlias = Dict[str, Iterable[MechanismParamItem]] +class Pagerduty(TypedDict, total=False): + pass + + +class Webhook(TypedDict, total=False): + pass + + +class MechanismParam(TypedDict, total=False): + email: Iterable[Email] + + pagerduty: Iterable[Pagerduty] + + webhooks: Iterable[Webhook] diff --git a/tests/api_resources/alerting/test_policies.py b/tests/api_resources/alerting/test_policies.py index 56106b46ee8..89dc8d18f6b 100644 --- a/tests/api_resources/alerting/test_policies.py +++ b/tests/api_resources/alerting/test_policies.py @@ -32,11 +32,7 @@ def test_method_create(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", alert_type="access_custom_certificate_expiration_type", enabled=True, - mechanisms={ - "email": [{}], - "pagerduty": [{}], - "webhooks": [{}], - }, + mechanisms={}, name="SSL Notification Event Policy", ) assert_matches_type(Optional[PolicyCreateResponse], policy, path=["response"]) @@ -52,8 +48,8 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: enabled=True, mechanisms={ "email": [{"id": "test@example.com"}], - "pagerduty": [{"id": "e8133a15-00a4-4d69-aec1-32f70c51f6e5"}], - "webhooks": [{"id": "14cc1190-5d2b-4b98-a696-c424cb2ad05f"}], + "pagerduty": [{}], + "webhooks": [{}], }, name="SSL Notification Event Policy", alert_interval="30m", @@ -113,11 +109,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", alert_type="access_custom_certificate_expiration_type", enabled=True, - mechanisms={ - "email": [{}], - "pagerduty": [{}], - "webhooks": [{}], - }, + mechanisms={}, name="SSL Notification Event Policy", ) @@ -135,11 +127,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", alert_type="access_custom_certificate_expiration_type", enabled=True, - mechanisms={ - "email": [{}], - "pagerduty": [{}], - "webhooks": [{}], - }, + mechanisms={}, name="SSL Notification Event Policy", ) as response: assert not response.is_closed @@ -160,11 +148,7 @@ def test_path_params_create(self, client: Cloudflare) -> None: account_id="", alert_type="access_custom_certificate_expiration_type", enabled=True, - mechanisms={ - "email": [{}], - "pagerduty": [{}], - "webhooks": [{}], - }, + mechanisms={}, name="SSL Notification Event Policy", ) @@ -236,8 +220,8 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: }, mechanisms={ "email": [{"id": "test@example.com"}], - "pagerduty": [{"id": "e8133a15-00a4-4d69-aec1-32f70c51f6e5"}], - "webhooks": [{"id": "14cc1190-5d2b-4b98-a696-c424cb2ad05f"}], + "pagerduty": [{}], + "webhooks": [{}], }, name="SSL Notification Event Policy", ) @@ -451,11 +435,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", alert_type="access_custom_certificate_expiration_type", enabled=True, - mechanisms={ - "email": [{}], - "pagerduty": [{}], - "webhooks": [{}], - }, + mechanisms={}, name="SSL Notification Event Policy", ) assert_matches_type(Optional[PolicyCreateResponse], policy, path=["response"]) @@ -471,8 +451,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare enabled=True, mechanisms={ "email": [{"id": "test@example.com"}], - "pagerduty": [{"id": "e8133a15-00a4-4d69-aec1-32f70c51f6e5"}], - "webhooks": [{"id": "14cc1190-5d2b-4b98-a696-c424cb2ad05f"}], + "pagerduty": [{}], + "webhooks": [{}], }, name="SSL Notification Event Policy", alert_interval="30m", @@ -532,11 +512,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", alert_type="access_custom_certificate_expiration_type", enabled=True, - mechanisms={ - "email": [{}], - "pagerduty": [{}], - "webhooks": [{}], - }, + mechanisms={}, name="SSL Notification Event Policy", ) @@ -554,11 +530,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> account_id="023e105f4ecef8ad9ca31a8372d0c353", alert_type="access_custom_certificate_expiration_type", enabled=True, - mechanisms={ - "email": [{}], - "pagerduty": [{}], - "webhooks": [{}], - }, + mechanisms={}, name="SSL Notification Event Policy", ) as response: assert not response.is_closed @@ -579,11 +551,7 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: account_id="", alert_type="access_custom_certificate_expiration_type", enabled=True, - mechanisms={ - "email": [{}], - "pagerduty": [{}], - "webhooks": [{}], - }, + mechanisms={}, name="SSL Notification Event Policy", ) @@ -655,8 +623,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare }, mechanisms={ "email": [{"id": "test@example.com"}], - "pagerduty": [{"id": "e8133a15-00a4-4d69-aec1-32f70c51f6e5"}], - "webhooks": [{"id": "14cc1190-5d2b-4b98-a696-c424cb2ad05f"}], + "pagerduty": [{}], + "webhooks": [{}], }, name="SSL Notification Event Policy", ) From 1246e695838ca571a61cf78d0abe7f7a8a9b158d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 15:16:27 +0000 Subject: [PATCH 047/358] feat(api): api update (#2399) --- .stats.yml | 2 +- src/cloudflare/resources/alerting/policies.py | 12 ++++++++---- src/cloudflare/types/alerting/policy.py | 3 ++- .../types/alerting/policy_create_params.py | 3 ++- src/cloudflare/types/alerting/policy_filter.py | 5 ++++- src/cloudflare/types/alerting/policy_filter_param.py | 5 ++++- .../types/alerting/policy_update_params.py | 3 ++- tests/api_resources/alerting/test_policies.py | 12 ++++++++---- 8 files changed, 31 insertions(+), 14 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2e10e9ccc0d..536f39d797c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1508 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-af20b95a31279c374d10db6b99abfb69221518a5339ac1864f4a87a18c358701.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fc6440a93f6aee5f11262d075db1abe2123bcba78d70b8ec7bb8dd7c8da69401.yml diff --git a/src/cloudflare/resources/alerting/policies.py b/src/cloudflare/resources/alerting/policies.py index ef3d2331da8..650d09f1800 100644 --- a/src/cloudflare/resources/alerting/policies.py +++ b/src/cloudflare/resources/alerting/policies.py @@ -88,9 +88,9 @@ def create( "hostname_aop_custom_certificate_expiration_type", "http_alert_edge_error", "http_alert_origin_error", - "incident_alert", "image_notification", "image_resizing_notification", + "incident_alert", "load_balancing_health_alert", "load_balancing_pool_enablement_alert", "logo_match_alert", @@ -113,6 +113,7 @@ def create( "secondary_dns_warning", "secondary_dns_zone_successfully_updated", "secondary_dns_zone_validation_warning", + "security_insights_alert", "sentinel_alert", "stream_live_notifications", "synthetic_test_latency_alert", @@ -233,9 +234,9 @@ def update( "hostname_aop_custom_certificate_expiration_type", "http_alert_edge_error", "http_alert_origin_error", - "incident_alert", "image_notification", "image_resizing_notification", + "incident_alert", "load_balancing_health_alert", "load_balancing_pool_enablement_alert", "logo_match_alert", @@ -258,6 +259,7 @@ def update( "secondary_dns_warning", "secondary_dns_zone_successfully_updated", "secondary_dns_zone_validation_warning", + "security_insights_alert", "sentinel_alert", "stream_live_notifications", "synthetic_test_latency_alert", @@ -521,9 +523,9 @@ async def create( "hostname_aop_custom_certificate_expiration_type", "http_alert_edge_error", "http_alert_origin_error", - "incident_alert", "image_notification", "image_resizing_notification", + "incident_alert", "load_balancing_health_alert", "load_balancing_pool_enablement_alert", "logo_match_alert", @@ -546,6 +548,7 @@ async def create( "secondary_dns_warning", "secondary_dns_zone_successfully_updated", "secondary_dns_zone_validation_warning", + "security_insights_alert", "sentinel_alert", "stream_live_notifications", "synthetic_test_latency_alert", @@ -666,9 +669,9 @@ async def update( "hostname_aop_custom_certificate_expiration_type", "http_alert_edge_error", "http_alert_origin_error", - "incident_alert", "image_notification", "image_resizing_notification", + "incident_alert", "load_balancing_health_alert", "load_balancing_pool_enablement_alert", "logo_match_alert", @@ -691,6 +694,7 @@ async def update( "secondary_dns_warning", "secondary_dns_zone_successfully_updated", "secondary_dns_zone_validation_warning", + "security_insights_alert", "sentinel_alert", "stream_live_notifications", "synthetic_test_latency_alert", diff --git a/src/cloudflare/types/alerting/policy.py b/src/cloudflare/types/alerting/policy.py index e247c40d603..473074d6abd 100644 --- a/src/cloudflare/types/alerting/policy.py +++ b/src/cloudflare/types/alerting/policy.py @@ -52,9 +52,9 @@ class Policy(BaseModel): "hostname_aop_custom_certificate_expiration_type", "http_alert_edge_error", "http_alert_origin_error", - "incident_alert", "image_notification", "image_resizing_notification", + "incident_alert", "load_balancing_health_alert", "load_balancing_pool_enablement_alert", "logo_match_alert", @@ -77,6 +77,7 @@ class Policy(BaseModel): "secondary_dns_warning", "secondary_dns_zone_successfully_updated", "secondary_dns_zone_validation_warning", + "security_insights_alert", "sentinel_alert", "stream_live_notifications", "synthetic_test_latency_alert", diff --git a/src/cloudflare/types/alerting/policy_create_params.py b/src/cloudflare/types/alerting/policy_create_params.py index 769c6d7e4d8..8c1d7f88063 100644 --- a/src/cloudflare/types/alerting/policy_create_params.py +++ b/src/cloudflare/types/alerting/policy_create_params.py @@ -45,9 +45,9 @@ class PolicyCreateParams(TypedDict, total=False): "hostname_aop_custom_certificate_expiration_type", "http_alert_edge_error", "http_alert_origin_error", - "incident_alert", "image_notification", "image_resizing_notification", + "incident_alert", "load_balancing_health_alert", "load_balancing_pool_enablement_alert", "logo_match_alert", @@ -70,6 +70,7 @@ class PolicyCreateParams(TypedDict, total=False): "secondary_dns_warning", "secondary_dns_zone_successfully_updated", "secondary_dns_zone_validation_warning", + "security_insights_alert", "sentinel_alert", "stream_live_notifications", "synthetic_test_latency_alert", diff --git a/src/cloudflare/types/alerting/policy_filter.py b/src/cloudflare/types/alerting/policy_filter.py index 3f729852279..199dc2862c2 100644 --- a/src/cloudflare/types/alerting/policy_filter.py +++ b/src/cloudflare/types/alerting/policy_filter.py @@ -63,6 +63,9 @@ class PolicyFilter(BaseModel): input_id: Optional[List[str]] = None """Used for configuring stream_live_notifications""" + insight_class: Optional[List[str]] = None + """Used for configuring security_insights_alert""" + limit: Optional[List[str]] = None """Used for configuring billing_usage_alert""" @@ -84,7 +87,7 @@ class PolicyFilter(BaseModel): pool_id: Optional[List[str]] = None """Usage depends on specific alert type""" - pop_name: Optional[List[str]] = None + pop_names: Optional[List[str]] = None """Usage depends on specific alert type""" product: Optional[List[str]] = None diff --git a/src/cloudflare/types/alerting/policy_filter_param.py b/src/cloudflare/types/alerting/policy_filter_param.py index b8c1a1b764c..21f67ba264a 100644 --- a/src/cloudflare/types/alerting/policy_filter_param.py +++ b/src/cloudflare/types/alerting/policy_filter_param.py @@ -59,6 +59,9 @@ class PolicyFilterParam(TypedDict, total=False): input_id: List[str] """Used for configuring stream_live_notifications""" + insight_class: List[str] + """Used for configuring security_insights_alert""" + limit: List[str] """Used for configuring billing_usage_alert""" @@ -80,7 +83,7 @@ class PolicyFilterParam(TypedDict, total=False): pool_id: List[str] """Usage depends on specific alert type""" - pop_name: List[str] + pop_names: List[str] """Usage depends on specific alert type""" product: List[str] diff --git a/src/cloudflare/types/alerting/policy_update_params.py b/src/cloudflare/types/alerting/policy_update_params.py index 613f894f620..815c8a05fa1 100644 --- a/src/cloudflare/types/alerting/policy_update_params.py +++ b/src/cloudflare/types/alerting/policy_update_params.py @@ -50,9 +50,9 @@ class PolicyUpdateParams(TypedDict, total=False): "hostname_aop_custom_certificate_expiration_type", "http_alert_edge_error", "http_alert_origin_error", - "incident_alert", "image_notification", "image_resizing_notification", + "incident_alert", "load_balancing_health_alert", "load_balancing_pool_enablement_alert", "logo_match_alert", @@ -75,6 +75,7 @@ class PolicyUpdateParams(TypedDict, total=False): "secondary_dns_warning", "secondary_dns_zone_successfully_updated", "secondary_dns_zone_validation_warning", + "security_insights_alert", "sentinel_alert", "stream_live_notifications", "synthetic_test_latency_alert", diff --git a/tests/api_resources/alerting/test_policies.py b/tests/api_resources/alerting/test_policies.py index 89dc8d18f6b..8211a770ec4 100644 --- a/tests/api_resources/alerting/test_policies.py +++ b/tests/api_resources/alerting/test_policies.py @@ -71,6 +71,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "health_check_id": ["string"], "incident_impact": ["INCIDENT_IMPACT_NONE"], "input_id": ["string"], + "insight_class": ["string"], "limit": ["string"], "logo_tag": ["string"], "megabits_per_second": ["string"], @@ -78,7 +79,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "new_status": ["string"], "packets_per_second": ["string"], "pool_id": ["string"], - "pop_name": ["string"], + "pop_names": ["string"], "product": ["string"], "project_id": ["string"], "protocol": ["string"], @@ -192,6 +193,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "health_check_id": ["string"], "incident_impact": ["INCIDENT_IMPACT_NONE"], "input_id": ["string"], + "insight_class": ["string"], "limit": ["string"], "logo_tag": ["string"], "megabits_per_second": ["string"], @@ -199,7 +201,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "new_status": ["string"], "packets_per_second": ["string"], "pool_id": ["string"], - "pop_name": ["string"], + "pop_names": ["string"], "product": ["string"], "project_id": ["string"], "protocol": ["string"], @@ -474,6 +476,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "health_check_id": ["string"], "incident_impact": ["INCIDENT_IMPACT_NONE"], "input_id": ["string"], + "insight_class": ["string"], "limit": ["string"], "logo_tag": ["string"], "megabits_per_second": ["string"], @@ -481,7 +484,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "new_status": ["string"], "packets_per_second": ["string"], "pool_id": ["string"], - "pop_name": ["string"], + "pop_names": ["string"], "product": ["string"], "project_id": ["string"], "protocol": ["string"], @@ -595,6 +598,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "health_check_id": ["string"], "incident_impact": ["INCIDENT_IMPACT_NONE"], "input_id": ["string"], + "insight_class": ["string"], "limit": ["string"], "logo_tag": ["string"], "megabits_per_second": ["string"], @@ -602,7 +606,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "new_status": ["string"], "packets_per_second": ["string"], "pool_id": ["string"], - "pop_name": ["string"], + "pop_names": ["string"], "product": ["string"], "project_id": ["string"], "protocol": ["string"], From c80c2b079849a06349bbc6469079bd51069e194a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 16:55:21 +0000 Subject: [PATCH 048/358] feat(api): api update (#2400) --- .stats.yml | 2 +- src/cloudflare/types/dns/setting_edit_params.py | 10 +++++++++- .../types/dns/setting_edit_response.py | 16 +++++++++++++++- src/cloudflare/types/dns/setting_get_response.py | 16 +++++++++++++++- tests/api_resources/dns/test_settings.py | 2 ++ 5 files changed, 42 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 536f39d797c..7a6046dba3b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1508 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fc6440a93f6aee5f11262d075db1abe2123bcba78d70b8ec7bb8dd7c8da69401.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bc8740036f5c85815dd08ce4d1787a79b09e8133dc24fcdf8c594aad2c5cc69d.yml diff --git a/src/cloudflare/types/dns/setting_edit_params.py b/src/cloudflare/types/dns/setting_edit_params.py index 3e5b2d51a74..bcf533c5b27 100644 --- a/src/cloudflare/types/dns/setting_edit_params.py +++ b/src/cloudflare/types/dns/setting_edit_params.py @@ -4,7 +4,7 @@ from typing_extensions import Literal, Required, TypedDict -__all__ = ["SettingEditParams", "ZoneDefaults", "ZoneDefaultsNameservers", "ZoneDefaultsSOA"] +__all__ = ["SettingEditParams", "ZoneDefaults", "ZoneDefaultsInternalDNS", "ZoneDefaultsNameservers", "ZoneDefaultsSOA"] class SettingEditParams(TypedDict, total=False): @@ -17,6 +17,11 @@ class SettingEditParams(TypedDict, total=False): zone_defaults: ZoneDefaults +class ZoneDefaultsInternalDNS(TypedDict, total=False): + reference_zone_id: str + """The ID of the zone to fallback to.""" + + class ZoneDefaultsNameservers(TypedDict, total=False): type: Required[Literal["cloudflare.standard", "cloudflare.standard.random", "custom.account", "custom.tenant"]] """Nameserver type""" @@ -68,6 +73,9 @@ class ZoneDefaults(TypedDict, total=False): foundation_dns: bool """Whether to enable Foundation DNS Advanced Nameservers on the zone.""" + internal_dns: ZoneDefaultsInternalDNS + """Settings for this internal zone.""" + multi_provider: bool """ Whether to enable multi-provider DNS, which causes Cloudflare to activate the diff --git a/src/cloudflare/types/dns/setting_edit_response.py b/src/cloudflare/types/dns/setting_edit_response.py index 186fb18e610..0a7564a8f6d 100644 --- a/src/cloudflare/types/dns/setting_edit_response.py +++ b/src/cloudflare/types/dns/setting_edit_response.py @@ -5,7 +5,18 @@ from ..._models import BaseModel -__all__ = ["SettingEditResponse", "ZoneDefaults", "ZoneDefaultsNameservers", "ZoneDefaultsSOA"] +__all__ = [ + "SettingEditResponse", + "ZoneDefaults", + "ZoneDefaultsInternalDNS", + "ZoneDefaultsNameservers", + "ZoneDefaultsSOA", +] + + +class ZoneDefaultsInternalDNS(BaseModel): + reference_zone_id: Optional[str] = None + """The ID of the zone to fallback to.""" class ZoneDefaultsNameservers(BaseModel): @@ -59,6 +70,9 @@ class ZoneDefaults(BaseModel): foundation_dns: Optional[bool] = None """Whether to enable Foundation DNS Advanced Nameservers on the zone.""" + internal_dns: Optional[ZoneDefaultsInternalDNS] = None + """Settings for this internal zone.""" + multi_provider: Optional[bool] = None """ Whether to enable multi-provider DNS, which causes Cloudflare to activate the diff --git a/src/cloudflare/types/dns/setting_get_response.py b/src/cloudflare/types/dns/setting_get_response.py index 778090fdd7a..dd008127b7d 100644 --- a/src/cloudflare/types/dns/setting_get_response.py +++ b/src/cloudflare/types/dns/setting_get_response.py @@ -5,7 +5,18 @@ from ..._models import BaseModel -__all__ = ["SettingGetResponse", "ZoneDefaults", "ZoneDefaultsNameservers", "ZoneDefaultsSOA"] +__all__ = [ + "SettingGetResponse", + "ZoneDefaults", + "ZoneDefaultsInternalDNS", + "ZoneDefaultsNameservers", + "ZoneDefaultsSOA", +] + + +class ZoneDefaultsInternalDNS(BaseModel): + reference_zone_id: Optional[str] = None + """The ID of the zone to fallback to.""" class ZoneDefaultsNameservers(BaseModel): @@ -59,6 +70,9 @@ class ZoneDefaults(BaseModel): foundation_dns: Optional[bool] = None """Whether to enable Foundation DNS Advanced Nameservers on the zone.""" + internal_dns: Optional[ZoneDefaultsInternalDNS] = None + """Settings for this internal zone.""" + multi_provider: Optional[bool] = None """ Whether to enable multi-provider DNS, which causes Cloudflare to activate the diff --git a/tests/api_resources/dns/test_settings.py b/tests/api_resources/dns/test_settings.py index a361bc02499..8c453b87f88 100644 --- a/tests/api_resources/dns/test_settings.py +++ b/tests/api_resources/dns/test_settings.py @@ -33,6 +33,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: zone_defaults={ "flatten_all_cnames": False, "foundation_dns": False, + "internal_dns": {"reference_zone_id": "reference_zone_id"}, "multi_provider": False, "nameservers": {"type": "cloudflare.standard"}, "ns_ttl": 86400, @@ -165,6 +166,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) zone_defaults={ "flatten_all_cnames": False, "foundation_dns": False, + "internal_dns": {"reference_zone_id": "reference_zone_id"}, "multi_provider": False, "nameservers": {"type": "cloudflare.standard"}, "ns_ttl": 86400, From 085287e1fec9e470b8395308b21e3b9cb40d62c8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 17:01:30 +0000 Subject: [PATCH 049/358] feat(api): api update (#2401) --- .stats.yml | 2 +- src/cloudflare/types/dns/setting_edit_params.py | 10 +--------- .../types/dns/setting_edit_response.py | 16 +--------------- src/cloudflare/types/dns/setting_get_response.py | 16 +--------------- tests/api_resources/dns/test_settings.py | 2 -- 5 files changed, 4 insertions(+), 42 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7a6046dba3b..536f39d797c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1508 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bc8740036f5c85815dd08ce4d1787a79b09e8133dc24fcdf8c594aad2c5cc69d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fc6440a93f6aee5f11262d075db1abe2123bcba78d70b8ec7bb8dd7c8da69401.yml diff --git a/src/cloudflare/types/dns/setting_edit_params.py b/src/cloudflare/types/dns/setting_edit_params.py index bcf533c5b27..3e5b2d51a74 100644 --- a/src/cloudflare/types/dns/setting_edit_params.py +++ b/src/cloudflare/types/dns/setting_edit_params.py @@ -4,7 +4,7 @@ from typing_extensions import Literal, Required, TypedDict -__all__ = ["SettingEditParams", "ZoneDefaults", "ZoneDefaultsInternalDNS", "ZoneDefaultsNameservers", "ZoneDefaultsSOA"] +__all__ = ["SettingEditParams", "ZoneDefaults", "ZoneDefaultsNameservers", "ZoneDefaultsSOA"] class SettingEditParams(TypedDict, total=False): @@ -17,11 +17,6 @@ class SettingEditParams(TypedDict, total=False): zone_defaults: ZoneDefaults -class ZoneDefaultsInternalDNS(TypedDict, total=False): - reference_zone_id: str - """The ID of the zone to fallback to.""" - - class ZoneDefaultsNameservers(TypedDict, total=False): type: Required[Literal["cloudflare.standard", "cloudflare.standard.random", "custom.account", "custom.tenant"]] """Nameserver type""" @@ -73,9 +68,6 @@ class ZoneDefaults(TypedDict, total=False): foundation_dns: bool """Whether to enable Foundation DNS Advanced Nameservers on the zone.""" - internal_dns: ZoneDefaultsInternalDNS - """Settings for this internal zone.""" - multi_provider: bool """ Whether to enable multi-provider DNS, which causes Cloudflare to activate the diff --git a/src/cloudflare/types/dns/setting_edit_response.py b/src/cloudflare/types/dns/setting_edit_response.py index 0a7564a8f6d..186fb18e610 100644 --- a/src/cloudflare/types/dns/setting_edit_response.py +++ b/src/cloudflare/types/dns/setting_edit_response.py @@ -5,18 +5,7 @@ from ..._models import BaseModel -__all__ = [ - "SettingEditResponse", - "ZoneDefaults", - "ZoneDefaultsInternalDNS", - "ZoneDefaultsNameservers", - "ZoneDefaultsSOA", -] - - -class ZoneDefaultsInternalDNS(BaseModel): - reference_zone_id: Optional[str] = None - """The ID of the zone to fallback to.""" +__all__ = ["SettingEditResponse", "ZoneDefaults", "ZoneDefaultsNameservers", "ZoneDefaultsSOA"] class ZoneDefaultsNameservers(BaseModel): @@ -70,9 +59,6 @@ class ZoneDefaults(BaseModel): foundation_dns: Optional[bool] = None """Whether to enable Foundation DNS Advanced Nameservers on the zone.""" - internal_dns: Optional[ZoneDefaultsInternalDNS] = None - """Settings for this internal zone.""" - multi_provider: Optional[bool] = None """ Whether to enable multi-provider DNS, which causes Cloudflare to activate the diff --git a/src/cloudflare/types/dns/setting_get_response.py b/src/cloudflare/types/dns/setting_get_response.py index dd008127b7d..778090fdd7a 100644 --- a/src/cloudflare/types/dns/setting_get_response.py +++ b/src/cloudflare/types/dns/setting_get_response.py @@ -5,18 +5,7 @@ from ..._models import BaseModel -__all__ = [ - "SettingGetResponse", - "ZoneDefaults", - "ZoneDefaultsInternalDNS", - "ZoneDefaultsNameservers", - "ZoneDefaultsSOA", -] - - -class ZoneDefaultsInternalDNS(BaseModel): - reference_zone_id: Optional[str] = None - """The ID of the zone to fallback to.""" +__all__ = ["SettingGetResponse", "ZoneDefaults", "ZoneDefaultsNameservers", "ZoneDefaultsSOA"] class ZoneDefaultsNameservers(BaseModel): @@ -70,9 +59,6 @@ class ZoneDefaults(BaseModel): foundation_dns: Optional[bool] = None """Whether to enable Foundation DNS Advanced Nameservers on the zone.""" - internal_dns: Optional[ZoneDefaultsInternalDNS] = None - """Settings for this internal zone.""" - multi_provider: Optional[bool] = None """ Whether to enable multi-provider DNS, which causes Cloudflare to activate the diff --git a/tests/api_resources/dns/test_settings.py b/tests/api_resources/dns/test_settings.py index 8c453b87f88..a361bc02499 100644 --- a/tests/api_resources/dns/test_settings.py +++ b/tests/api_resources/dns/test_settings.py @@ -33,7 +33,6 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: zone_defaults={ "flatten_all_cnames": False, "foundation_dns": False, - "internal_dns": {"reference_zone_id": "reference_zone_id"}, "multi_provider": False, "nameservers": {"type": "cloudflare.standard"}, "ns_ttl": 86400, @@ -166,7 +165,6 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) zone_defaults={ "flatten_all_cnames": False, "foundation_dns": False, - "internal_dns": {"reference_zone_id": "reference_zone_id"}, "multi_provider": False, "nameservers": {"type": "cloudflare.standard"}, "ns_ttl": 86400, From 7cb1e77a70187665964f7beda4e64d0237121c16 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 17:20:50 +0000 Subject: [PATCH 050/358] feat(api): api update (#2402) --- .stats.yml | 2 +- src/cloudflare/types/dns/setting_edit_params.py | 10 +++++++++- .../types/dns/setting_edit_response.py | 16 +++++++++++++++- src/cloudflare/types/dns/setting_get_response.py | 16 +++++++++++++++- tests/api_resources/dns/test_settings.py | 2 ++ 5 files changed, 42 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 536f39d797c..7a6046dba3b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1508 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fc6440a93f6aee5f11262d075db1abe2123bcba78d70b8ec7bb8dd7c8da69401.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bc8740036f5c85815dd08ce4d1787a79b09e8133dc24fcdf8c594aad2c5cc69d.yml diff --git a/src/cloudflare/types/dns/setting_edit_params.py b/src/cloudflare/types/dns/setting_edit_params.py index 3e5b2d51a74..bcf533c5b27 100644 --- a/src/cloudflare/types/dns/setting_edit_params.py +++ b/src/cloudflare/types/dns/setting_edit_params.py @@ -4,7 +4,7 @@ from typing_extensions import Literal, Required, TypedDict -__all__ = ["SettingEditParams", "ZoneDefaults", "ZoneDefaultsNameservers", "ZoneDefaultsSOA"] +__all__ = ["SettingEditParams", "ZoneDefaults", "ZoneDefaultsInternalDNS", "ZoneDefaultsNameservers", "ZoneDefaultsSOA"] class SettingEditParams(TypedDict, total=False): @@ -17,6 +17,11 @@ class SettingEditParams(TypedDict, total=False): zone_defaults: ZoneDefaults +class ZoneDefaultsInternalDNS(TypedDict, total=False): + reference_zone_id: str + """The ID of the zone to fallback to.""" + + class ZoneDefaultsNameservers(TypedDict, total=False): type: Required[Literal["cloudflare.standard", "cloudflare.standard.random", "custom.account", "custom.tenant"]] """Nameserver type""" @@ -68,6 +73,9 @@ class ZoneDefaults(TypedDict, total=False): foundation_dns: bool """Whether to enable Foundation DNS Advanced Nameservers on the zone.""" + internal_dns: ZoneDefaultsInternalDNS + """Settings for this internal zone.""" + multi_provider: bool """ Whether to enable multi-provider DNS, which causes Cloudflare to activate the diff --git a/src/cloudflare/types/dns/setting_edit_response.py b/src/cloudflare/types/dns/setting_edit_response.py index 186fb18e610..0a7564a8f6d 100644 --- a/src/cloudflare/types/dns/setting_edit_response.py +++ b/src/cloudflare/types/dns/setting_edit_response.py @@ -5,7 +5,18 @@ from ..._models import BaseModel -__all__ = ["SettingEditResponse", "ZoneDefaults", "ZoneDefaultsNameservers", "ZoneDefaultsSOA"] +__all__ = [ + "SettingEditResponse", + "ZoneDefaults", + "ZoneDefaultsInternalDNS", + "ZoneDefaultsNameservers", + "ZoneDefaultsSOA", +] + + +class ZoneDefaultsInternalDNS(BaseModel): + reference_zone_id: Optional[str] = None + """The ID of the zone to fallback to.""" class ZoneDefaultsNameservers(BaseModel): @@ -59,6 +70,9 @@ class ZoneDefaults(BaseModel): foundation_dns: Optional[bool] = None """Whether to enable Foundation DNS Advanced Nameservers on the zone.""" + internal_dns: Optional[ZoneDefaultsInternalDNS] = None + """Settings for this internal zone.""" + multi_provider: Optional[bool] = None """ Whether to enable multi-provider DNS, which causes Cloudflare to activate the diff --git a/src/cloudflare/types/dns/setting_get_response.py b/src/cloudflare/types/dns/setting_get_response.py index 778090fdd7a..dd008127b7d 100644 --- a/src/cloudflare/types/dns/setting_get_response.py +++ b/src/cloudflare/types/dns/setting_get_response.py @@ -5,7 +5,18 @@ from ..._models import BaseModel -__all__ = ["SettingGetResponse", "ZoneDefaults", "ZoneDefaultsNameservers", "ZoneDefaultsSOA"] +__all__ = [ + "SettingGetResponse", + "ZoneDefaults", + "ZoneDefaultsInternalDNS", + "ZoneDefaultsNameservers", + "ZoneDefaultsSOA", +] + + +class ZoneDefaultsInternalDNS(BaseModel): + reference_zone_id: Optional[str] = None + """The ID of the zone to fallback to.""" class ZoneDefaultsNameservers(BaseModel): @@ -59,6 +70,9 @@ class ZoneDefaults(BaseModel): foundation_dns: Optional[bool] = None """Whether to enable Foundation DNS Advanced Nameservers on the zone.""" + internal_dns: Optional[ZoneDefaultsInternalDNS] = None + """Settings for this internal zone.""" + multi_provider: Optional[bool] = None """ Whether to enable multi-provider DNS, which causes Cloudflare to activate the diff --git a/tests/api_resources/dns/test_settings.py b/tests/api_resources/dns/test_settings.py index a361bc02499..8c453b87f88 100644 --- a/tests/api_resources/dns/test_settings.py +++ b/tests/api_resources/dns/test_settings.py @@ -33,6 +33,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: zone_defaults={ "flatten_all_cnames": False, "foundation_dns": False, + "internal_dns": {"reference_zone_id": "reference_zone_id"}, "multi_provider": False, "nameservers": {"type": "cloudflare.standard"}, "ns_ttl": 86400, @@ -165,6 +166,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) zone_defaults={ "flatten_all_cnames": False, "foundation_dns": False, + "internal_dns": {"reference_zone_id": "reference_zone_id"}, "multi_provider": False, "nameservers": {"type": "cloudflare.standard"}, "ns_ttl": 86400, From 0806e465233ef01afdda097b560903a40ccfd0c8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 21:32:51 +0000 Subject: [PATCH 051/358] chore(internal): codegen related update (#2403) --- tests/api_resources/test_ai.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/api_resources/test_ai.py b/tests/api_resources/test_ai.py index ed27ad26aca..f25b3e34f7e 100644 --- a/tests/api_resources/test_ai.py +++ b/tests/api_resources/test_ai.py @@ -91,7 +91,7 @@ def test_method_run_with_all_params_overload_2(self, client: Cloudflare) -> None image_b64="image_b64", mask=[0], negative_prompt="negative_prompt", - num_steps=0, + num_steps=20, seed=0, strength=0, width=256, @@ -910,7 +910,7 @@ async def test_method_run_with_all_params_overload_2(self, async_client: AsyncCl image_b64="image_b64", mask=[0], negative_prompt="negative_prompt", - num_steps=0, + num_steps=20, seed=0, strength=0, width=256, From 547fcd779f58e9903799c3d1649734e73b5ecf49 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Jan 2025 15:27:08 +0000 Subject: [PATCH 052/358] chore(internal): codegen related update (#2405) --- tests/api_resources/rulesets/test_rules.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/api_resources/rulesets/test_rules.py b/tests/api_resources/rulesets/test_rules.py index d57aa588aa2..644f4f3952d 100644 --- a/tests/api_resources/rulesets/test_rules.py +++ b/tests/api_resources/rulesets/test_rules.py @@ -807,8 +807,8 @@ def test_method_create_with_all_params_overload_9(self, client: Cloudflare) -> N } }, "uri": { - "path": {"expression": 'regex_replace(http.request.uri.path, "/bar$", "/baz")'}, - "query": {"expression": 'regex_replace(http.request.uri.query, "foo=bar", "")'}, + "path": {"value": "/images"}, + "query": {"value": "/images"}, }, }, description="Add a header when the IP address is not 1.1.1.1", @@ -2771,8 +2771,8 @@ def test_method_edit_with_all_params_overload_9(self, client: Cloudflare) -> Non } }, "uri": { - "path": {"expression": 'regex_replace(http.request.uri.path, "/bar$", "/baz")'}, - "query": {"expression": 'regex_replace(http.request.uri.query, "foo=bar", "")'}, + "path": {"value": "/images"}, + "query": {"value": "/images"}, }, }, description="Add a header when the IP address is not 1.1.1.1", @@ -4682,8 +4682,8 @@ async def test_method_create_with_all_params_overload_9(self, async_client: Asyn } }, "uri": { - "path": {"expression": 'regex_replace(http.request.uri.path, "/bar$", "/baz")'}, - "query": {"expression": 'regex_replace(http.request.uri.query, "foo=bar", "")'}, + "path": {"value": "/images"}, + "query": {"value": "/images"}, }, }, description="Add a header when the IP address is not 1.1.1.1", @@ -6646,8 +6646,8 @@ async def test_method_edit_with_all_params_overload_9(self, async_client: AsyncC } }, "uri": { - "path": {"expression": 'regex_replace(http.request.uri.path, "/bar$", "/baz")'}, - "query": {"expression": 'regex_replace(http.request.uri.query, "foo=bar", "")'}, + "path": {"value": "/images"}, + "query": {"value": "/images"}, }, }, description="Add a header when the IP address is not 1.1.1.1", From e4e5b00e8618ce2f287362aa0a77412477621d3d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Jan 2025 20:57:11 +0000 Subject: [PATCH 053/358] feat(api): api update (#2406) --- .stats.yml | 4 +- api.md | 8 - src/cloudflare/resources/abuse_reports.py | 84 +++++--- .../custom_hostnames/custom_hostnames.py | 20 +- .../resources/magic_transit/sites/sites.py | 20 +- .../resources/radar/attacks/layer3/summary.py | 174 ---------------- .../radar/attacks/layer3/timeseries_groups.py | 186 ------------------ .../resources/radar/attacks/layer7/summary.py | 172 ---------------- .../radar/attacks/layer7/timeseries_groups.py | 184 ----------------- src/cloudflare/resources/radar/datasets.py | 4 +- src/cloudflare/resources/radar/dns/top.py | 32 +-- src/cloudflare/resources/radar/http/top.py | 8 - .../access/infrastructure/targets.py | 60 ++++++ .../abuse_report_create_params.py | 67 +++++-- .../custom_hostname_create_params.py | 15 +- .../custom_hostname_edit_params.py | 15 +- .../types/magic_transit/site_list_params.py | 2 +- .../types/magic_transit/sites/dhcp_server.py | 4 +- .../magic_transit/sites/dhcp_server_param.py | 4 +- .../types/radar/attacks/layer3/__init__.py | 4 - .../attacks/layer3/summary_get_params.py | 53 ----- .../attacks/layer3/summary_get_response.py | 69 ------- .../layer3/timeseries_group_get_params.py | 60 ------ .../layer3/timeseries_group_get_response.py | 75 ------- .../types/radar/attacks/layer7/__init__.py | 4 - .../attacks/layer7/summary_get_params.py | 53 ----- .../attacks/layer7/summary_get_response.py | 75 ------- .../layer7/timeseries_group_get_params.py | 60 ------ .../layer7/timeseries_group_get_response.py | 81 -------- .../types/radar/dns/top_ases_params.py | 8 +- .../types/radar/dns/top_locations_params.py | 8 +- .../radar/http/top_browser_family_params.py | 3 - .../infrastructure/target_list_params.py | 37 ++++ .../magic_transit/sites/test_lans.py | 6 + .../api_resources/magic_transit/test_sites.py | 4 +- .../radar/attacks/layer3/test_summary.py | 79 -------- .../attacks/layer3/test_timeseries_groups.py | 81 -------- .../radar/attacks/layer7/test_summary.py | 79 -------- .../attacks/layer7/test_timeseries_groups.py | 81 -------- tests/api_resources/radar/dns/test_top.py | 56 ++---- tests/api_resources/radar/http/test_top.py | 2 - tests/api_resources/test_abuse_reports.py | 12 +- tests/api_resources/test_custom_hostnames.py | 24 +++ .../access/infrastructure/test_targets.py | 12 ++ 44 files changed, 362 insertions(+), 1727 deletions(-) delete mode 100644 src/cloudflare/types/radar/attacks/layer3/summary_get_params.py delete mode 100644 src/cloudflare/types/radar/attacks/layer3/summary_get_response.py delete mode 100644 src/cloudflare/types/radar/attacks/layer3/timeseries_group_get_params.py delete mode 100644 src/cloudflare/types/radar/attacks/layer3/timeseries_group_get_response.py delete mode 100644 src/cloudflare/types/radar/attacks/layer7/summary_get_params.py delete mode 100644 src/cloudflare/types/radar/attacks/layer7/summary_get_response.py delete mode 100644 src/cloudflare/types/radar/attacks/layer7/timeseries_group_get_params.py delete mode 100644 src/cloudflare/types/radar/attacks/layer7/timeseries_group_get_response.py diff --git a/.stats.yml b/.stats.yml index 7a6046dba3b..1b3d6f07ee2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 1508 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bc8740036f5c85815dd08ce4d1787a79b09e8133dc24fcdf8c594aad2c5cc69d.yml +configured_endpoints: 1504 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9d820228c37e90bcda462f65ab99892171ce6ff3c5ef8ee2cbbced875a95419a.yml diff --git a/api.md b/api.md index f2db084f0e4..fdc548755ae 100644 --- a/api.md +++ b/api.md @@ -7242,7 +7242,6 @@ Types: from cloudflare.types.radar.attacks.layer3 import ( SummaryBitrateResponse, SummaryDurationResponse, - SummaryGetResponse, SummaryIPVersionResponse, SummaryProtocolResponse, SummaryVectorResponse, @@ -7253,7 +7252,6 @@ Methods: - client.radar.attacks.layer3.summary.bitrate(\*\*params) -> SummaryBitrateResponse - client.radar.attacks.layer3.summary.duration(\*\*params) -> SummaryDurationResponse -- client.radar.attacks.layer3.summary.get(\*\*params) -> SummaryGetResponse - client.radar.attacks.layer3.summary.ip_version(\*\*params) -> SummaryIPVersionResponse - client.radar.attacks.layer3.summary.protocol(\*\*params) -> SummaryProtocolResponse - client.radar.attacks.layer3.summary.vector(\*\*params) -> SummaryVectorResponse @@ -7266,7 +7264,6 @@ Types: from cloudflare.types.radar.attacks.layer3 import ( TimeseriesGroupBitrateResponse, TimeseriesGroupDurationResponse, - TimeseriesGroupGetResponse, TimeseriesGroupIndustryResponse, TimeseriesGroupIPVersionResponse, TimeseriesGroupProtocolResponse, @@ -7279,7 +7276,6 @@ Methods: - client.radar.attacks.layer3.timeseries_groups.bitrate(\*\*params) -> TimeseriesGroupBitrateResponse - client.radar.attacks.layer3.timeseries_groups.duration(\*\*params) -> TimeseriesGroupDurationResponse -- client.radar.attacks.layer3.timeseries_groups.get(\*\*params) -> TimeseriesGroupGetResponse - client.radar.attacks.layer3.timeseries_groups.industry(\*\*params) -> TimeseriesGroupIndustryResponse - client.radar.attacks.layer3.timeseries_groups.ip_version(\*\*params) -> TimeseriesGroupIPVersionResponse - client.radar.attacks.layer3.timeseries_groups.protocol(\*\*params) -> TimeseriesGroupProtocolResponse @@ -7335,7 +7331,6 @@ Types: ```python from cloudflare.types.radar.attacks.layer7 import ( - SummaryGetResponse, SummaryHTTPMethodResponse, SummaryHTTPVersionResponse, SummaryIPVersionResponse, @@ -7346,7 +7341,6 @@ from cloudflare.types.radar.attacks.layer7 import ( Methods: -- client.radar.attacks.layer7.summary.get(\*\*params) -> SummaryGetResponse - client.radar.attacks.layer7.summary.http_method(\*\*params) -> SummaryHTTPMethodResponse - client.radar.attacks.layer7.summary.http_version(\*\*params) -> SummaryHTTPVersionResponse - client.radar.attacks.layer7.summary.ip_version(\*\*params) -> SummaryIPVersionResponse @@ -7359,7 +7353,6 @@ Types: ```python from cloudflare.types.radar.attacks.layer7 import ( - TimeseriesGroupGetResponse, TimeseriesGroupHTTPMethodResponse, TimeseriesGroupHTTPVersionResponse, TimeseriesGroupIndustryResponse, @@ -7372,7 +7365,6 @@ from cloudflare.types.radar.attacks.layer7 import ( Methods: -- client.radar.attacks.layer7.timeseries_groups.get(\*\*params) -> TimeseriesGroupGetResponse - client.radar.attacks.layer7.timeseries_groups.http_method(\*\*params) -> TimeseriesGroupHTTPMethodResponse - client.radar.attacks.layer7.timeseries_groups.http_version(\*\*params) -> TimeseriesGroupHTTPVersionResponse - client.radar.attacks.layer7.timeseries_groups.industry(\*\*params) -> TimeseriesGroupIndustryResponse diff --git a/src/cloudflare/resources/abuse_reports.py b/src/cloudflare/resources/abuse_reports.py index da2da1d6197..a90898c5109 100644 --- a/src/cloudflare/resources/abuse_reports.py +++ b/src/cloudflare/resources/abuse_reports.py @@ -72,6 +72,7 @@ def create( "abuse_registrar_whois", "abuse_ncsei", ], + agree: Literal[0, 1], email: str, email2: str, host_notification: Literal["send", "send-anon", "none"], @@ -80,7 +81,6 @@ def create( urls: str, address1: str | NotGiven = NOT_GIVEN, agent_name: str | NotGiven = NOT_GIVEN, - agree: Literal[0, 1] | NotGiven = NOT_GIVEN, city: str | NotGiven = NOT_GIVEN, comments: str | NotGiven = NOT_GIVEN, company: str | NotGiven = NOT_GIVEN, @@ -114,7 +114,10 @@ def create( act: The abuse report type - email: A valid email of the abuse reporter + agree: Can be `0` for false or `1` for true + + email: A valid email of the abuse reporter. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). email2: Should match the value provided in `email` @@ -129,21 +132,26 @@ def create( urls: A list of valid URLs separated by ‘ ’ (new line character). The list of the URLs should not exceed 250 URLs. All URLs should have the same hostname. Each URL - should be unique - - address1: Text not exceeding 100 characters + should be unique. This field may be released by Cloudflare to third parties such + as the Lumen Database (https://lumendatabase.org/). - agent_name: The name of the copyright holder. Text not exceeding 60 characters. + address1: Text not exceeding 100 characters. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). - agree: Can be 0 or 1 + agent_name: The name of the copyright holder. Text not exceeding 60 characters. This field + may be released by Cloudflare to third parties such as the Lumen Database + (https://lumendatabase.org/). - city: Text not exceeding 255 characters + city: Text not exceeding 255 characters. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). comments: Any additional comments about the infringement not exceeding 2000 characters - company: Text not exceeding 100 characters + company: Text not exceeding 100 characters. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). - country: Text not exceeding 255 characters + country: Text not exceeding 255 characters. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). destination_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of destination IPs should not exceed 30 IP addresses. Each one of the IP addresses @@ -153,11 +161,13 @@ def create( details and the exact steps needed to view the content, not exceeding 5000 characters - name: Text not exceeding 255 characters + name: Text not exceeding 255 characters. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). ncsei_subject_representation: If the submitter is the target of NCSEI in the URLs of the abuse report - original_work: Text not exceeding 255 characters + original_work: Text not exceeding 255 characters. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). ports_protocols: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. The total size of the field should not exceed 2000 characters. Each individual @@ -172,9 +182,11 @@ def create( IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be unique - state: Text not exceeding 255 characters + state: Text not exceeding 255 characters. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). - tele: Text not exceeding 20 characters + tele: Text not exceeding 20 characters. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). title: Text not exceeding 255 characters @@ -201,6 +213,7 @@ def create( body=maybe_transform( { "act": act, + "agree": agree, "email": email, "email2": email2, "host_notification": host_notification, @@ -209,7 +222,6 @@ def create( "urls": urls, "address1": address1, "agent_name": agent_name, - "agree": agree, "city": city, "comments": comments, "company": company, @@ -286,6 +298,7 @@ async def create( "abuse_registrar_whois", "abuse_ncsei", ], + agree: Literal[0, 1], email: str, email2: str, host_notification: Literal["send", "send-anon", "none"], @@ -294,7 +307,6 @@ async def create( urls: str, address1: str | NotGiven = NOT_GIVEN, agent_name: str | NotGiven = NOT_GIVEN, - agree: Literal[0, 1] | NotGiven = NOT_GIVEN, city: str | NotGiven = NOT_GIVEN, comments: str | NotGiven = NOT_GIVEN, company: str | NotGiven = NOT_GIVEN, @@ -328,7 +340,10 @@ async def create( act: The abuse report type - email: A valid email of the abuse reporter + agree: Can be `0` for false or `1` for true + + email: A valid email of the abuse reporter. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). email2: Should match the value provided in `email` @@ -343,21 +358,26 @@ async def create( urls: A list of valid URLs separated by ‘ ’ (new line character). The list of the URLs should not exceed 250 URLs. All URLs should have the same hostname. Each URL - should be unique - - address1: Text not exceeding 100 characters + should be unique. This field may be released by Cloudflare to third parties such + as the Lumen Database (https://lumendatabase.org/). - agent_name: The name of the copyright holder. Text not exceeding 60 characters. + address1: Text not exceeding 100 characters. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). - agree: Can be 0 or 1 + agent_name: The name of the copyright holder. Text not exceeding 60 characters. This field + may be released by Cloudflare to third parties such as the Lumen Database + (https://lumendatabase.org/). - city: Text not exceeding 255 characters + city: Text not exceeding 255 characters. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). comments: Any additional comments about the infringement not exceeding 2000 characters - company: Text not exceeding 100 characters + company: Text not exceeding 100 characters. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). - country: Text not exceeding 255 characters + country: Text not exceeding 255 characters. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). destination_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of destination IPs should not exceed 30 IP addresses. Each one of the IP addresses @@ -367,11 +387,13 @@ async def create( details and the exact steps needed to view the content, not exceeding 5000 characters - name: Text not exceeding 255 characters + name: Text not exceeding 255 characters. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). ncsei_subject_representation: If the submitter is the target of NCSEI in the URLs of the abuse report - original_work: Text not exceeding 255 characters + original_work: Text not exceeding 255 characters. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). ports_protocols: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. The total size of the field should not exceed 2000 characters. Each individual @@ -386,9 +408,11 @@ async def create( IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be unique - state: Text not exceeding 255 characters + state: Text not exceeding 255 characters. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). - tele: Text not exceeding 20 characters + tele: Text not exceeding 20 characters. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). title: Text not exceeding 255 characters @@ -415,6 +439,7 @@ async def create( body=await async_maybe_transform( { "act": act, + "agree": agree, "email": email, "email2": email2, "host_notification": host_notification, @@ -423,7 +448,6 @@ async def create( "urls": urls, "address1": address1, "agent_name": agent_name, - "agree": agree, "city": city, "comments": comments, "company": company, diff --git a/src/cloudflare/resources/custom_hostnames/custom_hostnames.py b/src/cloudflare/resources/custom_hostnames/custom_hostnames.py index 3b5d9488d0c..797adc7312b 100644 --- a/src/cloudflare/resources/custom_hostnames/custom_hostnames.py +++ b/src/cloudflare/resources/custom_hostnames/custom_hostnames.py @@ -90,7 +90,10 @@ def create( 'email' will send an email to the WHOIS contacts on file for the base domain plus hostmaster, postmaster, webmaster, admin, administrator. If http is used and the domain is not already pointing to the Managed CNAME host, the PATCH - method must be used once it is (to complete validation). + method must be used once it is (to complete validation). Enable bundling of + certificates using the custom_cert_bundle field. The bundling process requires + the following condition One certificate in the bundle must use an RSA, and the + other must use an ECDSA. Args: zone_id: Identifier @@ -268,7 +271,10 @@ def edit( When sent with SSL config that matches existing config, used to indicate that hostname should pass domain control validation (DCV). Can also be used to change validation type, e.g., from - 'http' to 'email'. + 'http' to 'email'. Bundle an existing certificate with another certificate by + using the "custom_cert_bundle" field. The bundling process supports combining + certificates as long as the following condition is met. One certificate must use + the RSA algorithm, and the other must use the ECDSA algorithm. Args: zone_id: Identifier @@ -412,7 +418,10 @@ async def create( 'email' will send an email to the WHOIS contacts on file for the base domain plus hostmaster, postmaster, webmaster, admin, administrator. If http is used and the domain is not already pointing to the Managed CNAME host, the PATCH - method must be used once it is (to complete validation). + method must be used once it is (to complete validation). Enable bundling of + certificates using the custom_cert_bundle field. The bundling process requires + the following condition One certificate in the bundle must use an RSA, and the + other must use an ECDSA. Args: zone_id: Identifier @@ -590,7 +599,10 @@ async def edit( When sent with SSL config that matches existing config, used to indicate that hostname should pass domain control validation (DCV). Can also be used to change validation type, e.g., from - 'http' to 'email'. + 'http' to 'email'. Bundle an existing certificate with another certificate by + using the "custom_cert_bundle" field. The bundling process supports combining + certificates as long as the following condition is met. One certificate must use + the RSA algorithm, and the other must use the ECDSA algorithm. Args: zone_id: Identifier diff --git a/src/cloudflare/resources/magic_transit/sites/sites.py b/src/cloudflare/resources/magic_transit/sites/sites.py index e82dabeb01d..6b22efb382c 100644 --- a/src/cloudflare/resources/magic_transit/sites/sites.py +++ b/src/cloudflare/resources/magic_transit/sites/sites.py @@ -230,7 +230,7 @@ def list( self, *, account_id: str, - connector_identifier: str | NotGiven = NOT_GIVEN, + connectorid: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -240,14 +240,14 @@ def list( ) -> SyncSinglePage[Site]: """Lists Sites associated with an account. - Use connector_identifier query param to - return sites where connector_identifier matches either site.ConnectorID or + Use connectorid query param to return + sites where connectorid matches either site.ConnectorID or site.SecondaryConnectorID. Args: account_id: Identifier - connector_identifier: Identifier + connectorid: Identifier extra_headers: Send extra headers @@ -267,7 +267,7 @@ def list( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=maybe_transform({"connector_identifier": connector_identifier}, site_list_params.SiteListParams), + query=maybe_transform({"connectorid": connectorid}, site_list_params.SiteListParams), ), model=Site, ) @@ -609,7 +609,7 @@ def list( self, *, account_id: str, - connector_identifier: str | NotGiven = NOT_GIVEN, + connectorid: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -619,14 +619,14 @@ def list( ) -> AsyncPaginator[Site, AsyncSinglePage[Site]]: """Lists Sites associated with an account. - Use connector_identifier query param to - return sites where connector_identifier matches either site.ConnectorID or + Use connectorid query param to return + sites where connectorid matches either site.ConnectorID or site.SecondaryConnectorID. Args: account_id: Identifier - connector_identifier: Identifier + connectorid: Identifier extra_headers: Send extra headers @@ -646,7 +646,7 @@ def list( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=maybe_transform({"connector_identifier": connector_identifier}, site_list_params.SiteListParams), + query=maybe_transform({"connectorid": connectorid}, site_list_params.SiteListParams), ), model=Site, ) diff --git a/src/cloudflare/resources/radar/attacks/layer3/summary.py b/src/cloudflare/resources/radar/attacks/layer3/summary.py index 9a31318ad6f..da9c2220a2f 100644 --- a/src/cloudflare/resources/radar/attacks/layer3/summary.py +++ b/src/cloudflare/resources/radar/attacks/layer3/summary.py @@ -24,14 +24,12 @@ from ....._wrappers import ResultWrapper from ....._base_client import make_request_options from .....types.radar.attacks.layer3 import ( - summary_get_params, summary_vector_params, summary_bitrate_params, summary_duration_params, summary_protocol_params, summary_ip_version_params, ) -from .....types.radar.attacks.layer3.summary_get_response import SummaryGetResponse from .....types.radar.attacks.layer3.summary_vector_response import SummaryVectorResponse from .....types.radar.attacks.layer3.summary_bitrate_response import SummaryBitrateResponse from .....types.radar.attacks.layer3.summary_duration_response import SummaryDurationResponse @@ -233,86 +231,6 @@ def duration( cast_to=cast(Type[SummaryDurationResponse], ResultWrapper[SummaryDurationResponse]), ) - def get( - self, - *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SummaryGetResponse: - """ - Percentage distribution of network protocols in Layer 3/4 attacks over a given - time period. - - Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. - - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. - - date_end: End of the date range (inclusive). - - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). - - date_start: Array of datetimes to filter the start of a series. - - format: Format results are returned in. - - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. - - name: Array of names that will be used to name the series in responses. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._get( - "/radar/attacks/layer3/summary", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "asn": asn, - "continent": continent, - "date_end": date_end, - "date_range": date_range, - "date_start": date_start, - "format": format, - "location": location, - "name": name, - }, - summary_get_params.SummaryGetParams, - ), - post_parser=ResultWrapper[SummaryGetResponse]._unwrapper, - ), - cast_to=cast(Type[SummaryGetResponse], ResultWrapper[SummaryGetResponse]), - ) - def ip_version( self, *, @@ -761,86 +679,6 @@ async def duration( cast_to=cast(Type[SummaryDurationResponse], ResultWrapper[SummaryDurationResponse]), ) - async def get( - self, - *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SummaryGetResponse: - """ - Percentage distribution of network protocols in Layer 3/4 attacks over a given - time period. - - Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. - - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. - - date_end: End of the date range (inclusive). - - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). - - date_start: Array of datetimes to filter the start of a series. - - format: Format results are returned in. - - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. - - name: Array of names that will be used to name the series in responses. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return await self._get( - "/radar/attacks/layer3/summary", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "asn": asn, - "continent": continent, - "date_end": date_end, - "date_range": date_range, - "date_start": date_start, - "format": format, - "location": location, - "name": name, - }, - summary_get_params.SummaryGetParams, - ), - post_parser=ResultWrapper[SummaryGetResponse]._unwrapper, - ), - cast_to=cast(Type[SummaryGetResponse], ResultWrapper[SummaryGetResponse]), - ) - async def ip_version( self, *, @@ -1107,9 +945,6 @@ def __init__(self, summary: SummaryResource) -> None: self.duration = to_raw_response_wrapper( summary.duration, ) - self.get = to_raw_response_wrapper( - summary.get, - ) self.ip_version = to_raw_response_wrapper( summary.ip_version, ) @@ -1131,9 +966,6 @@ def __init__(self, summary: AsyncSummaryResource) -> None: self.duration = async_to_raw_response_wrapper( summary.duration, ) - self.get = async_to_raw_response_wrapper( - summary.get, - ) self.ip_version = async_to_raw_response_wrapper( summary.ip_version, ) @@ -1155,9 +987,6 @@ def __init__(self, summary: SummaryResource) -> None: self.duration = to_streamed_response_wrapper( summary.duration, ) - self.get = to_streamed_response_wrapper( - summary.get, - ) self.ip_version = to_streamed_response_wrapper( summary.ip_version, ) @@ -1179,9 +1008,6 @@ def __init__(self, summary: AsyncSummaryResource) -> None: self.duration = async_to_streamed_response_wrapper( summary.duration, ) - self.get = async_to_streamed_response_wrapper( - summary.get, - ) self.ip_version = async_to_streamed_response_wrapper( summary.ip_version, ) diff --git a/src/cloudflare/resources/radar/attacks/layer3/timeseries_groups.py b/src/cloudflare/resources/radar/attacks/layer3/timeseries_groups.py index 5e4bdd99bc1..3aab1090265 100644 --- a/src/cloudflare/resources/radar/attacks/layer3/timeseries_groups.py +++ b/src/cloudflare/resources/radar/attacks/layer3/timeseries_groups.py @@ -24,7 +24,6 @@ from ....._wrappers import ResultWrapper from ....._base_client import make_request_options from .....types.radar.attacks.layer3 import ( - timeseries_group_get_params, timeseries_group_vector_params, timeseries_group_bitrate_params, timeseries_group_duration_params, @@ -33,7 +32,6 @@ timeseries_group_vertical_params, timeseries_group_ip_version_params, ) -from .....types.radar.attacks.layer3.timeseries_group_get_response import TimeseriesGroupGetResponse from .....types.radar.attacks.layer3.timeseries_group_vector_response import TimeseriesGroupVectorResponse from .....types.radar.attacks.layer3.timeseries_group_bitrate_response import TimeseriesGroupBitrateResponse from .....types.radar.attacks.layer3.timeseries_group_duration_response import TimeseriesGroupDurationResponse @@ -259,92 +257,6 @@ def duration( cast_to=cast(Type[TimeseriesGroupDurationResponse], ResultWrapper[TimeseriesGroupDurationResponse]), ) - def get( - self, - *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TimeseriesGroupGetResponse: - """ - Get a time series of the percentage distribution of network protocols in Layer - 3/4 attacks. - - Args: - agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes - or 1 hour intervals). Refer to - [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. - - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. - - date_end: End of the date range (inclusive). - - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). - - date_start: Array of datetimes to filter the start of a series. - - format: Format results are returned in. - - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. - - name: Array of names that will be used to name the series in responses. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._get( - "/radar/attacks/layer3/timeseries_groups", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "agg_interval": agg_interval, - "asn": asn, - "continent": continent, - "date_end": date_end, - "date_range": date_range, - "date_start": date_start, - "format": format, - "location": location, - "name": name, - }, - timeseries_group_get_params.TimeseriesGroupGetParams, - ), - post_parser=ResultWrapper[TimeseriesGroupGetResponse]._unwrapper, - ), - cast_to=cast(Type[TimeseriesGroupGetResponse], ResultWrapper[TimeseriesGroupGetResponse]), - ) - def industry( self, *, @@ -1052,92 +964,6 @@ async def duration( cast_to=cast(Type[TimeseriesGroupDurationResponse], ResultWrapper[TimeseriesGroupDurationResponse]), ) - async def get( - self, - *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TimeseriesGroupGetResponse: - """ - Get a time series of the percentage distribution of network protocols in Layer - 3/4 attacks. - - Args: - agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes - or 1 hour intervals). Refer to - [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. - - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. - - date_end: End of the date range (inclusive). - - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). - - date_start: Array of datetimes to filter the start of a series. - - format: Format results are returned in. - - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. - - name: Array of names that will be used to name the series in responses. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return await self._get( - "/radar/attacks/layer3/timeseries_groups", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "agg_interval": agg_interval, - "asn": asn, - "continent": continent, - "date_end": date_end, - "date_range": date_range, - "date_start": date_start, - "format": format, - "location": location, - "name": name, - }, - timeseries_group_get_params.TimeseriesGroupGetParams, - ), - post_parser=ResultWrapper[TimeseriesGroupGetResponse]._unwrapper, - ), - cast_to=cast(Type[TimeseriesGroupGetResponse], ResultWrapper[TimeseriesGroupGetResponse]), - ) - async def industry( self, *, @@ -1641,9 +1467,6 @@ def __init__(self, timeseries_groups: TimeseriesGroupsResource) -> None: self.duration = to_raw_response_wrapper( timeseries_groups.duration, ) - self.get = to_raw_response_wrapper( - timeseries_groups.get, - ) self.industry = to_raw_response_wrapper( timeseries_groups.industry, ) @@ -1671,9 +1494,6 @@ def __init__(self, timeseries_groups: AsyncTimeseriesGroupsResource) -> None: self.duration = async_to_raw_response_wrapper( timeseries_groups.duration, ) - self.get = async_to_raw_response_wrapper( - timeseries_groups.get, - ) self.industry = async_to_raw_response_wrapper( timeseries_groups.industry, ) @@ -1701,9 +1521,6 @@ def __init__(self, timeseries_groups: TimeseriesGroupsResource) -> None: self.duration = to_streamed_response_wrapper( timeseries_groups.duration, ) - self.get = to_streamed_response_wrapper( - timeseries_groups.get, - ) self.industry = to_streamed_response_wrapper( timeseries_groups.industry, ) @@ -1731,9 +1548,6 @@ def __init__(self, timeseries_groups: AsyncTimeseriesGroupsResource) -> None: self.duration = async_to_streamed_response_wrapper( timeseries_groups.duration, ) - self.get = async_to_streamed_response_wrapper( - timeseries_groups.get, - ) self.industry = async_to_streamed_response_wrapper( timeseries_groups.industry, ) diff --git a/src/cloudflare/resources/radar/attacks/layer7/summary.py b/src/cloudflare/resources/radar/attacks/layer7/summary.py index ff08b2a712b..64036045174 100644 --- a/src/cloudflare/resources/radar/attacks/layer7/summary.py +++ b/src/cloudflare/resources/radar/attacks/layer7/summary.py @@ -24,14 +24,12 @@ from ....._wrappers import ResultWrapper from ....._base_client import make_request_options from .....types.radar.attacks.layer7 import ( - summary_get_params, summary_ip_version_params, summary_http_method_params, summary_http_version_params, summary_managed_rules_params, summary_mitigation_product_params, ) -from .....types.radar.attacks.layer7.summary_get_response import SummaryGetResponse from .....types.radar.attacks.layer7.summary_ip_version_response import SummaryIPVersionResponse from .....types.radar.attacks.layer7.summary_http_method_response import SummaryHTTPMethodResponse from .....types.radar.attacks.layer7.summary_http_version_response import SummaryHTTPVersionResponse @@ -61,85 +59,6 @@ def with_streaming_response(self) -> SummaryResourceWithStreamingResponse: """ return SummaryResourceWithStreamingResponse(self) - def get( - self, - *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SummaryGetResponse: - """ - Percentage distribution of mitigation techniques in Layer 7 attacks. - - Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. - - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. - - date_end: End of the date range (inclusive). - - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). - - date_start: Array of datetimes to filter the start of a series. - - format: Format results are returned in. - - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. - - name: Array of names that will be used to name the series in responses. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._get( - "/radar/attacks/layer7/summary", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "asn": asn, - "continent": continent, - "date_end": date_end, - "date_range": date_range, - "date_start": date_start, - "format": format, - "location": location, - "name": name, - }, - summary_get_params.SummaryGetParams, - ), - post_parser=ResultWrapper[SummaryGetResponse]._unwrapper, - ), - cast_to=cast(Type[SummaryGetResponse], ResultWrapper[SummaryGetResponse]), - ) - def http_method( self, *, @@ -855,85 +774,6 @@ def with_streaming_response(self) -> AsyncSummaryResourceWithStreamingResponse: """ return AsyncSummaryResourceWithStreamingResponse(self) - async def get( - self, - *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SummaryGetResponse: - """ - Percentage distribution of mitigation techniques in Layer 7 attacks. - - Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. - - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. - - date_end: End of the date range (inclusive). - - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). - - date_start: Array of datetimes to filter the start of a series. - - format: Format results are returned in. - - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. - - name: Array of names that will be used to name the series in responses. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return await self._get( - "/radar/attacks/layer7/summary", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "asn": asn, - "continent": continent, - "date_end": date_end, - "date_range": date_range, - "date_start": date_start, - "format": format, - "location": location, - "name": name, - }, - summary_get_params.SummaryGetParams, - ), - post_parser=ResultWrapper[SummaryGetResponse]._unwrapper, - ), - cast_to=cast(Type[SummaryGetResponse], ResultWrapper[SummaryGetResponse]), - ) - async def http_method( self, *, @@ -1633,9 +1473,6 @@ class SummaryResourceWithRawResponse: def __init__(self, summary: SummaryResource) -> None: self._summary = summary - self.get = to_raw_response_wrapper( - summary.get, - ) self.http_method = to_raw_response_wrapper( summary.http_method, ) @@ -1657,9 +1494,6 @@ class AsyncSummaryResourceWithRawResponse: def __init__(self, summary: AsyncSummaryResource) -> None: self._summary = summary - self.get = async_to_raw_response_wrapper( - summary.get, - ) self.http_method = async_to_raw_response_wrapper( summary.http_method, ) @@ -1681,9 +1515,6 @@ class SummaryResourceWithStreamingResponse: def __init__(self, summary: SummaryResource) -> None: self._summary = summary - self.get = to_streamed_response_wrapper( - summary.get, - ) self.http_method = to_streamed_response_wrapper( summary.http_method, ) @@ -1705,9 +1536,6 @@ class AsyncSummaryResourceWithStreamingResponse: def __init__(self, summary: AsyncSummaryResource) -> None: self._summary = summary - self.get = async_to_streamed_response_wrapper( - summary.get, - ) self.http_method = async_to_streamed_response_wrapper( summary.http_method, ) diff --git a/src/cloudflare/resources/radar/attacks/layer7/timeseries_groups.py b/src/cloudflare/resources/radar/attacks/layer7/timeseries_groups.py index 3d6a273b082..c1678312918 100644 --- a/src/cloudflare/resources/radar/attacks/layer7/timeseries_groups.py +++ b/src/cloudflare/resources/radar/attacks/layer7/timeseries_groups.py @@ -24,7 +24,6 @@ from ....._wrappers import ResultWrapper from ....._base_client import make_request_options from .....types.radar.attacks.layer7 import ( - timeseries_group_get_params, timeseries_group_industry_params, timeseries_group_vertical_params, timeseries_group_ip_version_params, @@ -33,7 +32,6 @@ timeseries_group_managed_rules_params, timeseries_group_mitigation_product_params, ) -from .....types.radar.attacks.layer7.timeseries_group_get_response import TimeseriesGroupGetResponse from .....types.radar.attacks.layer7.timeseries_group_industry_response import TimeseriesGroupIndustryResponse from .....types.radar.attacks.layer7.timeseries_group_vertical_response import TimeseriesGroupVerticalResponse from .....types.radar.attacks.layer7.timeseries_group_ip_version_response import TimeseriesGroupIPVersionResponse @@ -67,91 +65,6 @@ def with_streaming_response(self) -> TimeseriesGroupsResourceWithStreamingRespon """ return TimeseriesGroupsResourceWithStreamingResponse(self) - def get( - self, - *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TimeseriesGroupGetResponse: - """ - Get a time series of the distribution of mitigation techniques over time. - - Args: - agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes - or 1 hour intervals). Refer to - [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. - - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. - - date_end: End of the date range (inclusive). - - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). - - date_start: Array of datetimes to filter the start of a series. - - format: Format results are returned in. - - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. - - name: Array of names that will be used to name the series in responses. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._get( - "/radar/attacks/layer7/timeseries_groups", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "agg_interval": agg_interval, - "asn": asn, - "continent": continent, - "date_end": date_end, - "date_range": date_range, - "date_start": date_start, - "format": format, - "location": location, - "name": name, - }, - timeseries_group_get_params.TimeseriesGroupGetParams, - ), - post_parser=ResultWrapper[TimeseriesGroupGetResponse]._unwrapper, - ), - cast_to=cast(Type[TimeseriesGroupGetResponse], ResultWrapper[TimeseriesGroupGetResponse]), - ) - def http_method( self, *, @@ -1256,91 +1169,6 @@ def with_streaming_response(self) -> AsyncTimeseriesGroupsResourceWithStreamingR """ return AsyncTimeseriesGroupsResourceWithStreamingResponse(self) - async def get( - self, - *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TimeseriesGroupGetResponse: - """ - Get a time series of the distribution of mitigation techniques over time. - - Args: - agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes - or 1 hour intervals). Refer to - [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. - - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. - - date_end: End of the date range (inclusive). - - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). - - date_start: Array of datetimes to filter the start of a series. - - format: Format results are returned in. - - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. - - name: Array of names that will be used to name the series in responses. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return await self._get( - "/radar/attacks/layer7/timeseries_groups", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "agg_interval": agg_interval, - "asn": asn, - "continent": continent, - "date_end": date_end, - "date_range": date_range, - "date_start": date_start, - "format": format, - "location": location, - "name": name, - }, - timeseries_group_get_params.TimeseriesGroupGetParams, - ), - post_parser=ResultWrapper[TimeseriesGroupGetResponse]._unwrapper, - ), - cast_to=cast(Type[TimeseriesGroupGetResponse], ResultWrapper[TimeseriesGroupGetResponse]), - ) - async def http_method( self, *, @@ -2429,9 +2257,6 @@ class TimeseriesGroupsResourceWithRawResponse: def __init__(self, timeseries_groups: TimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.get = to_raw_response_wrapper( - timeseries_groups.get, - ) self.http_method = to_raw_response_wrapper( timeseries_groups.http_method, ) @@ -2459,9 +2284,6 @@ class AsyncTimeseriesGroupsResourceWithRawResponse: def __init__(self, timeseries_groups: AsyncTimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.get = async_to_raw_response_wrapper( - timeseries_groups.get, - ) self.http_method = async_to_raw_response_wrapper( timeseries_groups.http_method, ) @@ -2489,9 +2311,6 @@ class TimeseriesGroupsResourceWithStreamingResponse: def __init__(self, timeseries_groups: TimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.get = to_streamed_response_wrapper( - timeseries_groups.get, - ) self.http_method = to_streamed_response_wrapper( timeseries_groups.http_method, ) @@ -2519,9 +2338,6 @@ class AsyncTimeseriesGroupsResourceWithStreamingResponse: def __init__(self, timeseries_groups: AsyncTimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.get = async_to_streamed_response_wrapper( - timeseries_groups.get, - ) self.http_method = async_to_streamed_response_wrapper( timeseries_groups.http_method, ) diff --git a/src/cloudflare/resources/radar/datasets.py b/src/cloudflare/resources/radar/datasets.py index a5d7eec37f2..21c040a20a7 100644 --- a/src/cloudflare/resources/radar/datasets.py +++ b/src/cloudflare/resources/radar/datasets.py @@ -117,7 +117,7 @@ def download( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> DatasetDownloadResponse: """ - Get a url to download a single dataset. + Get a URL to download a single dataset. Args: format: Format results are returned in. @@ -272,7 +272,7 @@ async def download( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> DatasetDownloadResponse: """ - Get a url to download a single dataset. + Get a URL to download a single dataset. Args: format: Format results are returned in. diff --git a/src/cloudflare/resources/radar/dns/top.py b/src/cloudflare/resources/radar/dns/top.py index dc827517c6b..fb7a902c77e 100644 --- a/src/cloudflare/resources/radar/dns/top.py +++ b/src/cloudflare/resources/radar/dns/top.py @@ -53,12 +53,12 @@ def with_streaming_response(self) -> TopResourceWithStreamingResponse: def ases( self, *, - domain: List[str], asn: List[str] | NotGiven = NOT_GIVEN, continent: List[str] | NotGiven = NOT_GIVEN, date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, date_range: List[str] | NotGiven = NOT_GIVEN, date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, + domain: List[str] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, @@ -75,8 +75,6 @@ def ases( resolver. Args: - domain: Array of domain names. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. For example, `-174, 3356` excludes results from AS174, but includes results from AS3356. @@ -93,6 +91,8 @@ def ases( date_start: Array of datetimes to filter the start of a series. + domain: Array of domain names. + format: Format results are returned in. limit: Limit the number of objects in the response. @@ -120,12 +120,12 @@ def ases( timeout=timeout, query=maybe_transform( { - "domain": domain, "asn": asn, "continent": continent, "date_end": date_end, "date_range": date_range, "date_start": date_start, + "domain": domain, "format": format, "limit": limit, "location": location, @@ -141,12 +141,12 @@ def ases( def locations( self, *, - domain: List[str], asn: List[str] | NotGiven = NOT_GIVEN, continent: List[str] | NotGiven = NOT_GIVEN, date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, date_range: List[str] | NotGiven = NOT_GIVEN, date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, + domain: List[str] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, @@ -162,8 +162,6 @@ def locations( Get top locations by DNS queries made to Cloudflare's public DNS resolver. Args: - domain: Array of domain names. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. For example, `-174, 3356` excludes results from AS174, but includes results from AS3356. @@ -180,6 +178,8 @@ def locations( date_start: Array of datetimes to filter the start of a series. + domain: Array of domain names. + format: Format results are returned in. limit: Limit the number of objects in the response. @@ -207,12 +207,12 @@ def locations( timeout=timeout, query=maybe_transform( { - "domain": domain, "asn": asn, "continent": continent, "date_end": date_end, "date_range": date_range, "date_start": date_start, + "domain": domain, "format": format, "limit": limit, "location": location, @@ -249,12 +249,12 @@ def with_streaming_response(self) -> AsyncTopResourceWithStreamingResponse: async def ases( self, *, - domain: List[str], asn: List[str] | NotGiven = NOT_GIVEN, continent: List[str] | NotGiven = NOT_GIVEN, date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, date_range: List[str] | NotGiven = NOT_GIVEN, date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, + domain: List[str] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, @@ -271,8 +271,6 @@ async def ases( resolver. Args: - domain: Array of domain names. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. For example, `-174, 3356` excludes results from AS174, but includes results from AS3356. @@ -289,6 +287,8 @@ async def ases( date_start: Array of datetimes to filter the start of a series. + domain: Array of domain names. + format: Format results are returned in. limit: Limit the number of objects in the response. @@ -316,12 +316,12 @@ async def ases( timeout=timeout, query=await async_maybe_transform( { - "domain": domain, "asn": asn, "continent": continent, "date_end": date_end, "date_range": date_range, "date_start": date_start, + "domain": domain, "format": format, "limit": limit, "location": location, @@ -337,12 +337,12 @@ async def ases( async def locations( self, *, - domain: List[str], asn: List[str] | NotGiven = NOT_GIVEN, continent: List[str] | NotGiven = NOT_GIVEN, date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, date_range: List[str] | NotGiven = NOT_GIVEN, date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, + domain: List[str] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, @@ -358,8 +358,6 @@ async def locations( Get top locations by DNS queries made to Cloudflare's public DNS resolver. Args: - domain: Array of domain names. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. For example, `-174, 3356` excludes results from AS174, but includes results from AS3356. @@ -376,6 +374,8 @@ async def locations( date_start: Array of datetimes to filter the start of a series. + domain: Array of domain names. + format: Format results are returned in. limit: Limit the number of objects in the response. @@ -403,12 +403,12 @@ async def locations( timeout=timeout, query=await async_maybe_transform( { - "domain": domain, "asn": asn, "continent": continent, "date_end": date_end, "date_range": date_range, "date_start": date_start, + "domain": domain, "format": format, "limit": limit, "location": location, diff --git a/src/cloudflare/resources/radar/http/top.py b/src/cloudflare/resources/radar/http/top.py index f66f82dc348..bee2512dedb 100644 --- a/src/cloudflare/resources/radar/http/top.py +++ b/src/cloudflare/resources/radar/http/top.py @@ -174,7 +174,6 @@ def browser_family( *, asn: List[str] | NotGiven = NOT_GIVEN, bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, continent: List[str] | NotGiven = NOT_GIVEN, date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, date_range: List[str] | NotGiven = NOT_GIVEN, @@ -210,8 +209,6 @@ def browser_family( bot_class: Filter for bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - browser_family: Filter for browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start with `-` to exclude from results. For example, `-EU,NA` excludes results from Europe, but includes results from North America. @@ -265,7 +262,6 @@ def browser_family( { "asn": asn, "bot_class": bot_class, - "browser_family": browser_family, "continent": continent, "date_end": date_end, "date_range": date_range, @@ -433,7 +429,6 @@ async def browser_family( *, asn: List[str] | NotGiven = NOT_GIVEN, bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, continent: List[str] | NotGiven = NOT_GIVEN, date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, date_range: List[str] | NotGiven = NOT_GIVEN, @@ -469,8 +464,6 @@ async def browser_family( bot_class: Filter for bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - browser_family: Filter for browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start with `-` to exclude from results. For example, `-EU,NA` excludes results from Europe, but includes results from North America. @@ -524,7 +517,6 @@ async def browser_family( { "asn": asn, "bot_class": bot_class, - "browser_family": browser_family, "continent": continent, "date_end": date_end, "date_range": date_range, diff --git a/src/cloudflare/resources/zero_trust/access/infrastructure/targets.py b/src/cloudflare/resources/zero_trust/access/infrastructure/targets.py index 22f11c9e6fc..b9bab8582a4 100644 --- a/src/cloudflare/resources/zero_trust/access/infrastructure/targets.py +++ b/src/cloudflare/resources/zero_trust/access/infrastructure/targets.py @@ -181,14 +181,20 @@ def list( direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, hostname: Optional[str] | NotGiven = NOT_GIVEN, hostname_contains: Optional[str] | NotGiven = NOT_GIVEN, + ip_like: Optional[str] | NotGiven = NOT_GIVEN, ip_v4: Optional[str] | NotGiven = NOT_GIVEN, ip_v6: Optional[str] | NotGiven = NOT_GIVEN, ips: List[str] | NotGiven = NOT_GIVEN, + ipv4_end: Optional[str] | NotGiven = NOT_GIVEN, + ipv4_start: Optional[str] | NotGiven = NOT_GIVEN, + ipv6_end: Optional[str] | NotGiven = NOT_GIVEN, + ipv6_start: Optional[str] | NotGiven = NOT_GIVEN, modified_after: Union[str, datetime, None] | NotGiven = NOT_GIVEN, modified_before: Union[str, datetime, None] | NotGiven = NOT_GIVEN, order: Literal["hostname", "created_at"] | NotGiven = NOT_GIVEN, page: int | NotGiven = NOT_GIVEN, per_page: int | NotGiven = NOT_GIVEN, + target_ids: List[str] | NotGiven = NOT_GIVEN, virtual_network_id: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -215,6 +221,9 @@ def list( hostname_contains: Partial match to the hostname of a target + ip_like: Filters for targets whose IP addresses look like the specified string. Supports + `*` as a wildcard character + ip_v4: IPv4 address of the target ip_v6: IPv6 address of the target @@ -222,6 +231,18 @@ def list( ips: Filters for targets that have any of the following IP addresses. Specify `ips` multiple times in query parameter to build list of candidates. + ipv4_end: Defines an IPv4 filter range's ending value (inclusive). Requires `ipv4_start` + to be specified as well. + + ipv4_start: Defines an IPv4 filter range's starting value (inclusive). Requires `ipv4_end` + to be specified as well. + + ipv6_end: Defines an IPv6 filter range's ending value (inclusive). Requires `ipv6_start` + to be specified as well. + + ipv6_start: Defines an IPv6 filter range's starting value (inclusive). Requires `ipv6_end` + to be specified as well. + modified_after: Date and time at which the target was modified after (inclusive) modified_before: Date and time at which the target was modified before (inclusive) @@ -232,6 +253,9 @@ def list( per_page: Max amount of entries returned per page + target_ids: Filters for targets that have any of the following UUIDs. Specify `target_ids` + multiple times in query parameter to build list of candidates. + virtual_network_id: Private virtual network identifier of the target extra_headers: Send extra headers @@ -259,14 +283,20 @@ def list( "direction": direction, "hostname": hostname, "hostname_contains": hostname_contains, + "ip_like": ip_like, "ip_v4": ip_v4, "ip_v6": ip_v6, "ips": ips, + "ipv4_end": ipv4_end, + "ipv4_start": ipv4_start, + "ipv6_end": ipv6_end, + "ipv6_start": ipv6_start, "modified_after": modified_after, "modified_before": modified_before, "order": order, "page": page, "per_page": per_page, + "target_ids": target_ids, "virtual_network_id": virtual_network_id, }, target_list_params.TargetListParams, @@ -576,14 +606,20 @@ def list( direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, hostname: Optional[str] | NotGiven = NOT_GIVEN, hostname_contains: Optional[str] | NotGiven = NOT_GIVEN, + ip_like: Optional[str] | NotGiven = NOT_GIVEN, ip_v4: Optional[str] | NotGiven = NOT_GIVEN, ip_v6: Optional[str] | NotGiven = NOT_GIVEN, ips: List[str] | NotGiven = NOT_GIVEN, + ipv4_end: Optional[str] | NotGiven = NOT_GIVEN, + ipv4_start: Optional[str] | NotGiven = NOT_GIVEN, + ipv6_end: Optional[str] | NotGiven = NOT_GIVEN, + ipv6_start: Optional[str] | NotGiven = NOT_GIVEN, modified_after: Union[str, datetime, None] | NotGiven = NOT_GIVEN, modified_before: Union[str, datetime, None] | NotGiven = NOT_GIVEN, order: Literal["hostname", "created_at"] | NotGiven = NOT_GIVEN, page: int | NotGiven = NOT_GIVEN, per_page: int | NotGiven = NOT_GIVEN, + target_ids: List[str] | NotGiven = NOT_GIVEN, virtual_network_id: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -610,6 +646,9 @@ def list( hostname_contains: Partial match to the hostname of a target + ip_like: Filters for targets whose IP addresses look like the specified string. Supports + `*` as a wildcard character + ip_v4: IPv4 address of the target ip_v6: IPv6 address of the target @@ -617,6 +656,18 @@ def list( ips: Filters for targets that have any of the following IP addresses. Specify `ips` multiple times in query parameter to build list of candidates. + ipv4_end: Defines an IPv4 filter range's ending value (inclusive). Requires `ipv4_start` + to be specified as well. + + ipv4_start: Defines an IPv4 filter range's starting value (inclusive). Requires `ipv4_end` + to be specified as well. + + ipv6_end: Defines an IPv6 filter range's ending value (inclusive). Requires `ipv6_start` + to be specified as well. + + ipv6_start: Defines an IPv6 filter range's starting value (inclusive). Requires `ipv6_end` + to be specified as well. + modified_after: Date and time at which the target was modified after (inclusive) modified_before: Date and time at which the target was modified before (inclusive) @@ -627,6 +678,9 @@ def list( per_page: Max amount of entries returned per page + target_ids: Filters for targets that have any of the following UUIDs. Specify `target_ids` + multiple times in query parameter to build list of candidates. + virtual_network_id: Private virtual network identifier of the target extra_headers: Send extra headers @@ -654,14 +708,20 @@ def list( "direction": direction, "hostname": hostname, "hostname_contains": hostname_contains, + "ip_like": ip_like, "ip_v4": ip_v4, "ip_v6": ip_v6, "ips": ips, + "ipv4_end": ipv4_end, + "ipv4_start": ipv4_start, + "ipv6_end": ipv6_end, + "ipv6_start": ipv6_start, "modified_after": modified_after, "modified_before": modified_before, "order": order, "page": page, "per_page": per_page, + "target_ids": target_ids, "virtual_network_id": virtual_network_id, }, target_list_params.TargetListParams, diff --git a/src/cloudflare/types/abuse_reports/abuse_report_create_params.py b/src/cloudflare/types/abuse_reports/abuse_report_create_params.py index ff19f93f7c5..19b904614bf 100644 --- a/src/cloudflare/types/abuse_reports/abuse_report_create_params.py +++ b/src/cloudflare/types/abuse_reports/abuse_report_create_params.py @@ -24,8 +24,15 @@ class AbuseReportCreateParams(TypedDict, total=False): ] """The abuse report type""" + agree: Required[Literal[0, 1]] + """Can be `0` for false or `1` for true""" + email: Required[str] - """A valid email of the abuse reporter""" + """A valid email of the abuse reporter. + + This field may be released by Cloudflare to third parties such as the Lumen + Database (https://lumendatabase.org/). + """ email2: Required[str] """Should match the value provided in `email`""" @@ -52,29 +59,47 @@ class AbuseReportCreateParams(TypedDict, total=False): """A list of valid URLs separated by ‘ ’ (new line character). The list of the URLs should not exceed 250 URLs. All URLs should have the same - hostname. Each URL should be unique + hostname. Each URL should be unique. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). """ address1: str - """Text not exceeding 100 characters""" + """Text not exceeding 100 characters. + + This field may be released by Cloudflare to third parties such as the Lumen + Database (https://lumendatabase.org/). + """ agent_name: str - """The name of the copyright holder. Text not exceeding 60 characters.""" + """The name of the copyright holder. - agree: Literal[0, 1] - """Can be 0 or 1""" + Text not exceeding 60 characters. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). + """ city: str - """Text not exceeding 255 characters""" + """Text not exceeding 255 characters. + + This field may be released by Cloudflare to third parties such as the Lumen + Database (https://lumendatabase.org/). + """ comments: str """Any additional comments about the infringement not exceeding 2000 characters""" company: str - """Text not exceeding 100 characters""" + """Text not exceeding 100 characters. + + This field may be released by Cloudflare to third parties such as the Lumen + Database (https://lumendatabase.org/). + """ country: str - """Text not exceeding 255 characters""" + """Text not exceeding 255 characters. + + This field may be released by Cloudflare to third parties such as the Lumen + Database (https://lumendatabase.org/). + """ destination_ips: str """A list of IP addresses separated by ‘ ’ (new line character). @@ -91,13 +116,21 @@ class AbuseReportCreateParams(TypedDict, total=False): """ name: str - """Text not exceeding 255 characters""" + """Text not exceeding 255 characters. + + This field may be released by Cloudflare to third parties such as the Lumen + Database (https://lumendatabase.org/). + """ ncsei_subject_representation: bool """If the submitter is the target of NCSEI in the URLs of the abuse report""" original_work: str - """Text not exceeding 255 characters""" + """Text not exceeding 255 characters. + + This field may be released by Cloudflare to third parties such as the Lumen + Database (https://lumendatabase.org/). + """ ports_protocols: str """A comma separated list of ports and protocols e.g. @@ -122,10 +155,18 @@ class AbuseReportCreateParams(TypedDict, total=False): """ state: str - """Text not exceeding 255 characters""" + """Text not exceeding 255 characters. + + This field may be released by Cloudflare to third parties such as the Lumen + Database (https://lumendatabase.org/). + """ tele: str - """Text not exceeding 20 characters""" + """Text not exceeding 20 characters. + + This field may be released by Cloudflare to third parties such as the Lumen + Database (https://lumendatabase.org/). + """ title: str """Text not exceeding 255 characters""" diff --git a/src/cloudflare/types/custom_hostnames/custom_hostname_create_params.py b/src/cloudflare/types/custom_hostnames/custom_hostname_create_params.py index 8a1df196aa6..d9b23bd760e 100644 --- a/src/cloudflare/types/custom_hostnames/custom_hostname_create_params.py +++ b/src/cloudflare/types/custom_hostnames/custom_hostname_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, List +from typing import Dict, List, Iterable from typing_extensions import Literal, Required, TypedDict from .dcv_method import DCVMethod @@ -10,7 +10,7 @@ from ..shared.certificate_ca import CertificateCA from .domain_validation_type import DomainValidationType -__all__ = ["CustomHostnameCreateParams", "SSL", "SSLSettings"] +__all__ = ["CustomHostnameCreateParams", "SSL", "SSLCustomCERTBundle", "SSLSettings"] class CustomHostnameCreateParams(TypedDict, total=False): @@ -30,6 +30,14 @@ class CustomHostnameCreateParams(TypedDict, total=False): """ +class SSLCustomCERTBundle(TypedDict, total=False): + custom_certificate: Required[str] + """If a custom uploaded certificate is used.""" + + custom_key: Required[str] + """The key for a custom uploaded certificate.""" + + class SSLSettings(TypedDict, total=False): ciphers: List[str] """An allowlist of ciphers for TLS termination. @@ -69,6 +77,9 @@ class SSL(TypedDict, total=False): true """ + custom_cert_bundle: Iterable[SSLCustomCERTBundle] + """Array of custom certificate and key pairs (1 or 2 pairs allowed)""" + custom_certificate: str """If a custom uploaded certificate is used.""" diff --git a/src/cloudflare/types/custom_hostnames/custom_hostname_edit_params.py b/src/cloudflare/types/custom_hostnames/custom_hostname_edit_params.py index 57e1ba1ba7c..9639155cb15 100644 --- a/src/cloudflare/types/custom_hostnames/custom_hostname_edit_params.py +++ b/src/cloudflare/types/custom_hostnames/custom_hostname_edit_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, List +from typing import Dict, List, Iterable from typing_extensions import Literal, Required, TypedDict from .dcv_method import DCVMethod @@ -10,7 +10,7 @@ from ..shared.certificate_ca import CertificateCA from .domain_validation_type import DomainValidationType -__all__ = ["CustomHostnameEditParams", "SSL", "SSLSettings"] +__all__ = ["CustomHostnameEditParams", "SSL", "SSLCustomCERTBundle", "SSLSettings"] class CustomHostnameEditParams(TypedDict, total=False): @@ -42,6 +42,14 @@ class CustomHostnameEditParams(TypedDict, total=False): """SSL properties used when creating the custom hostname.""" +class SSLCustomCERTBundle(TypedDict, total=False): + custom_certificate: Required[str] + """If a custom uploaded certificate is used.""" + + custom_key: Required[str] + """The key for a custom uploaded certificate.""" + + class SSLSettings(TypedDict, total=False): ciphers: List[str] """An allowlist of ciphers for TLS termination. @@ -81,6 +89,9 @@ class SSL(TypedDict, total=False): true """ + custom_cert_bundle: Iterable[SSLCustomCERTBundle] + """Array of custom certificate and key pairs (1 or 2 pairs allowed)""" + custom_certificate: str """If a custom uploaded certificate is used.""" diff --git a/src/cloudflare/types/magic_transit/site_list_params.py b/src/cloudflare/types/magic_transit/site_list_params.py index 8f74157c2de..d446c2a2809 100644 --- a/src/cloudflare/types/magic_transit/site_list_params.py +++ b/src/cloudflare/types/magic_transit/site_list_params.py @@ -11,5 +11,5 @@ class SiteListParams(TypedDict, total=False): account_id: Required[str] """Identifier""" - connector_identifier: str + connectorid: str """Identifier""" diff --git a/src/cloudflare/types/magic_transit/sites/dhcp_server.py b/src/cloudflare/types/magic_transit/sites/dhcp_server.py index 2afdcdc65dd..51cce549430 100644 --- a/src/cloudflare/types/magic_transit/sites/dhcp_server.py +++ b/src/cloudflare/types/magic_transit/sites/dhcp_server.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, Optional +from typing import Dict, List, Optional from ...._models import BaseModel @@ -17,5 +17,7 @@ class DHCPServer(BaseModel): dns_server: Optional[str] = None """A valid IPv4 address.""" + dns_servers: Optional[List[str]] = None + reservations: Optional[Dict[str, str]] = None """Mapping of MAC addresses to IP addresses""" diff --git a/src/cloudflare/types/magic_transit/sites/dhcp_server_param.py b/src/cloudflare/types/magic_transit/sites/dhcp_server_param.py index 85bfb2f7745..ac990808ad6 100644 --- a/src/cloudflare/types/magic_transit/sites/dhcp_server_param.py +++ b/src/cloudflare/types/magic_transit/sites/dhcp_server_param.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict +from typing import Dict, List from typing_extensions import TypedDict __all__ = ["DHCPServerParam"] @@ -18,5 +18,7 @@ class DHCPServerParam(TypedDict, total=False): dns_server: str """A valid IPv4 address.""" + dns_servers: List[str] + reservations: Dict[str, str] """Mapping of MAC addresses to IP addresses""" diff --git a/src/cloudflare/types/radar/attacks/layer3/__init__.py b/src/cloudflare/types/radar/attacks/layer3/__init__.py index a0a2f946d4f..5d1d4cd7239 100644 --- a/src/cloudflare/types/radar/attacks/layer3/__init__.py +++ b/src/cloudflare/types/radar/attacks/layer3/__init__.py @@ -2,11 +2,9 @@ from __future__ import annotations -from .summary_get_params import SummaryGetParams as SummaryGetParams from .top_attacks_params import TopAttacksParams as TopAttacksParams from .top_industry_params import TopIndustryParams as TopIndustryParams from .top_vertical_params import TopVerticalParams as TopVerticalParams -from .summary_get_response import SummaryGetResponse as SummaryGetResponse from .top_attacks_response import TopAttacksResponse as TopAttacksResponse from .summary_vector_params import SummaryVectorParams as SummaryVectorParams from .top_industry_response import TopIndustryResponse as TopIndustryResponse @@ -20,8 +18,6 @@ from .summary_ip_version_params import SummaryIPVersionParams as SummaryIPVersionParams from .summary_protocol_response import SummaryProtocolResponse as SummaryProtocolResponse from .summary_ip_version_response import SummaryIPVersionResponse as SummaryIPVersionResponse -from .timeseries_group_get_params import TimeseriesGroupGetParams as TimeseriesGroupGetParams -from .timeseries_group_get_response import TimeseriesGroupGetResponse as TimeseriesGroupGetResponse from .timeseries_group_vector_params import TimeseriesGroupVectorParams as TimeseriesGroupVectorParams from .timeseries_group_bitrate_params import TimeseriesGroupBitrateParams as TimeseriesGroupBitrateParams from .timeseries_group_duration_params import TimeseriesGroupDurationParams as TimeseriesGroupDurationParams diff --git a/src/cloudflare/types/radar/attacks/layer3/summary_get_params.py b/src/cloudflare/types/radar/attacks/layer3/summary_get_params.py deleted file mode 100644 index fe1dae91b19..00000000000 --- a/src/cloudflare/types/radar/attacks/layer3/summary_get_params.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Union -from datetime import datetime -from typing_extensions import Literal, Annotated, TypedDict - -from ....._utils import PropertyInfo - -__all__ = ["SummaryGetParams"] - - -class SummaryGetParams(TypedDict, total=False): - asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. - - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. - """ - - continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). - - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. - """ - - date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] - """End of the date range (inclusive).""" - - date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). - """ - - date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" - - format: Literal["JSON", "CSV"] - """Format results are returned in.""" - - location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). - - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. - """ - - name: List[str] - """Array of names that will be used to name the series in responses.""" diff --git a/src/cloudflare/types/radar/attacks/layer3/summary_get_response.py b/src/cloudflare/types/radar/attacks/layer3/summary_get_response.py deleted file mode 100644 index e332260ec8e..00000000000 --- a/src/cloudflare/types/radar/attacks/layer3/summary_get_response.py +++ /dev/null @@ -1,69 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from datetime import datetime - -from pydantic import Field as FieldInfo - -from ....._models import BaseModel - -__all__ = [ - "SummaryGetResponse", - "Meta", - "MetaDateRange", - "MetaConfidenceInfo", - "MetaConfidenceInfoAnnotation", - "Summary0", -] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - -class MetaConfidenceInfoAnnotation(BaseModel): - data_source: str = FieldInfo(alias="dataSource") - - description: str - - event_type: str = FieldInfo(alias="eventType") - - is_instantaneous: bool = FieldInfo(alias="isInstantaneous") - - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) - - -class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None - - level: Optional[int] = None - - -class Meta(BaseModel): - date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) - - -class Summary0(BaseModel): - gre: str - - icmp: str - - tcp: str - - udp: str - - -class SummaryGetResponse(BaseModel): - meta: Meta - - summary_0: Summary0 diff --git a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_get_params.py b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_get_params.py deleted file mode 100644 index 9ab69b16b82..00000000000 --- a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_get_params.py +++ /dev/null @@ -1,60 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Union -from datetime import datetime -from typing_extensions import Literal, Annotated, TypedDict - -from ....._utils import PropertyInfo - -__all__ = ["TimeseriesGroupGetParams"] - - -class TimeseriesGroupGetParams(TypedDict, total=False): - agg_interval: Annotated[Literal["15m", "1h", "1d", "1w"], PropertyInfo(alias="aggInterval")] - """ - Aggregation interval results should be returned in (for example, in 15 minutes - or 1 hour intervals). Refer to - [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - """ - - asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. - - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. - """ - - continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). - - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. - """ - - date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] - """End of the date range (inclusive).""" - - date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). - """ - - date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" - - format: Literal["JSON", "CSV"] - """Format results are returned in.""" - - location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). - - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. - """ - - name: List[str] - """Array of names that will be used to name the series in responses.""" diff --git a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_get_response.py b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_get_response.py deleted file mode 100644 index ea55dbde517..00000000000 --- a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_get_response.py +++ /dev/null @@ -1,75 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from datetime import datetime - -from pydantic import Field as FieldInfo - -from ....._models import BaseModel - -__all__ = [ - "TimeseriesGroupGetResponse", - "Meta", - "MetaDateRange", - "MetaConfidenceInfo", - "MetaConfidenceInfoAnnotation", - "Serie0", -] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - -class MetaConfidenceInfoAnnotation(BaseModel): - data_source: str = FieldInfo(alias="dataSource") - - description: str - - event_type: str = FieldInfo(alias="eventType") - - is_instantaneous: bool = FieldInfo(alias="isInstantaneous") - - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) - - -class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None - - level: Optional[int] = None - - -class Meta(BaseModel): - agg_interval: str = FieldInfo(alias="aggInterval") - - date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - - last_updated: datetime = FieldInfo(alias="lastUpdated") - - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) - - -class Serie0(BaseModel): - gre: List[str] - - icmp: List[str] - - tcp: List[str] - - timestamps: List[str] - - udp: List[str] - - -class TimeseriesGroupGetResponse(BaseModel): - meta: Meta - - serie_0: Serie0 diff --git a/src/cloudflare/types/radar/attacks/layer7/__init__.py b/src/cloudflare/types/radar/attacks/layer7/__init__.py index 1f41fbea269..c4c0638daa1 100644 --- a/src/cloudflare/types/radar/attacks/layer7/__init__.py +++ b/src/cloudflare/types/radar/attacks/layer7/__init__.py @@ -2,11 +2,9 @@ from __future__ import annotations -from .summary_get_params import SummaryGetParams as SummaryGetParams from .top_attacks_params import TopAttacksParams as TopAttacksParams from .top_industry_params import TopIndustryParams as TopIndustryParams from .top_vertical_params import TopVerticalParams as TopVerticalParams -from .summary_get_response import SummaryGetResponse as SummaryGetResponse from .top_attacks_response import TopAttacksResponse as TopAttacksResponse from .top_industry_response import TopIndustryResponse as TopIndustryResponse from .top_vertical_response import TopVerticalResponse as TopVerticalResponse @@ -14,11 +12,9 @@ from .summary_http_method_params import SummaryHTTPMethodParams as SummaryHTTPMethodParams from .summary_http_version_params import SummaryHTTPVersionParams as SummaryHTTPVersionParams from .summary_ip_version_response import SummaryIPVersionResponse as SummaryIPVersionResponse -from .timeseries_group_get_params import TimeseriesGroupGetParams as TimeseriesGroupGetParams from .summary_http_method_response import SummaryHTTPMethodResponse as SummaryHTTPMethodResponse from .summary_managed_rules_params import SummaryManagedRulesParams as SummaryManagedRulesParams from .summary_http_version_response import SummaryHTTPVersionResponse as SummaryHTTPVersionResponse -from .timeseries_group_get_response import TimeseriesGroupGetResponse as TimeseriesGroupGetResponse from .summary_managed_rules_response import SummaryManagedRulesResponse as SummaryManagedRulesResponse from .timeseries_group_industry_params import TimeseriesGroupIndustryParams as TimeseriesGroupIndustryParams from .timeseries_group_vertical_params import TimeseriesGroupVerticalParams as TimeseriesGroupVerticalParams diff --git a/src/cloudflare/types/radar/attacks/layer7/summary_get_params.py b/src/cloudflare/types/radar/attacks/layer7/summary_get_params.py deleted file mode 100644 index fe1dae91b19..00000000000 --- a/src/cloudflare/types/radar/attacks/layer7/summary_get_params.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Union -from datetime import datetime -from typing_extensions import Literal, Annotated, TypedDict - -from ....._utils import PropertyInfo - -__all__ = ["SummaryGetParams"] - - -class SummaryGetParams(TypedDict, total=False): - asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. - - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. - """ - - continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). - - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. - """ - - date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] - """End of the date range (inclusive).""" - - date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). - """ - - date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" - - format: Literal["JSON", "CSV"] - """Format results are returned in.""" - - location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). - - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. - """ - - name: List[str] - """Array of names that will be used to name the series in responses.""" diff --git a/src/cloudflare/types/radar/attacks/layer7/summary_get_response.py b/src/cloudflare/types/radar/attacks/layer7/summary_get_response.py deleted file mode 100644 index 3830406025a..00000000000 --- a/src/cloudflare/types/radar/attacks/layer7/summary_get_response.py +++ /dev/null @@ -1,75 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from datetime import datetime - -from pydantic import Field as FieldInfo - -from ....._models import BaseModel - -__all__ = [ - "SummaryGetResponse", - "Meta", - "MetaDateRange", - "MetaConfidenceInfo", - "MetaConfidenceInfoAnnotation", - "Summary0", -] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - -class MetaConfidenceInfoAnnotation(BaseModel): - data_source: str = FieldInfo(alias="dataSource") - - description: str - - event_type: str = FieldInfo(alias="eventType") - - is_instantaneous: bool = FieldInfo(alias="isInstantaneous") - - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) - - -class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None - - level: Optional[int] = None - - -class Meta(BaseModel): - date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) - - -class Summary0(BaseModel): - access_rules: str = FieldInfo(alias="ACCESS_RULES") - - api_shield: str = FieldInfo(alias="API_SHIELD") - - bot_management: str = FieldInfo(alias="BOT_MANAGEMENT") - - data_loss_prevention: str = FieldInfo(alias="DATA_LOSS_PREVENTION") - - ddos: str = FieldInfo(alias="DDOS") - - ip_reputation: str = FieldInfo(alias="IP_REPUTATION") - - waf: str = FieldInfo(alias="WAF") - - -class SummaryGetResponse(BaseModel): - meta: Meta - - summary_0: Summary0 diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_get_params.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_get_params.py deleted file mode 100644 index 9ab69b16b82..00000000000 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_get_params.py +++ /dev/null @@ -1,60 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Union -from datetime import datetime -from typing_extensions import Literal, Annotated, TypedDict - -from ....._utils import PropertyInfo - -__all__ = ["TimeseriesGroupGetParams"] - - -class TimeseriesGroupGetParams(TypedDict, total=False): - agg_interval: Annotated[Literal["15m", "1h", "1d", "1w"], PropertyInfo(alias="aggInterval")] - """ - Aggregation interval results should be returned in (for example, in 15 minutes - or 1 hour intervals). Refer to - [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - """ - - asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. - - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. - """ - - continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). - - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. - """ - - date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] - """End of the date range (inclusive).""" - - date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). - """ - - date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" - - format: Literal["JSON", "CSV"] - """Format results are returned in.""" - - location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). - - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. - """ - - name: List[str] - """Array of names that will be used to name the series in responses.""" diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_get_response.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_get_response.py deleted file mode 100644 index 60c8a9d9117..00000000000 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_get_response.py +++ /dev/null @@ -1,81 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from datetime import datetime - -from pydantic import Field as FieldInfo - -from ....._models import BaseModel - -__all__ = [ - "TimeseriesGroupGetResponse", - "Meta", - "MetaDateRange", - "MetaConfidenceInfo", - "MetaConfidenceInfoAnnotation", - "Serie0", -] - - -class MetaDateRange(BaseModel): - end_time: datetime = FieldInfo(alias="endTime") - """Adjusted end of date range.""" - - start_time: datetime = FieldInfo(alias="startTime") - """Adjusted start of date range.""" - - -class MetaConfidenceInfoAnnotation(BaseModel): - data_source: str = FieldInfo(alias="dataSource") - - description: str - - event_type: str = FieldInfo(alias="eventType") - - is_instantaneous: bool = FieldInfo(alias="isInstantaneous") - - end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) - - linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) - - start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) - - -class MetaConfidenceInfo(BaseModel): - annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None - - level: Optional[int] = None - - -class Meta(BaseModel): - agg_interval: str = FieldInfo(alias="aggInterval") - - date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") - - last_updated: datetime = FieldInfo(alias="lastUpdated") - - confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) - - -class Serie0(BaseModel): - access_rules: List[str] = FieldInfo(alias="ACCESS_RULES") - - api_shield: List[str] = FieldInfo(alias="API_SHIELD") - - bot_management: List[str] = FieldInfo(alias="BOT_MANAGEMENT") - - data_loss_prevention: List[str] = FieldInfo(alias="DATA_LOSS_PREVENTION") - - ddos: List[str] = FieldInfo(alias="DDOS") - - ip_reputation: List[str] = FieldInfo(alias="IP_REPUTATION") - - timestamps: List[datetime] - - waf: List[str] = FieldInfo(alias="WAF") - - -class TimeseriesGroupGetResponse(BaseModel): - meta: Meta - - serie_0: Serie0 diff --git a/src/cloudflare/types/radar/dns/top_ases_params.py b/src/cloudflare/types/radar/dns/top_ases_params.py index fed6e043884..7cf911c139b 100644 --- a/src/cloudflare/types/radar/dns/top_ases_params.py +++ b/src/cloudflare/types/radar/dns/top_ases_params.py @@ -4,7 +4,7 @@ from typing import List, Union from datetime import datetime -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Literal, Annotated, TypedDict from ...._utils import PropertyInfo @@ -12,9 +12,6 @@ class TopAsesParams(TypedDict, total=False): - domain: Required[List[str]] - """Array of domain names.""" - asn: List[str] """Array of comma separated list of ASNs, start with `-` to exclude from results. @@ -42,6 +39,9 @@ class TopAsesParams(TypedDict, total=False): date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] """Array of datetimes to filter the start of a series.""" + domain: List[str] + """Array of domain names.""" + format: Literal["JSON", "CSV"] """Format results are returned in.""" diff --git a/src/cloudflare/types/radar/dns/top_locations_params.py b/src/cloudflare/types/radar/dns/top_locations_params.py index a0f8a46d7d3..f6e3c2327d1 100644 --- a/src/cloudflare/types/radar/dns/top_locations_params.py +++ b/src/cloudflare/types/radar/dns/top_locations_params.py @@ -4,7 +4,7 @@ from typing import List, Union from datetime import datetime -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Literal, Annotated, TypedDict from ...._utils import PropertyInfo @@ -12,9 +12,6 @@ class TopLocationsParams(TypedDict, total=False): - domain: Required[List[str]] - """Array of domain names.""" - asn: List[str] """Array of comma separated list of ASNs, start with `-` to exclude from results. @@ -42,6 +39,9 @@ class TopLocationsParams(TypedDict, total=False): date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] """Array of datetimes to filter the start of a series.""" + domain: List[str] + """Array of domain names.""" + format: Literal["JSON", "CSV"] """Format results are returned in.""" diff --git a/src/cloudflare/types/radar/http/top_browser_family_params.py b/src/cloudflare/types/radar/http/top_browser_family_params.py index a3382520b4f..2373d275b84 100644 --- a/src/cloudflare/types/radar/http/top_browser_family_params.py +++ b/src/cloudflare/types/radar/http/top_browser_family_params.py @@ -26,9 +26,6 @@ class TopBrowserFamilyParams(TypedDict, total=False): [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ - browser_family: Annotated[List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]], PropertyInfo(alias="browserFamily")] - """Filter for browser family.""" - continent: List[str] """Array of comma separated list of continents (alpha-2 continent codes). diff --git a/src/cloudflare/types/zero_trust/access/infrastructure/target_list_params.py b/src/cloudflare/types/zero_trust/access/infrastructure/target_list_params.py index fb6f96ce9ad..5481b051227 100644 --- a/src/cloudflare/types/zero_trust/access/infrastructure/target_list_params.py +++ b/src/cloudflare/types/zero_trust/access/infrastructure/target_list_params.py @@ -30,6 +30,12 @@ class TargetListParams(TypedDict, total=False): hostname_contains: Optional[str] """Partial match to the hostname of a target""" + ip_like: Optional[str] + """ + Filters for targets whose IP addresses look like the specified string. Supports + `*` as a wildcard character + """ + ip_v4: Optional[str] """IPv4 address of the target""" @@ -42,6 +48,30 @@ class TargetListParams(TypedDict, total=False): Specify `ips` multiple times in query parameter to build list of candidates. """ + ipv4_end: Optional[str] + """Defines an IPv4 filter range's ending value (inclusive). + + Requires `ipv4_start` to be specified as well. + """ + + ipv4_start: Optional[str] + """Defines an IPv4 filter range's starting value (inclusive). + + Requires `ipv4_end` to be specified as well. + """ + + ipv6_end: Optional[str] + """Defines an IPv6 filter range's ending value (inclusive). + + Requires `ipv6_start` to be specified as well. + """ + + ipv6_start: Optional[str] + """Defines an IPv6 filter range's starting value (inclusive). + + Requires `ipv6_end` to be specified as well. + """ + modified_after: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] """Date and time at which the target was modified after (inclusive)""" @@ -57,5 +87,12 @@ class TargetListParams(TypedDict, total=False): per_page: int """Max amount of entries returned per page""" + target_ids: List[str] + """Filters for targets that have any of the following UUIDs. + + Specify `target_ids` multiple times in query parameter to build list of + candidates. + """ + virtual_network_id: Optional[str] """Private virtual network identifier of the target""" diff --git a/tests/api_resources/magic_transit/sites/test_lans.py b/tests/api_resources/magic_transit/sites/test_lans.py index 0bb2a1e2740..df37edd9210 100644 --- a/tests/api_resources/magic_transit/sites/test_lans.py +++ b/tests/api_resources/magic_transit/sites/test_lans.py @@ -55,6 +55,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "dhcp_pool_end": "192.0.2.1", "dhcp_pool_start": "192.0.2.1", "dns_server": "192.0.2.1", + "dns_servers": ["192.0.2.1"], "reservations": { "00:11:22:33:44:55": "192.0.2.100", "AA:BB:CC:DD:EE:FF": "192.168.1.101", @@ -146,6 +147,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "dhcp_pool_end": "192.0.2.1", "dhcp_pool_start": "192.0.2.1", "dns_server": "192.0.2.1", + "dns_servers": ["192.0.2.1"], "reservations": { "00:11:22:33:44:55": "192.0.2.100", "AA:BB:CC:DD:EE:FF": "192.168.1.101", @@ -349,6 +351,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: "dhcp_pool_end": "192.0.2.1", "dhcp_pool_start": "192.0.2.1", "dns_server": "192.0.2.1", + "dns_servers": ["192.0.2.1"], "reservations": { "00:11:22:33:44:55": "192.0.2.100", "AA:BB:CC:DD:EE:FF": "192.168.1.101", @@ -510,6 +513,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "dhcp_pool_end": "192.0.2.1", "dhcp_pool_start": "192.0.2.1", "dns_server": "192.0.2.1", + "dns_servers": ["192.0.2.1"], "reservations": { "00:11:22:33:44:55": "192.0.2.100", "AA:BB:CC:DD:EE:FF": "192.168.1.101", @@ -601,6 +605,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "dhcp_pool_end": "192.0.2.1", "dhcp_pool_start": "192.0.2.1", "dns_server": "192.0.2.1", + "dns_servers": ["192.0.2.1"], "reservations": { "00:11:22:33:44:55": "192.0.2.100", "AA:BB:CC:DD:EE:FF": "192.168.1.101", @@ -804,6 +809,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) "dhcp_pool_end": "192.0.2.1", "dhcp_pool_start": "192.0.2.1", "dns_server": "192.0.2.1", + "dns_servers": ["192.0.2.1"], "reservations": { "00:11:22:33:44:55": "192.0.2.100", "AA:BB:CC:DD:EE:FF": "192.168.1.101", diff --git a/tests/api_resources/magic_transit/test_sites.py b/tests/api_resources/magic_transit/test_sites.py index fbf09a6f4b3..406ca9f52a9 100644 --- a/tests/api_resources/magic_transit/test_sites.py +++ b/tests/api_resources/magic_transit/test_sites.py @@ -153,7 +153,7 @@ def test_method_list(self, client: Cloudflare) -> None: def test_method_list_with_all_params(self, client: Cloudflare) -> None: site = client.magic_transit.sites.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", - connector_identifier="023e105f4ecef8ad9ca31a8372d0c353", + connectorid="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(SyncSinglePage[Site], site, path=["response"]) @@ -494,7 +494,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: site = await async_client.magic_transit.sites.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", - connector_identifier="023e105f4ecef8ad9ca31a8372d0c353", + connectorid="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(AsyncSinglePage[Site], site, path=["response"]) diff --git a/tests/api_resources/radar/attacks/layer3/test_summary.py b/tests/api_resources/radar/attacks/layer3/test_summary.py index 6e0d57be6a1..8bee0ce91a1 100644 --- a/tests/api_resources/radar/attacks/layer3/test_summary.py +++ b/tests/api_resources/radar/attacks/layer3/test_summary.py @@ -11,7 +11,6 @@ from tests.utils import assert_matches_type from cloudflare._utils import parse_datetime from cloudflare.types.radar.attacks.layer3 import ( - SummaryGetResponse, SummaryVectorResponse, SummaryBitrateResponse, SummaryDurationResponse, @@ -107,45 +106,6 @@ def test_streaming_response_duration(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True - @parametrize - def test_method_get(self, client: Cloudflare) -> None: - summary = client.radar.attacks.layer3.summary.get() - assert_matches_type(SummaryGetResponse, summary, path=["response"]) - - @parametrize - def test_method_get_with_all_params(self, client: Cloudflare) -> None: - summary = client.radar.attacks.layer3.summary.get( - asn=["string"], - continent=["string"], - date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], - date_range=["7d"], - date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], - format="JSON", - location=["string"], - name=["string"], - ) - assert_matches_type(SummaryGetResponse, summary, path=["response"]) - - @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.radar.attacks.layer3.summary.with_raw_response.get() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - summary = response.parse() - assert_matches_type(SummaryGetResponse, summary, path=["response"]) - - @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.radar.attacks.layer3.summary.with_streaming_response.get() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - summary = response.parse() - assert_matches_type(SummaryGetResponse, summary, path=["response"]) - - assert cast(Any, response.is_closed) is True - @parametrize def test_method_ip_version(self, client: Cloudflare) -> None: summary = client.radar.attacks.layer3.summary.ip_version() @@ -354,45 +314,6 @@ async def test_streaming_response_duration(self, async_client: AsyncCloudflare) assert cast(Any, response.is_closed) is True - @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - summary = await async_client.radar.attacks.layer3.summary.get() - assert_matches_type(SummaryGetResponse, summary, path=["response"]) - - @parametrize - async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: - summary = await async_client.radar.attacks.layer3.summary.get( - asn=["string"], - continent=["string"], - date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], - date_range=["7d"], - date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], - format="JSON", - location=["string"], - name=["string"], - ) - assert_matches_type(SummaryGetResponse, summary, path=["response"]) - - @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.radar.attacks.layer3.summary.with_raw_response.get() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - summary = await response.parse() - assert_matches_type(SummaryGetResponse, summary, path=["response"]) - - @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.radar.attacks.layer3.summary.with_streaming_response.get() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - summary = await response.parse() - assert_matches_type(SummaryGetResponse, summary, path=["response"]) - - assert cast(Any, response.is_closed) is True - @parametrize async def test_method_ip_version(self, async_client: AsyncCloudflare) -> None: summary = await async_client.radar.attacks.layer3.summary.ip_version() diff --git a/tests/api_resources/radar/attacks/layer3/test_timeseries_groups.py b/tests/api_resources/radar/attacks/layer3/test_timeseries_groups.py index 258338056b5..b248a2bc01e 100644 --- a/tests/api_resources/radar/attacks/layer3/test_timeseries_groups.py +++ b/tests/api_resources/radar/attacks/layer3/test_timeseries_groups.py @@ -11,7 +11,6 @@ from tests.utils import assert_matches_type from cloudflare._utils import parse_datetime from cloudflare.types.radar.attacks.layer3 import ( - TimeseriesGroupGetResponse, TimeseriesGroupVectorResponse, TimeseriesGroupBitrateResponse, TimeseriesGroupDurationResponse, @@ -113,46 +112,6 @@ def test_streaming_response_duration(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True - @parametrize - def test_method_get(self, client: Cloudflare) -> None: - timeseries_group = client.radar.attacks.layer3.timeseries_groups.get() - assert_matches_type(TimeseriesGroupGetResponse, timeseries_group, path=["response"]) - - @parametrize - def test_method_get_with_all_params(self, client: Cloudflare) -> None: - timeseries_group = client.radar.attacks.layer3.timeseries_groups.get( - agg_interval="15m", - asn=["string"], - continent=["string"], - date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], - date_range=["7d"], - date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], - format="JSON", - location=["string"], - name=["string"], - ) - assert_matches_type(TimeseriesGroupGetResponse, timeseries_group, path=["response"]) - - @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.radar.attacks.layer3.timeseries_groups.with_raw_response.get() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - timeseries_group = response.parse() - assert_matches_type(TimeseriesGroupGetResponse, timeseries_group, path=["response"]) - - @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.radar.attacks.layer3.timeseries_groups.with_streaming_response.get() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - timeseries_group = response.parse() - assert_matches_type(TimeseriesGroupGetResponse, timeseries_group, path=["response"]) - - assert cast(Any, response.is_closed) is True - @parametrize def test_method_industry(self, client: Cloudflare) -> None: timeseries_group = client.radar.attacks.layer3.timeseries_groups.industry() @@ -459,46 +418,6 @@ async def test_streaming_response_duration(self, async_client: AsyncCloudflare) assert cast(Any, response.is_closed) is True - @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - timeseries_group = await async_client.radar.attacks.layer3.timeseries_groups.get() - assert_matches_type(TimeseriesGroupGetResponse, timeseries_group, path=["response"]) - - @parametrize - async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: - timeseries_group = await async_client.radar.attacks.layer3.timeseries_groups.get( - agg_interval="15m", - asn=["string"], - continent=["string"], - date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], - date_range=["7d"], - date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], - format="JSON", - location=["string"], - name=["string"], - ) - assert_matches_type(TimeseriesGroupGetResponse, timeseries_group, path=["response"]) - - @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.radar.attacks.layer3.timeseries_groups.with_raw_response.get() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - timeseries_group = await response.parse() - assert_matches_type(TimeseriesGroupGetResponse, timeseries_group, path=["response"]) - - @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.radar.attacks.layer3.timeseries_groups.with_streaming_response.get() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - timeseries_group = await response.parse() - assert_matches_type(TimeseriesGroupGetResponse, timeseries_group, path=["response"]) - - assert cast(Any, response.is_closed) is True - @parametrize async def test_method_industry(self, async_client: AsyncCloudflare) -> None: timeseries_group = await async_client.radar.attacks.layer3.timeseries_groups.industry() diff --git a/tests/api_resources/radar/attacks/layer7/test_summary.py b/tests/api_resources/radar/attacks/layer7/test_summary.py index 694c8f4497c..a457ff963bc 100644 --- a/tests/api_resources/radar/attacks/layer7/test_summary.py +++ b/tests/api_resources/radar/attacks/layer7/test_summary.py @@ -11,7 +11,6 @@ from tests.utils import assert_matches_type from cloudflare._utils import parse_datetime from cloudflare.types.radar.attacks.layer7 import ( - SummaryGetResponse, SummaryIPVersionResponse, SummaryHTTPMethodResponse, SummaryHTTPVersionResponse, @@ -25,45 +24,6 @@ class TestSummary: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @parametrize - def test_method_get(self, client: Cloudflare) -> None: - summary = client.radar.attacks.layer7.summary.get() - assert_matches_type(SummaryGetResponse, summary, path=["response"]) - - @parametrize - def test_method_get_with_all_params(self, client: Cloudflare) -> None: - summary = client.radar.attacks.layer7.summary.get( - asn=["string"], - continent=["string"], - date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], - date_range=["7d"], - date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], - format="JSON", - location=["string"], - name=["string"], - ) - assert_matches_type(SummaryGetResponse, summary, path=["response"]) - - @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.radar.attacks.layer7.summary.with_raw_response.get() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - summary = response.parse() - assert_matches_type(SummaryGetResponse, summary, path=["response"]) - - @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.radar.attacks.layer7.summary.with_streaming_response.get() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - summary = response.parse() - assert_matches_type(SummaryGetResponse, summary, path=["response"]) - - assert cast(Any, response.is_closed) is True - @parametrize def test_method_http_method(self, client: Cloudflare) -> None: summary = client.radar.attacks.layer7.summary.http_method() @@ -282,45 +242,6 @@ def test_streaming_response_mitigation_product(self, client: Cloudflare) -> None class TestAsyncSummary: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - summary = await async_client.radar.attacks.layer7.summary.get() - assert_matches_type(SummaryGetResponse, summary, path=["response"]) - - @parametrize - async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: - summary = await async_client.radar.attacks.layer7.summary.get( - asn=["string"], - continent=["string"], - date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], - date_range=["7d"], - date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], - format="JSON", - location=["string"], - name=["string"], - ) - assert_matches_type(SummaryGetResponse, summary, path=["response"]) - - @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.radar.attacks.layer7.summary.with_raw_response.get() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - summary = await response.parse() - assert_matches_type(SummaryGetResponse, summary, path=["response"]) - - @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.radar.attacks.layer7.summary.with_streaming_response.get() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - summary = await response.parse() - assert_matches_type(SummaryGetResponse, summary, path=["response"]) - - assert cast(Any, response.is_closed) is True - @parametrize async def test_method_http_method(self, async_client: AsyncCloudflare) -> None: summary = await async_client.radar.attacks.layer7.summary.http_method() diff --git a/tests/api_resources/radar/attacks/layer7/test_timeseries_groups.py b/tests/api_resources/radar/attacks/layer7/test_timeseries_groups.py index 853d11fb63c..6ddecd6f0f8 100644 --- a/tests/api_resources/radar/attacks/layer7/test_timeseries_groups.py +++ b/tests/api_resources/radar/attacks/layer7/test_timeseries_groups.py @@ -11,7 +11,6 @@ from tests.utils import assert_matches_type from cloudflare._utils import parse_datetime from cloudflare.types.radar.attacks.layer7 import ( - TimeseriesGroupGetResponse, TimeseriesGroupIndustryResponse, TimeseriesGroupVerticalResponse, TimeseriesGroupIPVersionResponse, @@ -27,46 +26,6 @@ class TestTimeseriesGroups: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @parametrize - def test_method_get(self, client: Cloudflare) -> None: - timeseries_group = client.radar.attacks.layer7.timeseries_groups.get() - assert_matches_type(TimeseriesGroupGetResponse, timeseries_group, path=["response"]) - - @parametrize - def test_method_get_with_all_params(self, client: Cloudflare) -> None: - timeseries_group = client.radar.attacks.layer7.timeseries_groups.get( - agg_interval="15m", - asn=["string"], - continent=["string"], - date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], - date_range=["7d"], - date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], - format="JSON", - location=["string"], - name=["string"], - ) - assert_matches_type(TimeseriesGroupGetResponse, timeseries_group, path=["response"]) - - @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.radar.attacks.layer7.timeseries_groups.with_raw_response.get() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - timeseries_group = response.parse() - assert_matches_type(TimeseriesGroupGetResponse, timeseries_group, path=["response"]) - - @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.radar.attacks.layer7.timeseries_groups.with_streaming_response.get() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - timeseries_group = response.parse() - assert_matches_type(TimeseriesGroupGetResponse, timeseries_group, path=["response"]) - - assert cast(Any, response.is_closed) is True - @parametrize def test_method_http_method(self, client: Cloudflare) -> None: timeseries_group = client.radar.attacks.layer7.timeseries_groups.http_method() @@ -387,46 +346,6 @@ def test_streaming_response_vertical(self, client: Cloudflare) -> None: class TestAsyncTimeseriesGroups: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - timeseries_group = await async_client.radar.attacks.layer7.timeseries_groups.get() - assert_matches_type(TimeseriesGroupGetResponse, timeseries_group, path=["response"]) - - @parametrize - async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: - timeseries_group = await async_client.radar.attacks.layer7.timeseries_groups.get( - agg_interval="15m", - asn=["string"], - continent=["string"], - date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], - date_range=["7d"], - date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], - format="JSON", - location=["string"], - name=["string"], - ) - assert_matches_type(TimeseriesGroupGetResponse, timeseries_group, path=["response"]) - - @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.radar.attacks.layer7.timeseries_groups.with_raw_response.get() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - timeseries_group = await response.parse() - assert_matches_type(TimeseriesGroupGetResponse, timeseries_group, path=["response"]) - - @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.radar.attacks.layer7.timeseries_groups.with_streaming_response.get() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - timeseries_group = await response.parse() - assert_matches_type(TimeseriesGroupGetResponse, timeseries_group, path=["response"]) - - assert cast(Any, response.is_closed) is True - @parametrize async def test_method_http_method(self, async_client: AsyncCloudflare) -> None: timeseries_group = await async_client.radar.attacks.layer7.timeseries_groups.http_method() diff --git a/tests/api_resources/radar/dns/test_top.py b/tests/api_resources/radar/dns/test_top.py index bf381e27faa..4d9bb94fefc 100644 --- a/tests/api_resources/radar/dns/test_top.py +++ b/tests/api_resources/radar/dns/test_top.py @@ -20,20 +20,18 @@ class TestTop: @parametrize def test_method_ases(self, client: Cloudflare) -> None: - top = client.radar.dns.top.ases( - domain=["string"], - ) + top = client.radar.dns.top.ases() assert_matches_type(TopAsesResponse, top, path=["response"]) @parametrize def test_method_ases_with_all_params(self, client: Cloudflare) -> None: top = client.radar.dns.top.ases( - domain=["string"], asn=["string"], continent=["string"], date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], date_range=["7d"], date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], + domain=["string"], format="JSON", limit=5, location=["string"], @@ -43,9 +41,7 @@ def test_method_ases_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_ases(self, client: Cloudflare) -> None: - response = client.radar.dns.top.with_raw_response.ases( - domain=["string"], - ) + response = client.radar.dns.top.with_raw_response.ases() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -54,9 +50,7 @@ def test_raw_response_ases(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_ases(self, client: Cloudflare) -> None: - with client.radar.dns.top.with_streaming_response.ases( - domain=["string"], - ) as response: + with client.radar.dns.top.with_streaming_response.ases() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -67,20 +61,18 @@ def test_streaming_response_ases(self, client: Cloudflare) -> None: @parametrize def test_method_locations(self, client: Cloudflare) -> None: - top = client.radar.dns.top.locations( - domain=["string"], - ) + top = client.radar.dns.top.locations() assert_matches_type(TopLocationsResponse, top, path=["response"]) @parametrize def test_method_locations_with_all_params(self, client: Cloudflare) -> None: top = client.radar.dns.top.locations( - domain=["string"], asn=["string"], continent=["string"], date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], date_range=["7d"], date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], + domain=["string"], format="JSON", limit=5, location=["string"], @@ -90,9 +82,7 @@ def test_method_locations_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_locations(self, client: Cloudflare) -> None: - response = client.radar.dns.top.with_raw_response.locations( - domain=["string"], - ) + response = client.radar.dns.top.with_raw_response.locations() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -101,9 +91,7 @@ def test_raw_response_locations(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_locations(self, client: Cloudflare) -> None: - with client.radar.dns.top.with_streaming_response.locations( - domain=["string"], - ) as response: + with client.radar.dns.top.with_streaming_response.locations() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -118,20 +106,18 @@ class TestAsyncTop: @parametrize async def test_method_ases(self, async_client: AsyncCloudflare) -> None: - top = await async_client.radar.dns.top.ases( - domain=["string"], - ) + top = await async_client.radar.dns.top.ases() assert_matches_type(TopAsesResponse, top, path=["response"]) @parametrize async def test_method_ases_with_all_params(self, async_client: AsyncCloudflare) -> None: top = await async_client.radar.dns.top.ases( - domain=["string"], asn=["string"], continent=["string"], date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], date_range=["7d"], date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], + domain=["string"], format="JSON", limit=5, location=["string"], @@ -141,9 +127,7 @@ async def test_method_ases_with_all_params(self, async_client: AsyncCloudflare) @parametrize async def test_raw_response_ases(self, async_client: AsyncCloudflare) -> None: - response = await async_client.radar.dns.top.with_raw_response.ases( - domain=["string"], - ) + response = await async_client.radar.dns.top.with_raw_response.ases() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -152,9 +136,7 @@ async def test_raw_response_ases(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_ases(self, async_client: AsyncCloudflare) -> None: - async with async_client.radar.dns.top.with_streaming_response.ases( - domain=["string"], - ) as response: + async with async_client.radar.dns.top.with_streaming_response.ases() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -165,20 +147,18 @@ async def test_streaming_response_ases(self, async_client: AsyncCloudflare) -> N @parametrize async def test_method_locations(self, async_client: AsyncCloudflare) -> None: - top = await async_client.radar.dns.top.locations( - domain=["string"], - ) + top = await async_client.radar.dns.top.locations() assert_matches_type(TopLocationsResponse, top, path=["response"]) @parametrize async def test_method_locations_with_all_params(self, async_client: AsyncCloudflare) -> None: top = await async_client.radar.dns.top.locations( - domain=["string"], asn=["string"], continent=["string"], date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], date_range=["7d"], date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], + domain=["string"], format="JSON", limit=5, location=["string"], @@ -188,9 +168,7 @@ async def test_method_locations_with_all_params(self, async_client: AsyncCloudfl @parametrize async def test_raw_response_locations(self, async_client: AsyncCloudflare) -> None: - response = await async_client.radar.dns.top.with_raw_response.locations( - domain=["string"], - ) + response = await async_client.radar.dns.top.with_raw_response.locations() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -199,9 +177,7 @@ async def test_raw_response_locations(self, async_client: AsyncCloudflare) -> No @parametrize async def test_streaming_response_locations(self, async_client: AsyncCloudflare) -> None: - async with async_client.radar.dns.top.with_streaming_response.locations( - domain=["string"], - ) as response: + async with async_client.radar.dns.top.with_streaming_response.locations() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/radar/http/test_top.py b/tests/api_resources/radar/http/test_top.py index f6de6208b56..a940b158847 100644 --- a/tests/api_resources/radar/http/test_top.py +++ b/tests/api_resources/radar/http/test_top.py @@ -79,7 +79,6 @@ def test_method_browser_family_with_all_params(self, client: Cloudflare) -> None top = client.radar.http.top.browser_family( asn=["string"], bot_class=["LIKELY_AUTOMATED"], - browser_family=["CHROME"], continent=["string"], date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], date_range=["7d"], @@ -179,7 +178,6 @@ async def test_method_browser_family_with_all_params(self, async_client: AsyncCl top = await async_client.radar.http.top.browser_family( asn=["string"], bot_class=["LIKELY_AUTOMATED"], - browser_family=["CHROME"], continent=["string"], date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], date_range=["7d"], diff --git a/tests/api_resources/test_abuse_reports.py b/tests/api_resources/test_abuse_reports.py index ff8d92dee38..690fbab3c05 100644 --- a/tests/api_resources/test_abuse_reports.py +++ b/tests/api_resources/test_abuse_reports.py @@ -23,6 +23,7 @@ def test_method_create(self, client: Cloudflare) -> None: report_type="abuse_dmca", account_id="023e105f4ecef8ad9ca31a8372d0c353", act="abuse_dmca", + agree=0, email="email", email2="email2", host_notification="send", @@ -39,6 +40,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: report_type="abuse_dmca", account_id="023e105f4ecef8ad9ca31a8372d0c353", act="abuse_dmca", + agree=0, email="email", email2="email2", host_notification="send", @@ -47,7 +49,6 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: urls="urls", address1="x", agent_name="x", - agree=0, city="x", comments="x", company="x", @@ -76,6 +77,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: report_type="abuse_dmca", account_id="023e105f4ecef8ad9ca31a8372d0c353", act="abuse_dmca", + agree=0, email="email", email2="email2", host_notification="send", @@ -96,6 +98,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: report_type="abuse_dmca", account_id="023e105f4ecef8ad9ca31a8372d0c353", act="abuse_dmca", + agree=0, email="email", email2="email2", host_notification="send", @@ -119,6 +122,7 @@ def test_path_params_create(self, client: Cloudflare) -> None: report_type="abuse_dmca", account_id="", act="abuse_dmca", + agree=0, email="email", email2="email2", host_notification="send", @@ -138,6 +142,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: report_type="abuse_dmca", account_id="023e105f4ecef8ad9ca31a8372d0c353", act="abuse_dmca", + agree=0, email="email", email2="email2", host_notification="send", @@ -154,6 +159,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare report_type="abuse_dmca", account_id="023e105f4ecef8ad9ca31a8372d0c353", act="abuse_dmca", + agree=0, email="email", email2="email2", host_notification="send", @@ -162,7 +168,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare urls="urls", address1="x", agent_name="x", - agree=0, city="x", comments="x", company="x", @@ -191,6 +196,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: report_type="abuse_dmca", account_id="023e105f4ecef8ad9ca31a8372d0c353", act="abuse_dmca", + agree=0, email="email", email2="email2", host_notification="send", @@ -211,6 +217,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> report_type="abuse_dmca", account_id="023e105f4ecef8ad9ca31a8372d0c353", act="abuse_dmca", + agree=0, email="email", email2="email2", host_notification="send", @@ -234,6 +241,7 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: report_type="abuse_dmca", account_id="", act="abuse_dmca", + agree=0, email="email", email2="email2", host_notification="send", diff --git a/tests/api_resources/test_custom_hostnames.py b/tests/api_resources/test_custom_hostnames.py index 8b5d3b7f2a4..04a6877e5f4 100644 --- a/tests/api_resources/test_custom_hostnames.py +++ b/tests/api_resources/test_custom_hostnames.py @@ -42,6 +42,12 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "bundle_method": "ubiquitous", "certificate_authority": "digicert", "cloudflare_branding": False, + "custom_cert_bundle": [ + { + "custom_certificate": "-----BEGIN CERTIFICATE-----\nMIIDdjCCAl6gAwIBAgIJAPnMg0Fs+/B0MA0GCSqGSIb3DQEBCwUAMFsx...\n-----END CERTIFICATE-----\n", + "custom_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC/SCB5...\n-----END PRIVATE KEY-----\n", + } + ], "custom_certificate": "-----BEGIN CERTIFICATE-----\\nMIIFJDCCBAygAwIBAgIQD0ifmj/Yi5NP/2gdUySbfzANBgkqhkiG9w0BAQsFADBN\\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5E...SzSHfXp5lnu/3V08I72q1QNzOCgY1XeL4GKVcj4or6cT6tX6oJH7ePPmfrBfqI/O\\nOeH8gMJ+FuwtXYEPa4hBf38M5eU5xWG7\\n-----END CERTIFICATE-----\\n", "custom_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", "method": "http", @@ -218,6 +224,12 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: "bundle_method": "ubiquitous", "certificate_authority": "digicert", "cloudflare_branding": False, + "custom_cert_bundle": [ + { + "custom_certificate": "-----BEGIN CERTIFICATE-----\nMIIDdjCCAl6gAwIBAgIJAPnMg0Fs+/B0MA0GCSqGSIb3DQEBCwUAMFsx...\n-----END CERTIFICATE-----\n", + "custom_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC/SCB5...\n-----END PRIVATE KEY-----\n", + } + ], "custom_certificate": "-----BEGIN CERTIFICATE-----\\nMIIFJDCCBAygAwIBAgIQD0ifmj/Yi5NP/2gdUySbfzANBgkqhkiG9w0BAQsFADBN\\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5E...SzSHfXp5lnu/3V08I72q1QNzOCgY1XeL4GKVcj4or6cT6tX6oJH7ePPmfrBfqI/O\\nOeH8gMJ+FuwtXYEPa4hBf38M5eU5xWG7\\n-----END CERTIFICATE-----\\n", "custom_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", "method": "http", @@ -344,6 +356,12 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "bundle_method": "ubiquitous", "certificate_authority": "digicert", "cloudflare_branding": False, + "custom_cert_bundle": [ + { + "custom_certificate": "-----BEGIN CERTIFICATE-----\nMIIDdjCCAl6gAwIBAgIJAPnMg0Fs+/B0MA0GCSqGSIb3DQEBCwUAMFsx...\n-----END CERTIFICATE-----\n", + "custom_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC/SCB5...\n-----END PRIVATE KEY-----\n", + } + ], "custom_certificate": "-----BEGIN CERTIFICATE-----\\nMIIFJDCCBAygAwIBAgIQD0ifmj/Yi5NP/2gdUySbfzANBgkqhkiG9w0BAQsFADBN\\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5E...SzSHfXp5lnu/3V08I72q1QNzOCgY1XeL4GKVcj4or6cT6tX6oJH7ePPmfrBfqI/O\\nOeH8gMJ+FuwtXYEPa4hBf38M5eU5xWG7\\n-----END CERTIFICATE-----\\n", "custom_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", "method": "http", @@ -520,6 +538,12 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) "bundle_method": "ubiquitous", "certificate_authority": "digicert", "cloudflare_branding": False, + "custom_cert_bundle": [ + { + "custom_certificate": "-----BEGIN CERTIFICATE-----\nMIIDdjCCAl6gAwIBAgIJAPnMg0Fs+/B0MA0GCSqGSIb3DQEBCwUAMFsx...\n-----END CERTIFICATE-----\n", + "custom_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC/SCB5...\n-----END PRIVATE KEY-----\n", + } + ], "custom_certificate": "-----BEGIN CERTIFICATE-----\\nMIIFJDCCBAygAwIBAgIQD0ifmj/Yi5NP/2gdUySbfzANBgkqhkiG9w0BAQsFADBN\\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5E...SzSHfXp5lnu/3V08I72q1QNzOCgY1XeL4GKVcj4or6cT6tX6oJH7ePPmfrBfqI/O\\nOeH8gMJ+FuwtXYEPa4hBf38M5eU5xWG7\\n-----END CERTIFICATE-----\\n", "custom_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", "method": "http", diff --git a/tests/api_resources/zero_trust/access/infrastructure/test_targets.py b/tests/api_resources/zero_trust/access/infrastructure/test_targets.py index 263003e2c00..3b08c41fcd3 100644 --- a/tests/api_resources/zero_trust/access/infrastructure/test_targets.py +++ b/tests/api_resources/zero_trust/access/infrastructure/test_targets.py @@ -182,14 +182,20 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: direction="asc", hostname="hostname", hostname_contains="hostname_contains", + ip_like="ip_like", ip_v4="ip_v4", ip_v6="ip_v6", ips=["string"], + ipv4_end="ipv4_end", + ipv4_start="ipv4_start", + ipv6_end="ipv6_end", + ipv6_start="ipv6_start", modified_after=parse_datetime("2019-12-27T18:11:19.117Z"), modified_before=parse_datetime("2019-12-27T18:11:19.117Z"), order="hostname", page=1, per_page=1, + target_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], virtual_network_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(SyncV4PagePaginationArray[TargetListResponse], target, path=["response"]) @@ -582,14 +588,20 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) direction="asc", hostname="hostname", hostname_contains="hostname_contains", + ip_like="ip_like", ip_v4="ip_v4", ip_v6="ip_v6", ips=["string"], + ipv4_end="ipv4_end", + ipv4_start="ipv4_start", + ipv6_end="ipv6_end", + ipv6_start="ipv6_start", modified_after=parse_datetime("2019-12-27T18:11:19.117Z"), modified_before=parse_datetime("2019-12-27T18:11:19.117Z"), order="hostname", page=1, per_page=1, + target_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], virtual_network_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(AsyncV4PagePaginationArray[TargetListResponse], target, path=["response"]) From 3bacbe2163c8d54764089f93bacfda56c2535dac Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Jan 2025 21:30:17 +0000 Subject: [PATCH 054/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 1b3d6f07ee2..47bfdaeb1b7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1504 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9d820228c37e90bcda462f65ab99892171ce6ff3c5ef8ee2cbbced875a95419a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ee0fe6ded1f6eb6dfeee8aa4341555587ceed6fdce971e87b56809c6dbf2d64a.yml From 9d7ef492bc0d5a7f72949ecb38ed7d469d923492 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Jan 2025 21:41:06 +0000 Subject: [PATCH 055/358] feat(api): api update (#2407) --- .stats.yml | 2 +- api.md | 27 ++- .../applications/policy_tests/policy_tests.py | 181 ++++-------------- .../access/applications/policy_tests/users.py | 19 +- .../resources/zero_trust/access/groups.py | 53 ++--- .../zero_trust/access/users/users.py | 14 +- .../types/zero_trust/access/__init__.py | 7 +- .../access/applications/__init__.py | 1 + .../applications/policy_test_create_params.py | 37 ++-- .../applications/policy_test_get_params.py | 14 ++ .../policy_tests/user_list_response.py | 11 +- .../access/group_create_response.py | 45 +++++ ...o_trust_group.py => group_get_response.py} | 4 +- .../zero_trust/access/group_list_response.py | 45 +++++ .../access/group_update_response.py | 45 +++++ .../{access_user.py => user_list_response.py} | 4 +- .../applications/policy_tests/test_users.py | 13 +- .../access/applications/test_policy_tests.py | 138 +++++++------ .../zero_trust/access/test_groups.py | 69 +++---- .../zero_trust/access/test_users.py | 18 +- 20 files changed, 418 insertions(+), 329 deletions(-) create mode 100644 src/cloudflare/types/zero_trust/access/applications/policy_test_get_params.py create mode 100644 src/cloudflare/types/zero_trust/access/group_create_response.py rename src/cloudflare/types/zero_trust/access/{zero_trust_group.py => group_get_response.py} (94%) create mode 100644 src/cloudflare/types/zero_trust/access/group_list_response.py create mode 100644 src/cloudflare/types/zero_trust/access/group_update_response.py rename src/cloudflare/types/zero_trust/access/{access_user.py => user_list_response.py} (94%) diff --git a/.stats.yml b/.stats.yml index 47bfdaeb1b7..e871690d0f2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1504 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ee0fe6ded1f6eb6dfeee8aa4341555587ceed6fdce971e87b56809c6dbf2d64a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8973dde42d42a39c8fbc5f3f1eb1328e6ac0c805ca4d3e5920796749ed58eb0a.yml diff --git a/api.md b/api.md index fdc548755ae..817f0409ecd 100644 --- a/api.md +++ b/api.md @@ -5453,8 +5453,8 @@ from cloudflare.types.zero_trust.access.applications import ( Methods: -- client.zero_trust.access.applications.policy_tests.create(\*, account_id, \*\*params) -> PolicyTestCreateResponse -- client.zero_trust.access.applications.policy_tests.get(policy_test_id, \*, account_id) -> PolicyTestGetResponse +- client.zero_trust.access.applications.policy_tests.create(\*, account_id, \*\*params) -> Optional[PolicyTestCreateResponse] +- client.zero_trust.access.applications.policy_tests.get(policy_test_id, \*, account_id, \*\*params) -> Optional[PolicyTestGetResponse] ##### Users @@ -5466,7 +5466,7 @@ from cloudflare.types.zero_trust.access.applications.policy_tests import UserLis Methods: -- client.zero_trust.access.applications.policy_tests.users.list(policy_test_id, \*, account_id) -> UserListResponse +- client.zero_trust.access.applications.policy_tests.users.list(policy_test_id, \*, account_id) -> SyncSinglePage[UserListResponse] ### Certificates @@ -5510,16 +5510,23 @@ Methods: Types: ```python -from cloudflare.types.zero_trust.access import ZeroTrustGroup, GroupDeleteResponse +from cloudflare.types.zero_trust.access import ( + ZeroTrustGroup, + GroupCreateResponse, + GroupUpdateResponse, + GroupListResponse, + GroupDeleteResponse, + GroupGetResponse, +) ``` Methods: -- client.zero_trust.access.groups.create(\*, account_id, zone_id, \*\*params) -> Optional[ZeroTrustGroup] -- client.zero_trust.access.groups.update(group_id, \*, account_id, zone_id, \*\*params) -> Optional[ZeroTrustGroup] -- client.zero_trust.access.groups.list(\*, account_id, zone_id, \*\*params) -> SyncSinglePage[ZeroTrustGroup] +- client.zero_trust.access.groups.create(\*, account_id, zone_id, \*\*params) -> Optional[GroupCreateResponse] +- client.zero_trust.access.groups.update(group_id, \*, account_id, zone_id, \*\*params) -> Optional[GroupUpdateResponse] +- client.zero_trust.access.groups.list(\*, account_id, zone_id, \*\*params) -> SyncSinglePage[GroupListResponse] - client.zero_trust.access.groups.delete(group_id, \*, account_id, zone_id) -> Optional[GroupDeleteResponse] -- client.zero_trust.access.groups.get(group_id, \*, account_id, zone_id) -> Optional[ZeroTrustGroup] +- client.zero_trust.access.groups.get(group_id, \*, account_id, zone_id) -> Optional[GroupGetResponse] ### ServiceTokens @@ -5592,12 +5599,12 @@ Methods: Types: ```python -from cloudflare.types.zero_trust.access import AccessUser +from cloudflare.types.zero_trust.access import AccessUser, UserListResponse ``` Methods: -- client.zero_trust.access.users.list(\*, account_id, \*\*params) -> SyncSinglePage[AccessUser] +- client.zero_trust.access.users.list(\*, account_id, \*\*params) -> SyncSinglePage[UserListResponse] #### ActiveSessions diff --git a/src/cloudflare/resources/zero_trust/access/applications/policy_tests/policy_tests.py b/src/cloudflare/resources/zero_trust/access/applications/policy_tests/policy_tests.py index a43adaebf58..57bdd9e5aab 100755 --- a/src/cloudflare/resources/zero_trust/access/applications/policy_tests/policy_tests.py +++ b/src/cloudflare/resources/zero_trust/access/applications/policy_tests/policy_tests.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Iterable +from typing import Type, Iterable, Optional, cast import httpx @@ -27,12 +27,9 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) +from ......_wrappers import ResultWrapper from ......_base_client import make_request_options -from ......types.zero_trust.access import Decision -from ......types.zero_trust.access.decision import Decision -from ......types.zero_trust.access_rule_param import AccessRuleParam -from ......types.zero_trust.access.applications import policy_test_create_params -from ......types.zero_trust.access.approval_group_param import ApprovalGroupParam +from ......types.zero_trust.access.applications import policy_test_get_params, policy_test_create_params from ......types.zero_trust.access.applications.policy_test_get_response import PolicyTestGetResponse from ......types.zero_trust.access.applications.policy_test_create_response import PolicyTestCreateResponse @@ -67,64 +64,20 @@ def create( self, *, account_id: str, - id: str | NotGiven = NOT_GIVEN, - approval_groups: Iterable[ApprovalGroupParam] | NotGiven = NOT_GIVEN, - approval_required: bool | NotGiven = NOT_GIVEN, - decision: Decision | NotGiven = NOT_GIVEN, - exclude: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, - include: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, - isolation_required: bool | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - purpose_justification_prompt: str | NotGiven = NOT_GIVEN, - purpose_justification_required: bool | NotGiven = NOT_GIVEN, - require: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, + policies: Iterable[policy_test_create_params.Policy] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PolicyTestCreateResponse: + ) -> Optional[PolicyTestCreateResponse]: """ Starts an Access policy test. Args: account_id: Identifier - id: The UUID of the policy - - approval_groups: Administrators who can approve a temporary authentication request. - - approval_required: Requires the user to request access from an administrator at the start of each - session. - - decision: The action Access will take if a user matches this policy. Infrastructure - application policies can only use the Allow action. - - exclude: Rules evaluated with a NOT logical operator. To match the policy, a user cannot - meet any of the Exclude rules. - - include: Rules evaluated with an OR logical operator. A user needs to meet only one of - the Include rules. - - isolation_required: Require this application to be served in an isolated browser for users matching - this policy. 'Client Web Isolation' must be on for the account in order to use - this feature. - - name: The name of the Access policy. - - purpose_justification_prompt: A custom message that will appear on the purpose justification screen. - - purpose_justification_required: Require users to enter a justification when they log in to the application. - - require: Rules evaluated with an AND logical operator. To match the policy, a user must - meet all of the Require rules. - - session_duration: The amount of time that tokens issued for the application will be valid. Must be - in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, - m, h. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -137,27 +90,15 @@ def create( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( f"/accounts/{account_id}/access/policy-tests", - body=maybe_transform( - { - "id": id, - "approval_groups": approval_groups, - "approval_required": approval_required, - "decision": decision, - "exclude": exclude, - "include": include, - "isolation_required": isolation_required, - "name": name, - "purpose_justification_prompt": purpose_justification_prompt, - "purpose_justification_required": purpose_justification_required, - "require": require, - "session_duration": session_duration, - }, - policy_test_create_params.PolicyTestCreateParams, - ), + body=maybe_transform({"policies": policies}, policy_test_create_params.PolicyTestCreateParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[PolicyTestCreateResponse]]._unwrapper, ), - cast_to=PolicyTestCreateResponse, + cast_to=cast(Type[Optional[PolicyTestCreateResponse]], ResultWrapper[PolicyTestCreateResponse]), ) def get( @@ -165,13 +106,14 @@ def get( policy_test_id: str, *, account_id: str, + page: int | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PolicyTestGetResponse: + ) -> Optional[PolicyTestGetResponse]: """ Fetches the current status of a given Access policy test. @@ -195,9 +137,14 @@ def get( return self._get( f"/accounts/{account_id}/access/policy-tests/{policy_test_id}", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"page": page}, policy_test_get_params.PolicyTestGetParams), + post_parser=ResultWrapper[Optional[PolicyTestGetResponse]]._unwrapper, ), - cast_to=PolicyTestGetResponse, + cast_to=cast(Type[Optional[PolicyTestGetResponse]], ResultWrapper[PolicyTestGetResponse]), ) @@ -229,64 +176,20 @@ async def create( self, *, account_id: str, - id: str | NotGiven = NOT_GIVEN, - approval_groups: Iterable[ApprovalGroupParam] | NotGiven = NOT_GIVEN, - approval_required: bool | NotGiven = NOT_GIVEN, - decision: Decision | NotGiven = NOT_GIVEN, - exclude: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, - include: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, - isolation_required: bool | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - purpose_justification_prompt: str | NotGiven = NOT_GIVEN, - purpose_justification_required: bool | NotGiven = NOT_GIVEN, - require: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, + policies: Iterable[policy_test_create_params.Policy] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PolicyTestCreateResponse: + ) -> Optional[PolicyTestCreateResponse]: """ Starts an Access policy test. Args: account_id: Identifier - id: The UUID of the policy - - approval_groups: Administrators who can approve a temporary authentication request. - - approval_required: Requires the user to request access from an administrator at the start of each - session. - - decision: The action Access will take if a user matches this policy. Infrastructure - application policies can only use the Allow action. - - exclude: Rules evaluated with a NOT logical operator. To match the policy, a user cannot - meet any of the Exclude rules. - - include: Rules evaluated with an OR logical operator. A user needs to meet only one of - the Include rules. - - isolation_required: Require this application to be served in an isolated browser for users matching - this policy. 'Client Web Isolation' must be on for the account in order to use - this feature. - - name: The name of the Access policy. - - purpose_justification_prompt: A custom message that will appear on the purpose justification screen. - - purpose_justification_required: Require users to enter a justification when they log in to the application. - - require: Rules evaluated with an AND logical operator. To match the policy, a user must - meet all of the Require rules. - - session_duration: The amount of time that tokens issued for the application will be valid. Must be - in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, - m, h. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -299,27 +202,15 @@ async def create( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( f"/accounts/{account_id}/access/policy-tests", - body=await async_maybe_transform( - { - "id": id, - "approval_groups": approval_groups, - "approval_required": approval_required, - "decision": decision, - "exclude": exclude, - "include": include, - "isolation_required": isolation_required, - "name": name, - "purpose_justification_prompt": purpose_justification_prompt, - "purpose_justification_required": purpose_justification_required, - "require": require, - "session_duration": session_duration, - }, - policy_test_create_params.PolicyTestCreateParams, - ), + body=await async_maybe_transform({"policies": policies}, policy_test_create_params.PolicyTestCreateParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[PolicyTestCreateResponse]]._unwrapper, ), - cast_to=PolicyTestCreateResponse, + cast_to=cast(Type[Optional[PolicyTestCreateResponse]], ResultWrapper[PolicyTestCreateResponse]), ) async def get( @@ -327,13 +218,14 @@ async def get( policy_test_id: str, *, account_id: str, + page: int | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PolicyTestGetResponse: + ) -> Optional[PolicyTestGetResponse]: """ Fetches the current status of a given Access policy test. @@ -357,9 +249,14 @@ async def get( return await self._get( f"/accounts/{account_id}/access/policy-tests/{policy_test_id}", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform({"page": page}, policy_test_get_params.PolicyTestGetParams), + post_parser=ResultWrapper[Optional[PolicyTestGetResponse]]._unwrapper, ), - cast_to=PolicyTestGetResponse, + cast_to=cast(Type[Optional[PolicyTestGetResponse]], ResultWrapper[PolicyTestGetResponse]), ) diff --git a/src/cloudflare/resources/zero_trust/access/applications/policy_tests/users.py b/src/cloudflare/resources/zero_trust/access/applications/policy_tests/users.py index d3e70844952..a051ba2de97 100755 --- a/src/cloudflare/resources/zero_trust/access/applications/policy_tests/users.py +++ b/src/cloudflare/resources/zero_trust/access/applications/policy_tests/users.py @@ -13,7 +13,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ......_base_client import make_request_options +from ......pagination import SyncSinglePage, AsyncSinglePage +from ......_base_client import AsyncPaginator, make_request_options from ......types.zero_trust.access.applications.policy_tests.user_list_response import UserListResponse __all__ = ["UsersResource", "AsyncUsersResource"] @@ -50,7 +51,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> UserListResponse: + ) -> SyncSinglePage[UserListResponse]: """ Fetches a single page of user results from an Access policy test. @@ -71,12 +72,13 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_test_id: raise ValueError(f"Expected a non-empty value for `policy_test_id` but received {policy_test_id!r}") - return self._get( + return self._get_api_list( f"/accounts/{account_id}/access/policy-tests/{policy_test_id}/users", + page=SyncSinglePage[UserListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=UserListResponse, + model=UserListResponse, ) @@ -100,7 +102,7 @@ def with_streaming_response(self) -> AsyncUsersResourceWithStreamingResponse: """ return AsyncUsersResourceWithStreamingResponse(self) - async def list( + def list( self, policy_test_id: str, *, @@ -111,7 +113,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> UserListResponse: + ) -> AsyncPaginator[UserListResponse, AsyncSinglePage[UserListResponse]]: """ Fetches a single page of user results from an Access policy test. @@ -132,12 +134,13 @@ async def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_test_id: raise ValueError(f"Expected a non-empty value for `policy_test_id` but received {policy_test_id!r}") - return await self._get( + return self._get_api_list( f"/accounts/{account_id}/access/policy-tests/{policy_test_id}/users", + page=AsyncSinglePage[UserListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=UserListResponse, + model=UserListResponse, ) diff --git a/src/cloudflare/resources/zero_trust/access/groups.py b/src/cloudflare/resources/zero_trust/access/groups.py index 2de59b208dc..78fd9c2a2be 100644 --- a/src/cloudflare/resources/zero_trust/access/groups.py +++ b/src/cloudflare/resources/zero_trust/access/groups.py @@ -24,8 +24,11 @@ from ...._base_client import AsyncPaginator, make_request_options from ....types.zero_trust.access import group_list_params, group_create_params, group_update_params from ....types.zero_trust.access_rule_param import AccessRuleParam -from ....types.zero_trust.access.zero_trust_group import ZeroTrustGroup +from ....types.zero_trust.access.group_get_response import GroupGetResponse +from ....types.zero_trust.access.group_list_response import GroupListResponse +from ....types.zero_trust.access.group_create_response import GroupCreateResponse from ....types.zero_trust.access.group_delete_response import GroupDeleteResponse +from ....types.zero_trust.access.group_update_response import GroupUpdateResponse __all__ = ["GroupsResource", "AsyncGroupsResource"] @@ -66,7 +69,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ZeroTrustGroup]: + ) -> Optional[GroupCreateResponse]: """ Creates a new Access group. @@ -125,9 +128,9 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[ZeroTrustGroup]]._unwrapper, + post_parser=ResultWrapper[Optional[GroupCreateResponse]]._unwrapper, ), - cast_to=cast(Type[Optional[ZeroTrustGroup]], ResultWrapper[ZeroTrustGroup]), + cast_to=cast(Type[Optional[GroupCreateResponse]], ResultWrapper[GroupCreateResponse]), ) def update( @@ -147,7 +150,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ZeroTrustGroup]: + ) -> Optional[GroupUpdateResponse]: """ Updates a configured Access group. @@ -210,9 +213,9 @@ def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[ZeroTrustGroup]]._unwrapper, + post_parser=ResultWrapper[Optional[GroupUpdateResponse]]._unwrapper, ), - cast_to=cast(Type[Optional[ZeroTrustGroup]], ResultWrapper[ZeroTrustGroup]), + cast_to=cast(Type[Optional[GroupUpdateResponse]], ResultWrapper[GroupUpdateResponse]), ) def list( @@ -228,7 +231,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[ZeroTrustGroup]: + ) -> SyncSinglePage[GroupListResponse]: """ Lists all Access groups. @@ -263,7 +266,7 @@ def list( account_or_zone_id = zone_id return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/access/groups", - page=SyncSinglePage[ZeroTrustGroup], + page=SyncSinglePage[GroupListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -277,7 +280,7 @@ def list( group_list_params.GroupListParams, ), ), - model=ZeroTrustGroup, + model=GroupListResponse, ) def delete( @@ -349,7 +352,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ZeroTrustGroup]: + ) -> Optional[GroupGetResponse]: """ Fetches a single Access group. @@ -389,9 +392,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[ZeroTrustGroup]]._unwrapper, + post_parser=ResultWrapper[Optional[GroupGetResponse]]._unwrapper, ), - cast_to=cast(Type[Optional[ZeroTrustGroup]], ResultWrapper[ZeroTrustGroup]), + cast_to=cast(Type[Optional[GroupGetResponse]], ResultWrapper[GroupGetResponse]), ) @@ -431,7 +434,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ZeroTrustGroup]: + ) -> Optional[GroupCreateResponse]: """ Creates a new Access group. @@ -490,9 +493,9 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[ZeroTrustGroup]]._unwrapper, + post_parser=ResultWrapper[Optional[GroupCreateResponse]]._unwrapper, ), - cast_to=cast(Type[Optional[ZeroTrustGroup]], ResultWrapper[ZeroTrustGroup]), + cast_to=cast(Type[Optional[GroupCreateResponse]], ResultWrapper[GroupCreateResponse]), ) async def update( @@ -512,7 +515,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ZeroTrustGroup]: + ) -> Optional[GroupUpdateResponse]: """ Updates a configured Access group. @@ -575,9 +578,9 @@ async def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[ZeroTrustGroup]]._unwrapper, + post_parser=ResultWrapper[Optional[GroupUpdateResponse]]._unwrapper, ), - cast_to=cast(Type[Optional[ZeroTrustGroup]], ResultWrapper[ZeroTrustGroup]), + cast_to=cast(Type[Optional[GroupUpdateResponse]], ResultWrapper[GroupUpdateResponse]), ) def list( @@ -593,7 +596,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ZeroTrustGroup, AsyncSinglePage[ZeroTrustGroup]]: + ) -> AsyncPaginator[GroupListResponse, AsyncSinglePage[GroupListResponse]]: """ Lists all Access groups. @@ -628,7 +631,7 @@ def list( account_or_zone_id = zone_id return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/access/groups", - page=AsyncSinglePage[ZeroTrustGroup], + page=AsyncSinglePage[GroupListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -642,7 +645,7 @@ def list( group_list_params.GroupListParams, ), ), - model=ZeroTrustGroup, + model=GroupListResponse, ) async def delete( @@ -714,7 +717,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ZeroTrustGroup]: + ) -> Optional[GroupGetResponse]: """ Fetches a single Access group. @@ -754,9 +757,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[ZeroTrustGroup]]._unwrapper, + post_parser=ResultWrapper[Optional[GroupGetResponse]]._unwrapper, ), - cast_to=cast(Type[Optional[ZeroTrustGroup]], ResultWrapper[ZeroTrustGroup]), + cast_to=cast(Type[Optional[GroupGetResponse]], ResultWrapper[GroupGetResponse]), ) diff --git a/src/cloudflare/resources/zero_trust/access/users/users.py b/src/cloudflare/resources/zero_trust/access/users/users.py index 4d16686dbdb..e5a1c5d7568 100644 --- a/src/cloudflare/resources/zero_trust/access/users/users.py +++ b/src/cloudflare/resources/zero_trust/access/users/users.py @@ -41,7 +41,7 @@ AsyncLastSeenIdentityResourceWithStreamingResponse, ) from .....types.zero_trust.access import user_list_params -from .....types.zero_trust.access.access_user import AccessUser +from .....types.zero_trust.access.user_list_response import UserListResponse __all__ = ["UsersResource", "AsyncUsersResource"] @@ -91,7 +91,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[AccessUser]: + ) -> SyncSinglePage[UserListResponse]: """ Gets a list of users for an account. @@ -116,7 +116,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/access/users", - page=SyncSinglePage[AccessUser], + page=SyncSinglePage[UserListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -131,7 +131,7 @@ def list( user_list_params.UserListParams, ), ), - model=AccessUser, + model=UserListResponse, ) @@ -180,7 +180,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[AccessUser, AsyncSinglePage[AccessUser]]: + ) -> AsyncPaginator[UserListResponse, AsyncSinglePage[UserListResponse]]: """ Gets a list of users for an account. @@ -205,7 +205,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/access/users", - page=AsyncSinglePage[AccessUser], + page=AsyncSinglePage[UserListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -220,7 +220,7 @@ def list( user_list_params.UserListParams, ), ), - model=AccessUser, + model=UserListResponse, ) diff --git a/src/cloudflare/types/zero_trust/access/__init__.py b/src/cloudflare/types/zero_trust/access/__init__.py index 3db17eae160..67480e768ce 100644 --- a/src/cloudflare/types/zero_trust/access/__init__.py +++ b/src/cloudflare/types/zero_trust/access/__init__.py @@ -6,7 +6,6 @@ from .app_id import AppID as AppID from .bookmark import Bookmark as Bookmark from .decision import Decision as Decision -from .access_user import AccessUser as AccessUser from .certificate import Certificate as Certificate from .custom_page import CustomPage as CustomPage from .allowed_idps import AllowedIdPs as AllowedIdPs @@ -21,14 +20,16 @@ from .application_type import ApplicationType as ApplicationType from .key_get_response import KeyGetResponse as KeyGetResponse from .user_list_params import UserListParams as UserListParams -from .zero_trust_group import ZeroTrustGroup as ZeroTrustGroup from .group_list_params import GroupListParams as GroupListParams from .key_update_params import KeyUpdateParams as KeyUpdateParams from .tag_create_params import TagCreateParams as TagCreateParams from .tag_update_params import TagUpdateParams as TagUpdateParams from .application_policy import ApplicationPolicy as ApplicationPolicy from .cors_headers_param import CORSHeadersParam as CORSHeadersParam +from .group_get_response import GroupGetResponse as GroupGetResponse +from .user_list_response import UserListResponse as UserListResponse from .group_create_params import GroupCreateParams as GroupCreateParams +from .group_list_response import GroupListResponse as GroupListResponse from .group_update_params import GroupUpdateParams as GroupUpdateParams from .key_rotate_response import KeyRotateResponse as KeyRotateResponse from .key_update_response import KeyUpdateResponse as KeyUpdateResponse @@ -43,7 +44,9 @@ from .policy_create_params import PolicyCreateParams as PolicyCreateParams from .policy_list_response import PolicyListResponse as PolicyListResponse from .policy_update_params import PolicyUpdateParams as PolicyUpdateParams +from .group_create_response import GroupCreateResponse as GroupCreateResponse from .group_delete_response import GroupDeleteResponse as GroupDeleteResponse +from .group_update_response import GroupUpdateResponse as GroupUpdateResponse from .bookmark_create_params import BookmarkCreateParams as BookmarkCreateParams from .bookmark_update_params import BookmarkUpdateParams as BookmarkUpdateParams from .policy_create_response import PolicyCreateResponse as PolicyCreateResponse diff --git a/src/cloudflare/types/zero_trust/access/applications/__init__.py b/src/cloudflare/types/zero_trust/access/applications/__init__.py index 362c1906e85..b149f062d40 100644 --- a/src/cloudflare/types/zero_trust/access/applications/__init__.py +++ b/src/cloudflare/types/zero_trust/access/applications/__init__.py @@ -11,6 +11,7 @@ from .user_policy_check_geo import UserPolicyCheckGeo as UserPolicyCheckGeo from .policy_create_response import PolicyCreateResponse as PolicyCreateResponse from .policy_delete_response import PolicyDeleteResponse as PolicyDeleteResponse +from .policy_test_get_params import PolicyTestGetParams as PolicyTestGetParams from .policy_update_response import PolicyUpdateResponse as PolicyUpdateResponse from .policy_test_get_response import PolicyTestGetResponse as PolicyTestGetResponse from .policy_test_create_params import PolicyTestCreateParams as PolicyTestCreateParams diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_test_create_params.py b/src/cloudflare/types/zero_trust/access/applications/policy_test_create_params.py index b1e7593389d..63d7df7a9ef 100755 --- a/src/cloudflare/types/zero_trust/access/applications/policy_test_create_params.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_test_create_params.py @@ -9,15 +9,31 @@ from ...access_rule_param import AccessRuleParam from ..approval_group_param import ApprovalGroupParam -__all__ = ["PolicyTestCreateParams"] +__all__ = ["PolicyTestCreateParams", "Policy"] class PolicyTestCreateParams(TypedDict, total=False): account_id: Required[str] """Identifier""" - id: str - """The UUID of the policy""" + policies: Iterable[Policy] + + +class Policy(TypedDict, total=False): + decision: Required[Decision] + """The action Access will take if a user matches this policy. + + Infrastructure application policies can only use the Allow action. + """ + + include: Required[Iterable[AccessRuleParam]] + """Rules evaluated with an OR logical operator. + + A user needs to meet only one of the Include rules. + """ + + name: Required[str] + """The name of the Access policy.""" approval_groups: Iterable[ApprovalGroupParam] """Administrators who can approve a temporary authentication request.""" @@ -28,24 +44,12 @@ class PolicyTestCreateParams(TypedDict, total=False): session. """ - decision: Decision - """The action Access will take if a user matches this policy. - - Infrastructure application policies can only use the Allow action. - """ - exclude: Iterable[AccessRuleParam] """Rules evaluated with a NOT logical operator. To match the policy, a user cannot meet any of the Exclude rules. """ - include: Iterable[AccessRuleParam] - """Rules evaluated with an OR logical operator. - - A user needs to meet only one of the Include rules. - """ - isolation_required: bool """ Require this application to be served in an isolated browser for users matching @@ -53,9 +57,6 @@ class PolicyTestCreateParams(TypedDict, total=False): this feature. """ - name: str - """The name of the Access policy.""" - purpose_justification_prompt: str """A custom message that will appear on the purpose justification screen.""" diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_test_get_params.py b/src/cloudflare/types/zero_trust/access/applications/policy_test_get_params.py new file mode 100644 index 00000000000..3bac91ed729 --- /dev/null +++ b/src/cloudflare/types/zero_trust/access/applications/policy_test_get_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["PolicyTestGetParams"] + + +class PolicyTestGetParams(TypedDict, total=False): + account_id: Required[str] + """Identifier""" + + page: int diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_tests/user_list_response.py b/src/cloudflare/types/zero_trust/access/applications/policy_tests/user_list_response.py index eb1fd34090d..5b727718032 100755 --- a/src/cloudflare/types/zero_trust/access/applications/policy_tests/user_list_response.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_tests/user_list_response.py @@ -1,14 +1,14 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional -from typing_extensions import Literal, TypeAlias +from typing import Optional +from typing_extensions import Literal from ......_models import BaseModel -__all__ = ["UserListResponse", "UserListResponseItem"] +__all__ = ["UserListResponse"] -class UserListResponseItem(BaseModel): +class UserListResponse(BaseModel): id: Optional[str] = None """UUID""" @@ -20,6 +20,3 @@ class UserListResponseItem(BaseModel): status: Optional[Literal["approved", "blocked"]] = None """Policy evaluation result for an individual user.""" - - -UserListResponse: TypeAlias = List[UserListResponseItem] diff --git a/src/cloudflare/types/zero_trust/access/group_create_response.py b/src/cloudflare/types/zero_trust/access/group_create_response.py new file mode 100644 index 00000000000..b878764b5bc --- /dev/null +++ b/src/cloudflare/types/zero_trust/access/group_create_response.py @@ -0,0 +1,45 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime + +from ...._models import BaseModel +from ..access_rule import AccessRule + +__all__ = ["GroupCreateResponse"] + + +class GroupCreateResponse(BaseModel): + id: Optional[str] = None + """UUID""" + + created_at: Optional[datetime] = None + + exclude: Optional[List[AccessRule]] = None + """Rules evaluated with a NOT logical operator. + + To match a policy, a user cannot meet any of the Exclude rules. + """ + + include: Optional[List[AccessRule]] = None + """Rules evaluated with an OR logical operator. + + A user needs to meet only one of the Include rules. + """ + + is_default: Optional[List[AccessRule]] = None + """Rules evaluated with an AND logical operator. + + To match a policy, a user must meet all of the Require rules. + """ + + name: Optional[str] = None + """The name of the Access group.""" + + require: Optional[List[AccessRule]] = None + """Rules evaluated with an AND logical operator. + + To match a policy, a user must meet all of the Require rules. + """ + + updated_at: Optional[datetime] = None diff --git a/src/cloudflare/types/zero_trust/access/zero_trust_group.py b/src/cloudflare/types/zero_trust/access/group_get_response.py similarity index 94% rename from src/cloudflare/types/zero_trust/access/zero_trust_group.py rename to src/cloudflare/types/zero_trust/access/group_get_response.py index eae4f03b8f2..5a5e840456a 100644 --- a/src/cloudflare/types/zero_trust/access/zero_trust_group.py +++ b/src/cloudflare/types/zero_trust/access/group_get_response.py @@ -6,10 +6,10 @@ from ...._models import BaseModel from ..access_rule import AccessRule -__all__ = ["ZeroTrustGroup"] +__all__ = ["GroupGetResponse"] -class ZeroTrustGroup(BaseModel): +class GroupGetResponse(BaseModel): id: Optional[str] = None """UUID""" diff --git a/src/cloudflare/types/zero_trust/access/group_list_response.py b/src/cloudflare/types/zero_trust/access/group_list_response.py new file mode 100644 index 00000000000..4f3f9be3b6e --- /dev/null +++ b/src/cloudflare/types/zero_trust/access/group_list_response.py @@ -0,0 +1,45 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime + +from ...._models import BaseModel +from ..access_rule import AccessRule + +__all__ = ["GroupListResponse"] + + +class GroupListResponse(BaseModel): + id: Optional[str] = None + """UUID""" + + created_at: Optional[datetime] = None + + exclude: Optional[List[AccessRule]] = None + """Rules evaluated with a NOT logical operator. + + To match a policy, a user cannot meet any of the Exclude rules. + """ + + include: Optional[List[AccessRule]] = None + """Rules evaluated with an OR logical operator. + + A user needs to meet only one of the Include rules. + """ + + is_default: Optional[List[AccessRule]] = None + """Rules evaluated with an AND logical operator. + + To match a policy, a user must meet all of the Require rules. + """ + + name: Optional[str] = None + """The name of the Access group.""" + + require: Optional[List[AccessRule]] = None + """Rules evaluated with an AND logical operator. + + To match a policy, a user must meet all of the Require rules. + """ + + updated_at: Optional[datetime] = None diff --git a/src/cloudflare/types/zero_trust/access/group_update_response.py b/src/cloudflare/types/zero_trust/access/group_update_response.py new file mode 100644 index 00000000000..008a09f0bd0 --- /dev/null +++ b/src/cloudflare/types/zero_trust/access/group_update_response.py @@ -0,0 +1,45 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime + +from ...._models import BaseModel +from ..access_rule import AccessRule + +__all__ = ["GroupUpdateResponse"] + + +class GroupUpdateResponse(BaseModel): + id: Optional[str] = None + """UUID""" + + created_at: Optional[datetime] = None + + exclude: Optional[List[AccessRule]] = None + """Rules evaluated with a NOT logical operator. + + To match a policy, a user cannot meet any of the Exclude rules. + """ + + include: Optional[List[AccessRule]] = None + """Rules evaluated with an OR logical operator. + + A user needs to meet only one of the Include rules. + """ + + is_default: Optional[List[AccessRule]] = None + """Rules evaluated with an AND logical operator. + + To match a policy, a user must meet all of the Require rules. + """ + + name: Optional[str] = None + """The name of the Access group.""" + + require: Optional[List[AccessRule]] = None + """Rules evaluated with an AND logical operator. + + To match a policy, a user must meet all of the Require rules. + """ + + updated_at: Optional[datetime] = None diff --git a/src/cloudflare/types/zero_trust/access/access_user.py b/src/cloudflare/types/zero_trust/access/user_list_response.py similarity index 94% rename from src/cloudflare/types/zero_trust/access/access_user.py rename to src/cloudflare/types/zero_trust/access/user_list_response.py index 2430d721cf2..e88ef3a0556 100644 --- a/src/cloudflare/types/zero_trust/access/access_user.py +++ b/src/cloudflare/types/zero_trust/access/user_list_response.py @@ -5,10 +5,10 @@ from ...._models import BaseModel -__all__ = ["AccessUser"] +__all__ = ["UserListResponse"] -class AccessUser(BaseModel): +class UserListResponse(BaseModel): id: Optional[str] = None """UUID""" diff --git a/tests/api_resources/zero_trust/access/applications/policy_tests/test_users.py b/tests/api_resources/zero_trust/access/applications/policy_tests/test_users.py index ab93135bd20..38f13c7fc15 100755 --- a/tests/api_resources/zero_trust/access/applications/policy_tests/test_users.py +++ b/tests/api_resources/zero_trust/access/applications/policy_tests/test_users.py @@ -9,6 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.zero_trust.access.applications.policy_tests import UserListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +24,7 @@ def test_method_list(self, client: Cloudflare) -> None: policy_test_id="f1a8b3c9d4e5f6789a0b1c2d3e4f5678a9b0c1d2e3f4a5b67890c1d2e3f4b5a6", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(UserListResponse, user, path=["response"]) + assert_matches_type(SyncSinglePage[UserListResponse], user, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: @@ -35,7 +36,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" user = response.parse() - assert_matches_type(UserListResponse, user, path=["response"]) + assert_matches_type(SyncSinglePage[UserListResponse], user, path=["response"]) @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: @@ -47,7 +48,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" user = response.parse() - assert_matches_type(UserListResponse, user, path=["response"]) + assert_matches_type(SyncSinglePage[UserListResponse], user, path=["response"]) assert cast(Any, response.is_closed) is True @@ -75,7 +76,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: policy_test_id="f1a8b3c9d4e5f6789a0b1c2d3e4f5678a9b0c1d2e3f4a5b67890c1d2e3f4b5a6", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(UserListResponse, user, path=["response"]) + assert_matches_type(AsyncSinglePage[UserListResponse], user, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @@ -87,7 +88,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" user = await response.parse() - assert_matches_type(UserListResponse, user, path=["response"]) + assert_matches_type(AsyncSinglePage[UserListResponse], user, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: @@ -99,7 +100,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" user = await response.parse() - assert_matches_type(UserListResponse, user, path=["response"]) + assert_matches_type(AsyncSinglePage[UserListResponse], user, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/access/applications/test_policy_tests.py b/tests/api_resources/zero_trust/access/applications/test_policy_tests.py index d884f3087b0..72388bdb01f 100755 --- a/tests/api_resources/zero_trust/access/applications/test_policy_tests.py +++ b/tests/api_resources/zero_trust/access/applications/test_policy_tests.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -25,37 +25,40 @@ def test_method_create(self, client: Cloudflare) -> None: policy_test = client.zero_trust.access.applications.policy_tests.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(PolicyTestCreateResponse, policy_test, path=["response"]) + assert_matches_type(Optional[PolicyTestCreateResponse], policy_test, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: policy_test = client.zero_trust.access.applications.policy_tests.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - approval_groups=[ + policies=[ { - "approvals_needed": 1, - "email_addresses": ["test1@cloudflare.com", "test2@cloudflare.com"], - "email_list_uuid": "email_list_uuid", - }, - { - "approvals_needed": 3, - "email_addresses": ["test@cloudflare.com", "test2@cloudflare.com"], - "email_list_uuid": "597147a1-976b-4ef2-9af0-81d5d007fc34", - }, + "decision": "allow", + "include": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], + "name": "Allow devs", + "approval_groups": [ + { + "approvals_needed": 1, + "email_addresses": ["test1@cloudflare.com", "test2@cloudflare.com"], + "email_list_uuid": "email_list_uuid", + }, + { + "approvals_needed": 3, + "email_addresses": ["test@cloudflare.com", "test2@cloudflare.com"], + "email_list_uuid": "597147a1-976b-4ef2-9af0-81d5d007fc34", + }, + ], + "approval_required": True, + "exclude": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], + "isolation_required": False, + "purpose_justification_prompt": "Please enter a justification for entering this protected domain.", + "purpose_justification_required": True, + "require": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], + "session_duration": "24h", + } ], - approval_required=True, - decision="allow", - exclude=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], - include=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], - isolation_required=False, - name="Allow devs", - purpose_justification_prompt="Please enter a justification for entering this protected domain.", - purpose_justification_required=True, - require=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], - session_duration="24h", ) - assert_matches_type(PolicyTestCreateResponse, policy_test, path=["response"]) + assert_matches_type(Optional[PolicyTestCreateResponse], policy_test, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -66,7 +69,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy_test = response.parse() - assert_matches_type(PolicyTestCreateResponse, policy_test, path=["response"]) + assert_matches_type(Optional[PolicyTestCreateResponse], policy_test, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -77,7 +80,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy_test = response.parse() - assert_matches_type(PolicyTestCreateResponse, policy_test, path=["response"]) + assert_matches_type(Optional[PolicyTestCreateResponse], policy_test, path=["response"]) assert cast(Any, response.is_closed) is True @@ -94,7 +97,16 @@ def test_method_get(self, client: Cloudflare) -> None: policy_test_id="f1a8b3c9d4e5f6789a0b1c2d3e4f5678a9b0c1d2e3f4a5b67890c1d2e3f4b5a6", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(PolicyTestGetResponse, policy_test, path=["response"]) + assert_matches_type(Optional[PolicyTestGetResponse], policy_test, path=["response"]) + + @parametrize + def test_method_get_with_all_params(self, client: Cloudflare) -> None: + policy_test = client.zero_trust.access.applications.policy_tests.get( + policy_test_id="f1a8b3c9d4e5f6789a0b1c2d3e4f5678a9b0c1d2e3f4a5b67890c1d2e3f4b5a6", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + page=0, + ) + assert_matches_type(Optional[PolicyTestGetResponse], policy_test, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -106,7 +118,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy_test = response.parse() - assert_matches_type(PolicyTestGetResponse, policy_test, path=["response"]) + assert_matches_type(Optional[PolicyTestGetResponse], policy_test, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -118,7 +130,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy_test = response.parse() - assert_matches_type(PolicyTestGetResponse, policy_test, path=["response"]) + assert_matches_type(Optional[PolicyTestGetResponse], policy_test, path=["response"]) assert cast(Any, response.is_closed) is True @@ -145,37 +157,40 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: policy_test = await async_client.zero_trust.access.applications.policy_tests.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(PolicyTestCreateResponse, policy_test, path=["response"]) + assert_matches_type(Optional[PolicyTestCreateResponse], policy_test, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: policy_test = await async_client.zero_trust.access.applications.policy_tests.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - approval_groups=[ + policies=[ { - "approvals_needed": 1, - "email_addresses": ["test1@cloudflare.com", "test2@cloudflare.com"], - "email_list_uuid": "email_list_uuid", - }, - { - "approvals_needed": 3, - "email_addresses": ["test@cloudflare.com", "test2@cloudflare.com"], - "email_list_uuid": "597147a1-976b-4ef2-9af0-81d5d007fc34", - }, + "decision": "allow", + "include": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], + "name": "Allow devs", + "approval_groups": [ + { + "approvals_needed": 1, + "email_addresses": ["test1@cloudflare.com", "test2@cloudflare.com"], + "email_list_uuid": "email_list_uuid", + }, + { + "approvals_needed": 3, + "email_addresses": ["test@cloudflare.com", "test2@cloudflare.com"], + "email_list_uuid": "597147a1-976b-4ef2-9af0-81d5d007fc34", + }, + ], + "approval_required": True, + "exclude": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], + "isolation_required": False, + "purpose_justification_prompt": "Please enter a justification for entering this protected domain.", + "purpose_justification_required": True, + "require": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], + "session_duration": "24h", + } ], - approval_required=True, - decision="allow", - exclude=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], - include=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], - isolation_required=False, - name="Allow devs", - purpose_justification_prompt="Please enter a justification for entering this protected domain.", - purpose_justification_required=True, - require=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], - session_duration="24h", ) - assert_matches_type(PolicyTestCreateResponse, policy_test, path=["response"]) + assert_matches_type(Optional[PolicyTestCreateResponse], policy_test, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -186,7 +201,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy_test = await response.parse() - assert_matches_type(PolicyTestCreateResponse, policy_test, path=["response"]) + assert_matches_type(Optional[PolicyTestCreateResponse], policy_test, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -197,7 +212,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy_test = await response.parse() - assert_matches_type(PolicyTestCreateResponse, policy_test, path=["response"]) + assert_matches_type(Optional[PolicyTestCreateResponse], policy_test, path=["response"]) assert cast(Any, response.is_closed) is True @@ -214,7 +229,16 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: policy_test_id="f1a8b3c9d4e5f6789a0b1c2d3e4f5678a9b0c1d2e3f4a5b67890c1d2e3f4b5a6", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(PolicyTestGetResponse, policy_test, path=["response"]) + assert_matches_type(Optional[PolicyTestGetResponse], policy_test, path=["response"]) + + @parametrize + async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: + policy_test = await async_client.zero_trust.access.applications.policy_tests.get( + policy_test_id="f1a8b3c9d4e5f6789a0b1c2d3e4f5678a9b0c1d2e3f4a5b67890c1d2e3f4b5a6", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + page=0, + ) + assert_matches_type(Optional[PolicyTestGetResponse], policy_test, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -226,7 +250,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy_test = await response.parse() - assert_matches_type(PolicyTestGetResponse, policy_test, path=["response"]) + assert_matches_type(Optional[PolicyTestGetResponse], policy_test, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -238,7 +262,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy_test = await response.parse() - assert_matches_type(PolicyTestGetResponse, policy_test, path=["response"]) + assert_matches_type(Optional[PolicyTestGetResponse], policy_test, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/access/test_groups.py b/tests/api_resources/zero_trust/access/test_groups.py index f11474c5050..e5c790d8495 100644 --- a/tests/api_resources/zero_trust/access/test_groups.py +++ b/tests/api_resources/zero_trust/access/test_groups.py @@ -11,8 +11,11 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.zero_trust.access import ( - ZeroTrustGroup, + GroupGetResponse, + GroupListResponse, + GroupCreateResponse, GroupDeleteResponse, + GroupUpdateResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -29,7 +32,7 @@ def test_method_create(self, client: Cloudflare) -> None: name="Allow devs", account_id="account_id", ) - assert_matches_type(Optional[ZeroTrustGroup], group, path=["response"]) + assert_matches_type(Optional[GroupCreateResponse], group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -42,7 +45,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: is_default=True, require=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], ) - assert_matches_type(Optional[ZeroTrustGroup], group, path=["response"]) + assert_matches_type(Optional[GroupCreateResponse], group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -56,7 +59,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" group = response.parse() - assert_matches_type(Optional[ZeroTrustGroup], group, path=["response"]) + assert_matches_type(Optional[GroupCreateResponse], group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -70,7 +73,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" group = response.parse() - assert_matches_type(Optional[ZeroTrustGroup], group, path=["response"]) + assert_matches_type(Optional[GroupCreateResponse], group, path=["response"]) assert cast(Any, response.is_closed) is True @@ -100,7 +103,7 @@ def test_method_update(self, client: Cloudflare) -> None: name="Allow devs", account_id="account_id", ) - assert_matches_type(Optional[ZeroTrustGroup], group, path=["response"]) + assert_matches_type(Optional[GroupUpdateResponse], group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -114,7 +117,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: is_default=True, require=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], ) - assert_matches_type(Optional[ZeroTrustGroup], group, path=["response"]) + assert_matches_type(Optional[GroupUpdateResponse], group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -129,7 +132,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" group = response.parse() - assert_matches_type(Optional[ZeroTrustGroup], group, path=["response"]) + assert_matches_type(Optional[GroupUpdateResponse], group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -144,7 +147,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" group = response.parse() - assert_matches_type(Optional[ZeroTrustGroup], group, path=["response"]) + assert_matches_type(Optional[GroupUpdateResponse], group, path=["response"]) assert cast(Any, response.is_closed) is True @@ -181,7 +184,7 @@ def test_method_list(self, client: Cloudflare) -> None: group = client.zero_trust.access.groups.list( account_id="account_id", ) - assert_matches_type(SyncSinglePage[ZeroTrustGroup], group, path=["response"]) + assert_matches_type(SyncSinglePage[GroupListResponse], group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -191,7 +194,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: name="name", search="search", ) - assert_matches_type(SyncSinglePage[ZeroTrustGroup], group, path=["response"]) + assert_matches_type(SyncSinglePage[GroupListResponse], group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -203,7 +206,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" group = response.parse() - assert_matches_type(SyncSinglePage[ZeroTrustGroup], group, path=["response"]) + assert_matches_type(SyncSinglePage[GroupListResponse], group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -215,7 +218,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" group = response.parse() - assert_matches_type(SyncSinglePage[ZeroTrustGroup], group, path=["response"]) + assert_matches_type(SyncSinglePage[GroupListResponse], group, path=["response"]) assert cast(Any, response.is_closed) is True @@ -306,7 +309,7 @@ def test_method_get(self, client: Cloudflare) -> None: group_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", ) - assert_matches_type(Optional[ZeroTrustGroup], group, path=["response"]) + assert_matches_type(Optional[GroupGetResponse], group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -315,7 +318,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: group_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", ) - assert_matches_type(Optional[ZeroTrustGroup], group, path=["response"]) + assert_matches_type(Optional[GroupGetResponse], group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -328,7 +331,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" group = response.parse() - assert_matches_type(Optional[ZeroTrustGroup], group, path=["response"]) + assert_matches_type(Optional[GroupGetResponse], group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -341,7 +344,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" group = response.parse() - assert_matches_type(Optional[ZeroTrustGroup], group, path=["response"]) + assert_matches_type(Optional[GroupGetResponse], group, path=["response"]) assert cast(Any, response.is_closed) is True @@ -378,7 +381,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: name="Allow devs", account_id="account_id", ) - assert_matches_type(Optional[ZeroTrustGroup], group, path=["response"]) + assert_matches_type(Optional[GroupCreateResponse], group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -391,7 +394,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare is_default=True, require=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], ) - assert_matches_type(Optional[ZeroTrustGroup], group, path=["response"]) + assert_matches_type(Optional[GroupCreateResponse], group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -405,7 +408,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" group = await response.parse() - assert_matches_type(Optional[ZeroTrustGroup], group, path=["response"]) + assert_matches_type(Optional[GroupCreateResponse], group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -419,7 +422,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" group = await response.parse() - assert_matches_type(Optional[ZeroTrustGroup], group, path=["response"]) + assert_matches_type(Optional[GroupCreateResponse], group, path=["response"]) assert cast(Any, response.is_closed) is True @@ -449,7 +452,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: name="Allow devs", account_id="account_id", ) - assert_matches_type(Optional[ZeroTrustGroup], group, path=["response"]) + assert_matches_type(Optional[GroupUpdateResponse], group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -463,7 +466,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare is_default=True, require=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], ) - assert_matches_type(Optional[ZeroTrustGroup], group, path=["response"]) + assert_matches_type(Optional[GroupUpdateResponse], group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -478,7 +481,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" group = await response.parse() - assert_matches_type(Optional[ZeroTrustGroup], group, path=["response"]) + assert_matches_type(Optional[GroupUpdateResponse], group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -493,7 +496,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" group = await response.parse() - assert_matches_type(Optional[ZeroTrustGroup], group, path=["response"]) + assert_matches_type(Optional[GroupUpdateResponse], group, path=["response"]) assert cast(Any, response.is_closed) is True @@ -530,7 +533,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: group = await async_client.zero_trust.access.groups.list( account_id="account_id", ) - assert_matches_type(AsyncSinglePage[ZeroTrustGroup], group, path=["response"]) + assert_matches_type(AsyncSinglePage[GroupListResponse], group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -540,7 +543,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) name="name", search="search", ) - assert_matches_type(AsyncSinglePage[ZeroTrustGroup], group, path=["response"]) + assert_matches_type(AsyncSinglePage[GroupListResponse], group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -552,7 +555,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" group = await response.parse() - assert_matches_type(AsyncSinglePage[ZeroTrustGroup], group, path=["response"]) + assert_matches_type(AsyncSinglePage[GroupListResponse], group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -564,7 +567,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" group = await response.parse() - assert_matches_type(AsyncSinglePage[ZeroTrustGroup], group, path=["response"]) + assert_matches_type(AsyncSinglePage[GroupListResponse], group, path=["response"]) assert cast(Any, response.is_closed) is True @@ -655,7 +658,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: group_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", ) - assert_matches_type(Optional[ZeroTrustGroup], group, path=["response"]) + assert_matches_type(Optional[GroupGetResponse], group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -664,7 +667,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - group_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", ) - assert_matches_type(Optional[ZeroTrustGroup], group, path=["response"]) + assert_matches_type(Optional[GroupGetResponse], group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -677,7 +680,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" group = await response.parse() - assert_matches_type(Optional[ZeroTrustGroup], group, path=["response"]) + assert_matches_type(Optional[GroupGetResponse], group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -690,7 +693,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" group = await response.parse() - assert_matches_type(Optional[ZeroTrustGroup], group, path=["response"]) + assert_matches_type(Optional[GroupGetResponse], group, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/access/test_users.py b/tests/api_resources/zero_trust/access/test_users.py index 718418f8b98..ae92054aec0 100644 --- a/tests/api_resources/zero_trust/access/test_users.py +++ b/tests/api_resources/zero_trust/access/test_users.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.zero_trust.access import AccessUser +from cloudflare.types.zero_trust.access import UserListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +23,7 @@ def test_method_list(self, client: Cloudflare) -> None: user = client.zero_trust.access.users.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[AccessUser], user, path=["response"]) + assert_matches_type(SyncSinglePage[UserListResponse], user, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: @@ -33,7 +33,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: name="name", search="search", ) - assert_matches_type(SyncSinglePage[AccessUser], user, path=["response"]) + assert_matches_type(SyncSinglePage[UserListResponse], user, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: @@ -44,7 +44,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" user = response.parse() - assert_matches_type(SyncSinglePage[AccessUser], user, path=["response"]) + assert_matches_type(SyncSinglePage[UserListResponse], user, path=["response"]) @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: @@ -55,7 +55,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" user = response.parse() - assert_matches_type(SyncSinglePage[AccessUser], user, path=["response"]) + assert_matches_type(SyncSinglePage[UserListResponse], user, path=["response"]) assert cast(Any, response.is_closed) is True @@ -75,7 +75,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: user = await async_client.zero_trust.access.users.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[AccessUser], user, path=["response"]) + assert_matches_type(AsyncSinglePage[UserListResponse], user, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -85,7 +85,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) name="name", search="search", ) - assert_matches_type(AsyncSinglePage[AccessUser], user, path=["response"]) + assert_matches_type(AsyncSinglePage[UserListResponse], user, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @@ -96,7 +96,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" user = await response.parse() - assert_matches_type(AsyncSinglePage[AccessUser], user, path=["response"]) + assert_matches_type(AsyncSinglePage[UserListResponse], user, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: @@ -107,7 +107,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" user = await response.parse() - assert_matches_type(AsyncSinglePage[AccessUser], user, path=["response"]) + assert_matches_type(AsyncSinglePage[UserListResponse], user, path=["response"]) assert cast(Any, response.is_closed) is True From 86cdaf48974d3e213d7c9f7fa6c0d0542b12439f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Jan 2025 22:02:30 +0000 Subject: [PATCH 056/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index e871690d0f2..d86d2e7d558 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1504 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8973dde42d42a39c8fbc5f3f1eb1328e6ac0c805ca4d3e5920796749ed58eb0a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-04299b899e2bbf8ba1b4ad96d5e9f9c3e0c9b6246bfeac3f9ab684b855b0e412.yml From 50a0faf79f3bcd0f6fc98d399879d5740db92c7b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Jan 2025 22:20:18 +0000 Subject: [PATCH 057/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d86d2e7d558..e871690d0f2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1504 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-04299b899e2bbf8ba1b4ad96d5e9f9c3e0c9b6246bfeac3f9ab684b855b0e412.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8973dde42d42a39c8fbc5f3f1eb1328e6ac0c805ca4d3e5920796749ed58eb0a.yml From 0f2ad72c6d7cb0b27f2de765a90f585b15ad2c39 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Jan 2025 22:23:51 +0000 Subject: [PATCH 058/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index e871690d0f2..d86d2e7d558 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1504 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8973dde42d42a39c8fbc5f3f1eb1328e6ac0c805ca4d3e5920796749ed58eb0a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-04299b899e2bbf8ba1b4ad96d5e9f9c3e0c9b6246bfeac3f9ab684b855b0e412.yml From f7bdce1b005a0a8852135609925655b5fed55dfe Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Jan 2025 22:48:04 +0000 Subject: [PATCH 059/358] feat(api): add endpoint mappings (#2408) --- .stats.yml | 4 +- api.md | 215 +++++++- src/cloudflare/_client.py | 38 ++ .../resources/custom_hostnames/__init__.py | 14 + .../certificate_pack/__init__.py | 33 ++ .../certificate_pack/certificate_pack.py | 102 ++++ .../certificate_pack/certificates.py | 372 +++++++++++++ .../custom_hostnames/custom_hostnames.py | 32 ++ .../resources/r2/buckets/__init__.py | 28 + .../resources/r2/buckets/buckets.py | 64 +++ src/cloudflare/resources/r2/buckets/locks.py | 328 ++++++++++++ .../resources/r2/buckets/metrics.py | 182 +++++++ src/cloudflare/resources/radar/__init__.py | 14 + src/cloudflare/resources/radar/ai/__init__.py | 14 + src/cloudflare/resources/radar/ai/ai.py | 32 ++ .../resources/radar/ai/inference/__init__.py | 47 ++ .../resources/radar/ai/inference/inference.py | 134 +++++ .../resources/radar/ai/inference/summary.py | 384 ++++++++++++++ .../inference/timeseries_groups/__init__.py | 33 ++ .../ai/inference/timeseries_groups/summary.py | 408 ++++++++++++++ .../timeseries_groups/timeseries_groups.py | 102 ++++ src/cloudflare/resources/radar/radar.py | 32 ++ .../resources/radar/ranking/__init__.py | 14 + .../radar/ranking/internet_services.py | 382 ++++++++++++++ .../resources/radar/ranking/ranking.py | 32 ++ .../resources/radar/robots_txt/__init__.py | 33 ++ .../resources/radar/robots_txt/robots_txt.py | 102 ++++ .../radar/robots_txt/top/__init__.py | 33 ++ .../resources/radar/robots_txt/top/top.py | 257 +++++++++ .../radar/robots_txt/top/user_agents.py | 241 +++++++++ .../resources/security_center/__init__.py | 33 ++ .../security_center/insights/__init__.py | 61 +++ .../security_center/insights/class_.py | 265 ++++++++++ .../security_center/insights/insights.py | 496 ++++++++++++++++++ .../security_center/insights/severity.py | 265 ++++++++++ .../security_center/insights/type.py | 265 ++++++++++ .../security_center/security_center.py | 102 ++++ .../zero_trust/access/logs/__init__.py | 14 + .../resources/zero_trust/access/logs/logs.py | 32 ++ .../zero_trust/access/logs/scim/__init__.py | 33 ++ .../zero_trust/access/logs/scim/scim.py | 102 ++++ .../zero_trust/access/logs/scim/updates.py | 292 +++++++++++ .../zero_trust/identity_providers/__init__.py | 33 ++ .../identity_providers.py | 62 ++- .../identity_providers/scim/__init__.py | 47 ++ .../identity_providers/scim/groups.py | 232 ++++++++ .../identity_providers/scim/scim.py | 134 +++++ .../identity_providers/scim/users.py | 246 +++++++++ .../resources/zero_trust/zero_trust.py | 16 +- .../certificate_pack/__init__.py | 7 + .../certificate_delete_response.py | 12 + .../certificate_update_params.py | 24 + .../certificate_update_response.py | 257 +++++++++ src/cloudflare/types/r2/buckets/__init__.py | 3 + .../types/r2/buckets/lock_get_response.py | 62 +++ .../types/r2/buckets/lock_update_params.py | 68 +++ .../types/r2/buckets/metric_list_response.py | 85 +++ .../types/radar/ai/inference/__init__.py | 8 + .../ai/inference/summary_model_params.py | 38 ++ .../ai/inference/summary_model_response.py | 56 ++ .../radar/ai/inference/summary_task_params.py | 38 ++ .../ai/inference/summary_task_response.py | 56 ++ .../inference/timeseries_groups/__init__.py | 8 + .../timeseries_groups/summary_model_params.py | 45 ++ .../summary_model_response.py | 23 + .../timeseries_groups/summary_task_params.py | 45 ++ .../summary_task_response.py | 23 + .../types/radar/ranking/__init__.py | 8 + ...ternet_service_timeseries_groups_params.py | 38 ++ ...rnet_service_timeseries_groups_response.py | 38 ++ .../ranking/internet_service_top_params.py | 28 + .../ranking/internet_service_top_response.py | 31 ++ .../types/radar/robots_txt/__init__.py | 6 + .../types/radar/robots_txt/top/__init__.py | 6 + .../top/user_agent_directive_params.py | 34 ++ .../top/user_agent_directive_response.py | 82 +++ .../top_domain_categories_params.py | 28 + .../top_domain_categories_response.py | 78 +++ .../types/security_center/__init__.py | 8 + .../security_center/insight_dismiss_params.py | 17 + .../insight_dismiss_response.py | 18 + .../security_center/insight_get_params.py | 48 ++ .../security_center/insight_get_response.py | 47 ++ .../security_center/insights/__init__.py | 10 + .../insights/class_get_params.py | 42 ++ .../insights/class_get_response.py | 17 + .../insights/severity_get_params.py | 42 ++ .../insights/severity_get_response.py | 17 + .../insights/type_get_params.py | 42 ++ .../insights/type_get_response.py | 17 + .../types/zero_trust/access/__init__.py | 2 + .../types/zero_trust/access/access_user.py | 56 ++ .../zero_trust/access/logs/scim/__init__.py | 6 + .../access/logs/scim/update_list_params.py | 52 ++ .../access/logs/scim/update_list_response.py | 45 ++ .../zero_trust/access/zero_trust_group.py | 37 ++ .../zero_trust/identity_providers/__init__.py | 3 + .../identity_providers/scim/__init__.py | 6 + .../scim/group_list_params.py | 27 + .../scim/user_list_params.py | 32 ++ .../certificate_pack/__init__.py | 1 + .../certificate_pack/test_certificates.py | 349 ++++++++++++ tests/api_resources/r2/buckets/test_locks.py | 272 ++++++++++ .../api_resources/r2/buckets/test_metrics.py | 98 ++++ .../radar/ai/inference/__init__.py | 1 + .../radar/ai/inference/test_summary.py | 174 ++++++ .../inference/timeseries_groups/__init__.py | 1 + .../timeseries_groups/test_summary.py | 178 +++++++ .../radar/ranking/test_internet_services.py | 174 ++++++ .../radar/robots_txt/__init__.py | 1 + .../radar/robots_txt/test_top.py | 95 ++++ .../radar/robots_txt/top/__init__.py | 1 + .../radar/robots_txt/top/test_user_agents.py | 99 ++++ .../api_resources/security_center/__init__.py | 1 + .../security_center/insights/__init__.py | 1 + .../security_center/insights/test_class_.py | 144 +++++ .../security_center/insights/test_severity.py | 144 +++++ .../security_center/insights/test_type.py | 144 +++++ .../security_center/test_insights.py | 277 ++++++++++ .../zero_trust/access/logs/scim/__init__.py | 1 + .../access/logs/scim/test_updates.py | 146 ++++++ .../zero_trust/identity_providers/__init__.py | 1 + .../identity_providers/scim/__init__.py | 1 + .../identity_providers/scim/test_groups.py | 141 +++++ .../identity_providers/scim/test_users.py | 145 +++++ 125 files changed, 10821 insertions(+), 31 deletions(-) create mode 100644 src/cloudflare/resources/custom_hostnames/certificate_pack/__init__.py create mode 100644 src/cloudflare/resources/custom_hostnames/certificate_pack/certificate_pack.py create mode 100644 src/cloudflare/resources/custom_hostnames/certificate_pack/certificates.py create mode 100644 src/cloudflare/resources/r2/buckets/locks.py create mode 100644 src/cloudflare/resources/r2/buckets/metrics.py create mode 100644 src/cloudflare/resources/radar/ai/inference/__init__.py create mode 100644 src/cloudflare/resources/radar/ai/inference/inference.py create mode 100644 src/cloudflare/resources/radar/ai/inference/summary.py create mode 100644 src/cloudflare/resources/radar/ai/inference/timeseries_groups/__init__.py create mode 100644 src/cloudflare/resources/radar/ai/inference/timeseries_groups/summary.py create mode 100644 src/cloudflare/resources/radar/ai/inference/timeseries_groups/timeseries_groups.py create mode 100644 src/cloudflare/resources/radar/ranking/internet_services.py create mode 100644 src/cloudflare/resources/radar/robots_txt/__init__.py create mode 100644 src/cloudflare/resources/radar/robots_txt/robots_txt.py create mode 100644 src/cloudflare/resources/radar/robots_txt/top/__init__.py create mode 100644 src/cloudflare/resources/radar/robots_txt/top/top.py create mode 100644 src/cloudflare/resources/radar/robots_txt/top/user_agents.py create mode 100644 src/cloudflare/resources/security_center/__init__.py create mode 100644 src/cloudflare/resources/security_center/insights/__init__.py create mode 100644 src/cloudflare/resources/security_center/insights/class_.py create mode 100644 src/cloudflare/resources/security_center/insights/insights.py create mode 100644 src/cloudflare/resources/security_center/insights/severity.py create mode 100644 src/cloudflare/resources/security_center/insights/type.py create mode 100644 src/cloudflare/resources/security_center/security_center.py create mode 100644 src/cloudflare/resources/zero_trust/access/logs/scim/__init__.py create mode 100644 src/cloudflare/resources/zero_trust/access/logs/scim/scim.py create mode 100644 src/cloudflare/resources/zero_trust/access/logs/scim/updates.py create mode 100644 src/cloudflare/resources/zero_trust/identity_providers/__init__.py rename src/cloudflare/resources/zero_trust/{ => identity_providers}/identity_providers.py (98%) create mode 100644 src/cloudflare/resources/zero_trust/identity_providers/scim/__init__.py create mode 100644 src/cloudflare/resources/zero_trust/identity_providers/scim/groups.py create mode 100644 src/cloudflare/resources/zero_trust/identity_providers/scim/scim.py create mode 100644 src/cloudflare/resources/zero_trust/identity_providers/scim/users.py create mode 100644 src/cloudflare/types/custom_hostnames/certificate_pack/__init__.py create mode 100644 src/cloudflare/types/custom_hostnames/certificate_pack/certificate_delete_response.py create mode 100644 src/cloudflare/types/custom_hostnames/certificate_pack/certificate_update_params.py create mode 100644 src/cloudflare/types/custom_hostnames/certificate_pack/certificate_update_response.py create mode 100644 src/cloudflare/types/r2/buckets/lock_get_response.py create mode 100644 src/cloudflare/types/r2/buckets/lock_update_params.py create mode 100644 src/cloudflare/types/r2/buckets/metric_list_response.py create mode 100644 src/cloudflare/types/radar/ai/inference/__init__.py create mode 100644 src/cloudflare/types/radar/ai/inference/summary_model_params.py create mode 100644 src/cloudflare/types/radar/ai/inference/summary_model_response.py create mode 100644 src/cloudflare/types/radar/ai/inference/summary_task_params.py create mode 100644 src/cloudflare/types/radar/ai/inference/summary_task_response.py create mode 100644 src/cloudflare/types/radar/ai/inference/timeseries_groups/__init__.py create mode 100644 src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_model_params.py create mode 100644 src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_model_response.py create mode 100644 src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_task_params.py create mode 100644 src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_task_response.py create mode 100644 src/cloudflare/types/radar/ranking/internet_service_timeseries_groups_params.py create mode 100644 src/cloudflare/types/radar/ranking/internet_service_timeseries_groups_response.py create mode 100644 src/cloudflare/types/radar/ranking/internet_service_top_params.py create mode 100644 src/cloudflare/types/radar/ranking/internet_service_top_response.py create mode 100644 src/cloudflare/types/radar/robots_txt/__init__.py create mode 100644 src/cloudflare/types/radar/robots_txt/top/__init__.py create mode 100644 src/cloudflare/types/radar/robots_txt/top/user_agent_directive_params.py create mode 100644 src/cloudflare/types/radar/robots_txt/top/user_agent_directive_response.py create mode 100644 src/cloudflare/types/radar/robots_txt/top_domain_categories_params.py create mode 100644 src/cloudflare/types/radar/robots_txt/top_domain_categories_response.py create mode 100644 src/cloudflare/types/security_center/__init__.py create mode 100644 src/cloudflare/types/security_center/insight_dismiss_params.py create mode 100644 src/cloudflare/types/security_center/insight_dismiss_response.py create mode 100644 src/cloudflare/types/security_center/insight_get_params.py create mode 100644 src/cloudflare/types/security_center/insight_get_response.py create mode 100644 src/cloudflare/types/security_center/insights/__init__.py create mode 100644 src/cloudflare/types/security_center/insights/class_get_params.py create mode 100644 src/cloudflare/types/security_center/insights/class_get_response.py create mode 100644 src/cloudflare/types/security_center/insights/severity_get_params.py create mode 100644 src/cloudflare/types/security_center/insights/severity_get_response.py create mode 100644 src/cloudflare/types/security_center/insights/type_get_params.py create mode 100644 src/cloudflare/types/security_center/insights/type_get_response.py create mode 100644 src/cloudflare/types/zero_trust/access/access_user.py create mode 100644 src/cloudflare/types/zero_trust/access/logs/scim/__init__.py create mode 100644 src/cloudflare/types/zero_trust/access/logs/scim/update_list_params.py create mode 100644 src/cloudflare/types/zero_trust/access/logs/scim/update_list_response.py create mode 100644 src/cloudflare/types/zero_trust/access/zero_trust_group.py create mode 100644 src/cloudflare/types/zero_trust/identity_providers/__init__.py create mode 100644 src/cloudflare/types/zero_trust/identity_providers/scim/__init__.py create mode 100644 src/cloudflare/types/zero_trust/identity_providers/scim/group_list_params.py create mode 100644 src/cloudflare/types/zero_trust/identity_providers/scim/user_list_params.py create mode 100644 tests/api_resources/custom_hostnames/certificate_pack/__init__.py create mode 100644 tests/api_resources/custom_hostnames/certificate_pack/test_certificates.py create mode 100644 tests/api_resources/r2/buckets/test_locks.py create mode 100644 tests/api_resources/r2/buckets/test_metrics.py create mode 100644 tests/api_resources/radar/ai/inference/__init__.py create mode 100644 tests/api_resources/radar/ai/inference/test_summary.py create mode 100644 tests/api_resources/radar/ai/inference/timeseries_groups/__init__.py create mode 100644 tests/api_resources/radar/ai/inference/timeseries_groups/test_summary.py create mode 100644 tests/api_resources/radar/ranking/test_internet_services.py create mode 100644 tests/api_resources/radar/robots_txt/__init__.py create mode 100644 tests/api_resources/radar/robots_txt/test_top.py create mode 100644 tests/api_resources/radar/robots_txt/top/__init__.py create mode 100644 tests/api_resources/radar/robots_txt/top/test_user_agents.py create mode 100644 tests/api_resources/security_center/__init__.py create mode 100644 tests/api_resources/security_center/insights/__init__.py create mode 100644 tests/api_resources/security_center/insights/test_class_.py create mode 100644 tests/api_resources/security_center/insights/test_severity.py create mode 100644 tests/api_resources/security_center/insights/test_type.py create mode 100644 tests/api_resources/security_center/test_insights.py create mode 100644 tests/api_resources/zero_trust/access/logs/scim/__init__.py create mode 100644 tests/api_resources/zero_trust/access/logs/scim/test_updates.py create mode 100644 tests/api_resources/zero_trust/identity_providers/__init__.py create mode 100644 tests/api_resources/zero_trust/identity_providers/scim/__init__.py create mode 100644 tests/api_resources/zero_trust/identity_providers/scim/test_groups.py create mode 100644 tests/api_resources/zero_trust/identity_providers/scim/test_users.py diff --git a/.stats.yml b/.stats.yml index d86d2e7d558..de617f814c7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 1504 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-04299b899e2bbf8ba1b4ad96d5e9f9c3e0c9b6246bfeac3f9ab684b855b0e412.yml +configured_endpoints: 1525 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8973dde42d42a39c8fbc5f3f1eb1328e6ac0c805ca4d3e5920796749ed58eb0a.yml diff --git a/api.md b/api.md index 817f0409ecd..c46482ec1ed 100644 --- a/api.md +++ b/api.md @@ -972,6 +972,24 @@ Methods: - client.custom_hostnames.fallback_origin.delete(\*, zone_id) -> Optional[FallbackOriginDeleteResponse] - client.custom_hostnames.fallback_origin.get(\*, zone_id) -> Optional[FallbackOriginGetResponse] +## CertificatePack + +### Certificates + +Types: + +```python +from cloudflare.types.custom_hostnames.certificate_pack import ( + CertificateUpdateResponse, + CertificateDeleteResponse, +) +``` + +Methods: + +- client.custom_hostnames.certificate_pack.certificates.update(certificate_id, \*, zone_id, custom_hostname_id, certificate_pack_id, \*\*params) -> Optional[CertificateUpdateResponse] +- client.custom_hostnames.certificate_pack.certificates.delete(certificate_id, \*, zone_id, custom_hostname_id, certificate_pack_id) -> CertificateDeleteResponse + # CustomNameservers Types: @@ -4736,6 +4754,31 @@ Methods: - client.r2.buckets.event_notifications.configuration.queues.update(queue_id, \*, account_id, bucket_name, \*\*params) -> object - client.r2.buckets.event_notifications.configuration.queues.delete(queue_id, \*, account_id, bucket_name) -> object +### Locks + +Types: + +```python +from cloudflare.types.r2.buckets import LockUpdateResponse, LockGetResponse +``` + +Methods: + +- client.r2.buckets.locks.update(bucket_name, \*, account_id, \*\*params) -> object +- client.r2.buckets.locks.get(bucket_name, \*, account_id) -> LockGetResponse + +### Metrics + +Types: + +```python +from cloudflare.types.r2.buckets import MetricListResponse +``` + +Methods: + +- client.r2.buckets.metrics.list(\*, account_id) -> MetricListResponse + ### Sippy Types: @@ -5226,11 +5269,25 @@ from cloudflare.types.zero_trust import ( Methods: -- client.zero_trust.identity_providers.create(\*, account_id, zone_id, \*\*params) -> Optional[IdentityProvider] -- client.zero_trust.identity_providers.update(identity_provider_id, \*, account_id, zone_id, \*\*params) -> Optional[IdentityProvider] -- client.zero_trust.identity_providers.list(\*, account_id, zone_id, \*\*params) -> SyncSinglePage[IdentityProviderListResponse] -- client.zero_trust.identity_providers.delete(identity_provider_id, \*, account_id, zone_id) -> Optional[IdentityProviderDeleteResponse] -- client.zero_trust.identity_providers.get(identity_provider_id, \*, account_id, zone_id) -> Optional[IdentityProvider] +- client.zero_trust.identity_providers.create(\*, account_id, zone_id, \*\*params) -> Optional[IdentityProvider] +- client.zero_trust.identity_providers.update(identity_provider_id, \*, account_id, zone_id, \*\*params) -> Optional[IdentityProvider] +- client.zero_trust.identity_providers.list(\*, account_id, zone_id, \*\*params) -> SyncSinglePage[IdentityProviderListResponse] +- client.zero_trust.identity_providers.delete(identity_provider_id, \*, account_id, zone_id) -> Optional[IdentityProviderDeleteResponse] +- client.zero_trust.identity_providers.get(identity_provider_id, \*, account_id, zone_id) -> Optional[IdentityProvider] + +### SCIM + +#### Groups + +Methods: + +- client.zero_trust.identity_providers.scim.groups.list(identity_provider_id, \*, account_id, \*\*params) -> SyncSinglePage[ZeroTrustGroup] + +#### Users + +Methods: + +- client.zero_trust.identity_providers.scim.users.list(identity_provider_id, \*, account_id, \*\*params) -> SyncSinglePage[AccessUser] ## Organizations @@ -5587,13 +5644,33 @@ Methods: Types: ```python -from cloudflare.types.zero_trust.access.logs import AccessRequests, AccessRequestListResponse +from cloudflare.types.zero_trust.access.logs import AccessRequestListResponse ``` Methods: - client.zero_trust.access.logs.access_requests.list(\*, account_id, \*\*params) -> Optional[AccessRequestListResponse] +#### SCIM + +Types: + +```python +from cloudflare.types.zero_trust.access.logs import AccessRequests +``` + +##### Updates + +Types: + +```python +from cloudflare.types.zero_trust.access.logs.scim import UpdateListResponse +``` + +Methods: + +- client.zero_trust.access.logs.scim.updates.list(\*, account_id, \*\*params) -> SyncSinglePage[UpdateListResponse] + ### Users Types: @@ -6747,6 +6824,39 @@ Methods: ## AI +### Inference + +#### Summary + +Types: + +```python +from cloudflare.types.radar.ai.inference import SummaryModelResponse, SummaryTaskResponse +``` + +Methods: + +- client.radar.ai.inference.summary.model(\*\*params) -> SummaryModelResponse +- client.radar.ai.inference.summary.task(\*\*params) -> SummaryTaskResponse + +#### TimeseriesGroups + +##### Summary + +Types: + +```python +from cloudflare.types.radar.ai.inference.timeseries_groups import ( + SummaryModelResponse, + SummaryTaskResponse, +) +``` + +Methods: + +- client.radar.ai.inference.timeseries_groups.summary.model(\*\*params) -> SummaryModelResponse +- client.radar.ai.inference.timeseries_groups.summary.task(\*\*params) -> SummaryTaskResponse + ### Bots #### Summary @@ -7835,6 +7945,22 @@ Methods: - client.radar.ranking.domain.get(domain, \*\*params) -> DomainGetResponse +### InternetServices + +Types: + +```python +from cloudflare.types.radar.ranking import ( + InternetServiceTimeseriesGroupsResponse, + InternetServiceTopResponse, +) +``` + +Methods: + +- client.radar.ranking.internet_services.timeseries_groups(\*\*params) -> InternetServiceTimeseriesGroupsResponse +- client.radar.ranking.internet_services.top(\*\*params) -> InternetServiceTopResponse + ## TrafficAnomalies Types: @@ -7875,6 +8001,32 @@ Methods: - client.radar.tcp_resets_timeouts.summary(\*\*params) -> TCPResetsTimeoutSummaryResponse - client.radar.tcp_resets_timeouts.timeseries_groups(\*\*params) -> TCPResetsTimeoutTimeseriesGroupsResponse +## RobotsTXT + +### Top + +Types: + +```python +from cloudflare.types.radar.robots_txt import TopDomainCategoriesResponse +``` + +Methods: + +- client.radar.robots_txt.top.domain_categories(\*\*params) -> TopDomainCategoriesResponse + +#### UserAgents + +Types: + +```python +from cloudflare.types.radar.robots_txt.top import UserAgentDirectiveResponse +``` + +Methods: + +- client.radar.robots_txt.top.user_agents.directive(\*\*params) -> UserAgentDirectiveResponse + # BotManagement Types: @@ -8692,3 +8844,54 @@ from cloudflare.types.ai.models import SchemaGetResponse Methods: - client.ai.models.schema.get(\*, account_id, \*\*params) -> object + +# SecurityCenter + +## Insights + +Types: + +```python +from cloudflare.types.security_center import InsightDismissResponse, InsightGetResponse +``` + +Methods: + +- client.security_center.insights.dismiss(issue_id, \*, account_id, zone_id, \*\*params) -> InsightDismissResponse +- client.security_center.insights.get(\*, account_id, zone_id, \*\*params) -> Optional[InsightGetResponse] + +### Class + +Types: + +```python +from cloudflare.types.security_center.insights import ClassGetResponse +``` + +Methods: + +- client.security*center.insights.class*.get(\*, account_id, zone_id, \*\*params) -> Optional[ClassGetResponse] + +### Severity + +Types: + +```python +from cloudflare.types.security_center.insights import SeverityGetResponse +``` + +Methods: + +- client.security_center.insights.severity.get(\*, account_id, zone_id, \*\*params) -> Optional[SeverityGetResponse] + +### Type + +Types: + +```python +from cloudflare.types.security_center.insights import TypeGetResponse +``` + +Methods: + +- client.security_center.insights.type.get(\*, account_id, zone_id, \*\*params) -> Optional[TypeGetResponse] diff --git a/src/cloudflare/_client.py b/src/cloudflare/_client.py index e2e92d90f55..6427a186cad 100644 --- a/src/cloudflare/_client.py +++ b/src/cloudflare/_client.py @@ -104,6 +104,7 @@ cloud_connector, durable_objects, request_tracers, + security_center, brand_protection, content_scanning, custom_hostnames, @@ -203,6 +204,7 @@ from .resources.cloud_connector.cloud_connector import CloudConnectorResource, AsyncCloudConnectorResource from .resources.durable_objects.durable_objects import DurableObjectsResource, AsyncDurableObjectsResource from .resources.request_tracers.request_tracers import RequestTracersResource, AsyncRequestTracersResource + from .resources.security_center.security_center import SecurityCenterResource, AsyncSecurityCenterResource from .resources.content_scanning.content_scanning import ContentScanningResource, AsyncContentScanningResource from .resources.custom_hostnames.custom_hostnames import CustomHostnamesResource, AsyncCustomHostnamesResource from .resources.resource_sharing.resource_sharing import ResourceSharingResource, AsyncResourceSharingResource @@ -843,6 +845,12 @@ def ai(self) -> AIResource: return AIResource(self) + @cached_property + def security_center(self) -> SecurityCenterResource: + from .resources.security_center import SecurityCenterResource + + return SecurityCenterResource(self) + @cached_property def with_raw_response(self) -> CloudflareWithRawResponse: return CloudflareWithRawResponse(self) @@ -1620,6 +1628,12 @@ def ai(self) -> AsyncAIResource: return AsyncAIResource(self) + @cached_property + def security_center(self) -> AsyncSecurityCenterResource: + from .resources.security_center import AsyncSecurityCenterResource + + return AsyncSecurityCenterResource(self) + @cached_property def with_raw_response(self) -> AsyncCloudflareWithRawResponse: return AsyncCloudflareWithRawResponse(self) @@ -2332,6 +2346,12 @@ def ai(self) -> ai.AIResourceWithRawResponse: return AIResourceWithRawResponse(self._client.ai) + @cached_property + def security_center(self) -> security_center.SecurityCenterResourceWithRawResponse: + from .resources.security_center import SecurityCenterResourceWithRawResponse + + return SecurityCenterResourceWithRawResponse(self._client.security_center) + class AsyncCloudflareWithRawResponse: _client: AsyncCloudflare @@ -2863,6 +2883,12 @@ def ai(self) -> ai.AsyncAIResourceWithRawResponse: return AsyncAIResourceWithRawResponse(self._client.ai) + @cached_property + def security_center(self) -> security_center.AsyncSecurityCenterResourceWithRawResponse: + from .resources.security_center import AsyncSecurityCenterResourceWithRawResponse + + return AsyncSecurityCenterResourceWithRawResponse(self._client.security_center) + class CloudflareWithStreamedResponse: _client: Cloudflare @@ -3394,6 +3420,12 @@ def ai(self) -> ai.AIResourceWithStreamingResponse: return AIResourceWithStreamingResponse(self._client.ai) + @cached_property + def security_center(self) -> security_center.SecurityCenterResourceWithStreamingResponse: + from .resources.security_center import SecurityCenterResourceWithStreamingResponse + + return SecurityCenterResourceWithStreamingResponse(self._client.security_center) + class AsyncCloudflareWithStreamedResponse: _client: AsyncCloudflare @@ -3935,6 +3967,12 @@ def ai(self) -> ai.AsyncAIResourceWithStreamingResponse: return AsyncAIResourceWithStreamingResponse(self._client.ai) + @cached_property + def security_center(self) -> security_center.AsyncSecurityCenterResourceWithStreamingResponse: + from .resources.security_center import AsyncSecurityCenterResourceWithStreamingResponse + + return AsyncSecurityCenterResourceWithStreamingResponse(self._client.security_center) + Client = Cloudflare diff --git a/src/cloudflare/resources/custom_hostnames/__init__.py b/src/cloudflare/resources/custom_hostnames/__init__.py index 333e8854818..00e91bd5119 100644 --- a/src/cloudflare/resources/custom_hostnames/__init__.py +++ b/src/cloudflare/resources/custom_hostnames/__init__.py @@ -8,6 +8,14 @@ FallbackOriginResourceWithStreamingResponse, AsyncFallbackOriginResourceWithStreamingResponse, ) +from .certificate_pack import ( + CertificatePackResource, + AsyncCertificatePackResource, + CertificatePackResourceWithRawResponse, + AsyncCertificatePackResourceWithRawResponse, + CertificatePackResourceWithStreamingResponse, + AsyncCertificatePackResourceWithStreamingResponse, +) from .custom_hostnames import ( CustomHostnamesResource, AsyncCustomHostnamesResource, @@ -24,6 +32,12 @@ "AsyncFallbackOriginResourceWithRawResponse", "FallbackOriginResourceWithStreamingResponse", "AsyncFallbackOriginResourceWithStreamingResponse", + "CertificatePackResource", + "AsyncCertificatePackResource", + "CertificatePackResourceWithRawResponse", + "AsyncCertificatePackResourceWithRawResponse", + "CertificatePackResourceWithStreamingResponse", + "AsyncCertificatePackResourceWithStreamingResponse", "CustomHostnamesResource", "AsyncCustomHostnamesResource", "CustomHostnamesResourceWithRawResponse", diff --git a/src/cloudflare/resources/custom_hostnames/certificate_pack/__init__.py b/src/cloudflare/resources/custom_hostnames/certificate_pack/__init__.py new file mode 100644 index 00000000000..8588bf81547 --- /dev/null +++ b/src/cloudflare/resources/custom_hostnames/certificate_pack/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .certificates import ( + CertificatesResource, + AsyncCertificatesResource, + CertificatesResourceWithRawResponse, + AsyncCertificatesResourceWithRawResponse, + CertificatesResourceWithStreamingResponse, + AsyncCertificatesResourceWithStreamingResponse, +) +from .certificate_pack import ( + CertificatePackResource, + AsyncCertificatePackResource, + CertificatePackResourceWithRawResponse, + AsyncCertificatePackResourceWithRawResponse, + CertificatePackResourceWithStreamingResponse, + AsyncCertificatePackResourceWithStreamingResponse, +) + +__all__ = [ + "CertificatesResource", + "AsyncCertificatesResource", + "CertificatesResourceWithRawResponse", + "AsyncCertificatesResourceWithRawResponse", + "CertificatesResourceWithStreamingResponse", + "AsyncCertificatesResourceWithStreamingResponse", + "CertificatePackResource", + "AsyncCertificatePackResource", + "CertificatePackResourceWithRawResponse", + "AsyncCertificatePackResourceWithRawResponse", + "CertificatePackResourceWithStreamingResponse", + "AsyncCertificatePackResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/custom_hostnames/certificate_pack/certificate_pack.py b/src/cloudflare/resources/custom_hostnames/certificate_pack/certificate_pack.py new file mode 100644 index 00000000000..cda40e9baed --- /dev/null +++ b/src/cloudflare/resources/custom_hostnames/certificate_pack/certificate_pack.py @@ -0,0 +1,102 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from .certificates import ( + CertificatesResource, + AsyncCertificatesResource, + CertificatesResourceWithRawResponse, + AsyncCertificatesResourceWithRawResponse, + CertificatesResourceWithStreamingResponse, + AsyncCertificatesResourceWithStreamingResponse, +) + +__all__ = ["CertificatePackResource", "AsyncCertificatePackResource"] + + +class CertificatePackResource(SyncAPIResource): + @cached_property + def certificates(self) -> CertificatesResource: + return CertificatesResource(self._client) + + @cached_property + def with_raw_response(self) -> CertificatePackResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return CertificatePackResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> CertificatePackResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return CertificatePackResourceWithStreamingResponse(self) + + +class AsyncCertificatePackResource(AsyncAPIResource): + @cached_property + def certificates(self) -> AsyncCertificatesResource: + return AsyncCertificatesResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncCertificatePackResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncCertificatePackResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncCertificatePackResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncCertificatePackResourceWithStreamingResponse(self) + + +class CertificatePackResourceWithRawResponse: + def __init__(self, certificate_pack: CertificatePackResource) -> None: + self._certificate_pack = certificate_pack + + @cached_property + def certificates(self) -> CertificatesResourceWithRawResponse: + return CertificatesResourceWithRawResponse(self._certificate_pack.certificates) + + +class AsyncCertificatePackResourceWithRawResponse: + def __init__(self, certificate_pack: AsyncCertificatePackResource) -> None: + self._certificate_pack = certificate_pack + + @cached_property + def certificates(self) -> AsyncCertificatesResourceWithRawResponse: + return AsyncCertificatesResourceWithRawResponse(self._certificate_pack.certificates) + + +class CertificatePackResourceWithStreamingResponse: + def __init__(self, certificate_pack: CertificatePackResource) -> None: + self._certificate_pack = certificate_pack + + @cached_property + def certificates(self) -> CertificatesResourceWithStreamingResponse: + return CertificatesResourceWithStreamingResponse(self._certificate_pack.certificates) + + +class AsyncCertificatePackResourceWithStreamingResponse: + def __init__(self, certificate_pack: AsyncCertificatePackResource) -> None: + self._certificate_pack = certificate_pack + + @cached_property + def certificates(self) -> AsyncCertificatesResourceWithStreamingResponse: + return AsyncCertificatesResourceWithStreamingResponse(self._certificate_pack.certificates) diff --git a/src/cloudflare/resources/custom_hostnames/certificate_pack/certificates.py b/src/cloudflare/resources/custom_hostnames/certificate_pack/certificates.py new file mode 100644 index 00000000000..d30eb814ae7 --- /dev/null +++ b/src/cloudflare/resources/custom_hostnames/certificate_pack/certificates.py @@ -0,0 +1,372 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, Optional, cast + +import httpx + +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( + maybe_transform, + async_maybe_transform, +) +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...._wrappers import ResultWrapper +from ...._base_client import make_request_options +from ....types.custom_hostnames.certificate_pack import certificate_update_params +from ....types.custom_hostnames.certificate_pack.certificate_delete_response import CertificateDeleteResponse +from ....types.custom_hostnames.certificate_pack.certificate_update_response import CertificateUpdateResponse + +__all__ = ["CertificatesResource", "AsyncCertificatesResource"] + + +class CertificatesResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> CertificatesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return CertificatesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> CertificatesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return CertificatesResourceWithStreamingResponse(self) + + def update( + self, + certificate_id: str, + *, + zone_id: str, + custom_hostname_id: str, + certificate_pack_id: str, + custom_certificate: str, + custom_key: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[CertificateUpdateResponse]: + """ + Replace a single custom certificate within a certificate pack that contains two + bundled certificates. The replacement must adhere to the following constraints. + You can only replace an RSA certificate with another RSA certificate or an ECDSA + certificate with another ECDSA certificate. + + Args: + zone_id: Identifier + + custom_hostname_id: Identifier + + certificate_pack_id: Identifier + + certificate_id: Identifier + + custom_certificate: If a custom uploaded certificate is used. + + custom_key: The key for a custom uploaded certificate. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not custom_hostname_id: + raise ValueError(f"Expected a non-empty value for `custom_hostname_id` but received {custom_hostname_id!r}") + if not certificate_pack_id: + raise ValueError( + f"Expected a non-empty value for `certificate_pack_id` but received {certificate_pack_id!r}" + ) + if not certificate_id: + raise ValueError(f"Expected a non-empty value for `certificate_id` but received {certificate_id!r}") + return self._put( + f"/zones/{zone_id}/custom_hostnames/{custom_hostname_id}/certificate_pack/{certificate_pack_id}/certificates/{certificate_id}", + body=maybe_transform( + { + "custom_certificate": custom_certificate, + "custom_key": custom_key, + }, + certificate_update_params.CertificateUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[CertificateUpdateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[CertificateUpdateResponse]], ResultWrapper[CertificateUpdateResponse]), + ) + + def delete( + self, + certificate_id: str, + *, + zone_id: str, + custom_hostname_id: str, + certificate_pack_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CertificateDeleteResponse: + """ + Delete a single custom certificate from a certificate pack that contains two + bundled certificates. Deletion is subject to the following constraints. You + cannot delete a certificate if it is the only remaining certificate in the pack. + At least one certificate must remain in the pack. + + Args: + zone_id: Identifier + + custom_hostname_id: Identifier + + certificate_pack_id: Identifier + + certificate_id: Identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not custom_hostname_id: + raise ValueError(f"Expected a non-empty value for `custom_hostname_id` but received {custom_hostname_id!r}") + if not certificate_pack_id: + raise ValueError( + f"Expected a non-empty value for `certificate_pack_id` but received {certificate_pack_id!r}" + ) + if not certificate_id: + raise ValueError(f"Expected a non-empty value for `certificate_id` but received {certificate_id!r}") + return self._delete( + f"/zones/{zone_id}/custom_hostnames/{custom_hostname_id}/certificate_pack/{certificate_pack_id}/certificates/{certificate_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CertificateDeleteResponse, + ) + + +class AsyncCertificatesResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncCertificatesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncCertificatesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncCertificatesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncCertificatesResourceWithStreamingResponse(self) + + async def update( + self, + certificate_id: str, + *, + zone_id: str, + custom_hostname_id: str, + certificate_pack_id: str, + custom_certificate: str, + custom_key: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[CertificateUpdateResponse]: + """ + Replace a single custom certificate within a certificate pack that contains two + bundled certificates. The replacement must adhere to the following constraints. + You can only replace an RSA certificate with another RSA certificate or an ECDSA + certificate with another ECDSA certificate. + + Args: + zone_id: Identifier + + custom_hostname_id: Identifier + + certificate_pack_id: Identifier + + certificate_id: Identifier + + custom_certificate: If a custom uploaded certificate is used. + + custom_key: The key for a custom uploaded certificate. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not custom_hostname_id: + raise ValueError(f"Expected a non-empty value for `custom_hostname_id` but received {custom_hostname_id!r}") + if not certificate_pack_id: + raise ValueError( + f"Expected a non-empty value for `certificate_pack_id` but received {certificate_pack_id!r}" + ) + if not certificate_id: + raise ValueError(f"Expected a non-empty value for `certificate_id` but received {certificate_id!r}") + return await self._put( + f"/zones/{zone_id}/custom_hostnames/{custom_hostname_id}/certificate_pack/{certificate_pack_id}/certificates/{certificate_id}", + body=await async_maybe_transform( + { + "custom_certificate": custom_certificate, + "custom_key": custom_key, + }, + certificate_update_params.CertificateUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[CertificateUpdateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[CertificateUpdateResponse]], ResultWrapper[CertificateUpdateResponse]), + ) + + async def delete( + self, + certificate_id: str, + *, + zone_id: str, + custom_hostname_id: str, + certificate_pack_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CertificateDeleteResponse: + """ + Delete a single custom certificate from a certificate pack that contains two + bundled certificates. Deletion is subject to the following constraints. You + cannot delete a certificate if it is the only remaining certificate in the pack. + At least one certificate must remain in the pack. + + Args: + zone_id: Identifier + + custom_hostname_id: Identifier + + certificate_pack_id: Identifier + + certificate_id: Identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not custom_hostname_id: + raise ValueError(f"Expected a non-empty value for `custom_hostname_id` but received {custom_hostname_id!r}") + if not certificate_pack_id: + raise ValueError( + f"Expected a non-empty value for `certificate_pack_id` but received {certificate_pack_id!r}" + ) + if not certificate_id: + raise ValueError(f"Expected a non-empty value for `certificate_id` but received {certificate_id!r}") + return await self._delete( + f"/zones/{zone_id}/custom_hostnames/{custom_hostname_id}/certificate_pack/{certificate_pack_id}/certificates/{certificate_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CertificateDeleteResponse, + ) + + +class CertificatesResourceWithRawResponse: + def __init__(self, certificates: CertificatesResource) -> None: + self._certificates = certificates + + self.update = to_raw_response_wrapper( + certificates.update, + ) + self.delete = to_raw_response_wrapper( + certificates.delete, + ) + + +class AsyncCertificatesResourceWithRawResponse: + def __init__(self, certificates: AsyncCertificatesResource) -> None: + self._certificates = certificates + + self.update = async_to_raw_response_wrapper( + certificates.update, + ) + self.delete = async_to_raw_response_wrapper( + certificates.delete, + ) + + +class CertificatesResourceWithStreamingResponse: + def __init__(self, certificates: CertificatesResource) -> None: + self._certificates = certificates + + self.update = to_streamed_response_wrapper( + certificates.update, + ) + self.delete = to_streamed_response_wrapper( + certificates.delete, + ) + + +class AsyncCertificatesResourceWithStreamingResponse: + def __init__(self, certificates: AsyncCertificatesResource) -> None: + self._certificates = certificates + + self.update = async_to_streamed_response_wrapper( + certificates.update, + ) + self.delete = async_to_streamed_response_wrapper( + certificates.delete, + ) diff --git a/src/cloudflare/resources/custom_hostnames/custom_hostnames.py b/src/cloudflare/resources/custom_hostnames/custom_hostnames.py index 797adc7312b..3b9983442ec 100644 --- a/src/cloudflare/resources/custom_hostnames/custom_hostnames.py +++ b/src/cloudflare/resources/custom_hostnames/custom_hostnames.py @@ -36,6 +36,14 @@ custom_hostname_list_params, custom_hostname_create_params, ) +from .certificate_pack.certificate_pack import ( + CertificatePackResource, + AsyncCertificatePackResource, + CertificatePackResourceWithRawResponse, + AsyncCertificatePackResourceWithRawResponse, + CertificatePackResourceWithStreamingResponse, + AsyncCertificatePackResourceWithStreamingResponse, +) from ...types.custom_hostnames.custom_hostname_get_response import CustomHostnameGetResponse from ...types.custom_hostnames.custom_hostname_edit_response import CustomHostnameEditResponse from ...types.custom_hostnames.custom_hostname_list_response import CustomHostnameListResponse @@ -50,6 +58,10 @@ class CustomHostnamesResource(SyncAPIResource): def fallback_origin(self) -> FallbackOriginResource: return FallbackOriginResource(self._client) + @cached_property + def certificate_pack(self) -> CertificatePackResource: + return CertificatePackResource(self._client) + @cached_property def with_raw_response(self) -> CustomHostnamesResourceWithRawResponse: """ @@ -378,6 +390,10 @@ class AsyncCustomHostnamesResource(AsyncAPIResource): def fallback_origin(self) -> AsyncFallbackOriginResource: return AsyncFallbackOriginResource(self._client) + @cached_property + def certificate_pack(self) -> AsyncCertificatePackResource: + return AsyncCertificatePackResource(self._client) + @cached_property def with_raw_response(self) -> AsyncCustomHostnamesResourceWithRawResponse: """ @@ -725,6 +741,10 @@ def __init__(self, custom_hostnames: CustomHostnamesResource) -> None: def fallback_origin(self) -> FallbackOriginResourceWithRawResponse: return FallbackOriginResourceWithRawResponse(self._custom_hostnames.fallback_origin) + @cached_property + def certificate_pack(self) -> CertificatePackResourceWithRawResponse: + return CertificatePackResourceWithRawResponse(self._custom_hostnames.certificate_pack) + class AsyncCustomHostnamesResourceWithRawResponse: def __init__(self, custom_hostnames: AsyncCustomHostnamesResource) -> None: @@ -750,6 +770,10 @@ def __init__(self, custom_hostnames: AsyncCustomHostnamesResource) -> None: def fallback_origin(self) -> AsyncFallbackOriginResourceWithRawResponse: return AsyncFallbackOriginResourceWithRawResponse(self._custom_hostnames.fallback_origin) + @cached_property + def certificate_pack(self) -> AsyncCertificatePackResourceWithRawResponse: + return AsyncCertificatePackResourceWithRawResponse(self._custom_hostnames.certificate_pack) + class CustomHostnamesResourceWithStreamingResponse: def __init__(self, custom_hostnames: CustomHostnamesResource) -> None: @@ -775,6 +799,10 @@ def __init__(self, custom_hostnames: CustomHostnamesResource) -> None: def fallback_origin(self) -> FallbackOriginResourceWithStreamingResponse: return FallbackOriginResourceWithStreamingResponse(self._custom_hostnames.fallback_origin) + @cached_property + def certificate_pack(self) -> CertificatePackResourceWithStreamingResponse: + return CertificatePackResourceWithStreamingResponse(self._custom_hostnames.certificate_pack) + class AsyncCustomHostnamesResourceWithStreamingResponse: def __init__(self, custom_hostnames: AsyncCustomHostnamesResource) -> None: @@ -799,3 +827,7 @@ def __init__(self, custom_hostnames: AsyncCustomHostnamesResource) -> None: @cached_property def fallback_origin(self) -> AsyncFallbackOriginResourceWithStreamingResponse: return AsyncFallbackOriginResourceWithStreamingResponse(self._custom_hostnames.fallback_origin) + + @cached_property + def certificate_pack(self) -> AsyncCertificatePackResourceWithStreamingResponse: + return AsyncCertificatePackResourceWithStreamingResponse(self._custom_hostnames.certificate_pack) diff --git a/src/cloudflare/resources/r2/buckets/__init__.py b/src/cloudflare/resources/r2/buckets/__init__.py index 9de75b3eb9e..b5a72bc24b9 100644 --- a/src/cloudflare/resources/r2/buckets/__init__.py +++ b/src/cloudflare/resources/r2/buckets/__init__.py @@ -8,6 +8,14 @@ CORSResourceWithStreamingResponse, AsyncCORSResourceWithStreamingResponse, ) +from .locks import ( + LocksResource, + AsyncLocksResource, + LocksResourceWithRawResponse, + AsyncLocksResourceWithRawResponse, + LocksResourceWithStreamingResponse, + AsyncLocksResourceWithStreamingResponse, +) from .sippy import ( SippyResource, AsyncSippyResource, @@ -32,6 +40,14 @@ DomainsResourceWithStreamingResponse, AsyncDomainsResourceWithStreamingResponse, ) +from .metrics import ( + MetricsResource, + AsyncMetricsResource, + MetricsResourceWithRawResponse, + AsyncMetricsResourceWithRawResponse, + MetricsResourceWithStreamingResponse, + AsyncMetricsResourceWithStreamingResponse, +) from .lifecycle import ( LifecycleResource, AsyncLifecycleResource, @@ -74,6 +90,18 @@ "AsyncEventNotificationsResourceWithRawResponse", "EventNotificationsResourceWithStreamingResponse", "AsyncEventNotificationsResourceWithStreamingResponse", + "LocksResource", + "AsyncLocksResource", + "LocksResourceWithRawResponse", + "AsyncLocksResourceWithRawResponse", + "LocksResourceWithStreamingResponse", + "AsyncLocksResourceWithStreamingResponse", + "MetricsResource", + "AsyncMetricsResource", + "MetricsResourceWithRawResponse", + "AsyncMetricsResourceWithRawResponse", + "MetricsResourceWithStreamingResponse", + "AsyncMetricsResourceWithStreamingResponse", "SippyResource", "AsyncSippyResource", "SippyResourceWithRawResponse", diff --git a/src/cloudflare/resources/r2/buckets/buckets.py b/src/cloudflare/resources/r2/buckets/buckets.py index 7772e915c71..f70e2b42881 100644 --- a/src/cloudflare/resources/r2/buckets/buckets.py +++ b/src/cloudflare/resources/r2/buckets/buckets.py @@ -15,6 +15,14 @@ CORSResourceWithStreamingResponse, AsyncCORSResourceWithStreamingResponse, ) +from .locks import ( + LocksResource, + AsyncLocksResource, + LocksResourceWithRawResponse, + AsyncLocksResourceWithRawResponse, + LocksResourceWithStreamingResponse, + AsyncLocksResourceWithStreamingResponse, +) from .sippy import ( SippyResource, AsyncSippyResource, @@ -23,6 +31,14 @@ SippyResourceWithStreamingResponse, AsyncSippyResourceWithStreamingResponse, ) +from .metrics import ( + MetricsResource, + AsyncMetricsResource, + MetricsResourceWithRawResponse, + AsyncMetricsResourceWithRawResponse, + MetricsResourceWithStreamingResponse, + AsyncMetricsResourceWithStreamingResponse, +) from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( is_given, @@ -88,6 +104,14 @@ def domains(self) -> DomainsResource: def event_notifications(self) -> EventNotificationsResource: return EventNotificationsResource(self._client) + @cached_property + def locks(self) -> LocksResource: + return LocksResource(self._client) + + @cached_property + def metrics(self) -> MetricsResource: + return MetricsResource(self._client) + @cached_property def sippy(self) -> SippyResource: return SippyResource(self._client) @@ -371,6 +395,14 @@ def domains(self) -> AsyncDomainsResource: def event_notifications(self) -> AsyncEventNotificationsResource: return AsyncEventNotificationsResource(self._client) + @cached_property + def locks(self) -> AsyncLocksResource: + return AsyncLocksResource(self._client) + + @cached_property + def metrics(self) -> AsyncMetricsResource: + return AsyncMetricsResource(self._client) + @cached_property def sippy(self) -> AsyncSippyResource: return AsyncSippyResource(self._client) @@ -670,6 +702,14 @@ def domains(self) -> DomainsResourceWithRawResponse: def event_notifications(self) -> EventNotificationsResourceWithRawResponse: return EventNotificationsResourceWithRawResponse(self._buckets.event_notifications) + @cached_property + def locks(self) -> LocksResourceWithRawResponse: + return LocksResourceWithRawResponse(self._buckets.locks) + + @cached_property + def metrics(self) -> MetricsResourceWithRawResponse: + return MetricsResourceWithRawResponse(self._buckets.metrics) + @cached_property def sippy(self) -> SippyResourceWithRawResponse: return SippyResourceWithRawResponse(self._buckets.sippy) @@ -708,6 +748,14 @@ def domains(self) -> AsyncDomainsResourceWithRawResponse: def event_notifications(self) -> AsyncEventNotificationsResourceWithRawResponse: return AsyncEventNotificationsResourceWithRawResponse(self._buckets.event_notifications) + @cached_property + def locks(self) -> AsyncLocksResourceWithRawResponse: + return AsyncLocksResourceWithRawResponse(self._buckets.locks) + + @cached_property + def metrics(self) -> AsyncMetricsResourceWithRawResponse: + return AsyncMetricsResourceWithRawResponse(self._buckets.metrics) + @cached_property def sippy(self) -> AsyncSippyResourceWithRawResponse: return AsyncSippyResourceWithRawResponse(self._buckets.sippy) @@ -746,6 +794,14 @@ def domains(self) -> DomainsResourceWithStreamingResponse: def event_notifications(self) -> EventNotificationsResourceWithStreamingResponse: return EventNotificationsResourceWithStreamingResponse(self._buckets.event_notifications) + @cached_property + def locks(self) -> LocksResourceWithStreamingResponse: + return LocksResourceWithStreamingResponse(self._buckets.locks) + + @cached_property + def metrics(self) -> MetricsResourceWithStreamingResponse: + return MetricsResourceWithStreamingResponse(self._buckets.metrics) + @cached_property def sippy(self) -> SippyResourceWithStreamingResponse: return SippyResourceWithStreamingResponse(self._buckets.sippy) @@ -784,6 +840,14 @@ def domains(self) -> AsyncDomainsResourceWithStreamingResponse: def event_notifications(self) -> AsyncEventNotificationsResourceWithStreamingResponse: return AsyncEventNotificationsResourceWithStreamingResponse(self._buckets.event_notifications) + @cached_property + def locks(self) -> AsyncLocksResourceWithStreamingResponse: + return AsyncLocksResourceWithStreamingResponse(self._buckets.locks) + + @cached_property + def metrics(self) -> AsyncMetricsResourceWithStreamingResponse: + return AsyncMetricsResourceWithStreamingResponse(self._buckets.metrics) + @cached_property def sippy(self) -> AsyncSippyResourceWithStreamingResponse: return AsyncSippyResourceWithStreamingResponse(self._buckets.sippy) diff --git a/src/cloudflare/resources/r2/buckets/locks.py b/src/cloudflare/resources/r2/buckets/locks.py new file mode 100644 index 00000000000..bb799331eb1 --- /dev/null +++ b/src/cloudflare/resources/r2/buckets/locks.py @@ -0,0 +1,328 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, Iterable, cast +from typing_extensions import Literal + +import httpx + +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( + is_given, + maybe_transform, + strip_not_given, + async_maybe_transform, +) +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...._wrappers import ResultWrapper +from ...._base_client import make_request_options +from ....types.r2.buckets import lock_update_params +from ....types.r2.buckets.lock_get_response import LockGetResponse + +__all__ = ["LocksResource", "AsyncLocksResource"] + + +class LocksResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LocksResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return LocksResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LocksResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return LocksResourceWithStreamingResponse(self) + + def update( + self, + bucket_name: str, + *, + account_id: str, + rules: Iterable[lock_update_params.Rule] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Set lock rules for a bucket + + Args: + account_id: Account ID + + bucket_name: Name of the bucket + + jurisdiction: The bucket jurisdiction + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not bucket_name: + raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") + extra_headers = { + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **(extra_headers or {}), + } + return self._put( + f"/accounts/{account_id}/r2/buckets/{bucket_name}/lock", + body=maybe_transform({"rules": rules}, lock_update_params.LockUpdateParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[object]._unwrapper, + ), + cast_to=cast(Type[object], ResultWrapper[object]), + ) + + def get( + self, + bucket_name: str, + *, + account_id: str, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LockGetResponse: + """ + Get lock rules for a bucket + + Args: + account_id: Account ID + + bucket_name: Name of the bucket + + jurisdiction: The bucket jurisdiction + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not bucket_name: + raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") + extra_headers = { + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **(extra_headers or {}), + } + return self._get( + f"/accounts/{account_id}/r2/buckets/{bucket_name}/lock", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[LockGetResponse]._unwrapper, + ), + cast_to=cast(Type[LockGetResponse], ResultWrapper[LockGetResponse]), + ) + + +class AsyncLocksResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLocksResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncLocksResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLocksResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncLocksResourceWithStreamingResponse(self) + + async def update( + self, + bucket_name: str, + *, + account_id: str, + rules: Iterable[lock_update_params.Rule] | NotGiven = NOT_GIVEN, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Set lock rules for a bucket + + Args: + account_id: Account ID + + bucket_name: Name of the bucket + + jurisdiction: The bucket jurisdiction + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not bucket_name: + raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") + extra_headers = { + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **(extra_headers or {}), + } + return await self._put( + f"/accounts/{account_id}/r2/buckets/{bucket_name}/lock", + body=await async_maybe_transform({"rules": rules}, lock_update_params.LockUpdateParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[object]._unwrapper, + ), + cast_to=cast(Type[object], ResultWrapper[object]), + ) + + async def get( + self, + bucket_name: str, + *, + account_id: str, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LockGetResponse: + """ + Get lock rules for a bucket + + Args: + account_id: Account ID + + bucket_name: Name of the bucket + + jurisdiction: The bucket jurisdiction + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not bucket_name: + raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") + extra_headers = { + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **(extra_headers or {}), + } + return await self._get( + f"/accounts/{account_id}/r2/buckets/{bucket_name}/lock", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[LockGetResponse]._unwrapper, + ), + cast_to=cast(Type[LockGetResponse], ResultWrapper[LockGetResponse]), + ) + + +class LocksResourceWithRawResponse: + def __init__(self, locks: LocksResource) -> None: + self._locks = locks + + self.update = to_raw_response_wrapper( + locks.update, + ) + self.get = to_raw_response_wrapper( + locks.get, + ) + + +class AsyncLocksResourceWithRawResponse: + def __init__(self, locks: AsyncLocksResource) -> None: + self._locks = locks + + self.update = async_to_raw_response_wrapper( + locks.update, + ) + self.get = async_to_raw_response_wrapper( + locks.get, + ) + + +class LocksResourceWithStreamingResponse: + def __init__(self, locks: LocksResource) -> None: + self._locks = locks + + self.update = to_streamed_response_wrapper( + locks.update, + ) + self.get = to_streamed_response_wrapper( + locks.get, + ) + + +class AsyncLocksResourceWithStreamingResponse: + def __init__(self, locks: AsyncLocksResource) -> None: + self._locks = locks + + self.update = async_to_streamed_response_wrapper( + locks.update, + ) + self.get = async_to_streamed_response_wrapper( + locks.get, + ) diff --git a/src/cloudflare/resources/r2/buckets/metrics.py b/src/cloudflare/resources/r2/buckets/metrics.py new file mode 100644 index 00000000000..2464c5a5ea7 --- /dev/null +++ b/src/cloudflare/resources/r2/buckets/metrics.py @@ -0,0 +1,182 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, cast + +import httpx + +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...._wrappers import ResultWrapper +from ...._base_client import make_request_options +from ....types.r2.buckets.metric_list_response import MetricListResponse + +__all__ = ["MetricsResource", "AsyncMetricsResource"] + + +class MetricsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> MetricsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return MetricsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> MetricsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return MetricsResourceWithStreamingResponse(self) + + def list( + self, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> MetricListResponse: + """Get Storage/Object Count Metrics across all buckets in your account. + + Note that + Account-Level Metrics may not immediately reflect the latest data. + + Args: + account_id: Account ID + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get( + f"/accounts/{account_id}/r2/metrics", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[MetricListResponse]._unwrapper, + ), + cast_to=cast(Type[MetricListResponse], ResultWrapper[MetricListResponse]), + ) + + +class AsyncMetricsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncMetricsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncMetricsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncMetricsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncMetricsResourceWithStreamingResponse(self) + + async def list( + self, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> MetricListResponse: + """Get Storage/Object Count Metrics across all buckets in your account. + + Note that + Account-Level Metrics may not immediately reflect the latest data. + + Args: + account_id: Account ID + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return await self._get( + f"/accounts/{account_id}/r2/metrics", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[MetricListResponse]._unwrapper, + ), + cast_to=cast(Type[MetricListResponse], ResultWrapper[MetricListResponse]), + ) + + +class MetricsResourceWithRawResponse: + def __init__(self, metrics: MetricsResource) -> None: + self._metrics = metrics + + self.list = to_raw_response_wrapper( + metrics.list, + ) + + +class AsyncMetricsResourceWithRawResponse: + def __init__(self, metrics: AsyncMetricsResource) -> None: + self._metrics = metrics + + self.list = async_to_raw_response_wrapper( + metrics.list, + ) + + +class MetricsResourceWithStreamingResponse: + def __init__(self, metrics: MetricsResource) -> None: + self._metrics = metrics + + self.list = to_streamed_response_wrapper( + metrics.list, + ) + + +class AsyncMetricsResourceWithStreamingResponse: + def __init__(self, metrics: AsyncMetricsResource) -> None: + self._metrics = metrics + + self.list = async_to_streamed_response_wrapper( + metrics.list, + ) diff --git a/src/cloudflare/resources/radar/__init__.py b/src/cloudflare/resources/radar/__init__.py index 740d075f2df..2d701e31e91 100644 --- a/src/cloudflare/resources/radar/__init__.py +++ b/src/cloudflare/resources/radar/__init__.py @@ -112,6 +112,14 @@ NetflowsResourceWithStreamingResponse, AsyncNetflowsResourceWithStreamingResponse, ) +from .robots_txt import ( + RobotsTXTResource, + AsyncRobotsTXTResource, + RobotsTXTResourceWithRawResponse, + AsyncRobotsTXTResourceWithRawResponse, + RobotsTXTResourceWithStreamingResponse, + AsyncRobotsTXTResourceWithStreamingResponse, +) from .annotations import ( AnnotationsResource, AsyncAnnotationsResource, @@ -248,6 +256,12 @@ "AsyncTCPResetsTimeoutsResourceWithRawResponse", "TCPResetsTimeoutsResourceWithStreamingResponse", "AsyncTCPResetsTimeoutsResourceWithStreamingResponse", + "RobotsTXTResource", + "AsyncRobotsTXTResource", + "RobotsTXTResourceWithRawResponse", + "AsyncRobotsTXTResourceWithRawResponse", + "RobotsTXTResourceWithStreamingResponse", + "AsyncRobotsTXTResourceWithStreamingResponse", "RadarResource", "AsyncRadarResource", "RadarResourceWithRawResponse", diff --git a/src/cloudflare/resources/radar/ai/__init__.py b/src/cloudflare/resources/radar/ai/__init__.py index 4a65d175d4b..0a3ef3d68d8 100644 --- a/src/cloudflare/resources/radar/ai/__init__.py +++ b/src/cloudflare/resources/radar/ai/__init__.py @@ -16,6 +16,14 @@ BotsResourceWithStreamingResponse, AsyncBotsResourceWithStreamingResponse, ) +from .inference import ( + InferenceResource, + AsyncInferenceResource, + InferenceResourceWithRawResponse, + AsyncInferenceResourceWithRawResponse, + InferenceResourceWithStreamingResponse, + AsyncInferenceResourceWithStreamingResponse, +) from .timeseries_groups import ( TimeseriesGroupsResource, AsyncTimeseriesGroupsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "InferenceResource", + "AsyncInferenceResource", + "InferenceResourceWithRawResponse", + "AsyncInferenceResourceWithRawResponse", + "InferenceResourceWithStreamingResponse", + "AsyncInferenceResourceWithStreamingResponse", "BotsResource", "AsyncBotsResource", "BotsResourceWithRawResponse", diff --git a/src/cloudflare/resources/radar/ai/ai.py b/src/cloudflare/resources/radar/ai/ai.py index 6ce1832a38b..4038bdd803e 100644 --- a/src/cloudflare/resources/radar/ai/ai.py +++ b/src/cloudflare/resources/radar/ai/ai.py @@ -20,11 +20,23 @@ TimeseriesGroupsResourceWithStreamingResponse, AsyncTimeseriesGroupsResourceWithStreamingResponse, ) +from .inference.inference import ( + InferenceResource, + AsyncInferenceResource, + InferenceResourceWithRawResponse, + AsyncInferenceResourceWithRawResponse, + InferenceResourceWithStreamingResponse, + AsyncInferenceResourceWithStreamingResponse, +) __all__ = ["AIResource", "AsyncAIResource"] class AIResource(SyncAPIResource): + @cached_property + def inference(self) -> InferenceResource: + return InferenceResource(self._client) + @cached_property def bots(self) -> BotsResource: return BotsResource(self._client) @@ -54,6 +66,10 @@ def with_streaming_response(self) -> AIResourceWithStreamingResponse: class AsyncAIResource(AsyncAPIResource): + @cached_property + def inference(self) -> AsyncInferenceResource: + return AsyncInferenceResource(self._client) + @cached_property def bots(self) -> AsyncBotsResource: return AsyncBotsResource(self._client) @@ -86,6 +102,10 @@ class AIResourceWithRawResponse: def __init__(self, ai: AIResource) -> None: self._ai = ai + @cached_property + def inference(self) -> InferenceResourceWithRawResponse: + return InferenceResourceWithRawResponse(self._ai.inference) + @cached_property def bots(self) -> BotsResourceWithRawResponse: return BotsResourceWithRawResponse(self._ai.bots) @@ -99,6 +119,10 @@ class AsyncAIResourceWithRawResponse: def __init__(self, ai: AsyncAIResource) -> None: self._ai = ai + @cached_property + def inference(self) -> AsyncInferenceResourceWithRawResponse: + return AsyncInferenceResourceWithRawResponse(self._ai.inference) + @cached_property def bots(self) -> AsyncBotsResourceWithRawResponse: return AsyncBotsResourceWithRawResponse(self._ai.bots) @@ -112,6 +136,10 @@ class AIResourceWithStreamingResponse: def __init__(self, ai: AIResource) -> None: self._ai = ai + @cached_property + def inference(self) -> InferenceResourceWithStreamingResponse: + return InferenceResourceWithStreamingResponse(self._ai.inference) + @cached_property def bots(self) -> BotsResourceWithStreamingResponse: return BotsResourceWithStreamingResponse(self._ai.bots) @@ -125,6 +153,10 @@ class AsyncAIResourceWithStreamingResponse: def __init__(self, ai: AsyncAIResource) -> None: self._ai = ai + @cached_property + def inference(self) -> AsyncInferenceResourceWithStreamingResponse: + return AsyncInferenceResourceWithStreamingResponse(self._ai.inference) + @cached_property def bots(self) -> AsyncBotsResourceWithStreamingResponse: return AsyncBotsResourceWithStreamingResponse(self._ai.bots) diff --git a/src/cloudflare/resources/radar/ai/inference/__init__.py b/src/cloudflare/resources/radar/ai/inference/__init__.py new file mode 100644 index 00000000000..e8ccfb2aff9 --- /dev/null +++ b/src/cloudflare/resources/radar/ai/inference/__init__.py @@ -0,0 +1,47 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .summary import ( + SummaryResource, + AsyncSummaryResource, + SummaryResourceWithRawResponse, + AsyncSummaryResourceWithRawResponse, + SummaryResourceWithStreamingResponse, + AsyncSummaryResourceWithStreamingResponse, +) +from .inference import ( + InferenceResource, + AsyncInferenceResource, + InferenceResourceWithRawResponse, + AsyncInferenceResourceWithRawResponse, + InferenceResourceWithStreamingResponse, + AsyncInferenceResourceWithStreamingResponse, +) +from .timeseries_groups import ( + TimeseriesGroupsResource, + AsyncTimeseriesGroupsResource, + TimeseriesGroupsResourceWithRawResponse, + AsyncTimeseriesGroupsResourceWithRawResponse, + TimeseriesGroupsResourceWithStreamingResponse, + AsyncTimeseriesGroupsResourceWithStreamingResponse, +) + +__all__ = [ + "SummaryResource", + "AsyncSummaryResource", + "SummaryResourceWithRawResponse", + "AsyncSummaryResourceWithRawResponse", + "SummaryResourceWithStreamingResponse", + "AsyncSummaryResourceWithStreamingResponse", + "TimeseriesGroupsResource", + "AsyncTimeseriesGroupsResource", + "TimeseriesGroupsResourceWithRawResponse", + "AsyncTimeseriesGroupsResourceWithRawResponse", + "TimeseriesGroupsResourceWithStreamingResponse", + "AsyncTimeseriesGroupsResourceWithStreamingResponse", + "InferenceResource", + "AsyncInferenceResource", + "InferenceResourceWithRawResponse", + "AsyncInferenceResourceWithRawResponse", + "InferenceResourceWithStreamingResponse", + "AsyncInferenceResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/radar/ai/inference/inference.py b/src/cloudflare/resources/radar/ai/inference/inference.py new file mode 100644 index 00000000000..d72b4cc21cd --- /dev/null +++ b/src/cloudflare/resources/radar/ai/inference/inference.py @@ -0,0 +1,134 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .summary import ( + SummaryResource, + AsyncSummaryResource, + SummaryResourceWithRawResponse, + AsyncSummaryResourceWithRawResponse, + SummaryResourceWithStreamingResponse, + AsyncSummaryResourceWithStreamingResponse, +) +from ....._compat import cached_property +from ....._resource import SyncAPIResource, AsyncAPIResource +from .timeseries_groups.timeseries_groups import ( + TimeseriesGroupsResource, + AsyncTimeseriesGroupsResource, + TimeseriesGroupsResourceWithRawResponse, + AsyncTimeseriesGroupsResourceWithRawResponse, + TimeseriesGroupsResourceWithStreamingResponse, + AsyncTimeseriesGroupsResourceWithStreamingResponse, +) + +__all__ = ["InferenceResource", "AsyncInferenceResource"] + + +class InferenceResource(SyncAPIResource): + @cached_property + def summary(self) -> SummaryResource: + return SummaryResource(self._client) + + @cached_property + def timeseries_groups(self) -> TimeseriesGroupsResource: + return TimeseriesGroupsResource(self._client) + + @cached_property + def with_raw_response(self) -> InferenceResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return InferenceResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> InferenceResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return InferenceResourceWithStreamingResponse(self) + + +class AsyncInferenceResource(AsyncAPIResource): + @cached_property + def summary(self) -> AsyncSummaryResource: + return AsyncSummaryResource(self._client) + + @cached_property + def timeseries_groups(self) -> AsyncTimeseriesGroupsResource: + return AsyncTimeseriesGroupsResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncInferenceResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncInferenceResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncInferenceResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncInferenceResourceWithStreamingResponse(self) + + +class InferenceResourceWithRawResponse: + def __init__(self, inference: InferenceResource) -> None: + self._inference = inference + + @cached_property + def summary(self) -> SummaryResourceWithRawResponse: + return SummaryResourceWithRawResponse(self._inference.summary) + + @cached_property + def timeseries_groups(self) -> TimeseriesGroupsResourceWithRawResponse: + return TimeseriesGroupsResourceWithRawResponse(self._inference.timeseries_groups) + + +class AsyncInferenceResourceWithRawResponse: + def __init__(self, inference: AsyncInferenceResource) -> None: + self._inference = inference + + @cached_property + def summary(self) -> AsyncSummaryResourceWithRawResponse: + return AsyncSummaryResourceWithRawResponse(self._inference.summary) + + @cached_property + def timeseries_groups(self) -> AsyncTimeseriesGroupsResourceWithRawResponse: + return AsyncTimeseriesGroupsResourceWithRawResponse(self._inference.timeseries_groups) + + +class InferenceResourceWithStreamingResponse: + def __init__(self, inference: InferenceResource) -> None: + self._inference = inference + + @cached_property + def summary(self) -> SummaryResourceWithStreamingResponse: + return SummaryResourceWithStreamingResponse(self._inference.summary) + + @cached_property + def timeseries_groups(self) -> TimeseriesGroupsResourceWithStreamingResponse: + return TimeseriesGroupsResourceWithStreamingResponse(self._inference.timeseries_groups) + + +class AsyncInferenceResourceWithStreamingResponse: + def __init__(self, inference: AsyncInferenceResource) -> None: + self._inference = inference + + @cached_property + def summary(self) -> AsyncSummaryResourceWithStreamingResponse: + return AsyncSummaryResourceWithStreamingResponse(self._inference.summary) + + @cached_property + def timeseries_groups(self) -> AsyncTimeseriesGroupsResourceWithStreamingResponse: + return AsyncTimeseriesGroupsResourceWithStreamingResponse(self._inference.timeseries_groups) diff --git a/src/cloudflare/resources/radar/ai/inference/summary.py b/src/cloudflare/resources/radar/ai/inference/summary.py new file mode 100644 index 00000000000..9abc5c5f937 --- /dev/null +++ b/src/cloudflare/resources/radar/ai/inference/summary.py @@ -0,0 +1,384 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Type, Union, cast +from datetime import datetime +from typing_extensions import Literal + +import httpx + +from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._utils import ( + maybe_transform, + async_maybe_transform, +) +from ....._compat import cached_property +from ....._resource import SyncAPIResource, AsyncAPIResource +from ....._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ....._wrappers import ResultWrapper +from ....._base_client import make_request_options +from .....types.radar.ai.inference import summary_task_params, summary_model_params +from .....types.radar.ai.inference.summary_task_response import SummaryTaskResponse +from .....types.radar.ai.inference.summary_model_response import SummaryModelResponse + +__all__ = ["SummaryResource", "AsyncSummaryResource"] + + +class SummaryResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> SummaryResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return SummaryResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> SummaryResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return SummaryResourceWithStreamingResponse(self) + + def model( + self, + *, + date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, + date_range: List[str] | NotGiven = NOT_GIVEN, + date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, + name: List[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SummaryModelResponse: + """ + Percentage distribution of unique accounts by model. + + Args: + date_end: End of the date range (inclusive). + + date_range: For example, use `7d` and `7dControl` to compare this week with the previous + week. Use this parameter or set specific start and end dates (`dateStart` and + `dateEnd` parameters). + + date_start: Array of datetimes to filter the start of a series. + + format: Format results are returned in. + + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + + name: Array of names that will be used to name the series in responses. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get( + "/radar/ai/inference/summary/model", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "limit_per_group": limit_per_group, + "name": name, + }, + summary_model_params.SummaryModelParams, + ), + post_parser=ResultWrapper[SummaryModelResponse]._unwrapper, + ), + cast_to=cast(Type[SummaryModelResponse], ResultWrapper[SummaryModelResponse]), + ) + + def task( + self, + *, + date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, + date_range: List[str] | NotGiven = NOT_GIVEN, + date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, + name: List[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SummaryTaskResponse: + """ + Percentage distribution of unique accounts by task. + + Args: + date_end: End of the date range (inclusive). + + date_range: For example, use `7d` and `7dControl` to compare this week with the previous + week. Use this parameter or set specific start and end dates (`dateStart` and + `dateEnd` parameters). + + date_start: Array of datetimes to filter the start of a series. + + format: Format results are returned in. + + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + + name: Array of names that will be used to name the series in responses. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get( + "/radar/ai/inference/summary/task", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "limit_per_group": limit_per_group, + "name": name, + }, + summary_task_params.SummaryTaskParams, + ), + post_parser=ResultWrapper[SummaryTaskResponse]._unwrapper, + ), + cast_to=cast(Type[SummaryTaskResponse], ResultWrapper[SummaryTaskResponse]), + ) + + +class AsyncSummaryResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncSummaryResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncSummaryResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncSummaryResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncSummaryResourceWithStreamingResponse(self) + + async def model( + self, + *, + date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, + date_range: List[str] | NotGiven = NOT_GIVEN, + date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, + name: List[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SummaryModelResponse: + """ + Percentage distribution of unique accounts by model. + + Args: + date_end: End of the date range (inclusive). + + date_range: For example, use `7d` and `7dControl` to compare this week with the previous + week. Use this parameter or set specific start and end dates (`dateStart` and + `dateEnd` parameters). + + date_start: Array of datetimes to filter the start of a series. + + format: Format results are returned in. + + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + + name: Array of names that will be used to name the series in responses. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._get( + "/radar/ai/inference/summary/model", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "limit_per_group": limit_per_group, + "name": name, + }, + summary_model_params.SummaryModelParams, + ), + post_parser=ResultWrapper[SummaryModelResponse]._unwrapper, + ), + cast_to=cast(Type[SummaryModelResponse], ResultWrapper[SummaryModelResponse]), + ) + + async def task( + self, + *, + date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, + date_range: List[str] | NotGiven = NOT_GIVEN, + date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, + name: List[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SummaryTaskResponse: + """ + Percentage distribution of unique accounts by task. + + Args: + date_end: End of the date range (inclusive). + + date_range: For example, use `7d` and `7dControl` to compare this week with the previous + week. Use this parameter or set specific start and end dates (`dateStart` and + `dateEnd` parameters). + + date_start: Array of datetimes to filter the start of a series. + + format: Format results are returned in. + + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + + name: Array of names that will be used to name the series in responses. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._get( + "/radar/ai/inference/summary/task", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "limit_per_group": limit_per_group, + "name": name, + }, + summary_task_params.SummaryTaskParams, + ), + post_parser=ResultWrapper[SummaryTaskResponse]._unwrapper, + ), + cast_to=cast(Type[SummaryTaskResponse], ResultWrapper[SummaryTaskResponse]), + ) + + +class SummaryResourceWithRawResponse: + def __init__(self, summary: SummaryResource) -> None: + self._summary = summary + + self.model = to_raw_response_wrapper( + summary.model, + ) + self.task = to_raw_response_wrapper( + summary.task, + ) + + +class AsyncSummaryResourceWithRawResponse: + def __init__(self, summary: AsyncSummaryResource) -> None: + self._summary = summary + + self.model = async_to_raw_response_wrapper( + summary.model, + ) + self.task = async_to_raw_response_wrapper( + summary.task, + ) + + +class SummaryResourceWithStreamingResponse: + def __init__(self, summary: SummaryResource) -> None: + self._summary = summary + + self.model = to_streamed_response_wrapper( + summary.model, + ) + self.task = to_streamed_response_wrapper( + summary.task, + ) + + +class AsyncSummaryResourceWithStreamingResponse: + def __init__(self, summary: AsyncSummaryResource) -> None: + self._summary = summary + + self.model = async_to_streamed_response_wrapper( + summary.model, + ) + self.task = async_to_streamed_response_wrapper( + summary.task, + ) diff --git a/src/cloudflare/resources/radar/ai/inference/timeseries_groups/__init__.py b/src/cloudflare/resources/radar/ai/inference/timeseries_groups/__init__.py new file mode 100644 index 00000000000..3e42daf06bb --- /dev/null +++ b/src/cloudflare/resources/radar/ai/inference/timeseries_groups/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .summary import ( + SummaryResource, + AsyncSummaryResource, + SummaryResourceWithRawResponse, + AsyncSummaryResourceWithRawResponse, + SummaryResourceWithStreamingResponse, + AsyncSummaryResourceWithStreamingResponse, +) +from .timeseries_groups import ( + TimeseriesGroupsResource, + AsyncTimeseriesGroupsResource, + TimeseriesGroupsResourceWithRawResponse, + AsyncTimeseriesGroupsResourceWithRawResponse, + TimeseriesGroupsResourceWithStreamingResponse, + AsyncTimeseriesGroupsResourceWithStreamingResponse, +) + +__all__ = [ + "SummaryResource", + "AsyncSummaryResource", + "SummaryResourceWithRawResponse", + "AsyncSummaryResourceWithRawResponse", + "SummaryResourceWithStreamingResponse", + "AsyncSummaryResourceWithStreamingResponse", + "TimeseriesGroupsResource", + "AsyncTimeseriesGroupsResource", + "TimeseriesGroupsResourceWithRawResponse", + "AsyncTimeseriesGroupsResourceWithRawResponse", + "TimeseriesGroupsResourceWithStreamingResponse", + "AsyncTimeseriesGroupsResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/radar/ai/inference/timeseries_groups/summary.py b/src/cloudflare/resources/radar/ai/inference/timeseries_groups/summary.py new file mode 100644 index 00000000000..b66faca5e4b --- /dev/null +++ b/src/cloudflare/resources/radar/ai/inference/timeseries_groups/summary.py @@ -0,0 +1,408 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Type, Union, cast +from datetime import datetime +from typing_extensions import Literal + +import httpx + +from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ......_utils import ( + maybe_transform, + async_maybe_transform, +) +from ......_compat import cached_property +from ......_resource import SyncAPIResource, AsyncAPIResource +from ......_response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ......_wrappers import ResultWrapper +from ......_base_client import make_request_options +from ......types.radar.ai.inference.timeseries_groups import summary_task_params, summary_model_params +from ......types.radar.ai.inference.timeseries_groups.summary_task_response import SummaryTaskResponse +from ......types.radar.ai.inference.timeseries_groups.summary_model_response import SummaryModelResponse + +__all__ = ["SummaryResource", "AsyncSummaryResource"] + + +class SummaryResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> SummaryResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return SummaryResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> SummaryResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return SummaryResourceWithStreamingResponse(self) + + def model( + self, + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, + date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, + date_range: List[str] | NotGiven = NOT_GIVEN, + date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, + name: List[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SummaryModelResponse: + """ + Percentage distribution of unique accounts by model over time. + + Args: + agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes + or 1 hour intervals). Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + date_end: End of the date range (inclusive). + + date_range: For example, use `7d` and `7dControl` to compare this week with the previous + week. Use this parameter or set specific start and end dates (`dateStart` and + `dateEnd` parameters). + + date_start: Array of datetimes to filter the start of a series. + + format: Format results are returned in. + + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + + name: Array of names that will be used to name the series in responses. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get( + "/radar/ai/inference/timeseries_groups/model", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "agg_interval": agg_interval, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "limit_per_group": limit_per_group, + "name": name, + }, + summary_model_params.SummaryModelParams, + ), + post_parser=ResultWrapper[SummaryModelResponse]._unwrapper, + ), + cast_to=cast(Type[SummaryModelResponse], ResultWrapper[SummaryModelResponse]), + ) + + def task( + self, + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, + date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, + date_range: List[str] | NotGiven = NOT_GIVEN, + date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, + name: List[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SummaryTaskResponse: + """ + Percentage distribution of unique accounts by task over time. + + Args: + agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes + or 1 hour intervals). Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + date_end: End of the date range (inclusive). + + date_range: For example, use `7d` and `7dControl` to compare this week with the previous + week. Use this parameter or set specific start and end dates (`dateStart` and + `dateEnd` parameters). + + date_start: Array of datetimes to filter the start of a series. + + format: Format results are returned in. + + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + + name: Array of names that will be used to name the series in responses. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get( + "/radar/ai/inference/timeseries_groups/task", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "agg_interval": agg_interval, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "limit_per_group": limit_per_group, + "name": name, + }, + summary_task_params.SummaryTaskParams, + ), + post_parser=ResultWrapper[SummaryTaskResponse]._unwrapper, + ), + cast_to=cast(Type[SummaryTaskResponse], ResultWrapper[SummaryTaskResponse]), + ) + + +class AsyncSummaryResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncSummaryResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncSummaryResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncSummaryResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncSummaryResourceWithStreamingResponse(self) + + async def model( + self, + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, + date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, + date_range: List[str] | NotGiven = NOT_GIVEN, + date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, + name: List[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SummaryModelResponse: + """ + Percentage distribution of unique accounts by model over time. + + Args: + agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes + or 1 hour intervals). Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + date_end: End of the date range (inclusive). + + date_range: For example, use `7d` and `7dControl` to compare this week with the previous + week. Use this parameter or set specific start and end dates (`dateStart` and + `dateEnd` parameters). + + date_start: Array of datetimes to filter the start of a series. + + format: Format results are returned in. + + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + + name: Array of names that will be used to name the series in responses. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._get( + "/radar/ai/inference/timeseries_groups/model", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "agg_interval": agg_interval, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "limit_per_group": limit_per_group, + "name": name, + }, + summary_model_params.SummaryModelParams, + ), + post_parser=ResultWrapper[SummaryModelResponse]._unwrapper, + ), + cast_to=cast(Type[SummaryModelResponse], ResultWrapper[SummaryModelResponse]), + ) + + async def task( + self, + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, + date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, + date_range: List[str] | NotGiven = NOT_GIVEN, + date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + limit_per_group: int | NotGiven = NOT_GIVEN, + name: List[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SummaryTaskResponse: + """ + Percentage distribution of unique accounts by task over time. + + Args: + agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes + or 1 hour intervals). Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + date_end: End of the date range (inclusive). + + date_range: For example, use `7d` and `7dControl` to compare this week with the previous + week. Use this parameter or set specific start and end dates (`dateStart` and + `dateEnd` parameters). + + date_start: Array of datetimes to filter the start of a series. + + format: Format results are returned in. + + limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + + name: Array of names that will be used to name the series in responses. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._get( + "/radar/ai/inference/timeseries_groups/task", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "agg_interval": agg_interval, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "limit_per_group": limit_per_group, + "name": name, + }, + summary_task_params.SummaryTaskParams, + ), + post_parser=ResultWrapper[SummaryTaskResponse]._unwrapper, + ), + cast_to=cast(Type[SummaryTaskResponse], ResultWrapper[SummaryTaskResponse]), + ) + + +class SummaryResourceWithRawResponse: + def __init__(self, summary: SummaryResource) -> None: + self._summary = summary + + self.model = to_raw_response_wrapper( + summary.model, + ) + self.task = to_raw_response_wrapper( + summary.task, + ) + + +class AsyncSummaryResourceWithRawResponse: + def __init__(self, summary: AsyncSummaryResource) -> None: + self._summary = summary + + self.model = async_to_raw_response_wrapper( + summary.model, + ) + self.task = async_to_raw_response_wrapper( + summary.task, + ) + + +class SummaryResourceWithStreamingResponse: + def __init__(self, summary: SummaryResource) -> None: + self._summary = summary + + self.model = to_streamed_response_wrapper( + summary.model, + ) + self.task = to_streamed_response_wrapper( + summary.task, + ) + + +class AsyncSummaryResourceWithStreamingResponse: + def __init__(self, summary: AsyncSummaryResource) -> None: + self._summary = summary + + self.model = async_to_streamed_response_wrapper( + summary.model, + ) + self.task = async_to_streamed_response_wrapper( + summary.task, + ) diff --git a/src/cloudflare/resources/radar/ai/inference/timeseries_groups/timeseries_groups.py b/src/cloudflare/resources/radar/ai/inference/timeseries_groups/timeseries_groups.py new file mode 100644 index 00000000000..98c4e8984af --- /dev/null +++ b/src/cloudflare/resources/radar/ai/inference/timeseries_groups/timeseries_groups.py @@ -0,0 +1,102 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .summary import ( + SummaryResource, + AsyncSummaryResource, + SummaryResourceWithRawResponse, + AsyncSummaryResourceWithRawResponse, + SummaryResourceWithStreamingResponse, + AsyncSummaryResourceWithStreamingResponse, +) +from ......_compat import cached_property +from ......_resource import SyncAPIResource, AsyncAPIResource + +__all__ = ["TimeseriesGroupsResource", "AsyncTimeseriesGroupsResource"] + + +class TimeseriesGroupsResource(SyncAPIResource): + @cached_property + def summary(self) -> SummaryResource: + return SummaryResource(self._client) + + @cached_property + def with_raw_response(self) -> TimeseriesGroupsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return TimeseriesGroupsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> TimeseriesGroupsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return TimeseriesGroupsResourceWithStreamingResponse(self) + + +class AsyncTimeseriesGroupsResource(AsyncAPIResource): + @cached_property + def summary(self) -> AsyncSummaryResource: + return AsyncSummaryResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncTimeseriesGroupsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncTimeseriesGroupsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncTimeseriesGroupsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncTimeseriesGroupsResourceWithStreamingResponse(self) + + +class TimeseriesGroupsResourceWithRawResponse: + def __init__(self, timeseries_groups: TimeseriesGroupsResource) -> None: + self._timeseries_groups = timeseries_groups + + @cached_property + def summary(self) -> SummaryResourceWithRawResponse: + return SummaryResourceWithRawResponse(self._timeseries_groups.summary) + + +class AsyncTimeseriesGroupsResourceWithRawResponse: + def __init__(self, timeseries_groups: AsyncTimeseriesGroupsResource) -> None: + self._timeseries_groups = timeseries_groups + + @cached_property + def summary(self) -> AsyncSummaryResourceWithRawResponse: + return AsyncSummaryResourceWithRawResponse(self._timeseries_groups.summary) + + +class TimeseriesGroupsResourceWithStreamingResponse: + def __init__(self, timeseries_groups: TimeseriesGroupsResource) -> None: + self._timeseries_groups = timeseries_groups + + @cached_property + def summary(self) -> SummaryResourceWithStreamingResponse: + return SummaryResourceWithStreamingResponse(self._timeseries_groups.summary) + + +class AsyncTimeseriesGroupsResourceWithStreamingResponse: + def __init__(self, timeseries_groups: AsyncTimeseriesGroupsResource) -> None: + self._timeseries_groups = timeseries_groups + + @cached_property + def summary(self) -> AsyncSummaryResourceWithStreamingResponse: + return AsyncSummaryResourceWithStreamingResponse(self._timeseries_groups.summary) diff --git a/src/cloudflare/resources/radar/radar.py b/src/cloudflare/resources/radar/radar.py index d004421ca4b..35381777d0f 100644 --- a/src/cloudflare/resources/radar/radar.py +++ b/src/cloudflare/resources/radar/radar.py @@ -116,6 +116,14 @@ TCPResetsTimeoutsResourceWithStreamingResponse, AsyncTCPResetsTimeoutsResourceWithStreamingResponse, ) +from .robots_txt.robots_txt import ( + RobotsTXTResource, + AsyncRobotsTXTResource, + RobotsTXTResourceWithRawResponse, + AsyncRobotsTXTResourceWithRawResponse, + RobotsTXTResourceWithStreamingResponse, + AsyncRobotsTXTResourceWithStreamingResponse, +) from .annotations.annotations import ( AnnotationsResource, AsyncAnnotationsResource, @@ -213,6 +221,10 @@ def traffic_anomalies(self) -> TrafficAnomaliesResource: def tcp_resets_timeouts(self) -> TCPResetsTimeoutsResource: return TCPResetsTimeoutsResource(self._client) + @cached_property + def robots_txt(self) -> RobotsTXTResource: + return RobotsTXTResource(self._client) + @cached_property def with_raw_response(self) -> RadarResourceWithRawResponse: """ @@ -302,6 +314,10 @@ def traffic_anomalies(self) -> AsyncTrafficAnomaliesResource: def tcp_resets_timeouts(self) -> AsyncTCPResetsTimeoutsResource: return AsyncTCPResetsTimeoutsResource(self._client) + @cached_property + def robots_txt(self) -> AsyncRobotsTXTResource: + return AsyncRobotsTXTResource(self._client) + @cached_property def with_raw_response(self) -> AsyncRadarResourceWithRawResponse: """ @@ -394,6 +410,10 @@ def traffic_anomalies(self) -> TrafficAnomaliesResourceWithRawResponse: def tcp_resets_timeouts(self) -> TCPResetsTimeoutsResourceWithRawResponse: return TCPResetsTimeoutsResourceWithRawResponse(self._radar.tcp_resets_timeouts) + @cached_property + def robots_txt(self) -> RobotsTXTResourceWithRawResponse: + return RobotsTXTResourceWithRawResponse(self._radar.robots_txt) + class AsyncRadarResourceWithRawResponse: def __init__(self, radar: AsyncRadarResource) -> None: @@ -467,6 +487,10 @@ def traffic_anomalies(self) -> AsyncTrafficAnomaliesResourceWithRawResponse: def tcp_resets_timeouts(self) -> AsyncTCPResetsTimeoutsResourceWithRawResponse: return AsyncTCPResetsTimeoutsResourceWithRawResponse(self._radar.tcp_resets_timeouts) + @cached_property + def robots_txt(self) -> AsyncRobotsTXTResourceWithRawResponse: + return AsyncRobotsTXTResourceWithRawResponse(self._radar.robots_txt) + class RadarResourceWithStreamingResponse: def __init__(self, radar: RadarResource) -> None: @@ -540,6 +564,10 @@ def traffic_anomalies(self) -> TrafficAnomaliesResourceWithStreamingResponse: def tcp_resets_timeouts(self) -> TCPResetsTimeoutsResourceWithStreamingResponse: return TCPResetsTimeoutsResourceWithStreamingResponse(self._radar.tcp_resets_timeouts) + @cached_property + def robots_txt(self) -> RobotsTXTResourceWithStreamingResponse: + return RobotsTXTResourceWithStreamingResponse(self._radar.robots_txt) + class AsyncRadarResourceWithStreamingResponse: def __init__(self, radar: AsyncRadarResource) -> None: @@ -612,3 +640,7 @@ def traffic_anomalies(self) -> AsyncTrafficAnomaliesResourceWithStreamingRespons @cached_property def tcp_resets_timeouts(self) -> AsyncTCPResetsTimeoutsResourceWithStreamingResponse: return AsyncTCPResetsTimeoutsResourceWithStreamingResponse(self._radar.tcp_resets_timeouts) + + @cached_property + def robots_txt(self) -> AsyncRobotsTXTResourceWithStreamingResponse: + return AsyncRobotsTXTResourceWithStreamingResponse(self._radar.robots_txt) diff --git a/src/cloudflare/resources/radar/ranking/__init__.py b/src/cloudflare/resources/radar/ranking/__init__.py index cbb9e681fe6..9e972186dc5 100644 --- a/src/cloudflare/resources/radar/ranking/__init__.py +++ b/src/cloudflare/resources/radar/ranking/__init__.py @@ -16,6 +16,14 @@ RankingResourceWithStreamingResponse, AsyncRankingResourceWithStreamingResponse, ) +from .internet_services import ( + InternetServicesResource, + AsyncInternetServicesResource, + InternetServicesResourceWithRawResponse, + AsyncInternetServicesResourceWithRawResponse, + InternetServicesResourceWithStreamingResponse, + AsyncInternetServicesResourceWithStreamingResponse, +) __all__ = [ "DomainResource", @@ -24,6 +32,12 @@ "AsyncDomainResourceWithRawResponse", "DomainResourceWithStreamingResponse", "AsyncDomainResourceWithStreamingResponse", + "InternetServicesResource", + "AsyncInternetServicesResource", + "InternetServicesResourceWithRawResponse", + "AsyncInternetServicesResourceWithRawResponse", + "InternetServicesResourceWithStreamingResponse", + "AsyncInternetServicesResourceWithStreamingResponse", "RankingResource", "AsyncRankingResource", "RankingResourceWithRawResponse", diff --git a/src/cloudflare/resources/radar/ranking/internet_services.py b/src/cloudflare/resources/radar/ranking/internet_services.py new file mode 100644 index 00000000000..abfa97aa3f2 --- /dev/null +++ b/src/cloudflare/resources/radar/ranking/internet_services.py @@ -0,0 +1,382 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Type, Union, cast +from datetime import date, datetime +from typing_extensions import Literal + +import httpx + +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( + maybe_transform, + async_maybe_transform, +) +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...._wrappers import ResultWrapper +from ...._base_client import make_request_options +from ....types.radar.ranking import internet_service_top_params, internet_service_timeseries_groups_params +from ....types.radar.ranking.internet_service_top_response import InternetServiceTopResponse +from ....types.radar.ranking.internet_service_timeseries_groups_response import InternetServiceTimeseriesGroupsResponse + +__all__ = ["InternetServicesResource", "AsyncInternetServicesResource"] + + +class InternetServicesResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> InternetServicesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return InternetServicesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> InternetServicesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return InternetServicesResourceWithStreamingResponse(self) + + def timeseries_groups( + self, + *, + date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, + date_range: List[str] | NotGiven = NOT_GIVEN, + date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + limit: int | NotGiven = NOT_GIVEN, + name: List[str] | NotGiven = NOT_GIVEN, + service_category: List[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> InternetServiceTimeseriesGroupsResponse: + """Gets Internet Services rank update changes over time. + + Raw values are returned. + + Args: + date_end: End of the date range (inclusive). + + date_range: For example, use `7d` and `7dControl` to compare this week with the previous + week. Use this parameter or set specific start and end dates (`dateStart` and + `dateEnd` parameters). + + date_start: Array of datetimes to filter the start of a series. + + format: Format results are returned in. + + limit: Limit the number of objects in the response. + + name: Array of names that will be used to name the series in responses. + + service_category: Filter for services category. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get( + "/radar/ranking/internet_services/timeseries_groups", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "limit": limit, + "name": name, + "service_category": service_category, + }, + internet_service_timeseries_groups_params.InternetServiceTimeseriesGroupsParams, + ), + post_parser=ResultWrapper[InternetServiceTimeseriesGroupsResponse]._unwrapper, + ), + cast_to=cast( + Type[InternetServiceTimeseriesGroupsResponse], ResultWrapper[InternetServiceTimeseriesGroupsResponse] + ), + ) + + def top( + self, + *, + date: List[Union[str, date]] | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + limit: int | NotGiven = NOT_GIVEN, + name: List[str] | NotGiven = NOT_GIVEN, + service_category: List[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> InternetServiceTopResponse: + """ + Get top Internet services based on their rank. + + Args: + date: Array of dates to filter the ranking. + + format: Format results are returned in. + + limit: Limit the number of objects in the response. + + name: Array of names that will be used to name the series in responses. + + service_category: Filter for services category. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get( + "/radar/ranking/internet_services/top", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "date": date, + "format": format, + "limit": limit, + "name": name, + "service_category": service_category, + }, + internet_service_top_params.InternetServiceTopParams, + ), + post_parser=ResultWrapper[InternetServiceTopResponse]._unwrapper, + ), + cast_to=cast(Type[InternetServiceTopResponse], ResultWrapper[InternetServiceTopResponse]), + ) + + +class AsyncInternetServicesResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncInternetServicesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncInternetServicesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncInternetServicesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncInternetServicesResourceWithStreamingResponse(self) + + async def timeseries_groups( + self, + *, + date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, + date_range: List[str] | NotGiven = NOT_GIVEN, + date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + limit: int | NotGiven = NOT_GIVEN, + name: List[str] | NotGiven = NOT_GIVEN, + service_category: List[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> InternetServiceTimeseriesGroupsResponse: + """Gets Internet Services rank update changes over time. + + Raw values are returned. + + Args: + date_end: End of the date range (inclusive). + + date_range: For example, use `7d` and `7dControl` to compare this week with the previous + week. Use this parameter or set specific start and end dates (`dateStart` and + `dateEnd` parameters). + + date_start: Array of datetimes to filter the start of a series. + + format: Format results are returned in. + + limit: Limit the number of objects in the response. + + name: Array of names that will be used to name the series in responses. + + service_category: Filter for services category. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._get( + "/radar/ranking/internet_services/timeseries_groups", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "limit": limit, + "name": name, + "service_category": service_category, + }, + internet_service_timeseries_groups_params.InternetServiceTimeseriesGroupsParams, + ), + post_parser=ResultWrapper[InternetServiceTimeseriesGroupsResponse]._unwrapper, + ), + cast_to=cast( + Type[InternetServiceTimeseriesGroupsResponse], ResultWrapper[InternetServiceTimeseriesGroupsResponse] + ), + ) + + async def top( + self, + *, + date: List[Union[str, date]] | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + limit: int | NotGiven = NOT_GIVEN, + name: List[str] | NotGiven = NOT_GIVEN, + service_category: List[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> InternetServiceTopResponse: + """ + Get top Internet services based on their rank. + + Args: + date: Array of dates to filter the ranking. + + format: Format results are returned in. + + limit: Limit the number of objects in the response. + + name: Array of names that will be used to name the series in responses. + + service_category: Filter for services category. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._get( + "/radar/ranking/internet_services/top", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "date": date, + "format": format, + "limit": limit, + "name": name, + "service_category": service_category, + }, + internet_service_top_params.InternetServiceTopParams, + ), + post_parser=ResultWrapper[InternetServiceTopResponse]._unwrapper, + ), + cast_to=cast(Type[InternetServiceTopResponse], ResultWrapper[InternetServiceTopResponse]), + ) + + +class InternetServicesResourceWithRawResponse: + def __init__(self, internet_services: InternetServicesResource) -> None: + self._internet_services = internet_services + + self.timeseries_groups = to_raw_response_wrapper( + internet_services.timeseries_groups, + ) + self.top = to_raw_response_wrapper( + internet_services.top, + ) + + +class AsyncInternetServicesResourceWithRawResponse: + def __init__(self, internet_services: AsyncInternetServicesResource) -> None: + self._internet_services = internet_services + + self.timeseries_groups = async_to_raw_response_wrapper( + internet_services.timeseries_groups, + ) + self.top = async_to_raw_response_wrapper( + internet_services.top, + ) + + +class InternetServicesResourceWithStreamingResponse: + def __init__(self, internet_services: InternetServicesResource) -> None: + self._internet_services = internet_services + + self.timeseries_groups = to_streamed_response_wrapper( + internet_services.timeseries_groups, + ) + self.top = to_streamed_response_wrapper( + internet_services.top, + ) + + +class AsyncInternetServicesResourceWithStreamingResponse: + def __init__(self, internet_services: AsyncInternetServicesResource) -> None: + self._internet_services = internet_services + + self.timeseries_groups = async_to_streamed_response_wrapper( + internet_services.timeseries_groups, + ) + self.top = async_to_streamed_response_wrapper( + internet_services.top, + ) diff --git a/src/cloudflare/resources/radar/ranking/ranking.py b/src/cloudflare/resources/radar/ranking/ranking.py index 8670e90e1d1..39fcc521abb 100644 --- a/src/cloudflare/resources/radar/ranking/ranking.py +++ b/src/cloudflare/resources/radar/ranking/ranking.py @@ -32,6 +32,14 @@ from ...._wrappers import ResultWrapper from ....types.radar import ranking_top_params, ranking_timeseries_groups_params from ...._base_client import make_request_options +from .internet_services import ( + InternetServicesResource, + AsyncInternetServicesResource, + InternetServicesResourceWithRawResponse, + AsyncInternetServicesResourceWithRawResponse, + InternetServicesResourceWithStreamingResponse, + AsyncInternetServicesResourceWithStreamingResponse, +) from ....types.radar.ranking_top_response import RankingTopResponse from ....types.radar.ranking_timeseries_groups_response import RankingTimeseriesGroupsResponse @@ -43,6 +51,10 @@ class RankingResource(SyncAPIResource): def domain(self) -> DomainResource: return DomainResource(self._client) + @cached_property + def internet_services(self) -> InternetServicesResource: + return InternetServicesResource(self._client) + @cached_property def with_raw_response(self) -> RankingResourceWithRawResponse: """ @@ -213,6 +225,10 @@ class AsyncRankingResource(AsyncAPIResource): def domain(self) -> AsyncDomainResource: return AsyncDomainResource(self._client) + @cached_property + def internet_services(self) -> AsyncInternetServicesResource: + return AsyncInternetServicesResource(self._client) + @cached_property def with_raw_response(self) -> AsyncRankingResourceWithRawResponse: """ @@ -393,6 +409,10 @@ def __init__(self, ranking: RankingResource) -> None: def domain(self) -> DomainResourceWithRawResponse: return DomainResourceWithRawResponse(self._ranking.domain) + @cached_property + def internet_services(self) -> InternetServicesResourceWithRawResponse: + return InternetServicesResourceWithRawResponse(self._ranking.internet_services) + class AsyncRankingResourceWithRawResponse: def __init__(self, ranking: AsyncRankingResource) -> None: @@ -409,6 +429,10 @@ def __init__(self, ranking: AsyncRankingResource) -> None: def domain(self) -> AsyncDomainResourceWithRawResponse: return AsyncDomainResourceWithRawResponse(self._ranking.domain) + @cached_property + def internet_services(self) -> AsyncInternetServicesResourceWithRawResponse: + return AsyncInternetServicesResourceWithRawResponse(self._ranking.internet_services) + class RankingResourceWithStreamingResponse: def __init__(self, ranking: RankingResource) -> None: @@ -425,6 +449,10 @@ def __init__(self, ranking: RankingResource) -> None: def domain(self) -> DomainResourceWithStreamingResponse: return DomainResourceWithStreamingResponse(self._ranking.domain) + @cached_property + def internet_services(self) -> InternetServicesResourceWithStreamingResponse: + return InternetServicesResourceWithStreamingResponse(self._ranking.internet_services) + class AsyncRankingResourceWithStreamingResponse: def __init__(self, ranking: AsyncRankingResource) -> None: @@ -440,3 +468,7 @@ def __init__(self, ranking: AsyncRankingResource) -> None: @cached_property def domain(self) -> AsyncDomainResourceWithStreamingResponse: return AsyncDomainResourceWithStreamingResponse(self._ranking.domain) + + @cached_property + def internet_services(self) -> AsyncInternetServicesResourceWithStreamingResponse: + return AsyncInternetServicesResourceWithStreamingResponse(self._ranking.internet_services) diff --git a/src/cloudflare/resources/radar/robots_txt/__init__.py b/src/cloudflare/resources/radar/robots_txt/__init__.py new file mode 100644 index 00000000000..936f33b5d65 --- /dev/null +++ b/src/cloudflare/resources/radar/robots_txt/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .top import ( + TopResource, + AsyncTopResource, + TopResourceWithRawResponse, + AsyncTopResourceWithRawResponse, + TopResourceWithStreamingResponse, + AsyncTopResourceWithStreamingResponse, +) +from .robots_txt import ( + RobotsTXTResource, + AsyncRobotsTXTResource, + RobotsTXTResourceWithRawResponse, + AsyncRobotsTXTResourceWithRawResponse, + RobotsTXTResourceWithStreamingResponse, + AsyncRobotsTXTResourceWithStreamingResponse, +) + +__all__ = [ + "TopResource", + "AsyncTopResource", + "TopResourceWithRawResponse", + "AsyncTopResourceWithRawResponse", + "TopResourceWithStreamingResponse", + "AsyncTopResourceWithStreamingResponse", + "RobotsTXTResource", + "AsyncRobotsTXTResource", + "RobotsTXTResourceWithRawResponse", + "AsyncRobotsTXTResourceWithRawResponse", + "RobotsTXTResourceWithStreamingResponse", + "AsyncRobotsTXTResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/radar/robots_txt/robots_txt.py b/src/cloudflare/resources/radar/robots_txt/robots_txt.py new file mode 100644 index 00000000000..24d416eb7fb --- /dev/null +++ b/src/cloudflare/resources/radar/robots_txt/robots_txt.py @@ -0,0 +1,102 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .top.top import ( + TopResource, + AsyncTopResource, + TopResourceWithRawResponse, + AsyncTopResourceWithRawResponse, + TopResourceWithStreamingResponse, + AsyncTopResourceWithStreamingResponse, +) +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource + +__all__ = ["RobotsTXTResource", "AsyncRobotsTXTResource"] + + +class RobotsTXTResource(SyncAPIResource): + @cached_property + def top(self) -> TopResource: + return TopResource(self._client) + + @cached_property + def with_raw_response(self) -> RobotsTXTResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return RobotsTXTResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> RobotsTXTResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return RobotsTXTResourceWithStreamingResponse(self) + + +class AsyncRobotsTXTResource(AsyncAPIResource): + @cached_property + def top(self) -> AsyncTopResource: + return AsyncTopResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncRobotsTXTResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncRobotsTXTResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncRobotsTXTResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncRobotsTXTResourceWithStreamingResponse(self) + + +class RobotsTXTResourceWithRawResponse: + def __init__(self, robots_txt: RobotsTXTResource) -> None: + self._robots_txt = robots_txt + + @cached_property + def top(self) -> TopResourceWithRawResponse: + return TopResourceWithRawResponse(self._robots_txt.top) + + +class AsyncRobotsTXTResourceWithRawResponse: + def __init__(self, robots_txt: AsyncRobotsTXTResource) -> None: + self._robots_txt = robots_txt + + @cached_property + def top(self) -> AsyncTopResourceWithRawResponse: + return AsyncTopResourceWithRawResponse(self._robots_txt.top) + + +class RobotsTXTResourceWithStreamingResponse: + def __init__(self, robots_txt: RobotsTXTResource) -> None: + self._robots_txt = robots_txt + + @cached_property + def top(self) -> TopResourceWithStreamingResponse: + return TopResourceWithStreamingResponse(self._robots_txt.top) + + +class AsyncRobotsTXTResourceWithStreamingResponse: + def __init__(self, robots_txt: AsyncRobotsTXTResource) -> None: + self._robots_txt = robots_txt + + @cached_property + def top(self) -> AsyncTopResourceWithStreamingResponse: + return AsyncTopResourceWithStreamingResponse(self._robots_txt.top) diff --git a/src/cloudflare/resources/radar/robots_txt/top/__init__.py b/src/cloudflare/resources/radar/robots_txt/top/__init__.py new file mode 100644 index 00000000000..7fac3be2bc7 --- /dev/null +++ b/src/cloudflare/resources/radar/robots_txt/top/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .top import ( + TopResource, + AsyncTopResource, + TopResourceWithRawResponse, + AsyncTopResourceWithRawResponse, + TopResourceWithStreamingResponse, + AsyncTopResourceWithStreamingResponse, +) +from .user_agents import ( + UserAgentsResource, + AsyncUserAgentsResource, + UserAgentsResourceWithRawResponse, + AsyncUserAgentsResourceWithRawResponse, + UserAgentsResourceWithStreamingResponse, + AsyncUserAgentsResourceWithStreamingResponse, +) + +__all__ = [ + "UserAgentsResource", + "AsyncUserAgentsResource", + "UserAgentsResourceWithRawResponse", + "AsyncUserAgentsResourceWithRawResponse", + "UserAgentsResourceWithStreamingResponse", + "AsyncUserAgentsResourceWithStreamingResponse", + "TopResource", + "AsyncTopResource", + "TopResourceWithRawResponse", + "AsyncTopResourceWithRawResponse", + "TopResourceWithStreamingResponse", + "AsyncTopResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/radar/robots_txt/top/top.py b/src/cloudflare/resources/radar/robots_txt/top/top.py new file mode 100644 index 00000000000..a49a078fc72 --- /dev/null +++ b/src/cloudflare/resources/radar/robots_txt/top/top.py @@ -0,0 +1,257 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Type, Union, cast +from datetime import date +from typing_extensions import Literal + +import httpx + +from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._utils import ( + maybe_transform, + async_maybe_transform, +) +from ....._compat import cached_property +from .user_agents import ( + UserAgentsResource, + AsyncUserAgentsResource, + UserAgentsResourceWithRawResponse, + AsyncUserAgentsResourceWithRawResponse, + UserAgentsResourceWithStreamingResponse, + AsyncUserAgentsResourceWithStreamingResponse, +) +from ....._resource import SyncAPIResource, AsyncAPIResource +from ....._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ....._wrappers import ResultWrapper +from ....._base_client import make_request_options +from .....types.radar.robots_txt import top_domain_categories_params +from .....types.radar.robots_txt.top_domain_categories_response import TopDomainCategoriesResponse + +__all__ = ["TopResource", "AsyncTopResource"] + + +class TopResource(SyncAPIResource): + @cached_property + def user_agents(self) -> UserAgentsResource: + return UserAgentsResource(self._client) + + @cached_property + def with_raw_response(self) -> TopResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return TopResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> TopResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return TopResourceWithStreamingResponse(self) + + def domain_categories( + self, + *, + date: List[Union[str, date]] | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + limit: int | NotGiven = NOT_GIVEN, + name: List[str] | NotGiven = NOT_GIVEN, + user_agent_category: Literal["AI"] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> TopDomainCategoriesResponse: + """ + Get the top domain categories by the number of robots.txt files parsed. + + Args: + date: Array of dates to filter the ranking. + + format: Format results are returned in. + + limit: Limit the number of objects in the response. + + name: Array of names that will be used to name the series in responses. + + user_agent_category: Filter by user agent category. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get( + "/radar/robots_txt/top/domain_categories", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "date": date, + "format": format, + "limit": limit, + "name": name, + "user_agent_category": user_agent_category, + }, + top_domain_categories_params.TopDomainCategoriesParams, + ), + post_parser=ResultWrapper[TopDomainCategoriesResponse]._unwrapper, + ), + cast_to=cast(Type[TopDomainCategoriesResponse], ResultWrapper[TopDomainCategoriesResponse]), + ) + + +class AsyncTopResource(AsyncAPIResource): + @cached_property + def user_agents(self) -> AsyncUserAgentsResource: + return AsyncUserAgentsResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncTopResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncTopResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncTopResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncTopResourceWithStreamingResponse(self) + + async def domain_categories( + self, + *, + date: List[Union[str, date]] | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + limit: int | NotGiven = NOT_GIVEN, + name: List[str] | NotGiven = NOT_GIVEN, + user_agent_category: Literal["AI"] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> TopDomainCategoriesResponse: + """ + Get the top domain categories by the number of robots.txt files parsed. + + Args: + date: Array of dates to filter the ranking. + + format: Format results are returned in. + + limit: Limit the number of objects in the response. + + name: Array of names that will be used to name the series in responses. + + user_agent_category: Filter by user agent category. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._get( + "/radar/robots_txt/top/domain_categories", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "date": date, + "format": format, + "limit": limit, + "name": name, + "user_agent_category": user_agent_category, + }, + top_domain_categories_params.TopDomainCategoriesParams, + ), + post_parser=ResultWrapper[TopDomainCategoriesResponse]._unwrapper, + ), + cast_to=cast(Type[TopDomainCategoriesResponse], ResultWrapper[TopDomainCategoriesResponse]), + ) + + +class TopResourceWithRawResponse: + def __init__(self, top: TopResource) -> None: + self._top = top + + self.domain_categories = to_raw_response_wrapper( + top.domain_categories, + ) + + @cached_property + def user_agents(self) -> UserAgentsResourceWithRawResponse: + return UserAgentsResourceWithRawResponse(self._top.user_agents) + + +class AsyncTopResourceWithRawResponse: + def __init__(self, top: AsyncTopResource) -> None: + self._top = top + + self.domain_categories = async_to_raw_response_wrapper( + top.domain_categories, + ) + + @cached_property + def user_agents(self) -> AsyncUserAgentsResourceWithRawResponse: + return AsyncUserAgentsResourceWithRawResponse(self._top.user_agents) + + +class TopResourceWithStreamingResponse: + def __init__(self, top: TopResource) -> None: + self._top = top + + self.domain_categories = to_streamed_response_wrapper( + top.domain_categories, + ) + + @cached_property + def user_agents(self) -> UserAgentsResourceWithStreamingResponse: + return UserAgentsResourceWithStreamingResponse(self._top.user_agents) + + +class AsyncTopResourceWithStreamingResponse: + def __init__(self, top: AsyncTopResource) -> None: + self._top = top + + self.domain_categories = async_to_streamed_response_wrapper( + top.domain_categories, + ) + + @cached_property + def user_agents(self) -> AsyncUserAgentsResourceWithStreamingResponse: + return AsyncUserAgentsResourceWithStreamingResponse(self._top.user_agents) diff --git a/src/cloudflare/resources/radar/robots_txt/top/user_agents.py b/src/cloudflare/resources/radar/robots_txt/top/user_agents.py new file mode 100644 index 00000000000..774f29ecaf5 --- /dev/null +++ b/src/cloudflare/resources/radar/robots_txt/top/user_agents.py @@ -0,0 +1,241 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Type, Union, cast +from datetime import date +from typing_extensions import Literal + +import httpx + +from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._utils import ( + maybe_transform, + async_maybe_transform, +) +from ....._compat import cached_property +from ....._resource import SyncAPIResource, AsyncAPIResource +from ....._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ....._wrappers import ResultWrapper +from ....._base_client import make_request_options +from .....types.radar.robots_txt.top import user_agent_directive_params +from .....types.radar.robots_txt.top.user_agent_directive_response import UserAgentDirectiveResponse + +__all__ = ["UserAgentsResource", "AsyncUserAgentsResource"] + + +class UserAgentsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> UserAgentsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return UserAgentsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> UserAgentsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return UserAgentsResourceWithStreamingResponse(self) + + def directive( + self, + *, + date: List[Union[str, date]] | NotGiven = NOT_GIVEN, + directive: Literal["ALLOW", "DISALLOW"] | NotGiven = NOT_GIVEN, + domain_category: List[str] | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + limit: int | NotGiven = NOT_GIVEN, + name: List[str] | NotGiven = NOT_GIVEN, + user_agent_category: Literal["AI"] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> UserAgentDirectiveResponse: + """ + Get the top user agents on robots.txt files by directive. + + Args: + date: Array of dates to filter the ranking. + + directive: Filter by directive. + + domain_category: Filter by domain category. + + format: Format results are returned in. + + limit: Limit the number of objects in the response. + + name: Array of names that will be used to name the series in responses. + + user_agent_category: Filter by user agent category. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get( + "/radar/robots_txt/top/user_agents/directive", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "date": date, + "directive": directive, + "domain_category": domain_category, + "format": format, + "limit": limit, + "name": name, + "user_agent_category": user_agent_category, + }, + user_agent_directive_params.UserAgentDirectiveParams, + ), + post_parser=ResultWrapper[UserAgentDirectiveResponse]._unwrapper, + ), + cast_to=cast(Type[UserAgentDirectiveResponse], ResultWrapper[UserAgentDirectiveResponse]), + ) + + +class AsyncUserAgentsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncUserAgentsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncUserAgentsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncUserAgentsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncUserAgentsResourceWithStreamingResponse(self) + + async def directive( + self, + *, + date: List[Union[str, date]] | NotGiven = NOT_GIVEN, + directive: Literal["ALLOW", "DISALLOW"] | NotGiven = NOT_GIVEN, + domain_category: List[str] | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + limit: int | NotGiven = NOT_GIVEN, + name: List[str] | NotGiven = NOT_GIVEN, + user_agent_category: Literal["AI"] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> UserAgentDirectiveResponse: + """ + Get the top user agents on robots.txt files by directive. + + Args: + date: Array of dates to filter the ranking. + + directive: Filter by directive. + + domain_category: Filter by domain category. + + format: Format results are returned in. + + limit: Limit the number of objects in the response. + + name: Array of names that will be used to name the series in responses. + + user_agent_category: Filter by user agent category. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._get( + "/radar/robots_txt/top/user_agents/directive", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "date": date, + "directive": directive, + "domain_category": domain_category, + "format": format, + "limit": limit, + "name": name, + "user_agent_category": user_agent_category, + }, + user_agent_directive_params.UserAgentDirectiveParams, + ), + post_parser=ResultWrapper[UserAgentDirectiveResponse]._unwrapper, + ), + cast_to=cast(Type[UserAgentDirectiveResponse], ResultWrapper[UserAgentDirectiveResponse]), + ) + + +class UserAgentsResourceWithRawResponse: + def __init__(self, user_agents: UserAgentsResource) -> None: + self._user_agents = user_agents + + self.directive = to_raw_response_wrapper( + user_agents.directive, + ) + + +class AsyncUserAgentsResourceWithRawResponse: + def __init__(self, user_agents: AsyncUserAgentsResource) -> None: + self._user_agents = user_agents + + self.directive = async_to_raw_response_wrapper( + user_agents.directive, + ) + + +class UserAgentsResourceWithStreamingResponse: + def __init__(self, user_agents: UserAgentsResource) -> None: + self._user_agents = user_agents + + self.directive = to_streamed_response_wrapper( + user_agents.directive, + ) + + +class AsyncUserAgentsResourceWithStreamingResponse: + def __init__(self, user_agents: AsyncUserAgentsResource) -> None: + self._user_agents = user_agents + + self.directive = async_to_streamed_response_wrapper( + user_agents.directive, + ) diff --git a/src/cloudflare/resources/security_center/__init__.py b/src/cloudflare/resources/security_center/__init__.py new file mode 100644 index 00000000000..aced2f74c07 --- /dev/null +++ b/src/cloudflare/resources/security_center/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .insights import ( + InsightsResource, + AsyncInsightsResource, + InsightsResourceWithRawResponse, + AsyncInsightsResourceWithRawResponse, + InsightsResourceWithStreamingResponse, + AsyncInsightsResourceWithStreamingResponse, +) +from .security_center import ( + SecurityCenterResource, + AsyncSecurityCenterResource, + SecurityCenterResourceWithRawResponse, + AsyncSecurityCenterResourceWithRawResponse, + SecurityCenterResourceWithStreamingResponse, + AsyncSecurityCenterResourceWithStreamingResponse, +) + +__all__ = [ + "InsightsResource", + "AsyncInsightsResource", + "InsightsResourceWithRawResponse", + "AsyncInsightsResourceWithRawResponse", + "InsightsResourceWithStreamingResponse", + "AsyncInsightsResourceWithStreamingResponse", + "SecurityCenterResource", + "AsyncSecurityCenterResource", + "SecurityCenterResourceWithRawResponse", + "AsyncSecurityCenterResourceWithRawResponse", + "SecurityCenterResourceWithStreamingResponse", + "AsyncSecurityCenterResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/security_center/insights/__init__.py b/src/cloudflare/resources/security_center/insights/__init__.py new file mode 100644 index 00000000000..5818ca6cde6 --- /dev/null +++ b/src/cloudflare/resources/security_center/insights/__init__.py @@ -0,0 +1,61 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .type import ( + TypeResource, + AsyncTypeResource, + TypeResourceWithRawResponse, + AsyncTypeResourceWithRawResponse, + TypeResourceWithStreamingResponse, + AsyncTypeResourceWithStreamingResponse, +) +from .class_ import ( + ClassResource, + AsyncClassResource, + ClassResourceWithRawResponse, + AsyncClassResourceWithRawResponse, + ClassResourceWithStreamingResponse, + AsyncClassResourceWithStreamingResponse, +) +from .insights import ( + InsightsResource, + AsyncInsightsResource, + InsightsResourceWithRawResponse, + AsyncInsightsResourceWithRawResponse, + InsightsResourceWithStreamingResponse, + AsyncInsightsResourceWithStreamingResponse, +) +from .severity import ( + SeverityResource, + AsyncSeverityResource, + SeverityResourceWithRawResponse, + AsyncSeverityResourceWithRawResponse, + SeverityResourceWithStreamingResponse, + AsyncSeverityResourceWithStreamingResponse, +) + +__all__ = [ + "ClassResource", + "AsyncClassResource", + "ClassResourceWithRawResponse", + "AsyncClassResourceWithRawResponse", + "ClassResourceWithStreamingResponse", + "AsyncClassResourceWithStreamingResponse", + "SeverityResource", + "AsyncSeverityResource", + "SeverityResourceWithRawResponse", + "AsyncSeverityResourceWithRawResponse", + "SeverityResourceWithStreamingResponse", + "AsyncSeverityResourceWithStreamingResponse", + "TypeResource", + "AsyncTypeResource", + "TypeResourceWithRawResponse", + "AsyncTypeResourceWithRawResponse", + "TypeResourceWithStreamingResponse", + "AsyncTypeResourceWithStreamingResponse", + "InsightsResource", + "AsyncInsightsResource", + "InsightsResourceWithRawResponse", + "AsyncInsightsResourceWithRawResponse", + "InsightsResourceWithStreamingResponse", + "AsyncInsightsResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/security_center/insights/class_.py b/src/cloudflare/resources/security_center/insights/class_.py new file mode 100644 index 00000000000..8e6d1f59db4 --- /dev/null +++ b/src/cloudflare/resources/security_center/insights/class_.py @@ -0,0 +1,265 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Type, Optional, cast + +import httpx + +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( + maybe_transform, + async_maybe_transform, +) +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...._wrappers import ResultWrapper +from ...._base_client import make_request_options +from ....types.security_center.insights import class_get_params +from ....types.intel.attack_surface_report.issue_type import IssueType +from ....types.security_center.insights.class_get_response import ClassGetResponse +from ....types.intel.attack_surface_report.severity_query_param import SeverityQueryParam + +__all__ = ["ClassResource", "AsyncClassResource"] + + +class ClassResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> ClassResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return ClassResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ClassResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return ClassResourceWithStreamingResponse(self) + + def get( + self, + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + dismissed: bool | NotGiven = NOT_GIVEN, + issue_class: List[str] | NotGiven = NOT_GIVEN, + issue_class_neq: List[str] | NotGiven = NOT_GIVEN, + issue_type: List[IssueType] | NotGiven = NOT_GIVEN, + issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN, + product: List[str] | NotGiven = NOT_GIVEN, + product_neq: List[str] | NotGiven = NOT_GIVEN, + severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, + severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, + subject: List[str] | NotGiven = NOT_GIVEN, + subject_neq: List[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[ClassGetResponse]: + """ + Get Security Center Insight Counts by Class + + Args: + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if account_id and zone_id: + raise ValueError("You cannot provide both account_id and zone_id") + + if account_id: + account_or_zone = "accounts" + account_or_zone_id = account_id + else: + if not zone_id: + raise ValueError("You must provide either account_id or zone_id") + + account_or_zone = "zones" + account_or_zone_id = zone_id + return self._get( + f"/{account_or_zone}/{account_or_zone_id}/security-center/insights/class", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "dismissed": dismissed, + "issue_class": issue_class, + "issue_class_neq": issue_class_neq, + "issue_type": issue_type, + "issue_type_neq": issue_type_neq, + "product": product, + "product_neq": product_neq, + "severity": severity, + "severity_neq": severity_neq, + "subject": subject, + "subject_neq": subject_neq, + }, + class_get_params.ClassGetParams, + ), + post_parser=ResultWrapper[Optional[ClassGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[ClassGetResponse]], ResultWrapper[ClassGetResponse]), + ) + + +class AsyncClassResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncClassResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncClassResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncClassResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncClassResourceWithStreamingResponse(self) + + async def get( + self, + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + dismissed: bool | NotGiven = NOT_GIVEN, + issue_class: List[str] | NotGiven = NOT_GIVEN, + issue_class_neq: List[str] | NotGiven = NOT_GIVEN, + issue_type: List[IssueType] | NotGiven = NOT_GIVEN, + issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN, + product: List[str] | NotGiven = NOT_GIVEN, + product_neq: List[str] | NotGiven = NOT_GIVEN, + severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, + severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, + subject: List[str] | NotGiven = NOT_GIVEN, + subject_neq: List[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[ClassGetResponse]: + """ + Get Security Center Insight Counts by Class + + Args: + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if account_id and zone_id: + raise ValueError("You cannot provide both account_id and zone_id") + + if account_id: + account_or_zone = "accounts" + account_or_zone_id = account_id + else: + if not zone_id: + raise ValueError("You must provide either account_id or zone_id") + + account_or_zone = "zones" + account_or_zone_id = zone_id + return await self._get( + f"/{account_or_zone}/{account_or_zone_id}/security-center/insights/class", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "dismissed": dismissed, + "issue_class": issue_class, + "issue_class_neq": issue_class_neq, + "issue_type": issue_type, + "issue_type_neq": issue_type_neq, + "product": product, + "product_neq": product_neq, + "severity": severity, + "severity_neq": severity_neq, + "subject": subject, + "subject_neq": subject_neq, + }, + class_get_params.ClassGetParams, + ), + post_parser=ResultWrapper[Optional[ClassGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[ClassGetResponse]], ResultWrapper[ClassGetResponse]), + ) + + +class ClassResourceWithRawResponse: + def __init__(self, class_: ClassResource) -> None: + self._class_ = class_ + + self.get = to_raw_response_wrapper( + class_.get, + ) + + +class AsyncClassResourceWithRawResponse: + def __init__(self, class_: AsyncClassResource) -> None: + self._class_ = class_ + + self.get = async_to_raw_response_wrapper( + class_.get, + ) + + +class ClassResourceWithStreamingResponse: + def __init__(self, class_: ClassResource) -> None: + self._class_ = class_ + + self.get = to_streamed_response_wrapper( + class_.get, + ) + + +class AsyncClassResourceWithStreamingResponse: + def __init__(self, class_: AsyncClassResource) -> None: + self._class_ = class_ + + self.get = async_to_streamed_response_wrapper( + class_.get, + ) diff --git a/src/cloudflare/resources/security_center/insights/insights.py b/src/cloudflare/resources/security_center/insights/insights.py new file mode 100644 index 00000000000..223c538d59d --- /dev/null +++ b/src/cloudflare/resources/security_center/insights/insights.py @@ -0,0 +1,496 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Type, Optional, cast + +import httpx + +from .type import ( + TypeResource, + AsyncTypeResource, + TypeResourceWithRawResponse, + AsyncTypeResourceWithRawResponse, + TypeResourceWithStreamingResponse, + AsyncTypeResourceWithStreamingResponse, +) +from .class_ import ( + ClassResource, + AsyncClassResource, + ClassResourceWithRawResponse, + AsyncClassResourceWithRawResponse, + ClassResourceWithStreamingResponse, + AsyncClassResourceWithStreamingResponse, +) +from .severity import ( + SeverityResource, + AsyncSeverityResource, + SeverityResourceWithRawResponse, + AsyncSeverityResourceWithRawResponse, + SeverityResourceWithStreamingResponse, + AsyncSeverityResourceWithStreamingResponse, +) +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( + maybe_transform, + async_maybe_transform, +) +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...._wrappers import ResultWrapper +from ...._base_client import make_request_options +from ....types.security_center import insight_get_params, insight_dismiss_params +from ....types.security_center.insight_get_response import InsightGetResponse +from ....types.intel.attack_surface_report.issue_type import IssueType +from ....types.security_center.insight_dismiss_response import InsightDismissResponse +from ....types.intel.attack_surface_report.severity_query_param import SeverityQueryParam + +__all__ = ["InsightsResource", "AsyncInsightsResource"] + + +class InsightsResource(SyncAPIResource): + @cached_property + def class_(self) -> ClassResource: + return ClassResource(self._client) + + @cached_property + def severity(self) -> SeverityResource: + return SeverityResource(self._client) + + @cached_property + def type(self) -> TypeResource: + return TypeResource(self._client) + + @cached_property + def with_raw_response(self) -> InsightsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return InsightsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> InsightsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return InsightsResourceWithStreamingResponse(self) + + def dismiss( + self, + issue_id: str, + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + dismiss: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> InsightDismissResponse: + """ + Archive Security Center Insight + + Args: + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not issue_id: + raise ValueError(f"Expected a non-empty value for `issue_id` but received {issue_id!r}") + if account_id and zone_id: + raise ValueError("You cannot provide both account_id and zone_id") + + if account_id: + account_or_zone = "accounts" + account_or_zone_id = account_id + else: + if not zone_id: + raise ValueError("You must provide either account_id or zone_id") + + account_or_zone = "zones" + account_or_zone_id = zone_id + return self._put( + f"/{account_or_zone}/{account_or_zone_id}/security-center/insights/{issue_id}/dismiss", + body=maybe_transform({"dismiss": dismiss}, insight_dismiss_params.InsightDismissParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=InsightDismissResponse, + ) + + def get( + self, + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + dismissed: bool | NotGiven = NOT_GIVEN, + issue_class: List[str] | NotGiven = NOT_GIVEN, + issue_class_neq: List[str] | NotGiven = NOT_GIVEN, + issue_type: List[IssueType] | NotGiven = NOT_GIVEN, + issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN, + page: int | NotGiven = NOT_GIVEN, + per_page: int | NotGiven = NOT_GIVEN, + product: List[str] | NotGiven = NOT_GIVEN, + product_neq: List[str] | NotGiven = NOT_GIVEN, + severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, + severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, + subject: List[str] | NotGiven = NOT_GIVEN, + subject_neq: List[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[InsightGetResponse]: + """ + Get Security Center Insights + + Args: + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + page: Current page within paginated list of results + + per_page: Number of results per page of results + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if account_id and zone_id: + raise ValueError("You cannot provide both account_id and zone_id") + + if account_id: + account_or_zone = "accounts" + account_or_zone_id = account_id + else: + if not zone_id: + raise ValueError("You must provide either account_id or zone_id") + + account_or_zone = "zones" + account_or_zone_id = zone_id + return self._get( + f"/{account_or_zone}/{account_or_zone_id}/security-center/insights", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "dismissed": dismissed, + "issue_class": issue_class, + "issue_class_neq": issue_class_neq, + "issue_type": issue_type, + "issue_type_neq": issue_type_neq, + "page": page, + "per_page": per_page, + "product": product, + "product_neq": product_neq, + "severity": severity, + "severity_neq": severity_neq, + "subject": subject, + "subject_neq": subject_neq, + }, + insight_get_params.InsightGetParams, + ), + post_parser=ResultWrapper[Optional[InsightGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[InsightGetResponse]], ResultWrapper[InsightGetResponse]), + ) + + +class AsyncInsightsResource(AsyncAPIResource): + @cached_property + def class_(self) -> AsyncClassResource: + return AsyncClassResource(self._client) + + @cached_property + def severity(self) -> AsyncSeverityResource: + return AsyncSeverityResource(self._client) + + @cached_property + def type(self) -> AsyncTypeResource: + return AsyncTypeResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncInsightsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncInsightsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncInsightsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncInsightsResourceWithStreamingResponse(self) + + async def dismiss( + self, + issue_id: str, + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + dismiss: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> InsightDismissResponse: + """ + Archive Security Center Insight + + Args: + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not issue_id: + raise ValueError(f"Expected a non-empty value for `issue_id` but received {issue_id!r}") + if account_id and zone_id: + raise ValueError("You cannot provide both account_id and zone_id") + + if account_id: + account_or_zone = "accounts" + account_or_zone_id = account_id + else: + if not zone_id: + raise ValueError("You must provide either account_id or zone_id") + + account_or_zone = "zones" + account_or_zone_id = zone_id + return await self._put( + f"/{account_or_zone}/{account_or_zone_id}/security-center/insights/{issue_id}/dismiss", + body=await async_maybe_transform({"dismiss": dismiss}, insight_dismiss_params.InsightDismissParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=InsightDismissResponse, + ) + + async def get( + self, + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + dismissed: bool | NotGiven = NOT_GIVEN, + issue_class: List[str] | NotGiven = NOT_GIVEN, + issue_class_neq: List[str] | NotGiven = NOT_GIVEN, + issue_type: List[IssueType] | NotGiven = NOT_GIVEN, + issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN, + page: int | NotGiven = NOT_GIVEN, + per_page: int | NotGiven = NOT_GIVEN, + product: List[str] | NotGiven = NOT_GIVEN, + product_neq: List[str] | NotGiven = NOT_GIVEN, + severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, + severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, + subject: List[str] | NotGiven = NOT_GIVEN, + subject_neq: List[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[InsightGetResponse]: + """ + Get Security Center Insights + + Args: + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + page: Current page within paginated list of results + + per_page: Number of results per page of results + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if account_id and zone_id: + raise ValueError("You cannot provide both account_id and zone_id") + + if account_id: + account_or_zone = "accounts" + account_or_zone_id = account_id + else: + if not zone_id: + raise ValueError("You must provide either account_id or zone_id") + + account_or_zone = "zones" + account_or_zone_id = zone_id + return await self._get( + f"/{account_or_zone}/{account_or_zone_id}/security-center/insights", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "dismissed": dismissed, + "issue_class": issue_class, + "issue_class_neq": issue_class_neq, + "issue_type": issue_type, + "issue_type_neq": issue_type_neq, + "page": page, + "per_page": per_page, + "product": product, + "product_neq": product_neq, + "severity": severity, + "severity_neq": severity_neq, + "subject": subject, + "subject_neq": subject_neq, + }, + insight_get_params.InsightGetParams, + ), + post_parser=ResultWrapper[Optional[InsightGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[InsightGetResponse]], ResultWrapper[InsightGetResponse]), + ) + + +class InsightsResourceWithRawResponse: + def __init__(self, insights: InsightsResource) -> None: + self._insights = insights + + self.dismiss = to_raw_response_wrapper( + insights.dismiss, + ) + self.get = to_raw_response_wrapper( + insights.get, + ) + + @cached_property + def class_(self) -> ClassResourceWithRawResponse: + return ClassResourceWithRawResponse(self._insights.class_) + + @cached_property + def severity(self) -> SeverityResourceWithRawResponse: + return SeverityResourceWithRawResponse(self._insights.severity) + + @cached_property + def type(self) -> TypeResourceWithRawResponse: + return TypeResourceWithRawResponse(self._insights.type) + + +class AsyncInsightsResourceWithRawResponse: + def __init__(self, insights: AsyncInsightsResource) -> None: + self._insights = insights + + self.dismiss = async_to_raw_response_wrapper( + insights.dismiss, + ) + self.get = async_to_raw_response_wrapper( + insights.get, + ) + + @cached_property + def class_(self) -> AsyncClassResourceWithRawResponse: + return AsyncClassResourceWithRawResponse(self._insights.class_) + + @cached_property + def severity(self) -> AsyncSeverityResourceWithRawResponse: + return AsyncSeverityResourceWithRawResponse(self._insights.severity) + + @cached_property + def type(self) -> AsyncTypeResourceWithRawResponse: + return AsyncTypeResourceWithRawResponse(self._insights.type) + + +class InsightsResourceWithStreamingResponse: + def __init__(self, insights: InsightsResource) -> None: + self._insights = insights + + self.dismiss = to_streamed_response_wrapper( + insights.dismiss, + ) + self.get = to_streamed_response_wrapper( + insights.get, + ) + + @cached_property + def class_(self) -> ClassResourceWithStreamingResponse: + return ClassResourceWithStreamingResponse(self._insights.class_) + + @cached_property + def severity(self) -> SeverityResourceWithStreamingResponse: + return SeverityResourceWithStreamingResponse(self._insights.severity) + + @cached_property + def type(self) -> TypeResourceWithStreamingResponse: + return TypeResourceWithStreamingResponse(self._insights.type) + + +class AsyncInsightsResourceWithStreamingResponse: + def __init__(self, insights: AsyncInsightsResource) -> None: + self._insights = insights + + self.dismiss = async_to_streamed_response_wrapper( + insights.dismiss, + ) + self.get = async_to_streamed_response_wrapper( + insights.get, + ) + + @cached_property + def class_(self) -> AsyncClassResourceWithStreamingResponse: + return AsyncClassResourceWithStreamingResponse(self._insights.class_) + + @cached_property + def severity(self) -> AsyncSeverityResourceWithStreamingResponse: + return AsyncSeverityResourceWithStreamingResponse(self._insights.severity) + + @cached_property + def type(self) -> AsyncTypeResourceWithStreamingResponse: + return AsyncTypeResourceWithStreamingResponse(self._insights.type) diff --git a/src/cloudflare/resources/security_center/insights/severity.py b/src/cloudflare/resources/security_center/insights/severity.py new file mode 100644 index 00000000000..5108bec313d --- /dev/null +++ b/src/cloudflare/resources/security_center/insights/severity.py @@ -0,0 +1,265 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Type, Optional, cast + +import httpx + +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( + maybe_transform, + async_maybe_transform, +) +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...._wrappers import ResultWrapper +from ...._base_client import make_request_options +from ....types.security_center.insights import severity_get_params +from ....types.intel.attack_surface_report.issue_type import IssueType +from ....types.security_center.insights.severity_get_response import SeverityGetResponse +from ....types.intel.attack_surface_report.severity_query_param import SeverityQueryParam + +__all__ = ["SeverityResource", "AsyncSeverityResource"] + + +class SeverityResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> SeverityResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return SeverityResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> SeverityResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return SeverityResourceWithStreamingResponse(self) + + def get( + self, + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + dismissed: bool | NotGiven = NOT_GIVEN, + issue_class: List[str] | NotGiven = NOT_GIVEN, + issue_class_neq: List[str] | NotGiven = NOT_GIVEN, + issue_type: List[IssueType] | NotGiven = NOT_GIVEN, + issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN, + product: List[str] | NotGiven = NOT_GIVEN, + product_neq: List[str] | NotGiven = NOT_GIVEN, + severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, + severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, + subject: List[str] | NotGiven = NOT_GIVEN, + subject_neq: List[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[SeverityGetResponse]: + """ + Get Security Center Insight Counts by Severity + + Args: + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if account_id and zone_id: + raise ValueError("You cannot provide both account_id and zone_id") + + if account_id: + account_or_zone = "accounts" + account_or_zone_id = account_id + else: + if not zone_id: + raise ValueError("You must provide either account_id or zone_id") + + account_or_zone = "zones" + account_or_zone_id = zone_id + return self._get( + f"/{account_or_zone}/{account_or_zone_id}/security-center/insights/severity", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "dismissed": dismissed, + "issue_class": issue_class, + "issue_class_neq": issue_class_neq, + "issue_type": issue_type, + "issue_type_neq": issue_type_neq, + "product": product, + "product_neq": product_neq, + "severity": severity, + "severity_neq": severity_neq, + "subject": subject, + "subject_neq": subject_neq, + }, + severity_get_params.SeverityGetParams, + ), + post_parser=ResultWrapper[Optional[SeverityGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[SeverityGetResponse]], ResultWrapper[SeverityGetResponse]), + ) + + +class AsyncSeverityResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncSeverityResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncSeverityResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncSeverityResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncSeverityResourceWithStreamingResponse(self) + + async def get( + self, + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + dismissed: bool | NotGiven = NOT_GIVEN, + issue_class: List[str] | NotGiven = NOT_GIVEN, + issue_class_neq: List[str] | NotGiven = NOT_GIVEN, + issue_type: List[IssueType] | NotGiven = NOT_GIVEN, + issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN, + product: List[str] | NotGiven = NOT_GIVEN, + product_neq: List[str] | NotGiven = NOT_GIVEN, + severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, + severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, + subject: List[str] | NotGiven = NOT_GIVEN, + subject_neq: List[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[SeverityGetResponse]: + """ + Get Security Center Insight Counts by Severity + + Args: + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if account_id and zone_id: + raise ValueError("You cannot provide both account_id and zone_id") + + if account_id: + account_or_zone = "accounts" + account_or_zone_id = account_id + else: + if not zone_id: + raise ValueError("You must provide either account_id or zone_id") + + account_or_zone = "zones" + account_or_zone_id = zone_id + return await self._get( + f"/{account_or_zone}/{account_or_zone_id}/security-center/insights/severity", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "dismissed": dismissed, + "issue_class": issue_class, + "issue_class_neq": issue_class_neq, + "issue_type": issue_type, + "issue_type_neq": issue_type_neq, + "product": product, + "product_neq": product_neq, + "severity": severity, + "severity_neq": severity_neq, + "subject": subject, + "subject_neq": subject_neq, + }, + severity_get_params.SeverityGetParams, + ), + post_parser=ResultWrapper[Optional[SeverityGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[SeverityGetResponse]], ResultWrapper[SeverityGetResponse]), + ) + + +class SeverityResourceWithRawResponse: + def __init__(self, severity: SeverityResource) -> None: + self._severity = severity + + self.get = to_raw_response_wrapper( + severity.get, + ) + + +class AsyncSeverityResourceWithRawResponse: + def __init__(self, severity: AsyncSeverityResource) -> None: + self._severity = severity + + self.get = async_to_raw_response_wrapper( + severity.get, + ) + + +class SeverityResourceWithStreamingResponse: + def __init__(self, severity: SeverityResource) -> None: + self._severity = severity + + self.get = to_streamed_response_wrapper( + severity.get, + ) + + +class AsyncSeverityResourceWithStreamingResponse: + def __init__(self, severity: AsyncSeverityResource) -> None: + self._severity = severity + + self.get = async_to_streamed_response_wrapper( + severity.get, + ) diff --git a/src/cloudflare/resources/security_center/insights/type.py b/src/cloudflare/resources/security_center/insights/type.py new file mode 100644 index 00000000000..3638ef80bb6 --- /dev/null +++ b/src/cloudflare/resources/security_center/insights/type.py @@ -0,0 +1,265 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Type, Optional, cast + +import httpx + +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( + maybe_transform, + async_maybe_transform, +) +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...._wrappers import ResultWrapper +from ...._base_client import make_request_options +from ....types.security_center.insights import type_get_params +from ....types.intel.attack_surface_report.issue_type import IssueType +from ....types.security_center.insights.type_get_response import TypeGetResponse +from ....types.intel.attack_surface_report.severity_query_param import SeverityQueryParam + +__all__ = ["TypeResource", "AsyncTypeResource"] + + +class TypeResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> TypeResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return TypeResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> TypeResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return TypeResourceWithStreamingResponse(self) + + def get( + self, + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + dismissed: bool | NotGiven = NOT_GIVEN, + issue_class: List[str] | NotGiven = NOT_GIVEN, + issue_class_neq: List[str] | NotGiven = NOT_GIVEN, + issue_type: List[IssueType] | NotGiven = NOT_GIVEN, + issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN, + product: List[str] | NotGiven = NOT_GIVEN, + product_neq: List[str] | NotGiven = NOT_GIVEN, + severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, + severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, + subject: List[str] | NotGiven = NOT_GIVEN, + subject_neq: List[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[TypeGetResponse]: + """ + Get Security Center Insight Counts by Type + + Args: + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if account_id and zone_id: + raise ValueError("You cannot provide both account_id and zone_id") + + if account_id: + account_or_zone = "accounts" + account_or_zone_id = account_id + else: + if not zone_id: + raise ValueError("You must provide either account_id or zone_id") + + account_or_zone = "zones" + account_or_zone_id = zone_id + return self._get( + f"/{account_or_zone}/{account_or_zone_id}/security-center/insights/type", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "dismissed": dismissed, + "issue_class": issue_class, + "issue_class_neq": issue_class_neq, + "issue_type": issue_type, + "issue_type_neq": issue_type_neq, + "product": product, + "product_neq": product_neq, + "severity": severity, + "severity_neq": severity_neq, + "subject": subject, + "subject_neq": subject_neq, + }, + type_get_params.TypeGetParams, + ), + post_parser=ResultWrapper[Optional[TypeGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[TypeGetResponse]], ResultWrapper[TypeGetResponse]), + ) + + +class AsyncTypeResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncTypeResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncTypeResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncTypeResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncTypeResourceWithStreamingResponse(self) + + async def get( + self, + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + dismissed: bool | NotGiven = NOT_GIVEN, + issue_class: List[str] | NotGiven = NOT_GIVEN, + issue_class_neq: List[str] | NotGiven = NOT_GIVEN, + issue_type: List[IssueType] | NotGiven = NOT_GIVEN, + issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN, + product: List[str] | NotGiven = NOT_GIVEN, + product_neq: List[str] | NotGiven = NOT_GIVEN, + severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, + severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, + subject: List[str] | NotGiven = NOT_GIVEN, + subject_neq: List[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[TypeGetResponse]: + """ + Get Security Center Insight Counts by Type + + Args: + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if account_id and zone_id: + raise ValueError("You cannot provide both account_id and zone_id") + + if account_id: + account_or_zone = "accounts" + account_or_zone_id = account_id + else: + if not zone_id: + raise ValueError("You must provide either account_id or zone_id") + + account_or_zone = "zones" + account_or_zone_id = zone_id + return await self._get( + f"/{account_or_zone}/{account_or_zone_id}/security-center/insights/type", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "dismissed": dismissed, + "issue_class": issue_class, + "issue_class_neq": issue_class_neq, + "issue_type": issue_type, + "issue_type_neq": issue_type_neq, + "product": product, + "product_neq": product_neq, + "severity": severity, + "severity_neq": severity_neq, + "subject": subject, + "subject_neq": subject_neq, + }, + type_get_params.TypeGetParams, + ), + post_parser=ResultWrapper[Optional[TypeGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[TypeGetResponse]], ResultWrapper[TypeGetResponse]), + ) + + +class TypeResourceWithRawResponse: + def __init__(self, type: TypeResource) -> None: + self._type = type + + self.get = to_raw_response_wrapper( + type.get, + ) + + +class AsyncTypeResourceWithRawResponse: + def __init__(self, type: AsyncTypeResource) -> None: + self._type = type + + self.get = async_to_raw_response_wrapper( + type.get, + ) + + +class TypeResourceWithStreamingResponse: + def __init__(self, type: TypeResource) -> None: + self._type = type + + self.get = to_streamed_response_wrapper( + type.get, + ) + + +class AsyncTypeResourceWithStreamingResponse: + def __init__(self, type: AsyncTypeResource) -> None: + self._type = type + + self.get = async_to_streamed_response_wrapper( + type.get, + ) diff --git a/src/cloudflare/resources/security_center/security_center.py b/src/cloudflare/resources/security_center/security_center.py new file mode 100644 index 00000000000..8c377cc50c2 --- /dev/null +++ b/src/cloudflare/resources/security_center/security_center.py @@ -0,0 +1,102 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from .insights.insights import ( + InsightsResource, + AsyncInsightsResource, + InsightsResourceWithRawResponse, + AsyncInsightsResourceWithRawResponse, + InsightsResourceWithStreamingResponse, + AsyncInsightsResourceWithStreamingResponse, +) + +__all__ = ["SecurityCenterResource", "AsyncSecurityCenterResource"] + + +class SecurityCenterResource(SyncAPIResource): + @cached_property + def insights(self) -> InsightsResource: + return InsightsResource(self._client) + + @cached_property + def with_raw_response(self) -> SecurityCenterResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return SecurityCenterResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> SecurityCenterResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return SecurityCenterResourceWithStreamingResponse(self) + + +class AsyncSecurityCenterResource(AsyncAPIResource): + @cached_property + def insights(self) -> AsyncInsightsResource: + return AsyncInsightsResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncSecurityCenterResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncSecurityCenterResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncSecurityCenterResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncSecurityCenterResourceWithStreamingResponse(self) + + +class SecurityCenterResourceWithRawResponse: + def __init__(self, security_center: SecurityCenterResource) -> None: + self._security_center = security_center + + @cached_property + def insights(self) -> InsightsResourceWithRawResponse: + return InsightsResourceWithRawResponse(self._security_center.insights) + + +class AsyncSecurityCenterResourceWithRawResponse: + def __init__(self, security_center: AsyncSecurityCenterResource) -> None: + self._security_center = security_center + + @cached_property + def insights(self) -> AsyncInsightsResourceWithRawResponse: + return AsyncInsightsResourceWithRawResponse(self._security_center.insights) + + +class SecurityCenterResourceWithStreamingResponse: + def __init__(self, security_center: SecurityCenterResource) -> None: + self._security_center = security_center + + @cached_property + def insights(self) -> InsightsResourceWithStreamingResponse: + return InsightsResourceWithStreamingResponse(self._security_center.insights) + + +class AsyncSecurityCenterResourceWithStreamingResponse: + def __init__(self, security_center: AsyncSecurityCenterResource) -> None: + self._security_center = security_center + + @cached_property + def insights(self) -> AsyncInsightsResourceWithStreamingResponse: + return AsyncInsightsResourceWithStreamingResponse(self._security_center.insights) diff --git a/src/cloudflare/resources/zero_trust/access/logs/__init__.py b/src/cloudflare/resources/zero_trust/access/logs/__init__.py index 7479c1fbef8..3897e836cf7 100644 --- a/src/cloudflare/resources/zero_trust/access/logs/__init__.py +++ b/src/cloudflare/resources/zero_trust/access/logs/__init__.py @@ -8,6 +8,14 @@ LogsResourceWithStreamingResponse, AsyncLogsResourceWithStreamingResponse, ) +from .scim import ( + SCIMResource, + AsyncSCIMResource, + SCIMResourceWithRawResponse, + AsyncSCIMResourceWithRawResponse, + SCIMResourceWithStreamingResponse, + AsyncSCIMResourceWithStreamingResponse, +) from .access_requests import ( AccessRequestsResource, AsyncAccessRequestsResource, @@ -24,6 +32,12 @@ "AsyncAccessRequestsResourceWithRawResponse", "AccessRequestsResourceWithStreamingResponse", "AsyncAccessRequestsResourceWithStreamingResponse", + "SCIMResource", + "AsyncSCIMResource", + "SCIMResourceWithRawResponse", + "AsyncSCIMResourceWithRawResponse", + "SCIMResourceWithStreamingResponse", + "AsyncSCIMResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/cloudflare/resources/zero_trust/access/logs/logs.py b/src/cloudflare/resources/zero_trust/access/logs/logs.py index 03a9cf3c20d..5b42a260539 100644 --- a/src/cloudflare/resources/zero_trust/access/logs/logs.py +++ b/src/cloudflare/resources/zero_trust/access/logs/logs.py @@ -2,6 +2,14 @@ from __future__ import annotations +from .scim.scim import ( + SCIMResource, + AsyncSCIMResource, + SCIMResourceWithRawResponse, + AsyncSCIMResourceWithRawResponse, + SCIMResourceWithStreamingResponse, + AsyncSCIMResourceWithStreamingResponse, +) from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource from .access_requests import ( @@ -21,6 +29,10 @@ class LogsResource(SyncAPIResource): def access_requests(self) -> AccessRequestsResource: return AccessRequestsResource(self._client) + @cached_property + def scim(self) -> SCIMResource: + return SCIMResource(self._client) + @cached_property def with_raw_response(self) -> LogsResourceWithRawResponse: """ @@ -46,6 +58,10 @@ class AsyncLogsResource(AsyncAPIResource): def access_requests(self) -> AsyncAccessRequestsResource: return AsyncAccessRequestsResource(self._client) + @cached_property + def scim(self) -> AsyncSCIMResource: + return AsyncSCIMResource(self._client) + @cached_property def with_raw_response(self) -> AsyncLogsResourceWithRawResponse: """ @@ -74,6 +90,10 @@ def __init__(self, logs: LogsResource) -> None: def access_requests(self) -> AccessRequestsResourceWithRawResponse: return AccessRequestsResourceWithRawResponse(self._logs.access_requests) + @cached_property + def scim(self) -> SCIMResourceWithRawResponse: + return SCIMResourceWithRawResponse(self._logs.scim) + class AsyncLogsResourceWithRawResponse: def __init__(self, logs: AsyncLogsResource) -> None: @@ -83,6 +103,10 @@ def __init__(self, logs: AsyncLogsResource) -> None: def access_requests(self) -> AsyncAccessRequestsResourceWithRawResponse: return AsyncAccessRequestsResourceWithRawResponse(self._logs.access_requests) + @cached_property + def scim(self) -> AsyncSCIMResourceWithRawResponse: + return AsyncSCIMResourceWithRawResponse(self._logs.scim) + class LogsResourceWithStreamingResponse: def __init__(self, logs: LogsResource) -> None: @@ -92,6 +116,10 @@ def __init__(self, logs: LogsResource) -> None: def access_requests(self) -> AccessRequestsResourceWithStreamingResponse: return AccessRequestsResourceWithStreamingResponse(self._logs.access_requests) + @cached_property + def scim(self) -> SCIMResourceWithStreamingResponse: + return SCIMResourceWithStreamingResponse(self._logs.scim) + class AsyncLogsResourceWithStreamingResponse: def __init__(self, logs: AsyncLogsResource) -> None: @@ -100,3 +128,7 @@ def __init__(self, logs: AsyncLogsResource) -> None: @cached_property def access_requests(self) -> AsyncAccessRequestsResourceWithStreamingResponse: return AsyncAccessRequestsResourceWithStreamingResponse(self._logs.access_requests) + + @cached_property + def scim(self) -> AsyncSCIMResourceWithStreamingResponse: + return AsyncSCIMResourceWithStreamingResponse(self._logs.scim) diff --git a/src/cloudflare/resources/zero_trust/access/logs/scim/__init__.py b/src/cloudflare/resources/zero_trust/access/logs/scim/__init__.py new file mode 100644 index 00000000000..3c3bf38c7a3 --- /dev/null +++ b/src/cloudflare/resources/zero_trust/access/logs/scim/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .scim import ( + SCIMResource, + AsyncSCIMResource, + SCIMResourceWithRawResponse, + AsyncSCIMResourceWithRawResponse, + SCIMResourceWithStreamingResponse, + AsyncSCIMResourceWithStreamingResponse, +) +from .updates import ( + UpdatesResource, + AsyncUpdatesResource, + UpdatesResourceWithRawResponse, + AsyncUpdatesResourceWithRawResponse, + UpdatesResourceWithStreamingResponse, + AsyncUpdatesResourceWithStreamingResponse, +) + +__all__ = [ + "UpdatesResource", + "AsyncUpdatesResource", + "UpdatesResourceWithRawResponse", + "AsyncUpdatesResourceWithRawResponse", + "UpdatesResourceWithStreamingResponse", + "AsyncUpdatesResourceWithStreamingResponse", + "SCIMResource", + "AsyncSCIMResource", + "SCIMResourceWithRawResponse", + "AsyncSCIMResourceWithRawResponse", + "SCIMResourceWithStreamingResponse", + "AsyncSCIMResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/zero_trust/access/logs/scim/scim.py b/src/cloudflare/resources/zero_trust/access/logs/scim/scim.py new file mode 100644 index 00000000000..b181c120202 --- /dev/null +++ b/src/cloudflare/resources/zero_trust/access/logs/scim/scim.py @@ -0,0 +1,102 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .updates import ( + UpdatesResource, + AsyncUpdatesResource, + UpdatesResourceWithRawResponse, + AsyncUpdatesResourceWithRawResponse, + UpdatesResourceWithStreamingResponse, + AsyncUpdatesResourceWithStreamingResponse, +) +from ......_compat import cached_property +from ......_resource import SyncAPIResource, AsyncAPIResource + +__all__ = ["SCIMResource", "AsyncSCIMResource"] + + +class SCIMResource(SyncAPIResource): + @cached_property + def updates(self) -> UpdatesResource: + return UpdatesResource(self._client) + + @cached_property + def with_raw_response(self) -> SCIMResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return SCIMResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> SCIMResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return SCIMResourceWithStreamingResponse(self) + + +class AsyncSCIMResource(AsyncAPIResource): + @cached_property + def updates(self) -> AsyncUpdatesResource: + return AsyncUpdatesResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncSCIMResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncSCIMResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncSCIMResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncSCIMResourceWithStreamingResponse(self) + + +class SCIMResourceWithRawResponse: + def __init__(self, scim: SCIMResource) -> None: + self._scim = scim + + @cached_property + def updates(self) -> UpdatesResourceWithRawResponse: + return UpdatesResourceWithRawResponse(self._scim.updates) + + +class AsyncSCIMResourceWithRawResponse: + def __init__(self, scim: AsyncSCIMResource) -> None: + self._scim = scim + + @cached_property + def updates(self) -> AsyncUpdatesResourceWithRawResponse: + return AsyncUpdatesResourceWithRawResponse(self._scim.updates) + + +class SCIMResourceWithStreamingResponse: + def __init__(self, scim: SCIMResource) -> None: + self._scim = scim + + @cached_property + def updates(self) -> UpdatesResourceWithStreamingResponse: + return UpdatesResourceWithStreamingResponse(self._scim.updates) + + +class AsyncSCIMResourceWithStreamingResponse: + def __init__(self, scim: AsyncSCIMResource) -> None: + self._scim = scim + + @cached_property + def updates(self) -> AsyncUpdatesResourceWithStreamingResponse: + return AsyncUpdatesResourceWithStreamingResponse(self._scim.updates) diff --git a/src/cloudflare/resources/zero_trust/access/logs/scim/updates.py b/src/cloudflare/resources/zero_trust/access/logs/scim/updates.py new file mode 100644 index 00000000000..6e87273a40d --- /dev/null +++ b/src/cloudflare/resources/zero_trust/access/logs/scim/updates.py @@ -0,0 +1,292 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union +from datetime import datetime +from typing_extensions import Literal + +import httpx + +from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ......_utils import maybe_transform +from ......_compat import cached_property +from ......_resource import SyncAPIResource, AsyncAPIResource +from ......_response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ......pagination import SyncSinglePage, AsyncSinglePage +from ......_base_client import AsyncPaginator, make_request_options +from ......types.zero_trust.access.logs.scim import update_list_params +from ......types.zero_trust.access.logs.scim.update_list_response import UpdateListResponse + +__all__ = ["UpdatesResource", "AsyncUpdatesResource"] + + +class UpdatesResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> UpdatesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return UpdatesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> UpdatesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return UpdatesResourceWithStreamingResponse(self) + + def list( + self, + *, + account_id: str, + idp_id: List[str], + cf_resource_id: str | NotGiven = NOT_GIVEN, + direction: Literal["desc", "asc"] | NotGiven = NOT_GIVEN, + idp_resource_id: str | NotGiven = NOT_GIVEN, + limit: int | NotGiven = NOT_GIVEN, + request_method: List[Literal["DELETE", "PATCH", "POST", "PUT"]] | NotGiven = NOT_GIVEN, + resource_group_name: str | NotGiven = NOT_GIVEN, + resource_type: List[Literal["USER", "GROUP"]] | NotGiven = NOT_GIVEN, + resource_user_email: str | NotGiven = NOT_GIVEN, + since: Union[str, datetime] | NotGiven = NOT_GIVEN, + status: List[Literal["FAILURE", "SUCCESS"]] | NotGiven = NOT_GIVEN, + until: Union[str, datetime] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncSinglePage[UpdateListResponse]: + """ + Lists Access SCIM update logs that maintain a record of updates made to User and + Group resources synced to Cloudflare via the System for Cross-domain Identity + Management (SCIM). + + Args: + account_id: Identifier + + idp_id: The unique Id of the IdP that has SCIM enabled. + + cf_resource_id: The unique Cloudflare-generated Id of the SCIM resource. + + direction: The chronological order used to sort the logs. + + idp_resource_id: The IdP-generated Id of the SCIM resource. + + limit: The maximum number of update logs to retrieve. + + request_method: The request method of the SCIM request. + + resource_group_name: The display name of the SCIM Group resource. + + resource_type: The resource type of the SCIM request. + + resource_user_email: The email address of the SCIM User resource. + + since: the timestamp of the earliest update log. + + status: The status of the SCIM request. + + until: the timestamp of the most-recent update log. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get_api_list( + f"/accounts/{account_id}/access/logs/scim/updates", + page=SyncSinglePage[UpdateListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "idp_id": idp_id, + "cf_resource_id": cf_resource_id, + "direction": direction, + "idp_resource_id": idp_resource_id, + "limit": limit, + "request_method": request_method, + "resource_group_name": resource_group_name, + "resource_type": resource_type, + "resource_user_email": resource_user_email, + "since": since, + "status": status, + "until": until, + }, + update_list_params.UpdateListParams, + ), + ), + model=UpdateListResponse, + ) + + +class AsyncUpdatesResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncUpdatesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncUpdatesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncUpdatesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncUpdatesResourceWithStreamingResponse(self) + + def list( + self, + *, + account_id: str, + idp_id: List[str], + cf_resource_id: str | NotGiven = NOT_GIVEN, + direction: Literal["desc", "asc"] | NotGiven = NOT_GIVEN, + idp_resource_id: str | NotGiven = NOT_GIVEN, + limit: int | NotGiven = NOT_GIVEN, + request_method: List[Literal["DELETE", "PATCH", "POST", "PUT"]] | NotGiven = NOT_GIVEN, + resource_group_name: str | NotGiven = NOT_GIVEN, + resource_type: List[Literal["USER", "GROUP"]] | NotGiven = NOT_GIVEN, + resource_user_email: str | NotGiven = NOT_GIVEN, + since: Union[str, datetime] | NotGiven = NOT_GIVEN, + status: List[Literal["FAILURE", "SUCCESS"]] | NotGiven = NOT_GIVEN, + until: Union[str, datetime] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[UpdateListResponse, AsyncSinglePage[UpdateListResponse]]: + """ + Lists Access SCIM update logs that maintain a record of updates made to User and + Group resources synced to Cloudflare via the System for Cross-domain Identity + Management (SCIM). + + Args: + account_id: Identifier + + idp_id: The unique Id of the IdP that has SCIM enabled. + + cf_resource_id: The unique Cloudflare-generated Id of the SCIM resource. + + direction: The chronological order used to sort the logs. + + idp_resource_id: The IdP-generated Id of the SCIM resource. + + limit: The maximum number of update logs to retrieve. + + request_method: The request method of the SCIM request. + + resource_group_name: The display name of the SCIM Group resource. + + resource_type: The resource type of the SCIM request. + + resource_user_email: The email address of the SCIM User resource. + + since: the timestamp of the earliest update log. + + status: The status of the SCIM request. + + until: the timestamp of the most-recent update log. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get_api_list( + f"/accounts/{account_id}/access/logs/scim/updates", + page=AsyncSinglePage[UpdateListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "idp_id": idp_id, + "cf_resource_id": cf_resource_id, + "direction": direction, + "idp_resource_id": idp_resource_id, + "limit": limit, + "request_method": request_method, + "resource_group_name": resource_group_name, + "resource_type": resource_type, + "resource_user_email": resource_user_email, + "since": since, + "status": status, + "until": until, + }, + update_list_params.UpdateListParams, + ), + ), + model=UpdateListResponse, + ) + + +class UpdatesResourceWithRawResponse: + def __init__(self, updates: UpdatesResource) -> None: + self._updates = updates + + self.list = to_raw_response_wrapper( + updates.list, + ) + + +class AsyncUpdatesResourceWithRawResponse: + def __init__(self, updates: AsyncUpdatesResource) -> None: + self._updates = updates + + self.list = async_to_raw_response_wrapper( + updates.list, + ) + + +class UpdatesResourceWithStreamingResponse: + def __init__(self, updates: UpdatesResource) -> None: + self._updates = updates + + self.list = to_streamed_response_wrapper( + updates.list, + ) + + +class AsyncUpdatesResourceWithStreamingResponse: + def __init__(self, updates: AsyncUpdatesResource) -> None: + self._updates = updates + + self.list = async_to_streamed_response_wrapper( + updates.list, + ) diff --git a/src/cloudflare/resources/zero_trust/identity_providers/__init__.py b/src/cloudflare/resources/zero_trust/identity_providers/__init__.py new file mode 100644 index 00000000000..f35232c2d5c --- /dev/null +++ b/src/cloudflare/resources/zero_trust/identity_providers/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .scim import ( + SCIMResource, + AsyncSCIMResource, + SCIMResourceWithRawResponse, + AsyncSCIMResourceWithRawResponse, + SCIMResourceWithStreamingResponse, + AsyncSCIMResourceWithStreamingResponse, +) +from .identity_providers import ( + IdentityProvidersResource, + AsyncIdentityProvidersResource, + IdentityProvidersResourceWithRawResponse, + AsyncIdentityProvidersResourceWithRawResponse, + IdentityProvidersResourceWithStreamingResponse, + AsyncIdentityProvidersResourceWithStreamingResponse, +) + +__all__ = [ + "SCIMResource", + "AsyncSCIMResource", + "SCIMResourceWithRawResponse", + "AsyncSCIMResourceWithRawResponse", + "SCIMResourceWithStreamingResponse", + "AsyncSCIMResourceWithStreamingResponse", + "IdentityProvidersResource", + "AsyncIdentityProvidersResource", + "IdentityProvidersResourceWithRawResponse", + "AsyncIdentityProvidersResourceWithRawResponse", + "IdentityProvidersResourceWithStreamingResponse", + "AsyncIdentityProvidersResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/zero_trust/identity_providers.py b/src/cloudflare/resources/zero_trust/identity_providers/identity_providers.py similarity index 98% rename from src/cloudflare/resources/zero_trust/identity_providers.py rename to src/cloudflare/resources/zero_trust/identity_providers/identity_providers.py index a0cbd6d01e3..9436efa689e 100644 --- a/src/cloudflare/resources/zero_trust/identity_providers.py +++ b/src/cloudflare/resources/zero_trust/identity_providers/identity_providers.py @@ -7,40 +7,52 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( required_args, maybe_transform, async_maybe_transform, ) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( +from .scim.scim import ( + SCIMResource, + AsyncSCIMResource, + SCIMResourceWithRawResponse, + AsyncSCIMResourceWithRawResponse, + SCIMResourceWithStreamingResponse, + AsyncSCIMResourceWithStreamingResponse, +) +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._wrappers import ResultWrapper -from ...pagination import SyncSinglePage, AsyncSinglePage -from ..._base_client import AsyncPaginator, make_request_options -from ...types.zero_trust import ( +from ...._wrappers import ResultWrapper +from ....pagination import SyncSinglePage, AsyncSinglePage +from ...._base_client import AsyncPaginator, make_request_options +from ....types.zero_trust import ( IdentityProviderType, identity_provider_list_params, identity_provider_create_params, identity_provider_update_params, ) -from ...types.zero_trust.identity_provider import IdentityProvider -from ...types.zero_trust.identity_provider_type import IdentityProviderType -from ...types.zero_trust.generic_oauth_config_param import GenericOAuthConfigParam -from ...types.zero_trust.identity_provider_list_response import IdentityProviderListResponse -from ...types.zero_trust.identity_provider_delete_response import IdentityProviderDeleteResponse -from ...types.zero_trust.identity_provider_scim_config_param import IdentityProviderSCIMConfigParam +from ....types.zero_trust.identity_provider import IdentityProvider +from ....types.zero_trust.identity_provider_type import IdentityProviderType +from ....types.zero_trust.generic_oauth_config_param import GenericOAuthConfigParam +from ....types.zero_trust.identity_provider_list_response import IdentityProviderListResponse +from ....types.zero_trust.identity_provider_delete_response import IdentityProviderDeleteResponse +from ....types.zero_trust.identity_provider_scim_config_param import IdentityProviderSCIMConfigParam __all__ = ["IdentityProvidersResource", "AsyncIdentityProvidersResource"] class IdentityProvidersResource(SyncAPIResource): + @cached_property + def scim(self) -> SCIMResource: + return SCIMResource(self._client) + @cached_property def with_raw_response(self) -> IdentityProvidersResourceWithRawResponse: """ @@ -1767,6 +1779,10 @@ def get( class AsyncIdentityProvidersResource(AsyncAPIResource): + @cached_property + def scim(self) -> AsyncSCIMResource: + return AsyncSCIMResource(self._client) + @cached_property def with_raw_response(self) -> AsyncIdentityProvidersResourceWithRawResponse: """ @@ -3512,6 +3528,10 @@ def __init__(self, identity_providers: IdentityProvidersResource) -> None: identity_providers.get, ) + @cached_property + def scim(self) -> SCIMResourceWithRawResponse: + return SCIMResourceWithRawResponse(self._identity_providers.scim) + class AsyncIdentityProvidersResourceWithRawResponse: def __init__(self, identity_providers: AsyncIdentityProvidersResource) -> None: @@ -3533,6 +3553,10 @@ def __init__(self, identity_providers: AsyncIdentityProvidersResource) -> None: identity_providers.get, ) + @cached_property + def scim(self) -> AsyncSCIMResourceWithRawResponse: + return AsyncSCIMResourceWithRawResponse(self._identity_providers.scim) + class IdentityProvidersResourceWithStreamingResponse: def __init__(self, identity_providers: IdentityProvidersResource) -> None: @@ -3554,6 +3578,10 @@ def __init__(self, identity_providers: IdentityProvidersResource) -> None: identity_providers.get, ) + @cached_property + def scim(self) -> SCIMResourceWithStreamingResponse: + return SCIMResourceWithStreamingResponse(self._identity_providers.scim) + class AsyncIdentityProvidersResourceWithStreamingResponse: def __init__(self, identity_providers: AsyncIdentityProvidersResource) -> None: @@ -3574,3 +3602,7 @@ def __init__(self, identity_providers: AsyncIdentityProvidersResource) -> None: self.get = async_to_streamed_response_wrapper( identity_providers.get, ) + + @cached_property + def scim(self) -> AsyncSCIMResourceWithStreamingResponse: + return AsyncSCIMResourceWithStreamingResponse(self._identity_providers.scim) diff --git a/src/cloudflare/resources/zero_trust/identity_providers/scim/__init__.py b/src/cloudflare/resources/zero_trust/identity_providers/scim/__init__.py new file mode 100644 index 00000000000..187a6e97d8e --- /dev/null +++ b/src/cloudflare/resources/zero_trust/identity_providers/scim/__init__.py @@ -0,0 +1,47 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .scim import ( + SCIMResource, + AsyncSCIMResource, + SCIMResourceWithRawResponse, + AsyncSCIMResourceWithRawResponse, + SCIMResourceWithStreamingResponse, + AsyncSCIMResourceWithStreamingResponse, +) +from .users import ( + UsersResource, + AsyncUsersResource, + UsersResourceWithRawResponse, + AsyncUsersResourceWithRawResponse, + UsersResourceWithStreamingResponse, + AsyncUsersResourceWithStreamingResponse, +) +from .groups import ( + GroupsResource, + AsyncGroupsResource, + GroupsResourceWithRawResponse, + AsyncGroupsResourceWithRawResponse, + GroupsResourceWithStreamingResponse, + AsyncGroupsResourceWithStreamingResponse, +) + +__all__ = [ + "GroupsResource", + "AsyncGroupsResource", + "GroupsResourceWithRawResponse", + "AsyncGroupsResourceWithRawResponse", + "GroupsResourceWithStreamingResponse", + "AsyncGroupsResourceWithStreamingResponse", + "UsersResource", + "AsyncUsersResource", + "UsersResourceWithRawResponse", + "AsyncUsersResourceWithRawResponse", + "UsersResourceWithStreamingResponse", + "AsyncUsersResourceWithStreamingResponse", + "SCIMResource", + "AsyncSCIMResource", + "SCIMResourceWithRawResponse", + "AsyncSCIMResourceWithRawResponse", + "SCIMResourceWithStreamingResponse", + "AsyncSCIMResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/zero_trust/identity_providers/scim/groups.py b/src/cloudflare/resources/zero_trust/identity_providers/scim/groups.py new file mode 100644 index 00000000000..6ade1551ad1 --- /dev/null +++ b/src/cloudflare/resources/zero_trust/identity_providers/scim/groups.py @@ -0,0 +1,232 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._utils import maybe_transform +from ....._compat import cached_property +from ....._resource import SyncAPIResource, AsyncAPIResource +from ....._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .....pagination import SyncSinglePage, AsyncSinglePage +from ....._base_client import AsyncPaginator, make_request_options +from .....types.zero_trust.access.zero_trust_group import ZeroTrustGroup +from .....types.zero_trust.identity_providers.scim import group_list_params + +__all__ = ["GroupsResource", "AsyncGroupsResource"] + + +class GroupsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> GroupsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return GroupsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> GroupsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return GroupsResourceWithStreamingResponse(self) + + def list( + self, + identity_provider_id: str, + *, + account_id: str, + cf_resource_id: str | NotGiven = NOT_GIVEN, + idp_resource_id: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncSinglePage[ZeroTrustGroup]: + """ + Lists SCIM Group resources synced to Cloudflare via the System for Cross-domain + Identity Management (SCIM). + + Args: + account_id: Identifier + + identity_provider_id: UUID + + cf_resource_id: The unique Cloudflare-generated Id of the SCIM Group resource; also known as the + "Id". + + idp_resource_id: The IdP-generated Id of the SCIM Group resource; also known as the "external + Id". + + name: The display name of the SCIM Group resource. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not identity_provider_id: + raise ValueError( + f"Expected a non-empty value for `identity_provider_id` but received {identity_provider_id!r}" + ) + return self._get_api_list( + f"/accounts/{account_id}/access/identity_providers/{identity_provider_id}/scim/groups", + page=SyncSinglePage[ZeroTrustGroup], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "cf_resource_id": cf_resource_id, + "idp_resource_id": idp_resource_id, + "name": name, + }, + group_list_params.GroupListParams, + ), + ), + model=ZeroTrustGroup, + ) + + +class AsyncGroupsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncGroupsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncGroupsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncGroupsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncGroupsResourceWithStreamingResponse(self) + + def list( + self, + identity_provider_id: str, + *, + account_id: str, + cf_resource_id: str | NotGiven = NOT_GIVEN, + idp_resource_id: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[ZeroTrustGroup, AsyncSinglePage[ZeroTrustGroup]]: + """ + Lists SCIM Group resources synced to Cloudflare via the System for Cross-domain + Identity Management (SCIM). + + Args: + account_id: Identifier + + identity_provider_id: UUID + + cf_resource_id: The unique Cloudflare-generated Id of the SCIM Group resource; also known as the + "Id". + + idp_resource_id: The IdP-generated Id of the SCIM Group resource; also known as the "external + Id". + + name: The display name of the SCIM Group resource. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not identity_provider_id: + raise ValueError( + f"Expected a non-empty value for `identity_provider_id` but received {identity_provider_id!r}" + ) + return self._get_api_list( + f"/accounts/{account_id}/access/identity_providers/{identity_provider_id}/scim/groups", + page=AsyncSinglePage[ZeroTrustGroup], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "cf_resource_id": cf_resource_id, + "idp_resource_id": idp_resource_id, + "name": name, + }, + group_list_params.GroupListParams, + ), + ), + model=ZeroTrustGroup, + ) + + +class GroupsResourceWithRawResponse: + def __init__(self, groups: GroupsResource) -> None: + self._groups = groups + + self.list = to_raw_response_wrapper( + groups.list, + ) + + +class AsyncGroupsResourceWithRawResponse: + def __init__(self, groups: AsyncGroupsResource) -> None: + self._groups = groups + + self.list = async_to_raw_response_wrapper( + groups.list, + ) + + +class GroupsResourceWithStreamingResponse: + def __init__(self, groups: GroupsResource) -> None: + self._groups = groups + + self.list = to_streamed_response_wrapper( + groups.list, + ) + + +class AsyncGroupsResourceWithStreamingResponse: + def __init__(self, groups: AsyncGroupsResource) -> None: + self._groups = groups + + self.list = async_to_streamed_response_wrapper( + groups.list, + ) diff --git a/src/cloudflare/resources/zero_trust/identity_providers/scim/scim.py b/src/cloudflare/resources/zero_trust/identity_providers/scim/scim.py new file mode 100644 index 00000000000..2ad46a7e9e8 --- /dev/null +++ b/src/cloudflare/resources/zero_trust/identity_providers/scim/scim.py @@ -0,0 +1,134 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .users import ( + UsersResource, + AsyncUsersResource, + UsersResourceWithRawResponse, + AsyncUsersResourceWithRawResponse, + UsersResourceWithStreamingResponse, + AsyncUsersResourceWithStreamingResponse, +) +from .groups import ( + GroupsResource, + AsyncGroupsResource, + GroupsResourceWithRawResponse, + AsyncGroupsResourceWithRawResponse, + GroupsResourceWithStreamingResponse, + AsyncGroupsResourceWithStreamingResponse, +) +from ....._compat import cached_property +from ....._resource import SyncAPIResource, AsyncAPIResource + +__all__ = ["SCIMResource", "AsyncSCIMResource"] + + +class SCIMResource(SyncAPIResource): + @cached_property + def groups(self) -> GroupsResource: + return GroupsResource(self._client) + + @cached_property + def users(self) -> UsersResource: + return UsersResource(self._client) + + @cached_property + def with_raw_response(self) -> SCIMResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return SCIMResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> SCIMResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return SCIMResourceWithStreamingResponse(self) + + +class AsyncSCIMResource(AsyncAPIResource): + @cached_property + def groups(self) -> AsyncGroupsResource: + return AsyncGroupsResource(self._client) + + @cached_property + def users(self) -> AsyncUsersResource: + return AsyncUsersResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncSCIMResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncSCIMResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncSCIMResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncSCIMResourceWithStreamingResponse(self) + + +class SCIMResourceWithRawResponse: + def __init__(self, scim: SCIMResource) -> None: + self._scim = scim + + @cached_property + def groups(self) -> GroupsResourceWithRawResponse: + return GroupsResourceWithRawResponse(self._scim.groups) + + @cached_property + def users(self) -> UsersResourceWithRawResponse: + return UsersResourceWithRawResponse(self._scim.users) + + +class AsyncSCIMResourceWithRawResponse: + def __init__(self, scim: AsyncSCIMResource) -> None: + self._scim = scim + + @cached_property + def groups(self) -> AsyncGroupsResourceWithRawResponse: + return AsyncGroupsResourceWithRawResponse(self._scim.groups) + + @cached_property + def users(self) -> AsyncUsersResourceWithRawResponse: + return AsyncUsersResourceWithRawResponse(self._scim.users) + + +class SCIMResourceWithStreamingResponse: + def __init__(self, scim: SCIMResource) -> None: + self._scim = scim + + @cached_property + def groups(self) -> GroupsResourceWithStreamingResponse: + return GroupsResourceWithStreamingResponse(self._scim.groups) + + @cached_property + def users(self) -> UsersResourceWithStreamingResponse: + return UsersResourceWithStreamingResponse(self._scim.users) + + +class AsyncSCIMResourceWithStreamingResponse: + def __init__(self, scim: AsyncSCIMResource) -> None: + self._scim = scim + + @cached_property + def groups(self) -> AsyncGroupsResourceWithStreamingResponse: + return AsyncGroupsResourceWithStreamingResponse(self._scim.groups) + + @cached_property + def users(self) -> AsyncUsersResourceWithStreamingResponse: + return AsyncUsersResourceWithStreamingResponse(self._scim.users) diff --git a/src/cloudflare/resources/zero_trust/identity_providers/scim/users.py b/src/cloudflare/resources/zero_trust/identity_providers/scim/users.py new file mode 100644 index 00000000000..4fafba5c593 --- /dev/null +++ b/src/cloudflare/resources/zero_trust/identity_providers/scim/users.py @@ -0,0 +1,246 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._utils import maybe_transform +from ....._compat import cached_property +from ....._resource import SyncAPIResource, AsyncAPIResource +from ....._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .....pagination import SyncSinglePage, AsyncSinglePage +from ....._base_client import AsyncPaginator, make_request_options +from .....types.zero_trust.access.access_user import AccessUser +from .....types.zero_trust.identity_providers.scim import user_list_params + +__all__ = ["UsersResource", "AsyncUsersResource"] + + +class UsersResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> UsersResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return UsersResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> UsersResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return UsersResourceWithStreamingResponse(self) + + def list( + self, + identity_provider_id: str, + *, + account_id: str, + cf_resource_id: str | NotGiven = NOT_GIVEN, + email: str | NotGiven = NOT_GIVEN, + idp_resource_id: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + username: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncSinglePage[AccessUser]: + """ + Lists SCIM User resources synced to Cloudflare via the System for Cross-domain + Identity Management (SCIM). + + Args: + account_id: Identifier + + identity_provider_id: UUID + + cf_resource_id: The unique Cloudflare-generated Id of the SCIM User resource; also known as the + "Id". + + email: The email address of the SCIM User resource. + + idp_resource_id: The IdP-generated Id of the SCIM User resource; also known as the "external Id". + + name: The name of the SCIM User resource. + + username: The username of the SCIM User resource. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not identity_provider_id: + raise ValueError( + f"Expected a non-empty value for `identity_provider_id` but received {identity_provider_id!r}" + ) + return self._get_api_list( + f"/accounts/{account_id}/access/identity_providers/{identity_provider_id}/scim/users", + page=SyncSinglePage[AccessUser], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "cf_resource_id": cf_resource_id, + "email": email, + "idp_resource_id": idp_resource_id, + "name": name, + "username": username, + }, + user_list_params.UserListParams, + ), + ), + model=AccessUser, + ) + + +class AsyncUsersResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncUsersResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncUsersResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncUsersResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncUsersResourceWithStreamingResponse(self) + + def list( + self, + identity_provider_id: str, + *, + account_id: str, + cf_resource_id: str | NotGiven = NOT_GIVEN, + email: str | NotGiven = NOT_GIVEN, + idp_resource_id: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + username: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[AccessUser, AsyncSinglePage[AccessUser]]: + """ + Lists SCIM User resources synced to Cloudflare via the System for Cross-domain + Identity Management (SCIM). + + Args: + account_id: Identifier + + identity_provider_id: UUID + + cf_resource_id: The unique Cloudflare-generated Id of the SCIM User resource; also known as the + "Id". + + email: The email address of the SCIM User resource. + + idp_resource_id: The IdP-generated Id of the SCIM User resource; also known as the "external Id". + + name: The name of the SCIM User resource. + + username: The username of the SCIM User resource. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not identity_provider_id: + raise ValueError( + f"Expected a non-empty value for `identity_provider_id` but received {identity_provider_id!r}" + ) + return self._get_api_list( + f"/accounts/{account_id}/access/identity_providers/{identity_provider_id}/scim/users", + page=AsyncSinglePage[AccessUser], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "cf_resource_id": cf_resource_id, + "email": email, + "idp_resource_id": idp_resource_id, + "name": name, + "username": username, + }, + user_list_params.UserListParams, + ), + ), + model=AccessUser, + ) + + +class UsersResourceWithRawResponse: + def __init__(self, users: UsersResource) -> None: + self._users = users + + self.list = to_raw_response_wrapper( + users.list, + ) + + +class AsyncUsersResourceWithRawResponse: + def __init__(self, users: AsyncUsersResource) -> None: + self._users = users + + self.list = async_to_raw_response_wrapper( + users.list, + ) + + +class UsersResourceWithStreamingResponse: + def __init__(self, users: UsersResource) -> None: + self._users = users + + self.list = to_streamed_response_wrapper( + users.list, + ) + + +class AsyncUsersResourceWithStreamingResponse: + def __init__(self, users: AsyncUsersResource) -> None: + self._users = users + + self.list = async_to_streamed_response_wrapper( + users.list, + ) diff --git a/src/cloudflare/resources/zero_trust/zero_trust.py b/src/cloudflare/resources/zero_trust/zero_trust.py index 5ebc4ff16ee..a8de3d6cb8b 100644 --- a/src/cloudflare/resources/zero_trust/zero_trust.py +++ b/src/cloudflare/resources/zero_trust/zero_trust.py @@ -68,14 +68,6 @@ NetworksResourceWithStreamingResponse, AsyncNetworksResourceWithStreamingResponse, ) -from .identity_providers import ( - IdentityProvidersResource, - AsyncIdentityProvidersResource, - IdentityProvidersResourceWithRawResponse, - AsyncIdentityProvidersResourceWithRawResponse, - IdentityProvidersResourceWithStreamingResponse, - AsyncIdentityProvidersResourceWithStreamingResponse, -) from .connectivity_settings import ( ConnectivitySettingsResource, AsyncConnectivitySettingsResource, @@ -100,6 +92,14 @@ OrganizationsResourceWithStreamingResponse, AsyncOrganizationsResourceWithStreamingResponse, ) +from .identity_providers.identity_providers import ( + IdentityProvidersResource, + AsyncIdentityProvidersResource, + IdentityProvidersResourceWithRawResponse, + AsyncIdentityProvidersResourceWithRawResponse, + IdentityProvidersResourceWithStreamingResponse, + AsyncIdentityProvidersResourceWithStreamingResponse, +) __all__ = ["ZeroTrustResource", "AsyncZeroTrustResource"] diff --git a/src/cloudflare/types/custom_hostnames/certificate_pack/__init__.py b/src/cloudflare/types/custom_hostnames/certificate_pack/__init__.py new file mode 100644 index 00000000000..f5f692ca02a --- /dev/null +++ b/src/cloudflare/types/custom_hostnames/certificate_pack/__init__.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .certificate_update_params import CertificateUpdateParams as CertificateUpdateParams +from .certificate_delete_response import CertificateDeleteResponse as CertificateDeleteResponse +from .certificate_update_response import CertificateUpdateResponse as CertificateUpdateResponse diff --git a/src/cloudflare/types/custom_hostnames/certificate_pack/certificate_delete_response.py b/src/cloudflare/types/custom_hostnames/certificate_pack/certificate_delete_response.py new file mode 100644 index 00000000000..39bb658e6ad --- /dev/null +++ b/src/cloudflare/types/custom_hostnames/certificate_pack/certificate_delete_response.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["CertificateDeleteResponse"] + + +class CertificateDeleteResponse(BaseModel): + id: Optional[str] = None + """Identifier""" diff --git a/src/cloudflare/types/custom_hostnames/certificate_pack/certificate_update_params.py b/src/cloudflare/types/custom_hostnames/certificate_pack/certificate_update_params.py new file mode 100644 index 00000000000..1375e353493 --- /dev/null +++ b/src/cloudflare/types/custom_hostnames/certificate_pack/certificate_update_params.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["CertificateUpdateParams"] + + +class CertificateUpdateParams(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + custom_hostname_id: Required[str] + """Identifier""" + + certificate_pack_id: Required[str] + """Identifier""" + + custom_certificate: Required[str] + """If a custom uploaded certificate is used.""" + + custom_key: Required[str] + """The key for a custom uploaded certificate.""" diff --git a/src/cloudflare/types/custom_hostnames/certificate_pack/certificate_update_response.py b/src/cloudflare/types/custom_hostnames/certificate_pack/certificate_update_response.py new file mode 100644 index 00000000000..925381fec01 --- /dev/null +++ b/src/cloudflare/types/custom_hostnames/certificate_pack/certificate_update_response.py @@ -0,0 +1,257 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Optional +from datetime import datetime +from typing_extensions import Literal + +from ...._models import BaseModel +from ..dcv_method import DCVMethod +from ..bundle_method import BundleMethod +from ...shared.certificate_ca import CertificateCA +from ..domain_validation_type import DomainValidationType + +__all__ = [ + "CertificateUpdateResponse", + "SSL", + "SSLSettings", + "SSLValidationError", + "SSLValidationRecord", + "OwnershipVerification", + "OwnershipVerificationHTTP", +] + + +class SSLSettings(BaseModel): + ciphers: Optional[List[str]] = None + """An allowlist of ciphers for TLS termination. + + These ciphers must be in the BoringSSL format. + """ + + early_hints: Optional[Literal["on", "off"]] = None + """Whether or not Early Hints is enabled.""" + + http2: Optional[Literal["on", "off"]] = None + """Whether or not HTTP2 is enabled.""" + + min_tls_version: Optional[Literal["1.0", "1.1", "1.2", "1.3"]] = None + """The minimum TLS version supported.""" + + tls_1_3: Optional[Literal["on", "off"]] = None + """Whether or not TLS 1.3 is enabled.""" + + +class SSLValidationError(BaseModel): + message: Optional[str] = None + """A domain validation error.""" + + +class SSLValidationRecord(BaseModel): + emails: Optional[List[str]] = None + """ + The set of email addresses that the certificate authority (CA) will use to + complete domain validation. + """ + + http_body: Optional[str] = None + """ + The content that the certificate authority (CA) will expect to find at the + http_url during the domain validation. + """ + + http_url: Optional[str] = None + """The url that will be checked during domain validation.""" + + txt_name: Optional[str] = None + """ + The hostname that the certificate authority (CA) will check for a TXT record + during domain validation . + """ + + txt_value: Optional[str] = None + """ + The TXT record that the certificate authority (CA) will check during domain + validation. + """ + + +class SSL(BaseModel): + id: Optional[str] = None + """Custom hostname SSL identifier tag.""" + + bundle_method: Optional[BundleMethod] = None + """ + A ubiquitous bundle has the highest probability of being verified everywhere, + even by clients using outdated or unusual trust stores. An optimal bundle uses + the shortest chain and newest intermediates. And the force bundle verifies the + chain, but does not otherwise modify it. + """ + + certificate_authority: Optional[CertificateCA] = None + """The Certificate Authority that will issue the certificate""" + + custom_certificate: Optional[str] = None + """If a custom uploaded certificate is used.""" + + custom_csr_id: Optional[str] = None + """The identifier for the Custom CSR that was used.""" + + custom_key: Optional[str] = None + """The key for a custom uploaded certificate.""" + + expires_on: Optional[datetime] = None + """The time the custom certificate expires on.""" + + hosts: Optional[List[str]] = None + """A list of Hostnames on a custom uploaded certificate.""" + + issuer: Optional[str] = None + """The issuer on a custom uploaded certificate.""" + + method: Optional[DCVMethod] = None + """Domain control validation (DCV) method used for this hostname.""" + + serial_number: Optional[str] = None + """The serial number on a custom uploaded certificate.""" + + settings: Optional[SSLSettings] = None + + signature: Optional[str] = None + """The signature on a custom uploaded certificate.""" + + status: Optional[ + Literal[ + "initializing", + "pending_validation", + "deleted", + "pending_issuance", + "pending_deployment", + "pending_deletion", + "pending_expiration", + "expired", + "active", + "initializing_timed_out", + "validation_timed_out", + "issuance_timed_out", + "deployment_timed_out", + "deletion_timed_out", + "pending_cleanup", + "staging_deployment", + "staging_active", + "deactivating", + "inactive", + "backup_issued", + "holding_deployment", + ] + ] = None + """Status of the hostname's SSL certificates.""" + + type: Optional[DomainValidationType] = None + """Level of validation to be used for this hostname. + + Domain validation (dv) must be used. + """ + + uploaded_on: Optional[datetime] = None + """The time the custom certificate was uploaded.""" + + validation_errors: Optional[List[SSLValidationError]] = None + """ + Domain validation errors that have been received by the certificate authority + (CA). + """ + + validation_records: Optional[List[SSLValidationRecord]] = None + + wildcard: Optional[bool] = None + """Indicates whether the certificate covers a wildcard.""" + + +class OwnershipVerification(BaseModel): + name: Optional[str] = None + """DNS Name for record.""" + + type: Optional[Literal["txt"]] = None + """DNS Record type.""" + + value: Optional[str] = None + """Content for the record.""" + + +class OwnershipVerificationHTTP(BaseModel): + http_body: Optional[str] = None + """Token to be served.""" + + http_url: Optional[str] = None + """ + The HTTP URL that will be checked during custom hostname verification and where + the customer should host the token. + """ + + +class CertificateUpdateResponse(BaseModel): + id: str + """Identifier""" + + hostname: str + """The custom hostname that will point to your hostname via CNAME.""" + + ssl: SSL + + created_at: Optional[datetime] = None + """This is the time the hostname was created.""" + + custom_metadata: Optional[Dict[str, str]] = None + """Unique key/value metadata for this hostname. + + These are per-hostname (customer) settings. + """ + + custom_origin_server: Optional[str] = None + """ + a valid hostname that’s been added to your DNS zone as an A, AAAA, or CNAME + record. + """ + + custom_origin_sni: Optional[str] = None + """ + A hostname that will be sent to your custom origin server as SNI for TLS + handshake. This can be a valid subdomain of the zone or custom origin server + name or the string ':request_host_header:' which will cause the host header in + the request to be used as SNI. Not configurable with default/fallback origin + server. + """ + + ownership_verification: Optional[OwnershipVerification] = None + """This is a record which can be placed to activate a hostname.""" + + ownership_verification_http: Optional[OwnershipVerificationHTTP] = None + """ + This presents the token to be served by the given http url to activate a + hostname. + """ + + status: Optional[ + Literal[ + "active", + "pending", + "active_redeploying", + "moved", + "pending_deletion", + "deleted", + "pending_blocked", + "pending_migration", + "pending_provisioned", + "test_pending", + "test_active", + "test_active_apex", + "test_blocked", + "test_failed", + "provisioned", + "blocked", + ] + ] = None + """Status of the hostname's activation.""" + + verification_errors: Optional[List[str]] = None + """These are errors that were encountered while trying to activate a hostname.""" diff --git a/src/cloudflare/types/r2/buckets/__init__.py b/src/cloudflare/types/r2/buckets/__init__.py index 099dd207b74..54d849cf9ef 100644 --- a/src/cloudflare/types/r2/buckets/__init__.py +++ b/src/cloudflare/types/r2/buckets/__init__.py @@ -5,8 +5,11 @@ from .sippy import Sippy as Sippy from .provider import Provider as Provider from .cors_get_response import CORSGetResponse as CORSGetResponse +from .lock_get_response import LockGetResponse as LockGetResponse from .cors_update_params import CORSUpdateParams as CORSUpdateParams +from .lock_update_params import LockUpdateParams as LockUpdateParams from .sippy_update_params import SippyUpdateParams as SippyUpdateParams +from .metric_list_response import MetricListResponse as MetricListResponse from .sippy_delete_response import SippyDeleteResponse as SippyDeleteResponse from .lifecycle_get_response import LifecycleGetResponse as LifecycleGetResponse from .lifecycle_update_params import LifecycleUpdateParams as LifecycleUpdateParams diff --git a/src/cloudflare/types/r2/buckets/lock_get_response.py b/src/cloudflare/types/r2/buckets/lock_get_response.py new file mode 100644 index 00000000000..6749240330c --- /dev/null +++ b/src/cloudflare/types/r2/buckets/lock_get_response.py @@ -0,0 +1,62 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import datetime +from typing import List, Union, Optional +from typing_extensions import Literal, TypeAlias + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = [ + "LockGetResponse", + "Rule", + "RuleCondition", + "RuleConditionR2LockRuleAgeCondition", + "RuleConditionR2LockRuleDateCondition", + "RuleConditionR2LockRuleIndefiniteCondition", +] + + +class RuleConditionR2LockRuleAgeCondition(BaseModel): + max_age_seconds: int = FieldInfo(alias="maxAgeSeconds") + + type: Literal["Age"] + + +class RuleConditionR2LockRuleDateCondition(BaseModel): + date: datetime.date + + type: Literal["Date"] + + +class RuleConditionR2LockRuleIndefiniteCondition(BaseModel): + type: Literal["Indefinite"] + + +RuleCondition: TypeAlias = Union[ + RuleConditionR2LockRuleAgeCondition, + RuleConditionR2LockRuleDateCondition, + RuleConditionR2LockRuleIndefiniteCondition, +] + + +class Rule(BaseModel): + id: str + """Unique identifier for this rule""" + + condition: RuleCondition + """Condition to apply a lock rule to an object for how long in seconds""" + + enabled: bool + """Whether or not this rule is in effect""" + + prefix: Optional[str] = None + """ + Rule will only apply to objects/uploads in the bucket that start with the given + prefix, an empty prefix can be provided to scope rule to all objects/uploads + """ + + +class LockGetResponse(BaseModel): + rules: Optional[List[Rule]] = None diff --git a/src/cloudflare/types/r2/buckets/lock_update_params.py b/src/cloudflare/types/r2/buckets/lock_update_params.py new file mode 100644 index 00000000000..17329b04fd7 --- /dev/null +++ b/src/cloudflare/types/r2/buckets/lock_update_params.py @@ -0,0 +1,68 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import datetime +from typing import Union, Iterable +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict + +from ...._utils import PropertyInfo + +__all__ = [ + "LockUpdateParams", + "Rule", + "RuleCondition", + "RuleConditionR2LockRuleAgeCondition", + "RuleConditionR2LockRuleDateCondition", + "RuleConditionR2LockRuleIndefiniteCondition", +] + + +class LockUpdateParams(TypedDict, total=False): + account_id: Required[str] + """Account ID""" + + rules: Iterable[Rule] + + jurisdiction: Annotated[Literal["default", "eu", "fedramp"], PropertyInfo(alias="cf-r2-jurisdiction")] + """The bucket jurisdiction""" + + +class RuleConditionR2LockRuleAgeCondition(TypedDict, total=False): + max_age_seconds: Required[Annotated[int, PropertyInfo(alias="maxAgeSeconds")]] + + type: Required[Literal["Age"]] + + +class RuleConditionR2LockRuleDateCondition(TypedDict, total=False): + date: Required[Annotated[Union[str, datetime.date], PropertyInfo(format="iso8601")]] + + type: Required[Literal["Date"]] + + +class RuleConditionR2LockRuleIndefiniteCondition(TypedDict, total=False): + type: Required[Literal["Indefinite"]] + + +RuleCondition: TypeAlias = Union[ + RuleConditionR2LockRuleAgeCondition, + RuleConditionR2LockRuleDateCondition, + RuleConditionR2LockRuleIndefiniteCondition, +] + + +class Rule(TypedDict, total=False): + id: Required[str] + """Unique identifier for this rule""" + + condition: Required[RuleCondition] + """Condition to apply a lock rule to an object for how long in seconds""" + + enabled: Required[bool] + """Whether or not this rule is in effect""" + + prefix: str + """ + Rule will only apply to objects/uploads in the bucket that start with the given + prefix, an empty prefix can be provided to scope rule to all objects/uploads + """ diff --git a/src/cloudflare/types/r2/buckets/metric_list_response.py b/src/cloudflare/types/r2/buckets/metric_list_response.py new file mode 100644 index 00000000000..2abd0a2dfb0 --- /dev/null +++ b/src/cloudflare/types/r2/buckets/metric_list_response.py @@ -0,0 +1,85 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = [ + "MetricListResponse", + "InfrequentAccess", + "InfrequentAccessPublished", + "InfrequentAccessUploaded", + "Standard", + "StandardPublished", + "StandardUploaded", +] + + +class InfrequentAccessPublished(BaseModel): + metadata_size: Optional[float] = FieldInfo(alias="metadataSize", default=None) + """Amount of""" + + objects: Optional[float] = None + """Number of objects stored""" + + payload_size: Optional[float] = FieldInfo(alias="payloadSize", default=None) + """Amount of storage used by object data""" + + +class InfrequentAccessUploaded(BaseModel): + metadata_size: Optional[float] = FieldInfo(alias="metadataSize", default=None) + """Amount of""" + + objects: Optional[float] = None + """Number of objects stored""" + + payload_size: Optional[float] = FieldInfo(alias="payloadSize", default=None) + """Amount of storage used by object data""" + + +class InfrequentAccess(BaseModel): + published: Optional[InfrequentAccessPublished] = None + """Metrics on number of objects/amount of storage used""" + + uploaded: Optional[InfrequentAccessUploaded] = None + """Metrics on number of objects/amount of storage used""" + + +class StandardPublished(BaseModel): + metadata_size: Optional[float] = FieldInfo(alias="metadataSize", default=None) + """Amount of""" + + objects: Optional[float] = None + """Number of objects stored""" + + payload_size: Optional[float] = FieldInfo(alias="payloadSize", default=None) + """Amount of storage used by object data""" + + +class StandardUploaded(BaseModel): + metadata_size: Optional[float] = FieldInfo(alias="metadataSize", default=None) + """Amount of""" + + objects: Optional[float] = None + """Number of objects stored""" + + payload_size: Optional[float] = FieldInfo(alias="payloadSize", default=None) + """Amount of storage used by object data""" + + +class Standard(BaseModel): + published: Optional[StandardPublished] = None + """Metrics on number of objects/amount of storage used""" + + uploaded: Optional[StandardUploaded] = None + """Metrics on number of objects/amount of storage used""" + + +class MetricListResponse(BaseModel): + infrequent_access: Optional[InfrequentAccess] = FieldInfo(alias="infrequentAccess", default=None) + """Metrics based on what state they are in(uploaded or published)""" + + standard: Optional[Standard] = None + """Metrics based on what state they are in(uploaded or published)""" diff --git a/src/cloudflare/types/radar/ai/inference/__init__.py b/src/cloudflare/types/radar/ai/inference/__init__.py new file mode 100644 index 00000000000..d9c95a53d16 --- /dev/null +++ b/src/cloudflare/types/radar/ai/inference/__init__.py @@ -0,0 +1,8 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .summary_task_params import SummaryTaskParams as SummaryTaskParams +from .summary_model_params import SummaryModelParams as SummaryModelParams +from .summary_task_response import SummaryTaskResponse as SummaryTaskResponse +from .summary_model_response import SummaryModelResponse as SummaryModelResponse diff --git a/src/cloudflare/types/radar/ai/inference/summary_model_params.py b/src/cloudflare/types/radar/ai/inference/summary_model_params.py new file mode 100644 index 00000000000..050a7e9d487 --- /dev/null +++ b/src/cloudflare/types/radar/ai/inference/summary_model_params.py @@ -0,0 +1,38 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union +from datetime import datetime +from typing_extensions import Literal, Annotated, TypedDict + +from ....._utils import PropertyInfo + +__all__ = ["SummaryModelParams"] + + +class SummaryModelParams(TypedDict, total=False): + date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] + """End of the date range (inclusive).""" + + date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] + """ + For example, use `7d` and `7dControl` to compare this week with the previous + week. Use this parameter or set specific start and end dates (`dateStart` and + `dateEnd` parameters). + """ + + date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] + """Array of datetimes to filter the start of a series.""" + + format: Literal["JSON", "CSV"] + """Format results are returned in.""" + + limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] + """ + Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + """ + + name: List[str] + """Array of names that will be used to name the series in responses.""" diff --git a/src/cloudflare/types/radar/ai/inference/summary_model_response.py b/src/cloudflare/types/radar/ai/inference/summary_model_response.py new file mode 100644 index 00000000000..7aa2499b888 --- /dev/null +++ b/src/cloudflare/types/radar/ai/inference/summary_model_response.py @@ -0,0 +1,56 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Optional +from datetime import datetime + +from pydantic import Field as FieldInfo + +from ....._models import BaseModel + +__all__ = ["SummaryModelResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation"] + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + + end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + + linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + + start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + + +class MetaConfidenceInfo(BaseModel): + annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + + level: Optional[int] = None + + +class Meta(BaseModel): + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: str = FieldInfo(alias="lastUpdated") + + normalization: str + + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + + +class SummaryModelResponse(BaseModel): + meta: Meta + + summary_0: Dict[str, str] diff --git a/src/cloudflare/types/radar/ai/inference/summary_task_params.py b/src/cloudflare/types/radar/ai/inference/summary_task_params.py new file mode 100644 index 00000000000..468a554182f --- /dev/null +++ b/src/cloudflare/types/radar/ai/inference/summary_task_params.py @@ -0,0 +1,38 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union +from datetime import datetime +from typing_extensions import Literal, Annotated, TypedDict + +from ....._utils import PropertyInfo + +__all__ = ["SummaryTaskParams"] + + +class SummaryTaskParams(TypedDict, total=False): + date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] + """End of the date range (inclusive).""" + + date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] + """ + For example, use `7d` and `7dControl` to compare this week with the previous + week. Use this parameter or set specific start and end dates (`dateStart` and + `dateEnd` parameters). + """ + + date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] + """Array of datetimes to filter the start of a series.""" + + format: Literal["JSON", "CSV"] + """Format results are returned in.""" + + limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] + """ + Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + """ + + name: List[str] + """Array of names that will be used to name the series in responses.""" diff --git a/src/cloudflare/types/radar/ai/inference/summary_task_response.py b/src/cloudflare/types/radar/ai/inference/summary_task_response.py new file mode 100644 index 00000000000..c8b34b40a03 --- /dev/null +++ b/src/cloudflare/types/radar/ai/inference/summary_task_response.py @@ -0,0 +1,56 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Optional +from datetime import datetime + +from pydantic import Field as FieldInfo + +from ....._models import BaseModel + +__all__ = ["SummaryTaskResponse", "Meta", "MetaDateRange", "MetaConfidenceInfo", "MetaConfidenceInfoAnnotation"] + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + + end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + + linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + + start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + + +class MetaConfidenceInfo(BaseModel): + annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + + level: Optional[int] = None + + +class Meta(BaseModel): + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: str = FieldInfo(alias="lastUpdated") + + normalization: str + + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + + +class SummaryTaskResponse(BaseModel): + meta: Meta + + summary_0: Dict[str, str] diff --git a/src/cloudflare/types/radar/ai/inference/timeseries_groups/__init__.py b/src/cloudflare/types/radar/ai/inference/timeseries_groups/__init__.py new file mode 100644 index 00000000000..d9c95a53d16 --- /dev/null +++ b/src/cloudflare/types/radar/ai/inference/timeseries_groups/__init__.py @@ -0,0 +1,8 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .summary_task_params import SummaryTaskParams as SummaryTaskParams +from .summary_model_params import SummaryModelParams as SummaryModelParams +from .summary_task_response import SummaryTaskResponse as SummaryTaskResponse +from .summary_model_response import SummaryModelResponse as SummaryModelResponse diff --git a/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_model_params.py b/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_model_params.py new file mode 100644 index 00000000000..64ddb78649e --- /dev/null +++ b/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_model_params.py @@ -0,0 +1,45 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union +from datetime import datetime +from typing_extensions import Literal, Annotated, TypedDict + +from ......_utils import PropertyInfo + +__all__ = ["SummaryModelParams"] + + +class SummaryModelParams(TypedDict, total=False): + agg_interval: Annotated[Literal["15m", "1h", "1d", "1w"], PropertyInfo(alias="aggInterval")] + """ + Aggregation interval results should be returned in (for example, in 15 minutes + or 1 hour intervals). Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + """ + + date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] + """End of the date range (inclusive).""" + + date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] + """ + For example, use `7d` and `7dControl` to compare this week with the previous + week. Use this parameter or set specific start and end dates (`dateStart` and + `dateEnd` parameters). + """ + + date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] + """Array of datetimes to filter the start of a series.""" + + format: Literal["JSON", "CSV"] + """Format results are returned in.""" + + limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] + """ + Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + """ + + name: List[str] + """Array of names that will be used to name the series in responses.""" diff --git a/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_model_response.py b/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_model_response.py new file mode 100644 index 00000000000..8dc1979f7db --- /dev/null +++ b/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_model_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import TYPE_CHECKING, List + +from ......_models import BaseModel + +__all__ = ["SummaryModelResponse", "Serie0"] + + +class Serie0(BaseModel): + timestamps: List[str] + + if TYPE_CHECKING: + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> List[str]: ... + + +class SummaryModelResponse(BaseModel): + meta: object + + serie_0: Serie0 diff --git a/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_task_params.py b/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_task_params.py new file mode 100644 index 00000000000..13ce2929720 --- /dev/null +++ b/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_task_params.py @@ -0,0 +1,45 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union +from datetime import datetime +from typing_extensions import Literal, Annotated, TypedDict + +from ......_utils import PropertyInfo + +__all__ = ["SummaryTaskParams"] + + +class SummaryTaskParams(TypedDict, total=False): + agg_interval: Annotated[Literal["15m", "1h", "1d", "1w"], PropertyInfo(alias="aggInterval")] + """ + Aggregation interval results should be returned in (for example, in 15 minutes + or 1 hour intervals). Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + """ + + date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] + """End of the date range (inclusive).""" + + date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] + """ + For example, use `7d` and `7dControl` to compare this week with the previous + week. Use this parameter or set specific start and end dates (`dateStart` and + `dateEnd` parameters). + """ + + date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] + """Array of datetimes to filter the start of a series.""" + + format: Literal["JSON", "CSV"] + """Format results are returned in.""" + + limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] + """ + Limit the number of objects (eg browsers, verticals, etc) to the top items over + the time range. + """ + + name: List[str] + """Array of names that will be used to name the series in responses.""" diff --git a/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_task_response.py b/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_task_response.py new file mode 100644 index 00000000000..0d8ef99e7c8 --- /dev/null +++ b/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_task_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import TYPE_CHECKING, List + +from ......_models import BaseModel + +__all__ = ["SummaryTaskResponse", "Serie0"] + + +class Serie0(BaseModel): + timestamps: List[str] + + if TYPE_CHECKING: + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> List[str]: ... + + +class SummaryTaskResponse(BaseModel): + meta: object + + serie_0: Serie0 diff --git a/src/cloudflare/types/radar/ranking/__init__.py b/src/cloudflare/types/radar/ranking/__init__.py index 14589db42ec..de03bec4377 100644 --- a/src/cloudflare/types/radar/ranking/__init__.py +++ b/src/cloudflare/types/radar/ranking/__init__.py @@ -4,3 +4,11 @@ from .domain_get_params import DomainGetParams as DomainGetParams from .domain_get_response import DomainGetResponse as DomainGetResponse +from .internet_service_top_params import InternetServiceTopParams as InternetServiceTopParams +from .internet_service_top_response import InternetServiceTopResponse as InternetServiceTopResponse +from .internet_service_timeseries_groups_params import ( + InternetServiceTimeseriesGroupsParams as InternetServiceTimeseriesGroupsParams, +) +from .internet_service_timeseries_groups_response import ( + InternetServiceTimeseriesGroupsResponse as InternetServiceTimeseriesGroupsResponse, +) diff --git a/src/cloudflare/types/radar/ranking/internet_service_timeseries_groups_params.py b/src/cloudflare/types/radar/ranking/internet_service_timeseries_groups_params.py new file mode 100644 index 00000000000..fe6a82d3f79 --- /dev/null +++ b/src/cloudflare/types/radar/ranking/internet_service_timeseries_groups_params.py @@ -0,0 +1,38 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union +from datetime import datetime +from typing_extensions import Literal, Annotated, TypedDict + +from ...._utils import PropertyInfo + +__all__ = ["InternetServiceTimeseriesGroupsParams"] + + +class InternetServiceTimeseriesGroupsParams(TypedDict, total=False): + date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] + """End of the date range (inclusive).""" + + date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] + """ + For example, use `7d` and `7dControl` to compare this week with the previous + week. Use this parameter or set specific start and end dates (`dateStart` and + `dateEnd` parameters). + """ + + date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] + """Array of datetimes to filter the start of a series.""" + + format: Literal["JSON", "CSV"] + """Format results are returned in.""" + + limit: int + """Limit the number of objects in the response.""" + + name: List[str] + """Array of names that will be used to name the series in responses.""" + + service_category: Annotated[List[str], PropertyInfo(alias="serviceCategory")] + """Filter for services category.""" diff --git a/src/cloudflare/types/radar/ranking/internet_service_timeseries_groups_response.py b/src/cloudflare/types/radar/ranking/internet_service_timeseries_groups_response.py new file mode 100644 index 00000000000..76ac2a31de8 --- /dev/null +++ b/src/cloudflare/types/radar/ranking/internet_service_timeseries_groups_response.py @@ -0,0 +1,38 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import TYPE_CHECKING, List, Union +from datetime import datetime + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = ["InternetServiceTimeseriesGroupsResponse", "Meta", "MetaDateRange", "Serie0"] + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class Meta(BaseModel): + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + +class Serie0(BaseModel): + timestamps: List[str] + + if TYPE_CHECKING: + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> List[Union[str, float]]: ... + + +class InternetServiceTimeseriesGroupsResponse(BaseModel): + meta: Meta + + serie_0: Serie0 diff --git a/src/cloudflare/types/radar/ranking/internet_service_top_params.py b/src/cloudflare/types/radar/ranking/internet_service_top_params.py new file mode 100644 index 00000000000..d2809e2b3b0 --- /dev/null +++ b/src/cloudflare/types/radar/ranking/internet_service_top_params.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import datetime +from typing import List, Union +from typing_extensions import Literal, Annotated, TypedDict + +from ...._utils import PropertyInfo + +__all__ = ["InternetServiceTopParams"] + + +class InternetServiceTopParams(TypedDict, total=False): + date: Annotated[List[Union[str, datetime.date]], PropertyInfo(format="iso8601")] + """Array of dates to filter the ranking.""" + + format: Literal["JSON", "CSV"] + """Format results are returned in.""" + + limit: int + """Limit the number of objects in the response.""" + + name: List[str] + """Array of names that will be used to name the series in responses.""" + + service_category: Annotated[List[str], PropertyInfo(alias="serviceCategory")] + """Filter for services category.""" diff --git a/src/cloudflare/types/radar/ranking/internet_service_top_response.py b/src/cloudflare/types/radar/ranking/internet_service_top_response.py new file mode 100644 index 00000000000..0559e8fb43a --- /dev/null +++ b/src/cloudflare/types/radar/ranking/internet_service_top_response.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = ["InternetServiceTopResponse", "Meta", "MetaTop0", "Top0"] + + +class MetaTop0(BaseModel): + date: str + + service_category: str = FieldInfo(alias="serviceCategory") + + +class Meta(BaseModel): + top_0: MetaTop0 + + +class Top0(BaseModel): + rank: int + + service: str + + +class InternetServiceTopResponse(BaseModel): + meta: Meta + + top_0: List[Top0] diff --git a/src/cloudflare/types/radar/robots_txt/__init__.py b/src/cloudflare/types/radar/robots_txt/__init__.py new file mode 100644 index 00000000000..949681d3232 --- /dev/null +++ b/src/cloudflare/types/radar/robots_txt/__init__.py @@ -0,0 +1,6 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .top_domain_categories_params import TopDomainCategoriesParams as TopDomainCategoriesParams +from .top_domain_categories_response import TopDomainCategoriesResponse as TopDomainCategoriesResponse diff --git a/src/cloudflare/types/radar/robots_txt/top/__init__.py b/src/cloudflare/types/radar/robots_txt/top/__init__.py new file mode 100644 index 00000000000..6a26799ff66 --- /dev/null +++ b/src/cloudflare/types/radar/robots_txt/top/__init__.py @@ -0,0 +1,6 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .user_agent_directive_params import UserAgentDirectiveParams as UserAgentDirectiveParams +from .user_agent_directive_response import UserAgentDirectiveResponse as UserAgentDirectiveResponse diff --git a/src/cloudflare/types/radar/robots_txt/top/user_agent_directive_params.py b/src/cloudflare/types/radar/robots_txt/top/user_agent_directive_params.py new file mode 100644 index 00000000000..5b45e1e7913 --- /dev/null +++ b/src/cloudflare/types/radar/robots_txt/top/user_agent_directive_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import datetime +from typing import List, Union +from typing_extensions import Literal, Annotated, TypedDict + +from ....._utils import PropertyInfo + +__all__ = ["UserAgentDirectiveParams"] + + +class UserAgentDirectiveParams(TypedDict, total=False): + date: Annotated[List[Union[str, datetime.date]], PropertyInfo(format="iso8601")] + """Array of dates to filter the ranking.""" + + directive: Literal["ALLOW", "DISALLOW"] + """Filter by directive.""" + + domain_category: Annotated[List[str], PropertyInfo(alias="domainCategory")] + """Filter by domain category.""" + + format: Literal["JSON", "CSV"] + """Format results are returned in.""" + + limit: int + """Limit the number of objects in the response.""" + + name: List[str] + """Array of names that will be used to name the series in responses.""" + + user_agent_category: Annotated[Literal["AI"], PropertyInfo(alias="userAgentCategory")] + """Filter by user agent category.""" diff --git a/src/cloudflare/types/radar/robots_txt/top/user_agent_directive_response.py b/src/cloudflare/types/radar/robots_txt/top/user_agent_directive_response.py new file mode 100644 index 00000000000..945a2b60827 --- /dev/null +++ b/src/cloudflare/types/radar/robots_txt/top/user_agent_directive_response.py @@ -0,0 +1,82 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime + +from pydantic import Field as FieldInfo + +from ....._models import BaseModel + +__all__ = [ + "UserAgentDirectiveResponse", + "Meta", + "MetaDateRange", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaUnit", + "Top0", +] + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + + end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + + linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + + start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + + +class MetaConfidenceInfo(BaseModel): + annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + + level: Optional[int] = None + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: str = FieldInfo(alias="lastUpdated") + + normalization: str + + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + + units: Optional[List[MetaUnit]] = None + + +class Top0(BaseModel): + name: str + + value: int + + fully: Optional[int] = None + + partially: Optional[int] = None + + +class UserAgentDirectiveResponse(BaseModel): + meta: Meta + + top_0: List[Top0] diff --git a/src/cloudflare/types/radar/robots_txt/top_domain_categories_params.py b/src/cloudflare/types/radar/robots_txt/top_domain_categories_params.py new file mode 100644 index 00000000000..b36b8ee64f9 --- /dev/null +++ b/src/cloudflare/types/radar/robots_txt/top_domain_categories_params.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import datetime +from typing import List, Union +from typing_extensions import Literal, Annotated, TypedDict + +from ...._utils import PropertyInfo + +__all__ = ["TopDomainCategoriesParams"] + + +class TopDomainCategoriesParams(TypedDict, total=False): + date: Annotated[List[Union[str, datetime.date]], PropertyInfo(format="iso8601")] + """Array of dates to filter the ranking.""" + + format: Literal["JSON", "CSV"] + """Format results are returned in.""" + + limit: int + """Limit the number of objects in the response.""" + + name: List[str] + """Array of names that will be used to name the series in responses.""" + + user_agent_category: Annotated[Literal["AI"], PropertyInfo(alias="userAgentCategory")] + """Filter by user agent category.""" diff --git a/src/cloudflare/types/radar/robots_txt/top_domain_categories_response.py b/src/cloudflare/types/radar/robots_txt/top_domain_categories_response.py new file mode 100644 index 00000000000..10e1d0c48ba --- /dev/null +++ b/src/cloudflare/types/radar/robots_txt/top_domain_categories_response.py @@ -0,0 +1,78 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = [ + "TopDomainCategoriesResponse", + "Meta", + "MetaDateRange", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaUnit", + "Top0", +] + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaConfidenceInfoAnnotation(BaseModel): + data_source: str = FieldInfo(alias="dataSource") + + description: str + + event_type: str = FieldInfo(alias="eventType") + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + + end_time: Optional[datetime] = FieldInfo(alias="endTime", default=None) + + linked_url: Optional[str] = FieldInfo(alias="linkedUrl", default=None) + + start_time: Optional[datetime] = FieldInfo(alias="startTime", default=None) + + +class MetaConfidenceInfo(BaseModel): + annotations: Optional[List[MetaConfidenceInfoAnnotation]] = None + + level: Optional[int] = None + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: str = FieldInfo(alias="lastUpdated") + + normalization: str + + confidence_info: Optional[MetaConfidenceInfo] = FieldInfo(alias="confidenceInfo", default=None) + + units: Optional[List[MetaUnit]] = None + + +class Top0(BaseModel): + name: str + + value: int + + +class TopDomainCategoriesResponse(BaseModel): + meta: Meta + + top_0: List[Top0] diff --git a/src/cloudflare/types/security_center/__init__.py b/src/cloudflare/types/security_center/__init__.py new file mode 100644 index 00000000000..93cbbbdecc0 --- /dev/null +++ b/src/cloudflare/types/security_center/__init__.py @@ -0,0 +1,8 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .insight_get_params import InsightGetParams as InsightGetParams +from .insight_get_response import InsightGetResponse as InsightGetResponse +from .insight_dismiss_params import InsightDismissParams as InsightDismissParams +from .insight_dismiss_response import InsightDismissResponse as InsightDismissResponse diff --git a/src/cloudflare/types/security_center/insight_dismiss_params.py b/src/cloudflare/types/security_center/insight_dismiss_params.py new file mode 100644 index 00000000000..b4209f9bed2 --- /dev/null +++ b/src/cloudflare/types/security_center/insight_dismiss_params.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["InsightDismissParams"] + + +class InsightDismissParams(TypedDict, total=False): + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + dismiss: bool diff --git a/src/cloudflare/types/security_center/insight_dismiss_response.py b/src/cloudflare/types/security_center/insight_dismiss_response.py new file mode 100644 index 00000000000..520ec45bb74 --- /dev/null +++ b/src/cloudflare/types/security_center/insight_dismiss_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import Literal + +from ..._models import BaseModel +from ..shared.response_info import ResponseInfo + +__all__ = ["InsightDismissResponse"] + + +class InsightDismissResponse(BaseModel): + errors: List[ResponseInfo] + + messages: List[ResponseInfo] + + success: Literal[True] + """Whether the API call was successful""" diff --git a/src/cloudflare/types/security_center/insight_get_params.py b/src/cloudflare/types/security_center/insight_get_params.py new file mode 100644 index 00000000000..be46b8d1bb8 --- /dev/null +++ b/src/cloudflare/types/security_center/insight_get_params.py @@ -0,0 +1,48 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo +from ..intel.attack_surface_report.issue_type import IssueType +from ..intel.attack_surface_report.severity_query_param import SeverityQueryParam + +__all__ = ["InsightGetParams"] + + +class InsightGetParams(TypedDict, total=False): + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + dismissed: bool + + issue_class: List[str] + + issue_class_neq: Annotated[List[str], PropertyInfo(alias="issue_class~neq")] + + issue_type: List[IssueType] + + issue_type_neq: Annotated[List[IssueType], PropertyInfo(alias="issue_type~neq")] + + page: int + """Current page within paginated list of results""" + + per_page: int + """Number of results per page of results""" + + product: List[str] + + product_neq: Annotated[List[str], PropertyInfo(alias="product~neq")] + + severity: List[SeverityQueryParam] + + severity_neq: Annotated[List[SeverityQueryParam], PropertyInfo(alias="severity~neq")] + + subject: List[str] + + subject_neq: Annotated[List[str], PropertyInfo(alias="subject~neq")] diff --git a/src/cloudflare/types/security_center/insight_get_response.py b/src/cloudflare/types/security_center/insight_get_response.py new file mode 100644 index 00000000000..445c062edcc --- /dev/null +++ b/src/cloudflare/types/security_center/insight_get_response.py @@ -0,0 +1,47 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel +from ..intel.attack_surface_report.issue_type import IssueType + +__all__ = ["InsightGetResponse", "Issue"] + + +class Issue(BaseModel): + id: Optional[str] = None + + dismissed: Optional[bool] = None + + issue_class: Optional[str] = None + + issue_type: Optional[IssueType] = None + + payload: Optional[object] = None + + resolve_link: Optional[str] = None + + resolve_text: Optional[str] = None + + severity: Optional[Literal["Low", "Moderate", "Critical"]] = None + + since: Optional[datetime] = None + + subject: Optional[str] = None + + timestamp: Optional[datetime] = None + + +class InsightGetResponse(BaseModel): + count: Optional[int] = None + """Total number of results""" + + issues: Optional[List[Issue]] = None + + page: Optional[int] = None + """Current page within paginated list of results""" + + per_page: Optional[int] = None + """Number of results per page of results""" diff --git a/src/cloudflare/types/security_center/insights/__init__.py b/src/cloudflare/types/security_center/insights/__init__.py new file mode 100644 index 00000000000..adb9484cde5 --- /dev/null +++ b/src/cloudflare/types/security_center/insights/__init__.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .type_get_params import TypeGetParams as TypeGetParams +from .class_get_params import ClassGetParams as ClassGetParams +from .type_get_response import TypeGetResponse as TypeGetResponse +from .class_get_response import ClassGetResponse as ClassGetResponse +from .severity_get_params import SeverityGetParams as SeverityGetParams +from .severity_get_response import SeverityGetResponse as SeverityGetResponse diff --git a/src/cloudflare/types/security_center/insights/class_get_params.py b/src/cloudflare/types/security_center/insights/class_get_params.py new file mode 100644 index 00000000000..e2e6c7761a1 --- /dev/null +++ b/src/cloudflare/types/security_center/insights/class_get_params.py @@ -0,0 +1,42 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Annotated, TypedDict + +from ...._utils import PropertyInfo +from ...intel.attack_surface_report.issue_type import IssueType +from ...intel.attack_surface_report.severity_query_param import SeverityQueryParam + +__all__ = ["ClassGetParams"] + + +class ClassGetParams(TypedDict, total=False): + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + dismissed: bool + + issue_class: List[str] + + issue_class_neq: Annotated[List[str], PropertyInfo(alias="issue_class~neq")] + + issue_type: List[IssueType] + + issue_type_neq: Annotated[List[IssueType], PropertyInfo(alias="issue_type~neq")] + + product: List[str] + + product_neq: Annotated[List[str], PropertyInfo(alias="product~neq")] + + severity: List[SeverityQueryParam] + + severity_neq: Annotated[List[SeverityQueryParam], PropertyInfo(alias="severity~neq")] + + subject: List[str] + + subject_neq: Annotated[List[str], PropertyInfo(alias="subject~neq")] diff --git a/src/cloudflare/types/security_center/insights/class_get_response.py b/src/cloudflare/types/security_center/insights/class_get_response.py new file mode 100644 index 00000000000..b5c2898329f --- /dev/null +++ b/src/cloudflare/types/security_center/insights/class_get_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import TypeAlias + +from ...._models import BaseModel + +__all__ = ["ClassGetResponse", "ClassGetResponseItem"] + + +class ClassGetResponseItem(BaseModel): + count: Optional[int] = None + + value: Optional[str] = None + + +ClassGetResponse: TypeAlias = List[ClassGetResponseItem] diff --git a/src/cloudflare/types/security_center/insights/severity_get_params.py b/src/cloudflare/types/security_center/insights/severity_get_params.py new file mode 100644 index 00000000000..20a6bd2f418 --- /dev/null +++ b/src/cloudflare/types/security_center/insights/severity_get_params.py @@ -0,0 +1,42 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Annotated, TypedDict + +from ...._utils import PropertyInfo +from ...intel.attack_surface_report.issue_type import IssueType +from ...intel.attack_surface_report.severity_query_param import SeverityQueryParam + +__all__ = ["SeverityGetParams"] + + +class SeverityGetParams(TypedDict, total=False): + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + dismissed: bool + + issue_class: List[str] + + issue_class_neq: Annotated[List[str], PropertyInfo(alias="issue_class~neq")] + + issue_type: List[IssueType] + + issue_type_neq: Annotated[List[IssueType], PropertyInfo(alias="issue_type~neq")] + + product: List[str] + + product_neq: Annotated[List[str], PropertyInfo(alias="product~neq")] + + severity: List[SeverityQueryParam] + + severity_neq: Annotated[List[SeverityQueryParam], PropertyInfo(alias="severity~neq")] + + subject: List[str] + + subject_neq: Annotated[List[str], PropertyInfo(alias="subject~neq")] diff --git a/src/cloudflare/types/security_center/insights/severity_get_response.py b/src/cloudflare/types/security_center/insights/severity_get_response.py new file mode 100644 index 00000000000..a8148abb332 --- /dev/null +++ b/src/cloudflare/types/security_center/insights/severity_get_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import TypeAlias + +from ...._models import BaseModel + +__all__ = ["SeverityGetResponse", "SeverityGetResponseItem"] + + +class SeverityGetResponseItem(BaseModel): + count: Optional[int] = None + + value: Optional[str] = None + + +SeverityGetResponse: TypeAlias = List[SeverityGetResponseItem] diff --git a/src/cloudflare/types/security_center/insights/type_get_params.py b/src/cloudflare/types/security_center/insights/type_get_params.py new file mode 100644 index 00000000000..d9df1abb05f --- /dev/null +++ b/src/cloudflare/types/security_center/insights/type_get_params.py @@ -0,0 +1,42 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Annotated, TypedDict + +from ...._utils import PropertyInfo +from ...intel.attack_surface_report.issue_type import IssueType +from ...intel.attack_surface_report.severity_query_param import SeverityQueryParam + +__all__ = ["TypeGetParams"] + + +class TypeGetParams(TypedDict, total=False): + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + dismissed: bool + + issue_class: List[str] + + issue_class_neq: Annotated[List[str], PropertyInfo(alias="issue_class~neq")] + + issue_type: List[IssueType] + + issue_type_neq: Annotated[List[IssueType], PropertyInfo(alias="issue_type~neq")] + + product: List[str] + + product_neq: Annotated[List[str], PropertyInfo(alias="product~neq")] + + severity: List[SeverityQueryParam] + + severity_neq: Annotated[List[SeverityQueryParam], PropertyInfo(alias="severity~neq")] + + subject: List[str] + + subject_neq: Annotated[List[str], PropertyInfo(alias="subject~neq")] diff --git a/src/cloudflare/types/security_center/insights/type_get_response.py b/src/cloudflare/types/security_center/insights/type_get_response.py new file mode 100644 index 00000000000..eae4a597510 --- /dev/null +++ b/src/cloudflare/types/security_center/insights/type_get_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import TypeAlias + +from ...._models import BaseModel + +__all__ = ["TypeGetResponse", "TypeGetResponseItem"] + + +class TypeGetResponseItem(BaseModel): + count: Optional[int] = None + + value: Optional[str] = None + + +TypeGetResponse: TypeAlias = List[TypeGetResponseItem] diff --git a/src/cloudflare/types/zero_trust/access/__init__.py b/src/cloudflare/types/zero_trust/access/__init__.py index 67480e768ce..65e59f6df8c 100644 --- a/src/cloudflare/types/zero_trust/access/__init__.py +++ b/src/cloudflare/types/zero_trust/access/__init__.py @@ -6,6 +6,7 @@ from .app_id import AppID as AppID from .bookmark import Bookmark as Bookmark from .decision import Decision as Decision +from .access_user import AccessUser as AccessUser from .certificate import Certificate as Certificate from .custom_page import CustomPage as CustomPage from .allowed_idps import AllowedIdPs as AllowedIdPs @@ -20,6 +21,7 @@ from .application_type import ApplicationType as ApplicationType from .key_get_response import KeyGetResponse as KeyGetResponse from .user_list_params import UserListParams as UserListParams +from .zero_trust_group import ZeroTrustGroup as ZeroTrustGroup from .group_list_params import GroupListParams as GroupListParams from .key_update_params import KeyUpdateParams as KeyUpdateParams from .tag_create_params import TagCreateParams as TagCreateParams diff --git a/src/cloudflare/types/zero_trust/access/access_user.py b/src/cloudflare/types/zero_trust/access/access_user.py new file mode 100644 index 00000000000..afb810c138f --- /dev/null +++ b/src/cloudflare/types/zero_trust/access/access_user.py @@ -0,0 +1,56 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = ["AccessUser", "Email", "Meta"] + + +class Email(BaseModel): + primary: Optional[bool] = None + """ + Indicates if the email address is the primary email belonging to the SCIM User + resource. + """ + + type: Optional[str] = None + """Indicates the type of the email address.""" + + value: Optional[str] = None + """The email address of the SCIM User resource.""" + + +class Meta(BaseModel): + created: Optional[datetime] = None + """The timestamp of when the SCIM resource was created.""" + + last_modified: Optional[datetime] = FieldInfo(alias="lastModified", default=None) + """The timestamp of when the SCIM resource was last modified.""" + + +class AccessUser(BaseModel): + id: Optional[str] = None + """The unique Cloudflare-generated Id of the SCIM resource.""" + + active: Optional[bool] = None + """Determines the status of the SCIM User resource.""" + + display_name: Optional[str] = FieldInfo(alias="displayName", default=None) + """The name of the SCIM User resource.""" + + emails: Optional[List[Email]] = None + + external_id: Optional[str] = FieldInfo(alias="externalId", default=None) + """The IdP-generated Id of the SCIM resource.""" + + meta: Optional[Meta] = None + """The metadata of the SCIM resource.""" + + schemas: Optional[List[str]] = None + """ + The list of URIs which indicate the attributes contained within a SCIM resource. + """ diff --git a/src/cloudflare/types/zero_trust/access/logs/scim/__init__.py b/src/cloudflare/types/zero_trust/access/logs/scim/__init__.py new file mode 100644 index 00000000000..4082ace4688 --- /dev/null +++ b/src/cloudflare/types/zero_trust/access/logs/scim/__init__.py @@ -0,0 +1,6 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .update_list_params import UpdateListParams as UpdateListParams +from .update_list_response import UpdateListResponse as UpdateListResponse diff --git a/src/cloudflare/types/zero_trust/access/logs/scim/update_list_params.py b/src/cloudflare/types/zero_trust/access/logs/scim/update_list_params.py new file mode 100644 index 00000000000..5abe3bd5542 --- /dev/null +++ b/src/cloudflare/types/zero_trust/access/logs/scim/update_list_params.py @@ -0,0 +1,52 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union +from datetime import datetime +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ......_utils import PropertyInfo + +__all__ = ["UpdateListParams"] + + +class UpdateListParams(TypedDict, total=False): + account_id: Required[str] + """Identifier""" + + idp_id: Required[List[str]] + """The unique Id of the IdP that has SCIM enabled.""" + + cf_resource_id: str + """The unique Cloudflare-generated Id of the SCIM resource.""" + + direction: Literal["desc", "asc"] + """The chronological order used to sort the logs.""" + + idp_resource_id: str + """The IdP-generated Id of the SCIM resource.""" + + limit: int + """The maximum number of update logs to retrieve.""" + + request_method: List[Literal["DELETE", "PATCH", "POST", "PUT"]] + """The request method of the SCIM request.""" + + resource_group_name: str + """The display name of the SCIM Group resource.""" + + resource_type: List[Literal["USER", "GROUP"]] + """The resource type of the SCIM request.""" + + resource_user_email: str + """The email address of the SCIM User resource.""" + + since: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """the timestamp of the earliest update log.""" + + status: List[Literal["FAILURE", "SUCCESS"]] + """The status of the SCIM request.""" + + until: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """the timestamp of the most-recent update log.""" diff --git a/src/cloudflare/types/zero_trust/access/logs/scim/update_list_response.py b/src/cloudflare/types/zero_trust/access/logs/scim/update_list_response.py new file mode 100644 index 00000000000..f01d78e7e4f --- /dev/null +++ b/src/cloudflare/types/zero_trust/access/logs/scim/update_list_response.py @@ -0,0 +1,45 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from ......_models import BaseModel + +__all__ = ["UpdateListResponse"] + + +class UpdateListResponse(BaseModel): + cf_resource_id: Optional[str] = None + """The unique Cloudflare-generated Id of the SCIM resource.""" + + error_description: Optional[str] = None + """ + The error message which is generated when the status of the SCIM request is + 'FAILURE'. + """ + + idp_id: Optional[str] = None + """The unique Id of the IdP that has SCIM enabled.""" + + idp_resource_id: Optional[str] = None + """The IdP-generated Id of the SCIM resource.""" + + logged_at: Optional[datetime] = None + + request_body: Optional[str] = None + """The JSON-encoded string body of the SCIM request.""" + + request_method: Optional[str] = None + """The request method of the SCIM request.""" + + resource_group_name: Optional[str] = None + """The display name of the SCIM Group resource if it exists.""" + + resource_type: Optional[str] = None + """The resource type of the SCIM request.""" + + resource_user_email: Optional[str] = None + """The email address of the SCIM User resource if it exists.""" + + status: Optional[str] = None + """The status of the SCIM request.""" diff --git a/src/cloudflare/types/zero_trust/access/zero_trust_group.py b/src/cloudflare/types/zero_trust/access/zero_trust_group.py new file mode 100644 index 00000000000..0f9d075d62a --- /dev/null +++ b/src/cloudflare/types/zero_trust/access/zero_trust_group.py @@ -0,0 +1,37 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = ["ZeroTrustGroup", "Meta"] + + +class Meta(BaseModel): + created: Optional[datetime] = None + """The timestamp of when the SCIM resource was created.""" + + last_modified: Optional[datetime] = FieldInfo(alias="lastModified", default=None) + """The timestamp of when the SCIM resource was last modified.""" + + +class ZeroTrustGroup(BaseModel): + id: Optional[str] = None + """The unique Cloudflare-generated Id of the SCIM resource.""" + + display_name: Optional[str] = FieldInfo(alias="displayName", default=None) + """The display name of the SCIM Group resource.""" + + external_id: Optional[str] = FieldInfo(alias="externalId", default=None) + """The IdP-generated Id of the SCIM resource.""" + + meta: Optional[Meta] = None + """The metadata of the SCIM resource.""" + + schemas: Optional[List[str]] = None + """ + The list of URIs which indicate the attributes contained within a SCIM resource. + """ diff --git a/src/cloudflare/types/zero_trust/identity_providers/__init__.py b/src/cloudflare/types/zero_trust/identity_providers/__init__.py new file mode 100644 index 00000000000..f8ee8b14b1c --- /dev/null +++ b/src/cloudflare/types/zero_trust/identity_providers/__init__.py @@ -0,0 +1,3 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations diff --git a/src/cloudflare/types/zero_trust/identity_providers/scim/__init__.py b/src/cloudflare/types/zero_trust/identity_providers/scim/__init__.py new file mode 100644 index 00000000000..f050b879af4 --- /dev/null +++ b/src/cloudflare/types/zero_trust/identity_providers/scim/__init__.py @@ -0,0 +1,6 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .user_list_params import UserListParams as UserListParams +from .group_list_params import GroupListParams as GroupListParams diff --git a/src/cloudflare/types/zero_trust/identity_providers/scim/group_list_params.py b/src/cloudflare/types/zero_trust/identity_providers/scim/group_list_params.py new file mode 100644 index 00000000000..e92dbff52db --- /dev/null +++ b/src/cloudflare/types/zero_trust/identity_providers/scim/group_list_params.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["GroupListParams"] + + +class GroupListParams(TypedDict, total=False): + account_id: Required[str] + """Identifier""" + + cf_resource_id: str + """ + The unique Cloudflare-generated Id of the SCIM Group resource; also known as the + "Id". + """ + + idp_resource_id: str + """ + The IdP-generated Id of the SCIM Group resource; also known as the "external + Id". + """ + + name: str + """The display name of the SCIM Group resource.""" diff --git a/src/cloudflare/types/zero_trust/identity_providers/scim/user_list_params.py b/src/cloudflare/types/zero_trust/identity_providers/scim/user_list_params.py new file mode 100644 index 00000000000..2d6e89b3491 --- /dev/null +++ b/src/cloudflare/types/zero_trust/identity_providers/scim/user_list_params.py @@ -0,0 +1,32 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["UserListParams"] + + +class UserListParams(TypedDict, total=False): + account_id: Required[str] + """Identifier""" + + cf_resource_id: str + """ + The unique Cloudflare-generated Id of the SCIM User resource; also known as the + "Id". + """ + + email: str + """The email address of the SCIM User resource.""" + + idp_resource_id: str + """ + The IdP-generated Id of the SCIM User resource; also known as the "external Id". + """ + + name: str + """The name of the SCIM User resource.""" + + username: str + """The username of the SCIM User resource.""" diff --git a/tests/api_resources/custom_hostnames/certificate_pack/__init__.py b/tests/api_resources/custom_hostnames/certificate_pack/__init__.py new file mode 100644 index 00000000000..fd8019a9a1a --- /dev/null +++ b/tests/api_resources/custom_hostnames/certificate_pack/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/custom_hostnames/certificate_pack/test_certificates.py b/tests/api_resources/custom_hostnames/certificate_pack/test_certificates.py new file mode 100644 index 00000000000..bbe43fce774 --- /dev/null +++ b/tests/api_resources/custom_hostnames/certificate_pack/test_certificates.py @@ -0,0 +1,349 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.custom_hostnames.certificate_pack import ( + CertificateDeleteResponse, + CertificateUpdateResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestCertificates: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_update(self, client: Cloudflare) -> None: + certificate = client.custom_hostnames.certificate_pack.certificates.update( + certificate_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_hostname_id="023e105f4ecef8ad9ca31a8372d0c353", + certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_certificate="-----BEGIN CERTIFICATE-----\nMIIDdjCCAl6gAwIBAgIJAPnMg0Fs+/B0MA0GCSqGSIb3DQEBCwUAMFsx...\n-----END CERTIFICATE-----\n", + custom_key="-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC/SCB5...\n-----END PRIVATE KEY-----\n", + ) + assert_matches_type(Optional[CertificateUpdateResponse], certificate, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Cloudflare) -> None: + response = client.custom_hostnames.certificate_pack.certificates.with_raw_response.update( + certificate_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_hostname_id="023e105f4ecef8ad9ca31a8372d0c353", + certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_certificate="-----BEGIN CERTIFICATE-----\nMIIDdjCCAl6gAwIBAgIJAPnMg0Fs+/B0MA0GCSqGSIb3DQEBCwUAMFsx...\n-----END CERTIFICATE-----\n", + custom_key="-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC/SCB5...\n-----END PRIVATE KEY-----\n", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + certificate = response.parse() + assert_matches_type(Optional[CertificateUpdateResponse], certificate, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Cloudflare) -> None: + with client.custom_hostnames.certificate_pack.certificates.with_streaming_response.update( + certificate_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_hostname_id="023e105f4ecef8ad9ca31a8372d0c353", + certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_certificate="-----BEGIN CERTIFICATE-----\nMIIDdjCCAl6gAwIBAgIJAPnMg0Fs+/B0MA0GCSqGSIb3DQEBCwUAMFsx...\n-----END CERTIFICATE-----\n", + custom_key="-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC/SCB5...\n-----END PRIVATE KEY-----\n", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + certificate = response.parse() + assert_matches_type(Optional[CertificateUpdateResponse], certificate, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.custom_hostnames.certificate_pack.certificates.with_raw_response.update( + certificate_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + custom_hostname_id="023e105f4ecef8ad9ca31a8372d0c353", + certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_certificate="-----BEGIN CERTIFICATE-----\nMIIDdjCCAl6gAwIBAgIJAPnMg0Fs+/B0MA0GCSqGSIb3DQEBCwUAMFsx...\n-----END CERTIFICATE-----\n", + custom_key="-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC/SCB5...\n-----END PRIVATE KEY-----\n", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `custom_hostname_id` but received ''"): + client.custom_hostnames.certificate_pack.certificates.with_raw_response.update( + certificate_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_hostname_id="", + certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_certificate="-----BEGIN CERTIFICATE-----\nMIIDdjCCAl6gAwIBAgIJAPnMg0Fs+/B0MA0GCSqGSIb3DQEBCwUAMFsx...\n-----END CERTIFICATE-----\n", + custom_key="-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC/SCB5...\n-----END PRIVATE KEY-----\n", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `certificate_pack_id` but received ''"): + client.custom_hostnames.certificate_pack.certificates.with_raw_response.update( + certificate_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_hostname_id="023e105f4ecef8ad9ca31a8372d0c353", + certificate_pack_id="", + custom_certificate="-----BEGIN CERTIFICATE-----\nMIIDdjCCAl6gAwIBAgIJAPnMg0Fs+/B0MA0GCSqGSIb3DQEBCwUAMFsx...\n-----END CERTIFICATE-----\n", + custom_key="-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC/SCB5...\n-----END PRIVATE KEY-----\n", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `certificate_id` but received ''"): + client.custom_hostnames.certificate_pack.certificates.with_raw_response.update( + certificate_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_hostname_id="023e105f4ecef8ad9ca31a8372d0c353", + certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_certificate="-----BEGIN CERTIFICATE-----\nMIIDdjCCAl6gAwIBAgIJAPnMg0Fs+/B0MA0GCSqGSIb3DQEBCwUAMFsx...\n-----END CERTIFICATE-----\n", + custom_key="-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC/SCB5...\n-----END PRIVATE KEY-----\n", + ) + + @parametrize + def test_method_delete(self, client: Cloudflare) -> None: + certificate = client.custom_hostnames.certificate_pack.certificates.delete( + certificate_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_hostname_id="023e105f4ecef8ad9ca31a8372d0c353", + certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(CertificateDeleteResponse, certificate, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.custom_hostnames.certificate_pack.certificates.with_raw_response.delete( + certificate_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_hostname_id="023e105f4ecef8ad9ca31a8372d0c353", + certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + certificate = response.parse() + assert_matches_type(CertificateDeleteResponse, certificate, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.custom_hostnames.certificate_pack.certificates.with_streaming_response.delete( + certificate_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_hostname_id="023e105f4ecef8ad9ca31a8372d0c353", + certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + certificate = response.parse() + assert_matches_type(CertificateDeleteResponse, certificate, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.custom_hostnames.certificate_pack.certificates.with_raw_response.delete( + certificate_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + custom_hostname_id="023e105f4ecef8ad9ca31a8372d0c353", + certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `custom_hostname_id` but received ''"): + client.custom_hostnames.certificate_pack.certificates.with_raw_response.delete( + certificate_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_hostname_id="", + certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `certificate_pack_id` but received ''"): + client.custom_hostnames.certificate_pack.certificates.with_raw_response.delete( + certificate_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_hostname_id="023e105f4ecef8ad9ca31a8372d0c353", + certificate_pack_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `certificate_id` but received ''"): + client.custom_hostnames.certificate_pack.certificates.with_raw_response.delete( + certificate_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_hostname_id="023e105f4ecef8ad9ca31a8372d0c353", + certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + +class TestAsyncCertificates: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_update(self, async_client: AsyncCloudflare) -> None: + certificate = await async_client.custom_hostnames.certificate_pack.certificates.update( + certificate_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_hostname_id="023e105f4ecef8ad9ca31a8372d0c353", + certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_certificate="-----BEGIN CERTIFICATE-----\nMIIDdjCCAl6gAwIBAgIJAPnMg0Fs+/B0MA0GCSqGSIb3DQEBCwUAMFsx...\n-----END CERTIFICATE-----\n", + custom_key="-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC/SCB5...\n-----END PRIVATE KEY-----\n", + ) + assert_matches_type(Optional[CertificateUpdateResponse], certificate, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + response = await async_client.custom_hostnames.certificate_pack.certificates.with_raw_response.update( + certificate_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_hostname_id="023e105f4ecef8ad9ca31a8372d0c353", + certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_certificate="-----BEGIN CERTIFICATE-----\nMIIDdjCCAl6gAwIBAgIJAPnMg0Fs+/B0MA0GCSqGSIb3DQEBCwUAMFsx...\n-----END CERTIFICATE-----\n", + custom_key="-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC/SCB5...\n-----END PRIVATE KEY-----\n", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + certificate = await response.parse() + assert_matches_type(Optional[CertificateUpdateResponse], certificate, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async with async_client.custom_hostnames.certificate_pack.certificates.with_streaming_response.update( + certificate_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_hostname_id="023e105f4ecef8ad9ca31a8372d0c353", + certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_certificate="-----BEGIN CERTIFICATE-----\nMIIDdjCCAl6gAwIBAgIJAPnMg0Fs+/B0MA0GCSqGSIb3DQEBCwUAMFsx...\n-----END CERTIFICATE-----\n", + custom_key="-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC/SCB5...\n-----END PRIVATE KEY-----\n", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + certificate = await response.parse() + assert_matches_type(Optional[CertificateUpdateResponse], certificate, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.custom_hostnames.certificate_pack.certificates.with_raw_response.update( + certificate_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + custom_hostname_id="023e105f4ecef8ad9ca31a8372d0c353", + certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_certificate="-----BEGIN CERTIFICATE-----\nMIIDdjCCAl6gAwIBAgIJAPnMg0Fs+/B0MA0GCSqGSIb3DQEBCwUAMFsx...\n-----END CERTIFICATE-----\n", + custom_key="-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC/SCB5...\n-----END PRIVATE KEY-----\n", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `custom_hostname_id` but received ''"): + await async_client.custom_hostnames.certificate_pack.certificates.with_raw_response.update( + certificate_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_hostname_id="", + certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_certificate="-----BEGIN CERTIFICATE-----\nMIIDdjCCAl6gAwIBAgIJAPnMg0Fs+/B0MA0GCSqGSIb3DQEBCwUAMFsx...\n-----END CERTIFICATE-----\n", + custom_key="-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC/SCB5...\n-----END PRIVATE KEY-----\n", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `certificate_pack_id` but received ''"): + await async_client.custom_hostnames.certificate_pack.certificates.with_raw_response.update( + certificate_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_hostname_id="023e105f4ecef8ad9ca31a8372d0c353", + certificate_pack_id="", + custom_certificate="-----BEGIN CERTIFICATE-----\nMIIDdjCCAl6gAwIBAgIJAPnMg0Fs+/B0MA0GCSqGSIb3DQEBCwUAMFsx...\n-----END CERTIFICATE-----\n", + custom_key="-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC/SCB5...\n-----END PRIVATE KEY-----\n", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `certificate_id` but received ''"): + await async_client.custom_hostnames.certificate_pack.certificates.with_raw_response.update( + certificate_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_hostname_id="023e105f4ecef8ad9ca31a8372d0c353", + certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_certificate="-----BEGIN CERTIFICATE-----\nMIIDdjCCAl6gAwIBAgIJAPnMg0Fs+/B0MA0GCSqGSIb3DQEBCwUAMFsx...\n-----END CERTIFICATE-----\n", + custom_key="-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC/SCB5...\n-----END PRIVATE KEY-----\n", + ) + + @parametrize + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + certificate = await async_client.custom_hostnames.certificate_pack.certificates.delete( + certificate_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_hostname_id="023e105f4ecef8ad9ca31a8372d0c353", + certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(CertificateDeleteResponse, certificate, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.custom_hostnames.certificate_pack.certificates.with_raw_response.delete( + certificate_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_hostname_id="023e105f4ecef8ad9ca31a8372d0c353", + certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + certificate = await response.parse() + assert_matches_type(CertificateDeleteResponse, certificate, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.custom_hostnames.certificate_pack.certificates.with_streaming_response.delete( + certificate_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_hostname_id="023e105f4ecef8ad9ca31a8372d0c353", + certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + certificate = await response.parse() + assert_matches_type(CertificateDeleteResponse, certificate, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.custom_hostnames.certificate_pack.certificates.with_raw_response.delete( + certificate_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + custom_hostname_id="023e105f4ecef8ad9ca31a8372d0c353", + certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `custom_hostname_id` but received ''"): + await async_client.custom_hostnames.certificate_pack.certificates.with_raw_response.delete( + certificate_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_hostname_id="", + certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `certificate_pack_id` but received ''"): + await async_client.custom_hostnames.certificate_pack.certificates.with_raw_response.delete( + certificate_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_hostname_id="023e105f4ecef8ad9ca31a8372d0c353", + certificate_pack_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `certificate_id` but received ''"): + await async_client.custom_hostnames.certificate_pack.certificates.with_raw_response.delete( + certificate_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + custom_hostname_id="023e105f4ecef8ad9ca31a8372d0c353", + certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353", + ) diff --git a/tests/api_resources/r2/buckets/test_locks.py b/tests/api_resources/r2/buckets/test_locks.py new file mode 100644 index 00000000000..841345ef66e --- /dev/null +++ b/tests/api_resources/r2/buckets/test_locks.py @@ -0,0 +1,272 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.r2.buckets import LockGetResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLocks: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_update(self, client: Cloudflare) -> None: + lock = client.r2.buckets.locks.update( + bucket_name="example-bucket", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(object, lock, path=["response"]) + + @parametrize + def test_method_update_with_all_params(self, client: Cloudflare) -> None: + lock = client.r2.buckets.locks.update( + bucket_name="example-bucket", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + rules=[ + { + "id": "Lock all objects for 24 hours", + "condition": { + "max_age_seconds": 100, + "type": "Age", + }, + "enabled": True, + "prefix": "prefix", + } + ], + jurisdiction="default", + ) + assert_matches_type(object, lock, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Cloudflare) -> None: + response = client.r2.buckets.locks.with_raw_response.update( + bucket_name="example-bucket", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lock = response.parse() + assert_matches_type(object, lock, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Cloudflare) -> None: + with client.r2.buckets.locks.with_streaming_response.update( + bucket_name="example-bucket", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lock = response.parse() + assert_matches_type(object, lock, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.r2.buckets.locks.with_raw_response.update( + bucket_name="example-bucket", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `bucket_name` but received ''"): + client.r2.buckets.locks.with_raw_response.update( + bucket_name="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + lock = client.r2.buckets.locks.get( + bucket_name="example-bucket", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(LockGetResponse, lock, path=["response"]) + + @parametrize + def test_method_get_with_all_params(self, client: Cloudflare) -> None: + lock = client.r2.buckets.locks.get( + bucket_name="example-bucket", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + jurisdiction="default", + ) + assert_matches_type(LockGetResponse, lock, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.r2.buckets.locks.with_raw_response.get( + bucket_name="example-bucket", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lock = response.parse() + assert_matches_type(LockGetResponse, lock, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.r2.buckets.locks.with_streaming_response.get( + bucket_name="example-bucket", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lock = response.parse() + assert_matches_type(LockGetResponse, lock, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.r2.buckets.locks.with_raw_response.get( + bucket_name="example-bucket", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `bucket_name` but received ''"): + client.r2.buckets.locks.with_raw_response.get( + bucket_name="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + +class TestAsyncLocks: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_update(self, async_client: AsyncCloudflare) -> None: + lock = await async_client.r2.buckets.locks.update( + bucket_name="example-bucket", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(object, lock, path=["response"]) + + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: + lock = await async_client.r2.buckets.locks.update( + bucket_name="example-bucket", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + rules=[ + { + "id": "Lock all objects for 24 hours", + "condition": { + "max_age_seconds": 100, + "type": "Age", + }, + "enabled": True, + "prefix": "prefix", + } + ], + jurisdiction="default", + ) + assert_matches_type(object, lock, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + response = await async_client.r2.buckets.locks.with_raw_response.update( + bucket_name="example-bucket", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lock = await response.parse() + assert_matches_type(object, lock, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async with async_client.r2.buckets.locks.with_streaming_response.update( + bucket_name="example-bucket", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lock = await response.parse() + assert_matches_type(object, lock, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.r2.buckets.locks.with_raw_response.update( + bucket_name="example-bucket", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `bucket_name` but received ''"): + await async_client.r2.buckets.locks.with_raw_response.update( + bucket_name="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + lock = await async_client.r2.buckets.locks.get( + bucket_name="example-bucket", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(LockGetResponse, lock, path=["response"]) + + @parametrize + async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: + lock = await async_client.r2.buckets.locks.get( + bucket_name="example-bucket", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + jurisdiction="default", + ) + assert_matches_type(LockGetResponse, lock, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.r2.buckets.locks.with_raw_response.get( + bucket_name="example-bucket", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lock = await response.parse() + assert_matches_type(LockGetResponse, lock, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.r2.buckets.locks.with_streaming_response.get( + bucket_name="example-bucket", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lock = await response.parse() + assert_matches_type(LockGetResponse, lock, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.r2.buckets.locks.with_raw_response.get( + bucket_name="example-bucket", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `bucket_name` but received ''"): + await async_client.r2.buckets.locks.with_raw_response.get( + bucket_name="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) diff --git a/tests/api_resources/r2/buckets/test_metrics.py b/tests/api_resources/r2/buckets/test_metrics.py new file mode 100644 index 00000000000..c1b118c032c --- /dev/null +++ b/tests/api_resources/r2/buckets/test_metrics.py @@ -0,0 +1,98 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.r2.buckets import MetricListResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestMetrics: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + metric = client.r2.buckets.metrics.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(MetricListResponse, metric, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.r2.buckets.metrics.with_raw_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + metric = response.parse() + assert_matches_type(MetricListResponse, metric, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.r2.buckets.metrics.with_streaming_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + metric = response.parse() + assert_matches_type(MetricListResponse, metric, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.r2.buckets.metrics.with_raw_response.list( + account_id="", + ) + + +class TestAsyncMetrics: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + metric = await async_client.r2.buckets.metrics.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(MetricListResponse, metric, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.r2.buckets.metrics.with_raw_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + metric = await response.parse() + assert_matches_type(MetricListResponse, metric, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.r2.buckets.metrics.with_streaming_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + metric = await response.parse() + assert_matches_type(MetricListResponse, metric, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.r2.buckets.metrics.with_raw_response.list( + account_id="", + ) diff --git a/tests/api_resources/radar/ai/inference/__init__.py b/tests/api_resources/radar/ai/inference/__init__.py new file mode 100644 index 00000000000..fd8019a9a1a --- /dev/null +++ b/tests/api_resources/radar/ai/inference/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/radar/ai/inference/test_summary.py b/tests/api_resources/radar/ai/inference/test_summary.py new file mode 100644 index 00000000000..26083d232ef --- /dev/null +++ b/tests/api_resources/radar/ai/inference/test_summary.py @@ -0,0 +1,174 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare._utils import parse_datetime +from cloudflare.types.radar.ai.inference import ( + SummaryTaskResponse, + SummaryModelResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestSummary: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_model(self, client: Cloudflare) -> None: + summary = client.radar.ai.inference.summary.model() + assert_matches_type(SummaryModelResponse, summary, path=["response"]) + + @parametrize + def test_method_model_with_all_params(self, client: Cloudflare) -> None: + summary = client.radar.ai.inference.summary.model( + date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], + date_range=["7d"], + date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], + format="JSON", + limit_per_group=10, + name=["string"], + ) + assert_matches_type(SummaryModelResponse, summary, path=["response"]) + + @parametrize + def test_raw_response_model(self, client: Cloudflare) -> None: + response = client.radar.ai.inference.summary.with_raw_response.model() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + summary = response.parse() + assert_matches_type(SummaryModelResponse, summary, path=["response"]) + + @parametrize + def test_streaming_response_model(self, client: Cloudflare) -> None: + with client.radar.ai.inference.summary.with_streaming_response.model() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + summary = response.parse() + assert_matches_type(SummaryModelResponse, summary, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_task(self, client: Cloudflare) -> None: + summary = client.radar.ai.inference.summary.task() + assert_matches_type(SummaryTaskResponse, summary, path=["response"]) + + @parametrize + def test_method_task_with_all_params(self, client: Cloudflare) -> None: + summary = client.radar.ai.inference.summary.task( + date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], + date_range=["7d"], + date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], + format="JSON", + limit_per_group=10, + name=["string"], + ) + assert_matches_type(SummaryTaskResponse, summary, path=["response"]) + + @parametrize + def test_raw_response_task(self, client: Cloudflare) -> None: + response = client.radar.ai.inference.summary.with_raw_response.task() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + summary = response.parse() + assert_matches_type(SummaryTaskResponse, summary, path=["response"]) + + @parametrize + def test_streaming_response_task(self, client: Cloudflare) -> None: + with client.radar.ai.inference.summary.with_streaming_response.task() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + summary = response.parse() + assert_matches_type(SummaryTaskResponse, summary, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncSummary: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_model(self, async_client: AsyncCloudflare) -> None: + summary = await async_client.radar.ai.inference.summary.model() + assert_matches_type(SummaryModelResponse, summary, path=["response"]) + + @parametrize + async def test_method_model_with_all_params(self, async_client: AsyncCloudflare) -> None: + summary = await async_client.radar.ai.inference.summary.model( + date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], + date_range=["7d"], + date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], + format="JSON", + limit_per_group=10, + name=["string"], + ) + assert_matches_type(SummaryModelResponse, summary, path=["response"]) + + @parametrize + async def test_raw_response_model(self, async_client: AsyncCloudflare) -> None: + response = await async_client.radar.ai.inference.summary.with_raw_response.model() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + summary = await response.parse() + assert_matches_type(SummaryModelResponse, summary, path=["response"]) + + @parametrize + async def test_streaming_response_model(self, async_client: AsyncCloudflare) -> None: + async with async_client.radar.ai.inference.summary.with_streaming_response.model() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + summary = await response.parse() + assert_matches_type(SummaryModelResponse, summary, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_task(self, async_client: AsyncCloudflare) -> None: + summary = await async_client.radar.ai.inference.summary.task() + assert_matches_type(SummaryTaskResponse, summary, path=["response"]) + + @parametrize + async def test_method_task_with_all_params(self, async_client: AsyncCloudflare) -> None: + summary = await async_client.radar.ai.inference.summary.task( + date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], + date_range=["7d"], + date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], + format="JSON", + limit_per_group=10, + name=["string"], + ) + assert_matches_type(SummaryTaskResponse, summary, path=["response"]) + + @parametrize + async def test_raw_response_task(self, async_client: AsyncCloudflare) -> None: + response = await async_client.radar.ai.inference.summary.with_raw_response.task() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + summary = await response.parse() + assert_matches_type(SummaryTaskResponse, summary, path=["response"]) + + @parametrize + async def test_streaming_response_task(self, async_client: AsyncCloudflare) -> None: + async with async_client.radar.ai.inference.summary.with_streaming_response.task() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + summary = await response.parse() + assert_matches_type(SummaryTaskResponse, summary, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/radar/ai/inference/timeseries_groups/__init__.py b/tests/api_resources/radar/ai/inference/timeseries_groups/__init__.py new file mode 100644 index 00000000000..fd8019a9a1a --- /dev/null +++ b/tests/api_resources/radar/ai/inference/timeseries_groups/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/radar/ai/inference/timeseries_groups/test_summary.py b/tests/api_resources/radar/ai/inference/timeseries_groups/test_summary.py new file mode 100644 index 00000000000..deb21c11e17 --- /dev/null +++ b/tests/api_resources/radar/ai/inference/timeseries_groups/test_summary.py @@ -0,0 +1,178 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare._utils import parse_datetime +from cloudflare.types.radar.ai.inference.timeseries_groups import ( + SummaryTaskResponse, + SummaryModelResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestSummary: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_model(self, client: Cloudflare) -> None: + summary = client.radar.ai.inference.timeseries_groups.summary.model() + assert_matches_type(SummaryModelResponse, summary, path=["response"]) + + @parametrize + def test_method_model_with_all_params(self, client: Cloudflare) -> None: + summary = client.radar.ai.inference.timeseries_groups.summary.model( + agg_interval="15m", + date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], + date_range=["7d"], + date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], + format="JSON", + limit_per_group=10, + name=["string"], + ) + assert_matches_type(SummaryModelResponse, summary, path=["response"]) + + @parametrize + def test_raw_response_model(self, client: Cloudflare) -> None: + response = client.radar.ai.inference.timeseries_groups.summary.with_raw_response.model() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + summary = response.parse() + assert_matches_type(SummaryModelResponse, summary, path=["response"]) + + @parametrize + def test_streaming_response_model(self, client: Cloudflare) -> None: + with client.radar.ai.inference.timeseries_groups.summary.with_streaming_response.model() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + summary = response.parse() + assert_matches_type(SummaryModelResponse, summary, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_task(self, client: Cloudflare) -> None: + summary = client.radar.ai.inference.timeseries_groups.summary.task() + assert_matches_type(SummaryTaskResponse, summary, path=["response"]) + + @parametrize + def test_method_task_with_all_params(self, client: Cloudflare) -> None: + summary = client.radar.ai.inference.timeseries_groups.summary.task( + agg_interval="15m", + date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], + date_range=["7d"], + date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], + format="JSON", + limit_per_group=10, + name=["string"], + ) + assert_matches_type(SummaryTaskResponse, summary, path=["response"]) + + @parametrize + def test_raw_response_task(self, client: Cloudflare) -> None: + response = client.radar.ai.inference.timeseries_groups.summary.with_raw_response.task() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + summary = response.parse() + assert_matches_type(SummaryTaskResponse, summary, path=["response"]) + + @parametrize + def test_streaming_response_task(self, client: Cloudflare) -> None: + with client.radar.ai.inference.timeseries_groups.summary.with_streaming_response.task() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + summary = response.parse() + assert_matches_type(SummaryTaskResponse, summary, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncSummary: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_model(self, async_client: AsyncCloudflare) -> None: + summary = await async_client.radar.ai.inference.timeseries_groups.summary.model() + assert_matches_type(SummaryModelResponse, summary, path=["response"]) + + @parametrize + async def test_method_model_with_all_params(self, async_client: AsyncCloudflare) -> None: + summary = await async_client.radar.ai.inference.timeseries_groups.summary.model( + agg_interval="15m", + date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], + date_range=["7d"], + date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], + format="JSON", + limit_per_group=10, + name=["string"], + ) + assert_matches_type(SummaryModelResponse, summary, path=["response"]) + + @parametrize + async def test_raw_response_model(self, async_client: AsyncCloudflare) -> None: + response = await async_client.radar.ai.inference.timeseries_groups.summary.with_raw_response.model() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + summary = await response.parse() + assert_matches_type(SummaryModelResponse, summary, path=["response"]) + + @parametrize + async def test_streaming_response_model(self, async_client: AsyncCloudflare) -> None: + async with async_client.radar.ai.inference.timeseries_groups.summary.with_streaming_response.model() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + summary = await response.parse() + assert_matches_type(SummaryModelResponse, summary, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_task(self, async_client: AsyncCloudflare) -> None: + summary = await async_client.radar.ai.inference.timeseries_groups.summary.task() + assert_matches_type(SummaryTaskResponse, summary, path=["response"]) + + @parametrize + async def test_method_task_with_all_params(self, async_client: AsyncCloudflare) -> None: + summary = await async_client.radar.ai.inference.timeseries_groups.summary.task( + agg_interval="15m", + date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], + date_range=["7d"], + date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], + format="JSON", + limit_per_group=10, + name=["string"], + ) + assert_matches_type(SummaryTaskResponse, summary, path=["response"]) + + @parametrize + async def test_raw_response_task(self, async_client: AsyncCloudflare) -> None: + response = await async_client.radar.ai.inference.timeseries_groups.summary.with_raw_response.task() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + summary = await response.parse() + assert_matches_type(SummaryTaskResponse, summary, path=["response"]) + + @parametrize + async def test_streaming_response_task(self, async_client: AsyncCloudflare) -> None: + async with async_client.radar.ai.inference.timeseries_groups.summary.with_streaming_response.task() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + summary = await response.parse() + assert_matches_type(SummaryTaskResponse, summary, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/radar/ranking/test_internet_services.py b/tests/api_resources/radar/ranking/test_internet_services.py new file mode 100644 index 00000000000..f6b97175f9a --- /dev/null +++ b/tests/api_resources/radar/ranking/test_internet_services.py @@ -0,0 +1,174 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare._utils import parse_date, parse_datetime +from cloudflare.types.radar.ranking import ( + InternetServiceTopResponse, + InternetServiceTimeseriesGroupsResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestInternetServices: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_timeseries_groups(self, client: Cloudflare) -> None: + internet_service = client.radar.ranking.internet_services.timeseries_groups() + assert_matches_type(InternetServiceTimeseriesGroupsResponse, internet_service, path=["response"]) + + @parametrize + def test_method_timeseries_groups_with_all_params(self, client: Cloudflare) -> None: + internet_service = client.radar.ranking.internet_services.timeseries_groups( + date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], + date_range=["7d"], + date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], + format="JSON", + limit=5, + name=["string"], + service_category=["string"], + ) + assert_matches_type(InternetServiceTimeseriesGroupsResponse, internet_service, path=["response"]) + + @parametrize + def test_raw_response_timeseries_groups(self, client: Cloudflare) -> None: + response = client.radar.ranking.internet_services.with_raw_response.timeseries_groups() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + internet_service = response.parse() + assert_matches_type(InternetServiceTimeseriesGroupsResponse, internet_service, path=["response"]) + + @parametrize + def test_streaming_response_timeseries_groups(self, client: Cloudflare) -> None: + with client.radar.ranking.internet_services.with_streaming_response.timeseries_groups() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + internet_service = response.parse() + assert_matches_type(InternetServiceTimeseriesGroupsResponse, internet_service, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_top(self, client: Cloudflare) -> None: + internet_service = client.radar.ranking.internet_services.top() + assert_matches_type(InternetServiceTopResponse, internet_service, path=["response"]) + + @parametrize + def test_method_top_with_all_params(self, client: Cloudflare) -> None: + internet_service = client.radar.ranking.internet_services.top( + date=[parse_date("2019-12-27")], + format="JSON", + limit=5, + name=["string"], + service_category=["string"], + ) + assert_matches_type(InternetServiceTopResponse, internet_service, path=["response"]) + + @parametrize + def test_raw_response_top(self, client: Cloudflare) -> None: + response = client.radar.ranking.internet_services.with_raw_response.top() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + internet_service = response.parse() + assert_matches_type(InternetServiceTopResponse, internet_service, path=["response"]) + + @parametrize + def test_streaming_response_top(self, client: Cloudflare) -> None: + with client.radar.ranking.internet_services.with_streaming_response.top() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + internet_service = response.parse() + assert_matches_type(InternetServiceTopResponse, internet_service, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncInternetServices: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_timeseries_groups(self, async_client: AsyncCloudflare) -> None: + internet_service = await async_client.radar.ranking.internet_services.timeseries_groups() + assert_matches_type(InternetServiceTimeseriesGroupsResponse, internet_service, path=["response"]) + + @parametrize + async def test_method_timeseries_groups_with_all_params(self, async_client: AsyncCloudflare) -> None: + internet_service = await async_client.radar.ranking.internet_services.timeseries_groups( + date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], + date_range=["7d"], + date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], + format="JSON", + limit=5, + name=["string"], + service_category=["string"], + ) + assert_matches_type(InternetServiceTimeseriesGroupsResponse, internet_service, path=["response"]) + + @parametrize + async def test_raw_response_timeseries_groups(self, async_client: AsyncCloudflare) -> None: + response = await async_client.radar.ranking.internet_services.with_raw_response.timeseries_groups() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + internet_service = await response.parse() + assert_matches_type(InternetServiceTimeseriesGroupsResponse, internet_service, path=["response"]) + + @parametrize + async def test_streaming_response_timeseries_groups(self, async_client: AsyncCloudflare) -> None: + async with async_client.radar.ranking.internet_services.with_streaming_response.timeseries_groups() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + internet_service = await response.parse() + assert_matches_type(InternetServiceTimeseriesGroupsResponse, internet_service, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_top(self, async_client: AsyncCloudflare) -> None: + internet_service = await async_client.radar.ranking.internet_services.top() + assert_matches_type(InternetServiceTopResponse, internet_service, path=["response"]) + + @parametrize + async def test_method_top_with_all_params(self, async_client: AsyncCloudflare) -> None: + internet_service = await async_client.radar.ranking.internet_services.top( + date=[parse_date("2019-12-27")], + format="JSON", + limit=5, + name=["string"], + service_category=["string"], + ) + assert_matches_type(InternetServiceTopResponse, internet_service, path=["response"]) + + @parametrize + async def test_raw_response_top(self, async_client: AsyncCloudflare) -> None: + response = await async_client.radar.ranking.internet_services.with_raw_response.top() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + internet_service = await response.parse() + assert_matches_type(InternetServiceTopResponse, internet_service, path=["response"]) + + @parametrize + async def test_streaming_response_top(self, async_client: AsyncCloudflare) -> None: + async with async_client.radar.ranking.internet_services.with_streaming_response.top() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + internet_service = await response.parse() + assert_matches_type(InternetServiceTopResponse, internet_service, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/radar/robots_txt/__init__.py b/tests/api_resources/radar/robots_txt/__init__.py new file mode 100644 index 00000000000..fd8019a9a1a --- /dev/null +++ b/tests/api_resources/radar/robots_txt/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/radar/robots_txt/test_top.py b/tests/api_resources/radar/robots_txt/test_top.py new file mode 100644 index 00000000000..8206f5be9d5 --- /dev/null +++ b/tests/api_resources/radar/robots_txt/test_top.py @@ -0,0 +1,95 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare._utils import parse_date +from cloudflare.types.radar.robots_txt import TopDomainCategoriesResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestTop: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_domain_categories(self, client: Cloudflare) -> None: + top = client.radar.robots_txt.top.domain_categories() + assert_matches_type(TopDomainCategoriesResponse, top, path=["response"]) + + @parametrize + def test_method_domain_categories_with_all_params(self, client: Cloudflare) -> None: + top = client.radar.robots_txt.top.domain_categories( + date=[parse_date("2019-12-27")], + format="JSON", + limit=5, + name=["string"], + user_agent_category="AI", + ) + assert_matches_type(TopDomainCategoriesResponse, top, path=["response"]) + + @parametrize + def test_raw_response_domain_categories(self, client: Cloudflare) -> None: + response = client.radar.robots_txt.top.with_raw_response.domain_categories() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + top = response.parse() + assert_matches_type(TopDomainCategoriesResponse, top, path=["response"]) + + @parametrize + def test_streaming_response_domain_categories(self, client: Cloudflare) -> None: + with client.radar.robots_txt.top.with_streaming_response.domain_categories() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + top = response.parse() + assert_matches_type(TopDomainCategoriesResponse, top, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncTop: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_domain_categories(self, async_client: AsyncCloudflare) -> None: + top = await async_client.radar.robots_txt.top.domain_categories() + assert_matches_type(TopDomainCategoriesResponse, top, path=["response"]) + + @parametrize + async def test_method_domain_categories_with_all_params(self, async_client: AsyncCloudflare) -> None: + top = await async_client.radar.robots_txt.top.domain_categories( + date=[parse_date("2019-12-27")], + format="JSON", + limit=5, + name=["string"], + user_agent_category="AI", + ) + assert_matches_type(TopDomainCategoriesResponse, top, path=["response"]) + + @parametrize + async def test_raw_response_domain_categories(self, async_client: AsyncCloudflare) -> None: + response = await async_client.radar.robots_txt.top.with_raw_response.domain_categories() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + top = await response.parse() + assert_matches_type(TopDomainCategoriesResponse, top, path=["response"]) + + @parametrize + async def test_streaming_response_domain_categories(self, async_client: AsyncCloudflare) -> None: + async with async_client.radar.robots_txt.top.with_streaming_response.domain_categories() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + top = await response.parse() + assert_matches_type(TopDomainCategoriesResponse, top, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/radar/robots_txt/top/__init__.py b/tests/api_resources/radar/robots_txt/top/__init__.py new file mode 100644 index 00000000000..fd8019a9a1a --- /dev/null +++ b/tests/api_resources/radar/robots_txt/top/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/radar/robots_txt/top/test_user_agents.py b/tests/api_resources/radar/robots_txt/top/test_user_agents.py new file mode 100644 index 00000000000..471e63bbeeb --- /dev/null +++ b/tests/api_resources/radar/robots_txt/top/test_user_agents.py @@ -0,0 +1,99 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare._utils import parse_date +from cloudflare.types.radar.robots_txt.top import UserAgentDirectiveResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestUserAgents: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_directive(self, client: Cloudflare) -> None: + user_agent = client.radar.robots_txt.top.user_agents.directive() + assert_matches_type(UserAgentDirectiveResponse, user_agent, path=["response"]) + + @parametrize + def test_method_directive_with_all_params(self, client: Cloudflare) -> None: + user_agent = client.radar.robots_txt.top.user_agents.directive( + date=[parse_date("2019-12-27")], + directive="ALLOW", + domain_category=["string"], + format="JSON", + limit=5, + name=["string"], + user_agent_category="AI", + ) + assert_matches_type(UserAgentDirectiveResponse, user_agent, path=["response"]) + + @parametrize + def test_raw_response_directive(self, client: Cloudflare) -> None: + response = client.radar.robots_txt.top.user_agents.with_raw_response.directive() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user_agent = response.parse() + assert_matches_type(UserAgentDirectiveResponse, user_agent, path=["response"]) + + @parametrize + def test_streaming_response_directive(self, client: Cloudflare) -> None: + with client.radar.robots_txt.top.user_agents.with_streaming_response.directive() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user_agent = response.parse() + assert_matches_type(UserAgentDirectiveResponse, user_agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncUserAgents: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_directive(self, async_client: AsyncCloudflare) -> None: + user_agent = await async_client.radar.robots_txt.top.user_agents.directive() + assert_matches_type(UserAgentDirectiveResponse, user_agent, path=["response"]) + + @parametrize + async def test_method_directive_with_all_params(self, async_client: AsyncCloudflare) -> None: + user_agent = await async_client.radar.robots_txt.top.user_agents.directive( + date=[parse_date("2019-12-27")], + directive="ALLOW", + domain_category=["string"], + format="JSON", + limit=5, + name=["string"], + user_agent_category="AI", + ) + assert_matches_type(UserAgentDirectiveResponse, user_agent, path=["response"]) + + @parametrize + async def test_raw_response_directive(self, async_client: AsyncCloudflare) -> None: + response = await async_client.radar.robots_txt.top.user_agents.with_raw_response.directive() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user_agent = await response.parse() + assert_matches_type(UserAgentDirectiveResponse, user_agent, path=["response"]) + + @parametrize + async def test_streaming_response_directive(self, async_client: AsyncCloudflare) -> None: + async with async_client.radar.robots_txt.top.user_agents.with_streaming_response.directive() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user_agent = await response.parse() + assert_matches_type(UserAgentDirectiveResponse, user_agent, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/security_center/__init__.py b/tests/api_resources/security_center/__init__.py new file mode 100644 index 00000000000..fd8019a9a1a --- /dev/null +++ b/tests/api_resources/security_center/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/security_center/insights/__init__.py b/tests/api_resources/security_center/insights/__init__.py new file mode 100644 index 00000000000..fd8019a9a1a --- /dev/null +++ b/tests/api_resources/security_center/insights/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/security_center/insights/test_class_.py b/tests/api_resources/security_center/insights/test_class_.py new file mode 100644 index 00000000000..f165bb61c0a --- /dev/null +++ b/tests/api_resources/security_center/insights/test_class_.py @@ -0,0 +1,144 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.security_center.insights import ClassGetResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestClass: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + class_ = client.security_center.insights.class_.get( + account_id="account_id", + ) + assert_matches_type(Optional[ClassGetResponse], class_, path=["response"]) + + @parametrize + def test_method_get_with_all_params(self, client: Cloudflare) -> None: + class_ = client.security_center.insights.class_.get( + account_id="account_id", + dismissed=False, + issue_class=["a_record_dangling", "always_use_https_not_enabled"], + issue_class_neq=["a_record_dangling", "always_use_https_not_enabled"], + issue_type=["compliance_violation", "email_security"], + issue_type_neq=["compliance_violation", "email_security"], + product=["access", "dns"], + product_neq=["access", "dns"], + severity=["low", "moderate"], + severity_neq=["low", "moderate"], + subject=["example.com"], + subject_neq=["example.com"], + ) + assert_matches_type(Optional[ClassGetResponse], class_, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.security_center.insights.class_.with_raw_response.get( + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + class_ = response.parse() + assert_matches_type(Optional[ClassGetResponse], class_, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.security_center.insights.class_.with_streaming_response.get( + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + class_ = response.parse() + assert_matches_type(Optional[ClassGetResponse], class_, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.security_center.insights.class_.with_raw_response.get( + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.security_center.insights.class_.with_raw_response.get( + account_id="account_id", + ) + + +class TestAsyncClass: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + class_ = await async_client.security_center.insights.class_.get( + account_id="account_id", + ) + assert_matches_type(Optional[ClassGetResponse], class_, path=["response"]) + + @parametrize + async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: + class_ = await async_client.security_center.insights.class_.get( + account_id="account_id", + dismissed=False, + issue_class=["a_record_dangling", "always_use_https_not_enabled"], + issue_class_neq=["a_record_dangling", "always_use_https_not_enabled"], + issue_type=["compliance_violation", "email_security"], + issue_type_neq=["compliance_violation", "email_security"], + product=["access", "dns"], + product_neq=["access", "dns"], + severity=["low", "moderate"], + severity_neq=["low", "moderate"], + subject=["example.com"], + subject_neq=["example.com"], + ) + assert_matches_type(Optional[ClassGetResponse], class_, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.security_center.insights.class_.with_raw_response.get( + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + class_ = await response.parse() + assert_matches_type(Optional[ClassGetResponse], class_, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.security_center.insights.class_.with_streaming_response.get( + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + class_ = await response.parse() + assert_matches_type(Optional[ClassGetResponse], class_, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.security_center.insights.class_.with_raw_response.get( + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.security_center.insights.class_.with_raw_response.get( + account_id="account_id", + ) diff --git a/tests/api_resources/security_center/insights/test_severity.py b/tests/api_resources/security_center/insights/test_severity.py new file mode 100644 index 00000000000..1122a119653 --- /dev/null +++ b/tests/api_resources/security_center/insights/test_severity.py @@ -0,0 +1,144 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.security_center.insights import SeverityGetResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestSeverity: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + severity = client.security_center.insights.severity.get( + account_id="account_id", + ) + assert_matches_type(Optional[SeverityGetResponse], severity, path=["response"]) + + @parametrize + def test_method_get_with_all_params(self, client: Cloudflare) -> None: + severity = client.security_center.insights.severity.get( + account_id="account_id", + dismissed=False, + issue_class=["a_record_dangling", "always_use_https_not_enabled"], + issue_class_neq=["a_record_dangling", "always_use_https_not_enabled"], + issue_type=["compliance_violation", "email_security"], + issue_type_neq=["compliance_violation", "email_security"], + product=["access", "dns"], + product_neq=["access", "dns"], + severity=["low", "moderate"], + severity_neq=["low", "moderate"], + subject=["example.com"], + subject_neq=["example.com"], + ) + assert_matches_type(Optional[SeverityGetResponse], severity, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.security_center.insights.severity.with_raw_response.get( + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + severity = response.parse() + assert_matches_type(Optional[SeverityGetResponse], severity, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.security_center.insights.severity.with_streaming_response.get( + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + severity = response.parse() + assert_matches_type(Optional[SeverityGetResponse], severity, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.security_center.insights.severity.with_raw_response.get( + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.security_center.insights.severity.with_raw_response.get( + account_id="account_id", + ) + + +class TestAsyncSeverity: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + severity = await async_client.security_center.insights.severity.get( + account_id="account_id", + ) + assert_matches_type(Optional[SeverityGetResponse], severity, path=["response"]) + + @parametrize + async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: + severity = await async_client.security_center.insights.severity.get( + account_id="account_id", + dismissed=False, + issue_class=["a_record_dangling", "always_use_https_not_enabled"], + issue_class_neq=["a_record_dangling", "always_use_https_not_enabled"], + issue_type=["compliance_violation", "email_security"], + issue_type_neq=["compliance_violation", "email_security"], + product=["access", "dns"], + product_neq=["access", "dns"], + severity=["low", "moderate"], + severity_neq=["low", "moderate"], + subject=["example.com"], + subject_neq=["example.com"], + ) + assert_matches_type(Optional[SeverityGetResponse], severity, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.security_center.insights.severity.with_raw_response.get( + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + severity = await response.parse() + assert_matches_type(Optional[SeverityGetResponse], severity, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.security_center.insights.severity.with_streaming_response.get( + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + severity = await response.parse() + assert_matches_type(Optional[SeverityGetResponse], severity, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.security_center.insights.severity.with_raw_response.get( + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.security_center.insights.severity.with_raw_response.get( + account_id="account_id", + ) diff --git a/tests/api_resources/security_center/insights/test_type.py b/tests/api_resources/security_center/insights/test_type.py new file mode 100644 index 00000000000..45d189b175c --- /dev/null +++ b/tests/api_resources/security_center/insights/test_type.py @@ -0,0 +1,144 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.security_center.insights import TypeGetResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestType: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + type = client.security_center.insights.type.get( + account_id="account_id", + ) + assert_matches_type(Optional[TypeGetResponse], type, path=["response"]) + + @parametrize + def test_method_get_with_all_params(self, client: Cloudflare) -> None: + type = client.security_center.insights.type.get( + account_id="account_id", + dismissed=False, + issue_class=["a_record_dangling", "always_use_https_not_enabled"], + issue_class_neq=["a_record_dangling", "always_use_https_not_enabled"], + issue_type=["compliance_violation", "email_security"], + issue_type_neq=["compliance_violation", "email_security"], + product=["access", "dns"], + product_neq=["access", "dns"], + severity=["low", "moderate"], + severity_neq=["low", "moderate"], + subject=["example.com"], + subject_neq=["example.com"], + ) + assert_matches_type(Optional[TypeGetResponse], type, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.security_center.insights.type.with_raw_response.get( + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + type = response.parse() + assert_matches_type(Optional[TypeGetResponse], type, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.security_center.insights.type.with_streaming_response.get( + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + type = response.parse() + assert_matches_type(Optional[TypeGetResponse], type, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.security_center.insights.type.with_raw_response.get( + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.security_center.insights.type.with_raw_response.get( + account_id="account_id", + ) + + +class TestAsyncType: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + type = await async_client.security_center.insights.type.get( + account_id="account_id", + ) + assert_matches_type(Optional[TypeGetResponse], type, path=["response"]) + + @parametrize + async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: + type = await async_client.security_center.insights.type.get( + account_id="account_id", + dismissed=False, + issue_class=["a_record_dangling", "always_use_https_not_enabled"], + issue_class_neq=["a_record_dangling", "always_use_https_not_enabled"], + issue_type=["compliance_violation", "email_security"], + issue_type_neq=["compliance_violation", "email_security"], + product=["access", "dns"], + product_neq=["access", "dns"], + severity=["low", "moderate"], + severity_neq=["low", "moderate"], + subject=["example.com"], + subject_neq=["example.com"], + ) + assert_matches_type(Optional[TypeGetResponse], type, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.security_center.insights.type.with_raw_response.get( + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + type = await response.parse() + assert_matches_type(Optional[TypeGetResponse], type, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.security_center.insights.type.with_streaming_response.get( + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + type = await response.parse() + assert_matches_type(Optional[TypeGetResponse], type, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.security_center.insights.type.with_raw_response.get( + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.security_center.insights.type.with_raw_response.get( + account_id="account_id", + ) diff --git a/tests/api_resources/security_center/test_insights.py b/tests/api_resources/security_center/test_insights.py new file mode 100644 index 00000000000..0aa06ce2162 --- /dev/null +++ b/tests/api_resources/security_center/test_insights.py @@ -0,0 +1,277 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.security_center import ( + InsightGetResponse, + InsightDismissResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestInsights: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_dismiss(self, client: Cloudflare) -> None: + insight = client.security_center.insights.dismiss( + issue_id="issue_id", + account_id="account_id", + ) + assert_matches_type(InsightDismissResponse, insight, path=["response"]) + + @parametrize + def test_method_dismiss_with_all_params(self, client: Cloudflare) -> None: + insight = client.security_center.insights.dismiss( + issue_id="issue_id", + account_id="account_id", + dismiss=True, + ) + assert_matches_type(InsightDismissResponse, insight, path=["response"]) + + @parametrize + def test_raw_response_dismiss(self, client: Cloudflare) -> None: + response = client.security_center.insights.with_raw_response.dismiss( + issue_id="issue_id", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + insight = response.parse() + assert_matches_type(InsightDismissResponse, insight, path=["response"]) + + @parametrize + def test_streaming_response_dismiss(self, client: Cloudflare) -> None: + with client.security_center.insights.with_streaming_response.dismiss( + issue_id="issue_id", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + insight = response.parse() + assert_matches_type(InsightDismissResponse, insight, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_dismiss(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `issue_id` but received ''"): + client.security_center.insights.with_raw_response.dismiss( + issue_id="", + account_id="account_id", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.security_center.insights.with_raw_response.dismiss( + issue_id="issue_id", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.security_center.insights.with_raw_response.dismiss( + issue_id="issue_id", + account_id="account_id", + ) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + insight = client.security_center.insights.get( + account_id="account_id", + ) + assert_matches_type(Optional[InsightGetResponse], insight, path=["response"]) + + @parametrize + def test_method_get_with_all_params(self, client: Cloudflare) -> None: + insight = client.security_center.insights.get( + account_id="account_id", + dismissed=False, + issue_class=["a_record_dangling", "always_use_https_not_enabled"], + issue_class_neq=["a_record_dangling", "always_use_https_not_enabled"], + issue_type=["compliance_violation", "email_security"], + issue_type_neq=["compliance_violation", "email_security"], + page=1, + per_page=25, + product=["access", "dns"], + product_neq=["access", "dns"], + severity=["low", "moderate"], + severity_neq=["low", "moderate"], + subject=["example.com"], + subject_neq=["example.com"], + ) + assert_matches_type(Optional[InsightGetResponse], insight, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.security_center.insights.with_raw_response.get( + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + insight = response.parse() + assert_matches_type(Optional[InsightGetResponse], insight, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.security_center.insights.with_streaming_response.get( + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + insight = response.parse() + assert_matches_type(Optional[InsightGetResponse], insight, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.security_center.insights.with_raw_response.get( + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.security_center.insights.with_raw_response.get( + account_id="account_id", + ) + + +class TestAsyncInsights: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_dismiss(self, async_client: AsyncCloudflare) -> None: + insight = await async_client.security_center.insights.dismiss( + issue_id="issue_id", + account_id="account_id", + ) + assert_matches_type(InsightDismissResponse, insight, path=["response"]) + + @parametrize + async def test_method_dismiss_with_all_params(self, async_client: AsyncCloudflare) -> None: + insight = await async_client.security_center.insights.dismiss( + issue_id="issue_id", + account_id="account_id", + dismiss=True, + ) + assert_matches_type(InsightDismissResponse, insight, path=["response"]) + + @parametrize + async def test_raw_response_dismiss(self, async_client: AsyncCloudflare) -> None: + response = await async_client.security_center.insights.with_raw_response.dismiss( + issue_id="issue_id", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + insight = await response.parse() + assert_matches_type(InsightDismissResponse, insight, path=["response"]) + + @parametrize + async def test_streaming_response_dismiss(self, async_client: AsyncCloudflare) -> None: + async with async_client.security_center.insights.with_streaming_response.dismiss( + issue_id="issue_id", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + insight = await response.parse() + assert_matches_type(InsightDismissResponse, insight, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_dismiss(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `issue_id` but received ''"): + await async_client.security_center.insights.with_raw_response.dismiss( + issue_id="", + account_id="account_id", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.security_center.insights.with_raw_response.dismiss( + issue_id="issue_id", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.security_center.insights.with_raw_response.dismiss( + issue_id="issue_id", + account_id="account_id", + ) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + insight = await async_client.security_center.insights.get( + account_id="account_id", + ) + assert_matches_type(Optional[InsightGetResponse], insight, path=["response"]) + + @parametrize + async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: + insight = await async_client.security_center.insights.get( + account_id="account_id", + dismissed=False, + issue_class=["a_record_dangling", "always_use_https_not_enabled"], + issue_class_neq=["a_record_dangling", "always_use_https_not_enabled"], + issue_type=["compliance_violation", "email_security"], + issue_type_neq=["compliance_violation", "email_security"], + page=1, + per_page=25, + product=["access", "dns"], + product_neq=["access", "dns"], + severity=["low", "moderate"], + severity_neq=["low", "moderate"], + subject=["example.com"], + subject_neq=["example.com"], + ) + assert_matches_type(Optional[InsightGetResponse], insight, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.security_center.insights.with_raw_response.get( + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + insight = await response.parse() + assert_matches_type(Optional[InsightGetResponse], insight, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.security_center.insights.with_streaming_response.get( + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + insight = await response.parse() + assert_matches_type(Optional[InsightGetResponse], insight, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.security_center.insights.with_raw_response.get( + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.security_center.insights.with_raw_response.get( + account_id="account_id", + ) diff --git a/tests/api_resources/zero_trust/access/logs/scim/__init__.py b/tests/api_resources/zero_trust/access/logs/scim/__init__.py new file mode 100644 index 00000000000..fd8019a9a1a --- /dev/null +++ b/tests/api_resources/zero_trust/access/logs/scim/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/zero_trust/access/logs/scim/test_updates.py b/tests/api_resources/zero_trust/access/logs/scim/test_updates.py new file mode 100644 index 00000000000..776071ab042 --- /dev/null +++ b/tests/api_resources/zero_trust/access/logs/scim/test_updates.py @@ -0,0 +1,146 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare._utils import parse_datetime +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.zero_trust.access.logs.scim import UpdateListResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestUpdates: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + update = client.zero_trust.access.logs.scim.updates.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + idp_id=["df7e2w5f-02b7-4d9d-af26-8d1988fca630", "0194ae2c-efcf-7cfb-8884-055f1a161fa5"], + ) + assert_matches_type(SyncSinglePage[UpdateListResponse], update, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + update = client.zero_trust.access.logs.scim.updates.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + idp_id=["df7e2w5f-02b7-4d9d-af26-8d1988fca630", "0194ae2c-efcf-7cfb-8884-055f1a161fa5"], + cf_resource_id="bd97ef8d-7986-43e3-9ee0-c25dda33e4b0", + direction="desc", + idp_resource_id="idp_resource_id", + limit=10, + request_method=["DELETE", "PATCH"], + resource_group_name="ALL_EMPLOYEES", + resource_type=["USER", "GROUP"], + resource_user_email="john.smith@example.com", + since=parse_datetime("2025-01-01T00:00:00Z"), + status=["FAILURE", "SUCCESS"], + until=parse_datetime("2025-01-02T00:00:00Z"), + ) + assert_matches_type(SyncSinglePage[UpdateListResponse], update, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.zero_trust.access.logs.scim.updates.with_raw_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + idp_id=["df7e2w5f-02b7-4d9d-af26-8d1988fca630", "0194ae2c-efcf-7cfb-8884-055f1a161fa5"], + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + update = response.parse() + assert_matches_type(SyncSinglePage[UpdateListResponse], update, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.zero_trust.access.logs.scim.updates.with_streaming_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + idp_id=["df7e2w5f-02b7-4d9d-af26-8d1988fca630", "0194ae2c-efcf-7cfb-8884-055f1a161fa5"], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + update = response.parse() + assert_matches_type(SyncSinglePage[UpdateListResponse], update, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.access.logs.scim.updates.with_raw_response.list( + account_id="", + idp_id=["df7e2w5f-02b7-4d9d-af26-8d1988fca630", "0194ae2c-efcf-7cfb-8884-055f1a161fa5"], + ) + + +class TestAsyncUpdates: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + update = await async_client.zero_trust.access.logs.scim.updates.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + idp_id=["df7e2w5f-02b7-4d9d-af26-8d1988fca630", "0194ae2c-efcf-7cfb-8884-055f1a161fa5"], + ) + assert_matches_type(AsyncSinglePage[UpdateListResponse], update, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + update = await async_client.zero_trust.access.logs.scim.updates.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + idp_id=["df7e2w5f-02b7-4d9d-af26-8d1988fca630", "0194ae2c-efcf-7cfb-8884-055f1a161fa5"], + cf_resource_id="bd97ef8d-7986-43e3-9ee0-c25dda33e4b0", + direction="desc", + idp_resource_id="idp_resource_id", + limit=10, + request_method=["DELETE", "PATCH"], + resource_group_name="ALL_EMPLOYEES", + resource_type=["USER", "GROUP"], + resource_user_email="john.smith@example.com", + since=parse_datetime("2025-01-01T00:00:00Z"), + status=["FAILURE", "SUCCESS"], + until=parse_datetime("2025-01-02T00:00:00Z"), + ) + assert_matches_type(AsyncSinglePage[UpdateListResponse], update, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.access.logs.scim.updates.with_raw_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + idp_id=["df7e2w5f-02b7-4d9d-af26-8d1988fca630", "0194ae2c-efcf-7cfb-8884-055f1a161fa5"], + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + update = await response.parse() + assert_matches_type(AsyncSinglePage[UpdateListResponse], update, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.access.logs.scim.updates.with_streaming_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + idp_id=["df7e2w5f-02b7-4d9d-af26-8d1988fca630", "0194ae2c-efcf-7cfb-8884-055f1a161fa5"], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + update = await response.parse() + assert_matches_type(AsyncSinglePage[UpdateListResponse], update, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.access.logs.scim.updates.with_raw_response.list( + account_id="", + idp_id=["df7e2w5f-02b7-4d9d-af26-8d1988fca630", "0194ae2c-efcf-7cfb-8884-055f1a161fa5"], + ) diff --git a/tests/api_resources/zero_trust/identity_providers/__init__.py b/tests/api_resources/zero_trust/identity_providers/__init__.py new file mode 100644 index 00000000000..fd8019a9a1a --- /dev/null +++ b/tests/api_resources/zero_trust/identity_providers/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/zero_trust/identity_providers/scim/__init__.py b/tests/api_resources/zero_trust/identity_providers/scim/__init__.py new file mode 100644 index 00000000000..fd8019a9a1a --- /dev/null +++ b/tests/api_resources/zero_trust/identity_providers/scim/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/zero_trust/identity_providers/scim/test_groups.py b/tests/api_resources/zero_trust/identity_providers/scim/test_groups.py new file mode 100644 index 00000000000..36c7768d104 --- /dev/null +++ b/tests/api_resources/zero_trust/identity_providers/scim/test_groups.py @@ -0,0 +1,141 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.zero_trust.access import ZeroTrustGroup + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestGroups: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + group = client.zero_trust.identity_providers.scim.groups.list( + identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(SyncSinglePage[ZeroTrustGroup], group, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + group = client.zero_trust.identity_providers.scim.groups.list( + identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + cf_resource_id="a2abeb50-59c9-4c01-8c5c-963d3bf5700f", + idp_resource_id="all_employees", + name="ALL_EMPLOYEES", + ) + assert_matches_type(SyncSinglePage[ZeroTrustGroup], group, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.zero_trust.identity_providers.scim.groups.with_raw_response.list( + identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + group = response.parse() + assert_matches_type(SyncSinglePage[ZeroTrustGroup], group, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.zero_trust.identity_providers.scim.groups.with_streaming_response.list( + identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + group = response.parse() + assert_matches_type(SyncSinglePage[ZeroTrustGroup], group, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.identity_providers.scim.groups.with_raw_response.list( + identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + client.zero_trust.identity_providers.scim.groups.with_raw_response.list( + identity_provider_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + +class TestAsyncGroups: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + group = await async_client.zero_trust.identity_providers.scim.groups.list( + identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(AsyncSinglePage[ZeroTrustGroup], group, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + group = await async_client.zero_trust.identity_providers.scim.groups.list( + identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + cf_resource_id="a2abeb50-59c9-4c01-8c5c-963d3bf5700f", + idp_resource_id="all_employees", + name="ALL_EMPLOYEES", + ) + assert_matches_type(AsyncSinglePage[ZeroTrustGroup], group, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.identity_providers.scim.groups.with_raw_response.list( + identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + group = await response.parse() + assert_matches_type(AsyncSinglePage[ZeroTrustGroup], group, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.identity_providers.scim.groups.with_streaming_response.list( + identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + group = await response.parse() + assert_matches_type(AsyncSinglePage[ZeroTrustGroup], group, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.identity_providers.scim.groups.with_raw_response.list( + identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + await async_client.zero_trust.identity_providers.scim.groups.with_raw_response.list( + identity_provider_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) diff --git a/tests/api_resources/zero_trust/identity_providers/scim/test_users.py b/tests/api_resources/zero_trust/identity_providers/scim/test_users.py new file mode 100644 index 00000000000..8c2ccc6de8c --- /dev/null +++ b/tests/api_resources/zero_trust/identity_providers/scim/test_users.py @@ -0,0 +1,145 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.zero_trust.access import AccessUser + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestUsers: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + user = client.zero_trust.identity_providers.scim.users.list( + identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(SyncSinglePage[AccessUser], user, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + user = client.zero_trust.identity_providers.scim.users.list( + identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + cf_resource_id="bd97ef8d-7986-43e3-9ee0-c25dda33e4b0", + email="john.smith@example.com", + idp_resource_id="john_smith_01", + name="John Smith", + username="John Smith", + ) + assert_matches_type(SyncSinglePage[AccessUser], user, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.zero_trust.identity_providers.scim.users.with_raw_response.list( + identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user = response.parse() + assert_matches_type(SyncSinglePage[AccessUser], user, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.zero_trust.identity_providers.scim.users.with_streaming_response.list( + identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user = response.parse() + assert_matches_type(SyncSinglePage[AccessUser], user, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.identity_providers.scim.users.with_raw_response.list( + identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + client.zero_trust.identity_providers.scim.users.with_raw_response.list( + identity_provider_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + +class TestAsyncUsers: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + user = await async_client.zero_trust.identity_providers.scim.users.list( + identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(AsyncSinglePage[AccessUser], user, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + user = await async_client.zero_trust.identity_providers.scim.users.list( + identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + cf_resource_id="bd97ef8d-7986-43e3-9ee0-c25dda33e4b0", + email="john.smith@example.com", + idp_resource_id="john_smith_01", + name="John Smith", + username="John Smith", + ) + assert_matches_type(AsyncSinglePage[AccessUser], user, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.identity_providers.scim.users.with_raw_response.list( + identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user = await response.parse() + assert_matches_type(AsyncSinglePage[AccessUser], user, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.identity_providers.scim.users.with_streaming_response.list( + identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user = await response.parse() + assert_matches_type(AsyncSinglePage[AccessUser], user, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.identity_providers.scim.users.with_raw_response.list( + identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + await async_client.zero_trust.identity_providers.scim.users.with_raw_response.list( + identity_provider_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) From 29f2be6402d097747e399a32c64504dd1343c708 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Jan 2025 22:52:44 +0000 Subject: [PATCH 060/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index de617f814c7..05591bb7ef6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8973dde42d42a39c8fbc5f3f1eb1328e6ac0c805ca4d3e5920796749ed58eb0a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-04299b899e2bbf8ba1b4ad96d5e9f9c3e0c9b6246bfeac3f9ab684b855b0e412.yml From 85d7eb542d11177c190f84e52ddf37c0cf582708 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Jan 2025 23:15:59 +0000 Subject: [PATCH 061/358] feat(access): move policy rules into policy namespace (#2409) --- api.md | 47 ++++++++----------- .../resources/zero_trust/access/groups.py | 2 +- .../resources/zero_trust/access/policies.py | 2 +- src/cloudflare/types/zero_trust/__init__.py | 40 ---------------- .../access/application_create_params.py | 2 +- .../access/application_create_response.py | 2 +- .../access/application_get_response.py | 2 +- .../access/application_list_response.py | 2 +- .../zero_trust/access/application_policy.py | 2 +- .../access/application_update_params.py | 2 +- .../access/application_update_response.py | 2 +- .../access/applications/__init__.py | 40 ++++++++++++++++ .../access_device_posture_rule.py | 2 +- .../access_device_posture_rule_param.py | 0 .../{ => access/applications}/access_rule.py | 2 +- .../applications}/access_rule_param.py | 0 .../any_valid_service_token_rule.py | 2 +- .../any_valid_service_token_rule_param.py | 0 .../authentication_method_rule.py | 2 +- .../authentication_method_rule_param.py | 0 .../applications}/azure_group_rule.py | 2 +- .../applications}/azure_group_rule_param.py | 2 +- .../applications}/certificate_rule.py | 2 +- .../applications}/certificate_rule_param.py | 0 .../{ => access/applications}/country_rule.py | 2 +- .../applications}/country_rule_param.py | 0 .../{ => access/applications}/domain_rule.py | 2 +- .../applications}/domain_rule_param.py | 0 .../applications}/email_list_rule.py | 2 +- .../applications}/email_list_rule_param.py | 0 .../{ => access/applications}/email_rule.py | 2 +- .../applications}/email_rule_param.py | 0 .../applications}/everyone_rule.py | 2 +- .../applications}/everyone_rule_param.py | 0 .../applications}/external_evaluation_rule.py | 2 +- .../external_evaluation_rule_param.py | 0 .../applications}/github_organization_rule.py | 2 +- .../github_organization_rule_param.py | 2 +- .../{ => access/applications}/group_rule.py | 2 +- .../applications}/group_rule_param.py | 0 .../applications}/gsuite_group_rule.py | 2 +- .../applications}/gsuite_group_rule_param.py | 0 .../{ => access/applications}/ip_list_rule.py | 2 +- .../applications}/ip_list_rule_param.py | 0 .../{ => access/applications}/ip_rule.py | 2 +- .../applications}/ip_rule_param.py | 0 .../applications}/okta_group_rule.py | 2 +- .../applications}/okta_group_rule_param.py | 0 .../applications/policy_test_create_params.py | 2 +- .../applications}/saml_group_rule.py | 2 +- .../applications}/saml_group_rule_param.py | 0 .../applications}/service_token_rule.py | 2 +- .../applications}/service_token_rule_param.py | 0 .../zero_trust/access/group_create_params.py | 2 +- .../access/group_create_response.py | 2 +- .../zero_trust/access/group_get_response.py | 2 +- .../zero_trust/access/group_list_response.py | 2 +- .../zero_trust/access/group_update_params.py | 2 +- .../access/group_update_response.py | 2 +- .../zero_trust/access/policy_create_params.py | 2 +- .../access/policy_create_response.py | 2 +- .../zero_trust/access/policy_get_response.py | 2 +- .../zero_trust/access/policy_list_response.py | 2 +- .../zero_trust/access/policy_update_params.py | 2 +- .../access/policy_update_response.py | 2 +- 65 files changed, 104 insertions(+), 111 deletions(-) rename src/cloudflare/types/zero_trust/{ => access/applications}/access_device_posture_rule.py (90%) rename src/cloudflare/types/zero_trust/{ => access/applications}/access_device_posture_rule_param.py (100%) rename src/cloudflare/types/zero_trust/{ => access/applications}/access_rule.py (98%) rename src/cloudflare/types/zero_trust/{ => access/applications}/access_rule_param.py (100%) rename src/cloudflare/types/zero_trust/{ => access/applications}/any_valid_service_token_rule.py (91%) rename src/cloudflare/types/zero_trust/{ => access/applications}/any_valid_service_token_rule_param.py (100%) rename src/cloudflare/types/zero_trust/{ => access/applications}/authentication_method_rule.py (91%) rename src/cloudflare/types/zero_trust/{ => access/applications}/authentication_method_rule_param.py (100%) rename src/cloudflare/types/zero_trust/{ => access/applications}/azure_group_rule.py (92%) rename src/cloudflare/types/zero_trust/{ => access/applications}/azure_group_rule_param.py (93%) rename src/cloudflare/types/zero_trust/{ => access/applications}/certificate_rule.py (87%) rename src/cloudflare/types/zero_trust/{ => access/applications}/certificate_rule_param.py (100%) rename src/cloudflare/types/zero_trust/{ => access/applications}/country_rule.py (88%) rename src/cloudflare/types/zero_trust/{ => access/applications}/country_rule_param.py (100%) rename src/cloudflare/types/zero_trust/{ => access/applications}/domain_rule.py (88%) rename src/cloudflare/types/zero_trust/{ => access/applications}/domain_rule_param.py (100%) rename src/cloudflare/types/zero_trust/{ => access/applications}/email_list_rule.py (89%) rename src/cloudflare/types/zero_trust/{ => access/applications}/email_list_rule_param.py (100%) rename src/cloudflare/types/zero_trust/{ => access/applications}/email_rule.py (87%) rename src/cloudflare/types/zero_trust/{ => access/applications}/email_rule_param.py (100%) rename src/cloudflare/types/zero_trust/{ => access/applications}/everyone_rule.py (88%) rename src/cloudflare/types/zero_trust/{ => access/applications}/everyone_rule_param.py (100%) rename src/cloudflare/types/zero_trust/{ => access/applications}/external_evaluation_rule.py (93%) rename src/cloudflare/types/zero_trust/{ => access/applications}/external_evaluation_rule_param.py (100%) rename src/cloudflare/types/zero_trust/{ => access/applications}/github_organization_rule.py (94%) rename src/cloudflare/types/zero_trust/{ => access/applications}/github_organization_rule_param.py (94%) rename src/cloudflare/types/zero_trust/{ => access/applications}/group_rule.py (88%) rename src/cloudflare/types/zero_trust/{ => access/applications}/group_rule_param.py (100%) rename src/cloudflare/types/zero_trust/{ => access/applications}/gsuite_group_rule.py (91%) rename src/cloudflare/types/zero_trust/{ => access/applications}/gsuite_group_rule_param.py (100%) rename src/cloudflare/types/zero_trust/{ => access/applications}/ip_list_rule.py (88%) rename src/cloudflare/types/zero_trust/{ => access/applications}/ip_list_rule_param.py (100%) rename src/cloudflare/types/zero_trust/{ => access/applications}/ip_rule.py (86%) rename src/cloudflare/types/zero_trust/{ => access/applications}/ip_rule_param.py (100%) rename src/cloudflare/types/zero_trust/{ => access/applications}/okta_group_rule.py (90%) rename src/cloudflare/types/zero_trust/{ => access/applications}/okta_group_rule_param.py (100%) rename src/cloudflare/types/zero_trust/{ => access/applications}/saml_group_rule.py (92%) rename src/cloudflare/types/zero_trust/{ => access/applications}/saml_group_rule_param.py (100%) rename src/cloudflare/types/zero_trust/{ => access/applications}/service_token_rule.py (89%) rename src/cloudflare/types/zero_trust/{ => access/applications}/service_token_rule_param.py (100%) diff --git a/api.md b/api.md index c46482ec1ed..807fe265448 100644 --- a/api.md +++ b/api.md @@ -5331,33 +5331,6 @@ Methods: ## Access -Types: - -```python -from cloudflare.types.zero_trust import ( - AccessDevicePostureRule, - AccessRule, - AnyValidServiceTokenRule, - AuthenticationMethodRule, - AzureGroupRule, - CertificateRule, - CountryRule, - DomainRule, - EmailListRule, - EmailRule, - EveryoneRule, - ExternalEvaluationRule, - GitHubOrganizationRule, - GroupRule, - GSuiteGroupRule, - IPListRule, - IPRule, - OktaGroupRule, - SAMLGroupRule, - ServiceTokenRule, -) -``` - ### GatewayCA Types: @@ -5481,6 +5454,26 @@ Types: ```python from cloudflare.types.zero_trust.access.applications import ( + AccessDevicePostureRule, + AccessRule, + AnyValidServiceTokenRule, + AuthenticationMethodRule, + AzureGroupRule, + CertificateRule, + CountryRule, + DomainRule, + EmailListRule, + EmailRule, + EveryoneRule, + ExternalEvaluationRule, + GitHubOrganizationRule, + GroupRule, + GSuiteGroupRule, + IPListRule, + IPRule, + OktaGroupRule, + SAMLGroupRule, + ServiceTokenRule, PolicyCreateResponse, PolicyUpdateResponse, PolicyListResponse, diff --git a/src/cloudflare/resources/zero_trust/access/groups.py b/src/cloudflare/resources/zero_trust/access/groups.py index 78fd9c2a2be..b4a1b15c139 100644 --- a/src/cloudflare/resources/zero_trust/access/groups.py +++ b/src/cloudflare/resources/zero_trust/access/groups.py @@ -23,12 +23,12 @@ from ....pagination import SyncSinglePage, AsyncSinglePage from ...._base_client import AsyncPaginator, make_request_options from ....types.zero_trust.access import group_list_params, group_create_params, group_update_params -from ....types.zero_trust.access_rule_param import AccessRuleParam from ....types.zero_trust.access.group_get_response import GroupGetResponse from ....types.zero_trust.access.group_list_response import GroupListResponse from ....types.zero_trust.access.group_create_response import GroupCreateResponse from ....types.zero_trust.access.group_delete_response import GroupDeleteResponse from ....types.zero_trust.access.group_update_response import GroupUpdateResponse +from ....types.zero_trust.access.applications.access_rule_param import AccessRuleParam __all__ = ["GroupsResource", "AsyncGroupsResource"] diff --git a/src/cloudflare/resources/zero_trust/access/policies.py b/src/cloudflare/resources/zero_trust/access/policies.py index 79e74c3d732..8884017e0b7 100644 --- a/src/cloudflare/resources/zero_trust/access/policies.py +++ b/src/cloudflare/resources/zero_trust/access/policies.py @@ -24,13 +24,13 @@ from ...._base_client import AsyncPaginator, make_request_options from ....types.zero_trust.access import Decision, policy_create_params, policy_update_params from ....types.zero_trust.access.decision import Decision -from ....types.zero_trust.access_rule_param import AccessRuleParam from ....types.zero_trust.access.policy_get_response import PolicyGetResponse from ....types.zero_trust.access.approval_group_param import ApprovalGroupParam from ....types.zero_trust.access.policy_list_response import PolicyListResponse from ....types.zero_trust.access.policy_create_response import PolicyCreateResponse from ....types.zero_trust.access.policy_delete_response import PolicyDeleteResponse from ....types.zero_trust.access.policy_update_response import PolicyUpdateResponse +from ....types.zero_trust.access.applications.access_rule_param import AccessRuleParam __all__ = ["PoliciesResource", "AsyncPoliciesResource"] diff --git a/src/cloudflare/types/zero_trust/__init__.py b/src/cloudflare/types/zero_trust/__init__.py index 8042a1ec123..bde15a386b8 100644 --- a/src/cloudflare/types/zero_trust/__init__.py +++ b/src/cloudflare/types/zero_trust/__init__.py @@ -4,85 +4,45 @@ from .seat import Seat as Seat from .device import Device as Device -from .ip_rule import IPRule as IPRule from .azure_ad import AzureAD as AzureAD -from .email_rule import EmailRule as EmailRule -from .group_rule import GroupRule as GroupRule -from .access_rule import AccessRule as AccessRule -from .domain_rule import DomainRule as DomainRule from .percentiles import Percentiles as Percentiles -from .country_rule import CountryRule as CountryRule -from .ip_list_rule import IPListRule as IPListRule from .login_design import LoginDesign as LoginDesign from .network_path import NetworkPath as NetworkPath from .organization import Organization as Organization -from .everyone_rule import EveryoneRule as EveryoneRule -from .ip_rule_param import IPRuleParam as IPRuleParam from .azure_ad_param import AzureADParam as AzureADParam -from .email_list_rule import EmailListRule as EmailListRule -from .okta_group_rule import OktaGroupRule as OktaGroupRule -from .saml_group_rule import SAMLGroupRule as SAMLGroupRule -from .azure_group_rule import AzureGroupRule as AzureGroupRule -from .certificate_rule import CertificateRule as CertificateRule -from .email_rule_param import EmailRuleParam as EmailRuleParam -from .group_rule_param import GroupRuleParam as GroupRuleParam from .seat_edit_params import SeatEditParams as SeatEditParams -from .access_rule_param import AccessRuleParam as AccessRuleParam -from .domain_rule_param import DomainRuleParam as DomainRuleParam -from .gsuite_group_rule import GSuiteGroupRule as GSuiteGroupRule from .identity_provider import IdentityProvider as IdentityProvider -from .country_rule_param import CountryRuleParam as CountryRuleParam -from .ip_list_rule_param import IPListRuleParam as IPListRuleParam from .login_design_param import LoginDesignParam as LoginDesignParam from .seat_edit_response import SeatEditResponse as SeatEditResponse -from .service_token_rule import ServiceTokenRule as ServiceTokenRule from .tunnel_edit_params import TunnelEditParams as TunnelEditParams from .tunnel_list_params import TunnelListParams as TunnelListParams from .device_get_response import DeviceGetResponse as DeviceGetResponse -from .everyone_rule_param import EveryoneRuleParam as EveryoneRuleParam from .tunnel_get_response import TunnelGetResponse as TunnelGetResponse from .generic_oauth_config import GenericOAuthConfig as GenericOAuthConfig from .tunnel_create_params import TunnelCreateParams as TunnelCreateParams from .tunnel_edit_response import TunnelEditResponse as TunnelEditResponse from .tunnel_list_response import TunnelListResponse as TunnelListResponse -from .email_list_rule_param import EmailListRuleParam as EmailListRuleParam from .gateway_list_response import GatewayListResponse as GatewayListResponse from .network_path_response import NetworkPathResponse as NetworkPathResponse -from .okta_group_rule_param import OktaGroupRuleParam as OktaGroupRuleParam -from .saml_group_rule_param import SAMLGroupRuleParam as SAMLGroupRuleParam -from .azure_group_rule_param import AzureGroupRuleParam as AzureGroupRuleParam -from .certificate_rule_param import CertificateRuleParam as CertificateRuleParam from .identity_provider_type import IdentityProviderType as IdentityProviderType from .tunnel_create_response import TunnelCreateResponse as TunnelCreateResponse from .tunnel_delete_response import TunnelDeleteResponse as TunnelDeleteResponse from .gateway_create_response import GatewayCreateResponse as GatewayCreateResponse -from .gsuite_group_rule_param import GSuiteGroupRuleParam as GSuiteGroupRuleParam from .identity_provider_param import IdentityProviderParam as IdentityProviderParam -from .external_evaluation_rule import ExternalEvaluationRule as ExternalEvaluationRule -from .github_organization_rule import GitHubOrganizationRule as GitHubOrganizationRule -from .service_token_rule_param import ServiceTokenRuleParam as ServiceTokenRuleParam from .risk_scoring_get_response import RiskScoringGetResponse as RiskScoringGetResponse -from .access_device_posture_rule import AccessDevicePostureRule as AccessDevicePostureRule -from .authentication_method_rule import AuthenticationMethodRule as AuthenticationMethodRule from .digital_experience_monitor import DigitalExperienceMonitor as DigitalExperienceMonitor from .generic_oauth_config_param import GenericOAuthConfigParam as GenericOAuthConfigParam from .organization_create_params import OrganizationCreateParams as OrganizationCreateParams from .organization_update_params import OrganizationUpdateParams as OrganizationUpdateParams -from .any_valid_service_token_rule import AnyValidServiceTokenRule as AnyValidServiceTokenRule from .identity_provider_list_params import IdentityProviderListParams as IdentityProviderListParams from .identity_provider_scim_config import IdentityProviderSCIMConfig as IdentityProviderSCIMConfig -from .external_evaluation_rule_param import ExternalEvaluationRuleParam as ExternalEvaluationRuleParam -from .github_organization_rule_param import GitHubOrganizationRuleParam as GitHubOrganizationRuleParam from .identity_provider_create_params import IdentityProviderCreateParams as IdentityProviderCreateParams from .identity_provider_list_response import IdentityProviderListResponse as IdentityProviderListResponse from .identity_provider_update_params import IdentityProviderUpdateParams as IdentityProviderUpdateParams -from .access_device_posture_rule_param import AccessDevicePostureRuleParam as AccessDevicePostureRuleParam -from .authentication_method_rule_param import AuthenticationMethodRuleParam as AuthenticationMethodRuleParam from .connectivity_setting_edit_params import ConnectivitySettingEditParams as ConnectivitySettingEditParams from .organization_revoke_users_params import OrganizationRevokeUsersParams as OrganizationRevokeUsersParams from .connectivity_setting_get_response import ConnectivitySettingGetResponse as ConnectivitySettingGetResponse from .identity_provider_delete_response import IdentityProviderDeleteResponse as IdentityProviderDeleteResponse -from .any_valid_service_token_rule_param import AnyValidServiceTokenRuleParam as AnyValidServiceTokenRuleParam from .connectivity_setting_edit_response import ConnectivitySettingEditResponse as ConnectivitySettingEditResponse from .organization_revoke_users_response import OrganizationRevokeUsersResponse as OrganizationRevokeUsersResponse from .identity_provider_scim_config_param import IdentityProviderSCIMConfigParam as IdentityProviderSCIMConfigParam diff --git a/src/cloudflare/types/zero_trust/access/application_create_params.py b/src/cloudflare/types/zero_trust/access/application_create_params.py index 8f28b6ec26a..11bd0181f4d 100644 --- a/src/cloudflare/types/zero_trust/access/application_create_params.py +++ b/src/cloudflare/types/zero_trust/access/application_create_params.py @@ -8,13 +8,13 @@ from .decision import Decision from .allowed_idps import AllowedIdPs from .application_type import ApplicationType -from ..access_rule_param import AccessRuleParam from .cors_headers_param import CORSHeadersParam from .oidc_saas_app_param import OIDCSaaSAppParam from .saml_saas_app_param import SAMLSaaSAppParam from .self_hosted_domains import SelfHostedDomains from .approval_group_param import ApprovalGroupParam from .scim_config_mapping_param import SCIMConfigMappingParam +from .applications.access_rule_param import AccessRuleParam from .scim_config_authentication_oauth2_param import SCIMConfigAuthenticationOauth2Param from .scim_config_authentication_http_basic_param import SCIMConfigAuthenticationHTTPBasicParam from .scim_config_authentication_oauth_bearer_token_param import SCIMConfigAuthenticationOAuthBearerTokenParam diff --git a/src/cloudflare/types/zero_trust/access/application_create_response.py b/src/cloudflare/types/zero_trust/access/application_create_response.py index 1f3a5fdb214..93858f195db 100644 --- a/src/cloudflare/types/zero_trust/access/application_create_response.py +++ b/src/cloudflare/types/zero_trust/access/application_create_response.py @@ -6,7 +6,6 @@ from .decision import Decision from ...._models import BaseModel -from ..access_rule import AccessRule from .allowed_idps import AllowedIdPs from .cors_headers import CORSHeaders from .oidc_saas_app import OIDCSaaSApp @@ -15,6 +14,7 @@ from .application_policy import ApplicationPolicy from .scim_config_mapping import SCIMConfigMapping from .self_hosted_domains import SelfHostedDomains +from .applications.access_rule import AccessRule from .scim_config_authentication_oauth2 import SCIMConfigAuthenticationOauth2 from .scim_config_authentication_http_basic import SCIMConfigAuthenticationHTTPBasic from .scim_config_authentication_oauth_bearer_token import SCIMConfigAuthenticationOAuthBearerToken diff --git a/src/cloudflare/types/zero_trust/access/application_get_response.py b/src/cloudflare/types/zero_trust/access/application_get_response.py index cffacb3a76a..ffdc25f6b00 100644 --- a/src/cloudflare/types/zero_trust/access/application_get_response.py +++ b/src/cloudflare/types/zero_trust/access/application_get_response.py @@ -6,7 +6,6 @@ from .decision import Decision from ...._models import BaseModel -from ..access_rule import AccessRule from .allowed_idps import AllowedIdPs from .cors_headers import CORSHeaders from .oidc_saas_app import OIDCSaaSApp @@ -15,6 +14,7 @@ from .application_policy import ApplicationPolicy from .scim_config_mapping import SCIMConfigMapping from .self_hosted_domains import SelfHostedDomains +from .applications.access_rule import AccessRule from .scim_config_authentication_oauth2 import SCIMConfigAuthenticationOauth2 from .scim_config_authentication_http_basic import SCIMConfigAuthenticationHTTPBasic from .scim_config_authentication_oauth_bearer_token import SCIMConfigAuthenticationOAuthBearerToken diff --git a/src/cloudflare/types/zero_trust/access/application_list_response.py b/src/cloudflare/types/zero_trust/access/application_list_response.py index 1a0257ad43c..84c7d46ee79 100644 --- a/src/cloudflare/types/zero_trust/access/application_list_response.py +++ b/src/cloudflare/types/zero_trust/access/application_list_response.py @@ -6,7 +6,6 @@ from .decision import Decision from ...._models import BaseModel -from ..access_rule import AccessRule from .allowed_idps import AllowedIdPs from .cors_headers import CORSHeaders from .oidc_saas_app import OIDCSaaSApp @@ -15,6 +14,7 @@ from .application_policy import ApplicationPolicy from .scim_config_mapping import SCIMConfigMapping from .self_hosted_domains import SelfHostedDomains +from .applications.access_rule import AccessRule from .scim_config_authentication_oauth2 import SCIMConfigAuthenticationOauth2 from .scim_config_authentication_http_basic import SCIMConfigAuthenticationHTTPBasic from .scim_config_authentication_oauth_bearer_token import SCIMConfigAuthenticationOAuthBearerToken diff --git a/src/cloudflare/types/zero_trust/access/application_policy.py b/src/cloudflare/types/zero_trust/access/application_policy.py index fee16109e49..a1baa07d1b6 100644 --- a/src/cloudflare/types/zero_trust/access/application_policy.py +++ b/src/cloudflare/types/zero_trust/access/application_policy.py @@ -5,8 +5,8 @@ from .decision import Decision from ...._models import BaseModel -from ..access_rule import AccessRule from .approval_group import ApprovalGroup +from .applications.access_rule import AccessRule __all__ = ["ApplicationPolicy"] diff --git a/src/cloudflare/types/zero_trust/access/application_update_params.py b/src/cloudflare/types/zero_trust/access/application_update_params.py index f96f295a24f..dbc9f768f2d 100644 --- a/src/cloudflare/types/zero_trust/access/application_update_params.py +++ b/src/cloudflare/types/zero_trust/access/application_update_params.py @@ -8,13 +8,13 @@ from .decision import Decision from .allowed_idps import AllowedIdPs from .application_type import ApplicationType -from ..access_rule_param import AccessRuleParam from .cors_headers_param import CORSHeadersParam from .oidc_saas_app_param import OIDCSaaSAppParam from .saml_saas_app_param import SAMLSaaSAppParam from .self_hosted_domains import SelfHostedDomains from .approval_group_param import ApprovalGroupParam from .scim_config_mapping_param import SCIMConfigMappingParam +from .applications.access_rule_param import AccessRuleParam from .scim_config_authentication_oauth2_param import SCIMConfigAuthenticationOauth2Param from .scim_config_authentication_http_basic_param import SCIMConfigAuthenticationHTTPBasicParam from .scim_config_authentication_oauth_bearer_token_param import SCIMConfigAuthenticationOAuthBearerTokenParam diff --git a/src/cloudflare/types/zero_trust/access/application_update_response.py b/src/cloudflare/types/zero_trust/access/application_update_response.py index 00ea299d5f3..84970ad9974 100644 --- a/src/cloudflare/types/zero_trust/access/application_update_response.py +++ b/src/cloudflare/types/zero_trust/access/application_update_response.py @@ -6,7 +6,6 @@ from .decision import Decision from ...._models import BaseModel -from ..access_rule import AccessRule from .allowed_idps import AllowedIdPs from .cors_headers import CORSHeaders from .oidc_saas_app import OIDCSaaSApp @@ -15,6 +14,7 @@ from .application_policy import ApplicationPolicy from .scim_config_mapping import SCIMConfigMapping from .self_hosted_domains import SelfHostedDomains +from .applications.access_rule import AccessRule from .scim_config_authentication_oauth2 import SCIMConfigAuthenticationOauth2 from .scim_config_authentication_http_basic import SCIMConfigAuthenticationHTTPBasic from .scim_config_authentication_oauth_bearer_token import SCIMConfigAuthenticationOAuthBearerToken diff --git a/src/cloudflare/types/zero_trust/access/applications/__init__.py b/src/cloudflare/types/zero_trust/access/applications/__init__.py index b149f062d40..4d592f30ff5 100644 --- a/src/cloudflare/types/zero_trust/access/applications/__init__.py +++ b/src/cloudflare/types/zero_trust/access/applications/__init__.py @@ -3,17 +3,57 @@ from __future__ import annotations from .ca import CA as CA +from .ip_rule import IPRule as IPRule +from .email_rule import EmailRule as EmailRule +from .group_rule import GroupRule as GroupRule +from .access_rule import AccessRule as AccessRule +from .domain_rule import DomainRule as DomainRule +from .country_rule import CountryRule as CountryRule +from .ip_list_rule import IPListRule as IPListRule +from .everyone_rule import EveryoneRule as EveryoneRule +from .ip_rule_param import IPRuleParam as IPRuleParam +from .email_list_rule import EmailListRule as EmailListRule +from .okta_group_rule import OktaGroupRule as OktaGroupRule +from .saml_group_rule import SAMLGroupRule as SAMLGroupRule +from .azure_group_rule import AzureGroupRule as AzureGroupRule +from .certificate_rule import CertificateRule as CertificateRule +from .email_rule_param import EmailRuleParam as EmailRuleParam +from .group_rule_param import GroupRuleParam as GroupRuleParam +from .access_rule_param import AccessRuleParam as AccessRuleParam +from .domain_rule_param import DomainRuleParam as DomainRuleParam +from .gsuite_group_rule import GSuiteGroupRule as GSuiteGroupRule from .ca_delete_response import CADeleteResponse as CADeleteResponse +from .country_rule_param import CountryRuleParam as CountryRuleParam +from .ip_list_rule_param import IPListRuleParam as IPListRuleParam +from .service_token_rule import ServiceTokenRule as ServiceTokenRule +from .everyone_rule_param import EveryoneRuleParam as EveryoneRuleParam from .policy_get_response import PolicyGetResponse as PolicyGetResponse from .policy_create_params import PolicyCreateParams as PolicyCreateParams from .policy_list_response import PolicyListResponse as PolicyListResponse from .policy_update_params import PolicyUpdateParams as PolicyUpdateParams +from .email_list_rule_param import EmailListRuleParam as EmailListRuleParam +from .okta_group_rule_param import OktaGroupRuleParam as OktaGroupRuleParam +from .saml_group_rule_param import SAMLGroupRuleParam as SAMLGroupRuleParam from .user_policy_check_geo import UserPolicyCheckGeo as UserPolicyCheckGeo +from .azure_group_rule_param import AzureGroupRuleParam as AzureGroupRuleParam +from .certificate_rule_param import CertificateRuleParam as CertificateRuleParam from .policy_create_response import PolicyCreateResponse as PolicyCreateResponse from .policy_delete_response import PolicyDeleteResponse as PolicyDeleteResponse from .policy_test_get_params import PolicyTestGetParams as PolicyTestGetParams from .policy_update_response import PolicyUpdateResponse as PolicyUpdateResponse +from .gsuite_group_rule_param import GSuiteGroupRuleParam as GSuiteGroupRuleParam +from .external_evaluation_rule import ExternalEvaluationRule as ExternalEvaluationRule +from .github_organization_rule import GitHubOrganizationRule as GitHubOrganizationRule from .policy_test_get_response import PolicyTestGetResponse as PolicyTestGetResponse +from .service_token_rule_param import ServiceTokenRuleParam as ServiceTokenRuleParam from .policy_test_create_params import PolicyTestCreateParams as PolicyTestCreateParams +from .access_device_posture_rule import AccessDevicePostureRule as AccessDevicePostureRule +from .authentication_method_rule import AuthenticationMethodRule as AuthenticationMethodRule from .policy_test_create_response import PolicyTestCreateResponse as PolicyTestCreateResponse +from .any_valid_service_token_rule import AnyValidServiceTokenRule as AnyValidServiceTokenRule +from .external_evaluation_rule_param import ExternalEvaluationRuleParam as ExternalEvaluationRuleParam +from .github_organization_rule_param import GitHubOrganizationRuleParam as GitHubOrganizationRuleParam from .user_policy_check_list_response import UserPolicyCheckListResponse as UserPolicyCheckListResponse +from .access_device_posture_rule_param import AccessDevicePostureRuleParam as AccessDevicePostureRuleParam +from .authentication_method_rule_param import AuthenticationMethodRuleParam as AuthenticationMethodRuleParam +from .any_valid_service_token_rule_param import AnyValidServiceTokenRuleParam as AnyValidServiceTokenRuleParam diff --git a/src/cloudflare/types/zero_trust/access_device_posture_rule.py b/src/cloudflare/types/zero_trust/access/applications/access_device_posture_rule.py similarity index 90% rename from src/cloudflare/types/zero_trust/access_device_posture_rule.py rename to src/cloudflare/types/zero_trust/access/applications/access_device_posture_rule.py index 52525a17f74..e6ee4cd20d3 100644 --- a/src/cloudflare/types/zero_trust/access_device_posture_rule.py +++ b/src/cloudflare/types/zero_trust/access/applications/access_device_posture_rule.py @@ -1,7 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ..._models import BaseModel +from ....._models import BaseModel __all__ = ["AccessDevicePostureRule", "DevicePosture"] diff --git a/src/cloudflare/types/zero_trust/access_device_posture_rule_param.py b/src/cloudflare/types/zero_trust/access/applications/access_device_posture_rule_param.py similarity index 100% rename from src/cloudflare/types/zero_trust/access_device_posture_rule_param.py rename to src/cloudflare/types/zero_trust/access/applications/access_device_posture_rule_param.py diff --git a/src/cloudflare/types/zero_trust/access_rule.py b/src/cloudflare/types/zero_trust/access/applications/access_rule.py similarity index 98% rename from src/cloudflare/types/zero_trust/access_rule.py rename to src/cloudflare/types/zero_trust/access/applications/access_rule.py index ead404b9196..57917aaceab 100644 --- a/src/cloudflare/types/zero_trust/access_rule.py +++ b/src/cloudflare/types/zero_trust/access/applications/access_rule.py @@ -4,9 +4,9 @@ from typing_extensions import TypeAlias from .ip_rule import IPRule -from ..._models import BaseModel from .email_rule import EmailRule from .group_rule import GroupRule +from ....._models import BaseModel from .domain_rule import DomainRule from .country_rule import CountryRule from .ip_list_rule import IPListRule diff --git a/src/cloudflare/types/zero_trust/access_rule_param.py b/src/cloudflare/types/zero_trust/access/applications/access_rule_param.py similarity index 100% rename from src/cloudflare/types/zero_trust/access_rule_param.py rename to src/cloudflare/types/zero_trust/access/applications/access_rule_param.py diff --git a/src/cloudflare/types/zero_trust/any_valid_service_token_rule.py b/src/cloudflare/types/zero_trust/access/applications/any_valid_service_token_rule.py similarity index 91% rename from src/cloudflare/types/zero_trust/any_valid_service_token_rule.py rename to src/cloudflare/types/zero_trust/access/applications/any_valid_service_token_rule.py index b6a422e5457..577977a5ed2 100644 --- a/src/cloudflare/types/zero_trust/any_valid_service_token_rule.py +++ b/src/cloudflare/types/zero_trust/access/applications/any_valid_service_token_rule.py @@ -1,7 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ..._models import BaseModel +from ....._models import BaseModel __all__ = ["AnyValidServiceTokenRule", "AnyValidServiceToken"] diff --git a/src/cloudflare/types/zero_trust/any_valid_service_token_rule_param.py b/src/cloudflare/types/zero_trust/access/applications/any_valid_service_token_rule_param.py similarity index 100% rename from src/cloudflare/types/zero_trust/any_valid_service_token_rule_param.py rename to src/cloudflare/types/zero_trust/access/applications/any_valid_service_token_rule_param.py diff --git a/src/cloudflare/types/zero_trust/authentication_method_rule.py b/src/cloudflare/types/zero_trust/access/applications/authentication_method_rule.py similarity index 91% rename from src/cloudflare/types/zero_trust/authentication_method_rule.py rename to src/cloudflare/types/zero_trust/access/applications/authentication_method_rule.py index e0ed41f168f..d2b9f6a65a2 100644 --- a/src/cloudflare/types/zero_trust/authentication_method_rule.py +++ b/src/cloudflare/types/zero_trust/access/applications/authentication_method_rule.py @@ -1,7 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ..._models import BaseModel +from ....._models import BaseModel __all__ = ["AuthenticationMethodRule", "AuthMethod"] diff --git a/src/cloudflare/types/zero_trust/authentication_method_rule_param.py b/src/cloudflare/types/zero_trust/access/applications/authentication_method_rule_param.py similarity index 100% rename from src/cloudflare/types/zero_trust/authentication_method_rule_param.py rename to src/cloudflare/types/zero_trust/access/applications/authentication_method_rule_param.py diff --git a/src/cloudflare/types/zero_trust/azure_group_rule.py b/src/cloudflare/types/zero_trust/access/applications/azure_group_rule.py similarity index 92% rename from src/cloudflare/types/zero_trust/azure_group_rule.py rename to src/cloudflare/types/zero_trust/access/applications/azure_group_rule.py index 98ebed94f96..51526b8d337 100644 --- a/src/cloudflare/types/zero_trust/azure_group_rule.py +++ b/src/cloudflare/types/zero_trust/access/applications/azure_group_rule.py @@ -3,7 +3,7 @@ from pydantic import Field as FieldInfo -from ..._models import BaseModel +from ....._models import BaseModel __all__ = ["AzureGroupRule", "AzureAD"] diff --git a/src/cloudflare/types/zero_trust/azure_group_rule_param.py b/src/cloudflare/types/zero_trust/access/applications/azure_group_rule_param.py similarity index 93% rename from src/cloudflare/types/zero_trust/azure_group_rule_param.py rename to src/cloudflare/types/zero_trust/access/applications/azure_group_rule_param.py index 6f6a479e1e0..432e67513c8 100644 --- a/src/cloudflare/types/zero_trust/azure_group_rule_param.py +++ b/src/cloudflare/types/zero_trust/access/applications/azure_group_rule_param.py @@ -4,7 +4,7 @@ from typing_extensions import Required, Annotated, TypedDict -from ..._utils import PropertyInfo +from ....._utils import PropertyInfo __all__ = ["AzureGroupRuleParam", "AzureAD"] diff --git a/src/cloudflare/types/zero_trust/certificate_rule.py b/src/cloudflare/types/zero_trust/access/applications/certificate_rule.py similarity index 87% rename from src/cloudflare/types/zero_trust/certificate_rule.py rename to src/cloudflare/types/zero_trust/access/applications/certificate_rule.py index 2792935fd80..9d966c9470e 100644 --- a/src/cloudflare/types/zero_trust/certificate_rule.py +++ b/src/cloudflare/types/zero_trust/access/applications/certificate_rule.py @@ -1,7 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ..._models import BaseModel +from ....._models import BaseModel __all__ = ["CertificateRule", "Certificate"] diff --git a/src/cloudflare/types/zero_trust/certificate_rule_param.py b/src/cloudflare/types/zero_trust/access/applications/certificate_rule_param.py similarity index 100% rename from src/cloudflare/types/zero_trust/certificate_rule_param.py rename to src/cloudflare/types/zero_trust/access/applications/certificate_rule_param.py diff --git a/src/cloudflare/types/zero_trust/country_rule.py b/src/cloudflare/types/zero_trust/access/applications/country_rule.py similarity index 88% rename from src/cloudflare/types/zero_trust/country_rule.py rename to src/cloudflare/types/zero_trust/access/applications/country_rule.py index 060eda47066..b5d3621e345 100644 --- a/src/cloudflare/types/zero_trust/country_rule.py +++ b/src/cloudflare/types/zero_trust/access/applications/country_rule.py @@ -1,7 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ..._models import BaseModel +from ....._models import BaseModel __all__ = ["CountryRule", "Geo"] diff --git a/src/cloudflare/types/zero_trust/country_rule_param.py b/src/cloudflare/types/zero_trust/access/applications/country_rule_param.py similarity index 100% rename from src/cloudflare/types/zero_trust/country_rule_param.py rename to src/cloudflare/types/zero_trust/access/applications/country_rule_param.py diff --git a/src/cloudflare/types/zero_trust/domain_rule.py b/src/cloudflare/types/zero_trust/access/applications/domain_rule.py similarity index 88% rename from src/cloudflare/types/zero_trust/domain_rule.py rename to src/cloudflare/types/zero_trust/access/applications/domain_rule.py index 9bb961498ca..0759ad23bc9 100644 --- a/src/cloudflare/types/zero_trust/domain_rule.py +++ b/src/cloudflare/types/zero_trust/access/applications/domain_rule.py @@ -1,7 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ..._models import BaseModel +from ....._models import BaseModel __all__ = ["DomainRule", "EmailDomain"] diff --git a/src/cloudflare/types/zero_trust/domain_rule_param.py b/src/cloudflare/types/zero_trust/access/applications/domain_rule_param.py similarity index 100% rename from src/cloudflare/types/zero_trust/domain_rule_param.py rename to src/cloudflare/types/zero_trust/access/applications/domain_rule_param.py diff --git a/src/cloudflare/types/zero_trust/email_list_rule.py b/src/cloudflare/types/zero_trust/access/applications/email_list_rule.py similarity index 89% rename from src/cloudflare/types/zero_trust/email_list_rule.py rename to src/cloudflare/types/zero_trust/access/applications/email_list_rule.py index bda960c806a..e1add517571 100644 --- a/src/cloudflare/types/zero_trust/email_list_rule.py +++ b/src/cloudflare/types/zero_trust/access/applications/email_list_rule.py @@ -1,7 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ..._models import BaseModel +from ....._models import BaseModel __all__ = ["EmailListRule", "EmailList"] diff --git a/src/cloudflare/types/zero_trust/email_list_rule_param.py b/src/cloudflare/types/zero_trust/access/applications/email_list_rule_param.py similarity index 100% rename from src/cloudflare/types/zero_trust/email_list_rule_param.py rename to src/cloudflare/types/zero_trust/access/applications/email_list_rule_param.py diff --git a/src/cloudflare/types/zero_trust/email_rule.py b/src/cloudflare/types/zero_trust/access/applications/email_rule.py similarity index 87% rename from src/cloudflare/types/zero_trust/email_rule.py rename to src/cloudflare/types/zero_trust/access/applications/email_rule.py index 2333b69cb11..3f1e6ff3f31 100644 --- a/src/cloudflare/types/zero_trust/email_rule.py +++ b/src/cloudflare/types/zero_trust/access/applications/email_rule.py @@ -1,7 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ..._models import BaseModel +from ....._models import BaseModel __all__ = ["EmailRule", "Email"] diff --git a/src/cloudflare/types/zero_trust/email_rule_param.py b/src/cloudflare/types/zero_trust/access/applications/email_rule_param.py similarity index 100% rename from src/cloudflare/types/zero_trust/email_rule_param.py rename to src/cloudflare/types/zero_trust/access/applications/email_rule_param.py diff --git a/src/cloudflare/types/zero_trust/everyone_rule.py b/src/cloudflare/types/zero_trust/access/applications/everyone_rule.py similarity index 88% rename from src/cloudflare/types/zero_trust/everyone_rule.py rename to src/cloudflare/types/zero_trust/access/applications/everyone_rule.py index a30773cea60..257f7a8ba50 100644 --- a/src/cloudflare/types/zero_trust/everyone_rule.py +++ b/src/cloudflare/types/zero_trust/access/applications/everyone_rule.py @@ -1,7 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ..._models import BaseModel +from ....._models import BaseModel __all__ = ["EveryoneRule", "Everyone"] diff --git a/src/cloudflare/types/zero_trust/everyone_rule_param.py b/src/cloudflare/types/zero_trust/access/applications/everyone_rule_param.py similarity index 100% rename from src/cloudflare/types/zero_trust/everyone_rule_param.py rename to src/cloudflare/types/zero_trust/access/applications/everyone_rule_param.py diff --git a/src/cloudflare/types/zero_trust/external_evaluation_rule.py b/src/cloudflare/types/zero_trust/access/applications/external_evaluation_rule.py similarity index 93% rename from src/cloudflare/types/zero_trust/external_evaluation_rule.py rename to src/cloudflare/types/zero_trust/access/applications/external_evaluation_rule.py index d951576746a..bc674e50d66 100644 --- a/src/cloudflare/types/zero_trust/external_evaluation_rule.py +++ b/src/cloudflare/types/zero_trust/access/applications/external_evaluation_rule.py @@ -1,7 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ..._models import BaseModel +from ....._models import BaseModel __all__ = ["ExternalEvaluationRule", "ExternalEvaluation"] diff --git a/src/cloudflare/types/zero_trust/external_evaluation_rule_param.py b/src/cloudflare/types/zero_trust/access/applications/external_evaluation_rule_param.py similarity index 100% rename from src/cloudflare/types/zero_trust/external_evaluation_rule_param.py rename to src/cloudflare/types/zero_trust/access/applications/external_evaluation_rule_param.py diff --git a/src/cloudflare/types/zero_trust/github_organization_rule.py b/src/cloudflare/types/zero_trust/access/applications/github_organization_rule.py similarity index 94% rename from src/cloudflare/types/zero_trust/github_organization_rule.py rename to src/cloudflare/types/zero_trust/access/applications/github_organization_rule.py index 1f46348cf2b..07eb4ec29d2 100644 --- a/src/cloudflare/types/zero_trust/github_organization_rule.py +++ b/src/cloudflare/types/zero_trust/access/applications/github_organization_rule.py @@ -4,7 +4,7 @@ from pydantic import Field as FieldInfo -from ..._models import BaseModel +from ....._models import BaseModel __all__ = ["GitHubOrganizationRule", "GitHubOrganization"] diff --git a/src/cloudflare/types/zero_trust/github_organization_rule_param.py b/src/cloudflare/types/zero_trust/access/applications/github_organization_rule_param.py similarity index 94% rename from src/cloudflare/types/zero_trust/github_organization_rule_param.py rename to src/cloudflare/types/zero_trust/access/applications/github_organization_rule_param.py index 6825165605c..813dbaa9877 100644 --- a/src/cloudflare/types/zero_trust/github_organization_rule_param.py +++ b/src/cloudflare/types/zero_trust/access/applications/github_organization_rule_param.py @@ -4,7 +4,7 @@ from typing_extensions import Required, Annotated, TypedDict -from ..._utils import PropertyInfo +from ....._utils import PropertyInfo __all__ = ["GitHubOrganizationRuleParam", "GitHubOrganization"] diff --git a/src/cloudflare/types/zero_trust/group_rule.py b/src/cloudflare/types/zero_trust/access/applications/group_rule.py similarity index 88% rename from src/cloudflare/types/zero_trust/group_rule.py rename to src/cloudflare/types/zero_trust/access/applications/group_rule.py index 9813013c6a4..b2481ce88e9 100644 --- a/src/cloudflare/types/zero_trust/group_rule.py +++ b/src/cloudflare/types/zero_trust/access/applications/group_rule.py @@ -1,7 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ..._models import BaseModel +from ....._models import BaseModel __all__ = ["GroupRule", "Group"] diff --git a/src/cloudflare/types/zero_trust/group_rule_param.py b/src/cloudflare/types/zero_trust/access/applications/group_rule_param.py similarity index 100% rename from src/cloudflare/types/zero_trust/group_rule_param.py rename to src/cloudflare/types/zero_trust/access/applications/group_rule_param.py diff --git a/src/cloudflare/types/zero_trust/gsuite_group_rule.py b/src/cloudflare/types/zero_trust/access/applications/gsuite_group_rule.py similarity index 91% rename from src/cloudflare/types/zero_trust/gsuite_group_rule.py rename to src/cloudflare/types/zero_trust/access/applications/gsuite_group_rule.py index a230bf65d6e..bf4130554ac 100644 --- a/src/cloudflare/types/zero_trust/gsuite_group_rule.py +++ b/src/cloudflare/types/zero_trust/access/applications/gsuite_group_rule.py @@ -1,7 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ..._models import BaseModel +from ....._models import BaseModel __all__ = ["GSuiteGroupRule", "GSuite"] diff --git a/src/cloudflare/types/zero_trust/gsuite_group_rule_param.py b/src/cloudflare/types/zero_trust/access/applications/gsuite_group_rule_param.py similarity index 100% rename from src/cloudflare/types/zero_trust/gsuite_group_rule_param.py rename to src/cloudflare/types/zero_trust/access/applications/gsuite_group_rule_param.py diff --git a/src/cloudflare/types/zero_trust/ip_list_rule.py b/src/cloudflare/types/zero_trust/access/applications/ip_list_rule.py similarity index 88% rename from src/cloudflare/types/zero_trust/ip_list_rule.py rename to src/cloudflare/types/zero_trust/access/applications/ip_list_rule.py index aac38b6a5af..11c9f8092f7 100644 --- a/src/cloudflare/types/zero_trust/ip_list_rule.py +++ b/src/cloudflare/types/zero_trust/access/applications/ip_list_rule.py @@ -1,7 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ..._models import BaseModel +from ....._models import BaseModel __all__ = ["IPListRule", "IPList"] diff --git a/src/cloudflare/types/zero_trust/ip_list_rule_param.py b/src/cloudflare/types/zero_trust/access/applications/ip_list_rule_param.py similarity index 100% rename from src/cloudflare/types/zero_trust/ip_list_rule_param.py rename to src/cloudflare/types/zero_trust/access/applications/ip_list_rule_param.py diff --git a/src/cloudflare/types/zero_trust/ip_rule.py b/src/cloudflare/types/zero_trust/access/applications/ip_rule.py similarity index 86% rename from src/cloudflare/types/zero_trust/ip_rule.py rename to src/cloudflare/types/zero_trust/access/applications/ip_rule.py index 9b471986a36..51eb4fd1d22 100644 --- a/src/cloudflare/types/zero_trust/ip_rule.py +++ b/src/cloudflare/types/zero_trust/access/applications/ip_rule.py @@ -1,7 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ..._models import BaseModel +from ....._models import BaseModel __all__ = ["IPRule", "IP"] diff --git a/src/cloudflare/types/zero_trust/ip_rule_param.py b/src/cloudflare/types/zero_trust/access/applications/ip_rule_param.py similarity index 100% rename from src/cloudflare/types/zero_trust/ip_rule_param.py rename to src/cloudflare/types/zero_trust/access/applications/ip_rule_param.py diff --git a/src/cloudflare/types/zero_trust/okta_group_rule.py b/src/cloudflare/types/zero_trust/access/applications/okta_group_rule.py similarity index 90% rename from src/cloudflare/types/zero_trust/okta_group_rule.py rename to src/cloudflare/types/zero_trust/access/applications/okta_group_rule.py index 73dada6b434..6b1fc78e57f 100644 --- a/src/cloudflare/types/zero_trust/okta_group_rule.py +++ b/src/cloudflare/types/zero_trust/access/applications/okta_group_rule.py @@ -1,7 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ..._models import BaseModel +from ....._models import BaseModel __all__ = ["OktaGroupRule", "Okta"] diff --git a/src/cloudflare/types/zero_trust/okta_group_rule_param.py b/src/cloudflare/types/zero_trust/access/applications/okta_group_rule_param.py similarity index 100% rename from src/cloudflare/types/zero_trust/okta_group_rule_param.py rename to src/cloudflare/types/zero_trust/access/applications/okta_group_rule_param.py diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_test_create_params.py b/src/cloudflare/types/zero_trust/access/applications/policy_test_create_params.py index 63d7df7a9ef..29788994d19 100755 --- a/src/cloudflare/types/zero_trust/access/applications/policy_test_create_params.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_test_create_params.py @@ -6,7 +6,7 @@ from typing_extensions import Required, TypedDict from ..decision import Decision -from ...access_rule_param import AccessRuleParam +from .access_rule_param import AccessRuleParam from ..approval_group_param import ApprovalGroupParam __all__ = ["PolicyTestCreateParams", "Policy"] diff --git a/src/cloudflare/types/zero_trust/saml_group_rule.py b/src/cloudflare/types/zero_trust/access/applications/saml_group_rule.py similarity index 92% rename from src/cloudflare/types/zero_trust/saml_group_rule.py rename to src/cloudflare/types/zero_trust/access/applications/saml_group_rule.py index 50d5eeef875..cbb7545a666 100644 --- a/src/cloudflare/types/zero_trust/saml_group_rule.py +++ b/src/cloudflare/types/zero_trust/access/applications/saml_group_rule.py @@ -1,7 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ..._models import BaseModel +from ....._models import BaseModel __all__ = ["SAMLGroupRule", "SAML"] diff --git a/src/cloudflare/types/zero_trust/saml_group_rule_param.py b/src/cloudflare/types/zero_trust/access/applications/saml_group_rule_param.py similarity index 100% rename from src/cloudflare/types/zero_trust/saml_group_rule_param.py rename to src/cloudflare/types/zero_trust/access/applications/saml_group_rule_param.py diff --git a/src/cloudflare/types/zero_trust/service_token_rule.py b/src/cloudflare/types/zero_trust/access/applications/service_token_rule.py similarity index 89% rename from src/cloudflare/types/zero_trust/service_token_rule.py rename to src/cloudflare/types/zero_trust/access/applications/service_token_rule.py index fcf7a8e36b0..3c6afe44590 100644 --- a/src/cloudflare/types/zero_trust/service_token_rule.py +++ b/src/cloudflare/types/zero_trust/access/applications/service_token_rule.py @@ -1,7 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ..._models import BaseModel +from ....._models import BaseModel __all__ = ["ServiceTokenRule", "ServiceToken"] diff --git a/src/cloudflare/types/zero_trust/service_token_rule_param.py b/src/cloudflare/types/zero_trust/access/applications/service_token_rule_param.py similarity index 100% rename from src/cloudflare/types/zero_trust/service_token_rule_param.py rename to src/cloudflare/types/zero_trust/access/applications/service_token_rule_param.py diff --git a/src/cloudflare/types/zero_trust/access/group_create_params.py b/src/cloudflare/types/zero_trust/access/group_create_params.py index 04c7006d842..c507a5fc68f 100644 --- a/src/cloudflare/types/zero_trust/access/group_create_params.py +++ b/src/cloudflare/types/zero_trust/access/group_create_params.py @@ -5,7 +5,7 @@ from typing import Iterable from typing_extensions import Required, TypedDict -from ..access_rule_param import AccessRuleParam +from .applications.access_rule_param import AccessRuleParam __all__ = ["GroupCreateParams"] diff --git a/src/cloudflare/types/zero_trust/access/group_create_response.py b/src/cloudflare/types/zero_trust/access/group_create_response.py index b878764b5bc..c446dabbf35 100644 --- a/src/cloudflare/types/zero_trust/access/group_create_response.py +++ b/src/cloudflare/types/zero_trust/access/group_create_response.py @@ -4,7 +4,7 @@ from datetime import datetime from ...._models import BaseModel -from ..access_rule import AccessRule +from .applications.access_rule import AccessRule __all__ = ["GroupCreateResponse"] diff --git a/src/cloudflare/types/zero_trust/access/group_get_response.py b/src/cloudflare/types/zero_trust/access/group_get_response.py index 5a5e840456a..339f37eb1e5 100644 --- a/src/cloudflare/types/zero_trust/access/group_get_response.py +++ b/src/cloudflare/types/zero_trust/access/group_get_response.py @@ -4,7 +4,7 @@ from datetime import datetime from ...._models import BaseModel -from ..access_rule import AccessRule +from .applications.access_rule import AccessRule __all__ = ["GroupGetResponse"] diff --git a/src/cloudflare/types/zero_trust/access/group_list_response.py b/src/cloudflare/types/zero_trust/access/group_list_response.py index 4f3f9be3b6e..58bb048fb0d 100644 --- a/src/cloudflare/types/zero_trust/access/group_list_response.py +++ b/src/cloudflare/types/zero_trust/access/group_list_response.py @@ -4,7 +4,7 @@ from datetime import datetime from ...._models import BaseModel -from ..access_rule import AccessRule +from .applications.access_rule import AccessRule __all__ = ["GroupListResponse"] diff --git a/src/cloudflare/types/zero_trust/access/group_update_params.py b/src/cloudflare/types/zero_trust/access/group_update_params.py index 68672edb40e..1550b17a52b 100644 --- a/src/cloudflare/types/zero_trust/access/group_update_params.py +++ b/src/cloudflare/types/zero_trust/access/group_update_params.py @@ -5,7 +5,7 @@ from typing import Iterable from typing_extensions import Required, TypedDict -from ..access_rule_param import AccessRuleParam +from .applications.access_rule_param import AccessRuleParam __all__ = ["GroupUpdateParams"] diff --git a/src/cloudflare/types/zero_trust/access/group_update_response.py b/src/cloudflare/types/zero_trust/access/group_update_response.py index 008a09f0bd0..2f7cceec9c8 100644 --- a/src/cloudflare/types/zero_trust/access/group_update_response.py +++ b/src/cloudflare/types/zero_trust/access/group_update_response.py @@ -4,7 +4,7 @@ from datetime import datetime from ...._models import BaseModel -from ..access_rule import AccessRule +from .applications.access_rule import AccessRule __all__ = ["GroupUpdateResponse"] diff --git a/src/cloudflare/types/zero_trust/access/policy_create_params.py b/src/cloudflare/types/zero_trust/access/policy_create_params.py index 921fd57b6a2..5a28867d713 100644 --- a/src/cloudflare/types/zero_trust/access/policy_create_params.py +++ b/src/cloudflare/types/zero_trust/access/policy_create_params.py @@ -6,8 +6,8 @@ from typing_extensions import Required, TypedDict from .decision import Decision -from ..access_rule_param import AccessRuleParam from .approval_group_param import ApprovalGroupParam +from .applications.access_rule_param import AccessRuleParam __all__ = ["PolicyCreateParams"] diff --git a/src/cloudflare/types/zero_trust/access/policy_create_response.py b/src/cloudflare/types/zero_trust/access/policy_create_response.py index 680cc7cd07b..0b3aed6220d 100644 --- a/src/cloudflare/types/zero_trust/access/policy_create_response.py +++ b/src/cloudflare/types/zero_trust/access/policy_create_response.py @@ -6,8 +6,8 @@ from .decision import Decision from ...._models import BaseModel -from ..access_rule import AccessRule from .approval_group import ApprovalGroup +from .applications.access_rule import AccessRule __all__ = ["PolicyCreateResponse"] diff --git a/src/cloudflare/types/zero_trust/access/policy_get_response.py b/src/cloudflare/types/zero_trust/access/policy_get_response.py index bfa6be1d5d5..0c51e5cca00 100644 --- a/src/cloudflare/types/zero_trust/access/policy_get_response.py +++ b/src/cloudflare/types/zero_trust/access/policy_get_response.py @@ -6,8 +6,8 @@ from .decision import Decision from ...._models import BaseModel -from ..access_rule import AccessRule from .approval_group import ApprovalGroup +from .applications.access_rule import AccessRule __all__ = ["PolicyGetResponse"] diff --git a/src/cloudflare/types/zero_trust/access/policy_list_response.py b/src/cloudflare/types/zero_trust/access/policy_list_response.py index f32b6f0eee3..af20dea0f36 100644 --- a/src/cloudflare/types/zero_trust/access/policy_list_response.py +++ b/src/cloudflare/types/zero_trust/access/policy_list_response.py @@ -6,8 +6,8 @@ from .decision import Decision from ...._models import BaseModel -from ..access_rule import AccessRule from .approval_group import ApprovalGroup +from .applications.access_rule import AccessRule __all__ = ["PolicyListResponse"] diff --git a/src/cloudflare/types/zero_trust/access/policy_update_params.py b/src/cloudflare/types/zero_trust/access/policy_update_params.py index 8ec4bdd1c26..b2676c121ae 100644 --- a/src/cloudflare/types/zero_trust/access/policy_update_params.py +++ b/src/cloudflare/types/zero_trust/access/policy_update_params.py @@ -6,8 +6,8 @@ from typing_extensions import Required, TypedDict from .decision import Decision -from ..access_rule_param import AccessRuleParam from .approval_group_param import ApprovalGroupParam +from .applications.access_rule_param import AccessRuleParam __all__ = ["PolicyUpdateParams"] diff --git a/src/cloudflare/types/zero_trust/access/policy_update_response.py b/src/cloudflare/types/zero_trust/access/policy_update_response.py index 4e15ccbb683..bbd9d8cb480 100644 --- a/src/cloudflare/types/zero_trust/access/policy_update_response.py +++ b/src/cloudflare/types/zero_trust/access/policy_update_response.py @@ -6,8 +6,8 @@ from .decision import Decision from ...._models import BaseModel -from ..access_rule import AccessRule from .approval_group import ApprovalGroup +from .applications.access_rule import AccessRule __all__ = ["PolicyUpdateResponse"] From 41e7e17d9ec3bbd795345e7e78478ea126671cf7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 00:37:06 +0000 Subject: [PATCH 062/358] test(r2): skip due to auth failures (#2410) --- tests/api_resources/r2/buckets/test_locks.py | 20 +++++++++++++++++++ .../api_resources/r2/buckets/test_metrics.py | 8 ++++++++ 2 files changed, 28 insertions(+) diff --git a/tests/api_resources/r2/buckets/test_locks.py b/tests/api_resources/r2/buckets/test_locks.py index 841345ef66e..5921965821f 100644 --- a/tests/api_resources/r2/buckets/test_locks.py +++ b/tests/api_resources/r2/buckets/test_locks.py @@ -17,6 +17,7 @@ class TestLocks: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize def test_method_update(self, client: Cloudflare) -> None: lock = client.r2.buckets.locks.update( @@ -25,6 +26,7 @@ def test_method_update(self, client: Cloudflare) -> None: ) assert_matches_type(object, lock, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize def test_method_update_with_all_params(self, client: Cloudflare) -> None: lock = client.r2.buckets.locks.update( @@ -45,6 +47,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: ) assert_matches_type(object, lock, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: response = client.r2.buckets.locks.with_raw_response.update( @@ -57,6 +60,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: lock = response.parse() assert_matches_type(object, lock, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: with client.r2.buckets.locks.with_streaming_response.update( @@ -71,6 +75,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -85,6 +90,7 @@ def test_path_params_update(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", ) + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize def test_method_get(self, client: Cloudflare) -> None: lock = client.r2.buckets.locks.get( @@ -93,6 +99,7 @@ def test_method_get(self, client: Cloudflare) -> None: ) assert_matches_type(LockGetResponse, lock, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize def test_method_get_with_all_params(self, client: Cloudflare) -> None: lock = client.r2.buckets.locks.get( @@ -102,6 +109,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: ) assert_matches_type(LockGetResponse, lock, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: response = client.r2.buckets.locks.with_raw_response.get( @@ -114,6 +122,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: lock = response.parse() assert_matches_type(LockGetResponse, lock, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: with client.r2.buckets.locks.with_streaming_response.get( @@ -128,6 +137,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -146,6 +156,7 @@ def test_path_params_get(self, client: Cloudflare) -> None: class TestAsyncLocks: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize async def test_method_update(self, async_client: AsyncCloudflare) -> None: lock = await async_client.r2.buckets.locks.update( @@ -154,6 +165,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: ) assert_matches_type(object, lock, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: lock = await async_client.r2.buckets.locks.update( @@ -174,6 +186,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare ) assert_matches_type(object, lock, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.r2.buckets.locks.with_raw_response.update( @@ -186,6 +199,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: lock = await response.parse() assert_matches_type(object, lock, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.r2.buckets.locks.with_streaming_response.update( @@ -200,6 +214,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -214,6 +229,7 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", ) + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: lock = await async_client.r2.buckets.locks.get( @@ -222,6 +238,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: ) assert_matches_type(LockGetResponse, lock, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: lock = await async_client.r2.buckets.locks.get( @@ -231,6 +248,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - ) assert_matches_type(LockGetResponse, lock, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.r2.buckets.locks.with_raw_response.get( @@ -243,6 +261,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: lock = await response.parse() assert_matches_type(LockGetResponse, lock, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.r2.buckets.locks.with_streaming_response.get( @@ -257,6 +276,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): diff --git a/tests/api_resources/r2/buckets/test_metrics.py b/tests/api_resources/r2/buckets/test_metrics.py index c1b118c032c..fde55e0bb0e 100644 --- a/tests/api_resources/r2/buckets/test_metrics.py +++ b/tests/api_resources/r2/buckets/test_metrics.py @@ -17,6 +17,7 @@ class TestMetrics: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize def test_method_list(self, client: Cloudflare) -> None: metric = client.r2.buckets.metrics.list( @@ -24,6 +25,7 @@ def test_method_list(self, client: Cloudflare) -> None: ) assert_matches_type(MetricListResponse, metric, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.r2.buckets.metrics.with_raw_response.list( @@ -35,6 +37,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: metric = response.parse() assert_matches_type(MetricListResponse, metric, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.r2.buckets.metrics.with_streaming_response.list( @@ -48,6 +51,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize def test_path_params_list(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -59,6 +63,7 @@ def test_path_params_list(self, client: Cloudflare) -> None: class TestAsyncMetrics: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: metric = await async_client.r2.buckets.metrics.list( @@ -66,6 +71,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: ) assert_matches_type(MetricListResponse, metric, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.r2.buckets.metrics.with_raw_response.list( @@ -77,6 +83,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: metric = await response.parse() assert_matches_type(MetricListResponse, metric, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.r2.buckets.metrics.with_streaming_response.list( @@ -90,6 +97,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): From b01890fb71bec8a29af3254174eda1909ff83519 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 06:13:00 +0000 Subject: [PATCH 063/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 05591bb7ef6..de617f814c7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-04299b899e2bbf8ba1b4ad96d5e9f9c3e0c9b6246bfeac3f9ab684b855b0e412.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8973dde42d42a39c8fbc5f3f1eb1328e6ac0c805ca4d3e5920796749ed58eb0a.yml From 95fb9cbf6f5a61879706e3438982186a079f2929 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 06:17:36 +0000 Subject: [PATCH 064/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index de617f814c7..05591bb7ef6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8973dde42d42a39c8fbc5f3f1eb1328e6ac0c805ca4d3e5920796749ed58eb0a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-04299b899e2bbf8ba1b4ad96d5e9f9c3e0c9b6246bfeac3f9ab684b855b0e412.yml From 3b45a279a6d1cfa7f280fd29399171cac47d6f7f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 06:25:42 +0000 Subject: [PATCH 065/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 05591bb7ef6..de617f814c7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-04299b899e2bbf8ba1b4ad96d5e9f9c3e0c9b6246bfeac3f9ab684b855b0e412.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8973dde42d42a39c8fbc5f3f1eb1328e6ac0c805ca4d3e5920796749ed58eb0a.yml From 35bcfd42354e46fce288b50eb62c684f796743da Mon Sep 17 00:00:00 2001 From: Robert Craigie Date: Fri, 31 Jan 2025 10:18:28 +0000 Subject: [PATCH 066/358] chore(internal): add back missing test imports --- tests/test_client.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_client.py b/tests/test_client.py index 6156413f43c..5387461aab7 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -4,12 +4,15 @@ import gc import os +import sys import json import time import asyncio import inspect +import subprocess import tracemalloc from typing import Any, Union, cast +from textwrap import dedent from unittest import mock from typing_extensions import Literal @@ -1826,4 +1829,4 @@ async def test_main() -> None: process.kill() raise AssertionError("calling get_platform using asyncify resulted in a hung process") - time.sleep(0.1) \ No newline at end of file + time.sleep(0.1) From 79bf7c11be2372317931facf2b53d8aadd84d6a3 Mon Sep 17 00:00:00 2001 From: Robert Craigie Date: Fri, 31 Jan 2025 10:20:04 +0000 Subject: [PATCH 067/358] chore(internal): add missing test dependency --- pyproject.toml | 1 + requirements-dev.lock | 1 + 2 files changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index e4cb7331694..61d14798f8a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,6 +54,7 @@ dev-dependencies = [ "dirty-equals>=0.6.0", "importlib-metadata>=6.7.0", "rich>=13.7.1", + "nest_asyncio==1.6.0", ] [tool.rye.scripts] diff --git a/requirements-dev.lock b/requirements-dev.lock index 633e6e0aadc..3d778db8754 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -51,6 +51,7 @@ mdurl==0.1.2 mypy==1.14.1 mypy-extensions==1.0.0 # via mypy +nest-asyncio==1.6.0 nodeenv==1.8.0 # via pyright nox==2023.4.22 From 52fdd79beaab4253da16b1345bf96670507558f3 Mon Sep 17 00:00:00 2001 From: Robert Craigie Date: Fri, 31 Jan 2025 10:21:33 +0000 Subject: [PATCH 068/358] chore: fix async helper leaving dangling threads under certain cases --- src/cloudflare/_utils/_sync.py | 90 +++++++++++++++------------------- 1 file changed, 40 insertions(+), 50 deletions(-) diff --git a/src/cloudflare/_utils/_sync.py b/src/cloudflare/_utils/_sync.py index d0d810337ec..8b3aaf2b5d2 100644 --- a/src/cloudflare/_utils/_sync.py +++ b/src/cloudflare/_utils/_sync.py @@ -1,56 +1,62 @@ from __future__ import annotations +import sys +import asyncio import functools -from typing import TypeVar, Callable, Awaitable +import contextvars +from typing import Any, TypeVar, Callable, Awaitable from typing_extensions import ParamSpec -import anyio -import anyio.to_thread - -from ._reflection import function_has_argument - T_Retval = TypeVar("T_Retval") T_ParamSpec = ParamSpec("T_ParamSpec") -# copied from `asyncer`, https://github.com/tiangolo/asyncer -def asyncify( - function: Callable[T_ParamSpec, T_Retval], - *, - cancellable: bool = False, - limiter: anyio.CapacityLimiter | None = None, -) -> Callable[T_ParamSpec, Awaitable[T_Retval]]: +if sys.version_info >= (3, 9): + to_thread = asyncio.to_thread +else: + # backport of https://docs.python.org/3/library/asyncio-task.html#asyncio.to_thread + # for Python 3.8 support + async def to_thread( + func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs + ) -> Any: + """Asynchronously run function *func* in a separate thread. + + Any *args and **kwargs supplied for this function are directly passed + to *func*. Also, the current :class:`contextvars.Context` is propagated, + allowing context variables from the main thread to be accessed in the + separate thread. + + Returns a coroutine that can be awaited to get the eventual result of *func*. + """ + loop = asyncio.events.get_running_loop() + ctx = contextvars.copy_context() + func_call = functools.partial(ctx.run, func, *args, **kwargs) + return await loop.run_in_executor(None, func_call) + + +# inspired by `asyncer`, https://github.com/tiangolo/asyncer +def asyncify(function: Callable[T_ParamSpec, T_Retval]) -> Callable[T_ParamSpec, Awaitable[T_Retval]]: """ Take a blocking function and create an async one that receives the same - positional and keyword arguments, and that when called, calls the original function - in a worker thread using `anyio.to_thread.run_sync()`. Internally, - `asyncer.asyncify()` uses the same `anyio.to_thread.run_sync()`, but it supports - keyword arguments additional to positional arguments and it adds better support for - autocompletion and inline errors for the arguments of the function called and the - return value. - - If the `cancellable` option is enabled and the task waiting for its completion is - cancelled, the thread will still run its course but its return value (or any raised - exception) will be ignored. + positional and keyword arguments. For python version 3.9 and above, it uses + asyncio.to_thread to run the function in a separate thread. For python version + 3.8, it uses locally defined copy of the asyncio.to_thread function which was + introduced in python 3.9. - Use it like this: + Usage: - ```Python - def do_work(arg1, arg2, kwarg1="", kwarg2="") -> str: - # Do work - return "Some result" + ```python + def blocking_func(arg1, arg2, kwarg1=None): + # blocking code + return result - result = await to_thread.asyncify(do_work)("spam", "ham", kwarg1="a", kwarg2="b") - print(result) + result = asyncify(blocking_function)(arg1, arg2, kwarg1=value1) ``` ## Arguments `function`: a blocking regular callable (e.g. a function) - `cancellable`: `True` to allow cancellation of the operation - `limiter`: capacity limiter to use to limit the total amount of threads running - (if omitted, the default limiter is used) ## Return @@ -60,22 +66,6 @@ def do_work(arg1, arg2, kwarg1="", kwarg2="") -> str: """ async def wrapper(*args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs) -> T_Retval: - partial_f = functools.partial(function, *args, **kwargs) - - # In `v4.1.0` anyio added the `abandon_on_cancel` argument and deprecated the old - # `cancellable` argument, so we need to use the new `abandon_on_cancel` to avoid - # surfacing deprecation warnings. - if function_has_argument(anyio.to_thread.run_sync, "abandon_on_cancel"): - return await anyio.to_thread.run_sync( - partial_f, - abandon_on_cancel=cancellable, - limiter=limiter, - ) - - return await anyio.to_thread.run_sync( - partial_f, - cancellable=cancellable, - limiter=limiter, - ) + return await to_thread(function, *args, **kwargs) return wrapper From b9ea5e3c095ac23f00158c364a327f9a2d1d1739 Mon Sep 17 00:00:00 2001 From: Robert Craigie Date: Fri, 31 Jan 2025 10:23:20 +0000 Subject: [PATCH 069/358] chore(tests): fix mising password param --- .../api_resources/hyperdrive/test_configs.py | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/api_resources/hyperdrive/test_configs.py b/tests/api_resources/hyperdrive/test_configs.py index 45973d90dc5..1eca48b91d3 100644 --- a/tests/api_resources/hyperdrive/test_configs.py +++ b/tests/api_resources/hyperdrive/test_configs.py @@ -33,6 +33,7 @@ def test_method_create(self, client: Cloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", + "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -49,6 +50,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", + "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -66,6 +68,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", + "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -86,6 +89,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", + "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -109,6 +113,7 @@ def test_path_params_create(self, client: Cloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", + "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -125,6 +130,7 @@ def test_method_update(self, client: Cloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", + "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -142,6 +148,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", + "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -160,6 +167,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", + "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -181,6 +189,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", + "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -205,6 +214,7 @@ def test_path_params_update(self, client: Cloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", + "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -219,6 +229,7 @@ def test_path_params_update(self, client: Cloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", + "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -440,6 +451,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", + "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -456,6 +468,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare origin={ "database": "postgres", "host": "database.example.com", + "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -473,6 +486,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", + "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -493,6 +507,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> origin={ "database": "postgres", "host": "database.example.com", + "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -516,6 +531,7 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", + "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -532,6 +548,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", + "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -549,6 +566,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare origin={ "database": "postgres", "host": "database.example.com", + "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -567,6 +585,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", + "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -588,6 +607,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> origin={ "database": "postgres", "host": "database.example.com", + "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -612,6 +632,7 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", + "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", @@ -626,6 +647,7 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: origin={ "database": "postgres", "host": "database.example.com", + "password": "password", "port": 5432, "scheme": "postgres", "user": "postgres", From 58ced28ba034cd0a62b730ac8d5c0dacb2f62ea2 Mon Sep 17 00:00:00 2001 From: Robert Craigie Date: Fri, 31 Jan 2025 10:31:43 +0000 Subject: [PATCH 070/358] chore: revert request tracers change --- src/cloudflare/types/request_tracers/trace.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/cloudflare/types/request_tracers/trace.py b/src/cloudflare/types/request_tracers/trace.py index 194a007e285..873b2412404 100644 --- a/src/cloudflare/types/request_tracers/trace.py +++ b/src/cloudflare/types/request_tracers/trace.py @@ -2,10 +2,16 @@ from __future__ import annotations -from typing_extensions import List, TypeAlias +from typing_extensions import TYPE_CHECKING, List, TypeAlias, TypeAliasType + +from ..._compat import PYDANTIC_V2 __all__ = ["Trace"] -Trace: TypeAlias = List["TraceItem"] + +if TYPE_CHECKING or PYDANTIC_V2: + Trace = TypeAliasType("Trace", List["TraceItem"]) +else: + Trace: TypeAlias = List["TraceItem"] from .trace_item import TraceItem From 1767baf17fe0f4e11c24f039de9c9044fcb3c894 Mon Sep 17 00:00:00 2001 From: Robert Craigie Date: Fri, 31 Jan 2025 10:38:09 +0000 Subject: [PATCH 071/358] chore(types): fix ApplicationPolicy imports --- src/cloudflare/types/zero_trust/access/application_policy.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cloudflare/types/zero_trust/access/application_policy.py b/src/cloudflare/types/zero_trust/access/application_policy.py index a1baa07d1b6..84e3190f0ef 100644 --- a/src/cloudflare/types/zero_trust/access/application_policy.py +++ b/src/cloudflare/types/zero_trust/access/application_policy.py @@ -1,12 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from __future__ import annotations + from typing import List, Optional from datetime import datetime from .decision import Decision from ...._models import BaseModel from .approval_group import ApprovalGroup -from .applications.access_rule import AccessRule __all__ = ["ApplicationPolicy"] @@ -74,3 +75,5 @@ class ApplicationPolicy(BaseModel): """ updated_at: Optional[datetime] = None + +from .applications.access_rule import AccessRule From b69744f45b76ecc8cdc9926c97338fc06cd03e6d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 10:59:15 +0000 Subject: [PATCH 072/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index de617f814c7..05591bb7ef6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8973dde42d42a39c8fbc5f3f1eb1328e6ac0c805ca4d3e5920796749ed58eb0a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-04299b899e2bbf8ba1b4ad96d5e9f9c3e0c9b6246bfeac3f9ab684b855b0e412.yml From be6603f8021b6d5777cf8365874bb967152abea4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 11:02:38 +0000 Subject: [PATCH 073/358] chore(internal): fix path params tests (#2411) --- tests/api_resources/dns/test_settings.py | 16 +- .../firewall/test_access_rules.py | 52 +- .../logpush/datasets/test_fields.py | 12 +- .../logpush/datasets/test_jobs.py | 12 +- tests/api_resources/logpush/test_jobs.py | 40 +- tests/api_resources/logpush/test_ownership.py | 16 +- tests/api_resources/logpush/test_validate.py | 24 +- .../rulesets/phases/test_versions.py | 20 +- tests/api_resources/rulesets/test_phases.py | 16 +- tests/api_resources/rulesets/test_rules.py | 520 +++++++++--------- tests/api_resources/rulesets/test_versions.py | 44 +- .../security_center/insights/test_class_.py | 8 +- .../security_center/insights/test_severity.py | 8 +- .../security_center/insights/test_type.py | 8 +- .../security_center/test_insights.py | 20 +- tests/api_resources/test_rulesets.py | 52 +- .../access/applications/test_cas.py | 44 +- .../access/applications/test_policies.py | 72 +-- .../applications/test_user_policy_checks.py | 12 +- .../access/certificates/test_settings.py | 16 +- .../zero_trust/access/test_applications.py | 224 ++++---- .../zero_trust/access/test_certificates.py | 52 +- .../zero_trust/access/test_groups.py | 52 +- .../zero_trust/access/test_service_tokens.py | 52 +- .../zero_trust/test_identity_providers.py | 312 +++++------ .../zero_trust/test_organizations.py | 32 +- 26 files changed, 868 insertions(+), 868 deletions(-) diff --git a/tests/api_resources/dns/test_settings.py b/tests/api_resources/dns/test_settings.py index 8c453b87f88..f2501e2d9f7 100644 --- a/tests/api_resources/dns/test_settings.py +++ b/tests/api_resources/dns/test_settings.py @@ -81,12 +81,12 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="HTTP 422 from prism") @parametrize def test_path_params_edit(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.dns.settings.with_raw_response.edit( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.dns.settings.with_raw_response.edit( account_id="account_id", ) @@ -136,12 +136,12 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="HTTP 422 from prism") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.dns.settings.with_raw_response.get( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.dns.settings.with_raw_response.get( account_id="account_id", ) @@ -214,12 +214,12 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip(reason="HTTP 422 from prism") @parametrize async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.dns.settings.with_raw_response.edit( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.dns.settings.with_raw_response.edit( account_id="account_id", ) @@ -269,12 +269,12 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="HTTP 422 from prism") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.dns.settings.with_raw_response.get( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.dns.settings.with_raw_response.get( account_id="account_id", ) diff --git a/tests/api_resources/firewall/test_access_rules.py b/tests/api_resources/firewall/test_access_rules.py index 0e1faa1b86e..e9d1e70cafc 100644 --- a/tests/api_resources/firewall/test_access_rules.py +++ b/tests/api_resources/firewall/test_access_rules.py @@ -81,14 +81,14 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.firewall.access_rules.with_raw_response.create( configuration={}, mode="block", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.firewall.access_rules.with_raw_response.create( configuration={}, mode="block", @@ -151,12 +151,12 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.firewall.access_rules.with_raw_response.list( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.firewall.access_rules.with_raw_response.list( account_id="account_id", ) @@ -210,19 +210,19 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.firewall.access_rules.with_raw_response.delete( rule_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.firewall.access_rules.with_raw_response.delete( rule_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.firewall.access_rules.with_raw_response.delete( rule_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="account_id", @@ -289,7 +289,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.firewall.access_rules.with_raw_response.edit( rule_id="", configuration={}, @@ -297,7 +297,7 @@ def test_path_params_edit(self, client: Cloudflare) -> None: account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.firewall.access_rules.with_raw_response.edit( rule_id="023e105f4ecef8ad9ca31a8372d0c353", configuration={}, @@ -305,7 +305,7 @@ def test_path_params_edit(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.firewall.access_rules.with_raw_response.edit( rule_id="023e105f4ecef8ad9ca31a8372d0c353", configuration={}, @@ -362,19 +362,19 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.firewall.access_rules.with_raw_response.get( rule_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.firewall.access_rules.with_raw_response.get( rule_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.firewall.access_rules.with_raw_response.get( rule_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="account_id", @@ -441,14 +441,14 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.firewall.access_rules.with_raw_response.create( configuration={}, mode="block", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.firewall.access_rules.with_raw_response.create( configuration={}, mode="block", @@ -511,12 +511,12 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.firewall.access_rules.with_raw_response.list( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.firewall.access_rules.with_raw_response.list( account_id="account_id", ) @@ -570,19 +570,19 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.firewall.access_rules.with_raw_response.delete( rule_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.firewall.access_rules.with_raw_response.delete( rule_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.firewall.access_rules.with_raw_response.delete( rule_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="account_id", @@ -649,7 +649,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.firewall.access_rules.with_raw_response.edit( rule_id="", configuration={}, @@ -657,7 +657,7 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.firewall.access_rules.with_raw_response.edit( rule_id="023e105f4ecef8ad9ca31a8372d0c353", configuration={}, @@ -665,7 +665,7 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.firewall.access_rules.with_raw_response.edit( rule_id="023e105f4ecef8ad9ca31a8372d0c353", configuration={}, @@ -722,19 +722,19 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.firewall.access_rules.with_raw_response.get( rule_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.firewall.access_rules.with_raw_response.get( rule_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.firewall.access_rules.with_raw_response.get( rule_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="account_id", diff --git a/tests/api_resources/logpush/datasets/test_fields.py b/tests/api_resources/logpush/datasets/test_fields.py index 1ef68c66895..0e8296727ac 100644 --- a/tests/api_resources/logpush/datasets/test_fields.py +++ b/tests/api_resources/logpush/datasets/test_fields.py @@ -65,19 +65,19 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.logpush.datasets.fields.with_raw_response.get( dataset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.logpush.datasets.fields.with_raw_response.get( dataset_id="gateway_dns", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.logpush.datasets.fields.with_raw_response.get( dataset_id="gateway_dns", account_id="account_id", @@ -136,19 +136,19 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.logpush.datasets.fields.with_raw_response.get( dataset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.logpush.datasets.fields.with_raw_response.get( dataset_id="gateway_dns", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.logpush.datasets.fields.with_raw_response.get( dataset_id="gateway_dns", account_id="account_id", diff --git a/tests/api_resources/logpush/datasets/test_jobs.py b/tests/api_resources/logpush/datasets/test_jobs.py index 98ffb1c6a53..594efaff812 100644 --- a/tests/api_resources/logpush/datasets/test_jobs.py +++ b/tests/api_resources/logpush/datasets/test_jobs.py @@ -66,19 +66,19 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.logpush.datasets.jobs.with_raw_response.get( dataset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.logpush.datasets.jobs.with_raw_response.get( dataset_id="gateway_dns", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.logpush.datasets.jobs.with_raw_response.get( dataset_id="gateway_dns", account_id="account_id", @@ -137,19 +137,19 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.logpush.datasets.jobs.with_raw_response.get( dataset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.logpush.datasets.jobs.with_raw_response.get( dataset_id="gateway_dns", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.logpush.datasets.jobs.with_raw_response.get( dataset_id="gateway_dns", account_id="account_id", diff --git a/tests/api_resources/logpush/test_jobs.py b/tests/api_resources/logpush/test_jobs.py index 0674d1ec883..393234e2371 100644 --- a/tests/api_resources/logpush/test_jobs.py +++ b/tests/api_resources/logpush/test_jobs.py @@ -91,13 +91,13 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.logpush.jobs.with_raw_response.create( destination_conf="s3://mybucket/logs?region=us-west-2", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.logpush.jobs.with_raw_response.create( destination_conf="s3://mybucket/logs?region=us-west-2", account_id="account_id", @@ -176,13 +176,13 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.logpush.jobs.with_raw_response.update( job_id=1, account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.logpush.jobs.with_raw_response.update( job_id=1, account_id="account_id", @@ -233,12 +233,12 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.logpush.jobs.with_raw_response.list( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.logpush.jobs.with_raw_response.list( account_id="account_id", ) @@ -292,13 +292,13 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.logpush.jobs.with_raw_response.delete( job_id=1, account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.logpush.jobs.with_raw_response.delete( job_id=1, account_id="account_id", @@ -353,13 +353,13 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.logpush.jobs.with_raw_response.get( job_id=1, account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.logpush.jobs.with_raw_response.get( job_id=1, account_id="account_id", @@ -442,13 +442,13 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.logpush.jobs.with_raw_response.create( destination_conf="s3://mybucket/logs?region=us-west-2", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.logpush.jobs.with_raw_response.create( destination_conf="s3://mybucket/logs?region=us-west-2", account_id="account_id", @@ -527,13 +527,13 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.logpush.jobs.with_raw_response.update( job_id=1, account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.logpush.jobs.with_raw_response.update( job_id=1, account_id="account_id", @@ -584,12 +584,12 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.logpush.jobs.with_raw_response.list( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.logpush.jobs.with_raw_response.list( account_id="account_id", ) @@ -643,13 +643,13 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.logpush.jobs.with_raw_response.delete( job_id=1, account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.logpush.jobs.with_raw_response.delete( job_id=1, account_id="account_id", @@ -704,13 +704,13 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.logpush.jobs.with_raw_response.get( job_id=1, account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.logpush.jobs.with_raw_response.get( job_id=1, account_id="account_id", diff --git a/tests/api_resources/logpush/test_ownership.py b/tests/api_resources/logpush/test_ownership.py index c2d9297623c..4ad4830713f 100644 --- a/tests/api_resources/logpush/test_ownership.py +++ b/tests/api_resources/logpush/test_ownership.py @@ -69,13 +69,13 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.logpush.ownership.with_raw_response.create( destination_conf="s3://mybucket/logs?region=us-west-2", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.logpush.ownership.with_raw_response.create( destination_conf="s3://mybucket/logs?region=us-west-2", account_id="account_id", @@ -134,14 +134,14 @@ def test_streaming_response_validate(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_validate(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.logpush.ownership.with_raw_response.validate( destination_conf="s3://mybucket/logs?region=us-west-2", ownership_challenge="00000000000000000000", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.logpush.ownership.with_raw_response.validate( destination_conf="s3://mybucket/logs?region=us-west-2", ownership_challenge="00000000000000000000", @@ -201,13 +201,13 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.logpush.ownership.with_raw_response.create( destination_conf="s3://mybucket/logs?region=us-west-2", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.logpush.ownership.with_raw_response.create( destination_conf="s3://mybucket/logs?region=us-west-2", account_id="account_id", @@ -266,14 +266,14 @@ async def test_streaming_response_validate(self, async_client: AsyncCloudflare) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_validate(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.logpush.ownership.with_raw_response.validate( destination_conf="s3://mybucket/logs?region=us-west-2", ownership_challenge="00000000000000000000", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.logpush.ownership.with_raw_response.validate( destination_conf="s3://mybucket/logs?region=us-west-2", ownership_challenge="00000000000000000000", diff --git a/tests/api_resources/logpush/test_validate.py b/tests/api_resources/logpush/test_validate.py index 3a7d1dbf97c..1912c05f201 100644 --- a/tests/api_resources/logpush/test_validate.py +++ b/tests/api_resources/logpush/test_validate.py @@ -70,13 +70,13 @@ def test_streaming_response_destination(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_destination(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.logpush.validate.with_raw_response.destination( destination_conf="s3://mybucket/logs?region=us-west-2", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.logpush.validate.with_raw_response.destination( destination_conf="s3://mybucket/logs?region=us-west-2", account_id="account_id", @@ -131,13 +131,13 @@ def test_streaming_response_destination_exists(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_destination_exists(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.logpush.validate.with_raw_response.destination_exists( destination_conf="s3://mybucket/logs?region=us-west-2", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.logpush.validate.with_raw_response.destination_exists( destination_conf="s3://mybucket/logs?region=us-west-2", account_id="account_id", @@ -192,13 +192,13 @@ def test_streaming_response_origin(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_origin(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.logpush.validate.with_raw_response.origin( logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.logpush.validate.with_raw_response.origin( logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339", account_id="account_id", @@ -257,13 +257,13 @@ async def test_streaming_response_destination(self, async_client: AsyncCloudflar @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_destination(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.logpush.validate.with_raw_response.destination( destination_conf="s3://mybucket/logs?region=us-west-2", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.logpush.validate.with_raw_response.destination( destination_conf="s3://mybucket/logs?region=us-west-2", account_id="account_id", @@ -318,13 +318,13 @@ async def test_streaming_response_destination_exists(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_destination_exists(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.logpush.validate.with_raw_response.destination_exists( destination_conf="s3://mybucket/logs?region=us-west-2", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.logpush.validate.with_raw_response.destination_exists( destination_conf="s3://mybucket/logs?region=us-west-2", account_id="account_id", @@ -379,13 +379,13 @@ async def test_streaming_response_origin(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_origin(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.logpush.validate.with_raw_response.origin( logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.logpush.validate.with_raw_response.origin( logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339", account_id="account_id", diff --git a/tests/api_resources/rulesets/phases/test_versions.py b/tests/api_resources/rulesets/phases/test_versions.py index e26929d3ab5..95f0a8ac58c 100644 --- a/tests/api_resources/rulesets/phases/test_versions.py +++ b/tests/api_resources/rulesets/phases/test_versions.py @@ -67,13 +67,13 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.phases.versions.with_raw_response.list( ruleset_phase="ddos_l4", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.phases.versions.with_raw_response.list( ruleset_phase="ddos_l4", account_id="account_id", @@ -132,21 +132,21 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_version` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.phases.versions.with_raw_response.get( ruleset_version="", ruleset_phase="ddos_l4", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.phases.versions.with_raw_response.get( ruleset_version="1", ruleset_phase="ddos_l4", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.phases.versions.with_raw_response.get( ruleset_version="1", ruleset_phase="ddos_l4", @@ -206,13 +206,13 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.phases.versions.with_raw_response.list( ruleset_phase="ddos_l4", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.phases.versions.with_raw_response.list( ruleset_phase="ddos_l4", account_id="account_id", @@ -271,21 +271,21 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_version` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.phases.versions.with_raw_response.get( ruleset_version="", ruleset_phase="ddos_l4", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.phases.versions.with_raw_response.get( ruleset_version="1", ruleset_phase="ddos_l4", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.phases.versions.with_raw_response.get( ruleset_version="1", ruleset_phase="ddos_l4", diff --git a/tests/api_resources/rulesets/test_phases.py b/tests/api_resources/rulesets/test_phases.py index 6a4a3d57cab..6aa23e7fcab 100644 --- a/tests/api_resources/rulesets/test_phases.py +++ b/tests/api_resources/rulesets/test_phases.py @@ -103,14 +103,14 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.phases.with_raw_response.update( ruleset_phase="ddos_l4", rules=[{}], account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.phases.with_raw_response.update( ruleset_phase="ddos_l4", rules=[{}], @@ -166,13 +166,13 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.phases.with_raw_response.get( ruleset_phase="ddos_l4", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.phases.with_raw_response.get( ruleset_phase="ddos_l4", account_id="account_id", @@ -268,14 +268,14 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.phases.with_raw_response.update( ruleset_phase="ddos_l4", rules=[{}], account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.phases.with_raw_response.update( ruleset_phase="ddos_l4", rules=[{}], @@ -331,13 +331,13 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.phases.with_raw_response.get( ruleset_phase="ddos_l4", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.phases.with_raw_response.get( ruleset_phase="ddos_l4", account_id="account_id", diff --git a/tests/api_resources/rulesets/test_rules.py b/tests/api_resources/rulesets/test_rules.py index 644f4f3952d..1410dd18d50 100644 --- a/tests/api_resources/rulesets/test_rules.py +++ b/tests/api_resources/rulesets/test_rules.py @@ -99,19 +99,19 @@ def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_1(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -189,19 +189,19 @@ def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_2(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -279,19 +279,19 @@ def test_streaming_response_create_overload_3(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_3(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -394,19 +394,19 @@ def test_streaming_response_create_overload_4(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_4(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -484,19 +484,19 @@ def test_streaming_response_create_overload_5(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_5(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -574,19 +574,19 @@ def test_streaming_response_create_overload_6(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_6(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -664,19 +664,19 @@ def test_streaming_response_create_overload_7(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_7(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -764,19 +764,19 @@ def test_streaming_response_create_overload_8(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_8(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -865,19 +865,19 @@ def test_streaming_response_create_overload_9(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_9(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -962,19 +962,19 @@ def test_streaming_response_create_overload_10(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_10(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -1052,19 +1052,19 @@ def test_streaming_response_create_overload_11(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_11(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -1146,19 +1146,19 @@ def test_streaming_response_create_overload_12(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_12(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -1258,19 +1258,19 @@ def test_streaming_response_create_overload_13(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_13(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -1354,19 +1354,19 @@ def test_streaming_response_create_overload_14(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_14(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -1498,19 +1498,19 @@ def test_streaming_response_create_overload_15(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_15(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -1592,19 +1592,19 @@ def test_streaming_response_create_overload_16(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_16(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -1682,19 +1682,19 @@ def test_streaming_response_create_overload_17(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_17(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -1772,19 +1772,19 @@ def test_streaming_response_create_overload_18(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_18(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -1843,28 +1843,28 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.delete( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.delete( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.delete( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.delete( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -1953,28 +1953,28 @@ def test_streaming_response_edit_overload_1(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_1(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -2057,28 +2057,28 @@ def test_streaming_response_edit_overload_2(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_2(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -2161,28 +2161,28 @@ def test_streaming_response_edit_overload_3(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_3(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -2290,28 +2290,28 @@ def test_streaming_response_edit_overload_4(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_4(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -2394,28 +2394,28 @@ def test_streaming_response_edit_overload_5(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_5(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -2498,28 +2498,28 @@ def test_streaming_response_edit_overload_6(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_6(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -2602,28 +2602,28 @@ def test_streaming_response_edit_overload_7(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_7(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -2716,28 +2716,28 @@ def test_streaming_response_edit_overload_8(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_8(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -2831,28 +2831,28 @@ def test_streaming_response_edit_overload_9(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_9(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -2942,28 +2942,28 @@ def test_streaming_response_edit_overload_10(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_10(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -3046,28 +3046,28 @@ def test_streaming_response_edit_overload_11(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_11(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -3154,28 +3154,28 @@ def test_streaming_response_edit_overload_12(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_12(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -3280,28 +3280,28 @@ def test_streaming_response_edit_overload_13(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_13(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -3390,28 +3390,28 @@ def test_streaming_response_edit_overload_14(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_14(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -3548,28 +3548,28 @@ def test_streaming_response_edit_overload_15(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_15(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -3656,28 +3656,28 @@ def test_streaming_response_edit_overload_16(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_16(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -3760,28 +3760,28 @@ def test_streaming_response_edit_overload_17(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_17(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -3864,28 +3864,28 @@ def test_streaming_response_edit_overload_18(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_18(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -3974,19 +3974,19 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_1(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -4064,19 +4064,19 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_2(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -4154,19 +4154,19 @@ async def test_streaming_response_create_overload_3(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_3(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -4269,19 +4269,19 @@ async def test_streaming_response_create_overload_4(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_4(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -4359,19 +4359,19 @@ async def test_streaming_response_create_overload_5(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_5(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -4449,19 +4449,19 @@ async def test_streaming_response_create_overload_6(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_6(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -4539,19 +4539,19 @@ async def test_streaming_response_create_overload_7(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_7(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -4639,19 +4639,19 @@ async def test_streaming_response_create_overload_8(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_8(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -4740,19 +4740,19 @@ async def test_streaming_response_create_overload_9(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_9(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -4837,19 +4837,19 @@ async def test_streaming_response_create_overload_10(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_10(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -4927,19 +4927,19 @@ async def test_streaming_response_create_overload_11(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_11(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -5021,19 +5021,19 @@ async def test_streaming_response_create_overload_12(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_12(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -5133,19 +5133,19 @@ async def test_streaming_response_create_overload_13(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_13(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -5229,19 +5229,19 @@ async def test_streaming_response_create_overload_14(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_14(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -5373,19 +5373,19 @@ async def test_streaming_response_create_overload_15(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_15(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -5467,19 +5467,19 @@ async def test_streaming_response_create_overload_16(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_16(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -5557,19 +5557,19 @@ async def test_streaming_response_create_overload_17(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_17(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -5647,19 +5647,19 @@ async def test_streaming_response_create_overload_18(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_18(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -5718,28 +5718,28 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.delete( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.delete( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.delete( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.delete( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -5828,28 +5828,28 @@ async def test_streaming_response_edit_overload_1(self, async_client: AsyncCloud @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_1(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -5932,28 +5932,28 @@ async def test_streaming_response_edit_overload_2(self, async_client: AsyncCloud @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_2(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -6036,28 +6036,28 @@ async def test_streaming_response_edit_overload_3(self, async_client: AsyncCloud @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_3(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -6165,28 +6165,28 @@ async def test_streaming_response_edit_overload_4(self, async_client: AsyncCloud @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_4(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -6269,28 +6269,28 @@ async def test_streaming_response_edit_overload_5(self, async_client: AsyncCloud @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_5(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -6373,28 +6373,28 @@ async def test_streaming_response_edit_overload_6(self, async_client: AsyncCloud @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_6(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -6477,28 +6477,28 @@ async def test_streaming_response_edit_overload_7(self, async_client: AsyncCloud @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_7(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -6591,28 +6591,28 @@ async def test_streaming_response_edit_overload_8(self, async_client: AsyncCloud @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_8(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -6706,28 +6706,28 @@ async def test_streaming_response_edit_overload_9(self, async_client: AsyncCloud @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_9(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -6817,28 +6817,28 @@ async def test_streaming_response_edit_overload_10(self, async_client: AsyncClou @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_10(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -6921,28 +6921,28 @@ async def test_streaming_response_edit_overload_11(self, async_client: AsyncClou @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_11(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -7029,28 +7029,28 @@ async def test_streaming_response_edit_overload_12(self, async_client: AsyncClou @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_12(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -7155,28 +7155,28 @@ async def test_streaming_response_edit_overload_13(self, async_client: AsyncClou @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_13(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -7265,28 +7265,28 @@ async def test_streaming_response_edit_overload_14(self, async_client: AsyncClou @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_14(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -7423,28 +7423,28 @@ async def test_streaming_response_edit_overload_15(self, async_client: AsyncClou @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_15(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -7531,28 +7531,28 @@ async def test_streaming_response_edit_overload_16(self, async_client: AsyncClou @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_16(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -7635,28 +7635,28 @@ async def test_streaming_response_edit_overload_17(self, async_client: AsyncClou @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_17(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -7739,28 +7739,28 @@ async def test_streaming_response_edit_overload_18(self, async_client: AsyncClou @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_18(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", diff --git a/tests/api_resources/rulesets/test_versions.py b/tests/api_resources/rulesets/test_versions.py index 67582d09bf4..317dff48dfb 100644 --- a/tests/api_resources/rulesets/test_versions.py +++ b/tests/api_resources/rulesets/test_versions.py @@ -67,19 +67,19 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.versions.with_raw_response.list( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.versions.with_raw_response.list( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.versions.with_raw_response.list( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -138,28 +138,28 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.versions.with_raw_response.delete( ruleset_version="1", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_version` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.versions.with_raw_response.delete( ruleset_version="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.versions.with_raw_response.delete( ruleset_version="1", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.versions.with_raw_response.delete( ruleset_version="1", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -219,28 +219,28 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.versions.with_raw_response.get( ruleset_version="1", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_version` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.versions.with_raw_response.get( ruleset_version="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.versions.with_raw_response.get( ruleset_version="1", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.versions.with_raw_response.get( ruleset_version="1", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -300,19 +300,19 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.versions.with_raw_response.list( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.versions.with_raw_response.list( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.versions.with_raw_response.list( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -371,28 +371,28 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.versions.with_raw_response.delete( ruleset_version="1", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_version` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.versions.with_raw_response.delete( ruleset_version="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.versions.with_raw_response.delete( ruleset_version="1", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.versions.with_raw_response.delete( ruleset_version="1", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -452,28 +452,28 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.versions.with_raw_response.get( ruleset_version="1", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_version` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.versions.with_raw_response.get( ruleset_version="", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.versions.with_raw_response.get( ruleset_version="1", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.versions.with_raw_response.get( ruleset_version="1", ruleset_id="2f2feab2026849078ba485f918791bdc", diff --git a/tests/api_resources/security_center/insights/test_class_.py b/tests/api_resources/security_center/insights/test_class_.py index f165bb61c0a..0db301595ce 100644 --- a/tests/api_resources/security_center/insights/test_class_.py +++ b/tests/api_resources/security_center/insights/test_class_.py @@ -68,12 +68,12 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.security_center.insights.class_.with_raw_response.get( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.security_center.insights.class_.with_raw_response.get( account_id="account_id", ) @@ -133,12 +133,12 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.security_center.insights.class_.with_raw_response.get( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.security_center.insights.class_.with_raw_response.get( account_id="account_id", ) diff --git a/tests/api_resources/security_center/insights/test_severity.py b/tests/api_resources/security_center/insights/test_severity.py index 1122a119653..a8ffff6bdf2 100644 --- a/tests/api_resources/security_center/insights/test_severity.py +++ b/tests/api_resources/security_center/insights/test_severity.py @@ -68,12 +68,12 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.security_center.insights.severity.with_raw_response.get( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.security_center.insights.severity.with_raw_response.get( account_id="account_id", ) @@ -133,12 +133,12 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.security_center.insights.severity.with_raw_response.get( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.security_center.insights.severity.with_raw_response.get( account_id="account_id", ) diff --git a/tests/api_resources/security_center/insights/test_type.py b/tests/api_resources/security_center/insights/test_type.py index 45d189b175c..d2e7dfcd83b 100644 --- a/tests/api_resources/security_center/insights/test_type.py +++ b/tests/api_resources/security_center/insights/test_type.py @@ -68,12 +68,12 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.security_center.insights.type.with_raw_response.get( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.security_center.insights.type.with_raw_response.get( account_id="account_id", ) @@ -133,12 +133,12 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.security_center.insights.type.with_raw_response.get( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.security_center.insights.type.with_raw_response.get( account_id="account_id", ) diff --git a/tests/api_resources/security_center/test_insights.py b/tests/api_resources/security_center/test_insights.py index 0aa06ce2162..56b28556e92 100644 --- a/tests/api_resources/security_center/test_insights.py +++ b/tests/api_resources/security_center/test_insights.py @@ -65,19 +65,19 @@ def test_streaming_response_dismiss(self, client: Cloudflare) -> None: @parametrize def test_path_params_dismiss(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `issue_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.security_center.insights.with_raw_response.dismiss( issue_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.security_center.insights.with_raw_response.dismiss( issue_id="issue_id", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.security_center.insights.with_raw_response.dismiss( issue_id="issue_id", account_id="account_id", @@ -136,12 +136,12 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.security_center.insights.with_raw_response.get( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.security_center.insights.with_raw_response.get( account_id="account_id", ) @@ -195,19 +195,19 @@ async def test_streaming_response_dismiss(self, async_client: AsyncCloudflare) - @parametrize async def test_path_params_dismiss(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `issue_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.security_center.insights.with_raw_response.dismiss( issue_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.security_center.insights.with_raw_response.dismiss( issue_id="issue_id", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.security_center.insights.with_raw_response.dismiss( issue_id="issue_id", account_id="account_id", @@ -266,12 +266,12 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.security_center.insights.with_raw_response.get( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.security_center.insights.with_raw_response.get( account_id="account_id", ) diff --git a/tests/api_resources/test_rulesets.py b/tests/api_resources/test_rulesets.py index 766fdff4697..9b7e2cd2da6 100644 --- a/tests/api_resources/test_rulesets.py +++ b/tests/api_resources/test_rulesets.py @@ -116,7 +116,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.with_raw_response.create( kind="managed", name="My ruleset", @@ -125,7 +125,7 @@ def test_path_params_create(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.with_raw_response.create( kind="managed", name="My ruleset", @@ -222,21 +222,21 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.with_raw_response.update( ruleset_id="", rules=[{}], account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.with_raw_response.update( ruleset_id="2f2feab2026849078ba485f918791bdc", rules=[{}], account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.with_raw_response.update( ruleset_id="2f2feab2026849078ba485f918791bdc", rules=[{}], @@ -290,12 +290,12 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.with_raw_response.list( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.with_raw_response.list( account_id="account_id", ) @@ -349,19 +349,19 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.with_raw_response.delete( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.with_raw_response.delete( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.with_raw_response.delete( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -416,19 +416,19 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.with_raw_response.get( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.with_raw_response.get( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.with_raw_response.get( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -531,7 +531,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.with_raw_response.create( kind="managed", name="My ruleset", @@ -540,7 +540,7 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.with_raw_response.create( kind="managed", name="My ruleset", @@ -637,21 +637,21 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.with_raw_response.update( ruleset_id="", rules=[{}], account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.with_raw_response.update( ruleset_id="2f2feab2026849078ba485f918791bdc", rules=[{}], account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.with_raw_response.update( ruleset_id="2f2feab2026849078ba485f918791bdc", rules=[{}], @@ -705,12 +705,12 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.with_raw_response.list( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.with_raw_response.list( account_id="account_id", ) @@ -764,19 +764,19 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.with_raw_response.delete( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.with_raw_response.delete( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.with_raw_response.delete( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -831,19 +831,19 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.with_raw_response.get( ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.with_raw_response.get( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.with_raw_response.get( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", diff --git a/tests/api_resources/zero_trust/access/applications/test_cas.py b/tests/api_resources/zero_trust/access/applications/test_cas.py index 0c4259ce3e3..3f3c397b911 100644 --- a/tests/api_resources/zero_trust/access/applications/test_cas.py +++ b/tests/api_resources/zero_trust/access/applications/test_cas.py @@ -67,19 +67,19 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.cas.with_raw_response.create( app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.cas.with_raw_response.create( app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.cas.with_raw_response.create( app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", @@ -130,12 +130,12 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.cas.with_raw_response.list( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.cas.with_raw_response.list( account_id="account_id", ) @@ -189,19 +189,19 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.cas.with_raw_response.delete( app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.cas.with_raw_response.delete( app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.cas.with_raw_response.delete( app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", @@ -256,19 +256,19 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.cas.with_raw_response.get( app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.cas.with_raw_response.get( app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.cas.with_raw_response.get( app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", @@ -327,19 +327,19 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.cas.with_raw_response.create( app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.cas.with_raw_response.create( app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.cas.with_raw_response.create( app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", @@ -390,12 +390,12 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.cas.with_raw_response.list( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.cas.with_raw_response.list( account_id="account_id", ) @@ -449,19 +449,19 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.cas.with_raw_response.delete( app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.cas.with_raw_response.delete( app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.cas.with_raw_response.delete( app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", @@ -516,19 +516,19 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.cas.with_raw_response.get( app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.cas.with_raw_response.get( app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.cas.with_raw_response.get( app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", diff --git a/tests/api_resources/zero_trust/access/applications/test_policies.py b/tests/api_resources/zero_trust/access/applications/test_policies.py index de3dd7c1c8c..d8288b7b04c 100644 --- a/tests/api_resources/zero_trust/access/applications/test_policies.py +++ b/tests/api_resources/zero_trust/access/applications/test_policies.py @@ -91,19 +91,19 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.policies.with_raw_response.create( app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.policies.with_raw_response.create( app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.policies.with_raw_response.create( app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", @@ -180,28 +180,28 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.policies.with_raw_response.update( policy_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `policy_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.policies.with_raw_response.update( policy_id="", app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.policies.with_raw_response.update( policy_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.policies.with_raw_response.update( policy_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", @@ -257,19 +257,19 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.policies.with_raw_response.list( app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.policies.with_raw_response.list( app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.policies.with_raw_response.list( app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", @@ -328,28 +328,28 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.policies.with_raw_response.delete( policy_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `policy_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.policies.with_raw_response.delete( policy_id="", app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.policies.with_raw_response.delete( policy_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.policies.with_raw_response.delete( policy_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", @@ -409,28 +409,28 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.policies.with_raw_response.get( policy_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `policy_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.policies.with_raw_response.get( policy_id="", app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.policies.with_raw_response.get( policy_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.policies.with_raw_response.get( policy_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", @@ -508,19 +508,19 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.policies.with_raw_response.create( app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.policies.with_raw_response.create( app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.policies.with_raw_response.create( app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", @@ -597,28 +597,28 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.policies.with_raw_response.update( policy_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `policy_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.policies.with_raw_response.update( policy_id="", app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.policies.with_raw_response.update( policy_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.policies.with_raw_response.update( policy_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", @@ -674,19 +674,19 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.policies.with_raw_response.list( app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.policies.with_raw_response.list( app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.policies.with_raw_response.list( app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", @@ -745,28 +745,28 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.policies.with_raw_response.delete( policy_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `policy_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.policies.with_raw_response.delete( policy_id="", app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.policies.with_raw_response.delete( policy_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.policies.with_raw_response.delete( policy_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", @@ -826,28 +826,28 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.policies.with_raw_response.get( policy_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `policy_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.policies.with_raw_response.get( policy_id="", app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.policies.with_raw_response.get( policy_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.policies.with_raw_response.get( policy_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", diff --git a/tests/api_resources/zero_trust/access/applications/test_user_policy_checks.py b/tests/api_resources/zero_trust/access/applications/test_user_policy_checks.py index 44c7286495e..446ccd9f81c 100644 --- a/tests/api_resources/zero_trust/access/applications/test_user_policy_checks.py +++ b/tests/api_resources/zero_trust/access/applications/test_user_policy_checks.py @@ -66,19 +66,19 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.user_policy_checks.with_raw_response.list( app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.user_policy_checks.with_raw_response.list( app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.user_policy_checks.with_raw_response.list( app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="account_id", @@ -137,19 +137,19 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.user_policy_checks.with_raw_response.list( app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.user_policy_checks.with_raw_response.list( app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.user_policy_checks.with_raw_response.list( app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="account_id", diff --git a/tests/api_resources/zero_trust/access/certificates/test_settings.py b/tests/api_resources/zero_trust/access/certificates/test_settings.py index aa5d1334f74..32f63385133 100644 --- a/tests/api_resources/zero_trust/access/certificates/test_settings.py +++ b/tests/api_resources/zero_trust/access/certificates/test_settings.py @@ -93,7 +93,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.certificates.settings.with_raw_response.update( settings=[ { @@ -105,7 +105,7 @@ def test_path_params_update(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.certificates.settings.with_raw_response.update( settings=[ { @@ -162,12 +162,12 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.certificates.settings.with_raw_response.get( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.certificates.settings.with_raw_response.get( account_id="account_id", ) @@ -249,7 +249,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.certificates.settings.with_raw_response.update( settings=[ { @@ -261,7 +261,7 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.certificates.settings.with_raw_response.update( settings=[ { @@ -318,12 +318,12 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.certificates.settings.with_raw_response.get( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.certificates.settings.with_raw_response.get( account_id="account_id", ) diff --git a/tests/api_resources/zero_trust/access/test_applications.py b/tests/api_resources/zero_trust/access/test_applications.py index 3b041b0653f..776599ca547 100644 --- a/tests/api_resources/zero_trust/access/test_applications.py +++ b/tests/api_resources/zero_trust/access/test_applications.py @@ -172,14 +172,14 @@ def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_1(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.create( domain="test.example.com/admin", type="self_hosted", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.create( domain="test.example.com/admin", type="self_hosted", @@ -297,12 +297,12 @@ def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_2(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.create( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.create( account_id="account_id", ) @@ -455,14 +455,14 @@ def test_streaming_response_create_overload_3(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_3(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.create( domain="test.example.com/admin", type="ssh", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.create( domain="test.example.com/admin", type="ssh", @@ -617,14 +617,14 @@ def test_streaming_response_create_overload_4(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_4(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.create( domain="test.example.com/admin", type="vnc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.create( domain="test.example.com/admin", type="vnc", @@ -731,13 +731,13 @@ def test_streaming_response_create_overload_5(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_5(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.create( type="self_hosted", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.create( type="self_hosted", account_id="account_id", @@ -843,13 +843,13 @@ def test_streaming_response_create_overload_6(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_6(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.create( type="self_hosted", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.create( type="self_hosted", account_id="account_id", @@ -955,13 +955,13 @@ def test_streaming_response_create_overload_7(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_7(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.create( type="self_hosted", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.create( type="self_hosted", account_id="account_id", @@ -1043,12 +1043,12 @@ def test_streaming_response_create_overload_8(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_8(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.create( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.create( account_id="account_id", ) @@ -1146,7 +1146,7 @@ def test_streaming_response_create_overload_9(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_9(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.create( target_criteria=[ { @@ -1159,7 +1159,7 @@ def test_path_params_create_overload_9(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.create( target_criteria=[ { @@ -1324,7 +1324,7 @@ def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_1(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="", domain="test.example.com/admin", @@ -1332,7 +1332,7 @@ def test_path_params_update_overload_1(self, client: Cloudflare) -> None: account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", @@ -1340,7 +1340,7 @@ def test_path_params_update_overload_1(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", @@ -1463,19 +1463,19 @@ def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_2(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="account_id", @@ -1633,7 +1633,7 @@ def test_streaming_response_update_overload_3(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_3(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="", domain="test.example.com/admin", @@ -1641,7 +1641,7 @@ def test_path_params_update_overload_3(self, client: Cloudflare) -> None: account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", @@ -1649,7 +1649,7 @@ def test_path_params_update_overload_3(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", @@ -1809,7 +1809,7 @@ def test_streaming_response_update_overload_4(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_4(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="", domain="test.example.com/admin", @@ -1817,7 +1817,7 @@ def test_path_params_update_overload_4(self, client: Cloudflare) -> None: account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", @@ -1825,7 +1825,7 @@ def test_path_params_update_overload_4(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", @@ -1937,21 +1937,21 @@ def test_streaming_response_update_overload_5(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_5(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="", type="self_hosted", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", type="self_hosted", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", type="self_hosted", @@ -2062,21 +2062,21 @@ def test_streaming_response_update_overload_6(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_6(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="", type="self_hosted", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", type="self_hosted", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", type="self_hosted", @@ -2187,21 +2187,21 @@ def test_streaming_response_update_overload_7(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_7(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="", type="self_hosted", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", type="self_hosted", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", type="self_hosted", @@ -2288,19 +2288,19 @@ def test_streaming_response_update_overload_8(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_8(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="account_id", @@ -2403,7 +2403,7 @@ def test_streaming_response_update_overload_9(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_9(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="", target_criteria=[ @@ -2417,7 +2417,7 @@ def test_path_params_update_overload_9(self, client: Cloudflare) -> None: account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", target_criteria=[ @@ -2431,7 +2431,7 @@ def test_path_params_update_overload_9(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", target_criteria=[ @@ -2494,12 +2494,12 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.list( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.list( account_id="account_id", ) @@ -2553,19 +2553,19 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.delete( app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.delete( app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.delete( app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="account_id", @@ -2620,19 +2620,19 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.get( app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.get( app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.get( app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="account_id", @@ -2687,19 +2687,19 @@ def test_streaming_response_revoke_tokens(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_revoke_tokens(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.revoke_tokens( app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.revoke_tokens( app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.revoke_tokens( app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="account_id", @@ -2857,14 +2857,14 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_1(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( domain="test.example.com/admin", type="self_hosted", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( domain="test.example.com/admin", type="self_hosted", @@ -2982,12 +2982,12 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_2(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( account_id="account_id", ) @@ -3140,14 +3140,14 @@ async def test_streaming_response_create_overload_3(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_3(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( domain="test.example.com/admin", type="ssh", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( domain="test.example.com/admin", type="ssh", @@ -3302,14 +3302,14 @@ async def test_streaming_response_create_overload_4(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_4(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( domain="test.example.com/admin", type="vnc", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( domain="test.example.com/admin", type="vnc", @@ -3416,13 +3416,13 @@ async def test_streaming_response_create_overload_5(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_5(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( type="self_hosted", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( type="self_hosted", account_id="account_id", @@ -3528,13 +3528,13 @@ async def test_streaming_response_create_overload_6(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_6(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( type="self_hosted", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( type="self_hosted", account_id="account_id", @@ -3640,13 +3640,13 @@ async def test_streaming_response_create_overload_7(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_7(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( type="self_hosted", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( type="self_hosted", account_id="account_id", @@ -3728,12 +3728,12 @@ async def test_streaming_response_create_overload_8(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_8(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( account_id="account_id", ) @@ -3831,7 +3831,7 @@ async def test_streaming_response_create_overload_9(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_9(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( target_criteria=[ { @@ -3844,7 +3844,7 @@ async def test_path_params_create_overload_9(self, async_client: AsyncCloudflare account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( target_criteria=[ { @@ -4009,7 +4009,7 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_1(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="", domain="test.example.com/admin", @@ -4017,7 +4017,7 @@ async def test_path_params_update_overload_1(self, async_client: AsyncCloudflare account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", @@ -4025,7 +4025,7 @@ async def test_path_params_update_overload_1(self, async_client: AsyncCloudflare account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", @@ -4148,19 +4148,19 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="account_id", @@ -4318,7 +4318,7 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_3(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="", domain="test.example.com/admin", @@ -4326,7 +4326,7 @@ async def test_path_params_update_overload_3(self, async_client: AsyncCloudflare account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", @@ -4334,7 +4334,7 @@ async def test_path_params_update_overload_3(self, async_client: AsyncCloudflare account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", @@ -4494,7 +4494,7 @@ async def test_streaming_response_update_overload_4(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_4(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="", domain="test.example.com/admin", @@ -4502,7 +4502,7 @@ async def test_path_params_update_overload_4(self, async_client: AsyncCloudflare account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", @@ -4510,7 +4510,7 @@ async def test_path_params_update_overload_4(self, async_client: AsyncCloudflare account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", @@ -4622,21 +4622,21 @@ async def test_streaming_response_update_overload_5(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_5(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="", type="self_hosted", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", type="self_hosted", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", type="self_hosted", @@ -4747,21 +4747,21 @@ async def test_streaming_response_update_overload_6(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_6(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="", type="self_hosted", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", type="self_hosted", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", type="self_hosted", @@ -4872,21 +4872,21 @@ async def test_streaming_response_update_overload_7(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_7(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="", type="self_hosted", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", type="self_hosted", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", type="self_hosted", @@ -4973,19 +4973,19 @@ async def test_streaming_response_update_overload_8(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_8(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="account_id", @@ -5088,7 +5088,7 @@ async def test_streaming_response_update_overload_9(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_9(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="", target_criteria=[ @@ -5102,7 +5102,7 @@ async def test_path_params_update_overload_9(self, async_client: AsyncCloudflare account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", target_criteria=[ @@ -5116,7 +5116,7 @@ async def test_path_params_update_overload_9(self, async_client: AsyncCloudflare account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", target_criteria=[ @@ -5179,12 +5179,12 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.list( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.list( account_id="account_id", ) @@ -5238,19 +5238,19 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.delete( app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.delete( app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.delete( app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="account_id", @@ -5305,19 +5305,19 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.get( app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.get( app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.get( app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="account_id", @@ -5372,19 +5372,19 @@ async def test_streaming_response_revoke_tokens(self, async_client: AsyncCloudfl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_revoke_tokens(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.revoke_tokens( app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.revoke_tokens( app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.revoke_tokens( app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="account_id", diff --git a/tests/api_resources/zero_trust/access/test_certificates.py b/tests/api_resources/zero_trust/access/test_certificates.py index 30b99abd616..ce9a0660f0f 100644 --- a/tests/api_resources/zero_trust/access/test_certificates.py +++ b/tests/api_resources/zero_trust/access/test_certificates.py @@ -75,14 +75,14 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.certificates.with_raw_response.create( certificate="-----BEGIN CERTIFICATE-----\nMIIGAjCCA+qgAwIBAgIJAI7kymlF7CWT...N4RI7KKB7nikiuUf8vhULKy5IX10\nDrUtmu/B\n-----END CERTIFICATE-----", name="Allow devs", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.certificates.with_raw_response.create( certificate="-----BEGIN CERTIFICATE-----\nMIIGAjCCA+qgAwIBAgIJAI7kymlF7CWT...N4RI7KKB7nikiuUf8vhULKy5IX10\nDrUtmu/B\n-----END CERTIFICATE-----", name="Allow devs", @@ -143,21 +143,21 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `certificate_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.certificates.with_raw_response.update( certificate_id="", associated_hostnames=["admin.example.com"], account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.certificates.with_raw_response.update( certificate_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", associated_hostnames=["admin.example.com"], account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.certificates.with_raw_response.update( certificate_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", associated_hostnames=["admin.example.com"], @@ -209,12 +209,12 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.certificates.with_raw_response.list( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.certificates.with_raw_response.list( account_id="account_id", ) @@ -268,19 +268,19 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `certificate_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.certificates.with_raw_response.delete( certificate_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.certificates.with_raw_response.delete( certificate_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.certificates.with_raw_response.delete( certificate_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", @@ -335,19 +335,19 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `certificate_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.certificates.with_raw_response.get( certificate_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.certificates.with_raw_response.get( certificate_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.certificates.with_raw_response.get( certificate_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", @@ -411,14 +411,14 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.certificates.with_raw_response.create( certificate="-----BEGIN CERTIFICATE-----\nMIIGAjCCA+qgAwIBAgIJAI7kymlF7CWT...N4RI7KKB7nikiuUf8vhULKy5IX10\nDrUtmu/B\n-----END CERTIFICATE-----", name="Allow devs", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.certificates.with_raw_response.create( certificate="-----BEGIN CERTIFICATE-----\nMIIGAjCCA+qgAwIBAgIJAI7kymlF7CWT...N4RI7KKB7nikiuUf8vhULKy5IX10\nDrUtmu/B\n-----END CERTIFICATE-----", name="Allow devs", @@ -479,21 +479,21 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `certificate_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.certificates.with_raw_response.update( certificate_id="", associated_hostnames=["admin.example.com"], account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.certificates.with_raw_response.update( certificate_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", associated_hostnames=["admin.example.com"], account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.certificates.with_raw_response.update( certificate_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", associated_hostnames=["admin.example.com"], @@ -545,12 +545,12 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.certificates.with_raw_response.list( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.certificates.with_raw_response.list( account_id="account_id", ) @@ -604,19 +604,19 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `certificate_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.certificates.with_raw_response.delete( certificate_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.certificates.with_raw_response.delete( certificate_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.certificates.with_raw_response.delete( certificate_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", @@ -671,19 +671,19 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `certificate_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.certificates.with_raw_response.get( certificate_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.certificates.with_raw_response.get( certificate_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.certificates.with_raw_response.get( certificate_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", diff --git a/tests/api_resources/zero_trust/access/test_groups.py b/tests/api_resources/zero_trust/access/test_groups.py index e5c790d8495..14bf7a393ac 100644 --- a/tests/api_resources/zero_trust/access/test_groups.py +++ b/tests/api_resources/zero_trust/access/test_groups.py @@ -80,14 +80,14 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.groups.with_raw_response.create( include=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], name="Allow devs", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.groups.with_raw_response.create( include=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], name="Allow devs", @@ -154,7 +154,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `group_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.groups.with_raw_response.update( group_id="", include=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], @@ -162,7 +162,7 @@ def test_path_params_update(self, client: Cloudflare) -> None: account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.groups.with_raw_response.update( group_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", include=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], @@ -170,7 +170,7 @@ def test_path_params_update(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.groups.with_raw_response.update( group_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", include=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], @@ -225,12 +225,12 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.groups.with_raw_response.list( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.groups.with_raw_response.list( account_id="account_id", ) @@ -284,19 +284,19 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `group_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.groups.with_raw_response.delete( group_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.groups.with_raw_response.delete( group_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.groups.with_raw_response.delete( group_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", @@ -351,19 +351,19 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `group_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.groups.with_raw_response.get( group_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.groups.with_raw_response.get( group_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.groups.with_raw_response.get( group_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", @@ -429,14 +429,14 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.groups.with_raw_response.create( include=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], name="Allow devs", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.groups.with_raw_response.create( include=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], name="Allow devs", @@ -503,7 +503,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `group_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.groups.with_raw_response.update( group_id="", include=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], @@ -511,7 +511,7 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.groups.with_raw_response.update( group_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", include=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], @@ -519,7 +519,7 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.groups.with_raw_response.update( group_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", include=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], @@ -574,12 +574,12 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.groups.with_raw_response.list( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.groups.with_raw_response.list( account_id="account_id", ) @@ -633,19 +633,19 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `group_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.groups.with_raw_response.delete( group_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.groups.with_raw_response.delete( group_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.groups.with_raw_response.delete( group_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", @@ -700,19 +700,19 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `group_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.groups.with_raw_response.get( group_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.groups.with_raw_response.get( group_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.groups.with_raw_response.get( group_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", diff --git a/tests/api_resources/zero_trust/access/test_service_tokens.py b/tests/api_resources/zero_trust/access/test_service_tokens.py index fe1bff4c531..74f63be1b56 100644 --- a/tests/api_resources/zero_trust/access/test_service_tokens.py +++ b/tests/api_resources/zero_trust/access/test_service_tokens.py @@ -72,13 +72,13 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.service_tokens.with_raw_response.create( name="CI/CD token", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.service_tokens.with_raw_response.create( name="CI/CD token", account_id="account_id", @@ -135,19 +135,19 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `service_token_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.service_tokens.with_raw_response.update( service_token_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.service_tokens.with_raw_response.update( service_token_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.service_tokens.with_raw_response.update( service_token_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", @@ -200,12 +200,12 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.service_tokens.with_raw_response.list( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.service_tokens.with_raw_response.list( account_id="account_id", ) @@ -259,19 +259,19 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `service_token_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.service_tokens.with_raw_response.delete( service_token_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.service_tokens.with_raw_response.delete( service_token_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.service_tokens.with_raw_response.delete( service_token_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", @@ -326,19 +326,19 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `service_token_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.service_tokens.with_raw_response.get( service_token_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.service_tokens.with_raw_response.get( service_token_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.service_tokens.with_raw_response.get( service_token_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", @@ -494,13 +494,13 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.service_tokens.with_raw_response.create( name="CI/CD token", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.service_tokens.with_raw_response.create( name="CI/CD token", account_id="account_id", @@ -557,19 +557,19 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `service_token_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.service_tokens.with_raw_response.update( service_token_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.service_tokens.with_raw_response.update( service_token_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.service_tokens.with_raw_response.update( service_token_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", @@ -622,12 +622,12 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.service_tokens.with_raw_response.list( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.service_tokens.with_raw_response.list( account_id="account_id", ) @@ -681,19 +681,19 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `service_token_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.service_tokens.with_raw_response.delete( service_token_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.service_tokens.with_raw_response.delete( service_token_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.service_tokens.with_raw_response.delete( service_token_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", @@ -748,19 +748,19 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `service_token_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.service_tokens.with_raw_response.get( service_token_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.service_tokens.with_raw_response.get( service_token_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.service_tokens.with_raw_response.get( service_token_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", diff --git a/tests/api_resources/zero_trust/test_identity_providers.py b/tests/api_resources/zero_trust/test_identity_providers.py index 0f11348bac6..76f14a6aaab 100644 --- a/tests/api_resources/zero_trust/test_identity_providers.py +++ b/tests/api_resources/zero_trust/test_identity_providers.py @@ -94,7 +94,7 @@ def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_1(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -102,7 +102,7 @@ def test_path_params_create_overload_1(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -180,7 +180,7 @@ def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_2(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -188,7 +188,7 @@ def test_path_params_create_overload_2(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -262,7 +262,7 @@ def test_streaming_response_create_overload_3(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_3(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -270,7 +270,7 @@ def test_path_params_create_overload_3(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -344,7 +344,7 @@ def test_streaming_response_create_overload_4(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_4(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -352,7 +352,7 @@ def test_path_params_create_overload_4(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -428,7 +428,7 @@ def test_streaming_response_create_overload_5(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_5(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -436,7 +436,7 @@ def test_path_params_create_overload_5(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -513,7 +513,7 @@ def test_streaming_response_create_overload_6(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_6(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -521,7 +521,7 @@ def test_path_params_create_overload_6(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -595,7 +595,7 @@ def test_streaming_response_create_overload_7(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_7(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -603,7 +603,7 @@ def test_path_params_create_overload_7(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -684,7 +684,7 @@ def test_streaming_response_create_overload_8(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_8(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -692,7 +692,7 @@ def test_path_params_create_overload_8(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -770,7 +770,7 @@ def test_streaming_response_create_overload_9(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_9(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -778,7 +778,7 @@ def test_path_params_create_overload_9(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -855,7 +855,7 @@ def test_streaming_response_create_overload_10(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_10(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -863,7 +863,7 @@ def test_path_params_create_overload_10(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -940,7 +940,7 @@ def test_streaming_response_create_overload_11(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_11(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -948,7 +948,7 @@ def test_path_params_create_overload_11(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -1032,7 +1032,7 @@ def test_streaming_response_create_overload_12(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_12(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -1040,7 +1040,7 @@ def test_path_params_create_overload_12(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -1114,7 +1114,7 @@ def test_streaming_response_create_overload_13(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_13(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -1122,7 +1122,7 @@ def test_path_params_create_overload_13(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -1193,7 +1193,7 @@ def test_streaming_response_create_overload_14(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_14(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -1201,7 +1201,7 @@ def test_path_params_create_overload_14(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -1285,7 +1285,7 @@ def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_1(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -1294,7 +1294,7 @@ def test_path_params_update_overload_1(self, client: Cloudflare) -> None: account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -1303,7 +1303,7 @@ def test_path_params_update_overload_1(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -1386,7 +1386,7 @@ def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_2(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -1395,7 +1395,7 @@ def test_path_params_update_overload_2(self, client: Cloudflare) -> None: account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -1404,7 +1404,7 @@ def test_path_params_update_overload_2(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -1483,7 +1483,7 @@ def test_streaming_response_update_overload_3(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_3(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -1492,7 +1492,7 @@ def test_path_params_update_overload_3(self, client: Cloudflare) -> None: account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -1501,7 +1501,7 @@ def test_path_params_update_overload_3(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -1580,7 +1580,7 @@ def test_streaming_response_update_overload_4(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_4(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -1589,7 +1589,7 @@ def test_path_params_update_overload_4(self, client: Cloudflare) -> None: account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -1598,7 +1598,7 @@ def test_path_params_update_overload_4(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -1679,7 +1679,7 @@ def test_streaming_response_update_overload_5(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_5(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -1688,7 +1688,7 @@ def test_path_params_update_overload_5(self, client: Cloudflare) -> None: account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -1697,7 +1697,7 @@ def test_path_params_update_overload_5(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -1779,7 +1779,7 @@ def test_streaming_response_update_overload_6(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_6(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -1788,7 +1788,7 @@ def test_path_params_update_overload_6(self, client: Cloudflare) -> None: account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -1797,7 +1797,7 @@ def test_path_params_update_overload_6(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -1876,7 +1876,7 @@ def test_streaming_response_update_overload_7(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_7(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -1885,7 +1885,7 @@ def test_path_params_update_overload_7(self, client: Cloudflare) -> None: account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -1894,7 +1894,7 @@ def test_path_params_update_overload_7(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -1980,7 +1980,7 @@ def test_streaming_response_update_overload_8(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_8(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -1989,7 +1989,7 @@ def test_path_params_update_overload_8(self, client: Cloudflare) -> None: account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -1998,7 +1998,7 @@ def test_path_params_update_overload_8(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -2081,7 +2081,7 @@ def test_streaming_response_update_overload_9(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_9(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -2090,7 +2090,7 @@ def test_path_params_update_overload_9(self, client: Cloudflare) -> None: account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -2099,7 +2099,7 @@ def test_path_params_update_overload_9(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -2181,7 +2181,7 @@ def test_streaming_response_update_overload_10(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_10(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -2190,7 +2190,7 @@ def test_path_params_update_overload_10(self, client: Cloudflare) -> None: account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -2199,7 +2199,7 @@ def test_path_params_update_overload_10(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -2281,7 +2281,7 @@ def test_streaming_response_update_overload_11(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_11(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -2290,7 +2290,7 @@ def test_path_params_update_overload_11(self, client: Cloudflare) -> None: account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -2299,7 +2299,7 @@ def test_path_params_update_overload_11(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -2388,7 +2388,7 @@ def test_streaming_response_update_overload_12(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_12(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -2397,7 +2397,7 @@ def test_path_params_update_overload_12(self, client: Cloudflare) -> None: account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -2406,7 +2406,7 @@ def test_path_params_update_overload_12(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -2485,7 +2485,7 @@ def test_streaming_response_update_overload_13(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_13(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -2494,7 +2494,7 @@ def test_path_params_update_overload_13(self, client: Cloudflare) -> None: account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -2503,7 +2503,7 @@ def test_path_params_update_overload_13(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -2579,7 +2579,7 @@ def test_streaming_response_update_overload_14(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_14(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -2588,7 +2588,7 @@ def test_path_params_update_overload_14(self, client: Cloudflare) -> None: account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -2597,7 +2597,7 @@ def test_path_params_update_overload_14(self, client: Cloudflare) -> None: account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -2652,12 +2652,12 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.list( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.list( account_id="account_id", ) @@ -2711,19 +2711,19 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.delete( identity_provider_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.delete( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.delete( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", @@ -2778,19 +2778,19 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.get( identity_provider_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.get( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.identity_providers.with_raw_response.get( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", @@ -2872,7 +2872,7 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_1(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -2880,7 +2880,7 @@ async def test_path_params_create_overload_1(self, async_client: AsyncCloudflare account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -2958,7 +2958,7 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_2(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -2966,7 +2966,7 @@ async def test_path_params_create_overload_2(self, async_client: AsyncCloudflare account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -3040,7 +3040,7 @@ async def test_streaming_response_create_overload_3(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_3(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -3048,7 +3048,7 @@ async def test_path_params_create_overload_3(self, async_client: AsyncCloudflare account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -3122,7 +3122,7 @@ async def test_streaming_response_create_overload_4(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_4(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -3130,7 +3130,7 @@ async def test_path_params_create_overload_4(self, async_client: AsyncCloudflare account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -3206,7 +3206,7 @@ async def test_streaming_response_create_overload_5(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_5(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -3214,7 +3214,7 @@ async def test_path_params_create_overload_5(self, async_client: AsyncCloudflare account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -3291,7 +3291,7 @@ async def test_streaming_response_create_overload_6(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_6(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -3299,7 +3299,7 @@ async def test_path_params_create_overload_6(self, async_client: AsyncCloudflare account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -3373,7 +3373,7 @@ async def test_streaming_response_create_overload_7(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_7(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -3381,7 +3381,7 @@ async def test_path_params_create_overload_7(self, async_client: AsyncCloudflare account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -3462,7 +3462,7 @@ async def test_streaming_response_create_overload_8(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_8(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -3470,7 +3470,7 @@ async def test_path_params_create_overload_8(self, async_client: AsyncCloudflare account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -3548,7 +3548,7 @@ async def test_streaming_response_create_overload_9(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_9(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -3556,7 +3556,7 @@ async def test_path_params_create_overload_9(self, async_client: AsyncCloudflare account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -3633,7 +3633,7 @@ async def test_streaming_response_create_overload_10(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_10(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -3641,7 +3641,7 @@ async def test_path_params_create_overload_10(self, async_client: AsyncCloudflar account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -3718,7 +3718,7 @@ async def test_streaming_response_create_overload_11(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_11(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -3726,7 +3726,7 @@ async def test_path_params_create_overload_11(self, async_client: AsyncCloudflar account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -3810,7 +3810,7 @@ async def test_streaming_response_create_overload_12(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_12(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -3818,7 +3818,7 @@ async def test_path_params_create_overload_12(self, async_client: AsyncCloudflar account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -3892,7 +3892,7 @@ async def test_streaming_response_create_overload_13(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_13(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -3900,7 +3900,7 @@ async def test_path_params_create_overload_13(self, async_client: AsyncCloudflar account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -3971,7 +3971,7 @@ async def test_streaming_response_create_overload_14(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_14(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -3979,7 +3979,7 @@ async def test_path_params_create_overload_14(self, async_client: AsyncCloudflar account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -4063,7 +4063,7 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_1(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -4072,7 +4072,7 @@ async def test_path_params_update_overload_1(self, async_client: AsyncCloudflare account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -4081,7 +4081,7 @@ async def test_path_params_update_overload_1(self, async_client: AsyncCloudflare account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -4164,7 +4164,7 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -4173,7 +4173,7 @@ async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -4182,7 +4182,7 @@ async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -4261,7 +4261,7 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_3(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -4270,7 +4270,7 @@ async def test_path_params_update_overload_3(self, async_client: AsyncCloudflare account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -4279,7 +4279,7 @@ async def test_path_params_update_overload_3(self, async_client: AsyncCloudflare account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -4358,7 +4358,7 @@ async def test_streaming_response_update_overload_4(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_4(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -4367,7 +4367,7 @@ async def test_path_params_update_overload_4(self, async_client: AsyncCloudflare account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -4376,7 +4376,7 @@ async def test_path_params_update_overload_4(self, async_client: AsyncCloudflare account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -4457,7 +4457,7 @@ async def test_streaming_response_update_overload_5(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_5(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -4466,7 +4466,7 @@ async def test_path_params_update_overload_5(self, async_client: AsyncCloudflare account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -4475,7 +4475,7 @@ async def test_path_params_update_overload_5(self, async_client: AsyncCloudflare account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -4557,7 +4557,7 @@ async def test_streaming_response_update_overload_6(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_6(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -4566,7 +4566,7 @@ async def test_path_params_update_overload_6(self, async_client: AsyncCloudflare account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -4575,7 +4575,7 @@ async def test_path_params_update_overload_6(self, async_client: AsyncCloudflare account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -4654,7 +4654,7 @@ async def test_streaming_response_update_overload_7(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_7(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -4663,7 +4663,7 @@ async def test_path_params_update_overload_7(self, async_client: AsyncCloudflare account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -4672,7 +4672,7 @@ async def test_path_params_update_overload_7(self, async_client: AsyncCloudflare account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -4758,7 +4758,7 @@ async def test_streaming_response_update_overload_8(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_8(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -4767,7 +4767,7 @@ async def test_path_params_update_overload_8(self, async_client: AsyncCloudflare account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -4776,7 +4776,7 @@ async def test_path_params_update_overload_8(self, async_client: AsyncCloudflare account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -4859,7 +4859,7 @@ async def test_streaming_response_update_overload_9(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_9(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -4868,7 +4868,7 @@ async def test_path_params_update_overload_9(self, async_client: AsyncCloudflare account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -4877,7 +4877,7 @@ async def test_path_params_update_overload_9(self, async_client: AsyncCloudflare account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -4959,7 +4959,7 @@ async def test_streaming_response_update_overload_10(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_10(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -4968,7 +4968,7 @@ async def test_path_params_update_overload_10(self, async_client: AsyncCloudflar account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -4977,7 +4977,7 @@ async def test_path_params_update_overload_10(self, async_client: AsyncCloudflar account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -5059,7 +5059,7 @@ async def test_streaming_response_update_overload_11(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_11(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -5068,7 +5068,7 @@ async def test_path_params_update_overload_11(self, async_client: AsyncCloudflar account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -5077,7 +5077,7 @@ async def test_path_params_update_overload_11(self, async_client: AsyncCloudflar account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -5166,7 +5166,7 @@ async def test_streaming_response_update_overload_12(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_12(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -5175,7 +5175,7 @@ async def test_path_params_update_overload_12(self, async_client: AsyncCloudflar account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -5184,7 +5184,7 @@ async def test_path_params_update_overload_12(self, async_client: AsyncCloudflar account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -5263,7 +5263,7 @@ async def test_streaming_response_update_overload_13(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_13(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -5272,7 +5272,7 @@ async def test_path_params_update_overload_13(self, async_client: AsyncCloudflar account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -5281,7 +5281,7 @@ async def test_path_params_update_overload_13(self, async_client: AsyncCloudflar account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -5357,7 +5357,7 @@ async def test_streaming_response_update_overload_14(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_14(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -5366,7 +5366,7 @@ async def test_path_params_update_overload_14(self, async_client: AsyncCloudflar account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -5375,7 +5375,7 @@ async def test_path_params_update_overload_14(self, async_client: AsyncCloudflar account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -5430,12 +5430,12 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.list( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.list( account_id="account_id", ) @@ -5489,19 +5489,19 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.delete( identity_provider_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.delete( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.delete( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", @@ -5556,19 +5556,19 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.get( identity_provider_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.get( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.identity_providers.with_raw_response.get( identity_provider_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", diff --git a/tests/api_resources/zero_trust/test_organizations.py b/tests/api_resources/zero_trust/test_organizations.py index b88937228fd..3d851cb5226 100644 --- a/tests/api_resources/zero_trust/test_organizations.py +++ b/tests/api_resources/zero_trust/test_organizations.py @@ -87,14 +87,14 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.organizations.with_raw_response.create( auth_domain="test.cloudflareaccess.com", name="Widget Corps Internal Applications", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.organizations.with_raw_response.create( auth_domain="test.cloudflareaccess.com", name="Widget Corps Internal Applications", @@ -166,12 +166,12 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.organizations.with_raw_response.update( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.organizations.with_raw_response.update( account_id="account_id", ) @@ -221,12 +221,12 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.organizations.with_raw_response.list( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.organizations.with_raw_response.list( account_id="account_id", ) @@ -284,13 +284,13 @@ def test_streaming_response_revoke_users(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_revoke_users(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.organizations.with_raw_response.revoke_users( email="test@example.com", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.organizations.with_raw_response.revoke_users( email="test@example.com", account_id="account_id", @@ -367,14 +367,14 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.organizations.with_raw_response.create( auth_domain="test.cloudflareaccess.com", name="Widget Corps Internal Applications", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.organizations.with_raw_response.create( auth_domain="test.cloudflareaccess.com", name="Widget Corps Internal Applications", @@ -446,12 +446,12 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.organizations.with_raw_response.update( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.organizations.with_raw_response.update( account_id="account_id", ) @@ -501,12 +501,12 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.organizations.with_raw_response.list( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.organizations.with_raw_response.list( account_id="account_id", ) @@ -564,13 +564,13 @@ async def test_streaming_response_revoke_users(self, async_client: AsyncCloudfla @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_revoke_users(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.organizations.with_raw_response.revoke_users( email="test@example.com", account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.organizations.with_raw_response.revoke_users( email="test@example.com", account_id="account_id", From de030875ea811e7372f31c602bea8d7191f3728d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 11:45:14 +0000 Subject: [PATCH 074/358] chore(tests): fix path params tests (#2412) --- .../firewall/test_access_rules.py | 12 +- .../logpush/datasets/test_fields.py | 4 +- .../logpush/datasets/test_jobs.py | 4 +- .../rulesets/phases/test_versions.py | 4 +- tests/api_resources/rulesets/test_rules.py | 224 +++++++++--------- tests/api_resources/rulesets/test_versions.py | 20 +- .../security_center/test_insights.py | 4 +- tests/api_resources/test_rulesets.py | 12 +- .../access/applications/test_cas.py | 12 +- .../access/applications/test_policies.py | 32 +-- .../applications/test_user_policy_checks.py | 4 +- .../zero_trust/access/test_applications.py | 48 ++-- .../zero_trust/access/test_certificates.py | 12 +- .../zero_trust/access/test_groups.py | 12 +- .../zero_trust/access/test_service_tokens.py | 12 +- .../zero_trust/test_identity_providers.py | 64 ++--- 16 files changed, 240 insertions(+), 240 deletions(-) diff --git a/tests/api_resources/firewall/test_access_rules.py b/tests/api_resources/firewall/test_access_rules.py index e9d1e70cafc..c30dc3e279a 100644 --- a/tests/api_resources/firewall/test_access_rules.py +++ b/tests/api_resources/firewall/test_access_rules.py @@ -210,7 +210,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): client.firewall.access_rules.with_raw_response.delete( rule_id="", account_id="account_id", @@ -289,7 +289,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): client.firewall.access_rules.with_raw_response.edit( rule_id="", configuration={}, @@ -362,7 +362,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): client.firewall.access_rules.with_raw_response.get( rule_id="", account_id="account_id", @@ -570,7 +570,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): await async_client.firewall.access_rules.with_raw_response.delete( rule_id="", account_id="account_id", @@ -649,7 +649,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): await async_client.firewall.access_rules.with_raw_response.edit( rule_id="", configuration={}, @@ -722,7 +722,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): await async_client.firewall.access_rules.with_raw_response.get( rule_id="", account_id="account_id", diff --git a/tests/api_resources/logpush/datasets/test_fields.py b/tests/api_resources/logpush/datasets/test_fields.py index 0e8296727ac..1718e2059da 100644 --- a/tests/api_resources/logpush/datasets/test_fields.py +++ b/tests/api_resources/logpush/datasets/test_fields.py @@ -65,7 +65,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"): client.logpush.datasets.fields.with_raw_response.get( dataset_id="", account_id="account_id", @@ -136,7 +136,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"): await async_client.logpush.datasets.fields.with_raw_response.get( dataset_id="", account_id="account_id", diff --git a/tests/api_resources/logpush/datasets/test_jobs.py b/tests/api_resources/logpush/datasets/test_jobs.py index 594efaff812..26badfe9b3f 100644 --- a/tests/api_resources/logpush/datasets/test_jobs.py +++ b/tests/api_resources/logpush/datasets/test_jobs.py @@ -66,7 +66,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"): client.logpush.datasets.jobs.with_raw_response.get( dataset_id="", account_id="account_id", @@ -137,7 +137,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"): await async_client.logpush.datasets.jobs.with_raw_response.get( dataset_id="", account_id="account_id", diff --git a/tests/api_resources/rulesets/phases/test_versions.py b/tests/api_resources/rulesets/phases/test_versions.py index 95f0a8ac58c..c13e0327a61 100644 --- a/tests/api_resources/rulesets/phases/test_versions.py +++ b/tests/api_resources/rulesets/phases/test_versions.py @@ -132,7 +132,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_version` but received ''"): client.rulesets.phases.versions.with_raw_response.get( ruleset_version="", ruleset_phase="ddos_l4", @@ -271,7 +271,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_version` but received ''"): await async_client.rulesets.phases.versions.with_raw_response.get( ruleset_version="", ruleset_phase="ddos_l4", diff --git a/tests/api_resources/rulesets/test_rules.py b/tests/api_resources/rulesets/test_rules.py index 1410dd18d50..bbae006d39e 100644 --- a/tests/api_resources/rulesets/test_rules.py +++ b/tests/api_resources/rulesets/test_rules.py @@ -99,7 +99,7 @@ def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_1(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -189,7 +189,7 @@ def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_2(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -279,7 +279,7 @@ def test_streaming_response_create_overload_3(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_3(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -394,7 +394,7 @@ def test_streaming_response_create_overload_4(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_4(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -484,7 +484,7 @@ def test_streaming_response_create_overload_5(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_5(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -574,7 +574,7 @@ def test_streaming_response_create_overload_6(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_6(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -664,7 +664,7 @@ def test_streaming_response_create_overload_7(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_7(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -764,7 +764,7 @@ def test_streaming_response_create_overload_8(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_8(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -865,7 +865,7 @@ def test_streaming_response_create_overload_9(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_9(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -962,7 +962,7 @@ def test_streaming_response_create_overload_10(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_10(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -1052,7 +1052,7 @@ def test_streaming_response_create_overload_11(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_11(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -1146,7 +1146,7 @@ def test_streaming_response_create_overload_12(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_12(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -1258,7 +1258,7 @@ def test_streaming_response_create_overload_13(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_13(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -1354,7 +1354,7 @@ def test_streaming_response_create_overload_14(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_14(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -1498,7 +1498,7 @@ def test_streaming_response_create_overload_15(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_15(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -1592,7 +1592,7 @@ def test_streaming_response_create_overload_16(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_16(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -1682,7 +1682,7 @@ def test_streaming_response_create_overload_17(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_17(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -1772,7 +1772,7 @@ def test_streaming_response_create_overload_18(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create_overload_18(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -1843,14 +1843,14 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.delete( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): client.rulesets.rules.with_raw_response.delete( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -1953,14 +1953,14 @@ def test_streaming_response_edit_overload_1(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_1(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -2057,14 +2057,14 @@ def test_streaming_response_edit_overload_2(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_2(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -2161,14 +2161,14 @@ def test_streaming_response_edit_overload_3(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_3(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -2290,14 +2290,14 @@ def test_streaming_response_edit_overload_4(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_4(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -2394,14 +2394,14 @@ def test_streaming_response_edit_overload_5(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_5(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -2498,14 +2498,14 @@ def test_streaming_response_edit_overload_6(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_6(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -2602,14 +2602,14 @@ def test_streaming_response_edit_overload_7(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_7(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -2716,14 +2716,14 @@ def test_streaming_response_edit_overload_8(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_8(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -2831,14 +2831,14 @@ def test_streaming_response_edit_overload_9(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_9(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -2942,14 +2942,14 @@ def test_streaming_response_edit_overload_10(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_10(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -3046,14 +3046,14 @@ def test_streaming_response_edit_overload_11(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_11(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -3154,14 +3154,14 @@ def test_streaming_response_edit_overload_12(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_12(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -3280,14 +3280,14 @@ def test_streaming_response_edit_overload_13(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_13(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -3390,14 +3390,14 @@ def test_streaming_response_edit_overload_14(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_14(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -3548,14 +3548,14 @@ def test_streaming_response_edit_overload_15(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_15(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -3656,14 +3656,14 @@ def test_streaming_response_edit_overload_16(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_16(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -3760,14 +3760,14 @@ def test_streaming_response_edit_overload_17(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_17(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -3864,14 +3864,14 @@ def test_streaming_response_edit_overload_18(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_edit_overload_18(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -3974,7 +3974,7 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_1(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -4064,7 +4064,7 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_2(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -4154,7 +4154,7 @@ async def test_streaming_response_create_overload_3(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_3(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -4269,7 +4269,7 @@ async def test_streaming_response_create_overload_4(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_4(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -4359,7 +4359,7 @@ async def test_streaming_response_create_overload_5(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_5(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -4449,7 +4449,7 @@ async def test_streaming_response_create_overload_6(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_6(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -4539,7 +4539,7 @@ async def test_streaming_response_create_overload_7(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_7(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -4639,7 +4639,7 @@ async def test_streaming_response_create_overload_8(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_8(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -4740,7 +4740,7 @@ async def test_streaming_response_create_overload_9(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_9(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -4837,7 +4837,7 @@ async def test_streaming_response_create_overload_10(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_10(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -4927,7 +4927,7 @@ async def test_streaming_response_create_overload_11(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_11(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -5021,7 +5021,7 @@ async def test_streaming_response_create_overload_12(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_12(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -5133,7 +5133,7 @@ async def test_streaming_response_create_overload_13(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_13(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -5229,7 +5229,7 @@ async def test_streaming_response_create_overload_14(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_14(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -5373,7 +5373,7 @@ async def test_streaming_response_create_overload_15(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_15(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -5467,7 +5467,7 @@ async def test_streaming_response_create_overload_16(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_16(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -5557,7 +5557,7 @@ async def test_streaming_response_create_overload_17(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_17(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -5647,7 +5647,7 @@ async def test_streaming_response_create_overload_18(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create_overload_18(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", account_id="account_id", @@ -5718,14 +5718,14 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.delete( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): await async_client.rulesets.rules.with_raw_response.delete( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -5828,14 +5828,14 @@ async def test_streaming_response_edit_overload_1(self, async_client: AsyncCloud @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_1(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -5932,14 +5932,14 @@ async def test_streaming_response_edit_overload_2(self, async_client: AsyncCloud @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_2(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -6036,14 +6036,14 @@ async def test_streaming_response_edit_overload_3(self, async_client: AsyncCloud @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_3(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -6165,14 +6165,14 @@ async def test_streaming_response_edit_overload_4(self, async_client: AsyncCloud @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_4(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -6269,14 +6269,14 @@ async def test_streaming_response_edit_overload_5(self, async_client: AsyncCloud @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_5(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -6373,14 +6373,14 @@ async def test_streaming_response_edit_overload_6(self, async_client: AsyncCloud @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_6(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -6477,14 +6477,14 @@ async def test_streaming_response_edit_overload_7(self, async_client: AsyncCloud @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_7(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -6591,14 +6591,14 @@ async def test_streaming_response_edit_overload_8(self, async_client: AsyncCloud @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_8(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -6706,14 +6706,14 @@ async def test_streaming_response_edit_overload_9(self, async_client: AsyncCloud @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_9(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -6817,14 +6817,14 @@ async def test_streaming_response_edit_overload_10(self, async_client: AsyncClou @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_10(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -6921,14 +6921,14 @@ async def test_streaming_response_edit_overload_11(self, async_client: AsyncClou @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_11(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -7029,14 +7029,14 @@ async def test_streaming_response_edit_overload_12(self, async_client: AsyncClou @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_12(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -7155,14 +7155,14 @@ async def test_streaming_response_edit_overload_13(self, async_client: AsyncClou @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_13(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -7265,14 +7265,14 @@ async def test_streaming_response_edit_overload_14(self, async_client: AsyncClou @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_14(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -7423,14 +7423,14 @@ async def test_streaming_response_edit_overload_15(self, async_client: AsyncClou @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_15(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -7531,14 +7531,14 @@ async def test_streaming_response_edit_overload_16(self, async_client: AsyncClou @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_16(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -7635,14 +7635,14 @@ async def test_streaming_response_edit_overload_17(self, async_client: AsyncClou @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_17(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -7739,14 +7739,14 @@ async def test_streaming_response_edit_overload_18(self, async_client: AsyncClou @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_edit_overload_18(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="", ruleset_id="2f2feab2026849078ba485f918791bdc", diff --git a/tests/api_resources/rulesets/test_versions.py b/tests/api_resources/rulesets/test_versions.py index 317dff48dfb..620e4992e4d 100644 --- a/tests/api_resources/rulesets/test_versions.py +++ b/tests/api_resources/rulesets/test_versions.py @@ -67,7 +67,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.versions.with_raw_response.list( ruleset_id="", account_id="account_id", @@ -138,14 +138,14 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.versions.with_raw_response.delete( ruleset_version="1", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_version` but received ''"): client.rulesets.versions.with_raw_response.delete( ruleset_version="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -219,14 +219,14 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.versions.with_raw_response.get( ruleset_version="1", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_version` but received ''"): client.rulesets.versions.with_raw_response.get( ruleset_version="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -300,7 +300,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.versions.with_raw_response.list( ruleset_id="", account_id="account_id", @@ -371,14 +371,14 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.versions.with_raw_response.delete( ruleset_version="1", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_version` but received ''"): await async_client.rulesets.versions.with_raw_response.delete( ruleset_version="", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -452,14 +452,14 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.versions.with_raw_response.get( ruleset_version="1", ruleset_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_version` but received ''"): await async_client.rulesets.versions.with_raw_response.get( ruleset_version="", ruleset_id="2f2feab2026849078ba485f918791bdc", diff --git a/tests/api_resources/security_center/test_insights.py b/tests/api_resources/security_center/test_insights.py index 56b28556e92..531c0ba49dc 100644 --- a/tests/api_resources/security_center/test_insights.py +++ b/tests/api_resources/security_center/test_insights.py @@ -65,7 +65,7 @@ def test_streaming_response_dismiss(self, client: Cloudflare) -> None: @parametrize def test_path_params_dismiss(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `issue_id` but received ''"): client.security_center.insights.with_raw_response.dismiss( issue_id="", account_id="account_id", @@ -195,7 +195,7 @@ async def test_streaming_response_dismiss(self, async_client: AsyncCloudflare) - @parametrize async def test_path_params_dismiss(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `issue_id` but received ''"): await async_client.security_center.insights.with_raw_response.dismiss( issue_id="", account_id="account_id", diff --git a/tests/api_resources/test_rulesets.py b/tests/api_resources/test_rulesets.py index 9b7e2cd2da6..ab218130c3b 100644 --- a/tests/api_resources/test_rulesets.py +++ b/tests/api_resources/test_rulesets.py @@ -222,7 +222,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.with_raw_response.update( ruleset_id="", rules=[{}], @@ -349,7 +349,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.with_raw_response.delete( ruleset_id="", account_id="account_id", @@ -416,7 +416,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.with_raw_response.get( ruleset_id="", account_id="account_id", @@ -637,7 +637,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.with_raw_response.update( ruleset_id="", rules=[{}], @@ -764,7 +764,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.with_raw_response.delete( ruleset_id="", account_id="account_id", @@ -831,7 +831,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.with_raw_response.get( ruleset_id="", account_id="account_id", diff --git a/tests/api_resources/zero_trust/access/applications/test_cas.py b/tests/api_resources/zero_trust/access/applications/test_cas.py index 3f3c397b911..5ec4f55234f 100644 --- a/tests/api_resources/zero_trust/access/applications/test_cas.py +++ b/tests/api_resources/zero_trust/access/applications/test_cas.py @@ -67,7 +67,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): client.zero_trust.access.applications.cas.with_raw_response.create( app_id="", account_id="account_id", @@ -189,7 +189,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): client.zero_trust.access.applications.cas.with_raw_response.delete( app_id="", account_id="account_id", @@ -256,7 +256,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): client.zero_trust.access.applications.cas.with_raw_response.get( app_id="", account_id="account_id", @@ -327,7 +327,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): await async_client.zero_trust.access.applications.cas.with_raw_response.create( app_id="", account_id="account_id", @@ -449,7 +449,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): await async_client.zero_trust.access.applications.cas.with_raw_response.delete( app_id="", account_id="account_id", @@ -516,7 +516,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): await async_client.zero_trust.access.applications.cas.with_raw_response.get( app_id="", account_id="account_id", diff --git a/tests/api_resources/zero_trust/access/applications/test_policies.py b/tests/api_resources/zero_trust/access/applications/test_policies.py index d8288b7b04c..edb59c1c638 100644 --- a/tests/api_resources/zero_trust/access/applications/test_policies.py +++ b/tests/api_resources/zero_trust/access/applications/test_policies.py @@ -91,7 +91,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): client.zero_trust.access.applications.policies.with_raw_response.create( app_id="", account_id="account_id", @@ -180,14 +180,14 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): client.zero_trust.access.applications.policies.with_raw_response.update( policy_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `policy_id` but received ''"): client.zero_trust.access.applications.policies.with_raw_response.update( policy_id="", app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", @@ -257,7 +257,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): client.zero_trust.access.applications.policies.with_raw_response.list( app_id="", account_id="account_id", @@ -328,14 +328,14 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): client.zero_trust.access.applications.policies.with_raw_response.delete( policy_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `policy_id` but received ''"): client.zero_trust.access.applications.policies.with_raw_response.delete( policy_id="", app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", @@ -409,14 +409,14 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): client.zero_trust.access.applications.policies.with_raw_response.get( policy_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `policy_id` but received ''"): client.zero_trust.access.applications.policies.with_raw_response.get( policy_id="", app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", @@ -508,7 +508,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): await async_client.zero_trust.access.applications.policies.with_raw_response.create( app_id="", account_id="account_id", @@ -597,14 +597,14 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): await async_client.zero_trust.access.applications.policies.with_raw_response.update( policy_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `policy_id` but received ''"): await async_client.zero_trust.access.applications.policies.with_raw_response.update( policy_id="", app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", @@ -674,7 +674,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): await async_client.zero_trust.access.applications.policies.with_raw_response.list( app_id="", account_id="account_id", @@ -745,14 +745,14 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): await async_client.zero_trust.access.applications.policies.with_raw_response.delete( policy_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `policy_id` but received ''"): await async_client.zero_trust.access.applications.policies.with_raw_response.delete( policy_id="", app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", @@ -826,14 +826,14 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): await async_client.zero_trust.access.applications.policies.with_raw_response.get( policy_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", app_id="", account_id="account_id", ) - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `policy_id` but received ''"): await async_client.zero_trust.access.applications.policies.with_raw_response.get( policy_id="", app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", diff --git a/tests/api_resources/zero_trust/access/applications/test_user_policy_checks.py b/tests/api_resources/zero_trust/access/applications/test_user_policy_checks.py index 446ccd9f81c..daafd6559ea 100644 --- a/tests/api_resources/zero_trust/access/applications/test_user_policy_checks.py +++ b/tests/api_resources/zero_trust/access/applications/test_user_policy_checks.py @@ -66,7 +66,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): client.zero_trust.access.applications.user_policy_checks.with_raw_response.list( app_id="", account_id="account_id", @@ -137,7 +137,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): await async_client.zero_trust.access.applications.user_policy_checks.with_raw_response.list( app_id="", account_id="account_id", diff --git a/tests/api_resources/zero_trust/access/test_applications.py b/tests/api_resources/zero_trust/access/test_applications.py index 776599ca547..b705396c846 100644 --- a/tests/api_resources/zero_trust/access/test_applications.py +++ b/tests/api_resources/zero_trust/access/test_applications.py @@ -1324,7 +1324,7 @@ def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_1(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): client.zero_trust.access.applications.with_raw_response.update( app_id="", domain="test.example.com/admin", @@ -1463,7 +1463,7 @@ def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_2(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): client.zero_trust.access.applications.with_raw_response.update( app_id="", account_id="account_id", @@ -1633,7 +1633,7 @@ def test_streaming_response_update_overload_3(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_3(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): client.zero_trust.access.applications.with_raw_response.update( app_id="", domain="test.example.com/admin", @@ -1809,7 +1809,7 @@ def test_streaming_response_update_overload_4(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_4(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): client.zero_trust.access.applications.with_raw_response.update( app_id="", domain="test.example.com/admin", @@ -1937,7 +1937,7 @@ def test_streaming_response_update_overload_5(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_5(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): client.zero_trust.access.applications.with_raw_response.update( app_id="", type="self_hosted", @@ -2062,7 +2062,7 @@ def test_streaming_response_update_overload_6(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_6(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): client.zero_trust.access.applications.with_raw_response.update( app_id="", type="self_hosted", @@ -2187,7 +2187,7 @@ def test_streaming_response_update_overload_7(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_7(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): client.zero_trust.access.applications.with_raw_response.update( app_id="", type="self_hosted", @@ -2288,7 +2288,7 @@ def test_streaming_response_update_overload_8(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_8(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): client.zero_trust.access.applications.with_raw_response.update( app_id="", account_id="account_id", @@ -2403,7 +2403,7 @@ def test_streaming_response_update_overload_9(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_9(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): client.zero_trust.access.applications.with_raw_response.update( app_id="", target_criteria=[ @@ -2553,7 +2553,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): client.zero_trust.access.applications.with_raw_response.delete( app_id="", account_id="account_id", @@ -2620,7 +2620,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): client.zero_trust.access.applications.with_raw_response.get( app_id="", account_id="account_id", @@ -2687,7 +2687,7 @@ def test_streaming_response_revoke_tokens(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_revoke_tokens(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): client.zero_trust.access.applications.with_raw_response.revoke_tokens( app_id="", account_id="account_id", @@ -4009,7 +4009,7 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_1(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="", domain="test.example.com/admin", @@ -4148,7 +4148,7 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="", account_id="account_id", @@ -4318,7 +4318,7 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_3(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="", domain="test.example.com/admin", @@ -4494,7 +4494,7 @@ async def test_streaming_response_update_overload_4(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_4(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="", domain="test.example.com/admin", @@ -4622,7 +4622,7 @@ async def test_streaming_response_update_overload_5(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_5(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="", type="self_hosted", @@ -4747,7 +4747,7 @@ async def test_streaming_response_update_overload_6(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_6(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="", type="self_hosted", @@ -4872,7 +4872,7 @@ async def test_streaming_response_update_overload_7(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_7(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="", type="self_hosted", @@ -4973,7 +4973,7 @@ async def test_streaming_response_update_overload_8(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_8(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="", account_id="account_id", @@ -5088,7 +5088,7 @@ async def test_streaming_response_update_overload_9(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_9(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="", target_criteria=[ @@ -5238,7 +5238,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): await async_client.zero_trust.access.applications.with_raw_response.delete( app_id="", account_id="account_id", @@ -5305,7 +5305,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): await async_client.zero_trust.access.applications.with_raw_response.get( app_id="", account_id="account_id", @@ -5372,7 +5372,7 @@ async def test_streaming_response_revoke_tokens(self, async_client: AsyncCloudfl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_revoke_tokens(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): await async_client.zero_trust.access.applications.with_raw_response.revoke_tokens( app_id="", account_id="account_id", diff --git a/tests/api_resources/zero_trust/access/test_certificates.py b/tests/api_resources/zero_trust/access/test_certificates.py index ce9a0660f0f..8bd7249ed22 100644 --- a/tests/api_resources/zero_trust/access/test_certificates.py +++ b/tests/api_resources/zero_trust/access/test_certificates.py @@ -143,7 +143,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `certificate_id` but received ''"): client.zero_trust.access.certificates.with_raw_response.update( certificate_id="", associated_hostnames=["admin.example.com"], @@ -268,7 +268,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `certificate_id` but received ''"): client.zero_trust.access.certificates.with_raw_response.delete( certificate_id="", account_id="account_id", @@ -335,7 +335,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `certificate_id` but received ''"): client.zero_trust.access.certificates.with_raw_response.get( certificate_id="", account_id="account_id", @@ -479,7 +479,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `certificate_id` but received ''"): await async_client.zero_trust.access.certificates.with_raw_response.update( certificate_id="", associated_hostnames=["admin.example.com"], @@ -604,7 +604,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `certificate_id` but received ''"): await async_client.zero_trust.access.certificates.with_raw_response.delete( certificate_id="", account_id="account_id", @@ -671,7 +671,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `certificate_id` but received ''"): await async_client.zero_trust.access.certificates.with_raw_response.get( certificate_id="", account_id="account_id", diff --git a/tests/api_resources/zero_trust/access/test_groups.py b/tests/api_resources/zero_trust/access/test_groups.py index 14bf7a393ac..f83be911c0f 100644 --- a/tests/api_resources/zero_trust/access/test_groups.py +++ b/tests/api_resources/zero_trust/access/test_groups.py @@ -154,7 +154,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `group_id` but received ''"): client.zero_trust.access.groups.with_raw_response.update( group_id="", include=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], @@ -284,7 +284,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `group_id` but received ''"): client.zero_trust.access.groups.with_raw_response.delete( group_id="", account_id="account_id", @@ -351,7 +351,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `group_id` but received ''"): client.zero_trust.access.groups.with_raw_response.get( group_id="", account_id="account_id", @@ -503,7 +503,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `group_id` but received ''"): await async_client.zero_trust.access.groups.with_raw_response.update( group_id="", include=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], @@ -633,7 +633,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `group_id` but received ''"): await async_client.zero_trust.access.groups.with_raw_response.delete( group_id="", account_id="account_id", @@ -700,7 +700,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `group_id` but received ''"): await async_client.zero_trust.access.groups.with_raw_response.get( group_id="", account_id="account_id", diff --git a/tests/api_resources/zero_trust/access/test_service_tokens.py b/tests/api_resources/zero_trust/access/test_service_tokens.py index 74f63be1b56..f6980f81209 100644 --- a/tests/api_resources/zero_trust/access/test_service_tokens.py +++ b/tests/api_resources/zero_trust/access/test_service_tokens.py @@ -135,7 +135,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `service_token_id` but received ''"): client.zero_trust.access.service_tokens.with_raw_response.update( service_token_id="", account_id="account_id", @@ -259,7 +259,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `service_token_id` but received ''"): client.zero_trust.access.service_tokens.with_raw_response.delete( service_token_id="", account_id="account_id", @@ -326,7 +326,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `service_token_id` but received ''"): client.zero_trust.access.service_tokens.with_raw_response.get( service_token_id="", account_id="account_id", @@ -557,7 +557,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `service_token_id` but received ''"): await async_client.zero_trust.access.service_tokens.with_raw_response.update( service_token_id="", account_id="account_id", @@ -681,7 +681,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `service_token_id` but received ''"): await async_client.zero_trust.access.service_tokens.with_raw_response.delete( service_token_id="", account_id="account_id", @@ -748,7 +748,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `service_token_id` but received ''"): await async_client.zero_trust.access.service_tokens.with_raw_response.get( service_token_id="", account_id="account_id", diff --git a/tests/api_resources/zero_trust/test_identity_providers.py b/tests/api_resources/zero_trust/test_identity_providers.py index 76f14a6aaab..fc69af496c7 100644 --- a/tests/api_resources/zero_trust/test_identity_providers.py +++ b/tests/api_resources/zero_trust/test_identity_providers.py @@ -1285,7 +1285,7 @@ def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_1(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -1386,7 +1386,7 @@ def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_2(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -1483,7 +1483,7 @@ def test_streaming_response_update_overload_3(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_3(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -1580,7 +1580,7 @@ def test_streaming_response_update_overload_4(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_4(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -1679,7 +1679,7 @@ def test_streaming_response_update_overload_5(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_5(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -1779,7 +1779,7 @@ def test_streaming_response_update_overload_6(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_6(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -1876,7 +1876,7 @@ def test_streaming_response_update_overload_7(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_7(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -1980,7 +1980,7 @@ def test_streaming_response_update_overload_8(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_8(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -2081,7 +2081,7 @@ def test_streaming_response_update_overload_9(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_9(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -2181,7 +2181,7 @@ def test_streaming_response_update_overload_10(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_10(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -2281,7 +2281,7 @@ def test_streaming_response_update_overload_11(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_11(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -2388,7 +2388,7 @@ def test_streaming_response_update_overload_12(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_12(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -2485,7 +2485,7 @@ def test_streaming_response_update_overload_13(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_13(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -2579,7 +2579,7 @@ def test_streaming_response_update_overload_14(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_update_overload_14(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -2711,7 +2711,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): client.zero_trust.identity_providers.with_raw_response.delete( identity_provider_id="", account_id="account_id", @@ -2778,7 +2778,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): client.zero_trust.identity_providers.with_raw_response.get( identity_provider_id="", account_id="account_id", @@ -4063,7 +4063,7 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_1(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -4164,7 +4164,7 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -4261,7 +4261,7 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_3(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -4358,7 +4358,7 @@ async def test_streaming_response_update_overload_4(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_4(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -4457,7 +4457,7 @@ async def test_streaming_response_update_overload_5(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_5(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -4557,7 +4557,7 @@ async def test_streaming_response_update_overload_6(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_6(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -4654,7 +4654,7 @@ async def test_streaming_response_update_overload_7(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_7(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -4758,7 +4758,7 @@ async def test_streaming_response_update_overload_8(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_8(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -4859,7 +4859,7 @@ async def test_streaming_response_update_overload_9(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_9(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -4959,7 +4959,7 @@ async def test_streaming_response_update_overload_10(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_10(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -5059,7 +5059,7 @@ async def test_streaming_response_update_overload_11(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_11(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -5166,7 +5166,7 @@ async def test_streaming_response_update_overload_12(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_12(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -5263,7 +5263,7 @@ async def test_streaming_response_update_overload_13(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_13(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -5357,7 +5357,7 @@ async def test_streaming_response_update_overload_14(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_update_overload_14(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): await async_client.zero_trust.identity_providers.with_raw_response.update( identity_provider_id="", config={}, @@ -5489,7 +5489,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): await async_client.zero_trust.identity_providers.with_raw_response.delete( identity_provider_id="", account_id="account_id", @@ -5556,7 +5556,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identity_provider_id` but received ''"): await async_client.zero_trust.identity_providers.with_raw_response.get( identity_provider_id="", account_id="account_id", From 9ccce30ca029a19ff0708751dc0cb36cd402b7af Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 12:22:52 +0000 Subject: [PATCH 075/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 05591bb7ef6..de617f814c7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-04299b899e2bbf8ba1b4ad96d5e9f9c3e0c9b6246bfeac3f9ab684b855b0e412.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8973dde42d42a39c8fbc5f3f1eb1328e6ac0c805ca4d3e5920796749ed58eb0a.yml From 9e271eb1e8c799b9663a1f980864efa3dc55cbb4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 14:28:10 +0000 Subject: [PATCH 076/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index de617f814c7..05591bb7ef6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8973dde42d42a39c8fbc5f3f1eb1328e6ac0c805ca4d3e5920796749ed58eb0a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-04299b899e2bbf8ba1b4ad96d5e9f9c3e0c9b6246bfeac3f9ab684b855b0e412.yml From d5baa16e614ecf100f10699ce85a53456bcc139c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 14:54:12 +0000 Subject: [PATCH 077/358] chore(internal): codegen related update (#2413) --- api.md | 316 ++++++------------ .../resources/accounts/subscriptions.py | 35 +- .../alerting/destinations/pagerduty.py | 33 +- .../api_gateway/operations/operations.py | 34 +- .../resources/cloud_connector/rules.py | 40 +-- .../cloudforce_one/requests/assets.py | 63 ++-- .../cloudforce_one/requests/message.py | 36 +- .../cloudforce_one/requests/requests.py | 40 +-- .../resources/content_scanning/payloads.py | 70 ++-- .../custom_certificates/prioritize.py | 47 ++- .../resources/custom_nameservers.py | 94 ++---- src/cloudflare/resources/d1/database.py | 68 ++-- .../resources/diagnostics/traceroutes.py | 45 ++- src/cloudflare/resources/email_routing/dns.py | 41 ++- .../email_security/investigate/move.py | 75 ++--- .../email_security/investigate/release.py | 43 +-- .../email_security/settings/domains.py | 32 +- src/cloudflare/resources/filters.py | 99 +++--- src/cloudflare/resources/firewall/rules.py | 165 ++++----- .../resources/hostnames/settings/tls.py | 31 +- .../attack_surface_report/issue_types.py | 34 +- src/cloudflare/resources/intel/ip_lists.py | 36 +- .../load_balancers/monitors/references.py | 34 +- .../resources/load_balancers/pools/pools.py | 35 +- .../load_balancers/pools/references.py | 34 +- .../resources/logpush/datasets/jobs.py | 36 +- src/cloudflare/resources/logpush/edge.py | 32 +- .../magic_transit/pcaps/ownership.py | 34 +- .../resources/magic_transit/sites/lans.py | 33 +- .../resources/magic_transit/sites/wans.py | 33 +- .../mtls_certificates/associations.py | 36 +- .../hostnames/hostnames.py | 40 +-- src/cloudflare/resources/queues/consumers.py | 34 +- src/cloudflare/resources/queues/messages.py | 35 +- src/cloudflare/resources/snippets/rules.py | 40 +-- .../resources/stream/audio_tracks.py | 32 +- .../resources/stream/captions/captions.py | 36 +- src/cloudflare/resources/stream/keys.py | 31 +- .../resources/user/subscriptions.py | 35 +- .../resources/waiting_rooms/rules.py | 171 ++++------ .../dispatch/namespaces/scripts/bindings.py | 34 +- .../dispatch/namespaces/scripts/tags.py | 37 +- .../access/certificates/settings.py | 74 ++-- .../resources/zero_trust/devices/networks.py | 31 +- .../devices/policies/custom/custom.py | 31 +- .../devices/policies/custom/excludes.py | 74 ++-- .../policies/custom/fallback_domains.py | 74 ++-- .../devices/policies/custom/includes.py | 74 ++-- .../devices/policies/default/excludes.py | 74 ++-- .../policies/default/fallback_domains.py | 74 ++-- .../devices/policies/default/includes.py | 74 ++-- .../dlp/datasets/versions/versions.py | 43 +-- .../zero_trust/gateway/proxy_endpoints.py | 32 +- src/cloudflare/resources/zero_trust/seats.py | 45 ++- .../zero_trust/tunnels/connections.py | 33 +- .../resources/zones/custom_nameservers.py | 42 +-- src/cloudflare/resources/zones/rate_plans.py | 34 +- src/cloudflare/types/accounts/__init__.py | 1 - .../accounts/subscription_get_response.py | 10 - .../types/alerting/destinations/__init__.py | 1 - .../destinations/pagerduty_get_response.py | 10 - .../operation_bulk_create_response.py | 126 ++++--- .../cloud_connector/rule_update_response.py | 15 +- .../types/cloudforce_one/__init__.py | 1 + .../types/cloudforce_one/request_types.py | 4 +- .../request_types_response.py} | 7 +- .../types/cloudforce_one/requests/__init__.py | 1 - .../requests/asset_create_response.py | 10 +- .../requests/asset_get_response.py | 10 +- .../requests/message_get_response.py | 10 - .../payload_create_response.py | 10 +- .../payload_delete_response.py | 10 +- .../types/custom_certificates/__init__.py | 1 - .../prioritize_update_response.py | 10 - .../types/custom_nameservers/__init__.py | 1 - .../custom_nameserver_availabilty_response.py | 3 +- .../custom_nameserver_delete_response.py | 3 +- .../custom_nameserver_get_response.py | 10 - src/cloudflare/types/d1/__init__.py | 1 - .../types/d1/database_query_response.py | 10 - .../types/d1/database_raw_response.py | 21 +- src/cloudflare/types/diagnostics/__init__.py | 1 - .../diagnostics/traceroute_create_response.py | 10 - .../types/email_routing/__init__.py | 1 - .../email_routing/dns_delete_response.py | 54 --- .../investigate/move_bulk_response.py | 9 +- .../investigate/move_create_response.py | 9 +- .../investigate/release_bulk_response.py | 8 +- .../settings/domain_bulk_delete_response.py | 9 +- src/cloudflare/types/filters/__init__.py | 3 - .../filters/filter_bulk_delete_response.py | 10 - .../filters/filter_bulk_update_response.py | 10 - .../types/filters/filter_create_response.py | 10 - src/cloudflare/types/firewall/__init__.py | 5 - .../firewall/rule_bulk_delete_response.py | 10 - .../types/firewall/rule_bulk_edit_response.py | 10 - .../firewall/rule_bulk_update_response.py | 10 - .../types/firewall/rule_create_response.py | 10 - .../types/firewall/rule_edit_response.py | 10 - .../hostnames/settings/tls_get_response.py | 10 +- src/cloudflare/types/intel/__init__.py | 1 - .../issue_type_get_response.py | 3 +- .../types/intel/ip_list_get_response.py | 10 - .../types/load_balancers/__init__.py | 1 - .../monitors/reference_get_response.py | 11 +- .../load_balancers/pool_bulk_edit_response.py | 10 - .../pools/reference_get_response.py | 11 +- src/cloudflare/types/logpush/__init__.py | 1 - .../types/logpush/datasets/__init__.py | 2 - .../logpush/datasets/job_get_response.py | 10 - .../types/logpush/edge_get_response.py | 10 - .../types/magic_transit/pcaps/__init__.py | 1 - .../pcaps/ownership_get_response.py | 10 - .../types/magic_transit/sites/__init__.py | 2 - .../sites/wan_create_response.py | 10 - .../types/mtls_certificates/__init__.py | 1 - .../association_get_response.py | 10 - .../hostname_update_response.py | 10 +- src/cloudflare/types/queues/__init__.py | 1 - .../types/queues/consumer_get_response.py | 10 - .../types/queues/message_pull_response.py | 10 +- .../types/snippets/rule_update_response.py | 10 +- src/cloudflare/types/stream/__init__.py | 2 - .../types/stream/audio_track_get_response.py | 10 - .../types/stream/caption_get_response.py | 10 - .../types/stream/key_get_response.py | 10 +- src/cloudflare/types/user/__init__.py | 1 - .../types/user/subscription_get_response.py | 10 - .../types/waiting_rooms/__init__.py | 5 - .../waiting_rooms/rule_create_response.py | 10 - .../waiting_rooms/rule_delete_response.py | 10 - .../types/waiting_rooms/rule_edit_response.py | 10 - .../types/waiting_rooms/rule_get_response.py | 10 - .../waiting_rooms/rule_update_response.py | 10 - .../scripts/binding_get_response.py | 137 ++++---- .../namespaces/scripts/tag_update_response.py | 3 +- src/cloudflare/types/zero_trust/__init__.py | 1 - .../access/certificates/__init__.py | 2 - .../certificates/setting_get_response.py | 10 - .../certificates/setting_update_response.py | 10 - .../types/zero_trust/devices/__init__.py | 1 - .../devices/network_delete_response.py | 10 - .../zero_trust/devices/policies/__init__.py | 1 - .../devices/policies/custom/__init__.py | 6 - .../policies/custom/exclude_get_response.py | 10 - .../custom/exclude_update_response.py | 10 - .../custom/fallback_domain_get_response.py | 10 - .../custom/fallback_domain_update_response.py | 10 - .../policies/custom/include_get_response.py | 10 - .../custom/include_update_response.py | 10 - .../policies/custom_delete_response.py | 10 - .../devices/policies/default/__init__.py | 6 - .../policies/default/exclude_get_response.py | 10 - .../default/exclude_update_response.py | 10 - .../default/fallback_domain_get_response.py | 10 - .../fallback_domain_update_response.py | 10 - .../policies/default/include_get_response.py | 10 - .../default/include_update_response.py | 10 - .../dlp/datasets/version_create_response.py | 10 +- .../types/zero_trust/gateway/__init__.py | 1 - .../gateway/proxy_endpoint_get_response.py | 10 - .../types/zero_trust/seat_edit_response.py | 10 - .../types/zero_trust/tunnels/__init__.py | 1 - .../tunnels/connection_get_response.py | 10 - .../custom_nameserver_update_response.py | 3 +- .../types/zones/rate_plan_get_response.py | 13 +- .../accounts/test_subscriptions.py | 17 +- .../alerting/destinations/test_pagerduty.py | 15 +- .../api_gateway/test_operations.py | 14 +- .../cloud_connector/test_rules.py | 14 +- .../cloudforce_one/requests/test_assets.py | 25 +- .../cloudforce_one/requests/test_message.py | 18 +- .../cloudforce_one/test_requests.py | 32 +- .../content_scanning/test_payloads.py | 26 +- .../custom_certificates/test_prioritize.py | 17 +- tests/api_resources/d1/test_database.py | 36 +- .../diagnostics/test_traceroutes.py | 21 +- tests/api_resources/email_routing/test_dns.py | 15 +- .../email_security/investigate/test_move.py | 25 +- .../investigate/test_release.py | 13 +- .../email_security/settings/test_domains.py | 14 +- tests/api_resources/firewall/test_rules.py | 73 ++-- .../hostnames/settings/test_tls.py | 13 +- .../attack_surface_report/test_issue_types.py | 15 +- tests/api_resources/intel/test_ip_lists.py | 17 +- .../monitors/test_references.py | 13 +- .../load_balancers/pools/test_references.py | 13 +- .../load_balancers/test_pools.py | 17 +- .../logpush/datasets/test_jobs.py | 19 +- tests/api_resources/logpush/test_edge.py | 15 +- .../magic_transit/pcaps/test_ownership.py | 20 +- .../magic_transit/sites/test_lans.py | 17 +- .../magic_transit/sites/test_wans.py | 17 +- .../mtls_certificates/test_associations.py | 17 +- .../origin_tls_client_auth/test_hostnames.py | 13 +- tests/api_resources/queues/test_consumers.py | 19 +- tests/api_resources/queues/test_messages.py | 17 +- tests/api_resources/snippets/test_rules.py | 18 +- .../api_resources/stream/test_audio_tracks.py | 18 +- tests/api_resources/stream/test_captions.py | 17 +- tests/api_resources/stream/test_keys.py | 13 +- .../api_resources/test_custom_nameservers.py | 42 +-- tests/api_resources/test_filters.py | 47 ++- .../api_resources/user/test_subscriptions.py | 22 +- .../api_resources/waiting_rooms/test_rules.py | 79 ++--- .../namespaces/scripts/test_bindings.py | 15 +- .../dispatch/namespaces/scripts/test_tags.py | 14 +- .../access/certificates/test_settings.py | 40 ++- .../devices/policies/custom/test_excludes.py | 32 +- .../policies/custom/test_fallback_domains.py | 32 +- .../devices/policies/custom/test_includes.py | 32 +- .../devices/policies/default/test_excludes.py | 32 +- .../policies/default/test_fallback_domains.py | 32 +- .../devices/policies/default/test_includes.py | 32 +- .../devices/policies/test_custom.py | 13 +- .../zero_trust/devices/test_networks.py | 17 +- .../zero_trust/dlp/datasets/test_versions.py | 15 +- .../gateway/test_proxy_endpoints.py | 18 +- tests/api_resources/zero_trust/test_seats.py | 17 +- .../zero_trust/tunnels/test_connections.py | 17 +- .../zones/test_custom_nameservers.py | 23 +- tests/api_resources/zones/test_rate_plans.py | 15 +- 222 files changed, 2089 insertions(+), 3401 deletions(-) delete mode 100644 src/cloudflare/types/accounts/subscription_get_response.py delete mode 100644 src/cloudflare/types/alerting/destinations/pagerduty_get_response.py rename src/cloudflare/types/{magic_transit/sites/lan_create_response.py => cloudforce_one/request_types_response.py} (52%) delete mode 100644 src/cloudflare/types/cloudforce_one/requests/message_get_response.py delete mode 100644 src/cloudflare/types/custom_certificates/prioritize_update_response.py delete mode 100644 src/cloudflare/types/custom_nameservers/custom_nameserver_get_response.py delete mode 100644 src/cloudflare/types/d1/database_query_response.py delete mode 100644 src/cloudflare/types/diagnostics/traceroute_create_response.py delete mode 100644 src/cloudflare/types/email_routing/dns_delete_response.py delete mode 100644 src/cloudflare/types/filters/filter_bulk_delete_response.py delete mode 100644 src/cloudflare/types/filters/filter_bulk_update_response.py delete mode 100644 src/cloudflare/types/filters/filter_create_response.py delete mode 100644 src/cloudflare/types/firewall/rule_bulk_delete_response.py delete mode 100644 src/cloudflare/types/firewall/rule_bulk_edit_response.py delete mode 100644 src/cloudflare/types/firewall/rule_bulk_update_response.py delete mode 100644 src/cloudflare/types/firewall/rule_create_response.py delete mode 100644 src/cloudflare/types/firewall/rule_edit_response.py delete mode 100644 src/cloudflare/types/intel/ip_list_get_response.py delete mode 100644 src/cloudflare/types/load_balancers/pool_bulk_edit_response.py delete mode 100644 src/cloudflare/types/logpush/datasets/job_get_response.py delete mode 100644 src/cloudflare/types/logpush/edge_get_response.py delete mode 100644 src/cloudflare/types/magic_transit/pcaps/ownership_get_response.py delete mode 100644 src/cloudflare/types/magic_transit/sites/wan_create_response.py delete mode 100644 src/cloudflare/types/mtls_certificates/association_get_response.py delete mode 100644 src/cloudflare/types/queues/consumer_get_response.py delete mode 100644 src/cloudflare/types/stream/audio_track_get_response.py delete mode 100644 src/cloudflare/types/stream/caption_get_response.py delete mode 100644 src/cloudflare/types/user/subscription_get_response.py delete mode 100644 src/cloudflare/types/waiting_rooms/rule_create_response.py delete mode 100644 src/cloudflare/types/waiting_rooms/rule_delete_response.py delete mode 100644 src/cloudflare/types/waiting_rooms/rule_edit_response.py delete mode 100644 src/cloudflare/types/waiting_rooms/rule_get_response.py delete mode 100644 src/cloudflare/types/waiting_rooms/rule_update_response.py delete mode 100644 src/cloudflare/types/zero_trust/access/certificates/setting_get_response.py delete mode 100644 src/cloudflare/types/zero_trust/access/certificates/setting_update_response.py delete mode 100644 src/cloudflare/types/zero_trust/devices/network_delete_response.py delete mode 100644 src/cloudflare/types/zero_trust/devices/policies/custom/exclude_get_response.py delete mode 100644 src/cloudflare/types/zero_trust/devices/policies/custom/exclude_update_response.py delete mode 100644 src/cloudflare/types/zero_trust/devices/policies/custom/fallback_domain_get_response.py delete mode 100644 src/cloudflare/types/zero_trust/devices/policies/custom/fallback_domain_update_response.py delete mode 100644 src/cloudflare/types/zero_trust/devices/policies/custom/include_get_response.py delete mode 100644 src/cloudflare/types/zero_trust/devices/policies/custom/include_update_response.py delete mode 100644 src/cloudflare/types/zero_trust/devices/policies/custom_delete_response.py delete mode 100644 src/cloudflare/types/zero_trust/devices/policies/default/exclude_get_response.py delete mode 100644 src/cloudflare/types/zero_trust/devices/policies/default/exclude_update_response.py delete mode 100644 src/cloudflare/types/zero_trust/devices/policies/default/fallback_domain_get_response.py delete mode 100644 src/cloudflare/types/zero_trust/devices/policies/default/fallback_domain_update_response.py delete mode 100644 src/cloudflare/types/zero_trust/devices/policies/default/include_get_response.py delete mode 100644 src/cloudflare/types/zero_trust/devices/policies/default/include_update_response.py delete mode 100644 src/cloudflare/types/zero_trust/gateway/proxy_endpoint_get_response.py delete mode 100644 src/cloudflare/types/zero_trust/seat_edit_response.py delete mode 100644 src/cloudflare/types/zero_trust/tunnels/connection_get_response.py diff --git a/api.md b/api.md index 807fe265448..31d3021e218 100644 --- a/api.md +++ b/api.md @@ -77,7 +77,6 @@ from cloudflare.types.accounts import ( SubscriptionCreateResponse, SubscriptionUpdateResponse, SubscriptionDeleteResponse, - SubscriptionGetResponse, ) ``` @@ -86,7 +85,7 @@ Methods: - client.accounts.subscriptions.create(\*, account_id, \*\*params) -> SubscriptionCreateResponse - client.accounts.subscriptions.update(subscription_identifier, \*, account_id, \*\*params) -> SubscriptionUpdateResponse - client.accounts.subscriptions.delete(subscription_identifier, \*, account_id) -> SubscriptionDeleteResponse -- client.accounts.subscriptions.get(\*, account_id) -> Optional[SubscriptionGetResponse] +- client.accounts.subscriptions.get(\*, account_id) -> SyncSinglePage[Subscription] ## Tokens @@ -265,18 +264,14 @@ Methods: Types: ```python -from cloudflare.types.user import ( - SubscriptionUpdateResponse, - SubscriptionDeleteResponse, - SubscriptionGetResponse, -) +from cloudflare.types.user import SubscriptionUpdateResponse, SubscriptionDeleteResponse ``` Methods: - client.user.subscriptions.update(identifier, \*\*params) -> SubscriptionUpdateResponse - client.user.subscriptions.delete(identifier) -> SubscriptionDeleteResponse -- client.user.subscriptions.get() -> Optional[SubscriptionGetResponse] +- client.user.subscriptions.get() -> SyncSinglePage[Subscription] ## Tokens @@ -417,7 +412,7 @@ from cloudflare.types.zones import CustomNameserverUpdateResponse, CustomNameser Methods: -- client.zones.custom_nameservers.update(\*, zone_id, \*\*params) -> Optional[CustomNameserverUpdateResponse] +- client.zones.custom_nameservers.update(\*, zone_id, \*\*params) -> SyncSinglePage[CustomNameserverUpdateResponse] - client.zones.custom_nameservers.get(\*, zone_id) -> CustomNameserverGetResponse ## Holds @@ -476,7 +471,7 @@ from cloudflare.types.zones import RatePlanGetResponse Methods: -- client.zones.rate_plans.get(\*, zone_id) -> Optional[RatePlanGetResponse] +- client.zones.rate_plans.get(\*, zone_id) -> SyncSinglePage[RatePlanGetResponse] # LoadBalancers @@ -553,14 +548,14 @@ from cloudflare.types.load_balancers.monitors import ReferenceGetResponse Methods: -- client.load_balancers.monitors.references.get(monitor_id, \*, account_id) -> ReferenceGetResponse +- client.load_balancers.monitors.references.get(monitor_id, \*, account_id) -> SyncSinglePage[ReferenceGetResponse] ## Pools Types: ```python -from cloudflare.types.load_balancers import Pool, PoolDeleteResponse, PoolBulkEditResponse +from cloudflare.types.load_balancers import Pool, PoolDeleteResponse ``` Methods: @@ -569,7 +564,7 @@ Methods: - client.load_balancers.pools.update(pool_id, \*, account_id, \*\*params) -> Pool - client.load_balancers.pools.list(\*, account_id, \*\*params) -> SyncSinglePage[Pool] - client.load_balancers.pools.delete(pool_id, \*, account_id) -> PoolDeleteResponse -- client.load_balancers.pools.bulk_edit(\*, account_id, \*\*params) -> PoolBulkEditResponse +- client.load_balancers.pools.bulk_edit(\*, account_id, \*\*params) -> SyncSinglePage[Pool] - client.load_balancers.pools.edit(pool_id, \*, account_id, \*\*params) -> Pool - client.load_balancers.pools.get(pool_id, \*, account_id) -> Pool @@ -596,7 +591,7 @@ from cloudflare.types.load_balancers.pools import ReferenceGetResponse Methods: -- client.load_balancers.pools.references.get(pool_id, \*, account_id) -> ReferenceGetResponse +- client.load_balancers.pools.references.get(pool_id, \*, account_id) -> SyncSinglePage[ReferenceGetResponse] ## Previews @@ -918,15 +913,9 @@ Methods: ## Prioritize -Types: - -```python -from cloudflare.types.custom_certificates import PrioritizeUpdateResponse -``` - Methods: -- client.custom_certificates.prioritize.update(\*, zone_id, \*\*params) -> Optional[PrioritizeUpdateResponse] +- client.custom_certificates.prioritize.update(\*, zone_id, \*\*params) -> SyncSinglePage[CustomCertificate] # CustomHostnames @@ -999,16 +988,15 @@ from cloudflare.types.custom_nameservers import ( CustomNameserver, CustomNameserverDeleteResponse, CustomNameserverAvailabiltyResponse, - CustomNameserverGetResponse, ) ``` Methods: - client.custom_nameservers.create(\*, account_id, \*\*params) -> Optional[CustomNameserver] -- client.custom_nameservers.delete(custom_ns_id, \*, account_id) -> Optional[CustomNameserverDeleteResponse] -- client.custom_nameservers.availabilty(\*, account_id) -> Optional[CustomNameserverAvailabiltyResponse] -- client.custom_nameservers.get(\*, account_id) -> Optional[CustomNameserverGetResponse] +- client.custom_nameservers.delete(custom_ns_id, \*, account_id) -> SyncSinglePage[CustomNameserverDeleteResponse] +- client.custom_nameservers.availabilty(\*, account_id) -> SyncSinglePage[CustomNameserverAvailabiltyResponse] +- client.custom_nameservers.get(\*, account_id) -> SyncSinglePage[CustomNameserver] # DNSFirewall @@ -1389,8 +1377,8 @@ from cloudflare.types.email_security.investigate import MoveCreateResponse, Move Methods: -- client.email_security.investigate.move.create(postfix_id, \*, account_id, \*\*params) -> MoveCreateResponse -- client.email_security.investigate.move.bulk(\*, account_id, \*\*params) -> MoveBulkResponse +- client.email_security.investigate.move.create(postfix_id, \*, account_id, \*\*params) -> SyncSinglePage[MoveCreateResponse] +- client.email_security.investigate.move.bulk(\*, account_id, \*\*params) -> SyncSinglePage[MoveBulkResponse] ### Reclassify @@ -1414,7 +1402,7 @@ from cloudflare.types.email_security.investigate import ReleaseBulkResponse Methods: -- client.email_security.investigate.release.bulk(\*, account_id, \*\*params) -> ReleaseBulkResponse +- client.email_security.investigate.release.bulk(\*, account_id, \*\*params) -> SyncSinglePage[ReleaseBulkResponse] ## Settings @@ -1480,7 +1468,7 @@ Methods: - client.email_security.settings.domains.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[DomainListResponse] - client.email_security.settings.domains.delete(domain_id, \*, account_id) -> DomainDeleteResponse -- client.email_security.settings.domains.bulk_delete(\*, account_id) -> DomainBulkDeleteResponse +- client.email_security.settings.domains.bulk_delete(\*, account_id) -> SyncSinglePage[DomainBulkDeleteResponse] - client.email_security.settings.domains.edit(domain_id, \*, account_id, \*\*params) -> DomainEditResponse - client.email_security.settings.domains.get(domain_id, \*, account_id) -> DomainGetResponse @@ -1559,13 +1547,13 @@ Methods: Types: ```python -from cloudflare.types.email_routing import DNSRecord, DNSDeleteResponse, DNSGetResponse +from cloudflare.types.email_routing import DNSRecord, DNSGetResponse ``` Methods: - client.email_routing.dns.create(\*, zone_id, \*\*params) -> Optional[Settings] -- client.email_routing.dns.delete(\*, zone_id) -> DNSDeleteResponse +- client.email_routing.dns.delete(\*, zone_id) -> SyncSinglePage[DNSRecord] - client.email_routing.dns.edit(\*, zone_id, \*\*params) -> Optional[Settings] - client.email_routing.dns.get(\*, zone_id, \*\*params) -> DNSGetResponse @@ -1623,22 +1611,17 @@ Methods: Types: ```python -from cloudflare.types.filters import ( - FirewallFilter, - FilterCreateResponse, - FilterBulkDeleteResponse, - FilterBulkUpdateResponse, -) +from cloudflare.types.filters import FirewallFilter ``` Methods: -- client.filters.create(\*, zone_id, \*\*params) -> Optional[FilterCreateResponse] +- client.filters.create(\*, zone_id, \*\*params) -> SyncSinglePage[FirewallFilter] - client.filters.update(filter_id, \*, zone_id, \*\*params) -> FirewallFilter - client.filters.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[FirewallFilter] - client.filters.delete(filter_id, \*, zone_id) -> FirewallFilter -- client.filters.bulk_delete(\*, zone_id) -> Optional[FilterBulkDeleteResponse] -- client.filters.bulk_update(\*, zone_id) -> Optional[FilterBulkUpdateResponse] +- client.filters.bulk_delete(\*, zone_id) -> SyncSinglePage[FirewallFilter] +- client.filters.bulk_update(\*, zone_id) -> SyncSinglePage[FirewallFilter] - client.filters.get(filter_id, \*, zone_id) -> FirewallFilter # Firewall @@ -1671,28 +1654,19 @@ Methods: Types: ```python -from cloudflare.types.firewall import ( - DeletedFilter, - FirewallRule, - Product, - RuleCreateResponse, - RuleBulkDeleteResponse, - RuleBulkEditResponse, - RuleBulkUpdateResponse, - RuleEditResponse, -) +from cloudflare.types.firewall import DeletedFilter, FirewallRule, Product ``` Methods: -- client.firewall.rules.create(\*, zone_id, \*\*params) -> Optional[RuleCreateResponse] +- client.firewall.rules.create(\*, zone_id, \*\*params) -> SyncSinglePage[FirewallRule] - client.firewall.rules.update(rule_id, \*, zone_id, \*\*params) -> FirewallRule - client.firewall.rules.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[FirewallRule] - client.firewall.rules.delete(rule_id, \*, zone_id) -> FirewallRule -- client.firewall.rules.bulk_delete(\*, zone_id) -> Optional[RuleBulkDeleteResponse] -- client.firewall.rules.bulk_edit(\*, zone_id, \*\*params) -> Optional[RuleBulkEditResponse] -- client.firewall.rules.bulk_update(\*, zone_id, \*\*params) -> Optional[RuleBulkUpdateResponse] -- client.firewall.rules.edit(rule_id, \*, zone_id) -> Optional[RuleEditResponse] +- client.firewall.rules.bulk_delete(\*, zone_id) -> SyncSinglePage[FirewallRule] +- client.firewall.rules.bulk_edit(\*, zone_id, \*\*params) -> SyncSinglePage[FirewallRule] +- client.firewall.rules.bulk_update(\*, zone_id, \*\*params) -> SyncSinglePage[FirewallRule] +- client.firewall.rules.edit(rule_id, \*, zone_id) -> SyncSinglePage[FirewallRule] - client.firewall.rules.get(rule_id, \*, zone_id, \*\*params) -> FirewallRule ## AccessRules @@ -1891,28 +1865,22 @@ Methods: ### Jobs -Types: - -```python -from cloudflare.types.logpush.datasets import JobGetResponse -``` - Methods: -- client.logpush.datasets.jobs.get(dataset_id, \*, account_id, zone_id) -> Optional[JobGetResponse] +- client.logpush.datasets.jobs.get(dataset_id, \*, account_id, zone_id) -> SyncSinglePage[Optional[LogpushJob]] ## Edge Types: ```python -from cloudflare.types.logpush import InstantLogpushJob, EdgeGetResponse +from cloudflare.types.logpush import InstantLogpushJob ``` Methods: - client.logpush.edge.create(\*, zone_id, \*\*params) -> Optional[InstantLogpushJob] -- client.logpush.edge.get(\*, zone_id) -> Optional[EdgeGetResponse] +- client.logpush.edge.get(\*, zone_id) -> SyncSinglePage[Optional[InstantLogpushJob]] ## Jobs @@ -2061,7 +2029,7 @@ from cloudflare.types.origin_tls_client_auth import AuthenticatedOriginPull, Hos Methods: -- client.origin_tls_client_auth.hostnames.update(\*, zone_id, \*\*params) -> Optional[HostnameUpdateResponse] +- client.origin_tls_client_auth.hostnames.update(\*, zone_id, \*\*params) -> SyncSinglePage[HostnameUpdateResponse] - client.origin_tls_client_auth.hostnames.get(hostname, \*, zone_id) -> Optional[AuthenticatedOriginPull] ### Certificates @@ -2205,23 +2173,16 @@ Methods: Types: ```python -from cloudflare.types.waiting_rooms import ( - WaitingRoomRule, - RuleCreateResponse, - RuleUpdateResponse, - RuleDeleteResponse, - RuleEditResponse, - RuleGetResponse, -) +from cloudflare.types.waiting_rooms import WaitingRoomRule ``` Methods: -- client.waiting_rooms.rules.create(waiting_room_id, \*, zone_id, \*\*params) -> Optional[RuleCreateResponse] -- client.waiting_rooms.rules.update(waiting_room_id, \*, zone_id, \*\*params) -> Optional[RuleUpdateResponse] -- client.waiting_rooms.rules.delete(rule_id, \*, zone_id, waiting_room_id) -> Optional[RuleDeleteResponse] -- client.waiting_rooms.rules.edit(rule_id, \*, zone_id, waiting_room_id, \*\*params) -> Optional[RuleEditResponse] -- client.waiting_rooms.rules.get(waiting_room_id, \*, zone_id) -> Optional[RuleGetResponse] +- client.waiting_rooms.rules.create(waiting_room_id, \*, zone_id, \*\*params) -> SyncSinglePage[WaitingRoomRule] +- client.waiting_rooms.rules.update(waiting_room_id, \*, zone_id, \*\*params) -> SyncSinglePage[WaitingRoomRule] +- client.waiting_rooms.rules.delete(rule_id, \*, zone_id, waiting_room_id) -> SyncSinglePage[WaitingRoomRule] +- client.waiting_rooms.rules.edit(rule_id, \*, zone_id, waiting_room_id, \*\*params) -> SyncSinglePage[WaitingRoomRule] +- client.waiting_rooms.rules.get(waiting_room_id, \*, zone_id) -> SyncSinglePage[WaitingRoomRule] ## Statuses @@ -2641,7 +2602,7 @@ Methods: Types: ```python -from cloudflare.types.queues import Consumer, ConsumerDeleteResponse, ConsumerGetResponse +from cloudflare.types.queues import Consumer, ConsumerDeleteResponse ``` Methods: @@ -2649,7 +2610,7 @@ Methods: - client.queues.consumers.create(queue_id, \*, account_id, \*\*params) -> Optional[Consumer] - client.queues.consumers.update(consumer_id, \*, account_id, queue_id, \*\*params) -> Optional[Consumer] - client.queues.consumers.delete(consumer_id, \*, account_id, queue_id) -> ConsumerDeleteResponse -- client.queues.consumers.get(queue_id, \*, account_id) -> Optional[ConsumerGetResponse] +- client.queues.consumers.get(queue_id, \*, account_id) -> SyncSinglePage[Consumer] ## Messages @@ -2662,7 +2623,7 @@ from cloudflare.types.queues import MessageAckResponse, MessagePullResponse Methods: - client.queues.messages.ack(queue_id, \*, account_id, \*\*params) -> Optional[MessageAckResponse] -- client.queues.messages.pull(queue_id, \*, account_id, \*\*params) -> Optional[MessagePullResponse] +- client.queues.messages.pull(queue_id, \*, account_id, \*\*params) -> SyncSinglePage[MessagePullResponse] # APIGateway @@ -2726,7 +2687,7 @@ Methods: - client.api_gateway.operations.create(\*, zone_id, \*\*params) -> OperationCreateResponse - client.api_gateway.operations.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[OperationListResponse] - client.api_gateway.operations.delete(operation_id, \*, zone_id) -> OperationDeleteResponse -- client.api_gateway.operations.bulk_create(\*, zone_id, \*\*params) -> OperationBulkCreateResponse +- client.api_gateway.operations.bulk_create(\*, zone_id, \*\*params) -> SyncSinglePage[OperationBulkCreateResponse] - client.api_gateway.operations.bulk_delete(\*, zone_id) -> OperationBulkDeleteResponse - client.api_gateway.operations.get(operation_id, \*, zone_id, \*\*params) -> OperationGetResponse @@ -3366,12 +3327,12 @@ Methods: Types: ```python -from cloudflare.types.diagnostics import Traceroute, TracerouteCreateResponse +from cloudflare.types.diagnostics import Traceroute ``` Methods: -- client.diagnostics.traceroutes.create(\*, account_id, \*\*params) -> Optional[TracerouteCreateResponse] +- client.diagnostics.traceroutes.create(\*, account_id, \*\*params) -> SyncSinglePage[Traceroute] # Images @@ -3554,12 +3515,12 @@ Methods: Types: ```python -from cloudflare.types.intel import IPList, IPListGetResponse +from cloudflare.types.intel import IPList ``` Methods: -- client.intel.ip_lists.get(\*, account_id) -> Optional[IPListGetResponse] +- client.intel.ip_lists.get(\*, account_id) -> SyncSinglePage[IPList] ## Miscategorizations @@ -3673,7 +3634,7 @@ from cloudflare.types.intel.attack_surface_report import IssueTypeGetResponse Methods: -- client.intel.attack_surface_report.issue_types.get(\*, account_id) -> Optional[IssueTypeGetResponse] +- client.intel.attack_surface_report.issue_types.get(\*, account_id) -> SyncSinglePage[IssueTypeGetResponse] ### Issues @@ -3871,13 +3832,12 @@ from cloudflare.types.magic_transit.sites import ( LANStaticAddressing, Nat, RoutedSubnet, - LANCreateResponse, ) ``` Methods: -- client.magic_transit.sites.lans.create(site_id, \*, account_id, \*\*params) -> LANCreateResponse +- client.magic_transit.sites.lans.create(site_id, \*, account_id, \*\*params) -> SyncSinglePage[LAN] - client.magic_transit.sites.lans.update(lan_id, \*, account_id, site_id, \*\*params) -> LAN - client.magic_transit.sites.lans.list(site_id, \*, account_id) -> SyncSinglePage[LAN] - client.magic_transit.sites.lans.delete(lan_id, \*, account_id, site_id) -> LAN @@ -3889,12 +3849,12 @@ Methods: Types: ```python -from cloudflare.types.magic_transit.sites import WAN, WANStaticAddressing, WANCreateResponse +from cloudflare.types.magic_transit.sites import WAN, WANStaticAddressing ``` Methods: -- client.magic_transit.sites.wans.create(site_id, \*, account_id, \*\*params) -> WANCreateResponse +- client.magic_transit.sites.wans.create(site_id, \*, account_id, \*\*params) -> SyncSinglePage[WAN] - client.magic_transit.sites.wans.update(wan_id, \*, account_id, site_id, \*\*params) -> WAN - client.magic_transit.sites.wans.list(site_id, \*, account_id) -> SyncSinglePage[WAN] - client.magic_transit.sites.wans.delete(wan_id, \*, account_id, site_id) -> WAN @@ -3946,14 +3906,14 @@ Methods: Types: ```python -from cloudflare.types.magic_transit.pcaps import Ownership, OwnershipGetResponse +from cloudflare.types.magic_transit.pcaps import Ownership ``` Methods: - client.magic_transit.pcaps.ownership.create(\*, account_id, \*\*params) -> Ownership - client.magic_transit.pcaps.ownership.delete(ownership_id, \*, account_id) -> None -- client.magic_transit.pcaps.ownership.get(\*, account_id) -> Optional[OwnershipGetResponse] +- client.magic_transit.pcaps.ownership.get(\*, account_id) -> SyncSinglePage[Ownership] - client.magic_transit.pcaps.ownership.validate(\*, account_id, \*\*params) -> Ownership ### Download @@ -4106,12 +4066,12 @@ Methods: Types: ```python -from cloudflare.types.mtls_certificates import CertificateAsssociation, AssociationGetResponse +from cloudflare.types.mtls_certificates import CertificateAsssociation ``` Methods: -- client.mtls_certificates.associations.get(mtls_certificate_id, \*, account_id) -> Optional[AssociationGetResponse] +- client.mtls_certificates.associations.get(mtls_certificate_id, \*, account_id) -> SyncSinglePage[CertificateAsssociation] # Pages @@ -4296,7 +4256,7 @@ Methods: Types: ```python -from cloudflare.types.stream import Audio, AudioTrackDeleteResponse, AudioTrackGetResponse +from cloudflare.types.stream import Audio, AudioTrackDeleteResponse ``` Methods: @@ -4304,7 +4264,7 @@ Methods: - client.stream.audio_tracks.delete(audio_identifier, \*, account_id, identifier) -> str - client.stream.audio_tracks.copy(identifier, \*, account_id, \*\*params) -> Optional[Audio] - client.stream.audio_tracks.edit(audio_identifier, \*, account_id, identifier, \*\*params) -> Optional[Audio] -- client.stream.audio_tracks.get(identifier, \*, account_id) -> Optional[AudioTrackGetResponse] +- client.stream.audio_tracks.get(identifier, \*, account_id) -> SyncSinglePage[Audio] ## Videos @@ -4360,7 +4320,7 @@ Methods: - client.stream.keys.create(\*, account_id, \*\*params) -> Optional[Keys] - client.stream.keys.delete(identifier, \*, account_id) -> str -- client.stream.keys.get(\*, account_id) -> Optional[KeyGetResponse] +- client.stream.keys.get(\*, account_id) -> SyncSinglePage[KeyGetResponse] ## LiveInputs @@ -4427,12 +4387,12 @@ Methods: Types: ```python -from cloudflare.types.stream import Caption, CaptionGetResponse +from cloudflare.types.stream import Caption ``` Methods: -- client.stream.captions.get(identifier, \*, account_id) -> Optional[CaptionGetResponse] +- client.stream.captions.get(identifier, \*, account_id) -> SyncSinglePage[Caption] ### Language @@ -4540,7 +4500,6 @@ from cloudflare.types.alerting.destinations import ( Pagerduty, PagerdutyCreateResponse, PagerdutyDeleteResponse, - PagerdutyGetResponse, PagerdutyLinkResponse, ) ``` @@ -4549,7 +4508,7 @@ Methods: - client.alerting.destinations.pagerduty.create(\*, account_id) -> Optional[PagerdutyCreateResponse] - client.alerting.destinations.pagerduty.delete(\*, account_id) -> PagerdutyDeleteResponse -- client.alerting.destinations.pagerduty.get(\*, account_id) -> Optional[PagerdutyGetResponse] +- client.alerting.destinations.pagerduty.get(\*, account_id) -> SyncSinglePage[Pagerduty] - client.alerting.destinations.pagerduty.link(token_id, \*, account_id) -> Optional[PagerdutyLinkResponse] ### Webhooks @@ -4627,7 +4586,6 @@ from cloudflare.types.d1 import ( DatabaseDeleteResponse, DatabaseExportResponse, DatabaseImportResponse, - DatabaseQueryResponse, DatabaseRawResponse, ) ``` @@ -4640,8 +4598,8 @@ Methods: - client.d1.database.export(database_id, \*, account_id, \*\*params) -> DatabaseExportResponse - client.d1.database.get(database_id, \*, account_id) -> D1 - client.d1.database.import\_(database_id, \*, account_id, \*\*params) -> DatabaseImportResponse -- client.d1.database.query(database_id, \*, account_id, \*\*params) -> DatabaseQueryResponse -- client.d1.database.raw(database_id, \*, account_id, \*\*params) -> DatabaseRawResponse +- client.d1.database.query(database_id, \*, account_id, \*\*params) -> SyncSinglePage[QueryResult] +- client.d1.database.raw(database_id, \*, account_id, \*\*params) -> SyncSinglePage[DatabaseRawResponse] # R2 @@ -4890,7 +4848,7 @@ from cloudflare.types.workers_for_platforms.dispatch.namespaces.scripts import B Methods: -- client.workers_for_platforms.dispatch.namespaces.scripts.bindings.get(script_name, \*, account_id, dispatch_namespace) -> Optional[BindingGetResponse] +- client.workers_for_platforms.dispatch.namespaces.scripts.bindings.get(script_name, \*, account_id, dispatch_namespace) -> SyncSinglePage[BindingGetResponse] ##### Secrets @@ -4925,7 +4883,7 @@ from cloudflare.types.workers_for_platforms.dispatch.namespaces.scripts import ( Methods: -- client.workers_for_platforms.dispatch.namespaces.scripts.tags.update(script_name, \*, account_id, dispatch_namespace, \*\*params) -> Optional[TagUpdateResponse] +- client.workers_for_platforms.dispatch.namespaces.scripts.tags.update(script_name, \*, account_id, dispatch_namespace, \*\*params) -> SyncSinglePage[TagUpdateResponse] - client.workers_for_platforms.dispatch.namespaces.scripts.tags.list(script_name, \*, account_id, dispatch_namespace) -> SyncSinglePage[TagListResponse] - client.workers_for_platforms.dispatch.namespaces.scripts.tags.delete(tag, \*, account_id, dispatch_namespace, script_name) -> object @@ -4970,7 +4928,7 @@ Methods: Types: ```python -from cloudflare.types.zero_trust.devices import DeviceNetwork, NetworkDeleteResponse +from cloudflare.types.zero_trust.devices import DeviceNetwork ``` Methods: @@ -4978,7 +4936,7 @@ Methods: - client.zero_trust.devices.networks.create(\*, account_id, \*\*params) -> Optional[DeviceNetwork] - client.zero_trust.devices.networks.update(network_id, \*, account_id, \*\*params) -> Optional[DeviceNetwork] - client.zero_trust.devices.networks.list(\*, account_id) -> SyncSinglePage[DeviceNetwork] -- client.zero_trust.devices.networks.delete(network_id, \*, account_id) -> Optional[NetworkDeleteResponse] +- client.zero_trust.devices.networks.delete(network_id, \*, account_id) -> SyncSinglePage[DeviceNetwork] - client.zero_trust.devices.networks.get(network_id, \*, account_id) -> Optional[DeviceNetwork] ### FleetStatus @@ -5023,51 +4981,24 @@ Methods: ##### Excludes -Types: - -```python -from cloudflare.types.zero_trust.devices.policies.default import ( - ExcludeUpdateResponse, - ExcludeGetResponse, -) -``` - Methods: -- client.zero_trust.devices.policies.default.excludes.update(\*, account_id, \*\*params) -> Optional[ExcludeUpdateResponse] -- client.zero_trust.devices.policies.default.excludes.get(\*, account_id) -> Optional[ExcludeGetResponse] +- client.zero_trust.devices.policies.default.excludes.update(\*, account_id, \*\*params) -> SyncSinglePage[SplitTunnelExclude] +- client.zero_trust.devices.policies.default.excludes.get(\*, account_id) -> SyncSinglePage[SplitTunnelExclude] ##### Includes -Types: - -```python -from cloudflare.types.zero_trust.devices.policies.default import ( - IncludeUpdateResponse, - IncludeGetResponse, -) -``` - Methods: -- client.zero_trust.devices.policies.default.includes.update(\*, account_id, \*\*params) -> Optional[IncludeUpdateResponse] -- client.zero_trust.devices.policies.default.includes.get(\*, account_id) -> Optional[IncludeGetResponse] +- client.zero_trust.devices.policies.default.includes.update(\*, account_id, \*\*params) -> SyncSinglePage[SplitTunnelInclude] +- client.zero_trust.devices.policies.default.includes.get(\*, account_id) -> SyncSinglePage[SplitTunnelInclude] ##### FallbackDomains -Types: - -```python -from cloudflare.types.zero_trust.devices.policies.default import ( - FallbackDomainUpdateResponse, - FallbackDomainGetResponse, -) -``` - Methods: -- client.zero_trust.devices.policies.default.fallback_domains.update(\*, account_id, \*\*params) -> Optional[FallbackDomainUpdateResponse] -- client.zero_trust.devices.policies.default.fallback_domains.get(\*, account_id) -> Optional[FallbackDomainGetResponse] +- client.zero_trust.devices.policies.default.fallback_domains.update(\*, account_id, \*\*params) -> SyncSinglePage[FallbackDomain] +- client.zero_trust.devices.policies.default.fallback_domains.get(\*, account_id) -> SyncSinglePage[FallbackDomain] ##### Certificates @@ -5087,67 +5018,34 @@ Methods: #### Custom -Types: - -```python -from cloudflare.types.zero_trust.devices.policies import CustomDeleteResponse -``` - Methods: - client.zero_trust.devices.policies.custom.create(\*, account_id, \*\*params) -> Optional[SettingsPolicy] - client.zero_trust.devices.policies.custom.list(\*, account_id) -> SyncSinglePage[SettingsPolicy] -- client.zero_trust.devices.policies.custom.delete(policy_id, \*, account_id) -> Optional[CustomDeleteResponse] +- client.zero_trust.devices.policies.custom.delete(policy_id, \*, account_id) -> SyncSinglePage[SettingsPolicy] - client.zero_trust.devices.policies.custom.edit(policy_id, \*, account_id, \*\*params) -> Optional[SettingsPolicy] - client.zero_trust.devices.policies.custom.get(policy_id, \*, account_id) -> Optional[SettingsPolicy] ##### Excludes -Types: - -```python -from cloudflare.types.zero_trust.devices.policies.custom import ( - ExcludeUpdateResponse, - ExcludeGetResponse, -) -``` - Methods: -- client.zero_trust.devices.policies.custom.excludes.update(policy_id, \*, account_id, \*\*params) -> Optional[ExcludeUpdateResponse] -- client.zero_trust.devices.policies.custom.excludes.get(policy_id, \*, account_id) -> Optional[ExcludeGetResponse] +- client.zero_trust.devices.policies.custom.excludes.update(policy_id, \*, account_id, \*\*params) -> SyncSinglePage[SplitTunnelExclude] +- client.zero_trust.devices.policies.custom.excludes.get(policy_id, \*, account_id) -> SyncSinglePage[SplitTunnelExclude] ##### Includes -Types: - -```python -from cloudflare.types.zero_trust.devices.policies.custom import ( - IncludeUpdateResponse, - IncludeGetResponse, -) -``` - Methods: -- client.zero_trust.devices.policies.custom.includes.update(policy_id, \*, account_id, \*\*params) -> Optional[IncludeUpdateResponse] -- client.zero_trust.devices.policies.custom.includes.get(policy_id, \*, account_id) -> Optional[IncludeGetResponse] +- client.zero_trust.devices.policies.custom.includes.update(policy_id, \*, account_id, \*\*params) -> SyncSinglePage[SplitTunnelInclude] +- client.zero_trust.devices.policies.custom.includes.get(policy_id, \*, account_id) -> SyncSinglePage[SplitTunnelInclude] ##### FallbackDomains -Types: - -```python -from cloudflare.types.zero_trust.devices.policies.custom import ( - FallbackDomainUpdateResponse, - FallbackDomainGetResponse, -) -``` - Methods: -- client.zero_trust.devices.policies.custom.fallback_domains.update(policy_id, \*, account_id, \*\*params) -> Optional[FallbackDomainUpdateResponse] -- client.zero_trust.devices.policies.custom.fallback_domains.get(policy_id, \*, account_id) -> Optional[FallbackDomainGetResponse] +- client.zero_trust.devices.policies.custom.fallback_domains.update(policy_id, \*, account_id, \*\*params) -> SyncSinglePage[FallbackDomain] +- client.zero_trust.devices.policies.custom.fallback_domains.get(policy_id, \*, account_id) -> SyncSinglePage[FallbackDomain] ### Posture @@ -5322,12 +5220,12 @@ Methods: Types: ```python -from cloudflare.types.zero_trust import Seat, SeatEditResponse +from cloudflare.types.zero_trust import Seat ``` Methods: -- client.zero_trust.seats.edit(\*, account_id, \*\*params) -> Optional[SeatEditResponse] +- client.zero_trust.seats.edit(\*, account_id, \*\*params) -> SyncSinglePage[Seat] ## Access @@ -5543,17 +5441,13 @@ Methods: Types: ```python -from cloudflare.types.zero_trust.access.certificates import ( - CertificateSettings, - SettingUpdateResponse, - SettingGetResponse, -) +from cloudflare.types.zero_trust.access.certificates import CertificateSettings ``` Methods: -- client.zero_trust.access.certificates.settings.update(\*, account_id, zone_id, \*\*params) -> Optional[SettingUpdateResponse] -- client.zero_trust.access.certificates.settings.get(\*, account_id, zone_id) -> Optional[SettingGetResponse] +- client.zero_trust.access.certificates.settings.update(\*, account_id, zone_id, \*\*params) -> SyncSinglePage[CertificateSettings] +- client.zero_trust.access.certificates.settings.get(\*, account_id, zone_id) -> SyncSinglePage[CertificateSettings] ### Groups @@ -6013,17 +5907,13 @@ Methods: Types: ```python -from cloudflare.types.zero_trust.tunnels import ( - Client, - ConnectionDeleteResponse, - ConnectionGetResponse, -) +from cloudflare.types.zero_trust.tunnels import Client, ConnectionDeleteResponse ``` Methods: - client.zero_trust.tunnels.connections.delete(tunnel_id, \*, account_id, \*\*params) -> object -- client.zero_trust.tunnels.connections.get(tunnel_id, \*, account_id) -> Optional[ConnectionGetResponse] +- client.zero_trust.tunnels.connections.get(tunnel_id, \*, account_id) -> SyncSinglePage[Client] ### Token @@ -6112,7 +6002,7 @@ from cloudflare.types.zero_trust.dlp.datasets import VersionCreateResponse Methods: -- client.zero_trust.dlp.datasets.versions.create(version, \*, account_id, dataset_id, \*\*params) -> Optional[VersionCreateResponse] +- client.zero_trust.dlp.datasets.versions.create(version, \*, account_id, dataset_id, \*\*params) -> SyncSinglePage[VersionCreateResponse] ##### Entries @@ -6442,7 +6332,6 @@ from cloudflare.types.zero_trust.gateway import ( GatewayIPs, ProxyEndpoint, ProxyEndpointDeleteResponse, - ProxyEndpointGetResponse, ) ``` @@ -6452,7 +6341,7 @@ Methods: - client.zero_trust.gateway.proxy_endpoints.list(\*, account_id) -> Optional[ProxyEndpoint] - client.zero_trust.gateway.proxy_endpoints.delete(proxy_endpoint_id, \*, account_id) -> object - client.zero_trust.gateway.proxy_endpoints.edit(proxy_endpoint_id, \*, account_id, \*\*params) -> Optional[ProxyEndpoint] -- client.zero_trust.gateway.proxy_endpoints.get(proxy_endpoint_id, \*, account_id) -> Optional[ProxyEndpointGetResponse] +- client.zero_trust.gateway.proxy_endpoints.get(proxy_endpoint_id, \*, account_id) -> SyncSinglePage[ProxyEndpoint] ### Rules @@ -8151,7 +8040,7 @@ Methods: - client.hostnames.settings.tls.update(hostname, \*, zone_id, setting_id, \*\*params) -> Optional[Setting] - client.hostnames.settings.tls.delete(hostname, \*, zone_id, setting_id) -> Optional[TLSDeleteResponse] -- client.hostnames.settings.tls.get(setting_id, \*, zone_id) -> Optional[TLSGetResponse] +- client.hostnames.settings.tls.get(setting_id, \*, zone_id) -> SyncSinglePage[TLSGetResponse] # Snippets @@ -8184,7 +8073,7 @@ from cloudflare.types.snippets import RuleUpdateResponse, RuleListResponse, Rule Methods: -- client.snippets.rules.update(\*, zone_id, \*\*params) -> Optional[RuleUpdateResponse] +- client.snippets.rules.update(\*, zone_id, \*\*params) -> SyncSinglePage[RuleUpdateResponse] - client.snippets.rules.list(\*, zone_id) -> SyncSinglePage[RuleListResponse] - client.snippets.rules.delete(\*, zone_id) -> RuleDeleteResponse @@ -8248,6 +8137,7 @@ from cloudflare.types.cloudforce_one import ( RequestConstants, RequestTypes, RequestDeleteResponse, + RequestTypesResponse, ) ``` @@ -8255,23 +8145,19 @@ Methods: - client.cloudforce_one.requests.create(account_identifier, \*\*params) -> Optional[Item] - client.cloudforce_one.requests.update(request_identifier, \*, account_identifier, \*\*params) -> Optional[Item] -- client.cloudforce_one.requests.list(account_identifier, \*\*params) -> SyncV4PagePaginationArray[ListItem] +- client.cloudforce_one.requests.list(account_identifier, \*\*params) -> SyncSinglePage[ListItem] - client.cloudforce_one.requests.delete(request_identifier, \*, account_identifier) -> RequestDeleteResponse - client.cloudforce_one.requests.constants(account_identifier) -> Optional[RequestConstants] - client.cloudforce_one.requests.get(request_identifier, \*, account_identifier) -> Optional[Item] - client.cloudforce_one.requests.quota(account_identifier) -> Optional[Quota] -- client.cloudforce_one.requests.types(account_identifier) -> Optional[RequestTypes] +- client.cloudforce_one.requests.types(account_identifier) -> SyncSinglePage[RequestTypesResponse] ### Message Types: ```python -from cloudflare.types.cloudforce_one.requests import ( - Message, - MessageDeleteResponse, - MessageGetResponse, -) +from cloudflare.types.cloudforce_one.requests import Message, MessageDeleteResponse ``` Methods: @@ -8279,7 +8165,7 @@ Methods: - client.cloudforce_one.requests.message.create(request_identifier, \*, account_identifier, \*\*params) -> Optional[Message] - client.cloudforce_one.requests.message.update(message_identifer, \*, account_identifier, request_identifier, \*\*params) -> Optional[Message] - client.cloudforce_one.requests.message.delete(message_identifer, \*, account_identifier, request_identifier) -> MessageDeleteResponse -- client.cloudforce_one.requests.message.get(request_identifier, \*, account_identifier, \*\*params) -> Optional[MessageGetResponse] +- client.cloudforce_one.requests.message.get(request_identifier, \*, account_identifier, \*\*params) -> SyncSinglePage[Message] ### Priority @@ -8317,10 +8203,10 @@ from cloudflare.types.cloudforce_one.requests import ( Methods: -- client.cloudforce_one.requests.assets.create(request_identifier, \*, account_identifier, \*\*params) -> Optional[AssetCreateResponse] +- client.cloudforce_one.requests.assets.create(request_identifier, \*, account_identifier, \*\*params) -> SyncSinglePage[AssetCreateResponse] - client.cloudforce_one.requests.assets.update(asset_identifer, \*, account_identifier, request_identifier, \*\*params) -> Optional[AssetUpdateResponse] - client.cloudforce_one.requests.assets.delete(asset_identifer, \*, account_identifier, request_identifier) -> AssetDeleteResponse -- client.cloudforce_one.requests.assets.get(asset_identifer, \*, account_identifier, request_identifier) -> Optional[AssetGetResponse] +- client.cloudforce_one.requests.assets.get(asset_identifer, \*, account_identifier, request_identifier) -> SyncSinglePage[AssetGetResponse] # AIGateway @@ -8471,7 +8357,7 @@ from cloudflare.types.cloud_connector import RuleUpdateResponse, RuleListRespons Methods: -- client.cloud_connector.rules.update(\*, zone_id, \*\*params) -> Optional[RuleUpdateResponse] +- client.cloud_connector.rules.update(\*, zone_id, \*\*params) -> SyncSinglePage[RuleUpdateResponse] - client.cloud_connector.rules.list(\*, zone_id) -> SyncSinglePage[RuleListResponse] # BotnetFeed @@ -8713,9 +8599,9 @@ from cloudflare.types.content_scanning import ( Methods: -- client.content_scanning.payloads.create(\*, zone_id, \*\*params) -> Optional[PayloadCreateResponse] +- client.content_scanning.payloads.create(\*, zone_id, \*\*params) -> SyncSinglePage[PayloadCreateResponse] - client.content_scanning.payloads.list(\*, zone_id) -> SyncSinglePage[PayloadListResponse] -- client.content_scanning.payloads.delete(expression_id, \*, zone_id) -> Optional[PayloadDeleteResponse] +- client.content_scanning.payloads.delete(expression_id, \*, zone_id) -> SyncSinglePage[PayloadDeleteResponse] ## Settings diff --git a/src/cloudflare/resources/accounts/subscriptions.py b/src/cloudflare/resources/accounts/subscriptions.py index 89df486f34c..542727c8900 100644 --- a/src/cloudflare/resources/accounts/subscriptions.py +++ b/src/cloudflare/resources/accounts/subscriptions.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, Type, Optional, cast +from typing import Any, Type, cast from typing_extensions import Literal import httpx @@ -21,10 +21,11 @@ async_to_streamed_response_wrapper, ) from ..._wrappers import ResultWrapper -from ..._base_client import make_request_options +from ...pagination import SyncSinglePage, AsyncSinglePage +from ..._base_client import AsyncPaginator, make_request_options from ...types.accounts import subscription_create_params, subscription_update_params +from ...types.shared.subscription import Subscription from ...types.shared_params.rate_plan import RatePlan -from ...types.accounts.subscription_get_response import SubscriptionGetResponse from ...types.accounts.subscription_create_response import SubscriptionCreateResponse from ...types.accounts.subscription_delete_response import SubscriptionDeleteResponse from ...types.accounts.subscription_update_response import SubscriptionUpdateResponse @@ -229,7 +230,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[SubscriptionGetResponse]: + ) -> SyncSinglePage[Subscription]: """ Lists all of an account's subscriptions. @@ -246,16 +247,13 @@ def get( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get( + return self._get_api_list( f"/accounts/{account_id}/subscriptions", + page=SyncSinglePage[Subscription], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[SubscriptionGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[SubscriptionGetResponse]], ResultWrapper[SubscriptionGetResponse]), + model=Subscription, ) @@ -446,7 +444,7 @@ async def delete( cast_to=cast(Type[SubscriptionDeleteResponse], ResultWrapper[SubscriptionDeleteResponse]), ) - async def get( + def get( self, *, account_id: str, @@ -456,7 +454,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[SubscriptionGetResponse]: + ) -> AsyncPaginator[Subscription, AsyncSinglePage[Subscription]]: """ Lists all of an account's subscriptions. @@ -473,16 +471,13 @@ async def get( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._get( + return self._get_api_list( f"/accounts/{account_id}/subscriptions", + page=AsyncSinglePage[Subscription], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[SubscriptionGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[SubscriptionGetResponse]], ResultWrapper[SubscriptionGetResponse]), + model=Subscription, ) diff --git a/src/cloudflare/resources/alerting/destinations/pagerduty.py b/src/cloudflare/resources/alerting/destinations/pagerduty.py index 6e65685bb62..035b26f0af8 100644 --- a/src/cloudflare/resources/alerting/destinations/pagerduty.py +++ b/src/cloudflare/resources/alerting/destinations/pagerduty.py @@ -16,8 +16,9 @@ async_to_streamed_response_wrapper, ) from ...._wrappers import ResultWrapper -from ...._base_client import make_request_options -from ....types.alerting.destinations.pagerduty_get_response import PagerdutyGetResponse +from ....pagination import SyncSinglePage, AsyncSinglePage +from ...._base_client import AsyncPaginator, make_request_options +from ....types.alerting.destinations.pagerduty import Pagerduty from ....types.alerting.destinations.pagerduty_link_response import PagerdutyLinkResponse from ....types.alerting.destinations.pagerduty_create_response import PagerdutyCreateResponse from ....types.alerting.destinations.pagerduty_delete_response import PagerdutyDeleteResponse @@ -129,7 +130,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[PagerdutyGetResponse]: + ) -> SyncSinglePage[Pagerduty]: """ Get a list of all configured PagerDuty services. @@ -146,16 +147,13 @@ def get( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get( + return self._get_api_list( f"/accounts/{account_id}/alerting/v3/destinations/pagerduty", + page=SyncSinglePage[Pagerduty], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[PagerdutyGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[PagerdutyGetResponse]], ResultWrapper[PagerdutyGetResponse]), + model=Pagerduty, ) def link( @@ -297,7 +295,7 @@ async def delete( cast_to=PagerdutyDeleteResponse, ) - async def get( + def get( self, *, account_id: str, @@ -307,7 +305,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[PagerdutyGetResponse]: + ) -> AsyncPaginator[Pagerduty, AsyncSinglePage[Pagerduty]]: """ Get a list of all configured PagerDuty services. @@ -324,16 +322,13 @@ async def get( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._get( + return self._get_api_list( f"/accounts/{account_id}/alerting/v3/destinations/pagerduty", + page=AsyncSinglePage[Pagerduty], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[PagerdutyGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[PagerdutyGetResponse]], ResultWrapper[PagerdutyGetResponse]), + model=Pagerduty, ) async def link( diff --git a/src/cloudflare/resources/api_gateway/operations/operations.py b/src/cloudflare/resources/api_gateway/operations/operations.py index 5207f5d0c97..eae381497ff 100644 --- a/src/cloudflare/resources/api_gateway/operations/operations.py +++ b/src/cloudflare/resources/api_gateway/operations/operations.py @@ -21,7 +21,7 @@ async_to_streamed_response_wrapper, ) from ...._wrappers import ResultWrapper -from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray +from ....pagination import SyncSinglePage, AsyncSinglePage, SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ...._base_client import AsyncPaginator, make_request_options from .schema_validation import ( SchemaValidationResource, @@ -265,7 +265,7 @@ def bulk_create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OperationBulkCreateResponse: + ) -> SyncSinglePage[OperationBulkCreateResponse]: """Add one or more operations to a zone. Endpoints can contain path variables. @@ -287,17 +287,15 @@ def bulk_create( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._post( + return self._get_api_list( f"/zones/{zone_id}/api_gateway/operations", + page=SyncSinglePage[OperationBulkCreateResponse], body=maybe_transform(body, Iterable[operation_bulk_create_params.Body]), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[OperationBulkCreateResponse]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[OperationBulkCreateResponse], ResultWrapper[OperationBulkCreateResponse]), + model=OperationBulkCreateResponse, + method="post", ) def bulk_delete( @@ -593,7 +591,7 @@ async def delete( cast_to=OperationDeleteResponse, ) - async def bulk_create( + def bulk_create( self, *, zone_id: str, @@ -604,7 +602,7 @@ async def bulk_create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OperationBulkCreateResponse: + ) -> AsyncPaginator[OperationBulkCreateResponse, AsyncSinglePage[OperationBulkCreateResponse]]: """Add one or more operations to a zone. Endpoints can contain path variables. @@ -626,17 +624,15 @@ async def bulk_create( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._post( + return self._get_api_list( f"/zones/{zone_id}/api_gateway/operations", - body=await async_maybe_transform(body, Iterable[operation_bulk_create_params.Body]), + page=AsyncSinglePage[OperationBulkCreateResponse], + body=maybe_transform(body, Iterable[operation_bulk_create_params.Body]), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[OperationBulkCreateResponse]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[OperationBulkCreateResponse], ResultWrapper[OperationBulkCreateResponse]), + model=OperationBulkCreateResponse, + method="post", ) async def bulk_delete( diff --git a/src/cloudflare/resources/cloud_connector/rules.py b/src/cloudflare/resources/cloud_connector/rules.py index 2d32ec5746c..6a4ea6bf659 100644 --- a/src/cloudflare/resources/cloud_connector/rules.py +++ b/src/cloudflare/resources/cloud_connector/rules.py @@ -2,15 +2,12 @@ from __future__ import annotations -from typing import Type, Iterable, Optional, cast +from typing import Iterable import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -19,7 +16,6 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._wrappers import ResultWrapper from ...pagination import SyncSinglePage, AsyncSinglePage from ..._base_client import AsyncPaginator, make_request_options from ...types.cloud_connector import rule_update_params @@ -60,7 +56,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleUpdateResponse]: + ) -> SyncSinglePage[RuleUpdateResponse]: """ Put Rules @@ -79,17 +75,15 @@ def update( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._put( + return self._get_api_list( f"/zones/{zone_id}/cloud_connector/rules", + page=SyncSinglePage[RuleUpdateResponse], body=maybe_transform(rules, Iterable[rule_update_params.Rule]), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleUpdateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[RuleUpdateResponse]], ResultWrapper[RuleUpdateResponse]), + model=RuleUpdateResponse, + method="put", ) def list( @@ -149,7 +143,7 @@ def with_streaming_response(self) -> AsyncRulesResourceWithStreamingResponse: """ return AsyncRulesResourceWithStreamingResponse(self) - async def update( + def update( self, *, zone_id: str, @@ -160,7 +154,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleUpdateResponse]: + ) -> AsyncPaginator[RuleUpdateResponse, AsyncSinglePage[RuleUpdateResponse]]: """ Put Rules @@ -179,17 +173,15 @@ async def update( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._put( + return self._get_api_list( f"/zones/{zone_id}/cloud_connector/rules", - body=await async_maybe_transform(rules, Iterable[rule_update_params.Rule]), + page=AsyncSinglePage[RuleUpdateResponse], + body=maybe_transform(rules, Iterable[rule_update_params.Rule]), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleUpdateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[RuleUpdateResponse]], ResultWrapper[RuleUpdateResponse]), + model=RuleUpdateResponse, + method="put", ) def list( diff --git a/src/cloudflare/resources/cloudforce_one/requests/assets.py b/src/cloudflare/resources/cloudforce_one/requests/assets.py index 3ba735daf6d..0c9c7c081ba 100644 --- a/src/cloudflare/resources/cloudforce_one/requests/assets.py +++ b/src/cloudflare/resources/cloudforce_one/requests/assets.py @@ -20,7 +20,8 @@ async_to_streamed_response_wrapper, ) from ...._wrappers import ResultWrapper -from ...._base_client import make_request_options +from ....pagination import SyncSinglePage, AsyncSinglePage +from ...._base_client import AsyncPaginator, make_request_options from ....types.cloudforce_one.requests import asset_create_params, asset_update_params from ....types.cloudforce_one.requests.asset_get_response import AssetGetResponse from ....types.cloudforce_one.requests.asset_create_response import AssetCreateResponse @@ -63,7 +64,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AssetCreateResponse]: + ) -> SyncSinglePage[AssetCreateResponse]: """ List Request Assets @@ -88,8 +89,9 @@ def create( raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") if not request_identifier: raise ValueError(f"Expected a non-empty value for `request_identifier` but received {request_identifier!r}") - return self._post( + return self._get_api_list( f"/accounts/{account_identifier}/cloudforce-one/requests/{request_identifier}/asset", + page=SyncSinglePage[AssetCreateResponse], body=maybe_transform( { "page": page, @@ -98,13 +100,10 @@ def create( asset_create_params.AssetCreateParams, ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[AssetCreateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[AssetCreateResponse]], ResultWrapper[AssetCreateResponse]), + model=AssetCreateResponse, + method="post", ) def update( @@ -217,7 +216,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AssetGetResponse]: + ) -> SyncSinglePage[AssetGetResponse]: """ Get a Request Asset @@ -242,16 +241,13 @@ def get( raise ValueError(f"Expected a non-empty value for `request_identifier` but received {request_identifier!r}") if not asset_identifer: raise ValueError(f"Expected a non-empty value for `asset_identifer` but received {asset_identifer!r}") - return self._get( + return self._get_api_list( f"/accounts/{account_identifier}/cloudforce-one/requests/{request_identifier}/asset/{asset_identifer}", + page=SyncSinglePage[AssetGetResponse], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[AssetGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[AssetGetResponse]], ResultWrapper[AssetGetResponse]), + model=AssetGetResponse, ) @@ -275,7 +271,7 @@ def with_streaming_response(self) -> AsyncAssetsResourceWithStreamingResponse: """ return AsyncAssetsResourceWithStreamingResponse(self) - async def create( + def create( self, request_identifier: str, *, @@ -288,7 +284,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AssetCreateResponse]: + ) -> AsyncPaginator[AssetCreateResponse, AsyncSinglePage[AssetCreateResponse]]: """ List Request Assets @@ -313,9 +309,10 @@ async def create( raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") if not request_identifier: raise ValueError(f"Expected a non-empty value for `request_identifier` but received {request_identifier!r}") - return await self._post( + return self._get_api_list( f"/accounts/{account_identifier}/cloudforce-one/requests/{request_identifier}/asset", - body=await async_maybe_transform( + page=AsyncSinglePage[AssetCreateResponse], + body=maybe_transform( { "page": page, "per_page": per_page, @@ -323,13 +320,10 @@ async def create( asset_create_params.AssetCreateParams, ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[AssetCreateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[AssetCreateResponse]], ResultWrapper[AssetCreateResponse]), + model=AssetCreateResponse, + method="post", ) async def update( @@ -430,7 +424,7 @@ async def delete( cast_to=AssetDeleteResponse, ) - async def get( + def get( self, asset_identifer: str, *, @@ -442,7 +436,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AssetGetResponse]: + ) -> AsyncPaginator[AssetGetResponse, AsyncSinglePage[AssetGetResponse]]: """ Get a Request Asset @@ -467,16 +461,13 @@ async def get( raise ValueError(f"Expected a non-empty value for `request_identifier` but received {request_identifier!r}") if not asset_identifer: raise ValueError(f"Expected a non-empty value for `asset_identifer` but received {asset_identifer!r}") - return await self._get( + return self._get_api_list( f"/accounts/{account_identifier}/cloudforce-one/requests/{request_identifier}/asset/{asset_identifer}", + page=AsyncSinglePage[AssetGetResponse], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[AssetGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[AssetGetResponse]], ResultWrapper[AssetGetResponse]), + model=AssetGetResponse, ) diff --git a/src/cloudflare/resources/cloudforce_one/requests/message.py b/src/cloudflare/resources/cloudforce_one/requests/message.py index 0a2ba2af0dc..ec576651394 100644 --- a/src/cloudflare/resources/cloudforce_one/requests/message.py +++ b/src/cloudflare/resources/cloudforce_one/requests/message.py @@ -22,10 +22,10 @@ async_to_streamed_response_wrapper, ) from ...._wrappers import ResultWrapper -from ...._base_client import make_request_options +from ....pagination import SyncSinglePage, AsyncSinglePage +from ...._base_client import AsyncPaginator, make_request_options from ....types.cloudforce_one.requests import message_get_params, message_create_params, message_update_params from ....types.cloudforce_one.requests.message import Message -from ....types.cloudforce_one.requests.message_get_response import MessageGetResponse from ....types.cloudforce_one.requests.message_delete_response import MessageDeleteResponse __all__ = ["MessageResource", "AsyncMessageResource"] @@ -206,7 +206,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[MessageGetResponse]: + ) -> SyncSinglePage[Message]: """ List Request Messages @@ -239,8 +239,9 @@ def get( raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") if not request_identifier: raise ValueError(f"Expected a non-empty value for `request_identifier` but received {request_identifier!r}") - return self._post( + return self._get_api_list( f"/accounts/{account_identifier}/cloudforce-one/requests/{request_identifier}/message", + page=SyncSinglePage[Message], body=maybe_transform( { "page": page, @@ -253,13 +254,10 @@ def get( message_get_params.MessageGetParams, ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[MessageGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[MessageGetResponse]], ResultWrapper[MessageGetResponse]), + model=Message, + method="post", ) @@ -421,7 +419,7 @@ async def delete( cast_to=MessageDeleteResponse, ) - async def get( + def get( self, request_identifier: str, *, @@ -438,7 +436,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[MessageGetResponse]: + ) -> AsyncPaginator[Message, AsyncSinglePage[Message]]: """ List Request Messages @@ -471,9 +469,10 @@ async def get( raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") if not request_identifier: raise ValueError(f"Expected a non-empty value for `request_identifier` but received {request_identifier!r}") - return await self._post( + return self._get_api_list( f"/accounts/{account_identifier}/cloudforce-one/requests/{request_identifier}/message", - body=await async_maybe_transform( + page=AsyncSinglePage[Message], + body=maybe_transform( { "page": page, "per_page": per_page, @@ -485,13 +484,10 @@ async def get( message_get_params.MessageGetParams, ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[MessageGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[MessageGetResponse]], ResultWrapper[MessageGetResponse]), + model=Message, + method="post", ) diff --git a/src/cloudflare/resources/cloudforce_one/requests/requests.py b/src/cloudflare/resources/cloudforce_one/requests/requests.py index e286b193820..ff7631757ba 100644 --- a/src/cloudflare/resources/cloudforce_one/requests/requests.py +++ b/src/cloudflare/resources/cloudforce_one/requests/requests.py @@ -46,14 +46,14 @@ async_to_streamed_response_wrapper, ) from ...._wrappers import ResultWrapper -from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray +from ....pagination import SyncSinglePage, AsyncSinglePage from ...._base_client import AsyncPaginator, make_request_options from ....types.cloudforce_one import request_list_params, request_create_params, request_update_params from ....types.cloudforce_one.item import Item from ....types.cloudforce_one.quota import Quota from ....types.cloudforce_one.list_item import ListItem -from ....types.cloudforce_one.request_types import RequestTypes from ....types.cloudforce_one.request_constants import RequestConstants +from ....types.cloudforce_one.request_types_response import RequestTypesResponse from ....types.cloudforce_one.request_delete_response import RequestDeleteResponse __all__ = ["RequestsResource", "AsyncRequestsResource"] @@ -249,7 +249,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncV4PagePaginationArray[ListItem]: + ) -> SyncSinglePage[ListItem]: """ List Requests @@ -288,7 +288,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") return self._get_api_list( f"/accounts/{account_identifier}/cloudforce-one/requests", - page=SyncV4PagePaginationArray[ListItem], + page=SyncSinglePage[ListItem], body=maybe_transform( { "page": page, @@ -483,7 +483,7 @@ def types( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RequestTypes]: + ) -> SyncSinglePage[RequestTypesResponse]: """ Get Request Types @@ -500,16 +500,13 @@ def types( """ if not account_identifier: raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - return self._get( + return self._get_api_list( f"/accounts/{account_identifier}/cloudforce-one/requests/types", + page=SyncSinglePage[RequestTypesResponse], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RequestTypes]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[RequestTypes]], ResultWrapper[RequestTypes]), + model=str, ) @@ -703,7 +700,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ListItem, AsyncV4PagePaginationArray[ListItem]]: + ) -> AsyncPaginator[ListItem, AsyncSinglePage[ListItem]]: """ List Requests @@ -742,7 +739,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") return self._get_api_list( f"/accounts/{account_identifier}/cloudforce-one/requests", - page=AsyncV4PagePaginationArray[ListItem], + page=AsyncSinglePage[ListItem], body=maybe_transform( { "page": page, @@ -927,7 +924,7 @@ async def quota( cast_to=cast(Type[Optional[Quota]], ResultWrapper[Quota]), ) - async def types( + def types( self, account_identifier: str, *, @@ -937,7 +934,7 @@ async def types( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RequestTypes]: + ) -> AsyncPaginator[RequestTypesResponse, AsyncSinglePage[RequestTypesResponse]]: """ Get Request Types @@ -954,16 +951,13 @@ async def types( """ if not account_identifier: raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - return await self._get( + return self._get_api_list( f"/accounts/{account_identifier}/cloudforce-one/requests/types", + page=AsyncSinglePage[RequestTypesResponse], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RequestTypes]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[RequestTypes]], ResultWrapper[RequestTypes]), + model=str, ) diff --git a/src/cloudflare/resources/content_scanning/payloads.py b/src/cloudflare/resources/content_scanning/payloads.py index f4530c909cb..48edd35a89e 100644 --- a/src/cloudflare/resources/content_scanning/payloads.py +++ b/src/cloudflare/resources/content_scanning/payloads.py @@ -2,15 +2,12 @@ from __future__ import annotations -from typing import Type, Iterable, Optional, cast +from typing import Iterable import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -19,7 +16,6 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._wrappers import ResultWrapper from ...pagination import SyncSinglePage, AsyncSinglePage from ..._base_client import AsyncPaginator, make_request_options from ...types.content_scanning import payload_create_params @@ -61,7 +57,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[PayloadCreateResponse]: + ) -> SyncSinglePage[PayloadCreateResponse]: """ Add custom scan expressions for Content Scanning @@ -78,17 +74,15 @@ def create( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._post( + return self._get_api_list( f"/zones/{zone_id}/content-upload-scan/payloads", + page=SyncSinglePage[PayloadCreateResponse], body=maybe_transform(body, Iterable[payload_create_params.Body]), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[PayloadCreateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[PayloadCreateResponse]], ResultWrapper[PayloadCreateResponse]), + model=PayloadCreateResponse, + method="post", ) def list( @@ -138,7 +132,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[PayloadDeleteResponse]: + ) -> SyncSinglePage[PayloadDeleteResponse]: """ Delete a Content Scan Custom Expression @@ -159,16 +153,14 @@ def delete( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not expression_id: raise ValueError(f"Expected a non-empty value for `expression_id` but received {expression_id!r}") - return self._delete( + return self._get_api_list( f"/zones/{zone_id}/content-upload-scan/payloads/{expression_id}", + page=SyncSinglePage[PayloadDeleteResponse], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[PayloadDeleteResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[PayloadDeleteResponse]], ResultWrapper[PayloadDeleteResponse]), + model=PayloadDeleteResponse, + method="delete", ) @@ -192,7 +184,7 @@ def with_streaming_response(self) -> AsyncPayloadsResourceWithStreamingResponse: """ return AsyncPayloadsResourceWithStreamingResponse(self) - async def create( + def create( self, *, zone_id: str, @@ -203,7 +195,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[PayloadCreateResponse]: + ) -> AsyncPaginator[PayloadCreateResponse, AsyncSinglePage[PayloadCreateResponse]]: """ Add custom scan expressions for Content Scanning @@ -220,17 +212,15 @@ async def create( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._post( + return self._get_api_list( f"/zones/{zone_id}/content-upload-scan/payloads", - body=await async_maybe_transform(body, Iterable[payload_create_params.Body]), + page=AsyncSinglePage[PayloadCreateResponse], + body=maybe_transform(body, Iterable[payload_create_params.Body]), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[PayloadCreateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[PayloadCreateResponse]], ResultWrapper[PayloadCreateResponse]), + model=PayloadCreateResponse, + method="post", ) def list( @@ -269,7 +259,7 @@ def list( model=PayloadListResponse, ) - async def delete( + def delete( self, expression_id: str, *, @@ -280,7 +270,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[PayloadDeleteResponse]: + ) -> AsyncPaginator[PayloadDeleteResponse, AsyncSinglePage[PayloadDeleteResponse]]: """ Delete a Content Scan Custom Expression @@ -301,16 +291,14 @@ async def delete( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not expression_id: raise ValueError(f"Expected a non-empty value for `expression_id` but received {expression_id!r}") - return await self._delete( + return self._get_api_list( f"/zones/{zone_id}/content-upload-scan/payloads/{expression_id}", + page=AsyncSinglePage[PayloadDeleteResponse], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[PayloadDeleteResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[PayloadDeleteResponse]], ResultWrapper[PayloadDeleteResponse]), + model=PayloadDeleteResponse, + method="delete", ) diff --git a/src/cloudflare/resources/custom_certificates/prioritize.py b/src/cloudflare/resources/custom_certificates/prioritize.py index 01f292bf754..582b319f716 100644 --- a/src/cloudflare/resources/custom_certificates/prioritize.py +++ b/src/cloudflare/resources/custom_certificates/prioritize.py @@ -2,15 +2,12 @@ from __future__ import annotations -from typing import Type, Iterable, Optional, cast +from typing import Iterable import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -19,10 +16,10 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._wrappers import ResultWrapper -from ..._base_client import make_request_options +from ...pagination import SyncSinglePage, AsyncSinglePage +from ..._base_client import AsyncPaginator, make_request_options from ...types.custom_certificates import prioritize_update_params -from ...types.custom_certificates.prioritize_update_response import PrioritizeUpdateResponse +from ...types.custom_certificates.custom_certificate import CustomCertificate __all__ = ["PrioritizeResource", "AsyncPrioritizeResource"] @@ -58,7 +55,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[PrioritizeUpdateResponse]: + ) -> SyncSinglePage[CustomCertificate]: """ If a zone has multiple SSL certificates, you can set the order in which they should be used during a request. The higher priority will break ties across @@ -79,17 +76,15 @@ def update( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._put( + return self._get_api_list( f"/zones/{zone_id}/custom_certificates/prioritize", + page=SyncSinglePage[CustomCertificate], body=maybe_transform({"certificates": certificates}, prioritize_update_params.PrioritizeUpdateParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[PrioritizeUpdateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[PrioritizeUpdateResponse]], ResultWrapper[PrioritizeUpdateResponse]), + model=CustomCertificate, + method="put", ) @@ -113,7 +108,7 @@ def with_streaming_response(self) -> AsyncPrioritizeResourceWithStreamingRespons """ return AsyncPrioritizeResourceWithStreamingResponse(self) - async def update( + def update( self, *, zone_id: str, @@ -124,7 +119,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[PrioritizeUpdateResponse]: + ) -> AsyncPaginator[CustomCertificate, AsyncSinglePage[CustomCertificate]]: """ If a zone has multiple SSL certificates, you can set the order in which they should be used during a request. The higher priority will break ties across @@ -145,19 +140,15 @@ async def update( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._put( + return self._get_api_list( f"/zones/{zone_id}/custom_certificates/prioritize", - body=await async_maybe_transform( - {"certificates": certificates}, prioritize_update_params.PrioritizeUpdateParams - ), + page=AsyncSinglePage[CustomCertificate], + body=maybe_transform({"certificates": certificates}, prioritize_update_params.PrioritizeUpdateParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[PrioritizeUpdateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[PrioritizeUpdateResponse]], ResultWrapper[PrioritizeUpdateResponse]), + model=CustomCertificate, + method="put", ) diff --git a/src/cloudflare/resources/custom_nameservers.py b/src/cloudflare/resources/custom_nameservers.py index 25b3d72e34b..8899e5b2e57 100644 --- a/src/cloudflare/resources/custom_nameservers.py +++ b/src/cloudflare/resources/custom_nameservers.py @@ -20,10 +20,10 @@ async_to_streamed_response_wrapper, ) from .._wrappers import ResultWrapper -from .._base_client import make_request_options +from ..pagination import SyncSinglePage, AsyncSinglePage +from .._base_client import AsyncPaginator, make_request_options from ..types.custom_nameservers import custom_nameserver_create_params from ..types.custom_nameservers.custom_nameserver import CustomNameserver -from ..types.custom_nameservers.custom_nameserver_get_response import CustomNameserverGetResponse from ..types.custom_nameservers.custom_nameserver_delete_response import CustomNameserverDeleteResponse from ..types.custom_nameservers.custom_nameserver_availabilty_response import CustomNameserverAvailabiltyResponse @@ -113,7 +113,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CustomNameserverDeleteResponse]: + ) -> SyncSinglePage[CustomNameserverDeleteResponse]: """ Delete Account Custom Nameserver @@ -134,16 +134,14 @@ def delete( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not custom_ns_id: raise ValueError(f"Expected a non-empty value for `custom_ns_id` but received {custom_ns_id!r}") - return self._delete( + return self._get_api_list( f"/accounts/{account_id}/custom_ns/{custom_ns_id}", + page=SyncSinglePage[CustomNameserverDeleteResponse], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[CustomNameserverDeleteResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[CustomNameserverDeleteResponse]], ResultWrapper[CustomNameserverDeleteResponse]), + model=str, + method="delete", ) def availabilty( @@ -156,7 +154,7 @@ def availabilty( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CustomNameserverAvailabiltyResponse]: + ) -> SyncSinglePage[CustomNameserverAvailabiltyResponse]: """ Get Eligible Zones for Account Custom Nameservers @@ -173,18 +171,13 @@ def availabilty( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get( + return self._get_api_list( f"/accounts/{account_id}/custom_ns/availability", + page=SyncSinglePage[CustomNameserverAvailabiltyResponse], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[CustomNameserverAvailabiltyResponse]]._unwrapper, - ), - cast_to=cast( - Type[Optional[CustomNameserverAvailabiltyResponse]], ResultWrapper[CustomNameserverAvailabiltyResponse] + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), + model=str, ) def get( @@ -197,7 +190,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CustomNameserverGetResponse]: + ) -> SyncSinglePage[CustomNameserver]: """ List an account's custom nameservers. @@ -214,16 +207,13 @@ def get( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get( + return self._get_api_list( f"/accounts/{account_id}/custom_ns", + page=SyncSinglePage[CustomNameserver], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[CustomNameserverGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[CustomNameserverGetResponse]], ResultWrapper[CustomNameserverGetResponse]), + model=CustomNameserver, ) @@ -299,7 +289,7 @@ async def create( cast_to=cast(Type[Optional[CustomNameserver]], ResultWrapper[CustomNameserver]), ) - async def delete( + def delete( self, custom_ns_id: str, *, @@ -310,7 +300,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CustomNameserverDeleteResponse]: + ) -> AsyncPaginator[CustomNameserverDeleteResponse, AsyncSinglePage[CustomNameserverDeleteResponse]]: """ Delete Account Custom Nameserver @@ -331,19 +321,17 @@ async def delete( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not custom_ns_id: raise ValueError(f"Expected a non-empty value for `custom_ns_id` but received {custom_ns_id!r}") - return await self._delete( + return self._get_api_list( f"/accounts/{account_id}/custom_ns/{custom_ns_id}", + page=AsyncSinglePage[CustomNameserverDeleteResponse], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[CustomNameserverDeleteResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[CustomNameserverDeleteResponse]], ResultWrapper[CustomNameserverDeleteResponse]), + model=str, + method="delete", ) - async def availabilty( + def availabilty( self, *, account_id: str, @@ -353,7 +341,7 @@ async def availabilty( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CustomNameserverAvailabiltyResponse]: + ) -> AsyncPaginator[CustomNameserverAvailabiltyResponse, AsyncSinglePage[CustomNameserverAvailabiltyResponse]]: """ Get Eligible Zones for Account Custom Nameservers @@ -370,21 +358,16 @@ async def availabilty( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._get( + return self._get_api_list( f"/accounts/{account_id}/custom_ns/availability", + page=AsyncSinglePage[CustomNameserverAvailabiltyResponse], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[CustomNameserverAvailabiltyResponse]]._unwrapper, - ), - cast_to=cast( - Type[Optional[CustomNameserverAvailabiltyResponse]], ResultWrapper[CustomNameserverAvailabiltyResponse] + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), + model=str, ) - async def get( + def get( self, *, account_id: str, @@ -394,7 +377,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CustomNameserverGetResponse]: + ) -> AsyncPaginator[CustomNameserver, AsyncSinglePage[CustomNameserver]]: """ List an account's custom nameservers. @@ -411,16 +394,13 @@ async def get( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._get( + return self._get_api_list( f"/accounts/{account_id}/custom_ns", + page=AsyncSinglePage[CustomNameserver], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[CustomNameserverGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[CustomNameserverGetResponse]], ResultWrapper[CustomNameserverGetResponse]), + model=CustomNameserver, ) diff --git a/src/cloudflare/resources/d1/database.py b/src/cloudflare/resources/d1/database.py index 1dba0e54c8d..025094dabe8 100644 --- a/src/cloudflare/resources/d1/database.py +++ b/src/cloudflare/resources/d1/database.py @@ -30,12 +30,12 @@ async_to_streamed_response_wrapper, ) from ..._wrappers import ResultWrapper -from ...pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray +from ...pagination import SyncSinglePage, AsyncSinglePage, SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ...types.d1.d1 import D1 from ..._base_client import AsyncPaginator, make_request_options +from ...types.d1.query_result import QueryResult from ...types.d1.database_raw_response import DatabaseRawResponse from ...types.d1.database_list_response import DatabaseListResponse -from ...types.d1.database_query_response import DatabaseQueryResponse from ...types.d1.database_export_response import DatabaseExportResponse from ...types.d1.database_import_response import DatabaseImportResponse @@ -491,7 +491,7 @@ def query( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DatabaseQueryResponse: + ) -> SyncSinglePage[QueryResult]: """ Returns the query result as an object. @@ -513,8 +513,9 @@ def query( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not database_id: raise ValueError(f"Expected a non-empty value for `database_id` but received {database_id!r}") - return self._post( + return self._get_api_list( f"/accounts/{account_id}/d1/database/{database_id}/query", + page=SyncSinglePage[QueryResult], body=maybe_transform( { "sql": sql, @@ -523,13 +524,10 @@ def query( database_query_params.DatabaseQueryParams, ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[DatabaseQueryResponse]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[DatabaseQueryResponse], ResultWrapper[DatabaseQueryResponse]), + model=QueryResult, + method="post", ) def raw( @@ -545,7 +543,7 @@ def raw( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DatabaseRawResponse: + ) -> SyncSinglePage[DatabaseRawResponse]: """Returns the query result rows as arrays rather than objects. This is a @@ -569,8 +567,9 @@ def raw( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not database_id: raise ValueError(f"Expected a non-empty value for `database_id` but received {database_id!r}") - return self._post( + return self._get_api_list( f"/accounts/{account_id}/d1/database/{database_id}/raw", + page=SyncSinglePage[DatabaseRawResponse], body=maybe_transform( { "sql": sql, @@ -579,13 +578,10 @@ def raw( database_raw_params.DatabaseRawParams, ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[DatabaseRawResponse]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[DatabaseRawResponse], ResultWrapper[DatabaseRawResponse]), + model=DatabaseRawResponse, + method="post", ) @@ -1025,7 +1021,7 @@ async def import_( cast_to=cast(Type[DatabaseImportResponse], ResultWrapper[DatabaseImportResponse]), ) - async def query( + def query( self, database_id: str, *, @@ -1038,7 +1034,7 @@ async def query( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DatabaseQueryResponse: + ) -> AsyncPaginator[QueryResult, AsyncSinglePage[QueryResult]]: """ Returns the query result as an object. @@ -1060,9 +1056,10 @@ async def query( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not database_id: raise ValueError(f"Expected a non-empty value for `database_id` but received {database_id!r}") - return await self._post( + return self._get_api_list( f"/accounts/{account_id}/d1/database/{database_id}/query", - body=await async_maybe_transform( + page=AsyncSinglePage[QueryResult], + body=maybe_transform( { "sql": sql, "params": params, @@ -1070,16 +1067,13 @@ async def query( database_query_params.DatabaseQueryParams, ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[DatabaseQueryResponse]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[DatabaseQueryResponse], ResultWrapper[DatabaseQueryResponse]), + model=QueryResult, + method="post", ) - async def raw( + def raw( self, database_id: str, *, @@ -1092,7 +1086,7 @@ async def raw( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DatabaseRawResponse: + ) -> AsyncPaginator[DatabaseRawResponse, AsyncSinglePage[DatabaseRawResponse]]: """Returns the query result rows as arrays rather than objects. This is a @@ -1116,9 +1110,10 @@ async def raw( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not database_id: raise ValueError(f"Expected a non-empty value for `database_id` but received {database_id!r}") - return await self._post( + return self._get_api_list( f"/accounts/{account_id}/d1/database/{database_id}/raw", - body=await async_maybe_transform( + page=AsyncSinglePage[DatabaseRawResponse], + body=maybe_transform( { "sql": sql, "params": params, @@ -1126,13 +1121,10 @@ async def raw( database_raw_params.DatabaseRawParams, ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[DatabaseRawResponse]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[DatabaseRawResponse], ResultWrapper[DatabaseRawResponse]), + model=DatabaseRawResponse, + method="post", ) diff --git a/src/cloudflare/resources/diagnostics/traceroutes.py b/src/cloudflare/resources/diagnostics/traceroutes.py index 8ef33b25588..3428333be8a 100644 --- a/src/cloudflare/resources/diagnostics/traceroutes.py +++ b/src/cloudflare/resources/diagnostics/traceroutes.py @@ -2,15 +2,12 @@ from __future__ import annotations -from typing import List, Type, Optional, cast +from typing import List import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -19,10 +16,10 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._wrappers import ResultWrapper -from ..._base_client import make_request_options +from ...pagination import SyncSinglePage, AsyncSinglePage +from ..._base_client import AsyncPaginator, make_request_options from ...types.diagnostics import traceroute_create_params -from ...types.diagnostics.traceroute_create_response import TracerouteCreateResponse +from ...types.diagnostics.traceroute import Traceroute __all__ = ["TraceroutesResource", "AsyncTraceroutesResource"] @@ -60,7 +57,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[TracerouteCreateResponse]: + ) -> SyncSinglePage[Traceroute]: """ Run traceroutes from Cloudflare colos. @@ -80,8 +77,9 @@ def create( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._post( + return self._get_api_list( f"/accounts/{account_id}/diagnostics/traceroute", + page=SyncSinglePage[Traceroute], body=maybe_transform( { "targets": targets, @@ -91,13 +89,10 @@ def create( traceroute_create_params.TracerouteCreateParams, ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[TracerouteCreateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[TracerouteCreateResponse]], ResultWrapper[TracerouteCreateResponse]), + model=Traceroute, + method="post", ) @@ -121,7 +116,7 @@ def with_streaming_response(self) -> AsyncTraceroutesResourceWithStreamingRespon """ return AsyncTraceroutesResourceWithStreamingResponse(self) - async def create( + def create( self, *, account_id: str, @@ -134,7 +129,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[TracerouteCreateResponse]: + ) -> AsyncPaginator[Traceroute, AsyncSinglePage[Traceroute]]: """ Run traceroutes from Cloudflare colos. @@ -154,9 +149,10 @@ async def create( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._post( + return self._get_api_list( f"/accounts/{account_id}/diagnostics/traceroute", - body=await async_maybe_transform( + page=AsyncSinglePage[Traceroute], + body=maybe_transform( { "targets": targets, "colos": colos, @@ -165,13 +161,10 @@ async def create( traceroute_create_params.TracerouteCreateParams, ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[TracerouteCreateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[TracerouteCreateResponse]], ResultWrapper[TracerouteCreateResponse]), + model=Traceroute, + method="post", ) diff --git a/src/cloudflare/resources/email_routing/dns.py b/src/cloudflare/resources/email_routing/dns.py index dc2723584b5..66a32de1370 100644 --- a/src/cloudflare/resources/email_routing/dns.py +++ b/src/cloudflare/resources/email_routing/dns.py @@ -20,11 +20,12 @@ async_to_streamed_response_wrapper, ) from ..._wrappers import ResultWrapper -from ..._base_client import make_request_options +from ...pagination import SyncSinglePage, AsyncSinglePage +from ..._base_client import AsyncPaginator, make_request_options from ...types.email_routing import dns_get_params, dns_edit_params, dns_create_params from ...types.email_routing.settings import Settings +from ...types.email_routing.dns_record import DNSRecord from ...types.email_routing.dns_get_response import DNSGetResponse -from ...types.email_routing.dns_delete_response import DNSDeleteResponse __all__ = ["DNSResource", "AsyncDNSResource"] @@ -103,7 +104,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DNSDeleteResponse: + ) -> SyncSinglePage[DNSRecord]: """Disable your Email Routing zone. Also removes additional MX records previously @@ -122,15 +123,14 @@ def delete( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return cast( - DNSDeleteResponse, - self._delete( - f"/zones/{zone_id}/email/routing/dns", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=cast(Any, DNSDeleteResponse), # Union types cannot be passed in as arguments in the type system + return self._get_api_list( + f"/zones/{zone_id}/email/routing/dns", + page=SyncSinglePage[DNSRecord], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), + model=DNSRecord, + method="delete", ) def edit( @@ -286,7 +286,7 @@ async def create( cast_to=cast(Type[Optional[Settings]], ResultWrapper[Settings]), ) - async def delete( + def delete( self, *, zone_id: str, @@ -296,7 +296,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DNSDeleteResponse: + ) -> AsyncPaginator[DNSRecord, AsyncSinglePage[DNSRecord]]: """Disable your Email Routing zone. Also removes additional MX records previously @@ -315,15 +315,14 @@ async def delete( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return cast( - DNSDeleteResponse, - await self._delete( - f"/zones/{zone_id}/email/routing/dns", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=cast(Any, DNSDeleteResponse), # Union types cannot be passed in as arguments in the type system + return self._get_api_list( + f"/zones/{zone_id}/email/routing/dns", + page=AsyncSinglePage[DNSRecord], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), + model=DNSRecord, + method="delete", ) async def edit( diff --git a/src/cloudflare/resources/email_security/investigate/move.py b/src/cloudflare/resources/email_security/investigate/move.py index 6b335bb8a2e..4081ee6e193 100644 --- a/src/cloudflare/resources/email_security/investigate/move.py +++ b/src/cloudflare/resources/email_security/investigate/move.py @@ -2,16 +2,13 @@ from __future__ import annotations -from typing import List, Type, cast +from typing import List from typing_extensions import Literal import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import ( - maybe_transform, - async_maybe_transform, -) +from ...._utils import maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -20,8 +17,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...._wrappers import ResultWrapper -from ...._base_client import make_request_options +from ....pagination import SyncSinglePage, AsyncSinglePage +from ...._base_client import AsyncPaginator, make_request_options from ....types.email_security.investigate import move_bulk_params, move_create_params from ....types.email_security.investigate.move_bulk_response import MoveBulkResponse from ....types.email_security.investigate.move_create_response import MoveCreateResponse @@ -63,7 +60,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MoveCreateResponse: + ) -> SyncSinglePage[MoveCreateResponse]: """ Move a message @@ -84,17 +81,15 @@ def create( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not postfix_id: raise ValueError(f"Expected a non-empty value for `postfix_id` but received {postfix_id!r}") - return self._post( + return self._get_api_list( f"/accounts/{account_id}/email-security/investigate/{postfix_id}/move", + page=SyncSinglePage[MoveCreateResponse], body=maybe_transform({"destination": destination}, move_create_params.MoveCreateParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[MoveCreateResponse]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[MoveCreateResponse], ResultWrapper[MoveCreateResponse]), + model=MoveCreateResponse, + method="post", ) def bulk( @@ -111,7 +106,7 @@ def bulk( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MoveBulkResponse: + ) -> SyncSinglePage[MoveBulkResponse]: """ Move multiple messages @@ -128,8 +123,9 @@ def bulk( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._post( + return self._get_api_list( f"/accounts/{account_id}/email-security/investigate/move", + page=SyncSinglePage[MoveBulkResponse], body=maybe_transform( { "destination": destination, @@ -138,13 +134,10 @@ def bulk( move_bulk_params.MoveBulkParams, ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[MoveBulkResponse]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[MoveBulkResponse], ResultWrapper[MoveBulkResponse]), + model=MoveBulkResponse, + method="post", ) @@ -168,7 +161,7 @@ def with_streaming_response(self) -> AsyncMoveResourceWithStreamingResponse: """ return AsyncMoveResourceWithStreamingResponse(self) - async def create( + def create( self, postfix_id: str, *, @@ -182,7 +175,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MoveCreateResponse: + ) -> AsyncPaginator[MoveCreateResponse, AsyncSinglePage[MoveCreateResponse]]: """ Move a message @@ -203,20 +196,18 @@ async def create( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not postfix_id: raise ValueError(f"Expected a non-empty value for `postfix_id` but received {postfix_id!r}") - return await self._post( + return self._get_api_list( f"/accounts/{account_id}/email-security/investigate/{postfix_id}/move", - body=await async_maybe_transform({"destination": destination}, move_create_params.MoveCreateParams), + page=AsyncSinglePage[MoveCreateResponse], + body=maybe_transform({"destination": destination}, move_create_params.MoveCreateParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[MoveCreateResponse]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[MoveCreateResponse], ResultWrapper[MoveCreateResponse]), + model=MoveCreateResponse, + method="post", ) - async def bulk( + def bulk( self, *, account_id: str, @@ -230,7 +221,7 @@ async def bulk( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MoveBulkResponse: + ) -> AsyncPaginator[MoveBulkResponse, AsyncSinglePage[MoveBulkResponse]]: """ Move multiple messages @@ -247,9 +238,10 @@ async def bulk( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._post( + return self._get_api_list( f"/accounts/{account_id}/email-security/investigate/move", - body=await async_maybe_transform( + page=AsyncSinglePage[MoveBulkResponse], + body=maybe_transform( { "destination": destination, "postfix_ids": postfix_ids, @@ -257,13 +249,10 @@ async def bulk( move_bulk_params.MoveBulkParams, ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[MoveBulkResponse]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[MoveBulkResponse], ResultWrapper[MoveBulkResponse]), + model=MoveBulkResponse, + method="post", ) diff --git a/src/cloudflare/resources/email_security/investigate/release.py b/src/cloudflare/resources/email_security/investigate/release.py index 59dd5500bff..2777dfaea86 100644 --- a/src/cloudflare/resources/email_security/investigate/release.py +++ b/src/cloudflare/resources/email_security/investigate/release.py @@ -2,15 +2,12 @@ from __future__ import annotations -from typing import List, Type, cast +from typing import List import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import ( - maybe_transform, - async_maybe_transform, -) +from ...._utils import maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -19,8 +16,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...._wrappers import ResultWrapper -from ...._base_client import make_request_options +from ....pagination import SyncSinglePage, AsyncSinglePage +from ...._base_client import AsyncPaginator, make_request_options from ....types.email_security.investigate.release_bulk_response import ReleaseBulkResponse __all__ = ["ReleaseResource", "AsyncReleaseResource"] @@ -57,7 +54,7 @@ def bulk( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ReleaseBulkResponse: + ) -> SyncSinglePage[ReleaseBulkResponse]: """ Release messages from quarantine @@ -76,17 +73,15 @@ def bulk( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._post( + return self._get_api_list( f"/accounts/{account_id}/email-security/investigate/release", + page=SyncSinglePage[ReleaseBulkResponse], body=maybe_transform(body, List[str]), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ReleaseBulkResponse]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[ReleaseBulkResponse], ResultWrapper[ReleaseBulkResponse]), + model=ReleaseBulkResponse, + method="post", ) @@ -110,7 +105,7 @@ def with_streaming_response(self) -> AsyncReleaseResourceWithStreamingResponse: """ return AsyncReleaseResourceWithStreamingResponse(self) - async def bulk( + def bulk( self, *, account_id: str, @@ -121,7 +116,7 @@ async def bulk( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ReleaseBulkResponse: + ) -> AsyncPaginator[ReleaseBulkResponse, AsyncSinglePage[ReleaseBulkResponse]]: """ Release messages from quarantine @@ -140,17 +135,15 @@ async def bulk( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._post( + return self._get_api_list( f"/accounts/{account_id}/email-security/investigate/release", - body=await async_maybe_transform(body, List[str]), + page=AsyncSinglePage[ReleaseBulkResponse], + body=maybe_transform(body, List[str]), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ReleaseBulkResponse]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[ReleaseBulkResponse], ResultWrapper[ReleaseBulkResponse]), + model=ReleaseBulkResponse, + method="post", ) diff --git a/src/cloudflare/resources/email_security/settings/domains.py b/src/cloudflare/resources/email_security/settings/domains.py index e409adf9ef3..10bd97baf03 100644 --- a/src/cloudflare/resources/email_security/settings/domains.py +++ b/src/cloudflare/resources/email_security/settings/domains.py @@ -21,7 +21,7 @@ async_to_streamed_response_wrapper, ) from ...._wrappers import ResultWrapper -from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray +from ....pagination import SyncSinglePage, AsyncSinglePage, SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ...._base_client import AsyncPaginator, make_request_options from ....types.email_security.settings import domain_edit_params, domain_list_params from ....types.email_security.settings.domain_get_response import DomainGetResponse @@ -183,7 +183,7 @@ def bulk_delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DomainBulkDeleteResponse: + ) -> SyncSinglePage[DomainBulkDeleteResponse]: """ Unprotect multiple email domains @@ -200,16 +200,14 @@ def bulk_delete( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._delete( + return self._get_api_list( f"/accounts/{account_id}/email-security/settings/domains", + page=SyncSinglePage[DomainBulkDeleteResponse], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[DomainBulkDeleteResponse]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[DomainBulkDeleteResponse], ResultWrapper[DomainBulkDeleteResponse]), + model=DomainBulkDeleteResponse, + method="delete", ) def edit( @@ -474,7 +472,7 @@ async def delete( cast_to=cast(Type[DomainDeleteResponse], ResultWrapper[DomainDeleteResponse]), ) - async def bulk_delete( + def bulk_delete( self, *, account_id: str, @@ -484,7 +482,7 @@ async def bulk_delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DomainBulkDeleteResponse: + ) -> AsyncPaginator[DomainBulkDeleteResponse, AsyncSinglePage[DomainBulkDeleteResponse]]: """ Unprotect multiple email domains @@ -501,16 +499,14 @@ async def bulk_delete( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._delete( + return self._get_api_list( f"/accounts/{account_id}/email-security/settings/domains", + page=AsyncSinglePage[DomainBulkDeleteResponse], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[DomainBulkDeleteResponse]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[DomainBulkDeleteResponse], ResultWrapper[DomainBulkDeleteResponse]), + model=DomainBulkDeleteResponse, + method="delete", ) async def edit( diff --git a/src/cloudflare/resources/filters.py b/src/cloudflare/resources/filters.py index 3c9ec387a1a..275d86ed4b8 100644 --- a/src/cloudflare/resources/filters.py +++ b/src/cloudflare/resources/filters.py @@ -3,7 +3,7 @@ from __future__ import annotations import typing_extensions -from typing import Type, Optional, cast +from typing import Type, cast import httpx @@ -21,13 +21,10 @@ async_to_streamed_response_wrapper, ) from .._wrappers import ResultWrapper -from ..pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray +from ..pagination import SyncSinglePage, AsyncSinglePage, SyncV4PagePaginationArray, AsyncV4PagePaginationArray from .._base_client import AsyncPaginator, make_request_options from ..types.filters import filter_list_params, filter_create_params, filter_update_params from ..types.filters.firewall_filter import FirewallFilter -from ..types.filters.filter_create_response import FilterCreateResponse -from ..types.filters.filter_bulk_delete_response import FilterBulkDeleteResponse -from ..types.filters.filter_bulk_update_response import FilterBulkUpdateResponse __all__ = ["FiltersResource", "AsyncFiltersResource"] @@ -66,7 +63,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FilterCreateResponse]: + ) -> SyncSinglePage[FirewallFilter]: """ Creates one or more filters. @@ -86,17 +83,15 @@ def create( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._post( + return self._get_api_list( f"/zones/{zone_id}/filters", + page=SyncSinglePage[FirewallFilter], body=maybe_transform({"expression": expression}, filter_create_params.FilterCreateParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[FilterCreateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[FilterCreateResponse]], ResultWrapper[FilterCreateResponse]), + model=FirewallFilter, + method="post", ) @typing_extensions.deprecated( @@ -285,7 +280,7 @@ def bulk_delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FilterBulkDeleteResponse]: + ) -> SyncSinglePage[FirewallFilter]: """ Deletes one or more existing filters. @@ -302,16 +297,14 @@ def bulk_delete( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._delete( + return self._get_api_list( f"/zones/{zone_id}/filters", + page=SyncSinglePage[FirewallFilter], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[FilterBulkDeleteResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[FilterBulkDeleteResponse]], ResultWrapper[FilterBulkDeleteResponse]), + model=FirewallFilter, + method="delete", ) @typing_extensions.deprecated( @@ -327,7 +320,7 @@ def bulk_update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FilterBulkUpdateResponse]: + ) -> SyncSinglePage[FirewallFilter]: """ Updates one or more existing filters. @@ -344,16 +337,14 @@ def bulk_update( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._put( + return self._get_api_list( f"/zones/{zone_id}/filters", + page=SyncSinglePage[FirewallFilter], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[FilterBulkUpdateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[FilterBulkUpdateResponse]], ResultWrapper[FilterBulkUpdateResponse]), + model=FirewallFilter, + method="put", ) @typing_extensions.deprecated( @@ -427,7 +418,7 @@ def with_streaming_response(self) -> AsyncFiltersResourceWithStreamingResponse: @typing_extensions.deprecated( "The Filters API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details." ) - async def create( + def create( self, *, zone_id: str, @@ -438,7 +429,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FilterCreateResponse]: + ) -> AsyncPaginator[FirewallFilter, AsyncSinglePage[FirewallFilter]]: """ Creates one or more filters. @@ -458,17 +449,15 @@ async def create( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._post( + return self._get_api_list( f"/zones/{zone_id}/filters", - body=await async_maybe_transform({"expression": expression}, filter_create_params.FilterCreateParams), + page=AsyncSinglePage[FirewallFilter], + body=maybe_transform({"expression": expression}, filter_create_params.FilterCreateParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[FilterCreateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[FilterCreateResponse]], ResultWrapper[FilterCreateResponse]), + model=FirewallFilter, + method="post", ) @typing_extensions.deprecated( @@ -647,7 +636,7 @@ async def delete( @typing_extensions.deprecated( "The Filters API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details." ) - async def bulk_delete( + def bulk_delete( self, *, zone_id: str, @@ -657,7 +646,7 @@ async def bulk_delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FilterBulkDeleteResponse]: + ) -> AsyncPaginator[FirewallFilter, AsyncSinglePage[FirewallFilter]]: """ Deletes one or more existing filters. @@ -674,22 +663,20 @@ async def bulk_delete( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._delete( + return self._get_api_list( f"/zones/{zone_id}/filters", + page=AsyncSinglePage[FirewallFilter], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[FilterBulkDeleteResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[FilterBulkDeleteResponse]], ResultWrapper[FilterBulkDeleteResponse]), + model=FirewallFilter, + method="delete", ) @typing_extensions.deprecated( "The Filters API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details." ) - async def bulk_update( + def bulk_update( self, *, zone_id: str, @@ -699,7 +686,7 @@ async def bulk_update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FilterBulkUpdateResponse]: + ) -> AsyncPaginator[FirewallFilter, AsyncSinglePage[FirewallFilter]]: """ Updates one or more existing filters. @@ -716,16 +703,14 @@ async def bulk_update( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._put( + return self._get_api_list( f"/zones/{zone_id}/filters", + page=AsyncSinglePage[FirewallFilter], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[FilterBulkUpdateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[FilterBulkUpdateResponse]], ResultWrapper[FilterBulkUpdateResponse]), + model=FirewallFilter, + method="put", ) @typing_extensions.deprecated( diff --git a/src/cloudflare/resources/firewall/rules.py b/src/cloudflare/resources/firewall/rules.py index d20a9a45976..d0f3bc77822 100644 --- a/src/cloudflare/resources/firewall/rules.py +++ b/src/cloudflare/resources/firewall/rules.py @@ -3,7 +3,7 @@ from __future__ import annotations import typing_extensions -from typing import Type, Optional, cast +from typing import Type, cast import httpx @@ -21,7 +21,7 @@ async_to_streamed_response_wrapper, ) from ..._wrappers import ResultWrapper -from ...pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray +from ...pagination import SyncSinglePage, AsyncSinglePage, SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ..._base_client import AsyncPaginator, make_request_options from ...types.firewall import ( rule_get_params, @@ -32,12 +32,7 @@ rule_bulk_update_params, ) from ...types.firewall.firewall_rule import FirewallRule -from ...types.firewall.rule_edit_response import RuleEditResponse from ...types.filters.firewall_filter_param import FirewallFilterParam -from ...types.firewall.rule_create_response import RuleCreateResponse -from ...types.firewall.rule_bulk_edit_response import RuleBulkEditResponse -from ...types.firewall.rule_bulk_delete_response import RuleBulkDeleteResponse -from ...types.firewall.rule_bulk_update_response import RuleBulkUpdateResponse __all__ = ["RulesResource", "AsyncRulesResource"] @@ -77,7 +72,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleCreateResponse]: + ) -> SyncSinglePage[FirewallRule]: """ Create one or more firewall rules. @@ -97,8 +92,9 @@ def create( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._post( + return self._get_api_list( f"/zones/{zone_id}/firewall/rules", + page=SyncSinglePage[FirewallRule], body=maybe_transform( { "action": action, @@ -107,13 +103,10 @@ def create( rule_create_params.RuleCreateParams, ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleCreateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[RuleCreateResponse]], ResultWrapper[RuleCreateResponse]), + model=FirewallRule, + method="post", ) @typing_extensions.deprecated( @@ -308,7 +301,7 @@ def bulk_delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleBulkDeleteResponse]: + ) -> SyncSinglePage[FirewallRule]: """ Deletes existing firewall rules. @@ -325,16 +318,14 @@ def bulk_delete( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._delete( + return self._get_api_list( f"/zones/{zone_id}/firewall/rules", + page=SyncSinglePage[FirewallRule], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleBulkDeleteResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[RuleBulkDeleteResponse]], ResultWrapper[RuleBulkDeleteResponse]), + model=FirewallRule, + method="delete", ) @typing_extensions.deprecated( @@ -351,7 +342,7 @@ def bulk_edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleBulkEditResponse]: + ) -> SyncSinglePage[FirewallRule]: """ Updates the priority of existing firewall rules. @@ -368,17 +359,15 @@ def bulk_edit( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._patch( + return self._get_api_list( f"/zones/{zone_id}/firewall/rules", + page=SyncSinglePage[FirewallRule], body=maybe_transform(body, rule_bulk_edit_params.RuleBulkEditParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleBulkEditResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[RuleBulkEditResponse]], ResultWrapper[RuleBulkEditResponse]), + model=FirewallRule, + method="patch", ) @typing_extensions.deprecated( @@ -395,7 +384,7 @@ def bulk_update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleBulkUpdateResponse]: + ) -> SyncSinglePage[FirewallRule]: """ Updates one or more existing firewall rules. @@ -412,17 +401,15 @@ def bulk_update( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._put( + return self._get_api_list( f"/zones/{zone_id}/firewall/rules", + page=SyncSinglePage[FirewallRule], body=maybe_transform(body, rule_bulk_update_params.RuleBulkUpdateParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleBulkUpdateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[RuleBulkUpdateResponse]], ResultWrapper[RuleBulkUpdateResponse]), + model=FirewallRule, + method="put", ) @typing_extensions.deprecated( @@ -439,7 +426,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleEditResponse]: + ) -> SyncSinglePage[FirewallRule]: """ Updates the priority of an existing firewall rule. @@ -460,16 +447,14 @@ def edit( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not rule_id: raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") - return self._patch( + return self._get_api_list( f"/zones/{zone_id}/firewall/rules/{rule_id}", + page=SyncSinglePage[FirewallRule], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleEditResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[RuleEditResponse]], ResultWrapper[RuleEditResponse]), + model=FirewallRule, + method="patch", ) @typing_extensions.deprecated( @@ -547,7 +532,7 @@ def with_streaming_response(self) -> AsyncRulesResourceWithStreamingResponse: @typing_extensions.deprecated( "The Firewall Rules API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details." ) - async def create( + def create( self, *, zone_id: str, @@ -559,7 +544,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleCreateResponse]: + ) -> AsyncPaginator[FirewallRule, AsyncSinglePage[FirewallRule]]: """ Create one or more firewall rules. @@ -579,9 +564,10 @@ async def create( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._post( + return self._get_api_list( f"/zones/{zone_id}/firewall/rules", - body=await async_maybe_transform( + page=AsyncSinglePage[FirewallRule], + body=maybe_transform( { "action": action, "filter": filter, @@ -589,13 +575,10 @@ async def create( rule_create_params.RuleCreateParams, ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleCreateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[RuleCreateResponse]], ResultWrapper[RuleCreateResponse]), + model=FirewallRule, + method="post", ) @typing_extensions.deprecated( @@ -780,7 +763,7 @@ async def delete( @typing_extensions.deprecated( "The Firewall Rules API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details." ) - async def bulk_delete( + def bulk_delete( self, *, zone_id: str, @@ -790,7 +773,7 @@ async def bulk_delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleBulkDeleteResponse]: + ) -> AsyncPaginator[FirewallRule, AsyncSinglePage[FirewallRule]]: """ Deletes existing firewall rules. @@ -807,22 +790,20 @@ async def bulk_delete( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._delete( + return self._get_api_list( f"/zones/{zone_id}/firewall/rules", + page=AsyncSinglePage[FirewallRule], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleBulkDeleteResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[RuleBulkDeleteResponse]], ResultWrapper[RuleBulkDeleteResponse]), + model=FirewallRule, + method="delete", ) @typing_extensions.deprecated( "The Firewall Rules API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details." ) - async def bulk_edit( + def bulk_edit( self, *, zone_id: str, @@ -833,7 +814,7 @@ async def bulk_edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleBulkEditResponse]: + ) -> AsyncPaginator[FirewallRule, AsyncSinglePage[FirewallRule]]: """ Updates the priority of existing firewall rules. @@ -850,23 +831,21 @@ async def bulk_edit( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._patch( + return self._get_api_list( f"/zones/{zone_id}/firewall/rules", - body=await async_maybe_transform(body, rule_bulk_edit_params.RuleBulkEditParams), + page=AsyncSinglePage[FirewallRule], + body=maybe_transform(body, rule_bulk_edit_params.RuleBulkEditParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleBulkEditResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[RuleBulkEditResponse]], ResultWrapper[RuleBulkEditResponse]), + model=FirewallRule, + method="patch", ) @typing_extensions.deprecated( "The Firewall Rules API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details." ) - async def bulk_update( + def bulk_update( self, *, zone_id: str, @@ -877,7 +856,7 @@ async def bulk_update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleBulkUpdateResponse]: + ) -> AsyncPaginator[FirewallRule, AsyncSinglePage[FirewallRule]]: """ Updates one or more existing firewall rules. @@ -894,23 +873,21 @@ async def bulk_update( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._put( + return self._get_api_list( f"/zones/{zone_id}/firewall/rules", - body=await async_maybe_transform(body, rule_bulk_update_params.RuleBulkUpdateParams), + page=AsyncSinglePage[FirewallRule], + body=maybe_transform(body, rule_bulk_update_params.RuleBulkUpdateParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleBulkUpdateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[RuleBulkUpdateResponse]], ResultWrapper[RuleBulkUpdateResponse]), + model=FirewallRule, + method="put", ) @typing_extensions.deprecated( "The Firewall Rules API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details." ) - async def edit( + def edit( self, rule_id: str, *, @@ -921,7 +898,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleEditResponse]: + ) -> AsyncPaginator[FirewallRule, AsyncSinglePage[FirewallRule]]: """ Updates the priority of an existing firewall rule. @@ -942,16 +919,14 @@ async def edit( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not rule_id: raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") - return await self._patch( + return self._get_api_list( f"/zones/{zone_id}/firewall/rules/{rule_id}", + page=AsyncSinglePage[FirewallRule], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleEditResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[RuleEditResponse]], ResultWrapper[RuleEditResponse]), + model=FirewallRule, + method="patch", ) @typing_extensions.deprecated( diff --git a/src/cloudflare/resources/hostnames/settings/tls.py b/src/cloudflare/resources/hostnames/settings/tls.py index c40474a516b..2c5d7765ade 100644 --- a/src/cloudflare/resources/hostnames/settings/tls.py +++ b/src/cloudflare/resources/hostnames/settings/tls.py @@ -21,7 +21,8 @@ async_to_streamed_response_wrapper, ) from ...._wrappers import ResultWrapper -from ...._base_client import make_request_options +from ....pagination import SyncSinglePage, AsyncSinglePage +from ...._base_client import AsyncPaginator, make_request_options from ....types.hostnames.settings import tls_update_params from ....types.hostnames.settings.setting import Setting from ....types.hostnames.settings.tls_get_response import TLSGetResponse @@ -164,7 +165,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[TLSGetResponse]: + ) -> SyncSinglePage[TLSGetResponse]: """ List the requested TLS setting for the hostnames under this zone. @@ -185,16 +186,13 @@ def get( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not setting_id: raise ValueError(f"Expected a non-empty value for `setting_id` but received {setting_id!r}") - return self._get( + return self._get_api_list( f"/zones/{zone_id}/hostnames/settings/{setting_id}", + page=SyncSinglePage[TLSGetResponse], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[TLSGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[TLSGetResponse]], ResultWrapper[TLSGetResponse]), + model=TLSGetResponse, ) @@ -320,7 +318,7 @@ async def delete( cast_to=cast(Type[Optional[TLSDeleteResponse]], ResultWrapper[TLSDeleteResponse]), ) - async def get( + def get( self, setting_id: Literal["ciphers", "min_tls_version", "http2"], *, @@ -331,7 +329,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[TLSGetResponse]: + ) -> AsyncPaginator[TLSGetResponse, AsyncSinglePage[TLSGetResponse]]: """ List the requested TLS setting for the hostnames under this zone. @@ -352,16 +350,13 @@ async def get( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not setting_id: raise ValueError(f"Expected a non-empty value for `setting_id` but received {setting_id!r}") - return await self._get( + return self._get_api_list( f"/zones/{zone_id}/hostnames/settings/{setting_id}", + page=AsyncSinglePage[TLSGetResponse], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[TLSGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[TLSGetResponse]], ResultWrapper[TLSGetResponse]), + model=TLSGetResponse, ) diff --git a/src/cloudflare/resources/intel/attack_surface_report/issue_types.py b/src/cloudflare/resources/intel/attack_surface_report/issue_types.py index 11ec7be69bd..fef0b323d6b 100644 --- a/src/cloudflare/resources/intel/attack_surface_report/issue_types.py +++ b/src/cloudflare/resources/intel/attack_surface_report/issue_types.py @@ -2,8 +2,6 @@ from __future__ import annotations -from typing import Type, Optional, cast - import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven @@ -15,8 +13,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...._wrappers import ResultWrapper -from ...._base_client import make_request_options +from ....pagination import SyncSinglePage, AsyncSinglePage +from ...._base_client import AsyncPaginator, make_request_options from ....types.intel.attack_surface_report.issue_type_get_response import IssueTypeGetResponse __all__ = ["IssueTypesResource", "AsyncIssueTypesResource"] @@ -52,7 +50,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[IssueTypeGetResponse]: + ) -> SyncSinglePage[IssueTypeGetResponse]: """ Get Security Center Issues Types @@ -69,16 +67,13 @@ def get( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get( + return self._get_api_list( f"/accounts/{account_id}/intel/attack-surface-report/issue-types", + page=SyncSinglePage[IssueTypeGetResponse], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[IssueTypeGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[IssueTypeGetResponse]], ResultWrapper[IssueTypeGetResponse]), + model=str, ) @@ -102,7 +97,7 @@ def with_streaming_response(self) -> AsyncIssueTypesResourceWithStreamingRespons """ return AsyncIssueTypesResourceWithStreamingResponse(self) - async def get( + def get( self, *, account_id: str, @@ -112,7 +107,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[IssueTypeGetResponse]: + ) -> AsyncPaginator[IssueTypeGetResponse, AsyncSinglePage[IssueTypeGetResponse]]: """ Get Security Center Issues Types @@ -129,16 +124,13 @@ async def get( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._get( + return self._get_api_list( f"/accounts/{account_id}/intel/attack-surface-report/issue-types", + page=AsyncSinglePage[IssueTypeGetResponse], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[IssueTypeGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[IssueTypeGetResponse]], ResultWrapper[IssueTypeGetResponse]), + model=str, ) diff --git a/src/cloudflare/resources/intel/ip_lists.py b/src/cloudflare/resources/intel/ip_lists.py index 4a35366f10b..6a562bb29c0 100644 --- a/src/cloudflare/resources/intel/ip_lists.py +++ b/src/cloudflare/resources/intel/ip_lists.py @@ -2,8 +2,6 @@ from __future__ import annotations -from typing import Type, Optional, cast - import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven @@ -15,9 +13,9 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._wrappers import ResultWrapper -from ..._base_client import make_request_options -from ...types.intel.ip_list_get_response import IPListGetResponse +from ...pagination import SyncSinglePage, AsyncSinglePage +from ..._base_client import AsyncPaginator, make_request_options +from ...types.intel.ip_list import IPList __all__ = ["IPListsResource", "AsyncIPListsResource"] @@ -52,7 +50,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[IPListGetResponse]: + ) -> SyncSinglePage[IPList]: """ Get IP Lists @@ -69,16 +67,13 @@ def get( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get( + return self._get_api_list( f"/accounts/{account_id}/intel/ip-list", + page=SyncSinglePage[IPList], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[IPListGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[IPListGetResponse]], ResultWrapper[IPListGetResponse]), + model=IPList, ) @@ -102,7 +97,7 @@ def with_streaming_response(self) -> AsyncIPListsResourceWithStreamingResponse: """ return AsyncIPListsResourceWithStreamingResponse(self) - async def get( + def get( self, *, account_id: str, @@ -112,7 +107,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[IPListGetResponse]: + ) -> AsyncPaginator[IPList, AsyncSinglePage[IPList]]: """ Get IP Lists @@ -129,16 +124,13 @@ async def get( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._get( + return self._get_api_list( f"/accounts/{account_id}/intel/ip-list", + page=AsyncSinglePage[IPList], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[IPListGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[IPListGetResponse]], ResultWrapper[IPListGetResponse]), + model=IPList, ) diff --git a/src/cloudflare/resources/load_balancers/monitors/references.py b/src/cloudflare/resources/load_balancers/monitors/references.py index 54e233d0817..f91dc316661 100644 --- a/src/cloudflare/resources/load_balancers/monitors/references.py +++ b/src/cloudflare/resources/load_balancers/monitors/references.py @@ -2,8 +2,6 @@ from __future__ import annotations -from typing import Type, cast - import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven @@ -15,8 +13,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...._wrappers import ResultWrapper -from ...._base_client import make_request_options +from ....pagination import SyncSinglePage, AsyncSinglePage +from ...._base_client import AsyncPaginator, make_request_options from ....types.load_balancers.monitors.reference_get_response import ReferenceGetResponse __all__ = ["ReferencesResource", "AsyncReferencesResource"] @@ -53,7 +51,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ReferenceGetResponse: + ) -> SyncSinglePage[ReferenceGetResponse]: """ Get the list of resources that reference the provided monitor. @@ -72,16 +70,13 @@ def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not monitor_id: raise ValueError(f"Expected a non-empty value for `monitor_id` but received {monitor_id!r}") - return self._get( + return self._get_api_list( f"/accounts/{account_id}/load_balancers/monitors/{monitor_id}/references", + page=SyncSinglePage[ReferenceGetResponse], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ReferenceGetResponse]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[ReferenceGetResponse], ResultWrapper[ReferenceGetResponse]), + model=ReferenceGetResponse, ) @@ -105,7 +100,7 @@ def with_streaming_response(self) -> AsyncReferencesResourceWithStreamingRespons """ return AsyncReferencesResourceWithStreamingResponse(self) - async def get( + def get( self, monitor_id: str, *, @@ -116,7 +111,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ReferenceGetResponse: + ) -> AsyncPaginator[ReferenceGetResponse, AsyncSinglePage[ReferenceGetResponse]]: """ Get the list of resources that reference the provided monitor. @@ -135,16 +130,13 @@ async def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not monitor_id: raise ValueError(f"Expected a non-empty value for `monitor_id` but received {monitor_id!r}") - return await self._get( + return self._get_api_list( f"/accounts/{account_id}/load_balancers/monitors/{monitor_id}/references", + page=AsyncSinglePage[ReferenceGetResponse], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ReferenceGetResponse]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[ReferenceGetResponse], ResultWrapper[ReferenceGetResponse]), + model=ReferenceGetResponse, ) diff --git a/src/cloudflare/resources/load_balancers/pools/pools.py b/src/cloudflare/resources/load_balancers/pools/pools.py index 9465ec04317..04119211241 100644 --- a/src/cloudflare/resources/load_balancers/pools/pools.py +++ b/src/cloudflare/resources/load_balancers/pools/pools.py @@ -52,7 +52,6 @@ from ....types.load_balancers.load_shedding_param import LoadSheddingParam from ....types.load_balancers.pool_delete_response import PoolDeleteResponse from ....types.load_balancers.origin_steering_param import OriginSteeringParam -from ....types.load_balancers.pool_bulk_edit_response import PoolBulkEditResponse from ....types.load_balancers.notification_filter_param import NotificationFilterParam __all__ = ["PoolsResource", "AsyncPoolsResource"] @@ -405,7 +404,7 @@ def bulk_edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PoolBulkEditResponse: + ) -> SyncSinglePage[Pool]: """Apply changes to a number of existing pools, overwriting the supplied properties. @@ -430,17 +429,15 @@ def bulk_edit( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._patch( + return self._get_api_list( f"/accounts/{account_id}/load_balancers/pools", + page=SyncSinglePage[Pool], body=maybe_transform({"notification_email": notification_email}, pool_bulk_edit_params.PoolBulkEditParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[PoolBulkEditResponse]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[PoolBulkEditResponse], ResultWrapper[PoolBulkEditResponse]), + model=Pool, + method="patch", ) def edit( @@ -937,7 +934,7 @@ async def delete( cast_to=cast(Type[PoolDeleteResponse], ResultWrapper[PoolDeleteResponse]), ) - async def bulk_edit( + def bulk_edit( self, *, account_id: str, @@ -948,7 +945,7 @@ async def bulk_edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PoolBulkEditResponse: + ) -> AsyncPaginator[Pool, AsyncSinglePage[Pool]]: """Apply changes to a number of existing pools, overwriting the supplied properties. @@ -973,19 +970,15 @@ async def bulk_edit( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._patch( + return self._get_api_list( f"/accounts/{account_id}/load_balancers/pools", - body=await async_maybe_transform( - {"notification_email": notification_email}, pool_bulk_edit_params.PoolBulkEditParams - ), + page=AsyncSinglePage[Pool], + body=maybe_transform({"notification_email": notification_email}, pool_bulk_edit_params.PoolBulkEditParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[PoolBulkEditResponse]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[PoolBulkEditResponse], ResultWrapper[PoolBulkEditResponse]), + model=Pool, + method="patch", ) async def edit( diff --git a/src/cloudflare/resources/load_balancers/pools/references.py b/src/cloudflare/resources/load_balancers/pools/references.py index fa529b572d7..1278c53d179 100644 --- a/src/cloudflare/resources/load_balancers/pools/references.py +++ b/src/cloudflare/resources/load_balancers/pools/references.py @@ -2,8 +2,6 @@ from __future__ import annotations -from typing import Type, cast - import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven @@ -15,8 +13,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...._wrappers import ResultWrapper -from ...._base_client import make_request_options +from ....pagination import SyncSinglePage, AsyncSinglePage +from ...._base_client import AsyncPaginator, make_request_options from ....types.load_balancers.pools.reference_get_response import ReferenceGetResponse __all__ = ["ReferencesResource", "AsyncReferencesResource"] @@ -53,7 +51,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ReferenceGetResponse: + ) -> SyncSinglePage[ReferenceGetResponse]: """ Get the list of resources that reference the provided pool. @@ -72,16 +70,13 @@ def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not pool_id: raise ValueError(f"Expected a non-empty value for `pool_id` but received {pool_id!r}") - return self._get( + return self._get_api_list( f"/accounts/{account_id}/load_balancers/pools/{pool_id}/references", + page=SyncSinglePage[ReferenceGetResponse], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ReferenceGetResponse]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[ReferenceGetResponse], ResultWrapper[ReferenceGetResponse]), + model=ReferenceGetResponse, ) @@ -105,7 +100,7 @@ def with_streaming_response(self) -> AsyncReferencesResourceWithStreamingRespons """ return AsyncReferencesResourceWithStreamingResponse(self) - async def get( + def get( self, pool_id: str, *, @@ -116,7 +111,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ReferenceGetResponse: + ) -> AsyncPaginator[ReferenceGetResponse, AsyncSinglePage[ReferenceGetResponse]]: """ Get the list of resources that reference the provided pool. @@ -135,16 +130,13 @@ async def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not pool_id: raise ValueError(f"Expected a non-empty value for `pool_id` but received {pool_id!r}") - return await self._get( + return self._get_api_list( f"/accounts/{account_id}/load_balancers/pools/{pool_id}/references", + page=AsyncSinglePage[ReferenceGetResponse], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ReferenceGetResponse]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[ReferenceGetResponse], ResultWrapper[ReferenceGetResponse]), + model=ReferenceGetResponse, ) diff --git a/src/cloudflare/resources/logpush/datasets/jobs.py b/src/cloudflare/resources/logpush/datasets/jobs.py index f2b6a8ec25e..3243b74204f 100644 --- a/src/cloudflare/resources/logpush/datasets/jobs.py +++ b/src/cloudflare/resources/logpush/datasets/jobs.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, Optional, cast +from typing import Optional import httpx @@ -15,9 +15,9 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...._wrappers import ResultWrapper -from ...._base_client import make_request_options -from ....types.logpush.datasets.job_get_response import JobGetResponse +from ....pagination import SyncSinglePage, AsyncSinglePage +from ...._base_client import AsyncPaginator, make_request_options +from ....types.logpush.logpush_job import LogpushJob __all__ = ["JobsResource", "AsyncJobsResource"] @@ -54,7 +54,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[JobGetResponse]: + ) -> SyncSinglePage[Optional[LogpushJob]]: """ Lists Logpush jobs for an account or zone for a dataset. @@ -88,16 +88,13 @@ def get( account_or_zone = "zones" account_or_zone_id = zone_id - return self._get( + return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/logpush/datasets/{dataset_id}/jobs", + page=SyncSinglePage[Optional[LogpushJob]], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[JobGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[JobGetResponse]], ResultWrapper[JobGetResponse]), + model=LogpushJob, ) @@ -121,7 +118,7 @@ def with_streaming_response(self) -> AsyncJobsResourceWithStreamingResponse: """ return AsyncJobsResourceWithStreamingResponse(self) - async def get( + def get( self, dataset_id: Optional[str], *, @@ -133,7 +130,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[JobGetResponse]: + ) -> AsyncPaginator[Optional[LogpushJob], AsyncSinglePage[Optional[LogpushJob]]]: """ Lists Logpush jobs for an account or zone for a dataset. @@ -167,16 +164,13 @@ async def get( account_or_zone = "zones" account_or_zone_id = zone_id - return await self._get( + return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/logpush/datasets/{dataset_id}/jobs", + page=AsyncSinglePage[Optional[LogpushJob]], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[JobGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[JobGetResponse]], ResultWrapper[JobGetResponse]), + model=LogpushJob, ) diff --git a/src/cloudflare/resources/logpush/edge.py b/src/cloudflare/resources/logpush/edge.py index 5d460b18334..a3c6900c3b1 100644 --- a/src/cloudflare/resources/logpush/edge.py +++ b/src/cloudflare/resources/logpush/edge.py @@ -20,9 +20,9 @@ async_to_streamed_response_wrapper, ) from ..._wrappers import ResultWrapper -from ..._base_client import make_request_options +from ...pagination import SyncSinglePage, AsyncSinglePage +from ..._base_client import AsyncPaginator, make_request_options from ...types.logpush import edge_create_params -from ...types.logpush.edge_get_response import EdgeGetResponse from ...types.logpush.instant_logpush_job import InstantLogpushJob __all__ = ["EdgeResource", "AsyncEdgeResource"] @@ -116,7 +116,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[EdgeGetResponse]: + ) -> SyncSinglePage[Optional[InstantLogpushJob]]: """ Lists Instant Logs jobs for a zone. @@ -133,16 +133,13 @@ def get( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._get( + return self._get_api_list( f"/zones/{zone_id}/logpush/edge", + page=SyncSinglePage[Optional[InstantLogpushJob]], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[EdgeGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[EdgeGetResponse]], ResultWrapper[EdgeGetResponse]), + model=InstantLogpushJob, ) @@ -224,7 +221,7 @@ async def create( cast_to=cast(Type[Optional[InstantLogpushJob]], ResultWrapper[InstantLogpushJob]), ) - async def get( + def get( self, *, zone_id: str, @@ -234,7 +231,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[EdgeGetResponse]: + ) -> AsyncPaginator[Optional[InstantLogpushJob], AsyncSinglePage[Optional[InstantLogpushJob]]]: """ Lists Instant Logs jobs for a zone. @@ -251,16 +248,13 @@ async def get( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._get( + return self._get_api_list( f"/zones/{zone_id}/logpush/edge", + page=AsyncSinglePage[Optional[InstantLogpushJob]], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[EdgeGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[EdgeGetResponse]], ResultWrapper[EdgeGetResponse]), + model=InstantLogpushJob, ) diff --git a/src/cloudflare/resources/magic_transit/pcaps/ownership.py b/src/cloudflare/resources/magic_transit/pcaps/ownership.py index f9fb3922d02..becc99c2b4d 100644 --- a/src/cloudflare/resources/magic_transit/pcaps/ownership.py +++ b/src/cloudflare/resources/magic_transit/pcaps/ownership.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, Optional, cast +from typing import Type, cast import httpx @@ -20,10 +20,10 @@ async_to_streamed_response_wrapper, ) from ...._wrappers import ResultWrapper -from ...._base_client import make_request_options +from ....pagination import SyncSinglePage, AsyncSinglePage +from ...._base_client import AsyncPaginator, make_request_options from ....types.magic_transit.pcaps import ownership_create_params, ownership_validate_params from ....types.magic_transit.pcaps.ownership import Ownership -from ....types.magic_transit.pcaps.ownership_get_response import OwnershipGetResponse __all__ = ["OwnershipResource", "AsyncOwnershipResource"] @@ -142,7 +142,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[OwnershipGetResponse]: + ) -> SyncSinglePage[Ownership]: """ List all buckets configured for use with PCAPs API. @@ -159,16 +159,13 @@ def get( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get( + return self._get_api_list( f"/accounts/{account_id}/pcaps/ownership", + page=SyncSinglePage[Ownership], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[OwnershipGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[OwnershipGetResponse]], ResultWrapper[OwnershipGetResponse]), + model=Ownership, ) def validate( @@ -330,7 +327,7 @@ async def delete( cast_to=NoneType, ) - async def get( + def get( self, *, account_id: str, @@ -340,7 +337,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[OwnershipGetResponse]: + ) -> AsyncPaginator[Ownership, AsyncSinglePage[Ownership]]: """ List all buckets configured for use with PCAPs API. @@ -357,16 +354,13 @@ async def get( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._get( + return self._get_api_list( f"/accounts/{account_id}/pcaps/ownership", + page=AsyncSinglePage[Ownership], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[OwnershipGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[OwnershipGetResponse]], ResultWrapper[OwnershipGetResponse]), + model=Ownership, ) async def validate( diff --git a/src/cloudflare/resources/magic_transit/sites/lans.py b/src/cloudflare/resources/magic_transit/sites/lans.py index 12424587962..4dff1f98a60 100644 --- a/src/cloudflare/resources/magic_transit/sites/lans.py +++ b/src/cloudflare/resources/magic_transit/sites/lans.py @@ -29,7 +29,6 @@ ) from ....types.magic_transit.sites.lan import LAN from ....types.magic_transit.sites.nat_param import NatParam -from ....types.magic_transit.sites.lan_create_response import LANCreateResponse from ....types.magic_transit.sites.routed_subnet_param import RoutedSubnetParam from ....types.magic_transit.sites.lan_static_addressing_param import LANStaticAddressingParam @@ -74,7 +73,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LANCreateResponse: + ) -> SyncSinglePage[LAN]: """Creates a new Site LAN. If the site is in high availability mode, @@ -106,8 +105,9 @@ def create( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: raise ValueError(f"Expected a non-empty value for `site_id` but received {site_id!r}") - return self._post( + return self._get_api_list( f"/accounts/{account_id}/magic/sites/{site_id}/lans", + page=SyncSinglePage[LAN], body=maybe_transform( { "physport": physport, @@ -121,13 +121,10 @@ def create( lan_create_params.LANCreateParams, ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[LANCreateResponse]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[LANCreateResponse], ResultWrapper[LANCreateResponse]), + model=LAN, + method="post", ) def update( @@ -434,7 +431,7 @@ def with_streaming_response(self) -> AsyncLANsResourceWithStreamingResponse: """ return AsyncLANsResourceWithStreamingResponse(self) - async def create( + def create( self, site_id: str, *, @@ -452,7 +449,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LANCreateResponse: + ) -> AsyncPaginator[LAN, AsyncSinglePage[LAN]]: """Creates a new Site LAN. If the site is in high availability mode, @@ -484,9 +481,10 @@ async def create( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: raise ValueError(f"Expected a non-empty value for `site_id` but received {site_id!r}") - return await self._post( + return self._get_api_list( f"/accounts/{account_id}/magic/sites/{site_id}/lans", - body=await async_maybe_transform( + page=AsyncSinglePage[LAN], + body=maybe_transform( { "physport": physport, "vlan_tag": vlan_tag, @@ -499,13 +497,10 @@ async def create( lan_create_params.LANCreateParams, ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[LANCreateResponse]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[LANCreateResponse], ResultWrapper[LANCreateResponse]), + model=LAN, + method="post", ) async def update( diff --git a/src/cloudflare/resources/magic_transit/sites/wans.py b/src/cloudflare/resources/magic_transit/sites/wans.py index 4598083e7e4..0f0eafd5c22 100644 --- a/src/cloudflare/resources/magic_transit/sites/wans.py +++ b/src/cloudflare/resources/magic_transit/sites/wans.py @@ -24,7 +24,6 @@ from ...._base_client import AsyncPaginator, make_request_options from ....types.magic_transit.sites import wan_edit_params, wan_create_params, wan_update_params from ....types.magic_transit.sites.wan import WAN -from ....types.magic_transit.sites.wan_create_response import WANCreateResponse from ....types.magic_transit.sites.wan_static_addressing_param import WANStaticAddressingParam __all__ = ["WANsResource", "AsyncWANsResource"] @@ -66,7 +65,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> WANCreateResponse: + ) -> SyncSinglePage[WAN]: """ Creates a new Site WAN. @@ -92,8 +91,9 @@ def create( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: raise ValueError(f"Expected a non-empty value for `site_id` but received {site_id!r}") - return self._post( + return self._get_api_list( f"/accounts/{account_id}/magic/sites/{site_id}/wans", + page=SyncSinglePage[WAN], body=maybe_transform( { "physport": physport, @@ -105,13 +105,10 @@ def create( wan_create_params.WANCreateParams, ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[WANCreateResponse]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[WANCreateResponse], ResultWrapper[WANCreateResponse]), + model=WAN, + method="post", ) def update( @@ -412,7 +409,7 @@ def with_streaming_response(self) -> AsyncWANsResourceWithStreamingResponse: """ return AsyncWANsResourceWithStreamingResponse(self) - async def create( + def create( self, site_id: str, *, @@ -428,7 +425,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> WANCreateResponse: + ) -> AsyncPaginator[WAN, AsyncSinglePage[WAN]]: """ Creates a new Site WAN. @@ -454,9 +451,10 @@ async def create( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: raise ValueError(f"Expected a non-empty value for `site_id` but received {site_id!r}") - return await self._post( + return self._get_api_list( f"/accounts/{account_id}/magic/sites/{site_id}/wans", - body=await async_maybe_transform( + page=AsyncSinglePage[WAN], + body=maybe_transform( { "physport": physport, "vlan_tag": vlan_tag, @@ -467,13 +465,10 @@ async def create( wan_create_params.WANCreateParams, ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[WANCreateResponse]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[WANCreateResponse], ResultWrapper[WANCreateResponse]), + model=WAN, + method="post", ) async def update( diff --git a/src/cloudflare/resources/mtls_certificates/associations.py b/src/cloudflare/resources/mtls_certificates/associations.py index 23f2b9ac2e8..6f2b2f3dcf6 100644 --- a/src/cloudflare/resources/mtls_certificates/associations.py +++ b/src/cloudflare/resources/mtls_certificates/associations.py @@ -2,8 +2,6 @@ from __future__ import annotations -from typing import Type, Optional, cast - import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven @@ -15,9 +13,9 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._wrappers import ResultWrapper -from ..._base_client import make_request_options -from ...types.mtls_certificates.association_get_response import AssociationGetResponse +from ...pagination import SyncSinglePage, AsyncSinglePage +from ..._base_client import AsyncPaginator, make_request_options +from ...types.mtls_certificates.certificate_asssociation import CertificateAsssociation __all__ = ["AssociationsResource", "AsyncAssociationsResource"] @@ -53,7 +51,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AssociationGetResponse]: + ) -> SyncSinglePage[CertificateAsssociation]: """ Lists all active associations between the certificate and Cloudflare services. @@ -76,16 +74,13 @@ def get( raise ValueError( f"Expected a non-empty value for `mtls_certificate_id` but received {mtls_certificate_id!r}" ) - return self._get( + return self._get_api_list( f"/accounts/{account_id}/mtls_certificates/{mtls_certificate_id}/associations", + page=SyncSinglePage[CertificateAsssociation], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[AssociationGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[AssociationGetResponse]], ResultWrapper[AssociationGetResponse]), + model=CertificateAsssociation, ) @@ -109,7 +104,7 @@ def with_streaming_response(self) -> AsyncAssociationsResourceWithStreamingRespo """ return AsyncAssociationsResourceWithStreamingResponse(self) - async def get( + def get( self, mtls_certificate_id: str, *, @@ -120,7 +115,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AssociationGetResponse]: + ) -> AsyncPaginator[CertificateAsssociation, AsyncSinglePage[CertificateAsssociation]]: """ Lists all active associations between the certificate and Cloudflare services. @@ -143,16 +138,13 @@ async def get( raise ValueError( f"Expected a non-empty value for `mtls_certificate_id` but received {mtls_certificate_id!r}" ) - return await self._get( + return self._get_api_list( f"/accounts/{account_id}/mtls_certificates/{mtls_certificate_id}/associations", + page=AsyncSinglePage[CertificateAsssociation], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[AssociationGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[AssociationGetResponse]], ResultWrapper[AssociationGetResponse]), + model=CertificateAsssociation, ) diff --git a/src/cloudflare/resources/origin_tls_client_auth/hostnames/hostnames.py b/src/cloudflare/resources/origin_tls_client_auth/hostnames/hostnames.py index 74516f2281e..79e2c8d024c 100644 --- a/src/cloudflare/resources/origin_tls_client_auth/hostnames/hostnames.py +++ b/src/cloudflare/resources/origin_tls_client_auth/hostnames/hostnames.py @@ -7,10 +7,7 @@ import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import ( - maybe_transform, - async_maybe_transform, -) +from ...._utils import maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -28,7 +25,8 @@ CertificatesResourceWithStreamingResponse, AsyncCertificatesResourceWithStreamingResponse, ) -from ...._base_client import make_request_options +from ....pagination import SyncSinglePage, AsyncSinglePage +from ...._base_client import AsyncPaginator, make_request_options from ....types.origin_tls_client_auth import hostname_update_params from ....types.origin_tls_client_auth.hostname_update_response import HostnameUpdateResponse from ....types.origin_tls_client_auth.authenticated_origin_pull import AuthenticatedOriginPull @@ -71,7 +69,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[HostnameUpdateResponse]: + ) -> SyncSinglePage[HostnameUpdateResponse]: """ Associate a hostname to a certificate and enable, disable or invalidate the association. If disabled, client certificate will not be sent to the hostname @@ -92,17 +90,15 @@ def update( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._put( + return self._get_api_list( f"/zones/{zone_id}/origin_tls_client_auth/hostnames", + page=SyncSinglePage[HostnameUpdateResponse], body=maybe_transform({"config": config}, hostname_update_params.HostnameUpdateParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[HostnameUpdateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[HostnameUpdateResponse]], ResultWrapper[HostnameUpdateResponse]), + model=HostnameUpdateResponse, + method="put", ) def get( @@ -175,7 +171,7 @@ def with_streaming_response(self) -> AsyncHostnamesResourceWithStreamingResponse """ return AsyncHostnamesResourceWithStreamingResponse(self) - async def update( + def update( self, *, zone_id: str, @@ -186,7 +182,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[HostnameUpdateResponse]: + ) -> AsyncPaginator[HostnameUpdateResponse, AsyncSinglePage[HostnameUpdateResponse]]: """ Associate a hostname to a certificate and enable, disable or invalidate the association. If disabled, client certificate will not be sent to the hostname @@ -207,17 +203,15 @@ async def update( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._put( + return self._get_api_list( f"/zones/{zone_id}/origin_tls_client_auth/hostnames", - body=await async_maybe_transform({"config": config}, hostname_update_params.HostnameUpdateParams), + page=AsyncSinglePage[HostnameUpdateResponse], + body=maybe_transform({"config": config}, hostname_update_params.HostnameUpdateParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[HostnameUpdateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[HostnameUpdateResponse]], ResultWrapper[HostnameUpdateResponse]), + model=HostnameUpdateResponse, + method="put", ) async def get( diff --git a/src/cloudflare/resources/queues/consumers.py b/src/cloudflare/resources/queues/consumers.py index 0c44ae6b0f5..514d6546399 100644 --- a/src/cloudflare/resources/queues/consumers.py +++ b/src/cloudflare/resources/queues/consumers.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, Type, Optional, cast +from typing import Any, Optional, cast from typing_extensions import Literal, overload import httpx @@ -22,10 +22,10 @@ async_to_streamed_response_wrapper, ) from ..._wrappers import ResultWrapper -from ..._base_client import make_request_options +from ...pagination import SyncSinglePage, AsyncSinglePage +from ..._base_client import AsyncPaginator, make_request_options from ...types.queues import consumer_create_params, consumer_update_params from ...types.queues.consumer import Consumer -from ...types.queues.consumer_get_response import ConsumerGetResponse from ...types.queues.consumer_delete_response import ConsumerDeleteResponse __all__ = ["ConsumersResource", "AsyncConsumersResource"] @@ -356,7 +356,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ConsumerGetResponse]: + ) -> SyncSinglePage[Consumer]: """ Returns the consumers for a Queue @@ -377,16 +377,13 @@ def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: raise ValueError(f"Expected a non-empty value for `queue_id` but received {queue_id!r}") - return self._get( + return self._get_api_list( f"/accounts/{account_id}/queues/{queue_id}/consumers", + page=SyncSinglePage[Consumer], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[ConsumerGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[ConsumerGetResponse]], ResultWrapper[ConsumerGetResponse]), + model=cast(Any, Consumer), # Union types cannot be passed in as arguments in the type system ) @@ -704,7 +701,7 @@ async def delete( cast_to=ConsumerDeleteResponse, ) - async def get( + def get( self, queue_id: str, *, @@ -715,7 +712,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ConsumerGetResponse]: + ) -> AsyncPaginator[Consumer, AsyncSinglePage[Consumer]]: """ Returns the consumers for a Queue @@ -736,16 +733,13 @@ async def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: raise ValueError(f"Expected a non-empty value for `queue_id` but received {queue_id!r}") - return await self._get( + return self._get_api_list( f"/accounts/{account_id}/queues/{queue_id}/consumers", + page=AsyncSinglePage[Consumer], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[ConsumerGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[ConsumerGetResponse]], ResultWrapper[ConsumerGetResponse]), + model=cast(Any, Consumer), # Union types cannot be passed in as arguments in the type system ) diff --git a/src/cloudflare/resources/queues/messages.py b/src/cloudflare/resources/queues/messages.py index 47a3f63f5b0..868cfe64092 100644 --- a/src/cloudflare/resources/queues/messages.py +++ b/src/cloudflare/resources/queues/messages.py @@ -20,7 +20,8 @@ async_to_streamed_response_wrapper, ) from ..._wrappers import ResultWrapper -from ..._base_client import make_request_options +from ...pagination import SyncSinglePage, AsyncSinglePage +from ..._base_client import AsyncPaginator, make_request_options from ...types.queues import message_ack_params, message_pull_params from ...types.queues.message_ack_response import MessageAckResponse from ...types.queues.message_pull_response import MessagePullResponse @@ -114,7 +115,7 @@ def pull( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[MessagePullResponse]: + ) -> SyncSinglePage[MessagePullResponse]: """ Pull a batch of messages from a Queue @@ -140,8 +141,9 @@ def pull( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: raise ValueError(f"Expected a non-empty value for `queue_id` but received {queue_id!r}") - return self._post( + return self._get_api_list( f"/accounts/{account_id}/queues/{queue_id}/messages/pull", + page=SyncSinglePage[MessagePullResponse], body=maybe_transform( { "batch_size": batch_size, @@ -150,13 +152,10 @@ def pull( message_pull_params.MessagePullParams, ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[MessagePullResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[MessagePullResponse]], ResultWrapper[MessagePullResponse]), + model=MessagePullResponse, + method="post", ) @@ -233,7 +232,7 @@ async def ack( cast_to=cast(Type[Optional[MessageAckResponse]], ResultWrapper[MessageAckResponse]), ) - async def pull( + def pull( self, queue_id: str, *, @@ -246,7 +245,7 @@ async def pull( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[MessagePullResponse]: + ) -> AsyncPaginator[MessagePullResponse, AsyncSinglePage[MessagePullResponse]]: """ Pull a batch of messages from a Queue @@ -272,9 +271,10 @@ async def pull( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: raise ValueError(f"Expected a non-empty value for `queue_id` but received {queue_id!r}") - return await self._post( + return self._get_api_list( f"/accounts/{account_id}/queues/{queue_id}/messages/pull", - body=await async_maybe_transform( + page=AsyncSinglePage[MessagePullResponse], + body=maybe_transform( { "batch_size": batch_size, "visibility_timeout_ms": visibility_timeout_ms, @@ -282,13 +282,10 @@ async def pull( message_pull_params.MessagePullParams, ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[MessagePullResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[MessagePullResponse]], ResultWrapper[MessagePullResponse]), + model=MessagePullResponse, + method="post", ) diff --git a/src/cloudflare/resources/snippets/rules.py b/src/cloudflare/resources/snippets/rules.py index dad75c555a6..51785fd67ab 100644 --- a/src/cloudflare/resources/snippets/rules.py +++ b/src/cloudflare/resources/snippets/rules.py @@ -2,15 +2,12 @@ from __future__ import annotations -from typing import Type, Iterable, Optional, cast +from typing import Iterable import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -19,7 +16,6 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._wrappers import ResultWrapper from ...pagination import SyncSinglePage, AsyncSinglePage from ..._base_client import AsyncPaginator, make_request_options from ...types.snippets import rule_update_params @@ -61,7 +57,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleUpdateResponse]: + ) -> SyncSinglePage[RuleUpdateResponse]: """ Put Rules @@ -80,17 +76,15 @@ def update( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._put( + return self._get_api_list( f"/zones/{zone_id}/snippets/snippet_rules", + page=SyncSinglePage[RuleUpdateResponse], body=maybe_transform({"rules": rules}, rule_update_params.RuleUpdateParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleUpdateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[RuleUpdateResponse]], ResultWrapper[RuleUpdateResponse]), + model=RuleUpdateResponse, + method="put", ) def list( @@ -185,7 +179,7 @@ def with_streaming_response(self) -> AsyncRulesResourceWithStreamingResponse: """ return AsyncRulesResourceWithStreamingResponse(self) - async def update( + def update( self, *, zone_id: str, @@ -196,7 +190,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleUpdateResponse]: + ) -> AsyncPaginator[RuleUpdateResponse, AsyncSinglePage[RuleUpdateResponse]]: """ Put Rules @@ -215,17 +209,15 @@ async def update( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._put( + return self._get_api_list( f"/zones/{zone_id}/snippets/snippet_rules", - body=await async_maybe_transform({"rules": rules}, rule_update_params.RuleUpdateParams), + page=AsyncSinglePage[RuleUpdateResponse], + body=maybe_transform({"rules": rules}, rule_update_params.RuleUpdateParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleUpdateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[RuleUpdateResponse]], ResultWrapper[RuleUpdateResponse]), + model=RuleUpdateResponse, + method="put", ) def list( diff --git a/src/cloudflare/resources/stream/audio_tracks.py b/src/cloudflare/resources/stream/audio_tracks.py index 377b45aeda9..9dd7fa8a2f0 100644 --- a/src/cloudflare/resources/stream/audio_tracks.py +++ b/src/cloudflare/resources/stream/audio_tracks.py @@ -20,10 +20,10 @@ async_to_streamed_response_wrapper, ) from ..._wrappers import ResultWrapper -from ..._base_client import make_request_options +from ...pagination import SyncSinglePage, AsyncSinglePage +from ..._base_client import AsyncPaginator, make_request_options from ...types.stream import audio_track_copy_params, audio_track_edit_params from ...types.stream.audio import Audio -from ...types.stream.audio_track_get_response import AudioTrackGetResponse from ...types.stream.audio_track_delete_response import AudioTrackDeleteResponse __all__ = ["AudioTracksResource", "AsyncAudioTracksResource"] @@ -237,7 +237,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AudioTrackGetResponse]: + ) -> SyncSinglePage[Audio]: """Lists additional audio tracks on a video. Note this API will not return @@ -260,16 +260,13 @@ def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") - return self._get( + return self._get_api_list( f"/accounts/{account_id}/stream/{identifier}/audio", + page=SyncSinglePage[Audio], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[AudioTrackGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[AudioTrackGetResponse]], ResultWrapper[AudioTrackGetResponse]), + model=Audio, ) @@ -470,7 +467,7 @@ async def edit( cast_to=cast(Type[Optional[Audio]], ResultWrapper[Audio]), ) - async def get( + def get( self, identifier: str, *, @@ -481,7 +478,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AudioTrackGetResponse]: + ) -> AsyncPaginator[Audio, AsyncSinglePage[Audio]]: """Lists additional audio tracks on a video. Note this API will not return @@ -504,16 +501,13 @@ async def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") - return await self._get( + return self._get_api_list( f"/accounts/{account_id}/stream/{identifier}/audio", + page=AsyncSinglePage[Audio], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[AudioTrackGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[AudioTrackGetResponse]], ResultWrapper[AudioTrackGetResponse]), + model=Audio, ) diff --git a/src/cloudflare/resources/stream/captions/captions.py b/src/cloudflare/resources/stream/captions/captions.py index 068457a8526..93c0b2949d9 100644 --- a/src/cloudflare/resources/stream/captions/captions.py +++ b/src/cloudflare/resources/stream/captions/captions.py @@ -2,8 +2,6 @@ from __future__ import annotations -from typing import Type, Optional, cast - import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven @@ -15,8 +13,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...._wrappers import ResultWrapper -from ...._base_client import make_request_options +from ....pagination import SyncSinglePage, AsyncSinglePage +from ...._base_client import AsyncPaginator, make_request_options from .language.language import ( LanguageResource, AsyncLanguageResource, @@ -25,7 +23,7 @@ LanguageResourceWithStreamingResponse, AsyncLanguageResourceWithStreamingResponse, ) -from ....types.stream.caption_get_response import CaptionGetResponse +from ....types.stream.caption import Caption __all__ = ["CaptionsResource", "AsyncCaptionsResource"] @@ -65,7 +63,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CaptionGetResponse]: + ) -> SyncSinglePage[Caption]: """ Lists the available captions or subtitles for a specific video. @@ -86,16 +84,13 @@ def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") - return self._get( + return self._get_api_list( f"/accounts/{account_id}/stream/{identifier}/captions", + page=SyncSinglePage[Caption], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[CaptionGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[CaptionGetResponse]], ResultWrapper[CaptionGetResponse]), + model=Caption, ) @@ -123,7 +118,7 @@ def with_streaming_response(self) -> AsyncCaptionsResourceWithStreamingResponse: """ return AsyncCaptionsResourceWithStreamingResponse(self) - async def get( + def get( self, identifier: str, *, @@ -134,7 +129,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CaptionGetResponse]: + ) -> AsyncPaginator[Caption, AsyncSinglePage[Caption]]: """ Lists the available captions or subtitles for a specific video. @@ -155,16 +150,13 @@ async def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") - return await self._get( + return self._get_api_list( f"/accounts/{account_id}/stream/{identifier}/captions", + page=AsyncSinglePage[Caption], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[CaptionGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[CaptionGetResponse]], ResultWrapper[CaptionGetResponse]), + model=Caption, ) diff --git a/src/cloudflare/resources/stream/keys.py b/src/cloudflare/resources/stream/keys.py index 061ce9f008d..6bdbbedb273 100644 --- a/src/cloudflare/resources/stream/keys.py +++ b/src/cloudflare/resources/stream/keys.py @@ -20,7 +20,8 @@ async_to_streamed_response_wrapper, ) from ..._wrappers import ResultWrapper -from ..._base_client import make_request_options +from ...pagination import SyncSinglePage, AsyncSinglePage +from ..._base_client import AsyncPaginator, make_request_options from ...types.stream import key_create_params from ...types.stream.keys import Keys from ...types.stream.key_get_response import KeyGetResponse @@ -147,7 +148,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[KeyGetResponse]: + ) -> SyncSinglePage[KeyGetResponse]: """ Lists the video ID and creation date and time when a signing key was created. @@ -164,16 +165,13 @@ def get( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get( + return self._get_api_list( f"/accounts/{account_id}/stream/keys", + page=SyncSinglePage[KeyGetResponse], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[KeyGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[KeyGetResponse]], ResultWrapper[KeyGetResponse]), + model=KeyGetResponse, ) @@ -285,7 +283,7 @@ async def delete( cast_to=cast(Type[str], ResultWrapper[str]), ) - async def get( + def get( self, *, account_id: str, @@ -295,7 +293,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[KeyGetResponse]: + ) -> AsyncPaginator[KeyGetResponse, AsyncSinglePage[KeyGetResponse]]: """ Lists the video ID and creation date and time when a signing key was created. @@ -312,16 +310,13 @@ async def get( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._get( + return self._get_api_list( f"/accounts/{account_id}/stream/keys", + page=AsyncSinglePage[KeyGetResponse], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[KeyGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[KeyGetResponse]], ResultWrapper[KeyGetResponse]), + model=KeyGetResponse, ) diff --git a/src/cloudflare/resources/user/subscriptions.py b/src/cloudflare/resources/user/subscriptions.py index 0d21f3985f5..592b92f3b74 100644 --- a/src/cloudflare/resources/user/subscriptions.py +++ b/src/cloudflare/resources/user/subscriptions.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, Type, Optional, cast +from typing import Any, cast from typing_extensions import Literal import httpx @@ -21,10 +21,11 @@ async_to_streamed_response_wrapper, ) from ..._wrappers import ResultWrapper +from ...pagination import SyncSinglePage, AsyncSinglePage from ...types.user import subscription_update_params -from ..._base_client import make_request_options +from ..._base_client import AsyncPaginator, make_request_options +from ...types.shared.subscription import Subscription from ...types.shared_params.rate_plan import RatePlan -from ...types.user.subscription_get_response import SubscriptionGetResponse from ...types.user.subscription_delete_response import SubscriptionDeleteResponse from ...types.user.subscription_update_response import SubscriptionUpdateResponse @@ -152,18 +153,15 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[SubscriptionGetResponse]: + ) -> SyncSinglePage[Subscription]: """Lists all of a user's subscriptions.""" - return self._get( + return self._get_api_list( "/user/subscriptions", + page=SyncSinglePage[Subscription], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[SubscriptionGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[SubscriptionGetResponse]], ResultWrapper[SubscriptionGetResponse]), + model=Subscription, ) @@ -279,7 +277,7 @@ async def delete( cast_to=SubscriptionDeleteResponse, ) - async def get( + def get( self, *, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -288,18 +286,15 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[SubscriptionGetResponse]: + ) -> AsyncPaginator[Subscription, AsyncSinglePage[Subscription]]: """Lists all of a user's subscriptions.""" - return await self._get( + return self._get_api_list( "/user/subscriptions", + page=AsyncSinglePage[Subscription], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[SubscriptionGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[SubscriptionGetResponse]], ResultWrapper[SubscriptionGetResponse]), + model=Subscription, ) diff --git a/src/cloudflare/resources/waiting_rooms/rules.py b/src/cloudflare/resources/waiting_rooms/rules.py index d3f669c2685..6d87708c662 100644 --- a/src/cloudflare/resources/waiting_rooms/rules.py +++ b/src/cloudflare/resources/waiting_rooms/rules.py @@ -2,16 +2,13 @@ from __future__ import annotations -from typing import Type, Iterable, Optional, cast +from typing import Iterable from typing_extensions import Literal import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -20,14 +17,10 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._wrappers import ResultWrapper -from ..._base_client import make_request_options +from ...pagination import SyncSinglePage, AsyncSinglePage +from ..._base_client import AsyncPaginator, make_request_options from ...types.waiting_rooms import rule_edit_params, rule_create_params, rule_update_params -from ...types.waiting_rooms.rule_get_response import RuleGetResponse -from ...types.waiting_rooms.rule_edit_response import RuleEditResponse -from ...types.waiting_rooms.rule_create_response import RuleCreateResponse -from ...types.waiting_rooms.rule_delete_response import RuleDeleteResponse -from ...types.waiting_rooms.rule_update_response import RuleUpdateResponse +from ...types.waiting_rooms.waiting_room_rule import WaitingRoomRule __all__ = ["RulesResource", "AsyncRulesResource"] @@ -64,7 +57,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleCreateResponse]: + ) -> SyncSinglePage[WaitingRoomRule]: """Only available for the Waiting Room Advanced subscription. Creates a rule for a @@ -85,17 +78,15 @@ def create( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: raise ValueError(f"Expected a non-empty value for `waiting_room_id` but received {waiting_room_id!r}") - return self._post( + return self._get_api_list( f"/zones/{zone_id}/waiting_rooms/{waiting_room_id}/rules", + page=SyncSinglePage[WaitingRoomRule], body=maybe_transform(rules, rule_create_params.RuleCreateParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleCreateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[RuleCreateResponse]], ResultWrapper[RuleCreateResponse]), + model=WaitingRoomRule, + method="post", ) def update( @@ -110,7 +101,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleUpdateResponse]: + ) -> SyncSinglePage[WaitingRoomRule]: """Only available for the Waiting Room Advanced subscription. Replaces all rules @@ -131,17 +122,15 @@ def update( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: raise ValueError(f"Expected a non-empty value for `waiting_room_id` but received {waiting_room_id!r}") - return self._put( + return self._get_api_list( f"/zones/{zone_id}/waiting_rooms/{waiting_room_id}/rules", + page=SyncSinglePage[WaitingRoomRule], body=maybe_transform(rules, Iterable[rule_update_params.Rule]), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleUpdateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[RuleUpdateResponse]], ResultWrapper[RuleUpdateResponse]), + model=WaitingRoomRule, + method="put", ) def delete( @@ -156,7 +145,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleDeleteResponse]: + ) -> SyncSinglePage[WaitingRoomRule]: """ Deletes a rule for a waiting room. @@ -179,16 +168,14 @@ def delete( raise ValueError(f"Expected a non-empty value for `waiting_room_id` but received {waiting_room_id!r}") if not rule_id: raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") - return self._delete( + return self._get_api_list( f"/zones/{zone_id}/waiting_rooms/{waiting_room_id}/rules/{rule_id}", + page=SyncSinglePage[WaitingRoomRule], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleDeleteResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[RuleDeleteResponse]], ResultWrapper[RuleDeleteResponse]), + model=WaitingRoomRule, + method="delete", ) def edit( @@ -208,7 +195,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleEditResponse]: + ) -> SyncSinglePage[WaitingRoomRule]: """ Patches a rule for a waiting room. @@ -241,8 +228,9 @@ def edit( raise ValueError(f"Expected a non-empty value for `waiting_room_id` but received {waiting_room_id!r}") if not rule_id: raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") - return self._patch( + return self._get_api_list( f"/zones/{zone_id}/waiting_rooms/{waiting_room_id}/rules/{rule_id}", + page=SyncSinglePage[WaitingRoomRule], body=maybe_transform( { "action": action, @@ -254,13 +242,10 @@ def edit( rule_edit_params.RuleEditParams, ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleEditResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[RuleEditResponse]], ResultWrapper[RuleEditResponse]), + model=WaitingRoomRule, + method="patch", ) def get( @@ -274,7 +259,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleGetResponse]: + ) -> SyncSinglePage[WaitingRoomRule]: """ Lists rules for a waiting room. @@ -293,16 +278,13 @@ def get( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: raise ValueError(f"Expected a non-empty value for `waiting_room_id` but received {waiting_room_id!r}") - return self._get( + return self._get_api_list( f"/zones/{zone_id}/waiting_rooms/{waiting_room_id}/rules", + page=SyncSinglePage[WaitingRoomRule], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[RuleGetResponse]], ResultWrapper[RuleGetResponse]), + model=WaitingRoomRule, ) @@ -326,7 +308,7 @@ def with_streaming_response(self) -> AsyncRulesResourceWithStreamingResponse: """ return AsyncRulesResourceWithStreamingResponse(self) - async def create( + def create( self, waiting_room_id: str, *, @@ -338,7 +320,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleCreateResponse]: + ) -> AsyncPaginator[WaitingRoomRule, AsyncSinglePage[WaitingRoomRule]]: """Only available for the Waiting Room Advanced subscription. Creates a rule for a @@ -359,20 +341,18 @@ async def create( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: raise ValueError(f"Expected a non-empty value for `waiting_room_id` but received {waiting_room_id!r}") - return await self._post( + return self._get_api_list( f"/zones/{zone_id}/waiting_rooms/{waiting_room_id}/rules", - body=await async_maybe_transform(rules, rule_create_params.RuleCreateParams), + page=AsyncSinglePage[WaitingRoomRule], + body=maybe_transform(rules, rule_create_params.RuleCreateParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleCreateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[RuleCreateResponse]], ResultWrapper[RuleCreateResponse]), + model=WaitingRoomRule, + method="post", ) - async def update( + def update( self, waiting_room_id: str, *, @@ -384,7 +364,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleUpdateResponse]: + ) -> AsyncPaginator[WaitingRoomRule, AsyncSinglePage[WaitingRoomRule]]: """Only available for the Waiting Room Advanced subscription. Replaces all rules @@ -405,20 +385,18 @@ async def update( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: raise ValueError(f"Expected a non-empty value for `waiting_room_id` but received {waiting_room_id!r}") - return await self._put( + return self._get_api_list( f"/zones/{zone_id}/waiting_rooms/{waiting_room_id}/rules", - body=await async_maybe_transform(rules, Iterable[rule_update_params.Rule]), + page=AsyncSinglePage[WaitingRoomRule], + body=maybe_transform(rules, Iterable[rule_update_params.Rule]), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleUpdateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[RuleUpdateResponse]], ResultWrapper[RuleUpdateResponse]), + model=WaitingRoomRule, + method="put", ) - async def delete( + def delete( self, rule_id: str, *, @@ -430,7 +408,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleDeleteResponse]: + ) -> AsyncPaginator[WaitingRoomRule, AsyncSinglePage[WaitingRoomRule]]: """ Deletes a rule for a waiting room. @@ -453,19 +431,17 @@ async def delete( raise ValueError(f"Expected a non-empty value for `waiting_room_id` but received {waiting_room_id!r}") if not rule_id: raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") - return await self._delete( + return self._get_api_list( f"/zones/{zone_id}/waiting_rooms/{waiting_room_id}/rules/{rule_id}", + page=AsyncSinglePage[WaitingRoomRule], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleDeleteResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[RuleDeleteResponse]], ResultWrapper[RuleDeleteResponse]), + model=WaitingRoomRule, + method="delete", ) - async def edit( + def edit( self, rule_id: str, *, @@ -482,7 +458,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleEditResponse]: + ) -> AsyncPaginator[WaitingRoomRule, AsyncSinglePage[WaitingRoomRule]]: """ Patches a rule for a waiting room. @@ -515,9 +491,10 @@ async def edit( raise ValueError(f"Expected a non-empty value for `waiting_room_id` but received {waiting_room_id!r}") if not rule_id: raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") - return await self._patch( + return self._get_api_list( f"/zones/{zone_id}/waiting_rooms/{waiting_room_id}/rules/{rule_id}", - body=await async_maybe_transform( + page=AsyncSinglePage[WaitingRoomRule], + body=maybe_transform( { "action": action, "expression": expression, @@ -528,16 +505,13 @@ async def edit( rule_edit_params.RuleEditParams, ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleEditResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[RuleEditResponse]], ResultWrapper[RuleEditResponse]), + model=WaitingRoomRule, + method="patch", ) - async def get( + def get( self, waiting_room_id: str, *, @@ -548,7 +522,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleGetResponse]: + ) -> AsyncPaginator[WaitingRoomRule, AsyncSinglePage[WaitingRoomRule]]: """ Lists rules for a waiting room. @@ -567,16 +541,13 @@ async def get( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: raise ValueError(f"Expected a non-empty value for `waiting_room_id` but received {waiting_room_id!r}") - return await self._get( + return self._get_api_list( f"/zones/{zone_id}/waiting_rooms/{waiting_room_id}/rules", + page=AsyncSinglePage[WaitingRoomRule], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RuleGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[RuleGetResponse]], ResultWrapper[RuleGetResponse]), + model=WaitingRoomRule, ) diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/bindings.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/bindings.py index 6532f30ee21..51d824649ed 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/bindings.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/bindings.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, Optional, cast +from typing import Any, cast import httpx @@ -15,8 +15,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ......_wrappers import ResultWrapper -from ......_base_client import make_request_options +from ......pagination import SyncSinglePage, AsyncSinglePage +from ......_base_client import AsyncPaginator, make_request_options from ......types.workers_for_platforms.dispatch.namespaces.scripts.binding_get_response import BindingGetResponse __all__ = ["BindingsResource", "AsyncBindingsResource"] @@ -54,7 +54,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[BindingGetResponse]: + ) -> SyncSinglePage[BindingGetResponse]: """ Fetch script bindings from a script uploaded to a Workers for Platforms namespace. @@ -80,16 +80,13 @@ def get( raise ValueError(f"Expected a non-empty value for `dispatch_namespace` but received {dispatch_namespace!r}") if not script_name: raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") - return self._get( + return self._get_api_list( f"/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/bindings", + page=SyncSinglePage[BindingGetResponse], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[BindingGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[BindingGetResponse]], ResultWrapper[BindingGetResponse]), + model=cast(Any, BindingGetResponse), # Union types cannot be passed in as arguments in the type system ) @@ -113,7 +110,7 @@ def with_streaming_response(self) -> AsyncBindingsResourceWithStreamingResponse: """ return AsyncBindingsResourceWithStreamingResponse(self) - async def get( + def get( self, script_name: str, *, @@ -125,7 +122,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[BindingGetResponse]: + ) -> AsyncPaginator[BindingGetResponse, AsyncSinglePage[BindingGetResponse]]: """ Fetch script bindings from a script uploaded to a Workers for Platforms namespace. @@ -151,16 +148,13 @@ async def get( raise ValueError(f"Expected a non-empty value for `dispatch_namespace` but received {dispatch_namespace!r}") if not script_name: raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") - return await self._get( + return self._get_api_list( f"/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/bindings", + page=AsyncSinglePage[BindingGetResponse], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[BindingGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[BindingGetResponse]], ResultWrapper[BindingGetResponse]), + model=cast(Any, BindingGetResponse), # Union types cannot be passed in as arguments in the type system ) diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/tags.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/tags.py index 42ae35e97a5..e810cfc722d 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/tags.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/tags.py @@ -7,10 +7,7 @@ import httpx from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ......_utils import ( - maybe_transform, - async_maybe_transform, -) +from ......_utils import maybe_transform from ......_compat import cached_property from ......_resource import SyncAPIResource, AsyncAPIResource from ......_response import ( @@ -61,7 +58,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[TagUpdateResponse]: + ) -> SyncSinglePage[TagUpdateResponse]: """ Put script tags for a script uploaded to a Workers for Platforms namespace. @@ -88,17 +85,15 @@ def update( raise ValueError(f"Expected a non-empty value for `dispatch_namespace` but received {dispatch_namespace!r}") if not script_name: raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") - return self._put( + return self._get_api_list( f"/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/tags", + page=SyncSinglePage[TagUpdateResponse], body=maybe_transform(body, List[str]), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[TagUpdateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[TagUpdateResponse]], ResultWrapper[TagUpdateResponse]), + model=str, + method="put", ) def list( @@ -222,7 +217,7 @@ def with_streaming_response(self) -> AsyncTagsResourceWithStreamingResponse: """ return AsyncTagsResourceWithStreamingResponse(self) - async def update( + def update( self, script_name: str, *, @@ -235,7 +230,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[TagUpdateResponse]: + ) -> AsyncPaginator[TagUpdateResponse, AsyncSinglePage[TagUpdateResponse]]: """ Put script tags for a script uploaded to a Workers for Platforms namespace. @@ -262,17 +257,15 @@ async def update( raise ValueError(f"Expected a non-empty value for `dispatch_namespace` but received {dispatch_namespace!r}") if not script_name: raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") - return await self._put( + return self._get_api_list( f"/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/tags", - body=await async_maybe_transform(body, List[str]), + page=AsyncSinglePage[TagUpdateResponse], + body=maybe_transform(body, List[str]), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[TagUpdateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[TagUpdateResponse]], ResultWrapper[TagUpdateResponse]), + model=str, + method="put", ) def list( diff --git a/src/cloudflare/resources/zero_trust/access/certificates/settings.py b/src/cloudflare/resources/zero_trust/access/certificates/settings.py index 86e37e2bc8e..fb0852d1e59 100644 --- a/src/cloudflare/resources/zero_trust/access/certificates/settings.py +++ b/src/cloudflare/resources/zero_trust/access/certificates/settings.py @@ -2,15 +2,12 @@ from __future__ import annotations -from typing import Type, Iterable, Optional, cast +from typing import Iterable import httpx from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ....._utils import ( - maybe_transform, - async_maybe_transform, -) +from ....._utils import maybe_transform from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource from ....._response import ( @@ -19,11 +16,10 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ....._wrappers import ResultWrapper -from ....._base_client import make_request_options +from .....pagination import SyncSinglePage, AsyncSinglePage +from ....._base_client import AsyncPaginator, make_request_options from .....types.zero_trust.access.certificates import setting_update_params -from .....types.zero_trust.access.certificates.setting_get_response import SettingGetResponse -from .....types.zero_trust.access.certificates.setting_update_response import SettingUpdateResponse +from .....types.zero_trust.access.certificates.certificate_settings import CertificateSettings from .....types.zero_trust.access.certificates.certificate_settings_param import CertificateSettingsParam __all__ = ["SettingsResource", "AsyncSettingsResource"] @@ -61,7 +57,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[SettingUpdateResponse]: + ) -> SyncSinglePage[CertificateSettings]: """ Updates an mTLS certificate's hostname settings. @@ -90,17 +86,15 @@ def update( account_or_zone = "zones" account_or_zone_id = zone_id - return self._put( + return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/access/certificates/settings", + page=SyncSinglePage[CertificateSettings], body=maybe_transform({"settings": settings}, setting_update_params.SettingUpdateParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[SettingUpdateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[SettingUpdateResponse]], ResultWrapper[SettingUpdateResponse]), + model=CertificateSettings, + method="put", ) def get( @@ -114,7 +108,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[SettingGetResponse]: + ) -> SyncSinglePage[CertificateSettings]: """ List all mTLS hostname settings for this account or zone. @@ -143,16 +137,13 @@ def get( account_or_zone = "zones" account_or_zone_id = zone_id - return self._get( + return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/access/certificates/settings", + page=SyncSinglePage[CertificateSettings], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[SettingGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[SettingGetResponse]], ResultWrapper[SettingGetResponse]), + model=CertificateSettings, ) @@ -176,7 +167,7 @@ def with_streaming_response(self) -> AsyncSettingsResourceWithStreamingResponse: """ return AsyncSettingsResourceWithStreamingResponse(self) - async def update( + def update( self, *, settings: Iterable[CertificateSettingsParam], @@ -188,7 +179,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[SettingUpdateResponse]: + ) -> AsyncPaginator[CertificateSettings, AsyncSinglePage[CertificateSettings]]: """ Updates an mTLS certificate's hostname settings. @@ -217,20 +208,18 @@ async def update( account_or_zone = "zones" account_or_zone_id = zone_id - return await self._put( + return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/access/certificates/settings", - body=await async_maybe_transform({"settings": settings}, setting_update_params.SettingUpdateParams), + page=AsyncSinglePage[CertificateSettings], + body=maybe_transform({"settings": settings}, setting_update_params.SettingUpdateParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[SettingUpdateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[SettingUpdateResponse]], ResultWrapper[SettingUpdateResponse]), + model=CertificateSettings, + method="put", ) - async def get( + def get( self, *, account_id: str | NotGiven = NOT_GIVEN, @@ -241,7 +230,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[SettingGetResponse]: + ) -> AsyncPaginator[CertificateSettings, AsyncSinglePage[CertificateSettings]]: """ List all mTLS hostname settings for this account or zone. @@ -270,16 +259,13 @@ async def get( account_or_zone = "zones" account_or_zone_id = zone_id - return await self._get( + return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/access/certificates/settings", + page=AsyncSinglePage[CertificateSettings], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[SettingGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[SettingGetResponse]], ResultWrapper[SettingGetResponse]), + model=CertificateSettings, ) diff --git a/src/cloudflare/resources/zero_trust/devices/networks.py b/src/cloudflare/resources/zero_trust/devices/networks.py index fed874d2057..0af6f2ec482 100644 --- a/src/cloudflare/resources/zero_trust/devices/networks.py +++ b/src/cloudflare/resources/zero_trust/devices/networks.py @@ -25,7 +25,6 @@ from ...._base_client import AsyncPaginator, make_request_options from ....types.zero_trust.devices import network_create_params, network_update_params from ....types.zero_trust.devices.device_network import DeviceNetwork -from ....types.zero_trust.devices.network_delete_response import NetworkDeleteResponse __all__ = ["NetworksResource", "AsyncNetworksResource"] @@ -204,7 +203,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[NetworkDeleteResponse]: + ) -> SyncSinglePage[DeviceNetwork]: """ Deletes a device managed network and fetches a list of the remaining device managed networks for an account. @@ -224,16 +223,14 @@ def delete( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not network_id: raise ValueError(f"Expected a non-empty value for `network_id` but received {network_id!r}") - return self._delete( + return self._get_api_list( f"/accounts/{account_id}/devices/networks/{network_id}", + page=SyncSinglePage[DeviceNetwork], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[NetworkDeleteResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[NetworkDeleteResponse]], ResultWrapper[NetworkDeleteResponse]), + model=DeviceNetwork, + method="delete", ) def get( @@ -442,7 +439,7 @@ def list( model=DeviceNetwork, ) - async def delete( + def delete( self, network_id: str, *, @@ -453,7 +450,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[NetworkDeleteResponse]: + ) -> AsyncPaginator[DeviceNetwork, AsyncSinglePage[DeviceNetwork]]: """ Deletes a device managed network and fetches a list of the remaining device managed networks for an account. @@ -473,16 +470,14 @@ async def delete( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not network_id: raise ValueError(f"Expected a non-empty value for `network_id` but received {network_id!r}") - return await self._delete( + return self._get_api_list( f"/accounts/{account_id}/devices/networks/{network_id}", + page=AsyncSinglePage[DeviceNetwork], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[NetworkDeleteResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[NetworkDeleteResponse]], ResultWrapper[NetworkDeleteResponse]), + model=DeviceNetwork, + method="delete", ) async def get( diff --git a/src/cloudflare/resources/zero_trust/devices/policies/custom/custom.py b/src/cloudflare/resources/zero_trust/devices/policies/custom/custom.py index 08f3e9fe57a..5f57c159651 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/custom/custom.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/custom/custom.py @@ -48,7 +48,6 @@ from ......_base_client import AsyncPaginator, make_request_options from ......types.zero_trust.devices.policies import custom_edit_params, custom_create_params from ......types.zero_trust.devices.settings_policy import SettingsPolicy -from ......types.zero_trust.devices.policies.custom_delete_response import CustomDeleteResponse __all__ = ["CustomResource", "AsyncCustomResource"] @@ -251,7 +250,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CustomDeleteResponse]: + ) -> SyncSinglePage[SettingsPolicy]: """ Deletes a device settings profile and fetches a list of the remaining profiles for an account. @@ -271,16 +270,14 @@ def delete( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}") - return self._delete( + return self._get_api_list( f"/accounts/{account_id}/devices/policy/{policy_id}", + page=SyncSinglePage[SettingsPolicy], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[CustomDeleteResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[CustomDeleteResponse]], ResultWrapper[CustomDeleteResponse]), + model=SettingsPolicy, + method="delete", ) def edit( @@ -626,7 +623,7 @@ def list( model=SettingsPolicy, ) - async def delete( + def delete( self, policy_id: str, *, @@ -637,7 +634,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CustomDeleteResponse]: + ) -> AsyncPaginator[SettingsPolicy, AsyncSinglePage[SettingsPolicy]]: """ Deletes a device settings profile and fetches a list of the remaining profiles for an account. @@ -657,16 +654,14 @@ async def delete( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}") - return await self._delete( + return self._get_api_list( f"/accounts/{account_id}/devices/policy/{policy_id}", + page=AsyncSinglePage[SettingsPolicy], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[CustomDeleteResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[CustomDeleteResponse]], ResultWrapper[CustomDeleteResponse]), + model=SettingsPolicy, + method="delete", ) async def edit( diff --git a/src/cloudflare/resources/zero_trust/devices/policies/custom/excludes.py b/src/cloudflare/resources/zero_trust/devices/policies/custom/excludes.py index a695ca20aad..f02481f0789 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/custom/excludes.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/custom/excludes.py @@ -2,15 +2,12 @@ from __future__ import annotations -from typing import Type, Iterable, Optional, cast +from typing import Iterable import httpx from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ......_utils import ( - maybe_transform, - async_maybe_transform, -) +from ......_utils import maybe_transform from ......_compat import cached_property from ......_resource import SyncAPIResource, AsyncAPIResource from ......_response import ( @@ -19,11 +16,10 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ......_wrappers import ResultWrapper -from ......_base_client import make_request_options +from ......pagination import SyncSinglePage, AsyncSinglePage +from ......_base_client import AsyncPaginator, make_request_options +from ......types.zero_trust.devices.split_tunnel_exclude import SplitTunnelExclude from ......types.zero_trust.devices.split_tunnel_exclude_param import SplitTunnelExcludeParam -from ......types.zero_trust.devices.policies.custom.exclude_get_response import ExcludeGetResponse -from ......types.zero_trust.devices.policies.custom.exclude_update_response import ExcludeUpdateResponse __all__ = ["ExcludesResource", "AsyncExcludesResource"] @@ -60,7 +56,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ExcludeUpdateResponse]: + ) -> SyncSinglePage[SplitTunnelExclude]: """ Sets the list of routes excluded from the WARP client's tunnel for a specific device settings profile. @@ -80,17 +76,15 @@ def update( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}") - return self._put( + return self._get_api_list( f"/accounts/{account_id}/devices/policy/{policy_id}/exclude", + page=SyncSinglePage[SplitTunnelExclude], body=maybe_transform(body, Iterable[SplitTunnelExcludeParam]), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[ExcludeUpdateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[ExcludeUpdateResponse]], ResultWrapper[ExcludeUpdateResponse]), + model=SplitTunnelExclude, + method="put", ) def get( @@ -104,7 +98,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ExcludeGetResponse]: + ) -> SyncSinglePage[SplitTunnelExclude]: """ Fetches the list of routes excluded from the WARP client's tunnel for a specific device settings profile. @@ -124,16 +118,13 @@ def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}") - return self._get( + return self._get_api_list( f"/accounts/{account_id}/devices/policy/{policy_id}/exclude", + page=SyncSinglePage[SplitTunnelExclude], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[ExcludeGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[ExcludeGetResponse]], ResultWrapper[ExcludeGetResponse]), + model=SplitTunnelExclude, ) @@ -157,7 +148,7 @@ def with_streaming_response(self) -> AsyncExcludesResourceWithStreamingResponse: """ return AsyncExcludesResourceWithStreamingResponse(self) - async def update( + def update( self, policy_id: str, *, @@ -169,7 +160,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ExcludeUpdateResponse]: + ) -> AsyncPaginator[SplitTunnelExclude, AsyncSinglePage[SplitTunnelExclude]]: """ Sets the list of routes excluded from the WARP client's tunnel for a specific device settings profile. @@ -189,20 +180,18 @@ async def update( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}") - return await self._put( + return self._get_api_list( f"/accounts/{account_id}/devices/policy/{policy_id}/exclude", - body=await async_maybe_transform(body, Iterable[SplitTunnelExcludeParam]), + page=AsyncSinglePage[SplitTunnelExclude], + body=maybe_transform(body, Iterable[SplitTunnelExcludeParam]), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[ExcludeUpdateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[ExcludeUpdateResponse]], ResultWrapper[ExcludeUpdateResponse]), + model=SplitTunnelExclude, + method="put", ) - async def get( + def get( self, policy_id: str, *, @@ -213,7 +202,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ExcludeGetResponse]: + ) -> AsyncPaginator[SplitTunnelExclude, AsyncSinglePage[SplitTunnelExclude]]: """ Fetches the list of routes excluded from the WARP client's tunnel for a specific device settings profile. @@ -233,16 +222,13 @@ async def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}") - return await self._get( + return self._get_api_list( f"/accounts/{account_id}/devices/policy/{policy_id}/exclude", + page=AsyncSinglePage[SplitTunnelExclude], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[ExcludeGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[ExcludeGetResponse]], ResultWrapper[ExcludeGetResponse]), + model=SplitTunnelExclude, ) diff --git a/src/cloudflare/resources/zero_trust/devices/policies/custom/fallback_domains.py b/src/cloudflare/resources/zero_trust/devices/policies/custom/fallback_domains.py index 4fec2de36f5..39b6c69bdfe 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/custom/fallback_domains.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/custom/fallback_domains.py @@ -2,15 +2,12 @@ from __future__ import annotations -from typing import Type, Iterable, Optional, cast +from typing import Iterable import httpx from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ......_utils import ( - maybe_transform, - async_maybe_transform, -) +from ......_utils import maybe_transform from ......_compat import cached_property from ......_resource import SyncAPIResource, AsyncAPIResource from ......_response import ( @@ -19,11 +16,10 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ......_wrappers import ResultWrapper -from ......_base_client import make_request_options +from ......pagination import SyncSinglePage, AsyncSinglePage +from ......_base_client import AsyncPaginator, make_request_options +from ......types.zero_trust.devices.fallback_domain import FallbackDomain from ......types.zero_trust.devices.fallback_domain_param import FallbackDomainParam -from ......types.zero_trust.devices.policies.custom.fallback_domain_get_response import FallbackDomainGetResponse -from ......types.zero_trust.devices.policies.custom.fallback_domain_update_response import FallbackDomainUpdateResponse __all__ = ["FallbackDomainsResource", "AsyncFallbackDomainsResource"] @@ -60,7 +56,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FallbackDomainUpdateResponse]: + ) -> SyncSinglePage[FallbackDomain]: """Sets the list of domains to bypass Gateway DNS resolution. These domains will @@ -82,17 +78,15 @@ def update( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}") - return self._put( + return self._get_api_list( f"/accounts/{account_id}/devices/policy/{policy_id}/fallback_domains", + page=SyncSinglePage[FallbackDomain], body=maybe_transform(domains, Iterable[FallbackDomainParam]), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[FallbackDomainUpdateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[FallbackDomainUpdateResponse]], ResultWrapper[FallbackDomainUpdateResponse]), + model=FallbackDomain, + method="put", ) def get( @@ -106,7 +100,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FallbackDomainGetResponse]: + ) -> SyncSinglePage[FallbackDomain]: """ Fetches the list of domains to bypass Gateway DNS resolution from a specified device settings profile. These domains will use the specified local DNS resolver @@ -127,16 +121,13 @@ def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}") - return self._get( + return self._get_api_list( f"/accounts/{account_id}/devices/policy/{policy_id}/fallback_domains", + page=SyncSinglePage[FallbackDomain], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[FallbackDomainGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[FallbackDomainGetResponse]], ResultWrapper[FallbackDomainGetResponse]), + model=FallbackDomain, ) @@ -160,7 +151,7 @@ def with_streaming_response(self) -> AsyncFallbackDomainsResourceWithStreamingRe """ return AsyncFallbackDomainsResourceWithStreamingResponse(self) - async def update( + def update( self, policy_id: str, *, @@ -172,7 +163,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FallbackDomainUpdateResponse]: + ) -> AsyncPaginator[FallbackDomain, AsyncSinglePage[FallbackDomain]]: """Sets the list of domains to bypass Gateway DNS resolution. These domains will @@ -194,20 +185,18 @@ async def update( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}") - return await self._put( + return self._get_api_list( f"/accounts/{account_id}/devices/policy/{policy_id}/fallback_domains", - body=await async_maybe_transform(domains, Iterable[FallbackDomainParam]), + page=AsyncSinglePage[FallbackDomain], + body=maybe_transform(domains, Iterable[FallbackDomainParam]), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[FallbackDomainUpdateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[FallbackDomainUpdateResponse]], ResultWrapper[FallbackDomainUpdateResponse]), + model=FallbackDomain, + method="put", ) - async def get( + def get( self, policy_id: str, *, @@ -218,7 +207,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FallbackDomainGetResponse]: + ) -> AsyncPaginator[FallbackDomain, AsyncSinglePage[FallbackDomain]]: """ Fetches the list of domains to bypass Gateway DNS resolution from a specified device settings profile. These domains will use the specified local DNS resolver @@ -239,16 +228,13 @@ async def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}") - return await self._get( + return self._get_api_list( f"/accounts/{account_id}/devices/policy/{policy_id}/fallback_domains", + page=AsyncSinglePage[FallbackDomain], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[FallbackDomainGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[FallbackDomainGetResponse]], ResultWrapper[FallbackDomainGetResponse]), + model=FallbackDomain, ) diff --git a/src/cloudflare/resources/zero_trust/devices/policies/custom/includes.py b/src/cloudflare/resources/zero_trust/devices/policies/custom/includes.py index 163274979ca..5d9722beccf 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/custom/includes.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/custom/includes.py @@ -2,15 +2,12 @@ from __future__ import annotations -from typing import Type, Iterable, Optional, cast +from typing import Iterable import httpx from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ......_utils import ( - maybe_transform, - async_maybe_transform, -) +from ......_utils import maybe_transform from ......_compat import cached_property from ......_resource import SyncAPIResource, AsyncAPIResource from ......_response import ( @@ -19,11 +16,10 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ......_wrappers import ResultWrapper -from ......_base_client import make_request_options +from ......pagination import SyncSinglePage, AsyncSinglePage +from ......_base_client import AsyncPaginator, make_request_options +from ......types.zero_trust.devices.split_tunnel_include import SplitTunnelInclude from ......types.zero_trust.devices.split_tunnel_include_param import SplitTunnelIncludeParam -from ......types.zero_trust.devices.policies.custom.include_get_response import IncludeGetResponse -from ......types.zero_trust.devices.policies.custom.include_update_response import IncludeUpdateResponse __all__ = ["IncludesResource", "AsyncIncludesResource"] @@ -60,7 +56,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[IncludeUpdateResponse]: + ) -> SyncSinglePage[SplitTunnelInclude]: """ Sets the list of routes included in the WARP client's tunnel for a specific device settings profile. @@ -80,17 +76,15 @@ def update( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}") - return self._put( + return self._get_api_list( f"/accounts/{account_id}/devices/policy/{policy_id}/include", + page=SyncSinglePage[SplitTunnelInclude], body=maybe_transform(body, Iterable[SplitTunnelIncludeParam]), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[IncludeUpdateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[IncludeUpdateResponse]], ResultWrapper[IncludeUpdateResponse]), + model=SplitTunnelInclude, + method="put", ) def get( @@ -104,7 +98,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[IncludeGetResponse]: + ) -> SyncSinglePage[SplitTunnelInclude]: """ Fetches the list of routes included in the WARP client's tunnel for a specific device settings profile. @@ -124,16 +118,13 @@ def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}") - return self._get( + return self._get_api_list( f"/accounts/{account_id}/devices/policy/{policy_id}/include", + page=SyncSinglePage[SplitTunnelInclude], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[IncludeGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[IncludeGetResponse]], ResultWrapper[IncludeGetResponse]), + model=SplitTunnelInclude, ) @@ -157,7 +148,7 @@ def with_streaming_response(self) -> AsyncIncludesResourceWithStreamingResponse: """ return AsyncIncludesResourceWithStreamingResponse(self) - async def update( + def update( self, policy_id: str, *, @@ -169,7 +160,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[IncludeUpdateResponse]: + ) -> AsyncPaginator[SplitTunnelInclude, AsyncSinglePage[SplitTunnelInclude]]: """ Sets the list of routes included in the WARP client's tunnel for a specific device settings profile. @@ -189,20 +180,18 @@ async def update( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}") - return await self._put( + return self._get_api_list( f"/accounts/{account_id}/devices/policy/{policy_id}/include", - body=await async_maybe_transform(body, Iterable[SplitTunnelIncludeParam]), + page=AsyncSinglePage[SplitTunnelInclude], + body=maybe_transform(body, Iterable[SplitTunnelIncludeParam]), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[IncludeUpdateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[IncludeUpdateResponse]], ResultWrapper[IncludeUpdateResponse]), + model=SplitTunnelInclude, + method="put", ) - async def get( + def get( self, policy_id: str, *, @@ -213,7 +202,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[IncludeGetResponse]: + ) -> AsyncPaginator[SplitTunnelInclude, AsyncSinglePage[SplitTunnelInclude]]: """ Fetches the list of routes included in the WARP client's tunnel for a specific device settings profile. @@ -233,16 +222,13 @@ async def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}") - return await self._get( + return self._get_api_list( f"/accounts/{account_id}/devices/policy/{policy_id}/include", + page=AsyncSinglePage[SplitTunnelInclude], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[IncludeGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[IncludeGetResponse]], ResultWrapper[IncludeGetResponse]), + model=SplitTunnelInclude, ) diff --git a/src/cloudflare/resources/zero_trust/devices/policies/default/excludes.py b/src/cloudflare/resources/zero_trust/devices/policies/default/excludes.py index 39a1525a49f..16adf36a352 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/default/excludes.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/default/excludes.py @@ -2,15 +2,12 @@ from __future__ import annotations -from typing import Type, Iterable, Optional, cast +from typing import Iterable import httpx from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ......_utils import ( - maybe_transform, - async_maybe_transform, -) +from ......_utils import maybe_transform from ......_compat import cached_property from ......_resource import SyncAPIResource, AsyncAPIResource from ......_response import ( @@ -19,11 +16,10 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ......_wrappers import ResultWrapper -from ......_base_client import make_request_options +from ......pagination import SyncSinglePage, AsyncSinglePage +from ......_base_client import AsyncPaginator, make_request_options +from ......types.zero_trust.devices.split_tunnel_exclude import SplitTunnelExclude from ......types.zero_trust.devices.split_tunnel_exclude_param import SplitTunnelExcludeParam -from ......types.zero_trust.devices.policies.default.exclude_get_response import ExcludeGetResponse -from ......types.zero_trust.devices.policies.default.exclude_update_response import ExcludeUpdateResponse __all__ = ["ExcludesResource", "AsyncExcludesResource"] @@ -59,7 +55,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ExcludeUpdateResponse]: + ) -> SyncSinglePage[SplitTunnelExclude]: """ Sets the list of routes excluded from the WARP client's tunnel. @@ -74,17 +70,15 @@ def update( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._put( + return self._get_api_list( f"/accounts/{account_id}/devices/policy/exclude", + page=SyncSinglePage[SplitTunnelExclude], body=maybe_transform(body, Iterable[SplitTunnelExcludeParam]), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[ExcludeUpdateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[ExcludeUpdateResponse]], ResultWrapper[ExcludeUpdateResponse]), + model=SplitTunnelExclude, + method="put", ) def get( @@ -97,7 +91,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ExcludeGetResponse]: + ) -> SyncSinglePage[SplitTunnelExclude]: """ Fetches the list of routes excluded from the WARP client's tunnel. @@ -112,16 +106,13 @@ def get( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get( + return self._get_api_list( f"/accounts/{account_id}/devices/policy/exclude", + page=SyncSinglePage[SplitTunnelExclude], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[ExcludeGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[ExcludeGetResponse]], ResultWrapper[ExcludeGetResponse]), + model=SplitTunnelExclude, ) @@ -145,7 +136,7 @@ def with_streaming_response(self) -> AsyncExcludesResourceWithStreamingResponse: """ return AsyncExcludesResourceWithStreamingResponse(self) - async def update( + def update( self, *, account_id: str, @@ -156,7 +147,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ExcludeUpdateResponse]: + ) -> AsyncPaginator[SplitTunnelExclude, AsyncSinglePage[SplitTunnelExclude]]: """ Sets the list of routes excluded from the WARP client's tunnel. @@ -171,20 +162,18 @@ async def update( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._put( + return self._get_api_list( f"/accounts/{account_id}/devices/policy/exclude", - body=await async_maybe_transform(body, Iterable[SplitTunnelExcludeParam]), + page=AsyncSinglePage[SplitTunnelExclude], + body=maybe_transform(body, Iterable[SplitTunnelExcludeParam]), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[ExcludeUpdateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[ExcludeUpdateResponse]], ResultWrapper[ExcludeUpdateResponse]), + model=SplitTunnelExclude, + method="put", ) - async def get( + def get( self, *, account_id: str, @@ -194,7 +183,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ExcludeGetResponse]: + ) -> AsyncPaginator[SplitTunnelExclude, AsyncSinglePage[SplitTunnelExclude]]: """ Fetches the list of routes excluded from the WARP client's tunnel. @@ -209,16 +198,13 @@ async def get( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._get( + return self._get_api_list( f"/accounts/{account_id}/devices/policy/exclude", + page=AsyncSinglePage[SplitTunnelExclude], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[ExcludeGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[ExcludeGetResponse]], ResultWrapper[ExcludeGetResponse]), + model=SplitTunnelExclude, ) diff --git a/src/cloudflare/resources/zero_trust/devices/policies/default/fallback_domains.py b/src/cloudflare/resources/zero_trust/devices/policies/default/fallback_domains.py index 3014b6f8300..7903025fae8 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/default/fallback_domains.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/default/fallback_domains.py @@ -2,15 +2,12 @@ from __future__ import annotations -from typing import Type, Iterable, Optional, cast +from typing import Iterable import httpx from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ......_utils import ( - maybe_transform, - async_maybe_transform, -) +from ......_utils import maybe_transform from ......_compat import cached_property from ......_resource import SyncAPIResource, AsyncAPIResource from ......_response import ( @@ -19,11 +16,10 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ......_wrappers import ResultWrapper -from ......_base_client import make_request_options +from ......pagination import SyncSinglePage, AsyncSinglePage +from ......_base_client import AsyncPaginator, make_request_options +from ......types.zero_trust.devices.fallback_domain import FallbackDomain from ......types.zero_trust.devices.fallback_domain_param import FallbackDomainParam -from ......types.zero_trust.devices.policies.default.fallback_domain_get_response import FallbackDomainGetResponse -from ......types.zero_trust.devices.policies.default.fallback_domain_update_response import FallbackDomainUpdateResponse __all__ = ["FallbackDomainsResource", "AsyncFallbackDomainsResource"] @@ -59,7 +55,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FallbackDomainUpdateResponse]: + ) -> SyncSinglePage[FallbackDomain]: """Sets the list of domains to bypass Gateway DNS resolution. These domains will @@ -76,17 +72,15 @@ def update( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._put( + return self._get_api_list( f"/accounts/{account_id}/devices/policy/fallback_domains", + page=SyncSinglePage[FallbackDomain], body=maybe_transform(domains, Iterable[FallbackDomainParam]), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[FallbackDomainUpdateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[FallbackDomainUpdateResponse]], ResultWrapper[FallbackDomainUpdateResponse]), + model=FallbackDomain, + method="put", ) def get( @@ -99,7 +93,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FallbackDomainGetResponse]: + ) -> SyncSinglePage[FallbackDomain]: """Fetches a list of domains to bypass Gateway DNS resolution. These domains will @@ -116,16 +110,13 @@ def get( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get( + return self._get_api_list( f"/accounts/{account_id}/devices/policy/fallback_domains", + page=SyncSinglePage[FallbackDomain], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[FallbackDomainGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[FallbackDomainGetResponse]], ResultWrapper[FallbackDomainGetResponse]), + model=FallbackDomain, ) @@ -149,7 +140,7 @@ def with_streaming_response(self) -> AsyncFallbackDomainsResourceWithStreamingRe """ return AsyncFallbackDomainsResourceWithStreamingResponse(self) - async def update( + def update( self, *, account_id: str, @@ -160,7 +151,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FallbackDomainUpdateResponse]: + ) -> AsyncPaginator[FallbackDomain, AsyncSinglePage[FallbackDomain]]: """Sets the list of domains to bypass Gateway DNS resolution. These domains will @@ -177,20 +168,18 @@ async def update( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._put( + return self._get_api_list( f"/accounts/{account_id}/devices/policy/fallback_domains", - body=await async_maybe_transform(domains, Iterable[FallbackDomainParam]), + page=AsyncSinglePage[FallbackDomain], + body=maybe_transform(domains, Iterable[FallbackDomainParam]), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[FallbackDomainUpdateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[FallbackDomainUpdateResponse]], ResultWrapper[FallbackDomainUpdateResponse]), + model=FallbackDomain, + method="put", ) - async def get( + def get( self, *, account_id: str, @@ -200,7 +189,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FallbackDomainGetResponse]: + ) -> AsyncPaginator[FallbackDomain, AsyncSinglePage[FallbackDomain]]: """Fetches a list of domains to bypass Gateway DNS resolution. These domains will @@ -217,16 +206,13 @@ async def get( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._get( + return self._get_api_list( f"/accounts/{account_id}/devices/policy/fallback_domains", + page=AsyncSinglePage[FallbackDomain], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[FallbackDomainGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[FallbackDomainGetResponse]], ResultWrapper[FallbackDomainGetResponse]), + model=FallbackDomain, ) diff --git a/src/cloudflare/resources/zero_trust/devices/policies/default/includes.py b/src/cloudflare/resources/zero_trust/devices/policies/default/includes.py index ddefff70346..53699a0be80 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/default/includes.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/default/includes.py @@ -2,15 +2,12 @@ from __future__ import annotations -from typing import Type, Iterable, Optional, cast +from typing import Iterable import httpx from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ......_utils import ( - maybe_transform, - async_maybe_transform, -) +from ......_utils import maybe_transform from ......_compat import cached_property from ......_resource import SyncAPIResource, AsyncAPIResource from ......_response import ( @@ -19,11 +16,10 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ......_wrappers import ResultWrapper -from ......_base_client import make_request_options +from ......pagination import SyncSinglePage, AsyncSinglePage +from ......_base_client import AsyncPaginator, make_request_options +from ......types.zero_trust.devices.split_tunnel_include import SplitTunnelInclude from ......types.zero_trust.devices.split_tunnel_include_param import SplitTunnelIncludeParam -from ......types.zero_trust.devices.policies.default.include_get_response import IncludeGetResponse -from ......types.zero_trust.devices.policies.default.include_update_response import IncludeUpdateResponse __all__ = ["IncludesResource", "AsyncIncludesResource"] @@ -59,7 +55,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[IncludeUpdateResponse]: + ) -> SyncSinglePage[SplitTunnelInclude]: """ Sets the list of routes included in the WARP client's tunnel. @@ -74,17 +70,15 @@ def update( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._put( + return self._get_api_list( f"/accounts/{account_id}/devices/policy/include", + page=SyncSinglePage[SplitTunnelInclude], body=maybe_transform(body, Iterable[SplitTunnelIncludeParam]), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[IncludeUpdateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[IncludeUpdateResponse]], ResultWrapper[IncludeUpdateResponse]), + model=SplitTunnelInclude, + method="put", ) def get( @@ -97,7 +91,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[IncludeGetResponse]: + ) -> SyncSinglePage[SplitTunnelInclude]: """ Fetches the list of routes included in the WARP client's tunnel. @@ -112,16 +106,13 @@ def get( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get( + return self._get_api_list( f"/accounts/{account_id}/devices/policy/include", + page=SyncSinglePage[SplitTunnelInclude], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[IncludeGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[IncludeGetResponse]], ResultWrapper[IncludeGetResponse]), + model=SplitTunnelInclude, ) @@ -145,7 +136,7 @@ def with_streaming_response(self) -> AsyncIncludesResourceWithStreamingResponse: """ return AsyncIncludesResourceWithStreamingResponse(self) - async def update( + def update( self, *, account_id: str, @@ -156,7 +147,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[IncludeUpdateResponse]: + ) -> AsyncPaginator[SplitTunnelInclude, AsyncSinglePage[SplitTunnelInclude]]: """ Sets the list of routes included in the WARP client's tunnel. @@ -171,20 +162,18 @@ async def update( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._put( + return self._get_api_list( f"/accounts/{account_id}/devices/policy/include", - body=await async_maybe_transform(body, Iterable[SplitTunnelIncludeParam]), + page=AsyncSinglePage[SplitTunnelInclude], + body=maybe_transform(body, Iterable[SplitTunnelIncludeParam]), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[IncludeUpdateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[IncludeUpdateResponse]], ResultWrapper[IncludeUpdateResponse]), + model=SplitTunnelInclude, + method="put", ) - async def get( + def get( self, *, account_id: str, @@ -194,7 +183,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[IncludeGetResponse]: + ) -> AsyncPaginator[SplitTunnelInclude, AsyncSinglePage[SplitTunnelInclude]]: """ Fetches the list of routes included in the WARP client's tunnel. @@ -209,16 +198,13 @@ async def get( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._get( + return self._get_api_list( f"/accounts/{account_id}/devices/policy/include", + page=AsyncSinglePage[SplitTunnelInclude], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[IncludeGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[IncludeGetResponse]], ResultWrapper[IncludeGetResponse]), + model=SplitTunnelInclude, ) diff --git a/src/cloudflare/resources/zero_trust/dlp/datasets/versions/versions.py b/src/cloudflare/resources/zero_trust/dlp/datasets/versions/versions.py index 158c7513cea..2caf310919d 100755 --- a/src/cloudflare/resources/zero_trust/dlp/datasets/versions/versions.py +++ b/src/cloudflare/resources/zero_trust/dlp/datasets/versions/versions.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, Iterable, Optional, cast +from typing import Iterable import httpx @@ -15,10 +15,7 @@ AsyncEntriesResourceWithStreamingResponse, ) from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ......_utils import ( - maybe_transform, - async_maybe_transform, -) +from ......_utils import maybe_transform from ......_compat import cached_property from ......_resource import SyncAPIResource, AsyncAPIResource from ......_response import ( @@ -27,8 +24,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ......_wrappers import ResultWrapper -from ......_base_client import make_request_options +from ......pagination import SyncSinglePage, AsyncSinglePage +from ......_base_client import AsyncPaginator, make_request_options from ......types.zero_trust.dlp.datasets import version_create_params from ......types.zero_trust.dlp.datasets.version_create_response import VersionCreateResponse @@ -72,7 +69,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[VersionCreateResponse]: + ) -> SyncSinglePage[VersionCreateResponse]: """This is used for multi-column EDMv2 datasets. The EDMv2 format can only be @@ -92,17 +89,15 @@ def create( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dataset_id: raise ValueError(f"Expected a non-empty value for `dataset_id` but received {dataset_id!r}") - return self._post( + return self._get_api_list( f"/accounts/{account_id}/dlp/datasets/{dataset_id}/versions/{version}", + page=SyncSinglePage[VersionCreateResponse], body=maybe_transform(body, Iterable[version_create_params.Body]), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[VersionCreateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[VersionCreateResponse]], ResultWrapper[VersionCreateResponse]), + model=VersionCreateResponse, + method="post", ) @@ -130,7 +125,7 @@ def with_streaming_response(self) -> AsyncVersionsResourceWithStreamingResponse: """ return AsyncVersionsResourceWithStreamingResponse(self) - async def create( + def create( self, version: int, *, @@ -143,7 +138,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[VersionCreateResponse]: + ) -> AsyncPaginator[VersionCreateResponse, AsyncSinglePage[VersionCreateResponse]]: """This is used for multi-column EDMv2 datasets. The EDMv2 format can only be @@ -163,17 +158,15 @@ async def create( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dataset_id: raise ValueError(f"Expected a non-empty value for `dataset_id` but received {dataset_id!r}") - return await self._post( + return self._get_api_list( f"/accounts/{account_id}/dlp/datasets/{dataset_id}/versions/{version}", - body=await async_maybe_transform(body, Iterable[version_create_params.Body]), + page=AsyncSinglePage[VersionCreateResponse], + body=maybe_transform(body, Iterable[version_create_params.Body]), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[VersionCreateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[VersionCreateResponse]], ResultWrapper[VersionCreateResponse]), + model=VersionCreateResponse, + method="post", ) diff --git a/src/cloudflare/resources/zero_trust/gateway/proxy_endpoints.py b/src/cloudflare/resources/zero_trust/gateway/proxy_endpoints.py index 9b0726dab09..f3f17f46e42 100644 --- a/src/cloudflare/resources/zero_trust/gateway/proxy_endpoints.py +++ b/src/cloudflare/resources/zero_trust/gateway/proxy_endpoints.py @@ -20,11 +20,11 @@ async_to_streamed_response_wrapper, ) from ...._wrappers import ResultWrapper -from ...._base_client import make_request_options +from ....pagination import SyncSinglePage, AsyncSinglePage +from ...._base_client import AsyncPaginator, make_request_options from ....types.zero_trust.gateway import proxy_endpoint_edit_params, proxy_endpoint_create_params from ....types.zero_trust.gateway.gateway_ips import GatewayIPs from ....types.zero_trust.gateway.proxy_endpoint import ProxyEndpoint -from ....types.zero_trust.gateway.proxy_endpoint_get_response import ProxyEndpointGetResponse __all__ = ["ProxyEndpointsResource", "AsyncProxyEndpointsResource"] @@ -240,7 +240,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ProxyEndpointGetResponse]: + ) -> SyncSinglePage[ProxyEndpoint]: """ Fetches a single Zero Trust Gateway proxy endpoint. @@ -257,16 +257,13 @@ def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not proxy_endpoint_id: raise ValueError(f"Expected a non-empty value for `proxy_endpoint_id` but received {proxy_endpoint_id!r}") - return self._get( + return self._get_api_list( f"/accounts/{account_id}/gateway/proxy_endpoints/{proxy_endpoint_id}", + page=SyncSinglePage[ProxyEndpoint], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[ProxyEndpointGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[ProxyEndpointGetResponse]], ResultWrapper[ProxyEndpointGetResponse]), + model=ProxyEndpoint, ) @@ -470,7 +467,7 @@ async def edit( cast_to=cast(Type[Optional[ProxyEndpoint]], ResultWrapper[ProxyEndpoint]), ) - async def get( + def get( self, proxy_endpoint_id: str, *, @@ -481,7 +478,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ProxyEndpointGetResponse]: + ) -> AsyncPaginator[ProxyEndpoint, AsyncSinglePage[ProxyEndpoint]]: """ Fetches a single Zero Trust Gateway proxy endpoint. @@ -498,16 +495,13 @@ async def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not proxy_endpoint_id: raise ValueError(f"Expected a non-empty value for `proxy_endpoint_id` but received {proxy_endpoint_id!r}") - return await self._get( + return self._get_api_list( f"/accounts/{account_id}/gateway/proxy_endpoints/{proxy_endpoint_id}", + page=AsyncSinglePage[ProxyEndpoint], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[ProxyEndpointGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[ProxyEndpointGetResponse]], ResultWrapper[ProxyEndpointGetResponse]), + model=ProxyEndpoint, ) diff --git a/src/cloudflare/resources/zero_trust/seats.py b/src/cloudflare/resources/zero_trust/seats.py index a054ff308c4..92aa2e6c401 100644 --- a/src/cloudflare/resources/zero_trust/seats.py +++ b/src/cloudflare/resources/zero_trust/seats.py @@ -2,15 +2,12 @@ from __future__ import annotations -from typing import Type, Iterable, Optional, cast +from typing import Iterable import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -19,10 +16,10 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._wrappers import ResultWrapper -from ..._base_client import make_request_options +from ...pagination import SyncSinglePage, AsyncSinglePage +from ..._base_client import AsyncPaginator, make_request_options from ...types.zero_trust import seat_edit_params -from ...types.zero_trust.seat_edit_response import SeatEditResponse +from ...types.zero_trust.seat import Seat __all__ = ["SeatsResource", "AsyncSeatsResource"] @@ -58,7 +55,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[SeatEditResponse]: + ) -> SyncSinglePage[Seat]: """ Removes a user from a Zero Trust seat when both `access_seat` and `gateway_seat` are set to false. @@ -76,17 +73,15 @@ def edit( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._patch( + return self._get_api_list( f"/accounts/{account_id}/access/seats", + page=SyncSinglePage[Seat], body=maybe_transform(body, Iterable[seat_edit_params.Body]), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[SeatEditResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[SeatEditResponse]], ResultWrapper[SeatEditResponse]), + model=Seat, + method="patch", ) @@ -110,7 +105,7 @@ def with_streaming_response(self) -> AsyncSeatsResourceWithStreamingResponse: """ return AsyncSeatsResourceWithStreamingResponse(self) - async def edit( + def edit( self, *, account_id: str, @@ -121,7 +116,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[SeatEditResponse]: + ) -> AsyncPaginator[Seat, AsyncSinglePage[Seat]]: """ Removes a user from a Zero Trust seat when both `access_seat` and `gateway_seat` are set to false. @@ -139,17 +134,15 @@ async def edit( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._patch( + return self._get_api_list( f"/accounts/{account_id}/access/seats", - body=await async_maybe_transform(body, Iterable[seat_edit_params.Body]), + page=AsyncSinglePage[Seat], + body=maybe_transform(body, Iterable[seat_edit_params.Body]), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[SeatEditResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[SeatEditResponse]], ResultWrapper[SeatEditResponse]), + model=Seat, + method="patch", ) diff --git a/src/cloudflare/resources/zero_trust/tunnels/connections.py b/src/cloudflare/resources/zero_trust/tunnels/connections.py index 76aee5e0274..17707e7c12b 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/connections.py +++ b/src/cloudflare/resources/zero_trust/tunnels/connections.py @@ -20,9 +20,10 @@ async_to_streamed_response_wrapper, ) from ...._wrappers import ResultWrapper -from ...._base_client import make_request_options +from ....pagination import SyncSinglePage, AsyncSinglePage +from ...._base_client import AsyncPaginator, make_request_options from ....types.zero_trust.tunnels import connection_delete_params -from ....types.zero_trust.tunnels.connection_get_response import ConnectionGetResponse +from ....types.zero_trust.tunnels.client import Client __all__ = ["ConnectionsResource", "AsyncConnectionsResource"] @@ -109,7 +110,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ConnectionGetResponse]: + ) -> SyncSinglePage[Client]: """ Fetches connection details for a Cloudflare Tunnel. @@ -130,16 +131,13 @@ def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: raise ValueError(f"Expected a non-empty value for `tunnel_id` but received {tunnel_id!r}") - return self._get( + return self._get_api_list( f"/accounts/{account_id}/cfd_tunnel/{tunnel_id}/connections", + page=SyncSinglePage[Client], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[ConnectionGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[ConnectionGetResponse]], ResultWrapper[ConnectionGetResponse]), + model=Client, ) @@ -216,7 +214,7 @@ async def delete( cast_to=cast(Type[object], ResultWrapper[object]), ) - async def get( + def get( self, tunnel_id: str, *, @@ -227,7 +225,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ConnectionGetResponse]: + ) -> AsyncPaginator[Client, AsyncSinglePage[Client]]: """ Fetches connection details for a Cloudflare Tunnel. @@ -248,16 +246,13 @@ async def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: raise ValueError(f"Expected a non-empty value for `tunnel_id` but received {tunnel_id!r}") - return await self._get( + return self._get_api_list( f"/accounts/{account_id}/cfd_tunnel/{tunnel_id}/connections", + page=AsyncSinglePage[Client], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[ConnectionGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[ConnectionGetResponse]], ResultWrapper[ConnectionGetResponse]), + model=Client, ) diff --git a/src/cloudflare/resources/zones/custom_nameservers.py b/src/cloudflare/resources/zones/custom_nameservers.py index 906c4f02bc3..149cbe50aa3 100644 --- a/src/cloudflare/resources/zones/custom_nameservers.py +++ b/src/cloudflare/resources/zones/custom_nameservers.py @@ -3,15 +3,11 @@ from __future__ import annotations import typing_extensions -from typing import Type, Optional, cast import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -20,9 +16,9 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._wrappers import ResultWrapper +from ...pagination import SyncSinglePage, AsyncSinglePage from ...types.zones import custom_nameserver_update_params -from ..._base_client import make_request_options +from ..._base_client import AsyncPaginator, make_request_options from ...types.zones.custom_nameserver_get_response import CustomNameserverGetResponse from ...types.zones.custom_nameserver_update_response import CustomNameserverUpdateResponse @@ -64,7 +60,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CustomNameserverUpdateResponse]: + ) -> SyncSinglePage[CustomNameserverUpdateResponse]: """ Set metadata for account-level custom nameservers on a zone. @@ -92,8 +88,9 @@ def update( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._put( + return self._get_api_list( f"/zones/{zone_id}/custom_ns", + page=SyncSinglePage[CustomNameserverUpdateResponse], body=maybe_transform( { "enabled": enabled, @@ -102,13 +99,10 @@ def update( custom_nameserver_update_params.CustomNameserverUpdateParams, ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[CustomNameserverUpdateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[CustomNameserverUpdateResponse]], ResultWrapper[CustomNameserverUpdateResponse]), + model=str, + method="put", ) @typing_extensions.deprecated( @@ -176,7 +170,7 @@ def with_streaming_response(self) -> AsyncCustomNameserversResourceWithStreaming @typing_extensions.deprecated( "Use [DNS settings API](https://developers.cloudflare.com/api/resources/dns/subresources/settings/methods/put/) instead." ) - async def update( + def update( self, *, zone_id: str, @@ -188,7 +182,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[CustomNameserverUpdateResponse]: + ) -> AsyncPaginator[CustomNameserverUpdateResponse, AsyncSinglePage[CustomNameserverUpdateResponse]]: """ Set metadata for account-level custom nameservers on a zone. @@ -216,9 +210,10 @@ async def update( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._put( + return self._get_api_list( f"/zones/{zone_id}/custom_ns", - body=await async_maybe_transform( + page=AsyncSinglePage[CustomNameserverUpdateResponse], + body=maybe_transform( { "enabled": enabled, "ns_set": ns_set, @@ -226,13 +221,10 @@ async def update( custom_nameserver_update_params.CustomNameserverUpdateParams, ), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[CustomNameserverUpdateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[CustomNameserverUpdateResponse]], ResultWrapper[CustomNameserverUpdateResponse]), + model=str, + method="put", ) @typing_extensions.deprecated( diff --git a/src/cloudflare/resources/zones/rate_plans.py b/src/cloudflare/resources/zones/rate_plans.py index 12d7c4deaff..daff981d93f 100644 --- a/src/cloudflare/resources/zones/rate_plans.py +++ b/src/cloudflare/resources/zones/rate_plans.py @@ -2,8 +2,6 @@ from __future__ import annotations -from typing import Type, Optional, cast - import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven @@ -15,8 +13,8 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._wrappers import ResultWrapper -from ..._base_client import make_request_options +from ...pagination import SyncSinglePage, AsyncSinglePage +from ..._base_client import AsyncPaginator, make_request_options from ...types.zones.rate_plan_get_response import RatePlanGetResponse __all__ = ["RatePlansResource", "AsyncRatePlansResource"] @@ -52,7 +50,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RatePlanGetResponse]: + ) -> SyncSinglePage[RatePlanGetResponse]: """ Lists all rate plans the zone can subscribe to. @@ -69,16 +67,13 @@ def get( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._get( + return self._get_api_list( f"/zones/{zone_id}/available_rate_plans", + page=SyncSinglePage[RatePlanGetResponse], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RatePlanGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[RatePlanGetResponse]], ResultWrapper[RatePlanGetResponse]), + model=RatePlanGetResponse, ) @@ -102,7 +97,7 @@ def with_streaming_response(self) -> AsyncRatePlansResourceWithStreamingResponse """ return AsyncRatePlansResourceWithStreamingResponse(self) - async def get( + def get( self, *, zone_id: str, @@ -112,7 +107,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RatePlanGetResponse]: + ) -> AsyncPaginator[RatePlanGetResponse, AsyncSinglePage[RatePlanGetResponse]]: """ Lists all rate plans the zone can subscribe to. @@ -129,16 +124,13 @@ async def get( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._get( + return self._get_api_list( f"/zones/{zone_id}/available_rate_plans", + page=AsyncSinglePage[RatePlanGetResponse], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RatePlanGetResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[RatePlanGetResponse]], ResultWrapper[RatePlanGetResponse]), + model=RatePlanGetResponse, ) diff --git a/src/cloudflare/types/accounts/__init__.py b/src/cloudflare/types/accounts/__init__.py index 261550ea29d..b9452666fc2 100644 --- a/src/cloudflare/types/accounts/__init__.py +++ b/src/cloudflare/types/accounts/__init__.py @@ -18,7 +18,6 @@ from .token_verify_response import TokenVerifyResponse as TokenVerifyResponse from .member_delete_response import MemberDeleteResponse as MemberDeleteResponse from .account_delete_response import AccountDeleteResponse as AccountDeleteResponse -from .subscription_get_response import SubscriptionGetResponse as SubscriptionGetResponse from .subscription_create_params import SubscriptionCreateParams as SubscriptionCreateParams from .subscription_update_params import SubscriptionUpdateParams as SubscriptionUpdateParams from .subscription_create_response import SubscriptionCreateResponse as SubscriptionCreateResponse diff --git a/src/cloudflare/types/accounts/subscription_get_response.py b/src/cloudflare/types/accounts/subscription_get_response.py deleted file mode 100644 index e03c90ba181..00000000000 --- a/src/cloudflare/types/accounts/subscription_get_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from ..shared.subscription import Subscription - -__all__ = ["SubscriptionGetResponse"] - -SubscriptionGetResponse: TypeAlias = List[Subscription] diff --git a/src/cloudflare/types/alerting/destinations/__init__.py b/src/cloudflare/types/alerting/destinations/__init__.py index fd61e30e290..848b0dd5555 100644 --- a/src/cloudflare/types/alerting/destinations/__init__.py +++ b/src/cloudflare/types/alerting/destinations/__init__.py @@ -7,7 +7,6 @@ from .eligible_get_response import EligibleGetResponse as EligibleGetResponse from .webhook_create_params import WebhookCreateParams as WebhookCreateParams from .webhook_update_params import WebhookUpdateParams as WebhookUpdateParams -from .pagerduty_get_response import PagerdutyGetResponse as PagerdutyGetResponse from .pagerduty_link_response import PagerdutyLinkResponse as PagerdutyLinkResponse from .webhook_create_response import WebhookCreateResponse as WebhookCreateResponse from .webhook_delete_response import WebhookDeleteResponse as WebhookDeleteResponse diff --git a/src/cloudflare/types/alerting/destinations/pagerduty_get_response.py b/src/cloudflare/types/alerting/destinations/pagerduty_get_response.py deleted file mode 100644 index ab52bae41f3..00000000000 --- a/src/cloudflare/types/alerting/destinations/pagerduty_get_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .pagerduty import Pagerduty - -__all__ = ["PagerdutyGetResponse"] - -PagerdutyGetResponse: TypeAlias = List[Pagerduty] diff --git a/src/cloudflare/types/api_gateway/operation_bulk_create_response.py b/src/cloudflare/types/api_gateway/operation_bulk_create_response.py index cf7c4824a17..9079c8b44c1 100644 --- a/src/cloudflare/types/api_gateway/operation_bulk_create_response.py +++ b/src/cloudflare/types/api_gateway/operation_bulk_create_response.py @@ -8,29 +8,28 @@ __all__ = [ "OperationBulkCreateResponse", - "OperationBulkCreateResponseItem", - "OperationBulkCreateResponseItemFeatures", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureThresholds", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureThresholdsThresholds", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemas", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureAPIRouting", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervals", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfo", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo", - "OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema", + "Features", + "FeaturesAPIShieldOperationFeatureThresholds", + "FeaturesAPIShieldOperationFeatureThresholdsThresholds", + "FeaturesAPIShieldOperationFeatureParameterSchemas", + "FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas", + "FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas", + "FeaturesAPIShieldOperationFeatureAPIRouting", + "FeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting", + "FeaturesAPIShieldOperationFeatureConfidenceIntervals", + "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals", + "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold", + "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals", + "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90", + "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95", + "FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99", + "FeaturesAPIShieldOperationFeatureSchemaInfo", + "FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo", + "FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema", ] -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureThresholdsThresholds(BaseModel): +class FeaturesAPIShieldOperationFeatureThresholdsThresholds(BaseModel): auth_id_tokens: Optional[int] = None """The total number of auth-ids seen across this calculation.""" @@ -58,13 +57,11 @@ class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureThresholds """The suggested threshold in requests done by the same auth_id or period_seconds.""" -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureThresholds(BaseModel): - thresholds: Optional[OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureThresholdsThresholds] = None +class FeaturesAPIShieldOperationFeatureThresholds(BaseModel): + thresholds: Optional[FeaturesAPIShieldOperationFeatureThresholdsThresholds] = None -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas( - BaseModel -): +class FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas(BaseModel): parameters: Optional[List[object]] = None """An array containing the learned parameter schemas.""" @@ -75,32 +72,32 @@ class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureParameterS """ -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas(BaseModel): +class FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas(BaseModel): last_updated: Optional[datetime] = None - parameter_schemas: Optional[ - OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas - ] = None + parameter_schemas: Optional[FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemasParameterSchemas] = ( + None + ) """An operation schema object containing a response.""" -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemas(BaseModel): - parameter_schemas: OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas +class FeaturesAPIShieldOperationFeatureParameterSchemas(BaseModel): + parameter_schemas: FeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting(BaseModel): +class FeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting(BaseModel): last_updated: Optional[datetime] = None route: Optional[str] = None """Target route.""" -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureAPIRouting(BaseModel): - api_routing: Optional[OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting] = None +class FeaturesAPIShieldOperationFeatureAPIRouting(BaseModel): + api_routing: Optional[FeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting] = None """API Routing settings on endpoint.""" -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90( +class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90( BaseModel ): lower: Optional[float] = None @@ -110,7 +107,7 @@ class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidence """Upper bound for percentile estimate""" -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95( +class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95( BaseModel ): lower: Optional[float] = None @@ -120,7 +117,7 @@ class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidence """Upper bound for percentile estimate""" -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99( +class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99( BaseModel ): lower: Optional[float] = None @@ -130,51 +127,47 @@ class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidence """Upper bound for percentile estimate""" -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals( +class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals( BaseModel ): p90: Optional[ - OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90 + FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP90 ] = None """Upper and lower bound for percentile estimate""" p95: Optional[ - OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95 + FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP95 ] = None """Upper and lower bound for percentile estimate""" p99: Optional[ - OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99 + FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervalsP99 ] = None """Upper and lower bound for percentile estimate""" -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold( - BaseModel -): +class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold(BaseModel): confidence_intervals: Optional[ - OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals + FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThresholdConfidenceIntervals ] = None mean: Optional[float] = None """Suggested threshold.""" -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals(BaseModel): +class FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals(BaseModel): last_updated: Optional[datetime] = None suggested_threshold: Optional[ - OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold + FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervalsSuggestedThreshold ] = None -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervals(BaseModel): - confidence_intervals: Optional[ - OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals - ] = None +class FeaturesAPIShieldOperationFeatureConfidenceIntervals(BaseModel): + confidence_intervals: Optional[FeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals] = None -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema(BaseModel): +class FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema(BaseModel): id: Optional[str] = None """UUID""" @@ -187,10 +180,8 @@ class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfo """Schema file name.""" -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo(BaseModel): - active_schema: Optional[ - OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema - ] = None +class FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo(BaseModel): + active_schema: Optional[FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema] = None """Schema active on endpoint.""" learned_available: Optional[bool] = None @@ -200,20 +191,20 @@ class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfo """Action taken on requests failing validation.""" -class OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfo(BaseModel): - schema_info: Optional[OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo] = None +class FeaturesAPIShieldOperationFeatureSchemaInfo(BaseModel): + schema_info: Optional[FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo] = None -OperationBulkCreateResponseItemFeatures: TypeAlias = Union[ - OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureThresholds, - OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureParameterSchemas, - OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureAPIRouting, - OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureConfidenceIntervals, - OperationBulkCreateResponseItemFeaturesAPIShieldOperationFeatureSchemaInfo, +Features: TypeAlias = Union[ + FeaturesAPIShieldOperationFeatureThresholds, + FeaturesAPIShieldOperationFeatureParameterSchemas, + FeaturesAPIShieldOperationFeatureAPIRouting, + FeaturesAPIShieldOperationFeatureConfidenceIntervals, + FeaturesAPIShieldOperationFeatureSchemaInfo, ] -class OperationBulkCreateResponseItem(BaseModel): +class OperationBulkCreateResponse(BaseModel): endpoint: str """ The endpoint which can contain path parameter templates in curly braces, each @@ -233,7 +224,4 @@ class OperationBulkCreateResponseItem(BaseModel): operation_id: str """UUID""" - features: Optional[OperationBulkCreateResponseItemFeatures] = None - - -OperationBulkCreateResponse: TypeAlias = List[OperationBulkCreateResponseItem] + features: Optional[Features] = None diff --git a/src/cloudflare/types/cloud_connector/rule_update_response.py b/src/cloudflare/types/cloud_connector/rule_update_response.py index 84392f2b6c3..2830970723a 100644 --- a/src/cloudflare/types/cloud_connector/rule_update_response.py +++ b/src/cloudflare/types/cloud_connector/rule_update_response.py @@ -1,19 +1,19 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional -from typing_extensions import Literal, TypeAlias +from typing import Optional +from typing_extensions import Literal from ..._models import BaseModel -__all__ = ["RuleUpdateResponse", "RuleUpdateResponseItem", "RuleUpdateResponseItemParameters"] +__all__ = ["RuleUpdateResponse", "Parameters"] -class RuleUpdateResponseItemParameters(BaseModel): +class Parameters(BaseModel): host: Optional[str] = None """Host to perform Cloud Connection to""" -class RuleUpdateResponseItem(BaseModel): +class RuleUpdateResponse(BaseModel): id: Optional[str] = None description: Optional[str] = None @@ -22,11 +22,8 @@ class RuleUpdateResponseItem(BaseModel): expression: Optional[str] = None - parameters: Optional[RuleUpdateResponseItemParameters] = None + parameters: Optional[Parameters] = None """Parameters of Cloud Connector Rule""" provider: Optional[Literal["aws_s3", "r2", "gcp_storage", "azure_storage"]] = None """Cloud Provider type""" - - -RuleUpdateResponse: TypeAlias = List[RuleUpdateResponseItem] diff --git a/src/cloudflare/types/cloudforce_one/__init__.py b/src/cloudflare/types/cloudforce_one/__init__.py index f069202d49b..4b1e4f5c1e4 100644 --- a/src/cloudflare/types/cloudforce_one/__init__.py +++ b/src/cloudflare/types/cloudforce_one/__init__.py @@ -10,4 +10,5 @@ from .request_list_params import RequestListParams as RequestListParams from .request_create_params import RequestCreateParams as RequestCreateParams from .request_update_params import RequestUpdateParams as RequestUpdateParams +from .request_types_response import RequestTypesResponse as RequestTypesResponse from .request_delete_response import RequestDeleteResponse as RequestDeleteResponse diff --git a/src/cloudflare/types/cloudforce_one/request_types.py b/src/cloudflare/types/cloudforce_one/request_types.py index 9f263ba6f4f..7393af0e69d 100644 --- a/src/cloudflare/types/cloudforce_one/request_types.py +++ b/src/cloudflare/types/cloudforce_one/request_types.py @@ -3,6 +3,8 @@ from typing import List from typing_extensions import TypeAlias +from .request_types_response import RequestTypesResponse + __all__ = ["RequestTypes"] -RequestTypes: TypeAlias = List[str] +RequestTypes: TypeAlias = List[RequestTypesResponse] diff --git a/src/cloudflare/types/magic_transit/sites/lan_create_response.py b/src/cloudflare/types/cloudforce_one/request_types_response.py similarity index 52% rename from src/cloudflare/types/magic_transit/sites/lan_create_response.py rename to src/cloudflare/types/cloudforce_one/request_types_response.py index cc90dc2a1e7..4be6a1748c5 100644 --- a/src/cloudflare/types/magic_transit/sites/lan_create_response.py +++ b/src/cloudflare/types/cloudforce_one/request_types_response.py @@ -1,10 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List from typing_extensions import TypeAlias -from .lan import LAN +__all__ = ["RequestTypesResponse"] -__all__ = ["LANCreateResponse"] - -LANCreateResponse: TypeAlias = List[LAN] +RequestTypesResponse: TypeAlias = str diff --git a/src/cloudflare/types/cloudforce_one/requests/__init__.py b/src/cloudflare/types/cloudforce_one/requests/__init__.py index ff4d1f16380..f5da4d3a21a 100644 --- a/src/cloudflare/types/cloudforce_one/requests/__init__.py +++ b/src/cloudflare/types/cloudforce_one/requests/__init__.py @@ -9,7 +9,6 @@ from .message_get_params import MessageGetParams as MessageGetParams from .asset_create_params import AssetCreateParams as AssetCreateParams from .asset_update_params import AssetUpdateParams as AssetUpdateParams -from .message_get_response import MessageGetResponse as MessageGetResponse from .asset_create_response import AssetCreateResponse as AssetCreateResponse from .asset_delete_response import AssetDeleteResponse as AssetDeleteResponse from .asset_update_response import AssetUpdateResponse as AssetUpdateResponse diff --git a/src/cloudflare/types/cloudforce_one/requests/asset_create_response.py b/src/cloudflare/types/cloudforce_one/requests/asset_create_response.py index c72dd9ea5fb..f35b8548866 100644 --- a/src/cloudflare/types/cloudforce_one/requests/asset_create_response.py +++ b/src/cloudflare/types/cloudforce_one/requests/asset_create_response.py @@ -1,15 +1,14 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Optional from datetime import datetime -from typing_extensions import TypeAlias from ...._models import BaseModel -__all__ = ["AssetCreateResponse", "AssetCreateResponseItem"] +__all__ = ["AssetCreateResponse"] -class AssetCreateResponseItem(BaseModel): +class AssetCreateResponse(BaseModel): id: int """Asset ID""" @@ -24,6 +23,3 @@ class AssetCreateResponseItem(BaseModel): file_type: Optional[str] = None """Asset file type""" - - -AssetCreateResponse: TypeAlias = List[AssetCreateResponseItem] diff --git a/src/cloudflare/types/cloudforce_one/requests/asset_get_response.py b/src/cloudflare/types/cloudforce_one/requests/asset_get_response.py index afc2465418d..6a7e7f66b9a 100644 --- a/src/cloudflare/types/cloudforce_one/requests/asset_get_response.py +++ b/src/cloudflare/types/cloudforce_one/requests/asset_get_response.py @@ -1,15 +1,14 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Optional from datetime import datetime -from typing_extensions import TypeAlias from ...._models import BaseModel -__all__ = ["AssetGetResponse", "AssetGetResponseItem"] +__all__ = ["AssetGetResponse"] -class AssetGetResponseItem(BaseModel): +class AssetGetResponse(BaseModel): id: int """Asset ID""" @@ -24,6 +23,3 @@ class AssetGetResponseItem(BaseModel): file_type: Optional[str] = None """Asset file type""" - - -AssetGetResponse: TypeAlias = List[AssetGetResponseItem] diff --git a/src/cloudflare/types/cloudforce_one/requests/message_get_response.py b/src/cloudflare/types/cloudforce_one/requests/message_get_response.py deleted file mode 100644 index 459cc869242..00000000000 --- a/src/cloudflare/types/cloudforce_one/requests/message_get_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .message import Message - -__all__ = ["MessageGetResponse"] - -MessageGetResponse: TypeAlias = List[Message] diff --git a/src/cloudflare/types/content_scanning/payload_create_response.py b/src/cloudflare/types/content_scanning/payload_create_response.py index 0faff0519e3..6cff7ddd70f 100644 --- a/src/cloudflare/types/content_scanning/payload_create_response.py +++ b/src/cloudflare/types/content_scanning/payload_create_response.py @@ -1,19 +1,15 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional -from typing_extensions import TypeAlias +from typing import Optional from ..._models import BaseModel -__all__ = ["PayloadCreateResponse", "PayloadCreateResponseItem"] +__all__ = ["PayloadCreateResponse"] -class PayloadCreateResponseItem(BaseModel): +class PayloadCreateResponse(BaseModel): id: Optional[str] = None """The unique ID for this custom scan expression""" payload: Optional[str] = None """Ruleset expression to use in matching content objects""" - - -PayloadCreateResponse: TypeAlias = List[PayloadCreateResponseItem] diff --git a/src/cloudflare/types/content_scanning/payload_delete_response.py b/src/cloudflare/types/content_scanning/payload_delete_response.py index f2e40df9962..3025a37b0ca 100644 --- a/src/cloudflare/types/content_scanning/payload_delete_response.py +++ b/src/cloudflare/types/content_scanning/payload_delete_response.py @@ -1,19 +1,15 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional -from typing_extensions import TypeAlias +from typing import Optional from ..._models import BaseModel -__all__ = ["PayloadDeleteResponse", "PayloadDeleteResponseItem"] +__all__ = ["PayloadDeleteResponse"] -class PayloadDeleteResponseItem(BaseModel): +class PayloadDeleteResponse(BaseModel): id: Optional[str] = None """The unique ID for this custom scan expression""" payload: Optional[str] = None """Ruleset expression to use in matching content objects""" - - -PayloadDeleteResponse: TypeAlias = List[PayloadDeleteResponseItem] diff --git a/src/cloudflare/types/custom_certificates/__init__.py b/src/cloudflare/types/custom_certificates/__init__.py index f42fb8b3733..0c22e5de0ca 100644 --- a/src/cloudflare/types/custom_certificates/__init__.py +++ b/src/cloudflare/types/custom_certificates/__init__.py @@ -7,7 +7,6 @@ from .custom_certificate import CustomCertificate as CustomCertificate from .geo_restrictions_param import GeoRestrictionsParam as GeoRestrictionsParam from .prioritize_update_params import PrioritizeUpdateParams as PrioritizeUpdateParams -from .prioritize_update_response import PrioritizeUpdateResponse as PrioritizeUpdateResponse from .custom_certificate_edit_params import CustomCertificateEditParams as CustomCertificateEditParams from .custom_certificate_list_params import CustomCertificateListParams as CustomCertificateListParams from .custom_certificate_create_params import CustomCertificateCreateParams as CustomCertificateCreateParams diff --git a/src/cloudflare/types/custom_certificates/prioritize_update_response.py b/src/cloudflare/types/custom_certificates/prioritize_update_response.py deleted file mode 100644 index eb3bff03f56..00000000000 --- a/src/cloudflare/types/custom_certificates/prioritize_update_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .custom_certificate import CustomCertificate - -__all__ = ["PrioritizeUpdateResponse"] - -PrioritizeUpdateResponse: TypeAlias = List[CustomCertificate] diff --git a/src/cloudflare/types/custom_nameservers/__init__.py b/src/cloudflare/types/custom_nameservers/__init__.py index a67351a5bcd..bf39d0d8ff1 100644 --- a/src/cloudflare/types/custom_nameservers/__init__.py +++ b/src/cloudflare/types/custom_nameservers/__init__.py @@ -3,7 +3,6 @@ from __future__ import annotations from .custom_nameserver import CustomNameserver as CustomNameserver -from .custom_nameserver_get_response import CustomNameserverGetResponse as CustomNameserverGetResponse from .custom_nameserver_create_params import CustomNameserverCreateParams as CustomNameserverCreateParams from .custom_nameserver_delete_response import CustomNameserverDeleteResponse as CustomNameserverDeleteResponse from .custom_nameserver_availabilty_response import ( diff --git a/src/cloudflare/types/custom_nameservers/custom_nameserver_availabilty_response.py b/src/cloudflare/types/custom_nameservers/custom_nameserver_availabilty_response.py index 0a6492bcf39..9077d181a34 100644 --- a/src/cloudflare/types/custom_nameservers/custom_nameserver_availabilty_response.py +++ b/src/cloudflare/types/custom_nameservers/custom_nameserver_availabilty_response.py @@ -1,8 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List from typing_extensions import TypeAlias __all__ = ["CustomNameserverAvailabiltyResponse"] -CustomNameserverAvailabiltyResponse: TypeAlias = List[str] +CustomNameserverAvailabiltyResponse: TypeAlias = str diff --git a/src/cloudflare/types/custom_nameservers/custom_nameserver_delete_response.py b/src/cloudflare/types/custom_nameservers/custom_nameserver_delete_response.py index 21442aa30ca..b49cbce768f 100644 --- a/src/cloudflare/types/custom_nameservers/custom_nameserver_delete_response.py +++ b/src/cloudflare/types/custom_nameservers/custom_nameserver_delete_response.py @@ -1,8 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List from typing_extensions import TypeAlias __all__ = ["CustomNameserverDeleteResponse"] -CustomNameserverDeleteResponse: TypeAlias = List[str] +CustomNameserverDeleteResponse: TypeAlias = str diff --git a/src/cloudflare/types/custom_nameservers/custom_nameserver_get_response.py b/src/cloudflare/types/custom_nameservers/custom_nameserver_get_response.py deleted file mode 100644 index 55b31de5e23..00000000000 --- a/src/cloudflare/types/custom_nameservers/custom_nameserver_get_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .custom_nameserver import CustomNameserver - -__all__ = ["CustomNameserverGetResponse"] - -CustomNameserverGetResponse: TypeAlias = List[CustomNameserver] diff --git a/src/cloudflare/types/d1/__init__.py b/src/cloudflare/types/d1/__init__.py index 6a9610c1a5f..1be6b62a22a 100644 --- a/src/cloudflare/types/d1/__init__.py +++ b/src/cloudflare/types/d1/__init__.py @@ -12,6 +12,5 @@ from .database_export_params import DatabaseExportParams as DatabaseExportParams from .database_import_params import DatabaseImportParams as DatabaseImportParams from .database_list_response import DatabaseListResponse as DatabaseListResponse -from .database_query_response import DatabaseQueryResponse as DatabaseQueryResponse from .database_export_response import DatabaseExportResponse as DatabaseExportResponse from .database_import_response import DatabaseImportResponse as DatabaseImportResponse diff --git a/src/cloudflare/types/d1/database_query_response.py b/src/cloudflare/types/d1/database_query_response.py deleted file mode 100644 index 12764eb1d1c..00000000000 --- a/src/cloudflare/types/d1/database_query_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .query_result import QueryResult - -__all__ = ["DatabaseQueryResponse"] - -DatabaseQueryResponse: TypeAlias = List[QueryResult] diff --git a/src/cloudflare/types/d1/database_raw_response.py b/src/cloudflare/types/d1/database_raw_response.py index e24eb35bd6b..dd12b973636 100644 --- a/src/cloudflare/types/d1/database_raw_response.py +++ b/src/cloudflare/types/d1/database_raw_response.py @@ -1,19 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Union, Optional -from typing_extensions import TypeAlias from ..._models import BaseModel -__all__ = [ - "DatabaseRawResponse", - "DatabaseRawResponseItem", - "DatabaseRawResponseItemMeta", - "DatabaseRawResponseItemResults", -] +__all__ = ["DatabaseRawResponse", "Meta", "Results"] -class DatabaseRawResponseItemMeta(BaseModel): +class Meta(BaseModel): changed_db: Optional[bool] = None changes: Optional[float] = None @@ -29,18 +23,15 @@ class DatabaseRawResponseItemMeta(BaseModel): size_after: Optional[float] = None -class DatabaseRawResponseItemResults(BaseModel): +class Results(BaseModel): columns: Optional[List[str]] = None rows: Optional[List[List[Union[float, str, object]]]] = None -class DatabaseRawResponseItem(BaseModel): - meta: Optional[DatabaseRawResponseItemMeta] = None +class DatabaseRawResponse(BaseModel): + meta: Optional[Meta] = None - results: Optional[DatabaseRawResponseItemResults] = None + results: Optional[Results] = None success: Optional[bool] = None - - -DatabaseRawResponse: TypeAlias = List[DatabaseRawResponseItem] diff --git a/src/cloudflare/types/diagnostics/__init__.py b/src/cloudflare/types/diagnostics/__init__.py index 94d7a66c1ee..8dafb1b2780 100644 --- a/src/cloudflare/types/diagnostics/__init__.py +++ b/src/cloudflare/types/diagnostics/__init__.py @@ -4,4 +4,3 @@ from .traceroute import Traceroute as Traceroute from .traceroute_create_params import TracerouteCreateParams as TracerouteCreateParams -from .traceroute_create_response import TracerouteCreateResponse as TracerouteCreateResponse diff --git a/src/cloudflare/types/diagnostics/traceroute_create_response.py b/src/cloudflare/types/diagnostics/traceroute_create_response.py deleted file mode 100644 index efb17af608d..00000000000 --- a/src/cloudflare/types/diagnostics/traceroute_create_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .traceroute import Traceroute - -__all__ = ["TracerouteCreateResponse"] - -TracerouteCreateResponse: TypeAlias = List[Traceroute] diff --git a/src/cloudflare/types/email_routing/__init__.py b/src/cloudflare/types/email_routing/__init__.py index b030f7c32de..553bab1e508 100644 --- a/src/cloudflare/types/email_routing/__init__.py +++ b/src/cloudflare/types/email_routing/__init__.py @@ -18,7 +18,6 @@ from .rule_create_params import RuleCreateParams as RuleCreateParams from .rule_update_params import RuleUpdateParams as RuleUpdateParams from .address_list_params import AddressListParams as AddressListParams -from .dns_delete_response import DNSDeleteResponse as DNSDeleteResponse from .address_create_params import AddressCreateParams as AddressCreateParams from .email_routing_enable_params import EmailRoutingEnableParams as EmailRoutingEnableParams from .email_routing_disable_params import EmailRoutingDisableParams as EmailRoutingDisableParams diff --git a/src/cloudflare/types/email_routing/dns_delete_response.py b/src/cloudflare/types/email_routing/dns_delete_response.py deleted file mode 100644 index 637a0e9c068..00000000000 --- a/src/cloudflare/types/email_routing/dns_delete_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import Literal, TypeAlias - -from ..._models import BaseModel -from .dns_record import DNSRecord -from ..shared.response_info import ResponseInfo - -__all__ = [ - "DNSDeleteResponse", - "EmailAPIResponseCommon", - "EmailDNSSettingsResponseCollection", - "EmailDNSSettingsResponseCollectionResultInfo", -] - - -class EmailAPIResponseCommon(BaseModel): - errors: List[ResponseInfo] - - messages: List[ResponseInfo] - - success: Literal[True] - """Whether the API call was successful""" - - -class EmailDNSSettingsResponseCollectionResultInfo(BaseModel): - count: Optional[float] = None - """Total number of results for the requested service""" - - page: Optional[float] = None - """Current page within paginated list of results""" - - per_page: Optional[float] = None - """Number of results per page of results""" - - total_count: Optional[float] = None - """Total results available without any search parameters""" - - -class EmailDNSSettingsResponseCollection(BaseModel): - errors: List[ResponseInfo] - - messages: List[ResponseInfo] - - success: Literal[True] - """Whether the API call was successful""" - - result: Optional[List[DNSRecord]] = None - - result_info: Optional[EmailDNSSettingsResponseCollectionResultInfo] = None - - -DNSDeleteResponse: TypeAlias = Union[EmailAPIResponseCommon, EmailDNSSettingsResponseCollection] diff --git a/src/cloudflare/types/email_security/investigate/move_bulk_response.py b/src/cloudflare/types/email_security/investigate/move_bulk_response.py index 8e626a9f881..ea093f060f1 100644 --- a/src/cloudflare/types/email_security/investigate/move_bulk_response.py +++ b/src/cloudflare/types/email_security/investigate/move_bulk_response.py @@ -1,15 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List from datetime import datetime -from typing_extensions import TypeAlias from ...._models import BaseModel -__all__ = ["MoveBulkResponse", "MoveBulkResponseItem"] +__all__ = ["MoveBulkResponse"] -class MoveBulkResponseItem(BaseModel): +class MoveBulkResponse(BaseModel): completed_timestamp: datetime destination: str @@ -23,6 +21,3 @@ class MoveBulkResponseItem(BaseModel): recipient: str status: str - - -MoveBulkResponse: TypeAlias = List[MoveBulkResponseItem] diff --git a/src/cloudflare/types/email_security/investigate/move_create_response.py b/src/cloudflare/types/email_security/investigate/move_create_response.py index 02a887bf9b8..c8509acc388 100644 --- a/src/cloudflare/types/email_security/investigate/move_create_response.py +++ b/src/cloudflare/types/email_security/investigate/move_create_response.py @@ -1,15 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List from datetime import datetime -from typing_extensions import TypeAlias from ...._models import BaseModel -__all__ = ["MoveCreateResponse", "MoveCreateResponseItem"] +__all__ = ["MoveCreateResponse"] -class MoveCreateResponseItem(BaseModel): +class MoveCreateResponse(BaseModel): completed_timestamp: datetime destination: str @@ -23,6 +21,3 @@ class MoveCreateResponseItem(BaseModel): recipient: str status: str - - -MoveCreateResponse: TypeAlias = List[MoveCreateResponseItem] diff --git a/src/cloudflare/types/email_security/investigate/release_bulk_response.py b/src/cloudflare/types/email_security/investigate/release_bulk_response.py index 75b93ca69cc..88b25069708 100644 --- a/src/cloudflare/types/email_security/investigate/release_bulk_response.py +++ b/src/cloudflare/types/email_security/investigate/release_bulk_response.py @@ -1,14 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Optional -from typing_extensions import TypeAlias from ...._models import BaseModel -__all__ = ["ReleaseBulkResponse", "ReleaseBulkResponseItem"] +__all__ = ["ReleaseBulkResponse"] -class ReleaseBulkResponseItem(BaseModel): +class ReleaseBulkResponse(BaseModel): postfix_id: str """The identifier of the message.""" @@ -17,6 +16,3 @@ class ReleaseBulkResponseItem(BaseModel): failed: Optional[List[str]] = None undelivered: Optional[List[str]] = None - - -ReleaseBulkResponse: TypeAlias = List[ReleaseBulkResponseItem] diff --git a/src/cloudflare/types/email_security/settings/domain_bulk_delete_response.py b/src/cloudflare/types/email_security/settings/domain_bulk_delete_response.py index bf90cf2a6ed..60c83fbb617 100644 --- a/src/cloudflare/types/email_security/settings/domain_bulk_delete_response.py +++ b/src/cloudflare/types/email_security/settings/domain_bulk_delete_response.py @@ -1,16 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List -from typing_extensions import TypeAlias from ...._models import BaseModel -__all__ = ["DomainBulkDeleteResponse", "DomainBulkDeleteResponseItem"] +__all__ = ["DomainBulkDeleteResponse"] -class DomainBulkDeleteResponseItem(BaseModel): +class DomainBulkDeleteResponse(BaseModel): id: int """The unique identifier for the domain.""" - - -DomainBulkDeleteResponse: TypeAlias = List[DomainBulkDeleteResponseItem] diff --git a/src/cloudflare/types/filters/__init__.py b/src/cloudflare/types/filters/__init__.py index be5345ef460..12616a57a56 100644 --- a/src/cloudflare/types/filters/__init__.py +++ b/src/cloudflare/types/filters/__init__.py @@ -7,6 +7,3 @@ from .filter_create_params import FilterCreateParams as FilterCreateParams from .filter_update_params import FilterUpdateParams as FilterUpdateParams from .firewall_filter_param import FirewallFilterParam as FirewallFilterParam -from .filter_create_response import FilterCreateResponse as FilterCreateResponse -from .filter_bulk_delete_response import FilterBulkDeleteResponse as FilterBulkDeleteResponse -from .filter_bulk_update_response import FilterBulkUpdateResponse as FilterBulkUpdateResponse diff --git a/src/cloudflare/types/filters/filter_bulk_delete_response.py b/src/cloudflare/types/filters/filter_bulk_delete_response.py deleted file mode 100644 index 7a37b1b4cbd..00000000000 --- a/src/cloudflare/types/filters/filter_bulk_delete_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .firewall_filter import FirewallFilter - -__all__ = ["FilterBulkDeleteResponse"] - -FilterBulkDeleteResponse: TypeAlias = List[FirewallFilter] diff --git a/src/cloudflare/types/filters/filter_bulk_update_response.py b/src/cloudflare/types/filters/filter_bulk_update_response.py deleted file mode 100644 index 48059fa12a6..00000000000 --- a/src/cloudflare/types/filters/filter_bulk_update_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .firewall_filter import FirewallFilter - -__all__ = ["FilterBulkUpdateResponse"] - -FilterBulkUpdateResponse: TypeAlias = List[FirewallFilter] diff --git a/src/cloudflare/types/filters/filter_create_response.py b/src/cloudflare/types/filters/filter_create_response.py deleted file mode 100644 index 1c979aae822..00000000000 --- a/src/cloudflare/types/filters/filter_create_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .firewall_filter import FirewallFilter - -__all__ = ["FilterCreateResponse"] - -FilterCreateResponse: TypeAlias = List[FirewallFilter] diff --git a/src/cloudflare/types/firewall/__init__.py b/src/cloudflare/types/firewall/__init__.py index 0b12a89c62b..63d1a171785 100644 --- a/src/cloudflare/types/firewall/__init__.py +++ b/src/cloudflare/types/firewall/__init__.py @@ -13,12 +13,10 @@ from .asn_configuration import ASNConfiguration as ASNConfiguration from .ipv6_configuration import IPV6Configuration as IPV6Configuration from .rule_create_params import RuleCreateParams as RuleCreateParams -from .rule_edit_response import RuleEditResponse as RuleEditResponse from .rule_update_params import RuleUpdateParams as RuleUpdateParams from .configuration_param import ConfigurationParam as ConfigurationParam from .ua_rule_list_params import UARuleListParams as UARuleListParams from .lockdown_list_params import LockdownListParams as LockdownListParams -from .rule_create_response import RuleCreateResponse as RuleCreateResponse from .ua_rule_get_response import UARuleGetResponse as UARuleGetResponse from .country_configuration import CountryConfiguration as CountryConfiguration from .rule_bulk_edit_params import RuleBulkEditParams as RuleBulkEditParams @@ -30,7 +28,6 @@ from .access_rule_edit_params import AccessRuleEditParams as AccessRuleEditParams from .access_rule_list_params import AccessRuleListParams as AccessRuleListParams from .asn_configuration_param import ASNConfigurationParam as ASNConfigurationParam -from .rule_bulk_edit_response import RuleBulkEditResponse as RuleBulkEditResponse from .rule_bulk_update_params import RuleBulkUpdateParams as RuleBulkUpdateParams from .ua_rule_create_response import UARuleCreateResponse as UARuleCreateResponse from .ua_rule_delete_response import UARuleDeleteResponse as UARuleDeleteResponse @@ -42,8 +39,6 @@ from .access_rule_edit_response import AccessRuleEditResponse as AccessRuleEditResponse from .access_rule_list_response import AccessRuleListResponse as AccessRuleListResponse from .lockdown_ip_configuration import LockdownIPConfiguration as LockdownIPConfiguration -from .rule_bulk_delete_response import RuleBulkDeleteResponse as RuleBulkDeleteResponse -from .rule_bulk_update_response import RuleBulkUpdateResponse as RuleBulkUpdateResponse from .access_rule_create_response import AccessRuleCreateResponse as AccessRuleCreateResponse from .access_rule_delete_response import AccessRuleDeleteResponse as AccessRuleDeleteResponse from .country_configuration_param import CountryConfigurationParam as CountryConfigurationParam diff --git a/src/cloudflare/types/firewall/rule_bulk_delete_response.py b/src/cloudflare/types/firewall/rule_bulk_delete_response.py deleted file mode 100644 index 535192b8afb..00000000000 --- a/src/cloudflare/types/firewall/rule_bulk_delete_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .firewall_rule import FirewallRule - -__all__ = ["RuleBulkDeleteResponse"] - -RuleBulkDeleteResponse: TypeAlias = List[FirewallRule] diff --git a/src/cloudflare/types/firewall/rule_bulk_edit_response.py b/src/cloudflare/types/firewall/rule_bulk_edit_response.py deleted file mode 100644 index f6d4fdaf7f2..00000000000 --- a/src/cloudflare/types/firewall/rule_bulk_edit_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .firewall_rule import FirewallRule - -__all__ = ["RuleBulkEditResponse"] - -RuleBulkEditResponse: TypeAlias = List[FirewallRule] diff --git a/src/cloudflare/types/firewall/rule_bulk_update_response.py b/src/cloudflare/types/firewall/rule_bulk_update_response.py deleted file mode 100644 index d8bacf8ab0e..00000000000 --- a/src/cloudflare/types/firewall/rule_bulk_update_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .firewall_rule import FirewallRule - -__all__ = ["RuleBulkUpdateResponse"] - -RuleBulkUpdateResponse: TypeAlias = List[FirewallRule] diff --git a/src/cloudflare/types/firewall/rule_create_response.py b/src/cloudflare/types/firewall/rule_create_response.py deleted file mode 100644 index 78ca0455e97..00000000000 --- a/src/cloudflare/types/firewall/rule_create_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .firewall_rule import FirewallRule - -__all__ = ["RuleCreateResponse"] - -RuleCreateResponse: TypeAlias = List[FirewallRule] diff --git a/src/cloudflare/types/firewall/rule_edit_response.py b/src/cloudflare/types/firewall/rule_edit_response.py deleted file mode 100644 index 078cb92e0e8..00000000000 --- a/src/cloudflare/types/firewall/rule_edit_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .firewall_rule import FirewallRule - -__all__ = ["RuleEditResponse"] - -RuleEditResponse: TypeAlias = List[FirewallRule] diff --git a/src/cloudflare/types/hostnames/settings/tls_get_response.py b/src/cloudflare/types/hostnames/settings/tls_get_response.py index e194ca02893..5afefb3f047 100644 --- a/src/cloudflare/types/hostnames/settings/tls_get_response.py +++ b/src/cloudflare/types/hostnames/settings/tls_get_response.py @@ -1,16 +1,15 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Optional from datetime import datetime -from typing_extensions import TypeAlias from ...._models import BaseModel from .setting_value import SettingValue -__all__ = ["TLSGetResponse", "TLSGetResponseItem"] +__all__ = ["TLSGetResponse"] -class TLSGetResponseItem(BaseModel): +class TLSGetResponse(BaseModel): created_at: Optional[datetime] = None """This is the time the tls setting was originally created for this hostname.""" @@ -25,6 +24,3 @@ class TLSGetResponseItem(BaseModel): value: Optional[SettingValue] = None """The tls setting value.""" - - -TLSGetResponse: TypeAlias = List[TLSGetResponseItem] diff --git a/src/cloudflare/types/intel/__init__.py b/src/cloudflare/types/intel/__init__.py index e3237030bbe..0e1b222bd5a 100644 --- a/src/cloudflare/types/intel/__init__.py +++ b/src/cloudflare/types/intel/__init__.py @@ -14,7 +14,6 @@ from .whois_get_params import WhoisGetParams as WhoisGetParams from .domain_get_params import DomainGetParams as DomainGetParams from .whois_get_response import WhoisGetResponse as WhoisGetResponse -from .ip_list_get_response import IPListGetResponse as IPListGetResponse from .domain_history_get_params import DomainHistoryGetParams as DomainHistoryGetParams from .domain_history_get_response import DomainHistoryGetResponse as DomainHistoryGetResponse from .indicator_feed_get_response import IndicatorFeedGetResponse as IndicatorFeedGetResponse diff --git a/src/cloudflare/types/intel/attack_surface_report/issue_type_get_response.py b/src/cloudflare/types/intel/attack_surface_report/issue_type_get_response.py index 488c3c114d8..06ab82a0706 100644 --- a/src/cloudflare/types/intel/attack_surface_report/issue_type_get_response.py +++ b/src/cloudflare/types/intel/attack_surface_report/issue_type_get_response.py @@ -1,8 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List from typing_extensions import TypeAlias __all__ = ["IssueTypeGetResponse"] -IssueTypeGetResponse: TypeAlias = List[str] +IssueTypeGetResponse: TypeAlias = str diff --git a/src/cloudflare/types/intel/ip_list_get_response.py b/src/cloudflare/types/intel/ip_list_get_response.py deleted file mode 100644 index 7a71d07c01c..00000000000 --- a/src/cloudflare/types/intel/ip_list_get_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .ip_list import IPList - -__all__ = ["IPListGetResponse"] - -IPListGetResponse: TypeAlias = List[IPList] diff --git a/src/cloudflare/types/load_balancers/__init__.py b/src/cloudflare/types/load_balancers/__init__.py index c6035687d61..5caf860663d 100644 --- a/src/cloudflare/types/load_balancers/__init__.py +++ b/src/cloudflare/types/load_balancers/__init__.py @@ -45,7 +45,6 @@ from .adaptive_routing_param import AdaptiveRoutingParam as AdaptiveRoutingParam from .location_strategy_param import LocationStrategyParam as LocationStrategyParam from .monitor_delete_response import MonitorDeleteResponse as MonitorDeleteResponse -from .pool_bulk_edit_response import PoolBulkEditResponse as PoolBulkEditResponse from .load_balancer_edit_params import LoadBalancerEditParams as LoadBalancerEditParams from .notification_filter_param import NotificationFilterParam as NotificationFilterParam from .load_balancer_create_params import LoadBalancerCreateParams as LoadBalancerCreateParams diff --git a/src/cloudflare/types/load_balancers/monitors/reference_get_response.py b/src/cloudflare/types/load_balancers/monitors/reference_get_response.py index 56dab55e125..91f6725f1c8 100644 --- a/src/cloudflare/types/load_balancers/monitors/reference_get_response.py +++ b/src/cloudflare/types/load_balancers/monitors/reference_get_response.py @@ -1,14 +1,14 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional -from typing_extensions import Literal, TypeAlias +from typing import Optional +from typing_extensions import Literal from ...._models import BaseModel -__all__ = ["ReferenceGetResponse", "ReferenceGetResponseItem"] +__all__ = ["ReferenceGetResponse"] -class ReferenceGetResponseItem(BaseModel): +class ReferenceGetResponse(BaseModel): reference_type: Optional[Literal["*", "referral", "referrer"]] = None resource_id: Optional[str] = None @@ -16,6 +16,3 @@ class ReferenceGetResponseItem(BaseModel): resource_name: Optional[str] = None resource_type: Optional[str] = None - - -ReferenceGetResponse: TypeAlias = List[ReferenceGetResponseItem] diff --git a/src/cloudflare/types/load_balancers/pool_bulk_edit_response.py b/src/cloudflare/types/load_balancers/pool_bulk_edit_response.py deleted file mode 100644 index 068a163bed5..00000000000 --- a/src/cloudflare/types/load_balancers/pool_bulk_edit_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .pool import Pool - -__all__ = ["PoolBulkEditResponse"] - -PoolBulkEditResponse: TypeAlias = List[Pool] diff --git a/src/cloudflare/types/load_balancers/pools/reference_get_response.py b/src/cloudflare/types/load_balancers/pools/reference_get_response.py index 56dab55e125..91f6725f1c8 100644 --- a/src/cloudflare/types/load_balancers/pools/reference_get_response.py +++ b/src/cloudflare/types/load_balancers/pools/reference_get_response.py @@ -1,14 +1,14 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional -from typing_extensions import Literal, TypeAlias +from typing import Optional +from typing_extensions import Literal from ...._models import BaseModel -__all__ = ["ReferenceGetResponse", "ReferenceGetResponseItem"] +__all__ = ["ReferenceGetResponse"] -class ReferenceGetResponseItem(BaseModel): +class ReferenceGetResponse(BaseModel): reference_type: Optional[Literal["*", "referral", "referrer"]] = None resource_id: Optional[str] = None @@ -16,6 +16,3 @@ class ReferenceGetResponseItem(BaseModel): resource_name: Optional[str] = None resource_type: Optional[str] = None - - -ReferenceGetResponse: TypeAlias = List[ReferenceGetResponseItem] diff --git a/src/cloudflare/types/logpush/__init__.py b/src/cloudflare/types/logpush/__init__.py index 8ae5b0ec652..f47e5fbcf8b 100644 --- a/src/cloudflare/types/logpush/__init__.py +++ b/src/cloudflare/types/logpush/__init__.py @@ -4,7 +4,6 @@ from .logpush_job import LogpushJob as LogpushJob from .output_options import OutputOptions as OutputOptions -from .edge_get_response import EdgeGetResponse as EdgeGetResponse from .job_create_params import JobCreateParams as JobCreateParams from .job_update_params import JobUpdateParams as JobUpdateParams from .edge_create_params import EdgeCreateParams as EdgeCreateParams diff --git a/src/cloudflare/types/logpush/datasets/__init__.py b/src/cloudflare/types/logpush/datasets/__init__.py index 8c60dd28797..f8ee8b14b1c 100644 --- a/src/cloudflare/types/logpush/datasets/__init__.py +++ b/src/cloudflare/types/logpush/datasets/__init__.py @@ -1,5 +1,3 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from __future__ import annotations - -from .job_get_response import JobGetResponse as JobGetResponse diff --git a/src/cloudflare/types/logpush/datasets/job_get_response.py b/src/cloudflare/types/logpush/datasets/job_get_response.py deleted file mode 100644 index d1aaccc5990..00000000000 --- a/src/cloudflare/types/logpush/datasets/job_get_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from typing_extensions import TypeAlias - -from ..logpush_job import LogpushJob - -__all__ = ["JobGetResponse"] - -JobGetResponse: TypeAlias = List[Optional[LogpushJob]] diff --git a/src/cloudflare/types/logpush/edge_get_response.py b/src/cloudflare/types/logpush/edge_get_response.py deleted file mode 100644 index fc0b45aa55b..00000000000 --- a/src/cloudflare/types/logpush/edge_get_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from typing_extensions import TypeAlias - -from .instant_logpush_job import InstantLogpushJob - -__all__ = ["EdgeGetResponse"] - -EdgeGetResponse: TypeAlias = List[Optional[InstantLogpushJob]] diff --git a/src/cloudflare/types/magic_transit/pcaps/__init__.py b/src/cloudflare/types/magic_transit/pcaps/__init__.py index 48f330a9b1a..baebb9439a6 100644 --- a/src/cloudflare/types/magic_transit/pcaps/__init__.py +++ b/src/cloudflare/types/magic_transit/pcaps/__init__.py @@ -3,6 +3,5 @@ from __future__ import annotations from .ownership import Ownership as Ownership -from .ownership_get_response import OwnershipGetResponse as OwnershipGetResponse from .ownership_create_params import OwnershipCreateParams as OwnershipCreateParams from .ownership_validate_params import OwnershipValidateParams as OwnershipValidateParams diff --git a/src/cloudflare/types/magic_transit/pcaps/ownership_get_response.py b/src/cloudflare/types/magic_transit/pcaps/ownership_get_response.py deleted file mode 100644 index d4b576046e6..00000000000 --- a/src/cloudflare/types/magic_transit/pcaps/ownership_get_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .ownership import Ownership - -__all__ = ["OwnershipGetResponse"] - -OwnershipGetResponse: TypeAlias = List[Ownership] diff --git a/src/cloudflare/types/magic_transit/sites/__init__.py b/src/cloudflare/types/magic_transit/sites/__init__.py index eb134db7d52..cdf0ff32712 100644 --- a/src/cloudflare/types/magic_transit/sites/__init__.py +++ b/src/cloudflare/types/magic_transit/sites/__init__.py @@ -24,9 +24,7 @@ from .lan_update_params import LANUpdateParams as LANUpdateParams from .wan_create_params import WANCreateParams as WANCreateParams from .wan_update_params import WANUpdateParams as WANUpdateParams -from .lan_create_response import LANCreateResponse as LANCreateResponse from .routed_subnet_param import RoutedSubnetParam as RoutedSubnetParam -from .wan_create_response import WANCreateResponse as WANCreateResponse from .lan_static_addressing import LANStaticAddressing as LANStaticAddressing from .wan_static_addressing import WANStaticAddressing as WANStaticAddressing from .acl_configuration_param import ACLConfigurationParam as ACLConfigurationParam diff --git a/src/cloudflare/types/magic_transit/sites/wan_create_response.py b/src/cloudflare/types/magic_transit/sites/wan_create_response.py deleted file mode 100644 index 37b582d7c1a..00000000000 --- a/src/cloudflare/types/magic_transit/sites/wan_create_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .wan import WAN - -__all__ = ["WANCreateResponse"] - -WANCreateResponse: TypeAlias = List[WAN] diff --git a/src/cloudflare/types/mtls_certificates/__init__.py b/src/cloudflare/types/mtls_certificates/__init__.py index e7b6588986e..d44f658f608 100644 --- a/src/cloudflare/types/mtls_certificates/__init__.py +++ b/src/cloudflare/types/mtls_certificates/__init__.py @@ -3,7 +3,6 @@ from __future__ import annotations from .mtls_certificate import MTLSCertificate as MTLSCertificate -from .association_get_response import AssociationGetResponse as AssociationGetResponse from .certificate_asssociation import CertificateAsssociation as CertificateAsssociation from .mtls_certificate_create_params import MTLSCertificateCreateParams as MTLSCertificateCreateParams from .mtls_certificate_create_response import MTLSCertificateCreateResponse as MTLSCertificateCreateResponse diff --git a/src/cloudflare/types/mtls_certificates/association_get_response.py b/src/cloudflare/types/mtls_certificates/association_get_response.py deleted file mode 100644 index e2ef7249f7a..00000000000 --- a/src/cloudflare/types/mtls_certificates/association_get_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .certificate_asssociation import CertificateAsssociation - -__all__ = ["AssociationGetResponse"] - -AssociationGetResponse: TypeAlias = List[CertificateAsssociation] diff --git a/src/cloudflare/types/origin_tls_client_auth/hostname_update_response.py b/src/cloudflare/types/origin_tls_client_auth/hostname_update_response.py index 5c708a48cbc..e910dc30fa2 100644 --- a/src/cloudflare/types/origin_tls_client_auth/hostname_update_response.py +++ b/src/cloudflare/types/origin_tls_client_auth/hostname_update_response.py @@ -1,14 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional -from typing_extensions import TypeAlias +from typing import Optional from .authenticated_origin_pull import AuthenticatedOriginPull -__all__ = ["HostnameUpdateResponse", "HostnameUpdateResponseItem"] +__all__ = ["HostnameUpdateResponse"] -class HostnameUpdateResponseItem(AuthenticatedOriginPull): +class HostnameUpdateResponse(AuthenticatedOriginPull): id: Optional[str] = None """Identifier""" @@ -32,6 +31,3 @@ class HostnameUpdateResponseItem(AuthenticatedOriginPull): private_key: Optional[str] = None """The hostname certificate's private key.""" - - -HostnameUpdateResponse: TypeAlias = List[HostnameUpdateResponseItem] diff --git a/src/cloudflare/types/queues/__init__.py b/src/cloudflare/types/queues/__init__.py index 5a2df213bd2..f7d869e72ae 100644 --- a/src/cloudflare/types/queues/__init__.py +++ b/src/cloudflare/types/queues/__init__.py @@ -9,7 +9,6 @@ from .queue_create_params import QueueCreateParams as QueueCreateParams from .queue_update_params import QueueUpdateParams as QueueUpdateParams from .message_ack_response import MessageAckResponse as MessageAckResponse -from .consumer_get_response import ConsumerGetResponse as ConsumerGetResponse from .message_pull_response import MessagePullResponse as MessagePullResponse from .queue_delete_response import QueueDeleteResponse as QueueDeleteResponse from .consumer_create_params import ConsumerCreateParams as ConsumerCreateParams diff --git a/src/cloudflare/types/queues/consumer_get_response.py b/src/cloudflare/types/queues/consumer_get_response.py deleted file mode 100644 index 5d513b81d56..00000000000 --- a/src/cloudflare/types/queues/consumer_get_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .consumer import Consumer - -__all__ = ["ConsumerGetResponse"] - -ConsumerGetResponse: TypeAlias = List[Consumer] diff --git a/src/cloudflare/types/queues/message_pull_response.py b/src/cloudflare/types/queues/message_pull_response.py index 39c56cebb19..bbbed2be267 100644 --- a/src/cloudflare/types/queues/message_pull_response.py +++ b/src/cloudflare/types/queues/message_pull_response.py @@ -1,14 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional -from typing_extensions import TypeAlias +from typing import Optional from ..._models import BaseModel -__all__ = ["MessagePullResponse", "MessagePullResponseItem"] +__all__ = ["MessagePullResponse"] -class MessagePullResponseItem(BaseModel): +class MessagePullResponse(BaseModel): id: Optional[str] = None attempts: Optional[float] = None @@ -24,6 +23,3 @@ class MessagePullResponseItem(BaseModel): metadata: Optional[object] = None timestamp_ms: Optional[float] = None - - -MessagePullResponse: TypeAlias = List[MessagePullResponseItem] diff --git a/src/cloudflare/types/snippets/rule_update_response.py b/src/cloudflare/types/snippets/rule_update_response.py index 3b4070d8484..29121fa03ab 100644 --- a/src/cloudflare/types/snippets/rule_update_response.py +++ b/src/cloudflare/types/snippets/rule_update_response.py @@ -1,14 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional -from typing_extensions import TypeAlias +from typing import Optional from ..._models import BaseModel -__all__ = ["RuleUpdateResponse", "RuleUpdateResponseItem"] +__all__ = ["RuleUpdateResponse"] -class RuleUpdateResponseItem(BaseModel): +class RuleUpdateResponse(BaseModel): description: Optional[str] = None enabled: Optional[bool] = None @@ -17,6 +16,3 @@ class RuleUpdateResponseItem(BaseModel): snippet_name: Optional[str] = None """Snippet identifying name""" - - -RuleUpdateResponse: TypeAlias = List[RuleUpdateResponseItem] diff --git a/src/cloudflare/types/stream/__init__.py b/src/cloudflare/types/stream/__init__.py index 271513be432..3cbf4f64afa 100644 --- a/src/cloudflare/types/stream/__init__.py +++ b/src/cloudflare/types/stream/__init__.py @@ -19,7 +19,6 @@ from .stream_list_params import StreamListParams as StreamListParams from .key_delete_response import KeyDeleteResponse as KeyDeleteResponse from .token_create_params import TokenCreateParams as TokenCreateParams -from .caption_get_response import CaptionGetResponse as CaptionGetResponse from .stream_create_params import StreamCreateParams as StreamCreateParams from .token_create_response import TokenCreateResponse as TokenCreateResponse from .webhook_update_params import WebhookUpdateParams as WebhookUpdateParams @@ -29,7 +28,6 @@ from .audio_track_edit_params import AudioTrackEditParams as AudioTrackEditParams from .watermark_create_params import WatermarkCreateParams as WatermarkCreateParams from .webhook_delete_response import WebhookDeleteResponse as WebhookDeleteResponse -from .audio_track_get_response import AudioTrackGetResponse as AudioTrackGetResponse from .download_delete_response import DownloadDeleteResponse as DownloadDeleteResponse from .live_input_create_params import LiveInputCreateParams as LiveInputCreateParams from .live_input_list_response import LiveInputListResponse as LiveInputListResponse diff --git a/src/cloudflare/types/stream/audio_track_get_response.py b/src/cloudflare/types/stream/audio_track_get_response.py deleted file mode 100644 index b76edca8338..00000000000 --- a/src/cloudflare/types/stream/audio_track_get_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .audio import Audio - -__all__ = ["AudioTrackGetResponse"] - -AudioTrackGetResponse: TypeAlias = List[Audio] diff --git a/src/cloudflare/types/stream/caption_get_response.py b/src/cloudflare/types/stream/caption_get_response.py deleted file mode 100644 index e2f4f8b7dc6..00000000000 --- a/src/cloudflare/types/stream/caption_get_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .caption import Caption - -__all__ = ["CaptionGetResponse"] - -CaptionGetResponse: TypeAlias = List[Caption] diff --git a/src/cloudflare/types/stream/key_get_response.py b/src/cloudflare/types/stream/key_get_response.py index e417aca71c3..b74f60bf4a3 100644 --- a/src/cloudflare/types/stream/key_get_response.py +++ b/src/cloudflare/types/stream/key_get_response.py @@ -1,20 +1,16 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Optional from datetime import datetime -from typing_extensions import TypeAlias from ..._models import BaseModel -__all__ = ["KeyGetResponse", "KeyGetResponseItem"] +__all__ = ["KeyGetResponse"] -class KeyGetResponseItem(BaseModel): +class KeyGetResponse(BaseModel): id: Optional[str] = None """Identifier""" created: Optional[datetime] = None """The date and time a signing key was created.""" - - -KeyGetResponse: TypeAlias = List[KeyGetResponseItem] diff --git a/src/cloudflare/types/user/__init__.py b/src/cloudflare/types/user/__init__.py index a410c5594bd..e6436d4c2fb 100644 --- a/src/cloudflare/types/user/__init__.py +++ b/src/cloudflare/types/user/__init__.py @@ -14,7 +14,6 @@ from .token_delete_response import TokenDeleteResponse as TokenDeleteResponse from .token_verify_response import TokenVerifyResponse as TokenVerifyResponse from .organization_list_params import OrganizationListParams as OrganizationListParams -from .subscription_get_response import SubscriptionGetResponse as SubscriptionGetResponse from .subscription_update_params import SubscriptionUpdateParams as SubscriptionUpdateParams from .organization_delete_response import OrganizationDeleteResponse as OrganizationDeleteResponse from .subscription_delete_response import SubscriptionDeleteResponse as SubscriptionDeleteResponse diff --git a/src/cloudflare/types/user/subscription_get_response.py b/src/cloudflare/types/user/subscription_get_response.py deleted file mode 100644 index e03c90ba181..00000000000 --- a/src/cloudflare/types/user/subscription_get_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from ..shared.subscription import Subscription - -__all__ = ["SubscriptionGetResponse"] - -SubscriptionGetResponse: TypeAlias = List[Subscription] diff --git a/src/cloudflare/types/waiting_rooms/__init__.py b/src/cloudflare/types/waiting_rooms/__init__.py index f26368ae4ef..63ac8eb3b82 100644 --- a/src/cloudflare/types/waiting_rooms/__init__.py +++ b/src/cloudflare/types/waiting_rooms/__init__.py @@ -9,19 +9,14 @@ from .cookie_attributes import CookieAttributes as CookieAttributes from .event_edit_params import EventEditParams as EventEditParams from .event_list_params import EventListParams as EventListParams -from .rule_get_response import RuleGetResponse as RuleGetResponse from .waiting_room_rule import WaitingRoomRule as WaitingRoomRule from .rule_create_params import RuleCreateParams as RuleCreateParams -from .rule_edit_response import RuleEditResponse as RuleEditResponse from .rule_update_params import RuleUpdateParams as RuleUpdateParams from .event_create_params import EventCreateParams as EventCreateParams from .event_update_params import EventUpdateParams as EventUpdateParams from .page_preview_params import PagePreviewParams as PagePreviewParams from .setting_edit_params import SettingEditParams as SettingEditParams from .status_get_response import StatusGetResponse as StatusGetResponse -from .rule_create_response import RuleCreateResponse as RuleCreateResponse -from .rule_delete_response import RuleDeleteResponse as RuleDeleteResponse -from .rule_update_response import RuleUpdateResponse as RuleUpdateResponse from .setting_get_response import SettingGetResponse as SettingGetResponse from .event_delete_response import EventDeleteResponse as EventDeleteResponse from .page_preview_response import PagePreviewResponse as PagePreviewResponse diff --git a/src/cloudflare/types/waiting_rooms/rule_create_response.py b/src/cloudflare/types/waiting_rooms/rule_create_response.py deleted file mode 100644 index d4f77d64d15..00000000000 --- a/src/cloudflare/types/waiting_rooms/rule_create_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .waiting_room_rule import WaitingRoomRule - -__all__ = ["RuleCreateResponse"] - -RuleCreateResponse: TypeAlias = List[WaitingRoomRule] diff --git a/src/cloudflare/types/waiting_rooms/rule_delete_response.py b/src/cloudflare/types/waiting_rooms/rule_delete_response.py deleted file mode 100644 index b636e6a879e..00000000000 --- a/src/cloudflare/types/waiting_rooms/rule_delete_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .waiting_room_rule import WaitingRoomRule - -__all__ = ["RuleDeleteResponse"] - -RuleDeleteResponse: TypeAlias = List[WaitingRoomRule] diff --git a/src/cloudflare/types/waiting_rooms/rule_edit_response.py b/src/cloudflare/types/waiting_rooms/rule_edit_response.py deleted file mode 100644 index 1667dc9ff2d..00000000000 --- a/src/cloudflare/types/waiting_rooms/rule_edit_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .waiting_room_rule import WaitingRoomRule - -__all__ = ["RuleEditResponse"] - -RuleEditResponse: TypeAlias = List[WaitingRoomRule] diff --git a/src/cloudflare/types/waiting_rooms/rule_get_response.py b/src/cloudflare/types/waiting_rooms/rule_get_response.py deleted file mode 100644 index a92b1a45ca4..00000000000 --- a/src/cloudflare/types/waiting_rooms/rule_get_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .waiting_room_rule import WaitingRoomRule - -__all__ = ["RuleGetResponse"] - -RuleGetResponse: TypeAlias = List[WaitingRoomRule] diff --git a/src/cloudflare/types/waiting_rooms/rule_update_response.py b/src/cloudflare/types/waiting_rooms/rule_update_response.py deleted file mode 100644 index 037b9a7b7c6..00000000000 --- a/src/cloudflare/types/waiting_rooms/rule_update_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .waiting_room_rule import WaitingRoomRule - -__all__ = ["RuleUpdateResponse"] - -RuleUpdateResponse: TypeAlias = List[WaitingRoomRule] diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py index c347a833b16..07fd2d2b27e 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py @@ -9,33 +9,32 @@ __all__ = [ "BindingGetResponse", - "BindingGetResponseItem", - "BindingGetResponseItemWorkersBindingKindAny", - "BindingGetResponseItemWorkersBindingKindAI", - "BindingGetResponseItemWorkersBindingKindAnalyticsEngine", - "BindingGetResponseItemWorkersBindingKindAssets", - "BindingGetResponseItemWorkersBindingKindBrowserRendering", - "BindingGetResponseItemWorkersBindingKindD1", - "BindingGetResponseItemWorkersBindingKindDispatchNamespace", - "BindingGetResponseItemWorkersBindingKindDispatchNamespaceOutbound", - "BindingGetResponseItemWorkersBindingKindDispatchNamespaceOutboundWorker", - "BindingGetResponseItemWorkersBindingKindDo", - "BindingGetResponseItemWorkersBindingKindHyperdrive", - "BindingGetResponseItemWorkersBindingKindJson", - "BindingGetResponseItemWorkersBindingKindKVNamespace", - "BindingGetResponseItemWorkersBindingKindMTLSCERT", - "BindingGetResponseItemWorkersBindingKindPlainText", - "BindingGetResponseItemWorkersBindingKindQueue", - "BindingGetResponseItemWorkersBindingKindR2", - "BindingGetResponseItemWorkersBindingKindSecret", - "BindingGetResponseItemWorkersBindingKindService", - "BindingGetResponseItemWorkersBindingKindTailConsumer", - "BindingGetResponseItemWorkersBindingKindVectorize", - "BindingGetResponseItemWorkersBindingKindVersionMetadata", + "WorkersBindingKindAny", + "WorkersBindingKindAI", + "WorkersBindingKindAnalyticsEngine", + "WorkersBindingKindAssets", + "WorkersBindingKindBrowserRendering", + "WorkersBindingKindD1", + "WorkersBindingKindDispatchNamespace", + "WorkersBindingKindDispatchNamespaceOutbound", + "WorkersBindingKindDispatchNamespaceOutboundWorker", + "WorkersBindingKindDo", + "WorkersBindingKindHyperdrive", + "WorkersBindingKindJson", + "WorkersBindingKindKVNamespace", + "WorkersBindingKindMTLSCERT", + "WorkersBindingKindPlainText", + "WorkersBindingKindQueue", + "WorkersBindingKindR2", + "WorkersBindingKindSecret", + "WorkersBindingKindService", + "WorkersBindingKindTailConsumer", + "WorkersBindingKindVectorize", + "WorkersBindingKindVersionMetadata", ] -class BindingGetResponseItemWorkersBindingKindAny(BaseModel): +class WorkersBindingKindAny(BaseModel): name: str """A JavaScript variable name for the binding.""" @@ -49,7 +48,7 @@ class BindingGetResponseItemWorkersBindingKindAny(BaseModel): def __getattr__(self, attr: str) -> object: ... -class BindingGetResponseItemWorkersBindingKindAI(BaseModel): +class WorkersBindingKindAI(BaseModel): name: str """A JavaScript variable name for the binding.""" @@ -57,7 +56,7 @@ class BindingGetResponseItemWorkersBindingKindAI(BaseModel): """The kind of resource that the binding provides.""" -class BindingGetResponseItemWorkersBindingKindAnalyticsEngine(BaseModel): +class WorkersBindingKindAnalyticsEngine(BaseModel): dataset: str """The dataset name to bind to.""" @@ -68,7 +67,7 @@ class BindingGetResponseItemWorkersBindingKindAnalyticsEngine(BaseModel): """The kind of resource that the binding provides.""" -class BindingGetResponseItemWorkersBindingKindAssets(BaseModel): +class WorkersBindingKindAssets(BaseModel): name: str """A JavaScript variable name for the binding.""" @@ -76,7 +75,7 @@ class BindingGetResponseItemWorkersBindingKindAssets(BaseModel): """The kind of resource that the binding provides.""" -class BindingGetResponseItemWorkersBindingKindBrowserRendering(BaseModel): +class WorkersBindingKindBrowserRendering(BaseModel): name: str """A JavaScript variable name for the binding.""" @@ -84,7 +83,7 @@ class BindingGetResponseItemWorkersBindingKindBrowserRendering(BaseModel): """The kind of resource that the binding provides.""" -class BindingGetResponseItemWorkersBindingKindD1(BaseModel): +class WorkersBindingKindD1(BaseModel): id: str """Identifier of the D1 database to bind to.""" @@ -95,7 +94,7 @@ class BindingGetResponseItemWorkersBindingKindD1(BaseModel): """The kind of resource that the binding provides.""" -class BindingGetResponseItemWorkersBindingKindDispatchNamespaceOutboundWorker(BaseModel): +class WorkersBindingKindDispatchNamespaceOutboundWorker(BaseModel): environment: Optional[str] = None """Environment of the outbound worker.""" @@ -103,18 +102,18 @@ class BindingGetResponseItemWorkersBindingKindDispatchNamespaceOutboundWorker(Ba """Name of the outbound worker.""" -class BindingGetResponseItemWorkersBindingKindDispatchNamespaceOutbound(BaseModel): +class WorkersBindingKindDispatchNamespaceOutbound(BaseModel): params: Optional[List[str]] = None """ Pass information from the Dispatch Worker to the Outbound Worker through the parameters. """ - worker: Optional[BindingGetResponseItemWorkersBindingKindDispatchNamespaceOutboundWorker] = None + worker: Optional[WorkersBindingKindDispatchNamespaceOutboundWorker] = None """Outbound worker.""" -class BindingGetResponseItemWorkersBindingKindDispatchNamespace(BaseModel): +class WorkersBindingKindDispatchNamespace(BaseModel): name: str """A JavaScript variable name for the binding.""" @@ -124,11 +123,11 @@ class BindingGetResponseItemWorkersBindingKindDispatchNamespace(BaseModel): type: Literal["dispatch_namespace"] """The kind of resource that the binding provides.""" - outbound: Optional[BindingGetResponseItemWorkersBindingKindDispatchNamespaceOutbound] = None + outbound: Optional[WorkersBindingKindDispatchNamespaceOutbound] = None """Outbound worker.""" -class BindingGetResponseItemWorkersBindingKindDo(BaseModel): +class WorkersBindingKindDo(BaseModel): class_name: str """The exported class name of the Durable Object.""" @@ -151,7 +150,7 @@ class BindingGetResponseItemWorkersBindingKindDo(BaseModel): """ -class BindingGetResponseItemWorkersBindingKindHyperdrive(BaseModel): +class WorkersBindingKindHyperdrive(BaseModel): id: str """Identifier of the Hyperdrive connection to bind to.""" @@ -162,7 +161,7 @@ class BindingGetResponseItemWorkersBindingKindHyperdrive(BaseModel): """The kind of resource that the binding provides.""" -class BindingGetResponseItemWorkersBindingKindJson(BaseModel): +class WorkersBindingKindJson(BaseModel): json_: str = FieldInfo(alias="json") """JSON data to use.""" @@ -173,7 +172,7 @@ class BindingGetResponseItemWorkersBindingKindJson(BaseModel): """The kind of resource that the binding provides.""" -class BindingGetResponseItemWorkersBindingKindKVNamespace(BaseModel): +class WorkersBindingKindKVNamespace(BaseModel): name: str """A JavaScript variable name for the binding.""" @@ -184,7 +183,7 @@ class BindingGetResponseItemWorkersBindingKindKVNamespace(BaseModel): """The kind of resource that the binding provides.""" -class BindingGetResponseItemWorkersBindingKindMTLSCERT(BaseModel): +class WorkersBindingKindMTLSCERT(BaseModel): certificate_id: str """Identifier of the certificate to bind to.""" @@ -195,7 +194,7 @@ class BindingGetResponseItemWorkersBindingKindMTLSCERT(BaseModel): """The kind of resource that the binding provides.""" -class BindingGetResponseItemWorkersBindingKindPlainText(BaseModel): +class WorkersBindingKindPlainText(BaseModel): name: str """A JavaScript variable name for the binding.""" @@ -206,7 +205,7 @@ class BindingGetResponseItemWorkersBindingKindPlainText(BaseModel): """The kind of resource that the binding provides.""" -class BindingGetResponseItemWorkersBindingKindQueue(BaseModel): +class WorkersBindingKindQueue(BaseModel): name: str """A JavaScript variable name for the binding.""" @@ -217,7 +216,7 @@ class BindingGetResponseItemWorkersBindingKindQueue(BaseModel): """The kind of resource that the binding provides.""" -class BindingGetResponseItemWorkersBindingKindR2(BaseModel): +class WorkersBindingKindR2(BaseModel): bucket_name: str """R2 bucket to bind to.""" @@ -228,7 +227,7 @@ class BindingGetResponseItemWorkersBindingKindR2(BaseModel): """The kind of resource that the binding provides.""" -class BindingGetResponseItemWorkersBindingKindSecret(BaseModel): +class WorkersBindingKindSecret(BaseModel): name: str """A JavaScript variable name for the binding.""" @@ -239,7 +238,7 @@ class BindingGetResponseItemWorkersBindingKindSecret(BaseModel): """The kind of resource that the binding provides.""" -class BindingGetResponseItemWorkersBindingKindService(BaseModel): +class WorkersBindingKindService(BaseModel): environment: str """Optional environment if the Worker utilizes one.""" @@ -253,7 +252,7 @@ class BindingGetResponseItemWorkersBindingKindService(BaseModel): """The kind of resource that the binding provides.""" -class BindingGetResponseItemWorkersBindingKindTailConsumer(BaseModel): +class WorkersBindingKindTailConsumer(BaseModel): name: str """A JavaScript variable name for the binding.""" @@ -264,7 +263,7 @@ class BindingGetResponseItemWorkersBindingKindTailConsumer(BaseModel): """The kind of resource that the binding provides.""" -class BindingGetResponseItemWorkersBindingKindVectorize(BaseModel): +class WorkersBindingKindVectorize(BaseModel): index_name: str """Name of the Vectorize index to bind to.""" @@ -275,7 +274,7 @@ class BindingGetResponseItemWorkersBindingKindVectorize(BaseModel): """The kind of resource that the binding provides.""" -class BindingGetResponseItemWorkersBindingKindVersionMetadata(BaseModel): +class WorkersBindingKindVersionMetadata(BaseModel): name: str """A JavaScript variable name for the binding.""" @@ -283,27 +282,25 @@ class BindingGetResponseItemWorkersBindingKindVersionMetadata(BaseModel): """The kind of resource that the binding provides.""" -BindingGetResponseItem: TypeAlias = Union[ - BindingGetResponseItemWorkersBindingKindAny, - BindingGetResponseItemWorkersBindingKindAI, - BindingGetResponseItemWorkersBindingKindAnalyticsEngine, - BindingGetResponseItemWorkersBindingKindAssets, - BindingGetResponseItemWorkersBindingKindBrowserRendering, - BindingGetResponseItemWorkersBindingKindD1, - BindingGetResponseItemWorkersBindingKindDispatchNamespace, - BindingGetResponseItemWorkersBindingKindDo, - BindingGetResponseItemWorkersBindingKindHyperdrive, - BindingGetResponseItemWorkersBindingKindJson, - BindingGetResponseItemWorkersBindingKindKVNamespace, - BindingGetResponseItemWorkersBindingKindMTLSCERT, - BindingGetResponseItemWorkersBindingKindPlainText, - BindingGetResponseItemWorkersBindingKindQueue, - BindingGetResponseItemWorkersBindingKindR2, - BindingGetResponseItemWorkersBindingKindSecret, - BindingGetResponseItemWorkersBindingKindService, - BindingGetResponseItemWorkersBindingKindTailConsumer, - BindingGetResponseItemWorkersBindingKindVectorize, - BindingGetResponseItemWorkersBindingKindVersionMetadata, +BindingGetResponse: TypeAlias = Union[ + WorkersBindingKindAny, + WorkersBindingKindAI, + WorkersBindingKindAnalyticsEngine, + WorkersBindingKindAssets, + WorkersBindingKindBrowserRendering, + WorkersBindingKindD1, + WorkersBindingKindDispatchNamespace, + WorkersBindingKindDo, + WorkersBindingKindHyperdrive, + WorkersBindingKindJson, + WorkersBindingKindKVNamespace, + WorkersBindingKindMTLSCERT, + WorkersBindingKindPlainText, + WorkersBindingKindQueue, + WorkersBindingKindR2, + WorkersBindingKindSecret, + WorkersBindingKindService, + WorkersBindingKindTailConsumer, + WorkersBindingKindVectorize, + WorkersBindingKindVersionMetadata, ] - -BindingGetResponse: TypeAlias = List[BindingGetResponseItem] diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/tag_update_response.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/tag_update_response.py index 66c916b4112..4f80d1ed6da 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/tag_update_response.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/tag_update_response.py @@ -1,8 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List from typing_extensions import TypeAlias __all__ = ["TagUpdateResponse"] -TagUpdateResponse: TypeAlias = List[str] +TagUpdateResponse: TypeAlias = str diff --git a/src/cloudflare/types/zero_trust/__init__.py b/src/cloudflare/types/zero_trust/__init__.py index bde15a386b8..28b23b2cbfa 100644 --- a/src/cloudflare/types/zero_trust/__init__.py +++ b/src/cloudflare/types/zero_trust/__init__.py @@ -13,7 +13,6 @@ from .seat_edit_params import SeatEditParams as SeatEditParams from .identity_provider import IdentityProvider as IdentityProvider from .login_design_param import LoginDesignParam as LoginDesignParam -from .seat_edit_response import SeatEditResponse as SeatEditResponse from .tunnel_edit_params import TunnelEditParams as TunnelEditParams from .tunnel_list_params import TunnelListParams as TunnelListParams from .device_get_response import DeviceGetResponse as DeviceGetResponse diff --git a/src/cloudflare/types/zero_trust/access/certificates/__init__.py b/src/cloudflare/types/zero_trust/access/certificates/__init__.py index 2a8e492f5d5..d4cff2b0193 100644 --- a/src/cloudflare/types/zero_trust/access/certificates/__init__.py +++ b/src/cloudflare/types/zero_trust/access/certificates/__init__.py @@ -3,7 +3,5 @@ from __future__ import annotations from .certificate_settings import CertificateSettings as CertificateSettings -from .setting_get_response import SettingGetResponse as SettingGetResponse from .setting_update_params import SettingUpdateParams as SettingUpdateParams -from .setting_update_response import SettingUpdateResponse as SettingUpdateResponse from .certificate_settings_param import CertificateSettingsParam as CertificateSettingsParam diff --git a/src/cloudflare/types/zero_trust/access/certificates/setting_get_response.py b/src/cloudflare/types/zero_trust/access/certificates/setting_get_response.py deleted file mode 100644 index 43fcfdc5cc8..00000000000 --- a/src/cloudflare/types/zero_trust/access/certificates/setting_get_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .certificate_settings import CertificateSettings - -__all__ = ["SettingGetResponse"] - -SettingGetResponse: TypeAlias = List[CertificateSettings] diff --git a/src/cloudflare/types/zero_trust/access/certificates/setting_update_response.py b/src/cloudflare/types/zero_trust/access/certificates/setting_update_response.py deleted file mode 100644 index 1c3e2637fd9..00000000000 --- a/src/cloudflare/types/zero_trust/access/certificates/setting_update_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .certificate_settings import CertificateSettings - -__all__ = ["SettingUpdateResponse"] - -SettingUpdateResponse: TypeAlias = List[CertificateSettings] diff --git a/src/cloudflare/types/zero_trust/devices/__init__.py b/src/cloudflare/types/zero_trust/devices/__init__.py index 37d71da7a5e..c9108dded9d 100644 --- a/src/cloudflare/types/zero_trust/devices/__init__.py +++ b/src/cloudflare/types/zero_trust/devices/__init__.py @@ -50,7 +50,6 @@ from .unrevoke_create_params import UnrevokeCreateParams as UnrevokeCreateParams from .crowdstrike_input_param import CrowdstrikeInputParam as CrowdstrikeInputParam from .fleet_status_get_params import FleetStatusGetParams as FleetStatusGetParams -from .network_delete_response import NetworkDeleteResponse as NetworkDeleteResponse from .posture_delete_response import PostureDeleteResponse as PostureDeleteResponse from .sentinelone_input_param import SentineloneInputParam as SentineloneInputParam from .client_certificate_input import ClientCertificateInput as ClientCertificateInput diff --git a/src/cloudflare/types/zero_trust/devices/network_delete_response.py b/src/cloudflare/types/zero_trust/devices/network_delete_response.py deleted file mode 100644 index a17d11769f6..00000000000 --- a/src/cloudflare/types/zero_trust/devices/network_delete_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .device_network import DeviceNetwork - -__all__ = ["NetworkDeleteResponse"] - -NetworkDeleteResponse: TypeAlias = List[DeviceNetwork] diff --git a/src/cloudflare/types/zero_trust/devices/policies/__init__.py b/src/cloudflare/types/zero_trust/devices/policies/__init__.py index 7fd6acb2f1f..28f05f45e3d 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/__init__.py +++ b/src/cloudflare/types/zero_trust/devices/policies/__init__.py @@ -7,4 +7,3 @@ from .custom_create_params import CustomCreateParams as CustomCreateParams from .default_get_response import DefaultGetResponse as DefaultGetResponse from .default_edit_response import DefaultEditResponse as DefaultEditResponse -from .custom_delete_response import CustomDeleteResponse as CustomDeleteResponse diff --git a/src/cloudflare/types/zero_trust/devices/policies/custom/__init__.py b/src/cloudflare/types/zero_trust/devices/policies/custom/__init__.py index cb8c3df70ca..1b194e18048 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/custom/__init__.py +++ b/src/cloudflare/types/zero_trust/devices/policies/custom/__init__.py @@ -2,12 +2,6 @@ from __future__ import annotations -from .exclude_get_response import ExcludeGetResponse as ExcludeGetResponse -from .include_get_response import IncludeGetResponse as IncludeGetResponse from .exclude_update_params import ExcludeUpdateParams as ExcludeUpdateParams from .include_update_params import IncludeUpdateParams as IncludeUpdateParams -from .exclude_update_response import ExcludeUpdateResponse as ExcludeUpdateResponse -from .include_update_response import IncludeUpdateResponse as IncludeUpdateResponse -from .fallback_domain_get_response import FallbackDomainGetResponse as FallbackDomainGetResponse from .fallback_domain_update_params import FallbackDomainUpdateParams as FallbackDomainUpdateParams -from .fallback_domain_update_response import FallbackDomainUpdateResponse as FallbackDomainUpdateResponse diff --git a/src/cloudflare/types/zero_trust/devices/policies/custom/exclude_get_response.py b/src/cloudflare/types/zero_trust/devices/policies/custom/exclude_get_response.py deleted file mode 100644 index 58d2e0f96e4..00000000000 --- a/src/cloudflare/types/zero_trust/devices/policies/custom/exclude_get_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from ...split_tunnel_exclude import SplitTunnelExclude - -__all__ = ["ExcludeGetResponse"] - -ExcludeGetResponse: TypeAlias = List[SplitTunnelExclude] diff --git a/src/cloudflare/types/zero_trust/devices/policies/custom/exclude_update_response.py b/src/cloudflare/types/zero_trust/devices/policies/custom/exclude_update_response.py deleted file mode 100644 index bfafca3ec0a..00000000000 --- a/src/cloudflare/types/zero_trust/devices/policies/custom/exclude_update_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from ...split_tunnel_exclude import SplitTunnelExclude - -__all__ = ["ExcludeUpdateResponse"] - -ExcludeUpdateResponse: TypeAlias = List[SplitTunnelExclude] diff --git a/src/cloudflare/types/zero_trust/devices/policies/custom/fallback_domain_get_response.py b/src/cloudflare/types/zero_trust/devices/policies/custom/fallback_domain_get_response.py deleted file mode 100644 index f5dee1a6e13..00000000000 --- a/src/cloudflare/types/zero_trust/devices/policies/custom/fallback_domain_get_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from ...fallback_domain import FallbackDomain - -__all__ = ["FallbackDomainGetResponse"] - -FallbackDomainGetResponse: TypeAlias = List[FallbackDomain] diff --git a/src/cloudflare/types/zero_trust/devices/policies/custom/fallback_domain_update_response.py b/src/cloudflare/types/zero_trust/devices/policies/custom/fallback_domain_update_response.py deleted file mode 100644 index a32c7889b93..00000000000 --- a/src/cloudflare/types/zero_trust/devices/policies/custom/fallback_domain_update_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from ...fallback_domain import FallbackDomain - -__all__ = ["FallbackDomainUpdateResponse"] - -FallbackDomainUpdateResponse: TypeAlias = List[FallbackDomain] diff --git a/src/cloudflare/types/zero_trust/devices/policies/custom/include_get_response.py b/src/cloudflare/types/zero_trust/devices/policies/custom/include_get_response.py deleted file mode 100644 index 9c4138141b9..00000000000 --- a/src/cloudflare/types/zero_trust/devices/policies/custom/include_get_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from ...split_tunnel_include import SplitTunnelInclude - -__all__ = ["IncludeGetResponse"] - -IncludeGetResponse: TypeAlias = List[SplitTunnelInclude] diff --git a/src/cloudflare/types/zero_trust/devices/policies/custom/include_update_response.py b/src/cloudflare/types/zero_trust/devices/policies/custom/include_update_response.py deleted file mode 100644 index 3b3a07a81c1..00000000000 --- a/src/cloudflare/types/zero_trust/devices/policies/custom/include_update_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from ...split_tunnel_include import SplitTunnelInclude - -__all__ = ["IncludeUpdateResponse"] - -IncludeUpdateResponse: TypeAlias = List[SplitTunnelInclude] diff --git a/src/cloudflare/types/zero_trust/devices/policies/custom_delete_response.py b/src/cloudflare/types/zero_trust/devices/policies/custom_delete_response.py deleted file mode 100644 index ac479c997ed..00000000000 --- a/src/cloudflare/types/zero_trust/devices/policies/custom_delete_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from ..settings_policy import SettingsPolicy - -__all__ = ["CustomDeleteResponse"] - -CustomDeleteResponse: TypeAlias = List[SettingsPolicy] diff --git a/src/cloudflare/types/zero_trust/devices/policies/default/__init__.py b/src/cloudflare/types/zero_trust/devices/policies/default/__init__.py index 02bf1198370..7d2b20f1375 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/default/__init__.py +++ b/src/cloudflare/types/zero_trust/devices/policies/default/__init__.py @@ -2,15 +2,9 @@ from __future__ import annotations -from .exclude_get_response import ExcludeGetResponse as ExcludeGetResponse -from .include_get_response import IncludeGetResponse as IncludeGetResponse from .exclude_update_params import ExcludeUpdateParams as ExcludeUpdateParams from .include_update_params import IncludeUpdateParams as IncludeUpdateParams from .certificate_edit_params import CertificateEditParams as CertificateEditParams -from .exclude_update_response import ExcludeUpdateResponse as ExcludeUpdateResponse -from .include_update_response import IncludeUpdateResponse as IncludeUpdateResponse from .certificate_get_response import CertificateGetResponse as CertificateGetResponse from .certificate_edit_response import CertificateEditResponse as CertificateEditResponse -from .fallback_domain_get_response import FallbackDomainGetResponse as FallbackDomainGetResponse from .fallback_domain_update_params import FallbackDomainUpdateParams as FallbackDomainUpdateParams -from .fallback_domain_update_response import FallbackDomainUpdateResponse as FallbackDomainUpdateResponse diff --git a/src/cloudflare/types/zero_trust/devices/policies/default/exclude_get_response.py b/src/cloudflare/types/zero_trust/devices/policies/default/exclude_get_response.py deleted file mode 100644 index 58d2e0f96e4..00000000000 --- a/src/cloudflare/types/zero_trust/devices/policies/default/exclude_get_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from ...split_tunnel_exclude import SplitTunnelExclude - -__all__ = ["ExcludeGetResponse"] - -ExcludeGetResponse: TypeAlias = List[SplitTunnelExclude] diff --git a/src/cloudflare/types/zero_trust/devices/policies/default/exclude_update_response.py b/src/cloudflare/types/zero_trust/devices/policies/default/exclude_update_response.py deleted file mode 100644 index bfafca3ec0a..00000000000 --- a/src/cloudflare/types/zero_trust/devices/policies/default/exclude_update_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from ...split_tunnel_exclude import SplitTunnelExclude - -__all__ = ["ExcludeUpdateResponse"] - -ExcludeUpdateResponse: TypeAlias = List[SplitTunnelExclude] diff --git a/src/cloudflare/types/zero_trust/devices/policies/default/fallback_domain_get_response.py b/src/cloudflare/types/zero_trust/devices/policies/default/fallback_domain_get_response.py deleted file mode 100644 index f5dee1a6e13..00000000000 --- a/src/cloudflare/types/zero_trust/devices/policies/default/fallback_domain_get_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from ...fallback_domain import FallbackDomain - -__all__ = ["FallbackDomainGetResponse"] - -FallbackDomainGetResponse: TypeAlias = List[FallbackDomain] diff --git a/src/cloudflare/types/zero_trust/devices/policies/default/fallback_domain_update_response.py b/src/cloudflare/types/zero_trust/devices/policies/default/fallback_domain_update_response.py deleted file mode 100644 index a32c7889b93..00000000000 --- a/src/cloudflare/types/zero_trust/devices/policies/default/fallback_domain_update_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from ...fallback_domain import FallbackDomain - -__all__ = ["FallbackDomainUpdateResponse"] - -FallbackDomainUpdateResponse: TypeAlias = List[FallbackDomain] diff --git a/src/cloudflare/types/zero_trust/devices/policies/default/include_get_response.py b/src/cloudflare/types/zero_trust/devices/policies/default/include_get_response.py deleted file mode 100644 index 9c4138141b9..00000000000 --- a/src/cloudflare/types/zero_trust/devices/policies/default/include_get_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from ...split_tunnel_include import SplitTunnelInclude - -__all__ = ["IncludeGetResponse"] - -IncludeGetResponse: TypeAlias = List[SplitTunnelInclude] diff --git a/src/cloudflare/types/zero_trust/devices/policies/default/include_update_response.py b/src/cloudflare/types/zero_trust/devices/policies/default/include_update_response.py deleted file mode 100644 index 3b3a07a81c1..00000000000 --- a/src/cloudflare/types/zero_trust/devices/policies/default/include_update_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from ...split_tunnel_include import SplitTunnelInclude - -__all__ = ["IncludeUpdateResponse"] - -IncludeUpdateResponse: TypeAlias = List[SplitTunnelInclude] diff --git a/src/cloudflare/types/zero_trust/dlp/datasets/version_create_response.py b/src/cloudflare/types/zero_trust/dlp/datasets/version_create_response.py index d1980a52ad8..53ae57aad51 100755 --- a/src/cloudflare/types/zero_trust/dlp/datasets/version_create_response.py +++ b/src/cloudflare/types/zero_trust/dlp/datasets/version_create_response.py @@ -1,14 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal from ....._models import BaseModel -__all__ = ["VersionCreateResponse", "VersionCreateResponseItem"] +__all__ = ["VersionCreateResponse"] -class VersionCreateResponseItem(BaseModel): +class VersionCreateResponse(BaseModel): entry_id: str header_name: str @@ -16,6 +15,3 @@ class VersionCreateResponseItem(BaseModel): num_cells: int upload_status: Literal["empty", "uploading", "processing", "failed", "complete"] - - -VersionCreateResponse: TypeAlias = List[VersionCreateResponseItem] diff --git a/src/cloudflare/types/zero_trust/gateway/__init__.py b/src/cloudflare/types/zero_trust/gateway/__init__.py index 0be90d484e7..3493d5e0603 100644 --- a/src/cloudflare/types/zero_trust/gateway/__init__.py +++ b/src/cloudflare/types/zero_trust/gateway/__init__.py @@ -73,7 +73,6 @@ from .configuration_update_params import ConfigurationUpdateParams as ConfigurationUpdateParams from .custom_certificate_settings import CustomCertificateSettings as CustomCertificateSettings from .notification_settings_param import NotificationSettingsParam as NotificationSettingsParam -from .proxy_endpoint_get_response import ProxyEndpointGetResponse as ProxyEndpointGetResponse from .body_scanning_settings_param import BodyScanningSettingsParam as BodyScanningSettingsParam from .proxy_endpoint_create_params import ProxyEndpointCreateParams as ProxyEndpointCreateParams from .certificate_activate_response import CertificateActivateResponse as CertificateActivateResponse diff --git a/src/cloudflare/types/zero_trust/gateway/proxy_endpoint_get_response.py b/src/cloudflare/types/zero_trust/gateway/proxy_endpoint_get_response.py deleted file mode 100644 index 0f6670e8534..00000000000 --- a/src/cloudflare/types/zero_trust/gateway/proxy_endpoint_get_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .proxy_endpoint import ProxyEndpoint - -__all__ = ["ProxyEndpointGetResponse"] - -ProxyEndpointGetResponse: TypeAlias = List[ProxyEndpoint] diff --git a/src/cloudflare/types/zero_trust/seat_edit_response.py b/src/cloudflare/types/zero_trust/seat_edit_response.py deleted file mode 100644 index 9989455c52d..00000000000 --- a/src/cloudflare/types/zero_trust/seat_edit_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .seat import Seat - -__all__ = ["SeatEditResponse"] - -SeatEditResponse: TypeAlias = List[Seat] diff --git a/src/cloudflare/types/zero_trust/tunnels/__init__.py b/src/cloudflare/types/zero_trust/tunnels/__init__.py index 76a2a77db15..c5677bc50a7 100644 --- a/src/cloudflare/types/zero_trust/tunnels/__init__.py +++ b/src/cloudflare/types/zero_trust/tunnels/__init__.py @@ -4,7 +4,6 @@ from .client import Client as Client from .token_get_response import TokenGetResponse as TokenGetResponse -from .connection_get_response import ConnectionGetResponse as ConnectionGetResponse from .connection_delete_params import ConnectionDeleteParams as ConnectionDeleteParams from .management_create_params import ManagementCreateParams as ManagementCreateParams from .configuration_get_response import ConfigurationGetResponse as ConfigurationGetResponse diff --git a/src/cloudflare/types/zero_trust/tunnels/connection_get_response.py b/src/cloudflare/types/zero_trust/tunnels/connection_get_response.py deleted file mode 100644 index 056580f1881..00000000000 --- a/src/cloudflare/types/zero_trust/tunnels/connection_get_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .client import Client - -__all__ = ["ConnectionGetResponse"] - -ConnectionGetResponse: TypeAlias = List[Client] diff --git a/src/cloudflare/types/zones/custom_nameserver_update_response.py b/src/cloudflare/types/zones/custom_nameserver_update_response.py index 11b4e3cada2..895f5e51d8f 100644 --- a/src/cloudflare/types/zones/custom_nameserver_update_response.py +++ b/src/cloudflare/types/zones/custom_nameserver_update_response.py @@ -1,8 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List from typing_extensions import TypeAlias __all__ = ["CustomNameserverUpdateResponse"] -CustomNameserverUpdateResponse: TypeAlias = List[str] +CustomNameserverUpdateResponse: TypeAlias = str diff --git a/src/cloudflare/types/zones/rate_plan_get_response.py b/src/cloudflare/types/zones/rate_plan_get_response.py index 9de15c5c9ce..87940e668c0 100644 --- a/src/cloudflare/types/zones/rate_plan_get_response.py +++ b/src/cloudflare/types/zones/rate_plan_get_response.py @@ -1,14 +1,14 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Optional -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal from ..._models import BaseModel -__all__ = ["RatePlanGetResponse", "RatePlanGetResponseItem", "RatePlanGetResponseItemComponent"] +__all__ = ["RatePlanGetResponse", "Component"] -class RatePlanGetResponseItemComponent(BaseModel): +class Component(BaseModel): default: Optional[float] = None """The default amount allocated.""" @@ -19,11 +19,11 @@ class RatePlanGetResponseItemComponent(BaseModel): """The unit price of the addon.""" -class RatePlanGetResponseItem(BaseModel): +class RatePlanGetResponse(BaseModel): id: Optional[str] = None """Plan identifier tag.""" - components: Optional[List[RatePlanGetResponseItemComponent]] = None + components: Optional[List[Component]] = None """Array of available components values for the plan.""" currency: Optional[str] = None @@ -37,6 +37,3 @@ class RatePlanGetResponseItem(BaseModel): name: Optional[str] = None """The plan name.""" - - -RatePlanGetResponse: TypeAlias = List[RatePlanGetResponseItem] diff --git a/tests/api_resources/accounts/test_subscriptions.py b/tests/api_resources/accounts/test_subscriptions.py index 902f57d42f9..fe3639ee4a3 100644 --- a/tests/api_resources/accounts/test_subscriptions.py +++ b/tests/api_resources/accounts/test_subscriptions.py @@ -3,14 +3,15 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.shared import Subscription from cloudflare.types.accounts import ( - SubscriptionGetResponse, SubscriptionCreateResponse, SubscriptionDeleteResponse, SubscriptionUpdateResponse, @@ -200,7 +201,7 @@ def test_method_get(self, client: Cloudflare) -> None: subscription = client.accounts.subscriptions.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[SubscriptionGetResponse], subscription, path=["response"]) + assert_matches_type(SyncSinglePage[Subscription], subscription, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -211,7 +212,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Optional[SubscriptionGetResponse], subscription, path=["response"]) + assert_matches_type(SyncSinglePage[Subscription], subscription, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -222,7 +223,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Optional[SubscriptionGetResponse], subscription, path=["response"]) + assert_matches_type(SyncSinglePage[Subscription], subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -415,7 +416,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: subscription = await async_client.accounts.subscriptions.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[SubscriptionGetResponse], subscription, path=["response"]) + assert_matches_type(AsyncSinglePage[Subscription], subscription, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -426,7 +427,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(Optional[SubscriptionGetResponse], subscription, path=["response"]) + assert_matches_type(AsyncSinglePage[Subscription], subscription, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -437,7 +438,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(Optional[SubscriptionGetResponse], subscription, path=["response"]) + assert_matches_type(AsyncSinglePage[Subscription], subscription, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/alerting/destinations/test_pagerduty.py b/tests/api_resources/alerting/destinations/test_pagerduty.py index 05247187082..2201b9943e0 100644 --- a/tests/api_resources/alerting/destinations/test_pagerduty.py +++ b/tests/api_resources/alerting/destinations/test_pagerduty.py @@ -9,8 +9,9 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.alerting.destinations import ( - PagerdutyGetResponse, + Pagerduty, PagerdutyLinkResponse, PagerdutyCreateResponse, PagerdutyDeleteResponse, @@ -115,7 +116,7 @@ def test_method_get(self, client: Cloudflare) -> None: pagerduty = client.alerting.destinations.pagerduty.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[PagerdutyGetResponse], pagerduty, path=["response"]) + assert_matches_type(SyncSinglePage[Pagerduty], pagerduty, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -126,7 +127,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" pagerduty = response.parse() - assert_matches_type(Optional[PagerdutyGetResponse], pagerduty, path=["response"]) + assert_matches_type(SyncSinglePage[Pagerduty], pagerduty, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -137,7 +138,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" pagerduty = response.parse() - assert_matches_type(Optional[PagerdutyGetResponse], pagerduty, path=["response"]) + assert_matches_type(SyncSinglePage[Pagerduty], pagerduty, path=["response"]) assert cast(Any, response.is_closed) is True @@ -305,7 +306,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: pagerduty = await async_client.alerting.destinations.pagerduty.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[PagerdutyGetResponse], pagerduty, path=["response"]) + assert_matches_type(AsyncSinglePage[Pagerduty], pagerduty, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -316,7 +317,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" pagerduty = await response.parse() - assert_matches_type(Optional[PagerdutyGetResponse], pagerduty, path=["response"]) + assert_matches_type(AsyncSinglePage[Pagerduty], pagerduty, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -327,7 +328,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" pagerduty = await response.parse() - assert_matches_type(Optional[PagerdutyGetResponse], pagerduty, path=["response"]) + assert_matches_type(AsyncSinglePage[Pagerduty], pagerduty, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/api_gateway/test_operations.py b/tests/api_resources/api_gateway/test_operations.py index f61103adcc9..c363d5857b1 100644 --- a/tests/api_resources/api_gateway/test_operations.py +++ b/tests/api_resources/api_gateway/test_operations.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage, SyncV4PagePaginationArray, AsyncV4PagePaginationArray from cloudflare.types.api_gateway import ( OperationGetResponse, OperationListResponse, @@ -188,7 +188,7 @@ def test_method_bulk_create(self, client: Cloudflare) -> None: } ], ) - assert_matches_type(OperationBulkCreateResponse, operation, path=["response"]) + assert_matches_type(SyncSinglePage[OperationBulkCreateResponse], operation, path=["response"]) @parametrize def test_raw_response_bulk_create(self, client: Cloudflare) -> None: @@ -206,7 +206,7 @@ def test_raw_response_bulk_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" operation = response.parse() - assert_matches_type(OperationBulkCreateResponse, operation, path=["response"]) + assert_matches_type(SyncSinglePage[OperationBulkCreateResponse], operation, path=["response"]) @parametrize def test_streaming_response_bulk_create(self, client: Cloudflare) -> None: @@ -224,7 +224,7 @@ def test_streaming_response_bulk_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" operation = response.parse() - assert_matches_type(OperationBulkCreateResponse, operation, path=["response"]) + assert_matches_type(SyncSinglePage[OperationBulkCreateResponse], operation, path=["response"]) assert cast(Any, response.is_closed) is True @@ -504,7 +504,7 @@ async def test_method_bulk_create(self, async_client: AsyncCloudflare) -> None: } ], ) - assert_matches_type(OperationBulkCreateResponse, operation, path=["response"]) + assert_matches_type(AsyncSinglePage[OperationBulkCreateResponse], operation, path=["response"]) @parametrize async def test_raw_response_bulk_create(self, async_client: AsyncCloudflare) -> None: @@ -522,7 +522,7 @@ async def test_raw_response_bulk_create(self, async_client: AsyncCloudflare) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" operation = await response.parse() - assert_matches_type(OperationBulkCreateResponse, operation, path=["response"]) + assert_matches_type(AsyncSinglePage[OperationBulkCreateResponse], operation, path=["response"]) @parametrize async def test_streaming_response_bulk_create(self, async_client: AsyncCloudflare) -> None: @@ -540,7 +540,7 @@ async def test_streaming_response_bulk_create(self, async_client: AsyncCloudflar assert response.http_request.headers.get("X-Stainless-Lang") == "python" operation = await response.parse() - assert_matches_type(OperationBulkCreateResponse, operation, path=["response"]) + assert_matches_type(AsyncSinglePage[OperationBulkCreateResponse], operation, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/cloud_connector/test_rules.py b/tests/api_resources/cloud_connector/test_rules.py index 4c8dbcafd19..be4ecd8c702 100644 --- a/tests/api_resources/cloud_connector/test_rules.py +++ b/tests/api_resources/cloud_connector/test_rules.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest @@ -24,7 +24,7 @@ def test_method_update(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", rules=[{}], ) - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[RuleUpdateResponse], rule, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: @@ -36,7 +36,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[RuleUpdateResponse], rule, path=["response"]) @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: @@ -48,7 +48,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[RuleUpdateResponse], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -108,7 +108,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", rules=[{}], ) - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[RuleUpdateResponse], rule, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @@ -120,7 +120,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[RuleUpdateResponse], rule, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: @@ -132,7 +132,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[RuleUpdateResponse], rule, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/cloudforce_one/requests/test_assets.py b/tests/api_resources/cloudforce_one/requests/test_assets.py index 73a685dc703..a5e43df7fba 100644 --- a/tests/api_resources/cloudforce_one/requests/test_assets.py +++ b/tests/api_resources/cloudforce_one/requests/test_assets.py @@ -9,6 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.cloudforce_one.requests import ( AssetGetResponse, AssetCreateResponse, @@ -30,7 +31,7 @@ def test_method_create(self, client: Cloudflare) -> None: page=0, per_page=10, ) - assert_matches_type(Optional[AssetCreateResponse], asset, path=["response"]) + assert_matches_type(SyncSinglePage[AssetCreateResponse], asset, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -44,7 +45,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" asset = response.parse() - assert_matches_type(Optional[AssetCreateResponse], asset, path=["response"]) + assert_matches_type(SyncSinglePage[AssetCreateResponse], asset, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -58,7 +59,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" asset = response.parse() - assert_matches_type(Optional[AssetCreateResponse], asset, path=["response"]) + assert_matches_type(SyncSinglePage[AssetCreateResponse], asset, path=["response"]) assert cast(Any, response.is_closed) is True @@ -217,7 +218,7 @@ def test_method_get(self, client: Cloudflare) -> None: account_identifier="023e105f4ecef8ad9ca31a8372d0c353", request_identifier="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ) - assert_matches_type(Optional[AssetGetResponse], asset, path=["response"]) + assert_matches_type(SyncSinglePage[AssetGetResponse], asset, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -230,7 +231,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" asset = response.parse() - assert_matches_type(Optional[AssetGetResponse], asset, path=["response"]) + assert_matches_type(SyncSinglePage[AssetGetResponse], asset, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -243,7 +244,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" asset = response.parse() - assert_matches_type(Optional[AssetGetResponse], asset, path=["response"]) + assert_matches_type(SyncSinglePage[AssetGetResponse], asset, path=["response"]) assert cast(Any, response.is_closed) is True @@ -282,7 +283,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: page=0, per_page=10, ) - assert_matches_type(Optional[AssetCreateResponse], asset, path=["response"]) + assert_matches_type(AsyncSinglePage[AssetCreateResponse], asset, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -296,7 +297,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" asset = await response.parse() - assert_matches_type(Optional[AssetCreateResponse], asset, path=["response"]) + assert_matches_type(AsyncSinglePage[AssetCreateResponse], asset, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -310,7 +311,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" asset = await response.parse() - assert_matches_type(Optional[AssetCreateResponse], asset, path=["response"]) + assert_matches_type(AsyncSinglePage[AssetCreateResponse], asset, path=["response"]) assert cast(Any, response.is_closed) is True @@ -469,7 +470,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: account_identifier="023e105f4ecef8ad9ca31a8372d0c353", request_identifier="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ) - assert_matches_type(Optional[AssetGetResponse], asset, path=["response"]) + assert_matches_type(AsyncSinglePage[AssetGetResponse], asset, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -482,7 +483,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" asset = await response.parse() - assert_matches_type(Optional[AssetGetResponse], asset, path=["response"]) + assert_matches_type(AsyncSinglePage[AssetGetResponse], asset, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -495,7 +496,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" asset = await response.parse() - assert_matches_type(Optional[AssetGetResponse], asset, path=["response"]) + assert_matches_type(AsyncSinglePage[AssetGetResponse], asset, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/cloudforce_one/requests/test_message.py b/tests/api_resources/cloudforce_one/requests/test_message.py index 45d3caa0475..e2311353f62 100644 --- a/tests/api_resources/cloudforce_one/requests/test_message.py +++ b/tests/api_resources/cloudforce_one/requests/test_message.py @@ -10,9 +10,9 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare._utils import parse_datetime +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.cloudforce_one.requests import ( Message, - MessageGetResponse, MessageDeleteResponse, ) @@ -203,7 +203,7 @@ def test_method_get(self, client: Cloudflare) -> None: page=0, per_page=10, ) - assert_matches_type(Optional[MessageGetResponse], message, path=["response"]) + assert_matches_type(SyncSinglePage[Message], message, path=["response"]) @parametrize def test_method_get_with_all_params(self, client: Cloudflare) -> None: @@ -217,7 +217,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: sort_by="created", sort_order="asc", ) - assert_matches_type(Optional[MessageGetResponse], message, path=["response"]) + assert_matches_type(SyncSinglePage[Message], message, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -231,7 +231,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" message = response.parse() - assert_matches_type(Optional[MessageGetResponse], message, path=["response"]) + assert_matches_type(SyncSinglePage[Message], message, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -245,7 +245,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" message = response.parse() - assert_matches_type(Optional[MessageGetResponse], message, path=["response"]) + assert_matches_type(SyncSinglePage[Message], message, path=["response"]) assert cast(Any, response.is_closed) is True @@ -452,7 +452,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: page=0, per_page=10, ) - assert_matches_type(Optional[MessageGetResponse], message, path=["response"]) + assert_matches_type(AsyncSinglePage[Message], message, path=["response"]) @parametrize async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -466,7 +466,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - sort_by="created", sort_order="asc", ) - assert_matches_type(Optional[MessageGetResponse], message, path=["response"]) + assert_matches_type(AsyncSinglePage[Message], message, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -480,7 +480,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" message = await response.parse() - assert_matches_type(Optional[MessageGetResponse], message, path=["response"]) + assert_matches_type(AsyncSinglePage[Message], message, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -494,7 +494,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" message = await response.parse() - assert_matches_type(Optional[MessageGetResponse], message, path=["response"]) + assert_matches_type(AsyncSinglePage[Message], message, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/cloudforce_one/test_requests.py b/tests/api_resources/cloudforce_one/test_requests.py index 53ea792ef95..7b6c6ba2d91 100644 --- a/tests/api_resources/cloudforce_one/test_requests.py +++ b/tests/api_resources/cloudforce_one/test_requests.py @@ -10,13 +10,13 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare._utils import parse_datetime -from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.cloudforce_one import ( Item, Quota, ListItem, - RequestTypes, RequestConstants, + RequestTypesResponse, RequestDeleteResponse, ) @@ -144,7 +144,7 @@ def test_method_list(self, client: Cloudflare) -> None: page=0, per_page=10, ) - assert_matches_type(SyncV4PagePaginationArray[ListItem], request, path=["response"]) + assert_matches_type(SyncSinglePage[ListItem], request, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: @@ -161,7 +161,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: sort_order="asc", status="open", ) - assert_matches_type(SyncV4PagePaginationArray[ListItem], request, path=["response"]) + assert_matches_type(SyncSinglePage[ListItem], request, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: @@ -174,7 +174,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = response.parse() - assert_matches_type(SyncV4PagePaginationArray[ListItem], request, path=["response"]) + assert_matches_type(SyncSinglePage[ListItem], request, path=["response"]) @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: @@ -187,7 +187,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = response.parse() - assert_matches_type(SyncV4PagePaginationArray[ListItem], request, path=["response"]) + assert_matches_type(SyncSinglePage[ListItem], request, path=["response"]) assert cast(Any, response.is_closed) is True @@ -377,7 +377,7 @@ def test_method_types(self, client: Cloudflare) -> None: request = client.cloudforce_one.requests.types( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RequestTypes], request, path=["response"]) + assert_matches_type(SyncSinglePage[RequestTypesResponse], request, path=["response"]) @parametrize def test_raw_response_types(self, client: Cloudflare) -> None: @@ -388,7 +388,7 @@ def test_raw_response_types(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = response.parse() - assert_matches_type(Optional[RequestTypes], request, path=["response"]) + assert_matches_type(SyncSinglePage[RequestTypesResponse], request, path=["response"]) @parametrize def test_streaming_response_types(self, client: Cloudflare) -> None: @@ -399,7 +399,7 @@ def test_streaming_response_types(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = response.parse() - assert_matches_type(Optional[RequestTypes], request, path=["response"]) + assert_matches_type(SyncSinglePage[RequestTypesResponse], request, path=["response"]) assert cast(Any, response.is_closed) is True @@ -532,7 +532,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: page=0, per_page=10, ) - assert_matches_type(AsyncV4PagePaginationArray[ListItem], request, path=["response"]) + assert_matches_type(AsyncSinglePage[ListItem], request, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -549,7 +549,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) sort_order="asc", status="open", ) - assert_matches_type(AsyncV4PagePaginationArray[ListItem], request, path=["response"]) + assert_matches_type(AsyncSinglePage[ListItem], request, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @@ -562,7 +562,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[ListItem], request, path=["response"]) + assert_matches_type(AsyncSinglePage[ListItem], request, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: @@ -575,7 +575,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[ListItem], request, path=["response"]) + assert_matches_type(AsyncSinglePage[ListItem], request, path=["response"]) assert cast(Any, response.is_closed) is True @@ -765,7 +765,7 @@ async def test_method_types(self, async_client: AsyncCloudflare) -> None: request = await async_client.cloudforce_one.requests.types( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RequestTypes], request, path=["response"]) + assert_matches_type(AsyncSinglePage[RequestTypesResponse], request, path=["response"]) @parametrize async def test_raw_response_types(self, async_client: AsyncCloudflare) -> None: @@ -776,7 +776,7 @@ async def test_raw_response_types(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = await response.parse() - assert_matches_type(Optional[RequestTypes], request, path=["response"]) + assert_matches_type(AsyncSinglePage[RequestTypesResponse], request, path=["response"]) @parametrize async def test_streaming_response_types(self, async_client: AsyncCloudflare) -> None: @@ -787,7 +787,7 @@ async def test_streaming_response_types(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = await response.parse() - assert_matches_type(Optional[RequestTypes], request, path=["response"]) + assert_matches_type(AsyncSinglePage[RequestTypesResponse], request, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/content_scanning/test_payloads.py b/tests/api_resources/content_scanning/test_payloads.py index cf00ee67253..6f45fb1bc6b 100644 --- a/tests/api_resources/content_scanning/test_payloads.py +++ b/tests/api_resources/content_scanning/test_payloads.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest @@ -28,7 +28,7 @@ def test_method_create(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", body=[{"payload": 'lookup_json_string(http.request.body.raw, "file")'}], ) - assert_matches_type(Optional[PayloadCreateResponse], payload, path=["response"]) + assert_matches_type(SyncSinglePage[PayloadCreateResponse], payload, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -40,7 +40,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" payload = response.parse() - assert_matches_type(Optional[PayloadCreateResponse], payload, path=["response"]) + assert_matches_type(SyncSinglePage[PayloadCreateResponse], payload, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -52,7 +52,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" payload = response.parse() - assert_matches_type(Optional[PayloadCreateResponse], payload, path=["response"]) + assert_matches_type(SyncSinglePage[PayloadCreateResponse], payload, path=["response"]) assert cast(Any, response.is_closed) is True @@ -108,7 +108,7 @@ def test_method_delete(self, client: Cloudflare) -> None: expression_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[PayloadDeleteResponse], payload, path=["response"]) + assert_matches_type(SyncSinglePage[PayloadDeleteResponse], payload, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -120,7 +120,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" payload = response.parse() - assert_matches_type(Optional[PayloadDeleteResponse], payload, path=["response"]) + assert_matches_type(SyncSinglePage[PayloadDeleteResponse], payload, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -132,7 +132,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" payload = response.parse() - assert_matches_type(Optional[PayloadDeleteResponse], payload, path=["response"]) + assert_matches_type(SyncSinglePage[PayloadDeleteResponse], payload, path=["response"]) assert cast(Any, response.is_closed) is True @@ -160,7 +160,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", body=[{"payload": 'lookup_json_string(http.request.body.raw, "file")'}], ) - assert_matches_type(Optional[PayloadCreateResponse], payload, path=["response"]) + assert_matches_type(AsyncSinglePage[PayloadCreateResponse], payload, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -172,7 +172,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" payload = await response.parse() - assert_matches_type(Optional[PayloadCreateResponse], payload, path=["response"]) + assert_matches_type(AsyncSinglePage[PayloadCreateResponse], payload, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -184,7 +184,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" payload = await response.parse() - assert_matches_type(Optional[PayloadCreateResponse], payload, path=["response"]) + assert_matches_type(AsyncSinglePage[PayloadCreateResponse], payload, path=["response"]) assert cast(Any, response.is_closed) is True @@ -240,7 +240,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: expression_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[PayloadDeleteResponse], payload, path=["response"]) + assert_matches_type(AsyncSinglePage[PayloadDeleteResponse], payload, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -252,7 +252,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" payload = await response.parse() - assert_matches_type(Optional[PayloadDeleteResponse], payload, path=["response"]) + assert_matches_type(AsyncSinglePage[PayloadDeleteResponse], payload, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -264,7 +264,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" payload = await response.parse() - assert_matches_type(Optional[PayloadDeleteResponse], payload, path=["response"]) + assert_matches_type(AsyncSinglePage[PayloadDeleteResponse], payload, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/custom_certificates/test_prioritize.py b/tests/api_resources/custom_certificates/test_prioritize.py index 25accbd83cb..dec90b6f83c 100644 --- a/tests/api_resources/custom_certificates/test_prioritize.py +++ b/tests/api_resources/custom_certificates/test_prioritize.py @@ -3,13 +3,14 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.custom_certificates import PrioritizeUpdateResponse +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.custom_certificates import CustomCertificate base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +24,7 @@ def test_method_update(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", certificates=[{}, {}], ) - assert_matches_type(Optional[PrioritizeUpdateResponse], prioritize, path=["response"]) + assert_matches_type(SyncSinglePage[CustomCertificate], prioritize, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: @@ -35,7 +36,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" prioritize = response.parse() - assert_matches_type(Optional[PrioritizeUpdateResponse], prioritize, path=["response"]) + assert_matches_type(SyncSinglePage[CustomCertificate], prioritize, path=["response"]) @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: @@ -47,7 +48,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" prioritize = response.parse() - assert_matches_type(Optional[PrioritizeUpdateResponse], prioritize, path=["response"]) + assert_matches_type(SyncSinglePage[CustomCertificate], prioritize, path=["response"]) assert cast(Any, response.is_closed) is True @@ -69,7 +70,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", certificates=[{}, {}], ) - assert_matches_type(Optional[PrioritizeUpdateResponse], prioritize, path=["response"]) + assert_matches_type(AsyncSinglePage[CustomCertificate], prioritize, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @@ -81,7 +82,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" prioritize = await response.parse() - assert_matches_type(Optional[PrioritizeUpdateResponse], prioritize, path=["response"]) + assert_matches_type(AsyncSinglePage[CustomCertificate], prioritize, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: @@ -93,7 +94,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" prioritize = await response.parse() - assert_matches_type(Optional[PrioritizeUpdateResponse], prioritize, path=["response"]) + assert_matches_type(AsyncSinglePage[CustomCertificate], prioritize, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/d1/test_database.py b/tests/api_resources/d1/test_database.py index 42230253b1c..5e7a28f5b44 100644 --- a/tests/api_resources/d1/test_database.py +++ b/tests/api_resources/d1/test_database.py @@ -11,13 +11,13 @@ from tests.utils import assert_matches_type from cloudflare.types.d1 import ( D1, + QueryResult, DatabaseRawResponse, DatabaseListResponse, - DatabaseQueryResponse, DatabaseExportResponse, DatabaseImportResponse, ) -from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage, SyncV4PagePaginationArray, AsyncV4PagePaginationArray base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -474,7 +474,7 @@ def test_method_query(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", sql="SELECT * FROM myTable WHERE field = ? OR field = ?;", ) - assert_matches_type(DatabaseQueryResponse, database, path=["response"]) + assert_matches_type(SyncSinglePage[QueryResult], database, path=["response"]) @parametrize def test_method_query_with_all_params(self, client: Cloudflare) -> None: @@ -484,7 +484,7 @@ def test_method_query_with_all_params(self, client: Cloudflare) -> None: sql="SELECT * FROM myTable WHERE field = ? OR field = ?;", params=["firstParam", "secondParam"], ) - assert_matches_type(DatabaseQueryResponse, database, path=["response"]) + assert_matches_type(SyncSinglePage[QueryResult], database, path=["response"]) @parametrize def test_raw_response_query(self, client: Cloudflare) -> None: @@ -497,7 +497,7 @@ def test_raw_response_query(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" database = response.parse() - assert_matches_type(DatabaseQueryResponse, database, path=["response"]) + assert_matches_type(SyncSinglePage[QueryResult], database, path=["response"]) @parametrize def test_streaming_response_query(self, client: Cloudflare) -> None: @@ -510,7 +510,7 @@ def test_streaming_response_query(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" database = response.parse() - assert_matches_type(DatabaseQueryResponse, database, path=["response"]) + assert_matches_type(SyncSinglePage[QueryResult], database, path=["response"]) assert cast(Any, response.is_closed) is True @@ -537,7 +537,7 @@ def test_method_raw(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", sql="SELECT * FROM myTable WHERE field = ? OR field = ?;", ) - assert_matches_type(DatabaseRawResponse, database, path=["response"]) + assert_matches_type(SyncSinglePage[DatabaseRawResponse], database, path=["response"]) @parametrize def test_method_raw_with_all_params(self, client: Cloudflare) -> None: @@ -547,7 +547,7 @@ def test_method_raw_with_all_params(self, client: Cloudflare) -> None: sql="SELECT * FROM myTable WHERE field = ? OR field = ?;", params=["firstParam", "secondParam"], ) - assert_matches_type(DatabaseRawResponse, database, path=["response"]) + assert_matches_type(SyncSinglePage[DatabaseRawResponse], database, path=["response"]) @parametrize def test_raw_response_raw(self, client: Cloudflare) -> None: @@ -560,7 +560,7 @@ def test_raw_response_raw(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" database = response.parse() - assert_matches_type(DatabaseRawResponse, database, path=["response"]) + assert_matches_type(SyncSinglePage[DatabaseRawResponse], database, path=["response"]) @parametrize def test_streaming_response_raw(self, client: Cloudflare) -> None: @@ -573,7 +573,7 @@ def test_streaming_response_raw(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" database = response.parse() - assert_matches_type(DatabaseRawResponse, database, path=["response"]) + assert_matches_type(SyncSinglePage[DatabaseRawResponse], database, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1046,7 +1046,7 @@ async def test_method_query(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", sql="SELECT * FROM myTable WHERE field = ? OR field = ?;", ) - assert_matches_type(DatabaseQueryResponse, database, path=["response"]) + assert_matches_type(AsyncSinglePage[QueryResult], database, path=["response"]) @parametrize async def test_method_query_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -1056,7 +1056,7 @@ async def test_method_query_with_all_params(self, async_client: AsyncCloudflare) sql="SELECT * FROM myTable WHERE field = ? OR field = ?;", params=["firstParam", "secondParam"], ) - assert_matches_type(DatabaseQueryResponse, database, path=["response"]) + assert_matches_type(AsyncSinglePage[QueryResult], database, path=["response"]) @parametrize async def test_raw_response_query(self, async_client: AsyncCloudflare) -> None: @@ -1069,7 +1069,7 @@ async def test_raw_response_query(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" database = await response.parse() - assert_matches_type(DatabaseQueryResponse, database, path=["response"]) + assert_matches_type(AsyncSinglePage[QueryResult], database, path=["response"]) @parametrize async def test_streaming_response_query(self, async_client: AsyncCloudflare) -> None: @@ -1082,7 +1082,7 @@ async def test_streaming_response_query(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" database = await response.parse() - assert_matches_type(DatabaseQueryResponse, database, path=["response"]) + assert_matches_type(AsyncSinglePage[QueryResult], database, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1109,7 +1109,7 @@ async def test_method_raw(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", sql="SELECT * FROM myTable WHERE field = ? OR field = ?;", ) - assert_matches_type(DatabaseRawResponse, database, path=["response"]) + assert_matches_type(AsyncSinglePage[DatabaseRawResponse], database, path=["response"]) @parametrize async def test_method_raw_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -1119,7 +1119,7 @@ async def test_method_raw_with_all_params(self, async_client: AsyncCloudflare) - sql="SELECT * FROM myTable WHERE field = ? OR field = ?;", params=["firstParam", "secondParam"], ) - assert_matches_type(DatabaseRawResponse, database, path=["response"]) + assert_matches_type(AsyncSinglePage[DatabaseRawResponse], database, path=["response"]) @parametrize async def test_raw_response_raw(self, async_client: AsyncCloudflare) -> None: @@ -1132,7 +1132,7 @@ async def test_raw_response_raw(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" database = await response.parse() - assert_matches_type(DatabaseRawResponse, database, path=["response"]) + assert_matches_type(AsyncSinglePage[DatabaseRawResponse], database, path=["response"]) @parametrize async def test_streaming_response_raw(self, async_client: AsyncCloudflare) -> None: @@ -1145,7 +1145,7 @@ async def test_streaming_response_raw(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" database = await response.parse() - assert_matches_type(DatabaseRawResponse, database, path=["response"]) + assert_matches_type(AsyncSinglePage[DatabaseRawResponse], database, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/diagnostics/test_traceroutes.py b/tests/api_resources/diagnostics/test_traceroutes.py index 930de49727f..d71849dd539 100644 --- a/tests/api_resources/diagnostics/test_traceroutes.py +++ b/tests/api_resources/diagnostics/test_traceroutes.py @@ -3,13 +3,14 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.diagnostics import TracerouteCreateResponse +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.diagnostics import Traceroute base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +24,7 @@ def test_method_create(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", targets=["203.0.113.1", "cloudflare.com"], ) - assert_matches_type(Optional[TracerouteCreateResponse], traceroute, path=["response"]) + assert_matches_type(SyncSinglePage[Traceroute], traceroute, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: @@ -39,7 +40,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "wait_time": 1, }, ) - assert_matches_type(Optional[TracerouteCreateResponse], traceroute, path=["response"]) + assert_matches_type(SyncSinglePage[Traceroute], traceroute, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -51,7 +52,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" traceroute = response.parse() - assert_matches_type(Optional[TracerouteCreateResponse], traceroute, path=["response"]) + assert_matches_type(SyncSinglePage[Traceroute], traceroute, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -63,7 +64,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" traceroute = response.parse() - assert_matches_type(Optional[TracerouteCreateResponse], traceroute, path=["response"]) + assert_matches_type(SyncSinglePage[Traceroute], traceroute, path=["response"]) assert cast(Any, response.is_closed) is True @@ -85,7 +86,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", targets=["203.0.113.1", "cloudflare.com"], ) - assert_matches_type(Optional[TracerouteCreateResponse], traceroute, path=["response"]) + assert_matches_type(AsyncSinglePage[Traceroute], traceroute, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -101,7 +102,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "wait_time": 1, }, ) - assert_matches_type(Optional[TracerouteCreateResponse], traceroute, path=["response"]) + assert_matches_type(AsyncSinglePage[Traceroute], traceroute, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -113,7 +114,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" traceroute = await response.parse() - assert_matches_type(Optional[TracerouteCreateResponse], traceroute, path=["response"]) + assert_matches_type(AsyncSinglePage[Traceroute], traceroute, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -125,7 +126,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" traceroute = await response.parse() - assert_matches_type(Optional[TracerouteCreateResponse], traceroute, path=["response"]) + assert_matches_type(AsyncSinglePage[Traceroute], traceroute, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/email_routing/test_dns.py b/tests/api_resources/email_routing/test_dns.py index d55f944bb76..a4c80ef0659 100644 --- a/tests/api_resources/email_routing/test_dns.py +++ b/tests/api_resources/email_routing/test_dns.py @@ -9,10 +9,11 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.email_routing import ( Settings, + DNSRecord, DNSGetResponse, - DNSDeleteResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -68,7 +69,7 @@ def test_method_delete(self, client: Cloudflare) -> None: dns = client.email_routing.dns.delete( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(DNSDeleteResponse, dns, path=["response"]) + assert_matches_type(SyncSinglePage[DNSRecord], dns, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -79,7 +80,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" dns = response.parse() - assert_matches_type(DNSDeleteResponse, dns, path=["response"]) + assert_matches_type(SyncSinglePage[DNSRecord], dns, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -90,7 +91,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" dns = response.parse() - assert_matches_type(DNSDeleteResponse, dns, path=["response"]) + assert_matches_type(SyncSinglePage[DNSRecord], dns, path=["response"]) assert cast(Any, response.is_closed) is True @@ -240,7 +241,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: dns = await async_client.email_routing.dns.delete( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(DNSDeleteResponse, dns, path=["response"]) + assert_matches_type(AsyncSinglePage[DNSRecord], dns, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -251,7 +252,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" dns = await response.parse() - assert_matches_type(DNSDeleteResponse, dns, path=["response"]) + assert_matches_type(AsyncSinglePage[DNSRecord], dns, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -262,7 +263,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" dns = await response.parse() - assert_matches_type(DNSDeleteResponse, dns, path=["response"]) + assert_matches_type(AsyncSinglePage[DNSRecord], dns, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/email_security/investigate/test_move.py b/tests/api_resources/email_security/investigate/test_move.py index b1b2b935186..27096f30850 100644 --- a/tests/api_resources/email_security/investigate/test_move.py +++ b/tests/api_resources/email_security/investigate/test_move.py @@ -9,6 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.email_security.investigate import ( MoveBulkResponse, MoveCreateResponse, @@ -27,7 +28,7 @@ def test_method_create(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", destination="Inbox", ) - assert_matches_type(MoveCreateResponse, move, path=["response"]) + assert_matches_type(SyncSinglePage[MoveCreateResponse], move, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -40,7 +41,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" move = response.parse() - assert_matches_type(MoveCreateResponse, move, path=["response"]) + assert_matches_type(SyncSinglePage[MoveCreateResponse], move, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -53,7 +54,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" move = response.parse() - assert_matches_type(MoveCreateResponse, move, path=["response"]) + assert_matches_type(SyncSinglePage[MoveCreateResponse], move, path=["response"]) assert cast(Any, response.is_closed) is True @@ -80,7 +81,7 @@ def test_method_bulk(self, client: Cloudflare) -> None: destination="Inbox", postfix_ids=["4Njp3P0STMz2c02Q"], ) - assert_matches_type(MoveBulkResponse, move, path=["response"]) + assert_matches_type(SyncSinglePage[MoveBulkResponse], move, path=["response"]) @parametrize def test_raw_response_bulk(self, client: Cloudflare) -> None: @@ -93,7 +94,7 @@ def test_raw_response_bulk(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" move = response.parse() - assert_matches_type(MoveBulkResponse, move, path=["response"]) + assert_matches_type(SyncSinglePage[MoveBulkResponse], move, path=["response"]) @parametrize def test_streaming_response_bulk(self, client: Cloudflare) -> None: @@ -106,7 +107,7 @@ def test_streaming_response_bulk(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" move = response.parse() - assert_matches_type(MoveBulkResponse, move, path=["response"]) + assert_matches_type(SyncSinglePage[MoveBulkResponse], move, path=["response"]) assert cast(Any, response.is_closed) is True @@ -130,7 +131,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", destination="Inbox", ) - assert_matches_type(MoveCreateResponse, move, path=["response"]) + assert_matches_type(AsyncSinglePage[MoveCreateResponse], move, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -143,7 +144,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" move = await response.parse() - assert_matches_type(MoveCreateResponse, move, path=["response"]) + assert_matches_type(AsyncSinglePage[MoveCreateResponse], move, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -156,7 +157,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" move = await response.parse() - assert_matches_type(MoveCreateResponse, move, path=["response"]) + assert_matches_type(AsyncSinglePage[MoveCreateResponse], move, path=["response"]) assert cast(Any, response.is_closed) is True @@ -183,7 +184,7 @@ async def test_method_bulk(self, async_client: AsyncCloudflare) -> None: destination="Inbox", postfix_ids=["4Njp3P0STMz2c02Q"], ) - assert_matches_type(MoveBulkResponse, move, path=["response"]) + assert_matches_type(AsyncSinglePage[MoveBulkResponse], move, path=["response"]) @parametrize async def test_raw_response_bulk(self, async_client: AsyncCloudflare) -> None: @@ -196,7 +197,7 @@ async def test_raw_response_bulk(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" move = await response.parse() - assert_matches_type(MoveBulkResponse, move, path=["response"]) + assert_matches_type(AsyncSinglePage[MoveBulkResponse], move, path=["response"]) @parametrize async def test_streaming_response_bulk(self, async_client: AsyncCloudflare) -> None: @@ -209,7 +210,7 @@ async def test_streaming_response_bulk(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" move = await response.parse() - assert_matches_type(MoveBulkResponse, move, path=["response"]) + assert_matches_type(AsyncSinglePage[MoveBulkResponse], move, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/email_security/investigate/test_release.py b/tests/api_resources/email_security/investigate/test_release.py index 5d34bc6a07e..2b437e713c9 100644 --- a/tests/api_resources/email_security/investigate/test_release.py +++ b/tests/api_resources/email_security/investigate/test_release.py @@ -9,6 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.email_security.investigate import ReleaseBulkResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +24,7 @@ def test_method_bulk(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", body=["4Njp3P0STMz2c02Q"], ) - assert_matches_type(ReleaseBulkResponse, release, path=["response"]) + assert_matches_type(SyncSinglePage[ReleaseBulkResponse], release, path=["response"]) @parametrize def test_raw_response_bulk(self, client: Cloudflare) -> None: @@ -35,7 +36,7 @@ def test_raw_response_bulk(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" release = response.parse() - assert_matches_type(ReleaseBulkResponse, release, path=["response"]) + assert_matches_type(SyncSinglePage[ReleaseBulkResponse], release, path=["response"]) @parametrize def test_streaming_response_bulk(self, client: Cloudflare) -> None: @@ -47,7 +48,7 @@ def test_streaming_response_bulk(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" release = response.parse() - assert_matches_type(ReleaseBulkResponse, release, path=["response"]) + assert_matches_type(SyncSinglePage[ReleaseBulkResponse], release, path=["response"]) assert cast(Any, response.is_closed) is True @@ -69,7 +70,7 @@ async def test_method_bulk(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", body=["4Njp3P0STMz2c02Q"], ) - assert_matches_type(ReleaseBulkResponse, release, path=["response"]) + assert_matches_type(AsyncSinglePage[ReleaseBulkResponse], release, path=["response"]) @parametrize async def test_raw_response_bulk(self, async_client: AsyncCloudflare) -> None: @@ -81,7 +82,7 @@ async def test_raw_response_bulk(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" release = await response.parse() - assert_matches_type(ReleaseBulkResponse, release, path=["response"]) + assert_matches_type(AsyncSinglePage[ReleaseBulkResponse], release, path=["response"]) @parametrize async def test_streaming_response_bulk(self, async_client: AsyncCloudflare) -> None: @@ -93,7 +94,7 @@ async def test_streaming_response_bulk(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" release = await response.parse() - assert_matches_type(ReleaseBulkResponse, release, path=["response"]) + assert_matches_type(AsyncSinglePage[ReleaseBulkResponse], release, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/email_security/settings/test_domains.py b/tests/api_resources/email_security/settings/test_domains.py index 1277461c4ad..1108ce39300 100644 --- a/tests/api_resources/email_security/settings/test_domains.py +++ b/tests/api_resources/email_security/settings/test_domains.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage, SyncV4PagePaginationArray, AsyncV4PagePaginationArray from cloudflare.types.email_security.settings import ( DomainGetResponse, DomainEditResponse, @@ -124,7 +124,7 @@ def test_method_bulk_delete(self, client: Cloudflare) -> None: domain = client.email_security.settings.domains.bulk_delete( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(DomainBulkDeleteResponse, domain, path=["response"]) + assert_matches_type(SyncSinglePage[DomainBulkDeleteResponse], domain, path=["response"]) @parametrize def test_raw_response_bulk_delete(self, client: Cloudflare) -> None: @@ -135,7 +135,7 @@ def test_raw_response_bulk_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" domain = response.parse() - assert_matches_type(DomainBulkDeleteResponse, domain, path=["response"]) + assert_matches_type(SyncSinglePage[DomainBulkDeleteResponse], domain, path=["response"]) @parametrize def test_streaming_response_bulk_delete(self, client: Cloudflare) -> None: @@ -146,7 +146,7 @@ def test_streaming_response_bulk_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" domain = response.parse() - assert_matches_type(DomainBulkDeleteResponse, domain, path=["response"]) + assert_matches_type(SyncSinglePage[DomainBulkDeleteResponse], domain, path=["response"]) assert cast(Any, response.is_closed) is True @@ -366,7 +366,7 @@ async def test_method_bulk_delete(self, async_client: AsyncCloudflare) -> None: domain = await async_client.email_security.settings.domains.bulk_delete( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(DomainBulkDeleteResponse, domain, path=["response"]) + assert_matches_type(AsyncSinglePage[DomainBulkDeleteResponse], domain, path=["response"]) @parametrize async def test_raw_response_bulk_delete(self, async_client: AsyncCloudflare) -> None: @@ -377,7 +377,7 @@ async def test_raw_response_bulk_delete(self, async_client: AsyncCloudflare) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" domain = await response.parse() - assert_matches_type(DomainBulkDeleteResponse, domain, path=["response"]) + assert_matches_type(AsyncSinglePage[DomainBulkDeleteResponse], domain, path=["response"]) @parametrize async def test_streaming_response_bulk_delete(self, async_client: AsyncCloudflare) -> None: @@ -388,7 +388,7 @@ async def test_streaming_response_bulk_delete(self, async_client: AsyncCloudflar assert response.http_request.headers.get("X-Stainless-Lang") == "python" domain = await response.parse() - assert_matches_type(DomainBulkDeleteResponse, domain, path=["response"]) + assert_matches_type(AsyncSinglePage[DomainBulkDeleteResponse], domain, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/firewall/test_rules.py b/tests/api_resources/firewall/test_rules.py index 16d7451bf29..f33337a9a24 100644 --- a/tests/api_resources/firewall/test_rules.py +++ b/tests/api_resources/firewall/test_rules.py @@ -3,20 +3,15 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage, SyncV4PagePaginationArray, AsyncV4PagePaginationArray from cloudflare.types.firewall import ( FirewallRule, - RuleEditResponse, - RuleCreateResponse, - RuleBulkEditResponse, - RuleBulkDeleteResponse, - RuleBulkUpdateResponse, ) # pyright: reportDeprecated=false @@ -37,7 +32,7 @@ def test_method_create(self, client: Cloudflare) -> None: filter={}, ) - assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[FirewallRule], rule, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -61,7 +56,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: }, ) - assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[FirewallRule], rule, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -76,7 +71,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[FirewallRule], rule, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -91,7 +86,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[FirewallRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -317,7 +312,7 @@ def test_method_bulk_delete(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RuleBulkDeleteResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[FirewallRule], rule, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -330,7 +325,7 @@ def test_raw_response_bulk_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleBulkDeleteResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[FirewallRule], rule, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -343,7 +338,7 @@ def test_streaming_response_bulk_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleBulkDeleteResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[FirewallRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -365,7 +360,7 @@ def test_method_bulk_edit(self, client: Cloudflare) -> None: body={}, ) - assert_matches_type(Optional[RuleBulkEditResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[FirewallRule], rule, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -379,7 +374,7 @@ def test_raw_response_bulk_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleBulkEditResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[FirewallRule], rule, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -393,7 +388,7 @@ def test_streaming_response_bulk_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleBulkEditResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[FirewallRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -416,7 +411,7 @@ def test_method_bulk_update(self, client: Cloudflare) -> None: body={}, ) - assert_matches_type(Optional[RuleBulkUpdateResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[FirewallRule], rule, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -430,7 +425,7 @@ def test_raw_response_bulk_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleBulkUpdateResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[FirewallRule], rule, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -444,7 +439,7 @@ def test_streaming_response_bulk_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleBulkUpdateResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[FirewallRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -467,7 +462,7 @@ def test_method_edit(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RuleEditResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[FirewallRule], rule, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -481,7 +476,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleEditResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[FirewallRule], rule, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -495,7 +490,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleEditResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[FirewallRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -593,7 +588,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: filter={}, ) - assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[FirewallRule], rule, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -617,7 +612,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare }, ) - assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[FirewallRule], rule, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -632,7 +627,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[FirewallRule], rule, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -647,7 +642,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[FirewallRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -873,7 +868,7 @@ async def test_method_bulk_delete(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RuleBulkDeleteResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[FirewallRule], rule, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -886,7 +881,7 @@ async def test_raw_response_bulk_delete(self, async_client: AsyncCloudflare) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleBulkDeleteResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[FirewallRule], rule, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -899,7 +894,7 @@ async def test_streaming_response_bulk_delete(self, async_client: AsyncCloudflar assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleBulkDeleteResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[FirewallRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -921,7 +916,7 @@ async def test_method_bulk_edit(self, async_client: AsyncCloudflare) -> None: body={}, ) - assert_matches_type(Optional[RuleBulkEditResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[FirewallRule], rule, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -935,7 +930,7 @@ async def test_raw_response_bulk_edit(self, async_client: AsyncCloudflare) -> No assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleBulkEditResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[FirewallRule], rule, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -949,7 +944,7 @@ async def test_streaming_response_bulk_edit(self, async_client: AsyncCloudflare) assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleBulkEditResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[FirewallRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -972,7 +967,7 @@ async def test_method_bulk_update(self, async_client: AsyncCloudflare) -> None: body={}, ) - assert_matches_type(Optional[RuleBulkUpdateResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[FirewallRule], rule, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -986,7 +981,7 @@ async def test_raw_response_bulk_update(self, async_client: AsyncCloudflare) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleBulkUpdateResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[FirewallRule], rule, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1000,7 +995,7 @@ async def test_streaming_response_bulk_update(self, async_client: AsyncCloudflar assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleBulkUpdateResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[FirewallRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1023,7 +1018,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RuleEditResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[FirewallRule], rule, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1037,7 +1032,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleEditResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[FirewallRule], rule, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -1051,7 +1046,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleEditResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[FirewallRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/hostnames/settings/test_tls.py b/tests/api_resources/hostnames/settings/test_tls.py index 60abcaf4022..434d65687c6 100644 --- a/tests/api_resources/hostnames/settings/test_tls.py +++ b/tests/api_resources/hostnames/settings/test_tls.py @@ -9,6 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.hostnames.settings import ( Setting, TLSGetResponse, @@ -138,7 +139,7 @@ def test_method_get(self, client: Cloudflare) -> None: setting_id="ciphers", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[TLSGetResponse], tls, path=["response"]) + assert_matches_type(SyncSinglePage[TLSGetResponse], tls, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -150,7 +151,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" tls = response.parse() - assert_matches_type(Optional[TLSGetResponse], tls, path=["response"]) + assert_matches_type(SyncSinglePage[TLSGetResponse], tls, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -162,7 +163,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" tls = response.parse() - assert_matches_type(Optional[TLSGetResponse], tls, path=["response"]) + assert_matches_type(SyncSinglePage[TLSGetResponse], tls, path=["response"]) assert cast(Any, response.is_closed) is True @@ -295,7 +296,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: setting_id="ciphers", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[TLSGetResponse], tls, path=["response"]) + assert_matches_type(AsyncSinglePage[TLSGetResponse], tls, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -307,7 +308,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" tls = await response.parse() - assert_matches_type(Optional[TLSGetResponse], tls, path=["response"]) + assert_matches_type(AsyncSinglePage[TLSGetResponse], tls, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -319,7 +320,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" tls = await response.parse() - assert_matches_type(Optional[TLSGetResponse], tls, path=["response"]) + assert_matches_type(AsyncSinglePage[TLSGetResponse], tls, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/intel/attack_surface_report/test_issue_types.py b/tests/api_resources/intel/attack_surface_report/test_issue_types.py index 25b244d8989..b51bdf0886d 100644 --- a/tests/api_resources/intel/attack_surface_report/test_issue_types.py +++ b/tests/api_resources/intel/attack_surface_report/test_issue_types.py @@ -3,12 +3,13 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.intel.attack_surface_report import IssueTypeGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -22,7 +23,7 @@ def test_method_get(self, client: Cloudflare) -> None: issue_type = client.intel.attack_surface_report.issue_types.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[IssueTypeGetResponse], issue_type, path=["response"]) + assert_matches_type(SyncSinglePage[IssueTypeGetResponse], issue_type, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -33,7 +34,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" issue_type = response.parse() - assert_matches_type(Optional[IssueTypeGetResponse], issue_type, path=["response"]) + assert_matches_type(SyncSinglePage[IssueTypeGetResponse], issue_type, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -44,7 +45,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" issue_type = response.parse() - assert_matches_type(Optional[IssueTypeGetResponse], issue_type, path=["response"]) + assert_matches_type(SyncSinglePage[IssueTypeGetResponse], issue_type, path=["response"]) assert cast(Any, response.is_closed) is True @@ -64,7 +65,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: issue_type = await async_client.intel.attack_surface_report.issue_types.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[IssueTypeGetResponse], issue_type, path=["response"]) + assert_matches_type(AsyncSinglePage[IssueTypeGetResponse], issue_type, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -75,7 +76,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" issue_type = await response.parse() - assert_matches_type(Optional[IssueTypeGetResponse], issue_type, path=["response"]) + assert_matches_type(AsyncSinglePage[IssueTypeGetResponse], issue_type, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -86,7 +87,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" issue_type = await response.parse() - assert_matches_type(Optional[IssueTypeGetResponse], issue_type, path=["response"]) + assert_matches_type(AsyncSinglePage[IssueTypeGetResponse], issue_type, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/intel/test_ip_lists.py b/tests/api_resources/intel/test_ip_lists.py index afb47b13e8c..01befdba45c 100644 --- a/tests/api_resources/intel/test_ip_lists.py +++ b/tests/api_resources/intel/test_ip_lists.py @@ -3,13 +3,14 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.intel import IPListGetResponse +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.intel import IPList base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -22,7 +23,7 @@ def test_method_get(self, client: Cloudflare) -> None: ip_list = client.intel.ip_lists.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[IPListGetResponse], ip_list, path=["response"]) + assert_matches_type(SyncSinglePage[IPList], ip_list, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -33,7 +34,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ip_list = response.parse() - assert_matches_type(Optional[IPListGetResponse], ip_list, path=["response"]) + assert_matches_type(SyncSinglePage[IPList], ip_list, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -44,7 +45,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ip_list = response.parse() - assert_matches_type(Optional[IPListGetResponse], ip_list, path=["response"]) + assert_matches_type(SyncSinglePage[IPList], ip_list, path=["response"]) assert cast(Any, response.is_closed) is True @@ -64,7 +65,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: ip_list = await async_client.intel.ip_lists.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[IPListGetResponse], ip_list, path=["response"]) + assert_matches_type(AsyncSinglePage[IPList], ip_list, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -75,7 +76,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ip_list = await response.parse() - assert_matches_type(Optional[IPListGetResponse], ip_list, path=["response"]) + assert_matches_type(AsyncSinglePage[IPList], ip_list, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -86,7 +87,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" ip_list = await response.parse() - assert_matches_type(Optional[IPListGetResponse], ip_list, path=["response"]) + assert_matches_type(AsyncSinglePage[IPList], ip_list, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/load_balancers/monitors/test_references.py b/tests/api_resources/load_balancers/monitors/test_references.py index 573d10ec218..ba9680e3bc1 100644 --- a/tests/api_resources/load_balancers/monitors/test_references.py +++ b/tests/api_resources/load_balancers/monitors/test_references.py @@ -9,6 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.load_balancers.monitors import ReferenceGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +24,7 @@ def test_method_get(self, client: Cloudflare) -> None: monitor_id="f1aba936b94213e5b8dca0c0dbf1f9cc", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ReferenceGetResponse, reference, path=["response"]) + assert_matches_type(SyncSinglePage[ReferenceGetResponse], reference, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -35,7 +36,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" reference = response.parse() - assert_matches_type(ReferenceGetResponse, reference, path=["response"]) + assert_matches_type(SyncSinglePage[ReferenceGetResponse], reference, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -47,7 +48,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" reference = response.parse() - assert_matches_type(ReferenceGetResponse, reference, path=["response"]) + assert_matches_type(SyncSinglePage[ReferenceGetResponse], reference, path=["response"]) assert cast(Any, response.is_closed) is True @@ -75,7 +76,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: monitor_id="f1aba936b94213e5b8dca0c0dbf1f9cc", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ReferenceGetResponse, reference, path=["response"]) + assert_matches_type(AsyncSinglePage[ReferenceGetResponse], reference, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -87,7 +88,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" reference = await response.parse() - assert_matches_type(ReferenceGetResponse, reference, path=["response"]) + assert_matches_type(AsyncSinglePage[ReferenceGetResponse], reference, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -99,7 +100,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" reference = await response.parse() - assert_matches_type(ReferenceGetResponse, reference, path=["response"]) + assert_matches_type(AsyncSinglePage[ReferenceGetResponse], reference, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/load_balancers/pools/test_references.py b/tests/api_resources/load_balancers/pools/test_references.py index a62251e00e6..117c8a62c26 100644 --- a/tests/api_resources/load_balancers/pools/test_references.py +++ b/tests/api_resources/load_balancers/pools/test_references.py @@ -9,6 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.load_balancers.pools import ReferenceGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +24,7 @@ def test_method_get(self, client: Cloudflare) -> None: pool_id="17b5962d775c646f3f9725cbc7a53df4", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ReferenceGetResponse, reference, path=["response"]) + assert_matches_type(SyncSinglePage[ReferenceGetResponse], reference, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -35,7 +36,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" reference = response.parse() - assert_matches_type(ReferenceGetResponse, reference, path=["response"]) + assert_matches_type(SyncSinglePage[ReferenceGetResponse], reference, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -47,7 +48,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" reference = response.parse() - assert_matches_type(ReferenceGetResponse, reference, path=["response"]) + assert_matches_type(SyncSinglePage[ReferenceGetResponse], reference, path=["response"]) assert cast(Any, response.is_closed) is True @@ -75,7 +76,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: pool_id="17b5962d775c646f3f9725cbc7a53df4", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ReferenceGetResponse, reference, path=["response"]) + assert_matches_type(AsyncSinglePage[ReferenceGetResponse], reference, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -87,7 +88,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" reference = await response.parse() - assert_matches_type(ReferenceGetResponse, reference, path=["response"]) + assert_matches_type(AsyncSinglePage[ReferenceGetResponse], reference, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -99,7 +100,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" reference = await response.parse() - assert_matches_type(ReferenceGetResponse, reference, path=["response"]) + assert_matches_type(AsyncSinglePage[ReferenceGetResponse], reference, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/load_balancers/test_pools.py b/tests/api_resources/load_balancers/test_pools.py index 3808356bd7f..67c472f3840 100644 --- a/tests/api_resources/load_balancers/test_pools.py +++ b/tests/api_resources/load_balancers/test_pools.py @@ -13,7 +13,6 @@ from cloudflare.types.load_balancers import ( Pool, PoolDeleteResponse, - PoolBulkEditResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -311,7 +310,7 @@ def test_method_bulk_edit(self, client: Cloudflare) -> None: pool = client.load_balancers.pools.bulk_edit( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(PoolBulkEditResponse, pool, path=["response"]) + assert_matches_type(SyncSinglePage[Pool], pool, path=["response"]) @parametrize def test_method_bulk_edit_with_all_params(self, client: Cloudflare) -> None: @@ -319,7 +318,7 @@ def test_method_bulk_edit_with_all_params(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", notification_email="", ) - assert_matches_type(PoolBulkEditResponse, pool, path=["response"]) + assert_matches_type(SyncSinglePage[Pool], pool, path=["response"]) @parametrize def test_raw_response_bulk_edit(self, client: Cloudflare) -> None: @@ -330,7 +329,7 @@ def test_raw_response_bulk_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" pool = response.parse() - assert_matches_type(PoolBulkEditResponse, pool, path=["response"]) + assert_matches_type(SyncSinglePage[Pool], pool, path=["response"]) @parametrize def test_streaming_response_bulk_edit(self, client: Cloudflare) -> None: @@ -341,7 +340,7 @@ def test_streaming_response_bulk_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" pool = response.parse() - assert_matches_type(PoolBulkEditResponse, pool, path=["response"]) + assert_matches_type(SyncSinglePage[Pool], pool, path=["response"]) assert cast(Any, response.is_closed) is True @@ -785,7 +784,7 @@ async def test_method_bulk_edit(self, async_client: AsyncCloudflare) -> None: pool = await async_client.load_balancers.pools.bulk_edit( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(PoolBulkEditResponse, pool, path=["response"]) + assert_matches_type(AsyncSinglePage[Pool], pool, path=["response"]) @parametrize async def test_method_bulk_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -793,7 +792,7 @@ async def test_method_bulk_edit_with_all_params(self, async_client: AsyncCloudfl account_id="023e105f4ecef8ad9ca31a8372d0c353", notification_email="", ) - assert_matches_type(PoolBulkEditResponse, pool, path=["response"]) + assert_matches_type(AsyncSinglePage[Pool], pool, path=["response"]) @parametrize async def test_raw_response_bulk_edit(self, async_client: AsyncCloudflare) -> None: @@ -804,7 +803,7 @@ async def test_raw_response_bulk_edit(self, async_client: AsyncCloudflare) -> No assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" pool = await response.parse() - assert_matches_type(PoolBulkEditResponse, pool, path=["response"]) + assert_matches_type(AsyncSinglePage[Pool], pool, path=["response"]) @parametrize async def test_streaming_response_bulk_edit(self, async_client: AsyncCloudflare) -> None: @@ -815,7 +814,7 @@ async def test_streaming_response_bulk_edit(self, async_client: AsyncCloudflare) assert response.http_request.headers.get("X-Stainless-Lang") == "python" pool = await response.parse() - assert_matches_type(PoolBulkEditResponse, pool, path=["response"]) + assert_matches_type(AsyncSinglePage[Pool], pool, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/logpush/datasets/test_jobs.py b/tests/api_resources/logpush/datasets/test_jobs.py index 26badfe9b3f..d57325c4945 100644 --- a/tests/api_resources/logpush/datasets/test_jobs.py +++ b/tests/api_resources/logpush/datasets/test_jobs.py @@ -9,7 +9,8 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.logpush.datasets import JobGetResponse +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.logpush import LogpushJob base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +25,7 @@ def test_method_get(self, client: Cloudflare) -> None: dataset_id="gateway_dns", account_id="account_id", ) - assert_matches_type(Optional[JobGetResponse], job, path=["response"]) + assert_matches_type(SyncSinglePage[Optional[LogpushJob]], job, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -33,7 +34,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: dataset_id="gateway_dns", account_id="account_id", ) - assert_matches_type(Optional[JobGetResponse], job, path=["response"]) + assert_matches_type(SyncSinglePage[Optional[LogpushJob]], job, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -46,7 +47,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" job = response.parse() - assert_matches_type(Optional[JobGetResponse], job, path=["response"]) + assert_matches_type(SyncSinglePage[Optional[LogpushJob]], job, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -59,7 +60,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" job = response.parse() - assert_matches_type(Optional[JobGetResponse], job, path=["response"]) + assert_matches_type(SyncSinglePage[Optional[LogpushJob]], job, path=["response"]) assert cast(Any, response.is_closed) is True @@ -95,7 +96,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: dataset_id="gateway_dns", account_id="account_id", ) - assert_matches_type(Optional[JobGetResponse], job, path=["response"]) + assert_matches_type(AsyncSinglePage[Optional[LogpushJob]], job, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -104,7 +105,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - dataset_id="gateway_dns", account_id="account_id", ) - assert_matches_type(Optional[JobGetResponse], job, path=["response"]) + assert_matches_type(AsyncSinglePage[Optional[LogpushJob]], job, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -117,7 +118,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" job = await response.parse() - assert_matches_type(Optional[JobGetResponse], job, path=["response"]) + assert_matches_type(AsyncSinglePage[Optional[LogpushJob]], job, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -130,7 +131,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" job = await response.parse() - assert_matches_type(Optional[JobGetResponse], job, path=["response"]) + assert_matches_type(AsyncSinglePage[Optional[LogpushJob]], job, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/logpush/test_edge.py b/tests/api_resources/logpush/test_edge.py index 850a8a4cb57..c110064ecf9 100644 --- a/tests/api_resources/logpush/test_edge.py +++ b/tests/api_resources/logpush/test_edge.py @@ -9,7 +9,8 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.logpush import EdgeGetResponse, InstantLogpushJob +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.logpush import InstantLogpushJob base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -70,7 +71,7 @@ def test_method_get(self, client: Cloudflare) -> None: edge = client.logpush.edge.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[EdgeGetResponse], edge, path=["response"]) + assert_matches_type(SyncSinglePage[Optional[InstantLogpushJob]], edge, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -81,7 +82,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" edge = response.parse() - assert_matches_type(Optional[EdgeGetResponse], edge, path=["response"]) + assert_matches_type(SyncSinglePage[Optional[InstantLogpushJob]], edge, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -92,7 +93,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" edge = response.parse() - assert_matches_type(Optional[EdgeGetResponse], edge, path=["response"]) + assert_matches_type(SyncSinglePage[Optional[InstantLogpushJob]], edge, path=["response"]) assert cast(Any, response.is_closed) is True @@ -160,7 +161,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: edge = await async_client.logpush.edge.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[EdgeGetResponse], edge, path=["response"]) + assert_matches_type(AsyncSinglePage[Optional[InstantLogpushJob]], edge, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -171,7 +172,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" edge = await response.parse() - assert_matches_type(Optional[EdgeGetResponse], edge, path=["response"]) + assert_matches_type(AsyncSinglePage[Optional[InstantLogpushJob]], edge, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -182,7 +183,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" edge = await response.parse() - assert_matches_type(Optional[EdgeGetResponse], edge, path=["response"]) + assert_matches_type(AsyncSinglePage[Optional[InstantLogpushJob]], edge, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/magic_transit/pcaps/test_ownership.py b/tests/api_resources/magic_transit/pcaps/test_ownership.py index a1d62b85d3c..7a7d3ea89ec 100644 --- a/tests/api_resources/magic_transit/pcaps/test_ownership.py +++ b/tests/api_resources/magic_transit/pcaps/test_ownership.py @@ -3,16 +3,14 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.magic_transit.pcaps import ( - Ownership, - OwnershipGetResponse, -) +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.magic_transit.pcaps import Ownership base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -115,7 +113,7 @@ def test_method_get(self, client: Cloudflare) -> None: ownership = client.magic_transit.pcaps.ownership.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[OwnershipGetResponse], ownership, path=["response"]) + assert_matches_type(SyncSinglePage[Ownership], ownership, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -126,7 +124,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ownership = response.parse() - assert_matches_type(Optional[OwnershipGetResponse], ownership, path=["response"]) + assert_matches_type(SyncSinglePage[Ownership], ownership, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -137,7 +135,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ownership = response.parse() - assert_matches_type(Optional[OwnershipGetResponse], ownership, path=["response"]) + assert_matches_type(SyncSinglePage[Ownership], ownership, path=["response"]) assert cast(Any, response.is_closed) is True @@ -293,7 +291,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: ownership = await async_client.magic_transit.pcaps.ownership.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[OwnershipGetResponse], ownership, path=["response"]) + assert_matches_type(AsyncSinglePage[Ownership], ownership, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -304,7 +302,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ownership = await response.parse() - assert_matches_type(Optional[OwnershipGetResponse], ownership, path=["response"]) + assert_matches_type(AsyncSinglePage[Ownership], ownership, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -315,7 +313,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" ownership = await response.parse() - assert_matches_type(Optional[OwnershipGetResponse], ownership, path=["response"]) + assert_matches_type(AsyncSinglePage[Ownership], ownership, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/magic_transit/sites/test_lans.py b/tests/api_resources/magic_transit/sites/test_lans.py index df37edd9210..e7a88b249c2 100644 --- a/tests/api_resources/magic_transit/sites/test_lans.py +++ b/tests/api_resources/magic_transit/sites/test_lans.py @@ -12,7 +12,6 @@ from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.magic_transit.sites import ( LAN, - LANCreateResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -29,7 +28,7 @@ def test_method_create(self, client: Cloudflare) -> None: physport=1, vlan_tag=0, ) - assert_matches_type(LANCreateResponse, lan, path=["response"]) + assert_matches_type(SyncSinglePage[LAN], lan, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: @@ -65,7 +64,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "virtual_address": "192.0.2.0/24", }, ) - assert_matches_type(LANCreateResponse, lan, path=["response"]) + assert_matches_type(SyncSinglePage[LAN], lan, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -79,7 +78,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" lan = response.parse() - assert_matches_type(LANCreateResponse, lan, path=["response"]) + assert_matches_type(SyncSinglePage[LAN], lan, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -93,7 +92,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" lan = response.parse() - assert_matches_type(LANCreateResponse, lan, path=["response"]) + assert_matches_type(SyncSinglePage[LAN], lan, path=["response"]) assert cast(Any, response.is_closed) is True @@ -487,7 +486,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: physport=1, vlan_tag=0, ) - assert_matches_type(LANCreateResponse, lan, path=["response"]) + assert_matches_type(AsyncSinglePage[LAN], lan, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -523,7 +522,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "virtual_address": "192.0.2.0/24", }, ) - assert_matches_type(LANCreateResponse, lan, path=["response"]) + assert_matches_type(AsyncSinglePage[LAN], lan, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -537,7 +536,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" lan = await response.parse() - assert_matches_type(LANCreateResponse, lan, path=["response"]) + assert_matches_type(AsyncSinglePage[LAN], lan, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -551,7 +550,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" lan = await response.parse() - assert_matches_type(LANCreateResponse, lan, path=["response"]) + assert_matches_type(AsyncSinglePage[LAN], lan, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/magic_transit/sites/test_wans.py b/tests/api_resources/magic_transit/sites/test_wans.py index c3ba81f3615..e99e4b31b8a 100644 --- a/tests/api_resources/magic_transit/sites/test_wans.py +++ b/tests/api_resources/magic_transit/sites/test_wans.py @@ -12,7 +12,6 @@ from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.magic_transit.sites import ( WAN, - WANCreateResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -29,7 +28,7 @@ def test_method_create(self, client: Cloudflare) -> None: physport=1, vlan_tag=0, ) - assert_matches_type(WANCreateResponse, wan, path=["response"]) + assert_matches_type(SyncSinglePage[WAN], wan, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: @@ -46,7 +45,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "secondary_address": "192.0.2.0/24", }, ) - assert_matches_type(WANCreateResponse, wan, path=["response"]) + assert_matches_type(SyncSinglePage[WAN], wan, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -60,7 +59,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" wan = response.parse() - assert_matches_type(WANCreateResponse, wan, path=["response"]) + assert_matches_type(SyncSinglePage[WAN], wan, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -74,7 +73,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" wan = response.parse() - assert_matches_type(WANCreateResponse, wan, path=["response"]) + assert_matches_type(SyncSinglePage[WAN], wan, path=["response"]) assert cast(Any, response.is_closed) is True @@ -432,7 +431,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: physport=1, vlan_tag=0, ) - assert_matches_type(WANCreateResponse, wan, path=["response"]) + assert_matches_type(AsyncSinglePage[WAN], wan, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -449,7 +448,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "secondary_address": "192.0.2.0/24", }, ) - assert_matches_type(WANCreateResponse, wan, path=["response"]) + assert_matches_type(AsyncSinglePage[WAN], wan, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -463,7 +462,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" wan = await response.parse() - assert_matches_type(WANCreateResponse, wan, path=["response"]) + assert_matches_type(AsyncSinglePage[WAN], wan, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -477,7 +476,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" wan = await response.parse() - assert_matches_type(WANCreateResponse, wan, path=["response"]) + assert_matches_type(AsyncSinglePage[WAN], wan, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/mtls_certificates/test_associations.py b/tests/api_resources/mtls_certificates/test_associations.py index 8c28a978c39..6f11e303c01 100644 --- a/tests/api_resources/mtls_certificates/test_associations.py +++ b/tests/api_resources/mtls_certificates/test_associations.py @@ -3,13 +3,14 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.mtls_certificates import AssociationGetResponse +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.mtls_certificates import CertificateAsssociation base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +24,7 @@ def test_method_get(self, client: Cloudflare) -> None: mtls_certificate_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[AssociationGetResponse], association, path=["response"]) + assert_matches_type(SyncSinglePage[CertificateAsssociation], association, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -35,7 +36,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" association = response.parse() - assert_matches_type(Optional[AssociationGetResponse], association, path=["response"]) + assert_matches_type(SyncSinglePage[CertificateAsssociation], association, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -47,7 +48,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" association = response.parse() - assert_matches_type(Optional[AssociationGetResponse], association, path=["response"]) + assert_matches_type(SyncSinglePage[CertificateAsssociation], association, path=["response"]) assert cast(Any, response.is_closed) is True @@ -75,7 +76,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: mtls_certificate_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[AssociationGetResponse], association, path=["response"]) + assert_matches_type(AsyncSinglePage[CertificateAsssociation], association, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -87,7 +88,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" association = await response.parse() - assert_matches_type(Optional[AssociationGetResponse], association, path=["response"]) + assert_matches_type(AsyncSinglePage[CertificateAsssociation], association, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -99,7 +100,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" association = await response.parse() - assert_matches_type(Optional[AssociationGetResponse], association, path=["response"]) + assert_matches_type(AsyncSinglePage[CertificateAsssociation], association, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/origin_tls_client_auth/test_hostnames.py b/tests/api_resources/origin_tls_client_auth/test_hostnames.py index a1b05d5b190..37839d99139 100644 --- a/tests/api_resources/origin_tls_client_auth/test_hostnames.py +++ b/tests/api_resources/origin_tls_client_auth/test_hostnames.py @@ -9,6 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.origin_tls_client_auth import ( HostnameUpdateResponse, AuthenticatedOriginPull, @@ -26,7 +27,7 @@ def test_method_update(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", config=[{}], ) - assert_matches_type(Optional[HostnameUpdateResponse], hostname, path=["response"]) + assert_matches_type(SyncSinglePage[HostnameUpdateResponse], hostname, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: @@ -38,7 +39,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname = response.parse() - assert_matches_type(Optional[HostnameUpdateResponse], hostname, path=["response"]) + assert_matches_type(SyncSinglePage[HostnameUpdateResponse], hostname, path=["response"]) @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: @@ -50,7 +51,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname = response.parse() - assert_matches_type(Optional[HostnameUpdateResponse], hostname, path=["response"]) + assert_matches_type(SyncSinglePage[HostnameUpdateResponse], hostname, path=["response"]) assert cast(Any, response.is_closed) is True @@ -120,7 +121,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", config=[{}], ) - assert_matches_type(Optional[HostnameUpdateResponse], hostname, path=["response"]) + assert_matches_type(AsyncSinglePage[HostnameUpdateResponse], hostname, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @@ -132,7 +133,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname = await response.parse() - assert_matches_type(Optional[HostnameUpdateResponse], hostname, path=["response"]) + assert_matches_type(AsyncSinglePage[HostnameUpdateResponse], hostname, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: @@ -144,7 +145,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname = await response.parse() - assert_matches_type(Optional[HostnameUpdateResponse], hostname, path=["response"]) + assert_matches_type(AsyncSinglePage[HostnameUpdateResponse], hostname, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/queues/test_consumers.py b/tests/api_resources/queues/test_consumers.py index b566b540ad7..088cbc4a814 100644 --- a/tests/api_resources/queues/test_consumers.py +++ b/tests/api_resources/queues/test_consumers.py @@ -9,11 +9,8 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.queues import ( - Consumer, - ConsumerGetResponse, - ConsumerDeleteResponse, -) +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.queues import Consumer, ConsumerDeleteResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -373,7 +370,7 @@ def test_method_get(self, client: Cloudflare) -> None: queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ConsumerGetResponse], consumer, path=["response"]) + assert_matches_type(SyncSinglePage[Consumer], consumer, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -385,7 +382,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = response.parse() - assert_matches_type(Optional[ConsumerGetResponse], consumer, path=["response"]) + assert_matches_type(SyncSinglePage[Consumer], consumer, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -397,7 +394,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = response.parse() - assert_matches_type(Optional[ConsumerGetResponse], consumer, path=["response"]) + assert_matches_type(SyncSinglePage[Consumer], consumer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -771,7 +768,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ConsumerGetResponse], consumer, path=["response"]) + assert_matches_type(AsyncSinglePage[Consumer], consumer, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -783,7 +780,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = await response.parse() - assert_matches_type(Optional[ConsumerGetResponse], consumer, path=["response"]) + assert_matches_type(AsyncSinglePage[Consumer], consumer, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -795,7 +792,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = await response.parse() - assert_matches_type(Optional[ConsumerGetResponse], consumer, path=["response"]) + assert_matches_type(AsyncSinglePage[Consumer], consumer, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/queues/test_messages.py b/tests/api_resources/queues/test_messages.py index d17b7b03a74..89e031e692f 100644 --- a/tests/api_resources/queues/test_messages.py +++ b/tests/api_resources/queues/test_messages.py @@ -9,6 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.queues import MessageAckResponse, MessagePullResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -90,7 +91,7 @@ def test_method_pull(self, client: Cloudflare) -> None: queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[MessagePullResponse], message, path=["response"]) + assert_matches_type(SyncSinglePage[MessagePullResponse], message, path=["response"]) @parametrize def test_method_pull_with_all_params(self, client: Cloudflare) -> None: @@ -100,7 +101,7 @@ def test_method_pull_with_all_params(self, client: Cloudflare) -> None: batch_size=50, visibility_timeout_ms=6000, ) - assert_matches_type(Optional[MessagePullResponse], message, path=["response"]) + assert_matches_type(SyncSinglePage[MessagePullResponse], message, path=["response"]) @parametrize def test_raw_response_pull(self, client: Cloudflare) -> None: @@ -112,7 +113,7 @@ def test_raw_response_pull(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" message = response.parse() - assert_matches_type(Optional[MessagePullResponse], message, path=["response"]) + assert_matches_type(SyncSinglePage[MessagePullResponse], message, path=["response"]) @parametrize def test_streaming_response_pull(self, client: Cloudflare) -> None: @@ -124,7 +125,7 @@ def test_streaming_response_pull(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" message = response.parse() - assert_matches_type(Optional[MessagePullResponse], message, path=["response"]) + assert_matches_type(SyncSinglePage[MessagePullResponse], message, path=["response"]) assert cast(Any, response.is_closed) is True @@ -219,7 +220,7 @@ async def test_method_pull(self, async_client: AsyncCloudflare) -> None: queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[MessagePullResponse], message, path=["response"]) + assert_matches_type(AsyncSinglePage[MessagePullResponse], message, path=["response"]) @parametrize async def test_method_pull_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -229,7 +230,7 @@ async def test_method_pull_with_all_params(self, async_client: AsyncCloudflare) batch_size=50, visibility_timeout_ms=6000, ) - assert_matches_type(Optional[MessagePullResponse], message, path=["response"]) + assert_matches_type(AsyncSinglePage[MessagePullResponse], message, path=["response"]) @parametrize async def test_raw_response_pull(self, async_client: AsyncCloudflare) -> None: @@ -241,7 +242,7 @@ async def test_raw_response_pull(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" message = await response.parse() - assert_matches_type(Optional[MessagePullResponse], message, path=["response"]) + assert_matches_type(AsyncSinglePage[MessagePullResponse], message, path=["response"]) @parametrize async def test_streaming_response_pull(self, async_client: AsyncCloudflare) -> None: @@ -253,7 +254,7 @@ async def test_streaming_response_pull(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" message = await response.parse() - assert_matches_type(Optional[MessagePullResponse], message, path=["response"]) + assert_matches_type(AsyncSinglePage[MessagePullResponse], message, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/snippets/test_rules.py b/tests/api_resources/snippets/test_rules.py index 644eedf8d47..53816f2070b 100644 --- a/tests/api_resources/snippets/test_rules.py +++ b/tests/api_resources/snippets/test_rules.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest @@ -23,7 +23,7 @@ def test_method_update(self, client: Cloudflare) -> None: rule = client.snippets.rules.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[RuleUpdateResponse], rule, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Cloudflare) -> None: @@ -38,7 +38,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: } ], ) - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[RuleUpdateResponse], rule, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: @@ -49,7 +49,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[RuleUpdateResponse], rule, path=["response"]) @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: @@ -60,7 +60,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[RuleUpdateResponse], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -156,7 +156,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: rule = await async_client.snippets.rules.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[RuleUpdateResponse], rule, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -171,7 +171,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare } ], ) - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[RuleUpdateResponse], rule, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @@ -182,7 +182,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[RuleUpdateResponse], rule, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: @@ -193,7 +193,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[RuleUpdateResponse], rule, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/stream/test_audio_tracks.py b/tests/api_resources/stream/test_audio_tracks.py index 59b9b7d95ba..bf7462cf829 100644 --- a/tests/api_resources/stream/test_audio_tracks.py +++ b/tests/api_resources/stream/test_audio_tracks.py @@ -9,10 +9,8 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.stream import ( - Audio, - AudioTrackGetResponse, -) +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.stream import Audio base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -220,7 +218,7 @@ def test_method_get(self, client: Cloudflare) -> None: identifier="ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[AudioTrackGetResponse], audio_track, path=["response"]) + assert_matches_type(SyncSinglePage[Audio], audio_track, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -232,7 +230,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" audio_track = response.parse() - assert_matches_type(Optional[AudioTrackGetResponse], audio_track, path=["response"]) + assert_matches_type(SyncSinglePage[Audio], audio_track, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -244,7 +242,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" audio_track = response.parse() - assert_matches_type(Optional[AudioTrackGetResponse], audio_track, path=["response"]) + assert_matches_type(SyncSinglePage[Audio], audio_track, path=["response"]) assert cast(Any, response.is_closed) is True @@ -466,7 +464,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: identifier="ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[AudioTrackGetResponse], audio_track, path=["response"]) + assert_matches_type(AsyncSinglePage[Audio], audio_track, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -478,7 +476,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" audio_track = await response.parse() - assert_matches_type(Optional[AudioTrackGetResponse], audio_track, path=["response"]) + assert_matches_type(AsyncSinglePage[Audio], audio_track, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -490,7 +488,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" audio_track = await response.parse() - assert_matches_type(Optional[AudioTrackGetResponse], audio_track, path=["response"]) + assert_matches_type(AsyncSinglePage[Audio], audio_track, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/stream/test_captions.py b/tests/api_resources/stream/test_captions.py index 75cf3073069..89847fcdd1a 100644 --- a/tests/api_resources/stream/test_captions.py +++ b/tests/api_resources/stream/test_captions.py @@ -3,13 +3,14 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.stream import CaptionGetResponse +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.stream import Caption base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +24,7 @@ def test_method_get(self, client: Cloudflare) -> None: identifier="ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[CaptionGetResponse], caption, path=["response"]) + assert_matches_type(SyncSinglePage[Caption], caption, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -35,7 +36,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" caption = response.parse() - assert_matches_type(Optional[CaptionGetResponse], caption, path=["response"]) + assert_matches_type(SyncSinglePage[Caption], caption, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -47,7 +48,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" caption = response.parse() - assert_matches_type(Optional[CaptionGetResponse], caption, path=["response"]) + assert_matches_type(SyncSinglePage[Caption], caption, path=["response"]) assert cast(Any, response.is_closed) is True @@ -75,7 +76,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: identifier="ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[CaptionGetResponse], caption, path=["response"]) + assert_matches_type(AsyncSinglePage[Caption], caption, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -87,7 +88,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" caption = await response.parse() - assert_matches_type(Optional[CaptionGetResponse], caption, path=["response"]) + assert_matches_type(AsyncSinglePage[Caption], caption, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -99,7 +100,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" caption = await response.parse() - assert_matches_type(Optional[CaptionGetResponse], caption, path=["response"]) + assert_matches_type(AsyncSinglePage[Caption], caption, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/stream/test_keys.py b/tests/api_resources/stream/test_keys.py index ee3f8f0f699..fba7bbc8253 100644 --- a/tests/api_resources/stream/test_keys.py +++ b/tests/api_resources/stream/test_keys.py @@ -9,6 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.stream import Keys, KeyGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -112,7 +113,7 @@ def test_method_get(self, client: Cloudflare) -> None: key = client.stream.keys.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[KeyGetResponse], key, path=["response"]) + assert_matches_type(SyncSinglePage[KeyGetResponse], key, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -123,7 +124,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" key = response.parse() - assert_matches_type(Optional[KeyGetResponse], key, path=["response"]) + assert_matches_type(SyncSinglePage[KeyGetResponse], key, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -134,7 +135,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" key = response.parse() - assert_matches_type(Optional[KeyGetResponse], key, path=["response"]) + assert_matches_type(SyncSinglePage[KeyGetResponse], key, path=["response"]) assert cast(Any, response.is_closed) is True @@ -244,7 +245,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: key = await async_client.stream.keys.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[KeyGetResponse], key, path=["response"]) + assert_matches_type(AsyncSinglePage[KeyGetResponse], key, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -255,7 +256,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" key = await response.parse() - assert_matches_type(Optional[KeyGetResponse], key, path=["response"]) + assert_matches_type(AsyncSinglePage[KeyGetResponse], key, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -266,7 +267,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" key = await response.parse() - assert_matches_type(Optional[KeyGetResponse], key, path=["response"]) + assert_matches_type(AsyncSinglePage[KeyGetResponse], key, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_custom_nameservers.py b/tests/api_resources/test_custom_nameservers.py index e64edbc4327..7616efab5f3 100644 --- a/tests/api_resources/test_custom_nameservers.py +++ b/tests/api_resources/test_custom_nameservers.py @@ -9,9 +9,9 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.custom_nameservers import ( CustomNameserver, - CustomNameserverGetResponse, CustomNameserverDeleteResponse, CustomNameserverAvailabiltyResponse, ) @@ -79,7 +79,7 @@ def test_method_delete(self, client: Cloudflare) -> None: custom_ns_id="ns1.example.com", account_id="372e67954025e0ba6aaa6d586b9e0b59", ) - assert_matches_type(Optional[CustomNameserverDeleteResponse], custom_nameserver, path=["response"]) + assert_matches_type(SyncSinglePage[CustomNameserverDeleteResponse], custom_nameserver, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -91,7 +91,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_nameserver = response.parse() - assert_matches_type(Optional[CustomNameserverDeleteResponse], custom_nameserver, path=["response"]) + assert_matches_type(SyncSinglePage[CustomNameserverDeleteResponse], custom_nameserver, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -103,7 +103,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_nameserver = response.parse() - assert_matches_type(Optional[CustomNameserverDeleteResponse], custom_nameserver, path=["response"]) + assert_matches_type(SyncSinglePage[CustomNameserverDeleteResponse], custom_nameserver, path=["response"]) assert cast(Any, response.is_closed) is True @@ -126,7 +126,7 @@ def test_method_availabilty(self, client: Cloudflare) -> None: custom_nameserver = client.custom_nameservers.availabilty( account_id="372e67954025e0ba6aaa6d586b9e0b59", ) - assert_matches_type(Optional[CustomNameserverAvailabiltyResponse], custom_nameserver, path=["response"]) + assert_matches_type(SyncSinglePage[CustomNameserverAvailabiltyResponse], custom_nameserver, path=["response"]) @parametrize def test_raw_response_availabilty(self, client: Cloudflare) -> None: @@ -137,7 +137,7 @@ def test_raw_response_availabilty(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_nameserver = response.parse() - assert_matches_type(Optional[CustomNameserverAvailabiltyResponse], custom_nameserver, path=["response"]) + assert_matches_type(SyncSinglePage[CustomNameserverAvailabiltyResponse], custom_nameserver, path=["response"]) @parametrize def test_streaming_response_availabilty(self, client: Cloudflare) -> None: @@ -148,7 +148,9 @@ def test_streaming_response_availabilty(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_nameserver = response.parse() - assert_matches_type(Optional[CustomNameserverAvailabiltyResponse], custom_nameserver, path=["response"]) + assert_matches_type( + SyncSinglePage[CustomNameserverAvailabiltyResponse], custom_nameserver, path=["response"] + ) assert cast(Any, response.is_closed) is True @@ -164,7 +166,7 @@ def test_method_get(self, client: Cloudflare) -> None: custom_nameserver = client.custom_nameservers.get( account_id="372e67954025e0ba6aaa6d586b9e0b59", ) - assert_matches_type(Optional[CustomNameserverGetResponse], custom_nameserver, path=["response"]) + assert_matches_type(SyncSinglePage[CustomNameserver], custom_nameserver, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -175,7 +177,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_nameserver = response.parse() - assert_matches_type(Optional[CustomNameserverGetResponse], custom_nameserver, path=["response"]) + assert_matches_type(SyncSinglePage[CustomNameserver], custom_nameserver, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -186,7 +188,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_nameserver = response.parse() - assert_matches_type(Optional[CustomNameserverGetResponse], custom_nameserver, path=["response"]) + assert_matches_type(SyncSinglePage[CustomNameserver], custom_nameserver, path=["response"]) assert cast(Any, response.is_closed) is True @@ -258,7 +260,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: custom_ns_id="ns1.example.com", account_id="372e67954025e0ba6aaa6d586b9e0b59", ) - assert_matches_type(Optional[CustomNameserverDeleteResponse], custom_nameserver, path=["response"]) + assert_matches_type(AsyncSinglePage[CustomNameserverDeleteResponse], custom_nameserver, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -270,7 +272,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_nameserver = await response.parse() - assert_matches_type(Optional[CustomNameserverDeleteResponse], custom_nameserver, path=["response"]) + assert_matches_type(AsyncSinglePage[CustomNameserverDeleteResponse], custom_nameserver, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -282,7 +284,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_nameserver = await response.parse() - assert_matches_type(Optional[CustomNameserverDeleteResponse], custom_nameserver, path=["response"]) + assert_matches_type(AsyncSinglePage[CustomNameserverDeleteResponse], custom_nameserver, path=["response"]) assert cast(Any, response.is_closed) is True @@ -305,7 +307,7 @@ async def test_method_availabilty(self, async_client: AsyncCloudflare) -> None: custom_nameserver = await async_client.custom_nameservers.availabilty( account_id="372e67954025e0ba6aaa6d586b9e0b59", ) - assert_matches_type(Optional[CustomNameserverAvailabiltyResponse], custom_nameserver, path=["response"]) + assert_matches_type(AsyncSinglePage[CustomNameserverAvailabiltyResponse], custom_nameserver, path=["response"]) @parametrize async def test_raw_response_availabilty(self, async_client: AsyncCloudflare) -> None: @@ -316,7 +318,7 @@ async def test_raw_response_availabilty(self, async_client: AsyncCloudflare) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_nameserver = await response.parse() - assert_matches_type(Optional[CustomNameserverAvailabiltyResponse], custom_nameserver, path=["response"]) + assert_matches_type(AsyncSinglePage[CustomNameserverAvailabiltyResponse], custom_nameserver, path=["response"]) @parametrize async def test_streaming_response_availabilty(self, async_client: AsyncCloudflare) -> None: @@ -327,7 +329,9 @@ async def test_streaming_response_availabilty(self, async_client: AsyncCloudflar assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_nameserver = await response.parse() - assert_matches_type(Optional[CustomNameserverAvailabiltyResponse], custom_nameserver, path=["response"]) + assert_matches_type( + AsyncSinglePage[CustomNameserverAvailabiltyResponse], custom_nameserver, path=["response"] + ) assert cast(Any, response.is_closed) is True @@ -343,7 +347,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: custom_nameserver = await async_client.custom_nameservers.get( account_id="372e67954025e0ba6aaa6d586b9e0b59", ) - assert_matches_type(Optional[CustomNameserverGetResponse], custom_nameserver, path=["response"]) + assert_matches_type(AsyncSinglePage[CustomNameserver], custom_nameserver, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -354,7 +358,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_nameserver = await response.parse() - assert_matches_type(Optional[CustomNameserverGetResponse], custom_nameserver, path=["response"]) + assert_matches_type(AsyncSinglePage[CustomNameserver], custom_nameserver, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -365,7 +369,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_nameserver = await response.parse() - assert_matches_type(Optional[CustomNameserverGetResponse], custom_nameserver, path=["response"]) + assert_matches_type(AsyncSinglePage[CustomNameserver], custom_nameserver, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_filters.py b/tests/api_resources/test_filters.py index c85398c274e..1f0aaa1080f 100644 --- a/tests/api_resources/test_filters.py +++ b/tests/api_resources/test_filters.py @@ -3,19 +3,14 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray -from cloudflare.types.filters import ( - FirewallFilter, - FilterCreateResponse, - FilterBulkDeleteResponse, - FilterBulkUpdateResponse, -) +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage, SyncV4PagePaginationArray, AsyncV4PagePaginationArray +from cloudflare.types.filters import FirewallFilter # pyright: reportDeprecated=false @@ -34,7 +29,7 @@ def test_method_create(self, client: Cloudflare) -> None: expression='(http.request.uri.path ~ ".*wp-login.php" or http.request.uri.path ~ ".*xmlrpc.php") and ip.addr ne 172.16.22.155', ) - assert_matches_type(Optional[FilterCreateResponse], filter, path=["response"]) + assert_matches_type(SyncSinglePage[FirewallFilter], filter, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -48,7 +43,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" filter = response.parse() - assert_matches_type(Optional[FilterCreateResponse], filter, path=["response"]) + assert_matches_type(SyncSinglePage[FirewallFilter], filter, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -62,7 +57,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" filter = response.parse() - assert_matches_type(Optional[FilterCreateResponse], filter, path=["response"]) + assert_matches_type(SyncSinglePage[FirewallFilter], filter, path=["response"]) assert cast(Any, response.is_closed) is True @@ -257,7 +252,7 @@ def test_method_bulk_delete(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[FilterBulkDeleteResponse], filter, path=["response"]) + assert_matches_type(SyncSinglePage[FirewallFilter], filter, path=["response"]) @parametrize def test_raw_response_bulk_delete(self, client: Cloudflare) -> None: @@ -269,7 +264,7 @@ def test_raw_response_bulk_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" filter = response.parse() - assert_matches_type(Optional[FilterBulkDeleteResponse], filter, path=["response"]) + assert_matches_type(SyncSinglePage[FirewallFilter], filter, path=["response"]) @parametrize def test_streaming_response_bulk_delete(self, client: Cloudflare) -> None: @@ -281,7 +276,7 @@ def test_streaming_response_bulk_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" filter = response.parse() - assert_matches_type(Optional[FilterBulkDeleteResponse], filter, path=["response"]) + assert_matches_type(SyncSinglePage[FirewallFilter], filter, path=["response"]) assert cast(Any, response.is_closed) is True @@ -301,7 +296,7 @@ def test_method_bulk_update(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[FilterBulkUpdateResponse], filter, path=["response"]) + assert_matches_type(SyncSinglePage[FirewallFilter], filter, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -314,7 +309,7 @@ def test_raw_response_bulk_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" filter = response.parse() - assert_matches_type(Optional[FilterBulkUpdateResponse], filter, path=["response"]) + assert_matches_type(SyncSinglePage[FirewallFilter], filter, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -327,7 +322,7 @@ def test_streaming_response_bulk_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" filter = response.parse() - assert_matches_type(Optional[FilterBulkUpdateResponse], filter, path=["response"]) + assert_matches_type(SyncSinglePage[FirewallFilter], filter, path=["response"]) assert cast(Any, response.is_closed) is True @@ -406,7 +401,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: expression='(http.request.uri.path ~ ".*wp-login.php" or http.request.uri.path ~ ".*xmlrpc.php") and ip.addr ne 172.16.22.155', ) - assert_matches_type(Optional[FilterCreateResponse], filter, path=["response"]) + assert_matches_type(AsyncSinglePage[FirewallFilter], filter, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -420,7 +415,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" filter = await response.parse() - assert_matches_type(Optional[FilterCreateResponse], filter, path=["response"]) + assert_matches_type(AsyncSinglePage[FirewallFilter], filter, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -434,7 +429,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" filter = await response.parse() - assert_matches_type(Optional[FilterCreateResponse], filter, path=["response"]) + assert_matches_type(AsyncSinglePage[FirewallFilter], filter, path=["response"]) assert cast(Any, response.is_closed) is True @@ -629,7 +624,7 @@ async def test_method_bulk_delete(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[FilterBulkDeleteResponse], filter, path=["response"]) + assert_matches_type(AsyncSinglePage[FirewallFilter], filter, path=["response"]) @parametrize async def test_raw_response_bulk_delete(self, async_client: AsyncCloudflare) -> None: @@ -641,7 +636,7 @@ async def test_raw_response_bulk_delete(self, async_client: AsyncCloudflare) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" filter = await response.parse() - assert_matches_type(Optional[FilterBulkDeleteResponse], filter, path=["response"]) + assert_matches_type(AsyncSinglePage[FirewallFilter], filter, path=["response"]) @parametrize async def test_streaming_response_bulk_delete(self, async_client: AsyncCloudflare) -> None: @@ -653,7 +648,7 @@ async def test_streaming_response_bulk_delete(self, async_client: AsyncCloudflar assert response.http_request.headers.get("X-Stainless-Lang") == "python" filter = await response.parse() - assert_matches_type(Optional[FilterBulkDeleteResponse], filter, path=["response"]) + assert_matches_type(AsyncSinglePage[FirewallFilter], filter, path=["response"]) assert cast(Any, response.is_closed) is True @@ -673,7 +668,7 @@ async def test_method_bulk_update(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[FilterBulkUpdateResponse], filter, path=["response"]) + assert_matches_type(AsyncSinglePage[FirewallFilter], filter, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -686,7 +681,7 @@ async def test_raw_response_bulk_update(self, async_client: AsyncCloudflare) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" filter = await response.parse() - assert_matches_type(Optional[FilterBulkUpdateResponse], filter, path=["response"]) + assert_matches_type(AsyncSinglePage[FirewallFilter], filter, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -699,7 +694,7 @@ async def test_streaming_response_bulk_update(self, async_client: AsyncCloudflar assert response.http_request.headers.get("X-Stainless-Lang") == "python" filter = await response.parse() - assert_matches_type(Optional[FilterBulkUpdateResponse], filter, path=["response"]) + assert_matches_type(AsyncSinglePage[FirewallFilter], filter, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/user/test_subscriptions.py b/tests/api_resources/user/test_subscriptions.py index e8f52108591..707c27d211f 100644 --- a/tests/api_resources/user/test_subscriptions.py +++ b/tests/api_resources/user/test_subscriptions.py @@ -3,17 +3,15 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.user import ( - SubscriptionGetResponse, - SubscriptionDeleteResponse, - SubscriptionUpdateResponse, -) +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.user import SubscriptionDeleteResponse, SubscriptionUpdateResponse +from cloudflare.types.shared import Subscription base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -117,7 +115,7 @@ def test_path_params_delete(self, client: Cloudflare) -> None: @parametrize def test_method_get(self, client: Cloudflare) -> None: subscription = client.user.subscriptions.get() - assert_matches_type(Optional[SubscriptionGetResponse], subscription, path=["response"]) + assert_matches_type(SyncSinglePage[Subscription], subscription, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -126,7 +124,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Optional[SubscriptionGetResponse], subscription, path=["response"]) + assert_matches_type(SyncSinglePage[Subscription], subscription, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -135,7 +133,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Optional[SubscriptionGetResponse], subscription, path=["response"]) + assert_matches_type(SyncSinglePage[Subscription], subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -239,7 +237,7 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: subscription = await async_client.user.subscriptions.get() - assert_matches_type(Optional[SubscriptionGetResponse], subscription, path=["response"]) + assert_matches_type(AsyncSinglePage[Subscription], subscription, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -248,7 +246,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(Optional[SubscriptionGetResponse], subscription, path=["response"]) + assert_matches_type(AsyncSinglePage[Subscription], subscription, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -257,6 +255,6 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(Optional[SubscriptionGetResponse], subscription, path=["response"]) + assert_matches_type(AsyncSinglePage[Subscription], subscription, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/waiting_rooms/test_rules.py b/tests/api_resources/waiting_rooms/test_rules.py index 6ebb4128581..535dbf679a3 100644 --- a/tests/api_resources/waiting_rooms/test_rules.py +++ b/tests/api_resources/waiting_rooms/test_rules.py @@ -3,19 +3,14 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.waiting_rooms import ( - RuleGetResponse, - RuleEditResponse, - RuleCreateResponse, - RuleDeleteResponse, - RuleUpdateResponse, -) +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.waiting_rooms import WaitingRoomRule base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -33,7 +28,7 @@ def test_method_create(self, client: Cloudflare) -> None: "expression": "ip.src in {10.20.30.40}", }, ) - assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[WaitingRoomRule], rule, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: @@ -47,7 +42,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "enabled": True, }, ) - assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[WaitingRoomRule], rule, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -63,7 +58,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[WaitingRoomRule], rule, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -79,7 +74,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[WaitingRoomRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -117,7 +112,7 @@ def test_method_update(self, client: Cloudflare) -> None: } ], ) - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[WaitingRoomRule], rule, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: @@ -135,7 +130,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[WaitingRoomRule], rule, path=["response"]) @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: @@ -153,7 +148,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[WaitingRoomRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -190,7 +185,7 @@ def test_method_delete(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", waiting_room_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[RuleDeleteResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[WaitingRoomRule], rule, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -203,7 +198,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleDeleteResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[WaitingRoomRule], rule, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -216,7 +211,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleDeleteResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[WaitingRoomRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -252,7 +247,7 @@ def test_method_edit(self, client: Cloudflare) -> None: action="bypass_waiting_room", expression="ip.src in {10.20.30.40}", ) - assert_matches_type(Optional[RuleEditResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[WaitingRoomRule], rule, path=["response"]) @parametrize def test_method_edit_with_all_params(self, client: Cloudflare) -> None: @@ -266,7 +261,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: enabled=True, position={"index": 0}, ) - assert_matches_type(Optional[RuleEditResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[WaitingRoomRule], rule, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: @@ -281,7 +276,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleEditResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[WaitingRoomRule], rule, path=["response"]) @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: @@ -296,7 +291,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleEditResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[WaitingRoomRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -335,7 +330,7 @@ def test_method_get(self, client: Cloudflare) -> None: waiting_room_id="699d98642c564d2e855e9661899b7252", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RuleGetResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[WaitingRoomRule], rule, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -347,7 +342,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleGetResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[WaitingRoomRule], rule, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -359,7 +354,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleGetResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[WaitingRoomRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -391,7 +386,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: "expression": "ip.src in {10.20.30.40}", }, ) - assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[WaitingRoomRule], rule, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -405,7 +400,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "enabled": True, }, ) - assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[WaitingRoomRule], rule, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -421,7 +416,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[WaitingRoomRule], rule, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -437,7 +432,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[WaitingRoomRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -475,7 +470,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: } ], ) - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[WaitingRoomRule], rule, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @@ -493,7 +488,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[WaitingRoomRule], rule, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: @@ -511,7 +506,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[WaitingRoomRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -548,7 +543,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", waiting_room_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[RuleDeleteResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[WaitingRoomRule], rule, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -561,7 +556,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleDeleteResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[WaitingRoomRule], rule, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -574,7 +569,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleDeleteResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[WaitingRoomRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -610,7 +605,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: action="bypass_waiting_room", expression="ip.src in {10.20.30.40}", ) - assert_matches_type(Optional[RuleEditResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[WaitingRoomRule], rule, path=["response"]) @parametrize async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -624,7 +619,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) enabled=True, position={"index": 0}, ) - assert_matches_type(Optional[RuleEditResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[WaitingRoomRule], rule, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -639,7 +634,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleEditResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[WaitingRoomRule], rule, path=["response"]) @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -654,7 +649,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleEditResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[WaitingRoomRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -693,7 +688,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: waiting_room_id="699d98642c564d2e855e9661899b7252", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RuleGetResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[WaitingRoomRule], rule, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -705,7 +700,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleGetResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[WaitingRoomRule], rule, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -717,7 +712,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleGetResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[WaitingRoomRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_bindings.py b/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_bindings.py index 90c53166d4d..be685ad0e29 100644 --- a/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_bindings.py +++ b/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_bindings.py @@ -3,12 +3,13 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.workers_for_platforms.dispatch.namespaces.scripts import BindingGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +25,7 @@ def test_method_get(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", ) - assert_matches_type(Optional[BindingGetResponse], binding, path=["response"]) + assert_matches_type(SyncSinglePage[BindingGetResponse], binding, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -37,7 +38,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" binding = response.parse() - assert_matches_type(Optional[BindingGetResponse], binding, path=["response"]) + assert_matches_type(SyncSinglePage[BindingGetResponse], binding, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -50,7 +51,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" binding = response.parse() - assert_matches_type(Optional[BindingGetResponse], binding, path=["response"]) + assert_matches_type(SyncSinglePage[BindingGetResponse], binding, path=["response"]) assert cast(Any, response.is_closed) is True @@ -88,7 +89,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", ) - assert_matches_type(Optional[BindingGetResponse], binding, path=["response"]) + assert_matches_type(AsyncSinglePage[BindingGetResponse], binding, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -101,7 +102,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" binding = await response.parse() - assert_matches_type(Optional[BindingGetResponse], binding, path=["response"]) + assert_matches_type(AsyncSinglePage[BindingGetResponse], binding, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -114,7 +115,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" binding = await response.parse() - assert_matches_type(Optional[BindingGetResponse], binding, path=["response"]) + assert_matches_type(AsyncSinglePage[BindingGetResponse], binding, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_tags.py b/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_tags.py index f95a6ae0d1e..3723f23e5a4 100644 --- a/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_tags.py +++ b/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_tags.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest @@ -29,7 +29,7 @@ def test_method_update(self, client: Cloudflare) -> None: dispatch_namespace="my-dispatch-namespace", body=["my-tag"], ) - assert_matches_type(Optional[TagUpdateResponse], tag, path=["response"]) + assert_matches_type(SyncSinglePage[TagUpdateResponse], tag, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: @@ -43,7 +43,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" tag = response.parse() - assert_matches_type(Optional[TagUpdateResponse], tag, path=["response"]) + assert_matches_type(SyncSinglePage[TagUpdateResponse], tag, path=["response"]) @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: @@ -57,7 +57,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" tag = response.parse() - assert_matches_type(Optional[TagUpdateResponse], tag, path=["response"]) + assert_matches_type(SyncSinglePage[TagUpdateResponse], tag, path=["response"]) assert cast(Any, response.is_closed) is True @@ -233,7 +233,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: dispatch_namespace="my-dispatch-namespace", body=["my-tag"], ) - assert_matches_type(Optional[TagUpdateResponse], tag, path=["response"]) + assert_matches_type(AsyncSinglePage[TagUpdateResponse], tag, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @@ -247,7 +247,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" tag = await response.parse() - assert_matches_type(Optional[TagUpdateResponse], tag, path=["response"]) + assert_matches_type(AsyncSinglePage[TagUpdateResponse], tag, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: @@ -261,7 +261,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" tag = await response.parse() - assert_matches_type(Optional[TagUpdateResponse], tag, path=["response"]) + assert_matches_type(AsyncSinglePage[TagUpdateResponse], tag, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/access/certificates/test_settings.py b/tests/api_resources/zero_trust/access/certificates/test_settings.py index 32f63385133..bb371f1b93d 100644 --- a/tests/api_resources/zero_trust/access/certificates/test_settings.py +++ b/tests/api_resources/zero_trust/access/certificates/test_settings.py @@ -3,16 +3,14 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.zero_trust.access.certificates import ( - SettingGetResponse, - SettingUpdateResponse, -) +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.zero_trust.access.certificates import CertificateSettings base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -33,7 +31,7 @@ def test_method_update(self, client: Cloudflare) -> None: ], account_id="account_id", ) - assert_matches_type(Optional[SettingUpdateResponse], setting, path=["response"]) + assert_matches_type(SyncSinglePage[CertificateSettings], setting, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -48,7 +46,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: ], account_id="account_id", ) - assert_matches_type(Optional[SettingUpdateResponse], setting, path=["response"]) + assert_matches_type(SyncSinglePage[CertificateSettings], setting, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -67,7 +65,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(Optional[SettingUpdateResponse], setting, path=["response"]) + assert_matches_type(SyncSinglePage[CertificateSettings], setting, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -86,7 +84,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(Optional[SettingUpdateResponse], setting, path=["response"]) + assert_matches_type(SyncSinglePage[CertificateSettings], setting, path=["response"]) assert cast(Any, response.is_closed) is True @@ -123,7 +121,7 @@ def test_method_get(self, client: Cloudflare) -> None: setting = client.zero_trust.access.certificates.settings.get( account_id="account_id", ) - assert_matches_type(Optional[SettingGetResponse], setting, path=["response"]) + assert_matches_type(SyncSinglePage[CertificateSettings], setting, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -131,7 +129,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: setting = client.zero_trust.access.certificates.settings.get( account_id="account_id", ) - assert_matches_type(Optional[SettingGetResponse], setting, path=["response"]) + assert_matches_type(SyncSinglePage[CertificateSettings], setting, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -143,7 +141,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(Optional[SettingGetResponse], setting, path=["response"]) + assert_matches_type(SyncSinglePage[CertificateSettings], setting, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -155,7 +153,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(Optional[SettingGetResponse], setting, path=["response"]) + assert_matches_type(SyncSinglePage[CertificateSettings], setting, path=["response"]) assert cast(Any, response.is_closed) is True @@ -189,7 +187,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: ], account_id="account_id", ) - assert_matches_type(Optional[SettingUpdateResponse], setting, path=["response"]) + assert_matches_type(AsyncSinglePage[CertificateSettings], setting, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -204,7 +202,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare ], account_id="account_id", ) - assert_matches_type(Optional[SettingUpdateResponse], setting, path=["response"]) + assert_matches_type(AsyncSinglePage[CertificateSettings], setting, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -223,7 +221,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(Optional[SettingUpdateResponse], setting, path=["response"]) + assert_matches_type(AsyncSinglePage[CertificateSettings], setting, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -242,7 +240,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(Optional[SettingUpdateResponse], setting, path=["response"]) + assert_matches_type(AsyncSinglePage[CertificateSettings], setting, path=["response"]) assert cast(Any, response.is_closed) is True @@ -279,7 +277,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zero_trust.access.certificates.settings.get( account_id="account_id", ) - assert_matches_type(Optional[SettingGetResponse], setting, path=["response"]) + assert_matches_type(AsyncSinglePage[CertificateSettings], setting, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -287,7 +285,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - setting = await async_client.zero_trust.access.certificates.settings.get( account_id="account_id", ) - assert_matches_type(Optional[SettingGetResponse], setting, path=["response"]) + assert_matches_type(AsyncSinglePage[CertificateSettings], setting, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -299,7 +297,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(Optional[SettingGetResponse], setting, path=["response"]) + assert_matches_type(AsyncSinglePage[CertificateSettings], setting, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -311,7 +309,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(Optional[SettingGetResponse], setting, path=["response"]) + assert_matches_type(AsyncSinglePage[CertificateSettings], setting, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/devices/policies/custom/test_excludes.py b/tests/api_resources/zero_trust/devices/policies/custom/test_excludes.py index 30b735fc561..4ae1c9ecd6e 100644 --- a/tests/api_resources/zero_trust/devices/policies/custom/test_excludes.py +++ b/tests/api_resources/zero_trust/devices/policies/custom/test_excludes.py @@ -3,16 +3,14 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.zero_trust.devices.policies.custom import ( - ExcludeGetResponse, - ExcludeUpdateResponse, -) +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.zero_trust.devices import SplitTunnelExclude base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -32,7 +30,7 @@ def test_method_update(self, client: Cloudflare) -> None: } ], ) - assert_matches_type(Optional[ExcludeUpdateResponse], exclude, path=["response"]) + assert_matches_type(SyncSinglePage[SplitTunnelExclude], exclude, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: @@ -50,7 +48,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" exclude = response.parse() - assert_matches_type(Optional[ExcludeUpdateResponse], exclude, path=["response"]) + assert_matches_type(SyncSinglePage[SplitTunnelExclude], exclude, path=["response"]) @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: @@ -68,7 +66,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" exclude = response.parse() - assert_matches_type(Optional[ExcludeUpdateResponse], exclude, path=["response"]) + assert_matches_type(SyncSinglePage[SplitTunnelExclude], exclude, path=["response"]) assert cast(Any, response.is_closed) is True @@ -104,7 +102,7 @@ def test_method_get(self, client: Cloudflare) -> None: policy_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[ExcludeGetResponse], exclude, path=["response"]) + assert_matches_type(SyncSinglePage[SplitTunnelExclude], exclude, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -116,7 +114,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" exclude = response.parse() - assert_matches_type(Optional[ExcludeGetResponse], exclude, path=["response"]) + assert_matches_type(SyncSinglePage[SplitTunnelExclude], exclude, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -128,7 +126,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" exclude = response.parse() - assert_matches_type(Optional[ExcludeGetResponse], exclude, path=["response"]) + assert_matches_type(SyncSinglePage[SplitTunnelExclude], exclude, path=["response"]) assert cast(Any, response.is_closed) is True @@ -162,7 +160,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: } ], ) - assert_matches_type(Optional[ExcludeUpdateResponse], exclude, path=["response"]) + assert_matches_type(AsyncSinglePage[SplitTunnelExclude], exclude, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @@ -180,7 +178,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" exclude = await response.parse() - assert_matches_type(Optional[ExcludeUpdateResponse], exclude, path=["response"]) + assert_matches_type(AsyncSinglePage[SplitTunnelExclude], exclude, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: @@ -198,7 +196,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" exclude = await response.parse() - assert_matches_type(Optional[ExcludeUpdateResponse], exclude, path=["response"]) + assert_matches_type(AsyncSinglePage[SplitTunnelExclude], exclude, path=["response"]) assert cast(Any, response.is_closed) is True @@ -234,7 +232,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: policy_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[ExcludeGetResponse], exclude, path=["response"]) + assert_matches_type(AsyncSinglePage[SplitTunnelExclude], exclude, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -246,7 +244,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" exclude = await response.parse() - assert_matches_type(Optional[ExcludeGetResponse], exclude, path=["response"]) + assert_matches_type(AsyncSinglePage[SplitTunnelExclude], exclude, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -258,7 +256,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" exclude = await response.parse() - assert_matches_type(Optional[ExcludeGetResponse], exclude, path=["response"]) + assert_matches_type(AsyncSinglePage[SplitTunnelExclude], exclude, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/devices/policies/custom/test_fallback_domains.py b/tests/api_resources/zero_trust/devices/policies/custom/test_fallback_domains.py index c502b455603..f9396cb4b7a 100644 --- a/tests/api_resources/zero_trust/devices/policies/custom/test_fallback_domains.py +++ b/tests/api_resources/zero_trust/devices/policies/custom/test_fallback_domains.py @@ -3,16 +3,14 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.zero_trust.devices.policies.custom import ( - FallbackDomainGetResponse, - FallbackDomainUpdateResponse, -) +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.zero_trust.devices import FallbackDomain base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -27,7 +25,7 @@ def test_method_update(self, client: Cloudflare) -> None: account_id="699d98642c564d2e855e9661899b7252", domains=[{"suffix": "example.com"}], ) - assert_matches_type(Optional[FallbackDomainUpdateResponse], fallback_domain, path=["response"]) + assert_matches_type(SyncSinglePage[FallbackDomain], fallback_domain, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: @@ -40,7 +38,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" fallback_domain = response.parse() - assert_matches_type(Optional[FallbackDomainUpdateResponse], fallback_domain, path=["response"]) + assert_matches_type(SyncSinglePage[FallbackDomain], fallback_domain, path=["response"]) @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: @@ -53,7 +51,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" fallback_domain = response.parse() - assert_matches_type(Optional[FallbackDomainUpdateResponse], fallback_domain, path=["response"]) + assert_matches_type(SyncSinglePage[FallbackDomain], fallback_domain, path=["response"]) assert cast(Any, response.is_closed) is True @@ -79,7 +77,7 @@ def test_method_get(self, client: Cloudflare) -> None: policy_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[FallbackDomainGetResponse], fallback_domain, path=["response"]) + assert_matches_type(SyncSinglePage[FallbackDomain], fallback_domain, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -91,7 +89,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" fallback_domain = response.parse() - assert_matches_type(Optional[FallbackDomainGetResponse], fallback_domain, path=["response"]) + assert_matches_type(SyncSinglePage[FallbackDomain], fallback_domain, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -103,7 +101,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" fallback_domain = response.parse() - assert_matches_type(Optional[FallbackDomainGetResponse], fallback_domain, path=["response"]) + assert_matches_type(SyncSinglePage[FallbackDomain], fallback_domain, path=["response"]) assert cast(Any, response.is_closed) is True @@ -132,7 +130,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: account_id="699d98642c564d2e855e9661899b7252", domains=[{"suffix": "example.com"}], ) - assert_matches_type(Optional[FallbackDomainUpdateResponse], fallback_domain, path=["response"]) + assert_matches_type(AsyncSinglePage[FallbackDomain], fallback_domain, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @@ -145,7 +143,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" fallback_domain = await response.parse() - assert_matches_type(Optional[FallbackDomainUpdateResponse], fallback_domain, path=["response"]) + assert_matches_type(AsyncSinglePage[FallbackDomain], fallback_domain, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: @@ -158,7 +156,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" fallback_domain = await response.parse() - assert_matches_type(Optional[FallbackDomainUpdateResponse], fallback_domain, path=["response"]) + assert_matches_type(AsyncSinglePage[FallbackDomain], fallback_domain, path=["response"]) assert cast(Any, response.is_closed) is True @@ -184,7 +182,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: policy_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[FallbackDomainGetResponse], fallback_domain, path=["response"]) + assert_matches_type(AsyncSinglePage[FallbackDomain], fallback_domain, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -196,7 +194,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" fallback_domain = await response.parse() - assert_matches_type(Optional[FallbackDomainGetResponse], fallback_domain, path=["response"]) + assert_matches_type(AsyncSinglePage[FallbackDomain], fallback_domain, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -208,7 +206,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" fallback_domain = await response.parse() - assert_matches_type(Optional[FallbackDomainGetResponse], fallback_domain, path=["response"]) + assert_matches_type(AsyncSinglePage[FallbackDomain], fallback_domain, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/devices/policies/custom/test_includes.py b/tests/api_resources/zero_trust/devices/policies/custom/test_includes.py index 7524e89c1c2..7843d9f59c3 100644 --- a/tests/api_resources/zero_trust/devices/policies/custom/test_includes.py +++ b/tests/api_resources/zero_trust/devices/policies/custom/test_includes.py @@ -3,16 +3,14 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.zero_trust.devices.policies.custom import ( - IncludeGetResponse, - IncludeUpdateResponse, -) +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.zero_trust.devices import SplitTunnelInclude base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -32,7 +30,7 @@ def test_method_update(self, client: Cloudflare) -> None: } ], ) - assert_matches_type(Optional[IncludeUpdateResponse], include, path=["response"]) + assert_matches_type(SyncSinglePage[SplitTunnelInclude], include, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: @@ -50,7 +48,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" include = response.parse() - assert_matches_type(Optional[IncludeUpdateResponse], include, path=["response"]) + assert_matches_type(SyncSinglePage[SplitTunnelInclude], include, path=["response"]) @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: @@ -68,7 +66,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" include = response.parse() - assert_matches_type(Optional[IncludeUpdateResponse], include, path=["response"]) + assert_matches_type(SyncSinglePage[SplitTunnelInclude], include, path=["response"]) assert cast(Any, response.is_closed) is True @@ -104,7 +102,7 @@ def test_method_get(self, client: Cloudflare) -> None: policy_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[IncludeGetResponse], include, path=["response"]) + assert_matches_type(SyncSinglePage[SplitTunnelInclude], include, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -116,7 +114,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" include = response.parse() - assert_matches_type(Optional[IncludeGetResponse], include, path=["response"]) + assert_matches_type(SyncSinglePage[SplitTunnelInclude], include, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -128,7 +126,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" include = response.parse() - assert_matches_type(Optional[IncludeGetResponse], include, path=["response"]) + assert_matches_type(SyncSinglePage[SplitTunnelInclude], include, path=["response"]) assert cast(Any, response.is_closed) is True @@ -162,7 +160,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: } ], ) - assert_matches_type(Optional[IncludeUpdateResponse], include, path=["response"]) + assert_matches_type(AsyncSinglePage[SplitTunnelInclude], include, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @@ -180,7 +178,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" include = await response.parse() - assert_matches_type(Optional[IncludeUpdateResponse], include, path=["response"]) + assert_matches_type(AsyncSinglePage[SplitTunnelInclude], include, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: @@ -198,7 +196,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" include = await response.parse() - assert_matches_type(Optional[IncludeUpdateResponse], include, path=["response"]) + assert_matches_type(AsyncSinglePage[SplitTunnelInclude], include, path=["response"]) assert cast(Any, response.is_closed) is True @@ -234,7 +232,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: policy_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[IncludeGetResponse], include, path=["response"]) + assert_matches_type(AsyncSinglePage[SplitTunnelInclude], include, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -246,7 +244,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" include = await response.parse() - assert_matches_type(Optional[IncludeGetResponse], include, path=["response"]) + assert_matches_type(AsyncSinglePage[SplitTunnelInclude], include, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -258,7 +256,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" include = await response.parse() - assert_matches_type(Optional[IncludeGetResponse], include, path=["response"]) + assert_matches_type(AsyncSinglePage[SplitTunnelInclude], include, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/devices/policies/default/test_excludes.py b/tests/api_resources/zero_trust/devices/policies/default/test_excludes.py index ac6423b718f..9d823c2765a 100644 --- a/tests/api_resources/zero_trust/devices/policies/default/test_excludes.py +++ b/tests/api_resources/zero_trust/devices/policies/default/test_excludes.py @@ -3,16 +3,14 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.zero_trust.devices.policies.default import ( - ExcludeGetResponse, - ExcludeUpdateResponse, -) +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.zero_trust.devices import SplitTunnelExclude base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -31,7 +29,7 @@ def test_method_update(self, client: Cloudflare) -> None: } ], ) - assert_matches_type(Optional[ExcludeUpdateResponse], exclude, path=["response"]) + assert_matches_type(SyncSinglePage[SplitTunnelExclude], exclude, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: @@ -48,7 +46,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" exclude = response.parse() - assert_matches_type(Optional[ExcludeUpdateResponse], exclude, path=["response"]) + assert_matches_type(SyncSinglePage[SplitTunnelExclude], exclude, path=["response"]) @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: @@ -65,7 +63,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" exclude = response.parse() - assert_matches_type(Optional[ExcludeUpdateResponse], exclude, path=["response"]) + assert_matches_type(SyncSinglePage[SplitTunnelExclude], exclude, path=["response"]) assert cast(Any, response.is_closed) is True @@ -87,7 +85,7 @@ def test_method_get(self, client: Cloudflare) -> None: exclude = client.zero_trust.devices.policies.default.excludes.get( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[ExcludeGetResponse], exclude, path=["response"]) + assert_matches_type(SyncSinglePage[SplitTunnelExclude], exclude, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -98,7 +96,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" exclude = response.parse() - assert_matches_type(Optional[ExcludeGetResponse], exclude, path=["response"]) + assert_matches_type(SyncSinglePage[SplitTunnelExclude], exclude, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -109,7 +107,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" exclude = response.parse() - assert_matches_type(Optional[ExcludeGetResponse], exclude, path=["response"]) + assert_matches_type(SyncSinglePage[SplitTunnelExclude], exclude, path=["response"]) assert cast(Any, response.is_closed) is True @@ -135,7 +133,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: } ], ) - assert_matches_type(Optional[ExcludeUpdateResponse], exclude, path=["response"]) + assert_matches_type(AsyncSinglePage[SplitTunnelExclude], exclude, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @@ -152,7 +150,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" exclude = await response.parse() - assert_matches_type(Optional[ExcludeUpdateResponse], exclude, path=["response"]) + assert_matches_type(AsyncSinglePage[SplitTunnelExclude], exclude, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: @@ -169,7 +167,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" exclude = await response.parse() - assert_matches_type(Optional[ExcludeUpdateResponse], exclude, path=["response"]) + assert_matches_type(AsyncSinglePage[SplitTunnelExclude], exclude, path=["response"]) assert cast(Any, response.is_closed) is True @@ -191,7 +189,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: exclude = await async_client.zero_trust.devices.policies.default.excludes.get( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[ExcludeGetResponse], exclude, path=["response"]) + assert_matches_type(AsyncSinglePage[SplitTunnelExclude], exclude, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -202,7 +200,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" exclude = await response.parse() - assert_matches_type(Optional[ExcludeGetResponse], exclude, path=["response"]) + assert_matches_type(AsyncSinglePage[SplitTunnelExclude], exclude, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -213,7 +211,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" exclude = await response.parse() - assert_matches_type(Optional[ExcludeGetResponse], exclude, path=["response"]) + assert_matches_type(AsyncSinglePage[SplitTunnelExclude], exclude, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/devices/policies/default/test_fallback_domains.py b/tests/api_resources/zero_trust/devices/policies/default/test_fallback_domains.py index cf6b9551f58..13e16b48292 100644 --- a/tests/api_resources/zero_trust/devices/policies/default/test_fallback_domains.py +++ b/tests/api_resources/zero_trust/devices/policies/default/test_fallback_domains.py @@ -3,16 +3,14 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.zero_trust.devices.policies.default import ( - FallbackDomainGetResponse, - FallbackDomainUpdateResponse, -) +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.zero_trust.devices import FallbackDomain base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -26,7 +24,7 @@ def test_method_update(self, client: Cloudflare) -> None: account_id="699d98642c564d2e855e9661899b7252", domains=[{"suffix": "example.com"}], ) - assert_matches_type(Optional[FallbackDomainUpdateResponse], fallback_domain, path=["response"]) + assert_matches_type(SyncSinglePage[FallbackDomain], fallback_domain, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: @@ -38,7 +36,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" fallback_domain = response.parse() - assert_matches_type(Optional[FallbackDomainUpdateResponse], fallback_domain, path=["response"]) + assert_matches_type(SyncSinglePage[FallbackDomain], fallback_domain, path=["response"]) @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: @@ -50,7 +48,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" fallback_domain = response.parse() - assert_matches_type(Optional[FallbackDomainUpdateResponse], fallback_domain, path=["response"]) + assert_matches_type(SyncSinglePage[FallbackDomain], fallback_domain, path=["response"]) assert cast(Any, response.is_closed) is True @@ -67,7 +65,7 @@ def test_method_get(self, client: Cloudflare) -> None: fallback_domain = client.zero_trust.devices.policies.default.fallback_domains.get( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[FallbackDomainGetResponse], fallback_domain, path=["response"]) + assert_matches_type(SyncSinglePage[FallbackDomain], fallback_domain, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -78,7 +76,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" fallback_domain = response.parse() - assert_matches_type(Optional[FallbackDomainGetResponse], fallback_domain, path=["response"]) + assert_matches_type(SyncSinglePage[FallbackDomain], fallback_domain, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -89,7 +87,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" fallback_domain = response.parse() - assert_matches_type(Optional[FallbackDomainGetResponse], fallback_domain, path=["response"]) + assert_matches_type(SyncSinglePage[FallbackDomain], fallback_domain, path=["response"]) assert cast(Any, response.is_closed) is True @@ -110,7 +108,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: account_id="699d98642c564d2e855e9661899b7252", domains=[{"suffix": "example.com"}], ) - assert_matches_type(Optional[FallbackDomainUpdateResponse], fallback_domain, path=["response"]) + assert_matches_type(AsyncSinglePage[FallbackDomain], fallback_domain, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @@ -122,7 +120,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" fallback_domain = await response.parse() - assert_matches_type(Optional[FallbackDomainUpdateResponse], fallback_domain, path=["response"]) + assert_matches_type(AsyncSinglePage[FallbackDomain], fallback_domain, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: @@ -134,7 +132,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" fallback_domain = await response.parse() - assert_matches_type(Optional[FallbackDomainUpdateResponse], fallback_domain, path=["response"]) + assert_matches_type(AsyncSinglePage[FallbackDomain], fallback_domain, path=["response"]) assert cast(Any, response.is_closed) is True @@ -151,7 +149,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: fallback_domain = await async_client.zero_trust.devices.policies.default.fallback_domains.get( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[FallbackDomainGetResponse], fallback_domain, path=["response"]) + assert_matches_type(AsyncSinglePage[FallbackDomain], fallback_domain, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -162,7 +160,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" fallback_domain = await response.parse() - assert_matches_type(Optional[FallbackDomainGetResponse], fallback_domain, path=["response"]) + assert_matches_type(AsyncSinglePage[FallbackDomain], fallback_domain, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -173,7 +171,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" fallback_domain = await response.parse() - assert_matches_type(Optional[FallbackDomainGetResponse], fallback_domain, path=["response"]) + assert_matches_type(AsyncSinglePage[FallbackDomain], fallback_domain, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/devices/policies/default/test_includes.py b/tests/api_resources/zero_trust/devices/policies/default/test_includes.py index ba57af2c6bc..0ff11bcd14c 100644 --- a/tests/api_resources/zero_trust/devices/policies/default/test_includes.py +++ b/tests/api_resources/zero_trust/devices/policies/default/test_includes.py @@ -3,16 +3,14 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.zero_trust.devices.policies.default import ( - IncludeGetResponse, - IncludeUpdateResponse, -) +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.zero_trust.devices import SplitTunnelInclude base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -31,7 +29,7 @@ def test_method_update(self, client: Cloudflare) -> None: } ], ) - assert_matches_type(Optional[IncludeUpdateResponse], include, path=["response"]) + assert_matches_type(SyncSinglePage[SplitTunnelInclude], include, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: @@ -48,7 +46,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" include = response.parse() - assert_matches_type(Optional[IncludeUpdateResponse], include, path=["response"]) + assert_matches_type(SyncSinglePage[SplitTunnelInclude], include, path=["response"]) @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: @@ -65,7 +63,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" include = response.parse() - assert_matches_type(Optional[IncludeUpdateResponse], include, path=["response"]) + assert_matches_type(SyncSinglePage[SplitTunnelInclude], include, path=["response"]) assert cast(Any, response.is_closed) is True @@ -87,7 +85,7 @@ def test_method_get(self, client: Cloudflare) -> None: include = client.zero_trust.devices.policies.default.includes.get( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[IncludeGetResponse], include, path=["response"]) + assert_matches_type(SyncSinglePage[SplitTunnelInclude], include, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -98,7 +96,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" include = response.parse() - assert_matches_type(Optional[IncludeGetResponse], include, path=["response"]) + assert_matches_type(SyncSinglePage[SplitTunnelInclude], include, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -109,7 +107,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" include = response.parse() - assert_matches_type(Optional[IncludeGetResponse], include, path=["response"]) + assert_matches_type(SyncSinglePage[SplitTunnelInclude], include, path=["response"]) assert cast(Any, response.is_closed) is True @@ -135,7 +133,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: } ], ) - assert_matches_type(Optional[IncludeUpdateResponse], include, path=["response"]) + assert_matches_type(AsyncSinglePage[SplitTunnelInclude], include, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @@ -152,7 +150,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" include = await response.parse() - assert_matches_type(Optional[IncludeUpdateResponse], include, path=["response"]) + assert_matches_type(AsyncSinglePage[SplitTunnelInclude], include, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: @@ -169,7 +167,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" include = await response.parse() - assert_matches_type(Optional[IncludeUpdateResponse], include, path=["response"]) + assert_matches_type(AsyncSinglePage[SplitTunnelInclude], include, path=["response"]) assert cast(Any, response.is_closed) is True @@ -191,7 +189,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: include = await async_client.zero_trust.devices.policies.default.includes.get( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[IncludeGetResponse], include, path=["response"]) + assert_matches_type(AsyncSinglePage[SplitTunnelInclude], include, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -202,7 +200,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" include = await response.parse() - assert_matches_type(Optional[IncludeGetResponse], include, path=["response"]) + assert_matches_type(AsyncSinglePage[SplitTunnelInclude], include, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -213,7 +211,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" include = await response.parse() - assert_matches_type(Optional[IncludeGetResponse], include, path=["response"]) + assert_matches_type(AsyncSinglePage[SplitTunnelInclude], include, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/devices/policies/test_custom.py b/tests/api_resources/zero_trust/devices/policies/test_custom.py index b88e5c32535..562a6302412 100644 --- a/tests/api_resources/zero_trust/devices/policies/test_custom.py +++ b/tests/api_resources/zero_trust/devices/policies/test_custom.py @@ -11,7 +11,6 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.zero_trust.devices import SettingsPolicy -from cloudflare.types.zero_trust.devices.policies import CustomDeleteResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -146,7 +145,7 @@ def test_method_delete(self, client: Cloudflare) -> None: policy_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[CustomDeleteResponse], custom, path=["response"]) + assert_matches_type(SyncSinglePage[SettingsPolicy], custom, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -158,7 +157,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom = response.parse() - assert_matches_type(Optional[CustomDeleteResponse], custom, path=["response"]) + assert_matches_type(SyncSinglePage[SettingsPolicy], custom, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -170,7 +169,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom = response.parse() - assert_matches_type(Optional[CustomDeleteResponse], custom, path=["response"]) + assert_matches_type(SyncSinglePage[SettingsPolicy], custom, path=["response"]) assert cast(Any, response.is_closed) is True @@ -451,7 +450,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: policy_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[CustomDeleteResponse], custom, path=["response"]) + assert_matches_type(AsyncSinglePage[SettingsPolicy], custom, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -463,7 +462,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom = await response.parse() - assert_matches_type(Optional[CustomDeleteResponse], custom, path=["response"]) + assert_matches_type(AsyncSinglePage[SettingsPolicy], custom, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -475,7 +474,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom = await response.parse() - assert_matches_type(Optional[CustomDeleteResponse], custom, path=["response"]) + assert_matches_type(AsyncSinglePage[SettingsPolicy], custom, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/devices/test_networks.py b/tests/api_resources/zero_trust/devices/test_networks.py index 669480b6bae..99742f5be5e 100644 --- a/tests/api_resources/zero_trust/devices/test_networks.py +++ b/tests/api_resources/zero_trust/devices/test_networks.py @@ -10,10 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.zero_trust.devices import ( - DeviceNetwork, - NetworkDeleteResponse, -) +from cloudflare.types.zero_trust.devices import DeviceNetwork base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -190,7 +187,7 @@ def test_method_delete(self, client: Cloudflare) -> None: network_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[NetworkDeleteResponse], network, path=["response"]) + assert_matches_type(SyncSinglePage[DeviceNetwork], network, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -202,7 +199,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" network = response.parse() - assert_matches_type(Optional[NetworkDeleteResponse], network, path=["response"]) + assert_matches_type(SyncSinglePage[DeviceNetwork], network, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -214,7 +211,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" network = response.parse() - assert_matches_type(Optional[NetworkDeleteResponse], network, path=["response"]) + assert_matches_type(SyncSinglePage[DeviceNetwork], network, path=["response"]) assert cast(Any, response.is_closed) is True @@ -453,7 +450,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: network_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[NetworkDeleteResponse], network, path=["response"]) + assert_matches_type(AsyncSinglePage[DeviceNetwork], network, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -465,7 +462,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" network = await response.parse() - assert_matches_type(Optional[NetworkDeleteResponse], network, path=["response"]) + assert_matches_type(AsyncSinglePage[DeviceNetwork], network, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -477,7 +474,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" network = await response.parse() - assert_matches_type(Optional[NetworkDeleteResponse], network, path=["response"]) + assert_matches_type(AsyncSinglePage[DeviceNetwork], network, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/dlp/datasets/test_versions.py b/tests/api_resources/zero_trust/dlp/datasets/test_versions.py index c37528d256f..cb9b3c2c46c 100755 --- a/tests/api_resources/zero_trust/dlp/datasets/test_versions.py +++ b/tests/api_resources/zero_trust/dlp/datasets/test_versions.py @@ -3,12 +3,13 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.zero_trust.dlp.datasets import VersionCreateResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -26,7 +27,7 @@ def test_method_create(self, client: Cloudflare) -> None: dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", body=[{"entry_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}], ) - assert_matches_type(Optional[VersionCreateResponse], version, path=["response"]) + assert_matches_type(SyncSinglePage[VersionCreateResponse], version, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -41,7 +42,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" version = response.parse() - assert_matches_type(Optional[VersionCreateResponse], version, path=["response"]) + assert_matches_type(SyncSinglePage[VersionCreateResponse], version, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -56,7 +57,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" version = response.parse() - assert_matches_type(Optional[VersionCreateResponse], version, path=["response"]) + assert_matches_type(SyncSinglePage[VersionCreateResponse], version, path=["response"]) assert cast(Any, response.is_closed) is True @@ -92,7 +93,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", body=[{"entry_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}], ) - assert_matches_type(Optional[VersionCreateResponse], version, path=["response"]) + assert_matches_type(AsyncSinglePage[VersionCreateResponse], version, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -107,7 +108,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" version = await response.parse() - assert_matches_type(Optional[VersionCreateResponse], version, path=["response"]) + assert_matches_type(AsyncSinglePage[VersionCreateResponse], version, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -122,7 +123,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" version = await response.parse() - assert_matches_type(Optional[VersionCreateResponse], version, path=["response"]) + assert_matches_type(AsyncSinglePage[VersionCreateResponse], version, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/gateway/test_proxy_endpoints.py b/tests/api_resources/zero_trust/gateway/test_proxy_endpoints.py index 5a27878e351..4e8f3d0db64 100644 --- a/tests/api_resources/zero_trust/gateway/test_proxy_endpoints.py +++ b/tests/api_resources/zero_trust/gateway/test_proxy_endpoints.py @@ -9,10 +9,8 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.zero_trust.gateway import ( - ProxyEndpoint, - ProxyEndpointGetResponse, -) +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.zero_trust.gateway import ProxyEndpoint base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -216,7 +214,7 @@ def test_method_get(self, client: Cloudflare) -> None: proxy_endpoint_id="ed35569b41ce4d1facfe683550f54086", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[ProxyEndpointGetResponse], proxy_endpoint, path=["response"]) + assert_matches_type(SyncSinglePage[ProxyEndpoint], proxy_endpoint, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -228,7 +226,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" proxy_endpoint = response.parse() - assert_matches_type(Optional[ProxyEndpointGetResponse], proxy_endpoint, path=["response"]) + assert_matches_type(SyncSinglePage[ProxyEndpoint], proxy_endpoint, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -240,7 +238,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" proxy_endpoint = response.parse() - assert_matches_type(Optional[ProxyEndpointGetResponse], proxy_endpoint, path=["response"]) + assert_matches_type(SyncSinglePage[ProxyEndpoint], proxy_endpoint, path=["response"]) assert cast(Any, response.is_closed) is True @@ -458,7 +456,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: proxy_endpoint_id="ed35569b41ce4d1facfe683550f54086", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[ProxyEndpointGetResponse], proxy_endpoint, path=["response"]) + assert_matches_type(AsyncSinglePage[ProxyEndpoint], proxy_endpoint, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -470,7 +468,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" proxy_endpoint = await response.parse() - assert_matches_type(Optional[ProxyEndpointGetResponse], proxy_endpoint, path=["response"]) + assert_matches_type(AsyncSinglePage[ProxyEndpoint], proxy_endpoint, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -482,7 +480,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" proxy_endpoint = await response.parse() - assert_matches_type(Optional[ProxyEndpointGetResponse], proxy_endpoint, path=["response"]) + assert_matches_type(AsyncSinglePage[ProxyEndpoint], proxy_endpoint, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/test_seats.py b/tests/api_resources/zero_trust/test_seats.py index 06a8ee177e6..983cc57c9a1 100644 --- a/tests/api_resources/zero_trust/test_seats.py +++ b/tests/api_resources/zero_trust/test_seats.py @@ -3,13 +3,14 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.zero_trust import SeatEditResponse +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.zero_trust import Seat base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -30,7 +31,7 @@ def test_method_edit(self, client: Cloudflare) -> None: } ], ) - assert_matches_type(Optional[SeatEditResponse], seat, path=["response"]) + assert_matches_type(SyncSinglePage[Seat], seat, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -49,7 +50,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" seat = response.parse() - assert_matches_type(Optional[SeatEditResponse], seat, path=["response"]) + assert_matches_type(SyncSinglePage[Seat], seat, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -68,7 +69,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" seat = response.parse() - assert_matches_type(Optional[SeatEditResponse], seat, path=["response"]) + assert_matches_type(SyncSinglePage[Seat], seat, path=["response"]) assert cast(Any, response.is_closed) is True @@ -104,7 +105,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: } ], ) - assert_matches_type(Optional[SeatEditResponse], seat, path=["response"]) + assert_matches_type(AsyncSinglePage[Seat], seat, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -123,7 +124,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" seat = await response.parse() - assert_matches_type(Optional[SeatEditResponse], seat, path=["response"]) + assert_matches_type(AsyncSinglePage[Seat], seat, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -142,7 +143,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" seat = await response.parse() - assert_matches_type(Optional[SeatEditResponse], seat, path=["response"]) + assert_matches_type(AsyncSinglePage[Seat], seat, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/tunnels/test_connections.py b/tests/api_resources/zero_trust/tunnels/test_connections.py index 61fe9b4017a..13749e63f5e 100644 --- a/tests/api_resources/zero_trust/tunnels/test_connections.py +++ b/tests/api_resources/zero_trust/tunnels/test_connections.py @@ -3,13 +3,14 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.zero_trust.tunnels import ConnectionGetResponse +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.zero_trust.tunnels import Client base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -80,7 +81,7 @@ def test_method_get(self, client: Cloudflare) -> None: tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[ConnectionGetResponse], connection, path=["response"]) + assert_matches_type(SyncSinglePage[Client], connection, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -92,7 +93,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" connection = response.parse() - assert_matches_type(Optional[ConnectionGetResponse], connection, path=["response"]) + assert_matches_type(SyncSinglePage[Client], connection, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -104,7 +105,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" connection = response.parse() - assert_matches_type(Optional[ConnectionGetResponse], connection, path=["response"]) + assert_matches_type(SyncSinglePage[Client], connection, path=["response"]) assert cast(Any, response.is_closed) is True @@ -189,7 +190,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[ConnectionGetResponse], connection, path=["response"]) + assert_matches_type(AsyncSinglePage[Client], connection, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -201,7 +202,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" connection = await response.parse() - assert_matches_type(Optional[ConnectionGetResponse], connection, path=["response"]) + assert_matches_type(AsyncSinglePage[Client], connection, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -213,7 +214,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" connection = await response.parse() - assert_matches_type(Optional[ConnectionGetResponse], connection, path=["response"]) + assert_matches_type(AsyncSinglePage[Client], connection, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zones/test_custom_nameservers.py b/tests/api_resources/zones/test_custom_nameservers.py index 488b9a4cf6d..e3c7d509f44 100644 --- a/tests/api_resources/zones/test_custom_nameservers.py +++ b/tests/api_resources/zones/test_custom_nameservers.py @@ -3,12 +3,13 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.zones import ( CustomNameserverGetResponse, CustomNameserverUpdateResponse, @@ -29,7 +30,7 @@ def test_method_update(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[CustomNameserverUpdateResponse], custom_nameserver, path=["response"]) + assert_matches_type(SyncSinglePage[CustomNameserverUpdateResponse], custom_nameserver, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Cloudflare) -> None: @@ -40,7 +41,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: ns_set=1, ) - assert_matches_type(Optional[CustomNameserverUpdateResponse], custom_nameserver, path=["response"]) + assert_matches_type(SyncSinglePage[CustomNameserverUpdateResponse], custom_nameserver, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: @@ -52,7 +53,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_nameserver = response.parse() - assert_matches_type(Optional[CustomNameserverUpdateResponse], custom_nameserver, path=["response"]) + assert_matches_type(SyncSinglePage[CustomNameserverUpdateResponse], custom_nameserver, path=["response"]) @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: @@ -64,7 +65,9 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_nameserver = response.parse() - assert_matches_type(Optional[CustomNameserverUpdateResponse], custom_nameserver, path=["response"]) + assert_matches_type( + SyncSinglePage[CustomNameserverUpdateResponse], custom_nameserver, path=["response"] + ) assert cast(Any, response.is_closed) is True @@ -130,7 +133,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[CustomNameserverUpdateResponse], custom_nameserver, path=["response"]) + assert_matches_type(AsyncSinglePage[CustomNameserverUpdateResponse], custom_nameserver, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -141,7 +144,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare ns_set=1, ) - assert_matches_type(Optional[CustomNameserverUpdateResponse], custom_nameserver, path=["response"]) + assert_matches_type(AsyncSinglePage[CustomNameserverUpdateResponse], custom_nameserver, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @@ -153,7 +156,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_nameserver = await response.parse() - assert_matches_type(Optional[CustomNameserverUpdateResponse], custom_nameserver, path=["response"]) + assert_matches_type(AsyncSinglePage[CustomNameserverUpdateResponse], custom_nameserver, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: @@ -165,7 +168,9 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_nameserver = await response.parse() - assert_matches_type(Optional[CustomNameserverUpdateResponse], custom_nameserver, path=["response"]) + assert_matches_type( + AsyncSinglePage[CustomNameserverUpdateResponse], custom_nameserver, path=["response"] + ) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zones/test_rate_plans.py b/tests/api_resources/zones/test_rate_plans.py index e8324397075..656e6512dd1 100644 --- a/tests/api_resources/zones/test_rate_plans.py +++ b/tests/api_resources/zones/test_rate_plans.py @@ -3,12 +3,13 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.zones import RatePlanGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -22,7 +23,7 @@ def test_method_get(self, client: Cloudflare) -> None: rate_plan = client.zones.rate_plans.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RatePlanGetResponse], rate_plan, path=["response"]) + assert_matches_type(SyncSinglePage[RatePlanGetResponse], rate_plan, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -33,7 +34,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rate_plan = response.parse() - assert_matches_type(Optional[RatePlanGetResponse], rate_plan, path=["response"]) + assert_matches_type(SyncSinglePage[RatePlanGetResponse], rate_plan, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -44,7 +45,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rate_plan = response.parse() - assert_matches_type(Optional[RatePlanGetResponse], rate_plan, path=["response"]) + assert_matches_type(SyncSinglePage[RatePlanGetResponse], rate_plan, path=["response"]) assert cast(Any, response.is_closed) is True @@ -64,7 +65,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: rate_plan = await async_client.zones.rate_plans.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RatePlanGetResponse], rate_plan, path=["response"]) + assert_matches_type(AsyncSinglePage[RatePlanGetResponse], rate_plan, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -75,7 +76,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rate_plan = await response.parse() - assert_matches_type(Optional[RatePlanGetResponse], rate_plan, path=["response"]) + assert_matches_type(AsyncSinglePage[RatePlanGetResponse], rate_plan, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -86,7 +87,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" rate_plan = await response.parse() - assert_matches_type(Optional[RatePlanGetResponse], rate_plan, path=["response"]) + assert_matches_type(AsyncSinglePage[RatePlanGetResponse], rate_plan, path=["response"]) assert cast(Any, response.is_closed) is True From 5f9f67f12e17fbbff6594cb5951a31161590d15f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 15:32:17 +0000 Subject: [PATCH 078/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 05591bb7ef6..de617f814c7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-04299b899e2bbf8ba1b4ad96d5e9f9c3e0c9b6246bfeac3f9ab684b855b0e412.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8973dde42d42a39c8fbc5f3f1eb1328e6ac0c805ca4d3e5920796749ed58eb0a.yml From 6dcea44aca1b7554e7c8d363fe0b8368d2168470 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 15:43:03 +0000 Subject: [PATCH 079/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index de617f814c7..05591bb7ef6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8973dde42d42a39c8fbc5f3f1eb1328e6ac0c805ca4d3e5920796749ed58eb0a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-04299b899e2bbf8ba1b4ad96d5e9f9c3e0c9b6246bfeac3f9ab684b855b0e412.yml From 847f95c63f54fd575581c5ee5d2dfe476741c5e7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 16:26:37 +0000 Subject: [PATCH 080/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 05591bb7ef6..668e9a55693 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-04299b899e2bbf8ba1b4ad96d5e9f9c3e0c9b6246bfeac3f9ab684b855b0e412.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a90542373fb1edea8c9e7deb9b7a22677de8a3e8e6b0f242cf81ed0a73d1902f.yml From 28e4678060ad77445f429796a5d347bee2c64a7e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 17:19:53 +0000 Subject: [PATCH 081/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 668e9a55693..267a4b39ee5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a90542373fb1edea8c9e7deb9b7a22677de8a3e8e6b0f242cf81ed0a73d1902f.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ee950e54d31664fbd288649ee6b7fce536d4f358ec35e767eaa1bfcdd64047e3.yml From f335681c2ee1b0291bfc0990ed8765581da1715b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 17:53:19 +0000 Subject: [PATCH 082/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 267a4b39ee5..1b1414d3501 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ee950e54d31664fbd288649ee6b7fce536d4f358ec35e767eaa1bfcdd64047e3.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bc3696a18f538851d12e180969b9827d32e3008d0e966fe42219261d88f22b01.yml From 34abff559a3d10ae98965470da216be536e392f2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 19:48:05 +0000 Subject: [PATCH 083/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 1b1414d3501..267a4b39ee5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bc3696a18f538851d12e180969b9827d32e3008d0e966fe42219261d88f22b01.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ee950e54d31664fbd288649ee6b7fce536d4f358ec35e767eaa1bfcdd64047e3.yml From 4db4e2725e41bc7dfda6da645b28d8dc66ae38fe Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 21:15:21 +0000 Subject: [PATCH 084/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 267a4b39ee5..1b1414d3501 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ee950e54d31664fbd288649ee6b7fce536d4f358ec35e767eaa1bfcdd64047e3.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bc3696a18f538851d12e180969b9827d32e3008d0e966fe42219261d88f22b01.yml From 1b590fe1619bf6881e3ef85152e34ebe0f446410 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 23:04:41 +0000 Subject: [PATCH 085/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 1b1414d3501..267a4b39ee5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bc3696a18f538851d12e180969b9827d32e3008d0e966fe42219261d88f22b01.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ee950e54d31664fbd288649ee6b7fce536d4f358ec35e767eaa1bfcdd64047e3.yml From 797f4ec2be06dd8284baffe335767b3f493ec21c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 10:40:48 +0000 Subject: [PATCH 086/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 267a4b39ee5..1b1414d3501 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ee950e54d31664fbd288649ee6b7fce536d4f358ec35e767eaa1bfcdd64047e3.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bc3696a18f538851d12e180969b9827d32e3008d0e966fe42219261d88f22b01.yml From 1a674582f44dce9601ad01179004f33cdc5867c2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 12:15:23 +0000 Subject: [PATCH 087/358] feat(api): api update (#2414) --- .stats.yml | 2 +- .../resources/url_scanner/responses.py | 8 +++---- src/cloudflare/resources/url_scanner/scans.py | 24 +++++++++---------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1b1414d3501..a4bc068ddf7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bc3696a18f538851d12e180969b9827d32e3008d0e966fe42219261d88f22b01.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ac150b149275b115601462ffcfbcb02a9c2f2809b04cb9a5bd9bfb9d1bd100f0.yml diff --git a/src/cloudflare/resources/url_scanner/responses.py b/src/cloudflare/resources/url_scanner/responses.py index e1f6f2bda24..8ff974e8007 100644 --- a/src/cloudflare/resources/url_scanner/responses.py +++ b/src/cloudflare/resources/url_scanner/responses.py @@ -52,8 +52,8 @@ def get( ) -> str: """Returns the raw response of the network request. - If HTML, a plain text response - will be returned. + Find the `response_id` in the + `data.requests.response.hash`. Args: account_id: Account ID. @@ -116,8 +116,8 @@ async def get( ) -> str: """Returns the raw response of the network request. - If HTML, a plain text response - will be returned. + Find the `response_id` in the + `data.requests.response.hash`. Args: account_id: Account ID. diff --git a/src/cloudflare/resources/url_scanner/scans.py b/src/cloudflare/resources/url_scanner/scans.py index 703c16ba14e..de37c77ba9e 100644 --- a/src/cloudflare/resources/url_scanner/scans.py +++ b/src/cloudflare/resources/url_scanner/scans.py @@ -144,13 +144,13 @@ def list( """Use a subset of ElasticSearch Query syntax to filter scans. Some example - queries:

- 'page.domain:microsoft AND verdicts.malicious:true AND NOT + queries:

- 'path:"/bundles/jquery.js"': Searches for scans who + requested resources with the given path.
- 'page.asn:AS24940 AND hash:xxx': + Websites hosted in AS24940 where a resource with the given hash was + downloaded.
- 'page.domain:microsoft\\** AND verdicts.malicious:true AND NOT page.domain:microsoft.com': malicious scans whose hostname starts with - "microsoft".
- 'apikey:me AND date:[2024-01 TO 2024-10]': my scans from 2024 - January to 2024 October.
- 'page.domain:(blogspot OR www.blogspot)': - Searches for scans whose main domain starts with "blogspot" or with - "www.blogspot"
- 'page.asn:AS24940 AND hash:xxx': Websites hosted in AS24940 - where a resource with the given hash was downloaded. + "microsoft".
- 'apikey:me AND date:[2025-01 TO 2025-02]': my scans from 2025 + January to 2025 February. Args: account_id: Account ID. @@ -507,13 +507,13 @@ async def list( """Use a subset of ElasticSearch Query syntax to filter scans. Some example - queries:

- 'page.domain:microsoft AND verdicts.malicious:true AND NOT + queries:

- 'path:"/bundles/jquery.js"': Searches for scans who + requested resources with the given path.
- 'page.asn:AS24940 AND hash:xxx': + Websites hosted in AS24940 where a resource with the given hash was + downloaded.
- 'page.domain:microsoft\\** AND verdicts.malicious:true AND NOT page.domain:microsoft.com': malicious scans whose hostname starts with - "microsoft".
- 'apikey:me AND date:[2024-01 TO 2024-10]': my scans from 2024 - January to 2024 October.
- 'page.domain:(blogspot OR www.blogspot)': - Searches for scans whose main domain starts with "blogspot" or with - "www.blogspot"
- 'page.asn:AS24940 AND hash:xxx': Websites hosted in AS24940 - where a resource with the given hash was downloaded. + "microsoft".
- 'apikey:me AND date:[2025-01 TO 2025-02]': my scans from 2025 + January to 2025 February. Args: account_id: Account ID. From 0dc749c861afc3bfd34fa90098d3dd1f79203dc6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 12:20:44 +0000 Subject: [PATCH 088/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index a4bc068ddf7..a4c1a002e3a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ac150b149275b115601462ffcfbcb02a9c2f2809b04cb9a5bd9bfb9d1bd100f0.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d584521239e9a0c95bf67e1ac053785606e51cc3fd7c8781b797fa3ee16c095c.yml From 9f525a750d3dd9aedf3d760e7cf58fcd162fbe24 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 12:59:42 +0000 Subject: [PATCH 089/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index a4c1a002e3a..a4bc068ddf7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d584521239e9a0c95bf67e1ac053785606e51cc3fd7c8781b797fa3ee16c095c.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ac150b149275b115601462ffcfbcb02a9c2f2809b04cb9a5bd9bfb9d1bd100f0.yml From 44f9d6bce5b16ab24e1acff17a8d1d4c5da20ddb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 14:20:46 +0000 Subject: [PATCH 090/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index a4bc068ddf7..a4c1a002e3a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ac150b149275b115601462ffcfbcb02a9c2f2809b04cb9a5bd9bfb9d1bd100f0.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d584521239e9a0c95bf67e1ac053785606e51cc3fd7c8781b797fa3ee16c095c.yml From 312a8959daa72bdf06eae3dc4829760518d8391b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 14:43:51 +0000 Subject: [PATCH 091/358] chore(internal): change default timeout to an int (#2415) --- src/cloudflare/_constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cloudflare/_constants.py b/src/cloudflare/_constants.py index a2ac3b6f327..6ddf2c7170b 100644 --- a/src/cloudflare/_constants.py +++ b/src/cloudflare/_constants.py @@ -6,7 +6,7 @@ OVERRIDE_CAST_TO_HEADER = "____stainless_override_cast_to" # default timeout is 1 minute -DEFAULT_TIMEOUT = httpx.Timeout(timeout=60.0, connect=5.0) +DEFAULT_TIMEOUT = httpx.Timeout(timeout=60, connect=5.0) DEFAULT_MAX_RETRIES = 2 DEFAULT_CONNECTION_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20) From 99fa876848bee710678a3759d37a7876f40ea870 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 15:14:22 +0000 Subject: [PATCH 092/358] chore(internal): bummp ruff dependency (#2416) --- pyproject.toml | 2 +- requirements-dev.lock | 2 +- scripts/utils/ruffen-docs.py | 4 +-- src/cloudflare/_models.py | 2 +- .../timeseries_groups/test_summary.py | 4 ++- .../attacks/layer7/test_timeseries_groups.py | 16 ++++++--- .../email/security/test_timeseries_groups.py | 8 +++-- .../content_lists/test_entries.py | 36 +++++++++++-------- .../namespaces/scripts/test_asset_upload.py | 10 +++--- .../namespaces/scripts/test_content.py | 12 ++++--- .../namespaces/scripts/test_secrets.py | 10 +++--- 11 files changed, 66 insertions(+), 40 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 61d14798f8a..58761567d72 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -178,7 +178,7 @@ select = [ "T201", "T203", # misuse of typing.TYPE_CHECKING - "TCH004", + "TC004", # import rules "TID251", ] diff --git a/requirements-dev.lock b/requirements-dev.lock index 3d778db8754..904432cb213 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -78,7 +78,7 @@ pytz==2023.3.post1 # via dirty-equals respx==0.22.0 rich==13.7.1 -ruff==0.6.9 +ruff==0.9.4 setuptools==68.2.2 # via nodeenv six==1.16.0 diff --git a/scripts/utils/ruffen-docs.py b/scripts/utils/ruffen-docs.py index 37b3d94f0f8..0cf2bd2fd9d 100644 --- a/scripts/utils/ruffen-docs.py +++ b/scripts/utils/ruffen-docs.py @@ -47,7 +47,7 @@ def _md_match(match: Match[str]) -> str: with _collect_error(match): code = format_code_block(code) code = textwrap.indent(code, match["indent"]) - return f'{match["before"]}{code}{match["after"]}' + return f"{match['before']}{code}{match['after']}" def _pycon_match(match: Match[str]) -> str: code = "" @@ -97,7 +97,7 @@ def finish_fragment() -> None: def _md_pycon_match(match: Match[str]) -> str: code = _pycon_match(match) code = textwrap.indent(code, match["indent"]) - return f'{match["before"]}{code}{match["after"]}' + return f"{match['before']}{code}{match['after']}" src = MD_RE.sub(_md_match, src) src = MD_PYCON_RE.sub(_md_pycon_match, src) diff --git a/src/cloudflare/_models.py b/src/cloudflare/_models.py index 9a918aabf37..12c34b7d177 100644 --- a/src/cloudflare/_models.py +++ b/src/cloudflare/_models.py @@ -172,7 +172,7 @@ def to_json( @override def __str__(self) -> str: # mypy complains about an invalid self arg - return f'{self.__repr_name__()}({self.__repr_str__(", ")})' # type: ignore[misc] + return f"{self.__repr_name__()}({self.__repr_str__(', ')})" # type: ignore[misc] # Override the 'construct' method in a way that supports recursive parsing without validation. # Based on https://github.com/samuelcolvin/pydantic/issues/1168#issuecomment-817742836. diff --git a/tests/api_resources/radar/ai/inference/timeseries_groups/test_summary.py b/tests/api_resources/radar/ai/inference/timeseries_groups/test_summary.py index deb21c11e17..243d0f83b6c 100644 --- a/tests/api_resources/radar/ai/inference/timeseries_groups/test_summary.py +++ b/tests/api_resources/radar/ai/inference/timeseries_groups/test_summary.py @@ -130,7 +130,9 @@ async def test_raw_response_model(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_model(self, async_client: AsyncCloudflare) -> None: - async with async_client.radar.ai.inference.timeseries_groups.summary.with_streaming_response.model() as response: + async with ( + async_client.radar.ai.inference.timeseries_groups.summary.with_streaming_response.model() + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/radar/attacks/layer7/test_timeseries_groups.py b/tests/api_resources/radar/attacks/layer7/test_timeseries_groups.py index 6ddecd6f0f8..d45d9e3dee9 100644 --- a/tests/api_resources/radar/attacks/layer7/test_timeseries_groups.py +++ b/tests/api_resources/radar/attacks/layer7/test_timeseries_groups.py @@ -382,7 +382,9 @@ async def test_raw_response_http_method(self, async_client: AsyncCloudflare) -> @parametrize async def test_streaming_response_http_method(self, async_client: AsyncCloudflare) -> None: - async with async_client.radar.attacks.layer7.timeseries_groups.with_streaming_response.http_method() as response: + async with ( + async_client.radar.attacks.layer7.timeseries_groups.with_streaming_response.http_method() + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -426,7 +428,9 @@ async def test_raw_response_http_version(self, async_client: AsyncCloudflare) -> @parametrize async def test_streaming_response_http_version(self, async_client: AsyncCloudflare) -> None: - async with async_client.radar.attacks.layer7.timeseries_groups.with_streaming_response.http_version() as response: + async with ( + async_client.radar.attacks.layer7.timeseries_groups.with_streaming_response.http_version() + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -562,7 +566,9 @@ async def test_raw_response_managed_rules(self, async_client: AsyncCloudflare) - @parametrize async def test_streaming_response_managed_rules(self, async_client: AsyncCloudflare) -> None: - async with async_client.radar.attacks.layer7.timeseries_groups.with_streaming_response.managed_rules() as response: + async with ( + async_client.radar.attacks.layer7.timeseries_groups.with_streaming_response.managed_rules() + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -607,7 +613,9 @@ async def test_raw_response_mitigation_product(self, async_client: AsyncCloudfla @parametrize async def test_streaming_response_mitigation_product(self, async_client: AsyncCloudflare) -> None: - async with async_client.radar.attacks.layer7.timeseries_groups.with_streaming_response.mitigation_product() as response: + async with ( + async_client.radar.attacks.layer7.timeseries_groups.with_streaming_response.mitigation_product() + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/radar/email/security/test_timeseries_groups.py b/tests/api_resources/radar/email/security/test_timeseries_groups.py index 54cffda8872..3b306bd7c33 100644 --- a/tests/api_resources/radar/email/security/test_timeseries_groups.py +++ b/tests/api_resources/radar/email/security/test_timeseries_groups.py @@ -728,7 +728,9 @@ async def test_raw_response_threat_category(self, async_client: AsyncCloudflare) @parametrize async def test_streaming_response_threat_category(self, async_client: AsyncCloudflare) -> None: - async with async_client.radar.email.security.timeseries_groups.with_streaming_response.threat_category() as response: + async with ( + async_client.radar.email.security.timeseries_groups.with_streaming_response.threat_category() + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -769,7 +771,9 @@ async def test_raw_response_tls_version(self, async_client: AsyncCloudflare) -> @parametrize async def test_streaming_response_tls_version(self, async_client: AsyncCloudflare) -> None: - async with async_client.radar.email.security.timeseries_groups.with_streaming_response.tls_version() as response: + async with ( + async_client.radar.email.security.timeseries_groups.with_streaming_response.tls_version() + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/web3/hostnames/ipfs_universal_paths/content_lists/test_entries.py b/tests/api_resources/web3/hostnames/ipfs_universal_paths/content_lists/test_entries.py index b4f323177ba..b46488974a4 100644 --- a/tests/api_resources/web3/hostnames/ipfs_universal_paths/content_lists/test_entries.py +++ b/tests/api_resources/web3/hostnames/ipfs_universal_paths/content_lists/test_entries.py @@ -393,11 +393,13 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.web3.hostnames.ipfs_universal_paths.content_lists.entries.with_streaming_response.create( - identifier="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - content="QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB", - type="cid", + async with ( + async_client.web3.hostnames.ipfs_universal_paths.content_lists.entries.with_streaming_response.create( + identifier="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB", + type="cid", + ) ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -467,12 +469,14 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: - async with async_client.web3.hostnames.ipfs_universal_paths.content_lists.entries.with_streaming_response.update( - content_list_entry_identifier="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - identifier="023e105f4ecef8ad9ca31a8372d0c353", - content="QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB", - type="cid", + async with ( + async_client.web3.hostnames.ipfs_universal_paths.content_lists.entries.with_streaming_response.update( + content_list_entry_identifier="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + identifier="023e105f4ecef8ad9ca31a8372d0c353", + content="QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB", + type="cid", + ) ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -587,10 +591,12 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.web3.hostnames.ipfs_universal_paths.content_lists.entries.with_streaming_response.delete( - content_list_entry_identifier="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - identifier="023e105f4ecef8ad9ca31a8372d0c353", + async with ( + async_client.web3.hostnames.ipfs_universal_paths.content_lists.entries.with_streaming_response.delete( + content_list_entry_identifier="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + identifier="023e105f4ecef8ad9ca31a8372d0c353", + ) ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_asset_upload.py b/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_asset_upload.py index e709c6dc236..dd3e26c488d 100644 --- a/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_asset_upload.py +++ b/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_asset_upload.py @@ -139,10 +139,12 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.with_streaming_response.create( - script_name="this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dispatch_namespace="my-dispatch-namespace", + async with ( + async_client.workers_for_platforms.dispatch.namespaces.scripts.asset_upload.with_streaming_response.create( + script_name="this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + ) ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_content.py b/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_content.py index 822e7f80d7a..fb5fb964885 100644 --- a/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_content.py +++ b/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_content.py @@ -240,11 +240,13 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: - async with async_client.workers_for_platforms.dispatch.namespaces.scripts.content.with_streaming_response.update( - script_name="this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dispatch_namespace="my-dispatch-namespace", - metadata={}, + async with ( + async_client.workers_for_platforms.dispatch.namespaces.scripts.content.with_streaming_response.update( + script_name="this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + metadata={}, + ) ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_secrets.py b/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_secrets.py index 143914b5022..0a63545598c 100644 --- a/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_secrets.py +++ b/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_secrets.py @@ -270,10 +270,12 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: - async with async_client.workers_for_platforms.dispatch.namespaces.scripts.secrets.with_streaming_response.update( - script_name="this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - dispatch_namespace="my-dispatch-namespace", + async with ( + async_client.workers_for_platforms.dispatch.namespaces.scripts.secrets.with_streaming_response.update( + script_name="this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + ) ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" From afd6265d390afa19fea04dba1eca18bfbd5a7a87 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 15:20:50 +0000 Subject: [PATCH 093/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index a4c1a002e3a..a4bc068ddf7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d584521239e9a0c95bf67e1ac053785606e51cc3fd7c8781b797fa3ee16c095c.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ac150b149275b115601462ffcfbcb02a9c2f2809b04cb9a5bd9bfb9d1bd100f0.yml From 1b1c82bef52ffa6caacda17487d6fe36bb771d75 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 15:38:19 +0000 Subject: [PATCH 094/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index a4bc068ddf7..a4c1a002e3a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ac150b149275b115601462ffcfbcb02a9c2f2809b04cb9a5bd9bfb9d1bd100f0.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d584521239e9a0c95bf67e1ac053785606e51cc3fd7c8781b797fa3ee16c095c.yml From 8f2f04143e08ce23cb6dbf786aaab31215448fc7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 15:45:31 +0000 Subject: [PATCH 095/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index a4c1a002e3a..a4bc068ddf7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d584521239e9a0c95bf67e1ac053785606e51cc3fd7c8781b797fa3ee16c095c.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ac150b149275b115601462ffcfbcb02a9c2f2809b04cb9a5bd9bfb9d1bd100f0.yml From 381382078e41938cc3f22b9ccf5e6cce78c27193 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 16:17:10 +0000 Subject: [PATCH 096/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index a4bc068ddf7..a4c1a002e3a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ac150b149275b115601462ffcfbcb02a9c2f2809b04cb9a5bd9bfb9d1bd100f0.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d584521239e9a0c95bf67e1ac053785606e51cc3fd7c8781b797fa3ee16c095c.yml From 48e461a739ca8ca1c4d3d9ea6e3506a6975e52ed Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 17:40:13 +0000 Subject: [PATCH 097/358] chore(internal): use TypeAliasType for type aliases (#2417) --- src/cloudflare/types/request_tracers/trace.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cloudflare/types/request_tracers/trace.py b/src/cloudflare/types/request_tracers/trace.py index 873b2412404..a14ff79afdb 100644 --- a/src/cloudflare/types/request_tracers/trace.py +++ b/src/cloudflare/types/request_tracers/trace.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TYPE_CHECKING, List, TypeAlias, TypeAliasType +from typing import TYPE_CHECKING, List +from typing_extensions import TypeAlias, TypeAliasType from ..._compat import PYDANTIC_V2 __all__ = ["Trace"] - if TYPE_CHECKING or PYDANTIC_V2: Trace = TypeAliasType("Trace", List["TraceItem"]) else: From 680403b9a887265a4ce74b16775863963d592fd4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 19:44:29 +0000 Subject: [PATCH 098/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index a4c1a002e3a..a4bc068ddf7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d584521239e9a0c95bf67e1ac053785606e51cc3fd7c8781b797fa3ee16c095c.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ac150b149275b115601462ffcfbcb02a9c2f2809b04cb9a5bd9bfb9d1bd100f0.yml From fd06f550112346afbcfca7d66c172a5d182f1c2c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 20:07:35 +0000 Subject: [PATCH 099/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index a4bc068ddf7..a4c1a002e3a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ac150b149275b115601462ffcfbcb02a9c2f2809b04cb9a5bd9bfb9d1bd100f0.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d584521239e9a0c95bf67e1ac053785606e51cc3fd7c8781b797fa3ee16c095c.yml From 3afdb434d79d14fe790f7cb384d4665105b32717 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 21:14:03 +0000 Subject: [PATCH 100/358] feat(api): api update (#2419) --- .stats.yml | 2 +- src/cloudflare/types/zones/zone.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index a4c1a002e3a..e313fe39b6d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d584521239e9a0c95bf67e1ac053785606e51cc3fd7c8781b797fa3ee16c095c.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6457c71e9f79569df976f6b53f72da9490ec438a4e04f10fe2f12c2ce25238de.yml diff --git a/src/cloudflare/types/zones/zone.py b/src/cloudflare/types/zones/zone.py index d05fb2cfa85..6fd6d25f31e 100644 --- a/src/cloudflare/types/zones/zone.py +++ b/src/cloudflare/types/zones/zone.py @@ -115,3 +115,6 @@ class Zone(BaseModel): This is only available for Business and Enterprise plans. """ + + verification_key: Optional[str] = None + """Verification key for partial zone setup.""" From 3528441162074547098f7016356db38123df5ba4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 22:12:12 +0000 Subject: [PATCH 101/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index e313fe39b6d..3c855b184b7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6457c71e9f79569df976f6b53f72da9490ec438a4e04f10fe2f12c2ce25238de.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7d3d9376efe25aacad78ef5293b32f9e7bd403951e846671affe19b882a0af32.yml From 8e961e7d7b30598991f91f202357e43988156d27 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 03:46:15 +0000 Subject: [PATCH 102/358] feat(account_roles): explicitly configure `page_pagination` for listing (#2420) --- api.md | 8 ++++- src/cloudflare/resources/accounts/roles.py | 32 +++++++++++-------- src/cloudflare/types/accounts/__init__.py | 1 + .../types/accounts/role_list_response.py | 10 ++++++ tests/api_resources/accounts/test_roles.py | 14 ++++---- 5 files changed, 44 insertions(+), 21 deletions(-) create mode 100644 src/cloudflare/types/accounts/role_list_response.py diff --git a/api.md b/api.md index 31d3021e218..75b7fbf60c9 100644 --- a/api.md +++ b/api.md @@ -63,9 +63,15 @@ Methods: ## Roles +Types: + +```python +from cloudflare.types.accounts import RoleListResponse +``` + Methods: -- client.accounts.roles.list(\*, account_id) -> SyncSinglePage[Role] +- client.accounts.roles.list(\*, account_id) -> Optional[RoleListResponse] - client.accounts.roles.get(role_id, \*, account_id) -> Optional[Role] ## Subscriptions diff --git a/src/cloudflare/resources/accounts/roles.py b/src/cloudflare/resources/accounts/roles.py index d7ef52252b4..debcc53d8c0 100644 --- a/src/cloudflare/resources/accounts/roles.py +++ b/src/cloudflare/resources/accounts/roles.py @@ -16,9 +16,9 @@ async_to_streamed_response_wrapper, ) from ..._wrappers import ResultWrapper -from ...pagination import SyncSinglePage, AsyncSinglePage -from ..._base_client import AsyncPaginator, make_request_options +from ..._base_client import make_request_options from ...types.shared.role import Role +from ...types.accounts.role_list_response import RoleListResponse __all__ = ["RolesResource", "AsyncRolesResource"] @@ -53,7 +53,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[Role]: + ) -> Optional[RoleListResponse]: """ Get all available roles for an account. @@ -70,13 +70,16 @@ def list( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get_api_list( + return self._get( f"/accounts/{account_id}/roles", - page=SyncSinglePage[Role], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[RoleListResponse]]._unwrapper, ), - model=Role, + cast_to=cast(Type[Optional[RoleListResponse]], ResultWrapper[RoleListResponse]), ) def get( @@ -144,7 +147,7 @@ def with_streaming_response(self) -> AsyncRolesResourceWithStreamingResponse: """ return AsyncRolesResourceWithStreamingResponse(self) - def list( + async def list( self, *, account_id: str, @@ -154,7 +157,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[Role, AsyncSinglePage[Role]]: + ) -> Optional[RoleListResponse]: """ Get all available roles for an account. @@ -171,13 +174,16 @@ def list( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get_api_list( + return await self._get( f"/accounts/{account_id}/roles", - page=AsyncSinglePage[Role], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[RoleListResponse]]._unwrapper, ), - model=Role, + cast_to=cast(Type[Optional[RoleListResponse]], ResultWrapper[RoleListResponse]), ) async def get( diff --git a/src/cloudflare/types/accounts/__init__.py b/src/cloudflare/types/accounts/__init__.py index b9452666fc2..fd5f47b3d0e 100644 --- a/src/cloudflare/types/accounts/__init__.py +++ b/src/cloudflare/types/accounts/__init__.py @@ -6,6 +6,7 @@ from .account import Account as Account from .token_list_params import TokenListParams as TokenListParams from .member_list_params import MemberListParams as MemberListParams +from .role_list_response import RoleListResponse as RoleListResponse from .account_list_params import AccountListParams as AccountListParams from .token_create_params import TokenCreateParams as TokenCreateParams from .token_update_params import TokenUpdateParams as TokenUpdateParams diff --git a/src/cloudflare/types/accounts/role_list_response.py b/src/cloudflare/types/accounts/role_list_response.py new file mode 100644 index 00000000000..50a522a0fde --- /dev/null +++ b/src/cloudflare/types/accounts/role_list_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from ..shared.role import Role + +__all__ = ["RoleListResponse"] + +RoleListResponse: TypeAlias = List[Role] diff --git a/tests/api_resources/accounts/test_roles.py b/tests/api_resources/accounts/test_roles.py index 95df57ae04f..eabcfc343df 100644 --- a/tests/api_resources/accounts/test_roles.py +++ b/tests/api_resources/accounts/test_roles.py @@ -9,8 +9,8 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.shared import Role +from cloudflare.types.accounts import RoleListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +23,7 @@ def test_method_list(self, client: Cloudflare) -> None: role = client.accounts.roles.list( account_id="eb78d65290b24279ba6f44721b3ea3c4", ) - assert_matches_type(SyncSinglePage[Role], role, path=["response"]) + assert_matches_type(Optional[RoleListResponse], role, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: @@ -34,7 +34,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" role = response.parse() - assert_matches_type(SyncSinglePage[Role], role, path=["response"]) + assert_matches_type(Optional[RoleListResponse], role, path=["response"]) @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: @@ -45,7 +45,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" role = response.parse() - assert_matches_type(SyncSinglePage[Role], role, path=["response"]) + assert_matches_type(Optional[RoleListResponse], role, path=["response"]) assert cast(Any, response.is_closed) is True @@ -113,7 +113,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: role = await async_client.accounts.roles.list( account_id="eb78d65290b24279ba6f44721b3ea3c4", ) - assert_matches_type(AsyncSinglePage[Role], role, path=["response"]) + assert_matches_type(Optional[RoleListResponse], role, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @@ -124,7 +124,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" role = await response.parse() - assert_matches_type(AsyncSinglePage[Role], role, path=["response"]) + assert_matches_type(Optional[RoleListResponse], role, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: @@ -135,7 +135,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" role = await response.parse() - assert_matches_type(AsyncSinglePage[Role], role, path=["response"]) + assert_matches_type(Optional[RoleListResponse], role, path=["response"]) assert cast(Any, response.is_closed) is True From 58592dc11c2927130cf2e637d832fe30ac0f5737 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 04:33:14 +0000 Subject: [PATCH 103/358] feat(subscription): apply enums for rate_plan.id (#2421) --- .stats.yml | 2 +- src/cloudflare/types/shared/rate_plan.py | 16 +++++++++++++++- src/cloudflare/types/shared_params/rate_plan.py | 15 +++++++++++++-- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3c855b184b7..de6e07fc6c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7d3d9376efe25aacad78ef5293b32f9e7bd403951e846671affe19b882a0af32.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e342173dad9584a0439eeec0f609a40c16844e18a138f65e8c9787885da92013.yml diff --git a/src/cloudflare/types/shared/rate_plan.py b/src/cloudflare/types/shared/rate_plan.py index deab37dc61c..a66a8511d0f 100644 --- a/src/cloudflare/types/shared/rate_plan.py +++ b/src/cloudflare/types/shared/rate_plan.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Optional +from typing_extensions import Literal from ..._models import BaseModel @@ -8,7 +9,20 @@ class RatePlan(BaseModel): - id: Optional[str] = None + id: Optional[ + Literal[ + "free", + "lite", + "pro", + "pro_plus", + "business", + "enterprise", + "partners_free", + "partners_pro", + "partners_business", + "partners_enterprise", + ] + ] = None """The ID of the rate plan.""" currency: Optional[str] = None diff --git a/src/cloudflare/types/shared_params/rate_plan.py b/src/cloudflare/types/shared_params/rate_plan.py index 42e84fa46a1..8cddcdcd330 100644 --- a/src/cloudflare/types/shared_params/rate_plan.py +++ b/src/cloudflare/types/shared_params/rate_plan.py @@ -3,13 +3,24 @@ from __future__ import annotations from typing import List -from typing_extensions import TypedDict +from typing_extensions import Literal, TypedDict __all__ = ["RatePlan"] class RatePlan(TypedDict, total=False): - id: str + id: Literal[ + "free", + "lite", + "pro", + "pro_plus", + "business", + "enterprise", + "partners_free", + "partners_pro", + "partners_business", + "partners_enterprise", + ] """The ID of the rate plan.""" currency: str From daceb2abcd78f64aa279d587d71645378907e5fc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 05:05:59 +0000 Subject: [PATCH 104/358] feat(api): manual updates (#2422) --- api.md | 8 +---- src/cloudflare/resources/accounts/roles.py | 32 ++++++++----------- src/cloudflare/types/accounts/__init__.py | 1 - .../types/accounts/role_list_response.py | 10 ------ tests/api_resources/accounts/test_roles.py | 14 ++++---- 5 files changed, 21 insertions(+), 44 deletions(-) delete mode 100644 src/cloudflare/types/accounts/role_list_response.py diff --git a/api.md b/api.md index 75b7fbf60c9..31d3021e218 100644 --- a/api.md +++ b/api.md @@ -63,15 +63,9 @@ Methods: ## Roles -Types: - -```python -from cloudflare.types.accounts import RoleListResponse -``` - Methods: -- client.accounts.roles.list(\*, account_id) -> Optional[RoleListResponse] +- client.accounts.roles.list(\*, account_id) -> SyncSinglePage[Role] - client.accounts.roles.get(role_id, \*, account_id) -> Optional[Role] ## Subscriptions diff --git a/src/cloudflare/resources/accounts/roles.py b/src/cloudflare/resources/accounts/roles.py index debcc53d8c0..d7ef52252b4 100644 --- a/src/cloudflare/resources/accounts/roles.py +++ b/src/cloudflare/resources/accounts/roles.py @@ -16,9 +16,9 @@ async_to_streamed_response_wrapper, ) from ..._wrappers import ResultWrapper -from ..._base_client import make_request_options +from ...pagination import SyncSinglePage, AsyncSinglePage +from ..._base_client import AsyncPaginator, make_request_options from ...types.shared.role import Role -from ...types.accounts.role_list_response import RoleListResponse __all__ = ["RolesResource", "AsyncRolesResource"] @@ -53,7 +53,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RoleListResponse]: + ) -> SyncSinglePage[Role]: """ Get all available roles for an account. @@ -70,16 +70,13 @@ def list( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get( + return self._get_api_list( f"/accounts/{account_id}/roles", + page=SyncSinglePage[Role], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RoleListResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[RoleListResponse]], ResultWrapper[RoleListResponse]), + model=Role, ) def get( @@ -147,7 +144,7 @@ def with_streaming_response(self) -> AsyncRolesResourceWithStreamingResponse: """ return AsyncRolesResourceWithStreamingResponse(self) - async def list( + def list( self, *, account_id: str, @@ -157,7 +154,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RoleListResponse]: + ) -> AsyncPaginator[Role, AsyncSinglePage[Role]]: """ Get all available roles for an account. @@ -174,16 +171,13 @@ async def list( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._get( + return self._get_api_list( f"/accounts/{account_id}/roles", + page=AsyncSinglePage[Role], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RoleListResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[RoleListResponse]], ResultWrapper[RoleListResponse]), + model=Role, ) async def get( diff --git a/src/cloudflare/types/accounts/__init__.py b/src/cloudflare/types/accounts/__init__.py index fd5f47b3d0e..b9452666fc2 100644 --- a/src/cloudflare/types/accounts/__init__.py +++ b/src/cloudflare/types/accounts/__init__.py @@ -6,7 +6,6 @@ from .account import Account as Account from .token_list_params import TokenListParams as TokenListParams from .member_list_params import MemberListParams as MemberListParams -from .role_list_response import RoleListResponse as RoleListResponse from .account_list_params import AccountListParams as AccountListParams from .token_create_params import TokenCreateParams as TokenCreateParams from .token_update_params import TokenUpdateParams as TokenUpdateParams diff --git a/src/cloudflare/types/accounts/role_list_response.py b/src/cloudflare/types/accounts/role_list_response.py deleted file mode 100644 index 50a522a0fde..00000000000 --- a/src/cloudflare/types/accounts/role_list_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from ..shared.role import Role - -__all__ = ["RoleListResponse"] - -RoleListResponse: TypeAlias = List[Role] diff --git a/tests/api_resources/accounts/test_roles.py b/tests/api_resources/accounts/test_roles.py index eabcfc343df..95df57ae04f 100644 --- a/tests/api_resources/accounts/test_roles.py +++ b/tests/api_resources/accounts/test_roles.py @@ -9,8 +9,8 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.shared import Role -from cloudflare.types.accounts import RoleListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +23,7 @@ def test_method_list(self, client: Cloudflare) -> None: role = client.accounts.roles.list( account_id="eb78d65290b24279ba6f44721b3ea3c4", ) - assert_matches_type(Optional[RoleListResponse], role, path=["response"]) + assert_matches_type(SyncSinglePage[Role], role, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: @@ -34,7 +34,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" role = response.parse() - assert_matches_type(Optional[RoleListResponse], role, path=["response"]) + assert_matches_type(SyncSinglePage[Role], role, path=["response"]) @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: @@ -45,7 +45,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" role = response.parse() - assert_matches_type(Optional[RoleListResponse], role, path=["response"]) + assert_matches_type(SyncSinglePage[Role], role, path=["response"]) assert cast(Any, response.is_closed) is True @@ -113,7 +113,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: role = await async_client.accounts.roles.list( account_id="eb78d65290b24279ba6f44721b3ea3c4", ) - assert_matches_type(Optional[RoleListResponse], role, path=["response"]) + assert_matches_type(AsyncSinglePage[Role], role, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @@ -124,7 +124,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" role = await response.parse() - assert_matches_type(Optional[RoleListResponse], role, path=["response"]) + assert_matches_type(AsyncSinglePage[Role], role, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: @@ -135,7 +135,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" role = await response.parse() - assert_matches_type(Optional[RoleListResponse], role, path=["response"]) + assert_matches_type(AsyncSinglePage[Role], role, path=["response"]) assert cast(Any, response.is_closed) is True From 0f471a56521f2db019f981c5cc9bccc4e8fd5326 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 10:08:21 +0000 Subject: [PATCH 105/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index de6e07fc6c3..46976dca4aa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e342173dad9584a0439eeec0f609a40c16844e18a138f65e8c9787885da92013.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f86a29cec625ce10ab8b8ef9f7f2231490fcc8848247b025e1b5de45db4ecfee.yml From 28cd9afdfde3990508f2e3dcd6bf72c7a52a5282 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 10:56:23 +0000 Subject: [PATCH 106/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 46976dca4aa..de6e07fc6c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f86a29cec625ce10ab8b8ef9f7f2231490fcc8848247b025e1b5de45db4ecfee.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e342173dad9584a0439eeec0f609a40c16844e18a138f65e8c9787885da92013.yml From 7aa7af3d54e066cab8ce88218e00a2ad00f8bdee Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 13:08:26 +0000 Subject: [PATCH 107/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index de6e07fc6c3..46976dca4aa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e342173dad9584a0439eeec0f609a40c16844e18a138f65e8c9787885da92013.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f86a29cec625ce10ab8b8ef9f7f2231490fcc8848247b025e1b5de45db4ecfee.yml From 8ce826d4b105a765eeaa2d44189d993b214d5095 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 15:03:43 +0000 Subject: [PATCH 108/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 46976dca4aa..4d59266c250 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f86a29cec625ce10ab8b8ef9f7f2231490fcc8848247b025e1b5de45db4ecfee.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-baf072b3e0148bf6027b511051fec2b581649ec179c05523cdbf8e7774f389e2.yml From 7cfc2cdb78de79a4228985a5ab67d5f8a68d257e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 15:48:43 +0000 Subject: [PATCH 109/358] feat(api): api update (#2423) --- .stats.yml | 2 +- .../resources/ai_gateway/ai_gateway.py | 16 ++++++++++++++++ .../types/ai_gateway/ai_gateway_create_params.py | 4 ++++ .../ai_gateway/ai_gateway_create_response.py | 4 ++++ .../ai_gateway/ai_gateway_delete_response.py | 4 ++++ .../types/ai_gateway/ai_gateway_get_response.py | 4 ++++ .../types/ai_gateway/ai_gateway_list_response.py | 4 ++++ .../types/ai_gateway/ai_gateway_update_params.py | 4 ++++ .../ai_gateway/ai_gateway_update_response.py | 4 ++++ tests/api_resources/test_ai_gateway.py | 8 ++++++++ 10 files changed, 53 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 4d59266c250..354ff00e4e6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-baf072b3e0148bf6027b511051fec2b581649ec179c05523cdbf8e7774f389e2.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d44df38b0300879ca2f6cae588a5a8c3fe74cf2df8cd44c35b62ff41f7e255f4.yml diff --git a/src/cloudflare/resources/ai_gateway/ai_gateway.py b/src/cloudflare/resources/ai_gateway/ai_gateway.py index 1da57375627..04527825a3f 100644 --- a/src/cloudflare/resources/ai_gateway/ai_gateway.py +++ b/src/cloudflare/resources/ai_gateway/ai_gateway.py @@ -112,6 +112,8 @@ def create( rate_limiting_interval: Optional[int], rate_limiting_limit: Optional[int], rate_limiting_technique: Literal["fixed", "sliding"], + authentication: bool | NotGiven = NOT_GIVEN, + log_management: Optional[int] | NotGiven = NOT_GIVEN, logpush: bool | NotGiven = NOT_GIVEN, logpush_public_key: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -148,6 +150,8 @@ def create( "rate_limiting_interval": rate_limiting_interval, "rate_limiting_limit": rate_limiting_limit, "rate_limiting_technique": rate_limiting_technique, + "authentication": authentication, + "log_management": log_management, "logpush": logpush, "logpush_public_key": logpush_public_key, }, @@ -174,6 +178,8 @@ def update( rate_limiting_interval: Optional[int], rate_limiting_limit: Optional[int], rate_limiting_technique: Literal["fixed", "sliding"], + authentication: bool | NotGiven = NOT_GIVEN, + log_management: Optional[int] | NotGiven = NOT_GIVEN, logpush: bool | NotGiven = NOT_GIVEN, logpush_public_key: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -211,6 +217,8 @@ def update( "rate_limiting_interval": rate_limiting_interval, "rate_limiting_limit": rate_limiting_limit, "rate_limiting_technique": rate_limiting_technique, + "authentication": authentication, + "log_management": log_management, "logpush": logpush, "logpush_public_key": logpush_public_key, }, @@ -408,6 +416,8 @@ async def create( rate_limiting_interval: Optional[int], rate_limiting_limit: Optional[int], rate_limiting_technique: Literal["fixed", "sliding"], + authentication: bool | NotGiven = NOT_GIVEN, + log_management: Optional[int] | NotGiven = NOT_GIVEN, logpush: bool | NotGiven = NOT_GIVEN, logpush_public_key: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -444,6 +454,8 @@ async def create( "rate_limiting_interval": rate_limiting_interval, "rate_limiting_limit": rate_limiting_limit, "rate_limiting_technique": rate_limiting_technique, + "authentication": authentication, + "log_management": log_management, "logpush": logpush, "logpush_public_key": logpush_public_key, }, @@ -470,6 +482,8 @@ async def update( rate_limiting_interval: Optional[int], rate_limiting_limit: Optional[int], rate_limiting_technique: Literal["fixed", "sliding"], + authentication: bool | NotGiven = NOT_GIVEN, + log_management: Optional[int] | NotGiven = NOT_GIVEN, logpush: bool | NotGiven = NOT_GIVEN, logpush_public_key: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -507,6 +521,8 @@ async def update( "rate_limiting_interval": rate_limiting_interval, "rate_limiting_limit": rate_limiting_limit, "rate_limiting_technique": rate_limiting_technique, + "authentication": authentication, + "log_management": log_management, "logpush": logpush, "logpush_public_key": logpush_public_key, }, diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_create_params.py b/src/cloudflare/types/ai_gateway/ai_gateway_create_params.py index 0e0f3aee9a3..1242db27329 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_create_params.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_create_params.py @@ -26,6 +26,10 @@ class AIGatewayCreateParams(TypedDict, total=False): rate_limiting_technique: Required[Literal["fixed", "sliding"]] + authentication: bool + + log_management: Optional[int] + logpush: bool logpush_public_key: Optional[str] diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_create_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_create_response.py index 8c4df8ce75e..659a0523b84 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_create_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_create_response.py @@ -35,6 +35,10 @@ class AIGatewayCreateResponse(BaseModel): rate_limiting_technique: Literal["fixed", "sliding"] + authentication: Optional[bool] = None + + log_management: Optional[int] = None + logpush: Optional[bool] = None logpush_public_key: Optional[str] = None diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_delete_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_delete_response.py index 56b71b99466..10b0d26861b 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_delete_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_delete_response.py @@ -35,6 +35,10 @@ class AIGatewayDeleteResponse(BaseModel): rate_limiting_technique: Literal["fixed", "sliding"] + authentication: Optional[bool] = None + + log_management: Optional[int] = None + logpush: Optional[bool] = None logpush_public_key: Optional[str] = None diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_get_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_get_response.py index eed84b4ee8d..665f102fb1b 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_get_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_get_response.py @@ -35,6 +35,10 @@ class AIGatewayGetResponse(BaseModel): rate_limiting_technique: Literal["fixed", "sliding"] + authentication: Optional[bool] = None + + log_management: Optional[int] = None + logpush: Optional[bool] = None logpush_public_key: Optional[str] = None diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_list_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_list_response.py index 31dca9345f4..4b68d03f3fe 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_list_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_list_response.py @@ -35,6 +35,10 @@ class AIGatewayListResponse(BaseModel): rate_limiting_technique: Literal["fixed", "sliding"] + authentication: Optional[bool] = None + + log_management: Optional[int] = None + logpush: Optional[bool] = None logpush_public_key: Optional[str] = None diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_update_params.py b/src/cloudflare/types/ai_gateway/ai_gateway_update_params.py index e10c0992a8c..8e088902f48 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_update_params.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_update_params.py @@ -23,6 +23,10 @@ class AIGatewayUpdateParams(TypedDict, total=False): rate_limiting_technique: Required[Literal["fixed", "sliding"]] + authentication: bool + + log_management: Optional[int] + logpush: bool logpush_public_key: Optional[str] diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_update_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_update_response.py index 21e6cd223b6..bc0b2aa30db 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_update_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_update_response.py @@ -35,6 +35,10 @@ class AIGatewayUpdateResponse(BaseModel): rate_limiting_technique: Literal["fixed", "sliding"] + authentication: Optional[bool] = None + + log_management: Optional[int] = None + logpush: Optional[bool] = None logpush_public_key: Optional[str] = None diff --git a/tests/api_resources/test_ai_gateway.py b/tests/api_resources/test_ai_gateway.py index 410c03d585f..788a1ea2289 100644 --- a/tests/api_resources/test_ai_gateway.py +++ b/tests/api_resources/test_ai_gateway.py @@ -49,6 +49,8 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: rate_limiting_interval=0, rate_limiting_limit=0, rate_limiting_technique="fixed", + authentication=True, + log_management=10000, logpush=True, logpush_public_key="xxxxxxxxxxxxxxxx", ) @@ -131,6 +133,8 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: rate_limiting_interval=0, rate_limiting_limit=0, rate_limiting_technique="fixed", + authentication=True, + log_management=10000, logpush=True, logpush_public_key="xxxxxxxxxxxxxxxx", ) @@ -373,6 +377,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare rate_limiting_interval=0, rate_limiting_limit=0, rate_limiting_technique="fixed", + authentication=True, + log_management=10000, logpush=True, logpush_public_key="xxxxxxxxxxxxxxxx", ) @@ -455,6 +461,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare rate_limiting_interval=0, rate_limiting_limit=0, rate_limiting_technique="fixed", + authentication=True, + log_management=10000, logpush=True, logpush_public_key="xxxxxxxxxxxxxxxx", ) From a10f15f4628b0bed2a06d95571ecf83ed66ab4cc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 17:05:02 +0000 Subject: [PATCH 110/358] feat(api): api update (#2424) --- .stats.yml | 2 +- src/cloudflare/types/durable_objects/namespace.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 354ff00e4e6..420d1e391cf 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d44df38b0300879ca2f6cae588a5a8c3fe74cf2df8cd44c35b62ff41f7e255f4.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7100b19d975eb46bc9e7f7ea7a3dbea4d79c5d3972921c7e7db3612dd38bde21.yml diff --git a/src/cloudflare/types/durable_objects/namespace.py b/src/cloudflare/types/durable_objects/namespace.py index cb1bb82f93f..e9922554d84 100644 --- a/src/cloudflare/types/durable_objects/namespace.py +++ b/src/cloudflare/types/durable_objects/namespace.py @@ -18,4 +18,6 @@ class Namespace(BaseModel): script: Optional[str] = None + use_containers: Optional[bool] = None + use_sqlite: Optional[bool] = None From 198c3b1774e74b5b12469f56c19e3557e9708511 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 17:24:59 +0000 Subject: [PATCH 111/358] fix: improve names for conflicting params (#2425) --- api.md | 2 +- .../resources/resource_sharing/recipients.py | 32 ++++++++--------- .../zero_trust/organizations/organizations.py | 24 ++++++------- .../recipient_create_params.py | 4 +-- .../organization_revoke_users_params.py | 4 +-- .../resource_sharing/test_recipients.py | 36 +++++++++---------- .../zero_trust/test_organizations.py | 8 ++--- 7 files changed, 55 insertions(+), 55 deletions(-) diff --git a/api.md b/api.md index 31d3021e218..cca13f7a82e 100644 --- a/api.md +++ b/api.md @@ -8506,7 +8506,7 @@ from cloudflare.types.resource_sharing import ( Methods: -- client.resource_sharing.recipients.create(share_id, \*, account_id_1, \*\*params) -> Optional[RecipientCreateResponse] +- client.resource_sharing.recipients.create(share_id, \*, path_account_id, \*\*params) -> Optional[RecipientCreateResponse] - client.resource_sharing.recipients.list(share_id, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[RecipientListResponse] - client.resource_sharing.recipients.delete(recipient_id, \*, account_id, share_id) -> Optional[RecipientDeleteResponse] - client.resource_sharing.recipients.get(recipient_id, \*, account_id, share_id) -> Optional[RecipientGetResponse] diff --git a/src/cloudflare/resources/resource_sharing/recipients.py b/src/cloudflare/resources/resource_sharing/recipients.py index 81415f22963..f29632a0e8a 100644 --- a/src/cloudflare/resources/resource_sharing/recipients.py +++ b/src/cloudflare/resources/resource_sharing/recipients.py @@ -55,8 +55,8 @@ def create( self, share_id: str, *, - account_id_1: str, - account_id_2: str | NotGiven = NOT_GIVEN, + path_account_id: str, + body_account_id: str | NotGiven = NOT_GIVEN, organization_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -69,11 +69,11 @@ def create( Create a new share recipient Args: - account_id_1: Account identifier. + path_account_id: Account identifier. share_id: Share identifier tag. - account_id_2: Account identifier. + body_account_id: Account identifier. organization_id: Organization identifier. @@ -85,15 +85,15 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if not account_id_1: - raise ValueError(f"Expected a non-empty value for `account_id_1` but received {account_id_1!r}") + if not path_account_id: + raise ValueError(f"Expected a non-empty value for `path_account_id` but received {path_account_id!r}") if not share_id: raise ValueError(f"Expected a non-empty value for `share_id` but received {share_id!r}") return self._post( - f"/accounts/{account_id_1}/shares/{share_id}/recipients", + f"/accounts/{path_account_id}/shares/{share_id}/recipients", body=maybe_transform( { - "account_id_2": account_id_2, + "body_account_id": body_account_id, "organization_id": organization_id, }, recipient_create_params.RecipientCreateParams, @@ -289,8 +289,8 @@ async def create( self, share_id: str, *, - account_id_1: str, - account_id_2: str | NotGiven = NOT_GIVEN, + path_account_id: str, + body_account_id: str | NotGiven = NOT_GIVEN, organization_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -303,11 +303,11 @@ async def create( Create a new share recipient Args: - account_id_1: Account identifier. + path_account_id: Account identifier. share_id: Share identifier tag. - account_id_2: Account identifier. + body_account_id: Account identifier. organization_id: Organization identifier. @@ -319,15 +319,15 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if not account_id_1: - raise ValueError(f"Expected a non-empty value for `account_id_1` but received {account_id_1!r}") + if not path_account_id: + raise ValueError(f"Expected a non-empty value for `path_account_id` but received {path_account_id!r}") if not share_id: raise ValueError(f"Expected a non-empty value for `share_id` but received {share_id!r}") return await self._post( - f"/accounts/{account_id_1}/shares/{share_id}/recipients", + f"/accounts/{path_account_id}/shares/{share_id}/recipients", body=await async_maybe_transform( { - "account_id_2": account_id_2, + "body_account_id": body_account_id, "organization_id": organization_id, }, recipient_create_params.RecipientCreateParams, diff --git a/src/cloudflare/resources/zero_trust/organizations/organizations.py b/src/cloudflare/resources/zero_trust/organizations/organizations.py index 26f8d460463..8f473c661af 100644 --- a/src/cloudflare/resources/zero_trust/organizations/organizations.py +++ b/src/cloudflare/resources/zero_trust/organizations/organizations.py @@ -335,8 +335,8 @@ def revoke_users( email: str, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, - devices_1: bool | NotGiven = NOT_GIVEN, - devices_2: bool | NotGiven = NOT_GIVEN, + query_devices: bool | NotGiven = NOT_GIVEN, + body_devices: bool | NotGiven = NOT_GIVEN, user_uid: str | NotGiven = NOT_GIVEN, warp_session_reauth: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -356,9 +356,9 @@ def revoke_users( zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. - devices_1: When set to `true`, all devices associated with the user will be revoked. + query_devices: When set to `true`, all devices associated with the user will be revoked. - devices_2: When set to `true`, all devices associated with the user will be revoked. + body_devices: When set to `true`, all devices associated with the user will be revoked. user_uid: The uuid of the user to revoke. @@ -391,7 +391,7 @@ def revoke_users( body=maybe_transform( { "email": email, - "devices_2": devices_2, + "body_devices": body_devices, "user_uid": user_uid, "warp_session_reauth": warp_session_reauth, }, @@ -403,7 +403,7 @@ def revoke_users( extra_body=extra_body, timeout=timeout, query=maybe_transform( - {"devices_1": devices_1}, organization_revoke_users_params.OrganizationRevokeUsersParams + {"query_devices": query_devices}, organization_revoke_users_params.OrganizationRevokeUsersParams ), post_parser=ResultWrapper[Optional[OrganizationRevokeUsersResponse]]._unwrapper, ), @@ -707,8 +707,8 @@ async def revoke_users( email: str, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, - devices_1: bool | NotGiven = NOT_GIVEN, - devices_2: bool | NotGiven = NOT_GIVEN, + query_devices: bool | NotGiven = NOT_GIVEN, + body_devices: bool | NotGiven = NOT_GIVEN, user_uid: str | NotGiven = NOT_GIVEN, warp_session_reauth: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -728,9 +728,9 @@ async def revoke_users( zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. - devices_1: When set to `true`, all devices associated with the user will be revoked. + query_devices: When set to `true`, all devices associated with the user will be revoked. - devices_2: When set to `true`, all devices associated with the user will be revoked. + body_devices: When set to `true`, all devices associated with the user will be revoked. user_uid: The uuid of the user to revoke. @@ -763,7 +763,7 @@ async def revoke_users( body=await async_maybe_transform( { "email": email, - "devices_2": devices_2, + "body_devices": body_devices, "user_uid": user_uid, "warp_session_reauth": warp_session_reauth, }, @@ -775,7 +775,7 @@ async def revoke_users( extra_body=extra_body, timeout=timeout, query=await async_maybe_transform( - {"devices_1": devices_1}, organization_revoke_users_params.OrganizationRevokeUsersParams + {"query_devices": query_devices}, organization_revoke_users_params.OrganizationRevokeUsersParams ), post_parser=ResultWrapper[Optional[OrganizationRevokeUsersResponse]]._unwrapper, ), diff --git a/src/cloudflare/types/resource_sharing/recipient_create_params.py b/src/cloudflare/types/resource_sharing/recipient_create_params.py index 5e3ad6609ab..58b143bcada 100644 --- a/src/cloudflare/types/resource_sharing/recipient_create_params.py +++ b/src/cloudflare/types/resource_sharing/recipient_create_params.py @@ -10,10 +10,10 @@ class RecipientCreateParams(TypedDict, total=False): - account_id_1: Required[Annotated[str, PropertyInfo(alias="account_id")]] + path_account_id: Required[Annotated[str, PropertyInfo(alias="account_id")]] """Account identifier.""" - account_id_2: Annotated[str, PropertyInfo(alias="account_id")] + body_account_id: Annotated[str, PropertyInfo(alias="account_id")] """Account identifier.""" organization_id: str diff --git a/src/cloudflare/types/zero_trust/organization_revoke_users_params.py b/src/cloudflare/types/zero_trust/organization_revoke_users_params.py index 819fbb33331..d9467bcd648 100644 --- a/src/cloudflare/types/zero_trust/organization_revoke_users_params.py +++ b/src/cloudflare/types/zero_trust/organization_revoke_users_params.py @@ -19,10 +19,10 @@ class OrganizationRevokeUsersParams(TypedDict, total=False): zone_id: str """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" - devices_1: Annotated[bool, PropertyInfo(alias="devices")] + query_devices: Annotated[bool, PropertyInfo(alias="devices")] """When set to `true`, all devices associated with the user will be revoked.""" - devices_2: Annotated[bool, PropertyInfo(alias="devices")] + body_devices: Annotated[bool, PropertyInfo(alias="devices")] """When set to `true`, all devices associated with the user will be revoked.""" user_uid: str diff --git a/tests/api_resources/resource_sharing/test_recipients.py b/tests/api_resources/resource_sharing/test_recipients.py index a1e665de8b4..15de2199620 100644 --- a/tests/api_resources/resource_sharing/test_recipients.py +++ b/tests/api_resources/resource_sharing/test_recipients.py @@ -27,7 +27,7 @@ class TestRecipients: def test_method_create(self, client: Cloudflare) -> None: recipient = client.resource_sharing.recipients.create( share_id="3fd85f74b32742f1bff64a85009dda07", - account_id_1="023e105f4ecef8ad9ca31a8372d0c353", + path_account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[RecipientCreateResponse], recipient, path=["response"]) @@ -35,8 +35,8 @@ def test_method_create(self, client: Cloudflare) -> None: def test_method_create_with_all_params(self, client: Cloudflare) -> None: recipient = client.resource_sharing.recipients.create( share_id="3fd85f74b32742f1bff64a85009dda07", - account_id_1="023e105f4ecef8ad9ca31a8372d0c353", - account_id_2="023e105f4ecef8ad9ca31a8372d0c353", + path_account_id="023e105f4ecef8ad9ca31a8372d0c353", + body_account_id="023e105f4ecef8ad9ca31a8372d0c353", organization_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[RecipientCreateResponse], recipient, path=["response"]) @@ -45,7 +45,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_create(self, client: Cloudflare) -> None: response = client.resource_sharing.recipients.with_raw_response.create( share_id="3fd85f74b32742f1bff64a85009dda07", - account_id_1="023e105f4ecef8ad9ca31a8372d0c353", + path_account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -57,7 +57,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: def test_streaming_response_create(self, client: Cloudflare) -> None: with client.resource_sharing.recipients.with_streaming_response.create( share_id="3fd85f74b32742f1bff64a85009dda07", - account_id_1="023e105f4ecef8ad9ca31a8372d0c353", + path_account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -69,17 +69,17 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: @parametrize def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id_1` but received ''"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_account_id` but received ''"): client.resource_sharing.recipients.with_raw_response.create( share_id="3fd85f74b32742f1bff64a85009dda07", - account_id_1="", - account_id_2="", + path_account_id="", + body_account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `share_id` but received ''"): client.resource_sharing.recipients.with_raw_response.create( share_id="", - account_id_1="023e105f4ecef8ad9ca31a8372d0c353", + path_account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @parametrize @@ -268,7 +268,7 @@ class TestAsyncRecipients: async def test_method_create(self, async_client: AsyncCloudflare) -> None: recipient = await async_client.resource_sharing.recipients.create( share_id="3fd85f74b32742f1bff64a85009dda07", - account_id_1="023e105f4ecef8ad9ca31a8372d0c353", + path_account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[RecipientCreateResponse], recipient, path=["response"]) @@ -276,8 +276,8 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: recipient = await async_client.resource_sharing.recipients.create( share_id="3fd85f74b32742f1bff64a85009dda07", - account_id_1="023e105f4ecef8ad9ca31a8372d0c353", - account_id_2="023e105f4ecef8ad9ca31a8372d0c353", + path_account_id="023e105f4ecef8ad9ca31a8372d0c353", + body_account_id="023e105f4ecef8ad9ca31a8372d0c353", organization_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[RecipientCreateResponse], recipient, path=["response"]) @@ -286,7 +286,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.resource_sharing.recipients.with_raw_response.create( share_id="3fd85f74b32742f1bff64a85009dda07", - account_id_1="023e105f4ecef8ad9ca31a8372d0c353", + path_account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -298,7 +298,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.resource_sharing.recipients.with_streaming_response.create( share_id="3fd85f74b32742f1bff64a85009dda07", - account_id_1="023e105f4ecef8ad9ca31a8372d0c353", + path_account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -310,17 +310,17 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> @parametrize async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id_1` but received ''"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_account_id` but received ''"): await async_client.resource_sharing.recipients.with_raw_response.create( share_id="3fd85f74b32742f1bff64a85009dda07", - account_id_1="", - account_id_2="", + path_account_id="", + body_account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `share_id` but received ''"): await async_client.resource_sharing.recipients.with_raw_response.create( share_id="", - account_id_1="023e105f4ecef8ad9ca31a8372d0c353", + path_account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @parametrize diff --git a/tests/api_resources/zero_trust/test_organizations.py b/tests/api_resources/zero_trust/test_organizations.py index 3d851cb5226..e900ad0d293 100644 --- a/tests/api_resources/zero_trust/test_organizations.py +++ b/tests/api_resources/zero_trust/test_organizations.py @@ -246,8 +246,8 @@ def test_method_revoke_users_with_all_params(self, client: Cloudflare) -> None: organization = client.zero_trust.organizations.revoke_users( email="test@example.com", account_id="account_id", - devices_1=True, - devices_2=True, + query_devices=True, + body_devices=True, user_uid="699d98642c564d2e855e9661899b7252", warp_session_reauth=True, ) @@ -526,8 +526,8 @@ async def test_method_revoke_users_with_all_params(self, async_client: AsyncClou organization = await async_client.zero_trust.organizations.revoke_users( email="test@example.com", account_id="account_id", - devices_1=True, - devices_2=True, + query_devices=True, + body_devices=True, user_uid="699d98642c564d2e855e9661899b7252", warp_session_reauth=True, ) From ca9297861e9babe0ab92f5a67cbae3723f5f39ec Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 17:38:45 +0000 Subject: [PATCH 112/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 420d1e391cf..4e9f3ec1b67 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7100b19d975eb46bc9e7f7ea7a3dbea4d79c5d3972921c7e7db3612dd38bde21.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8bf742ae6e2cee2bd6aaefb44268e1d2242cae3b8057371f5d71c10b4da3f67f.yml From d3f7ffb9de811101e2a43ea2377e9d8a924c85bc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 19:00:42 +0000 Subject: [PATCH 113/358] feat(api): api update (#2426) --- .stats.yml | 2 +- src/cloudflare/resources/d1/database.py | 36 +++++++++++++++++++ src/cloudflare/types/d1/d1.py | 2 ++ .../types/d1/database_create_params.py | 1 + .../types/d1/database_list_response.py | 2 ++ 5 files changed, 42 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 4e9f3ec1b67..9890061ba23 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8bf742ae6e2cee2bd6aaefb44268e1d2242cae3b8057371f5d71c10b4da3f67f.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-013c26b947bc82da7dfa6f50d9e66450b455bb9400b244ac190bc6ecaf5c158f.yml diff --git a/src/cloudflare/resources/d1/database.py b/src/cloudflare/resources/d1/database.py index 025094dabe8..055b3d6d2fe 100644 --- a/src/cloudflare/resources/d1/database.py +++ b/src/cloudflare/resources/d1/database.py @@ -81,6 +81,8 @@ def create( Args: account_id: Account identifier tag. + name: D1 database name. + primary_location_hint: Specify the region to create the D1 primary, if available. If this option is omitted, the D1 will be created as close as possible to the current user. @@ -187,6 +189,8 @@ def delete( Args: account_id: Account identifier tag. + database_id: D1 database identifier (UUID). + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -236,6 +240,8 @@ def export( Args: account_id: Account identifier tag. + database_id: D1 database identifier (UUID). + output_format: Specifies that you will poll this endpoint until the export completes current_bookmark: To poll an in-progress export, provide the current bookmark (returned by your @@ -291,6 +297,8 @@ def get( Args: account_id: Account identifier tag. + database_id: D1 database identifier (UUID). + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -338,6 +346,8 @@ def import_( Args: account_id: Account identifier tag. + database_id: D1 database identifier (UUID). + action: Indicates you have a new SQL file to upload. etag: Required when action is 'init' or 'ingest'. An md5 hash of the file you're @@ -378,6 +388,8 @@ def import_( Args: account_id: Account identifier tag. + database_id: D1 database identifier (UUID). + action: Indicates you've finished uploading to tell the D1 to start consuming it etag: An md5 hash of the file you're uploading. Used to check if it already exists, @@ -418,6 +430,8 @@ def import_( Args: account_id: Account identifier tag. + database_id: D1 database identifier (UUID). + action: Indicates you've finished uploading to tell the D1 to start consuming it current_bookmark: This identifies the currently-running import, checking its status. @@ -498,6 +512,8 @@ def query( Args: account_id: Account identifier tag. + database_id: D1 database identifier (UUID). + sql: Your SQL query. Supports multiple statements, joined by semicolons, which will be executed as a batch. @@ -552,6 +568,8 @@ def raw( Args: account_id: Account identifier tag. + database_id: D1 database identifier (UUID). + sql: Your SQL query. Supports multiple statements, joined by semicolons, which will be executed as a batch. @@ -624,6 +642,8 @@ async def create( Args: account_id: Account identifier tag. + name: D1 database name. + primary_location_hint: Specify the region to create the D1 primary, if available. If this option is omitted, the D1 will be created as close as possible to the current user. @@ -730,6 +750,8 @@ async def delete( Args: account_id: Account identifier tag. + database_id: D1 database identifier (UUID). + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -779,6 +801,8 @@ async def export( Args: account_id: Account identifier tag. + database_id: D1 database identifier (UUID). + output_format: Specifies that you will poll this endpoint until the export completes current_bookmark: To poll an in-progress export, provide the current bookmark (returned by your @@ -834,6 +858,8 @@ async def get( Args: account_id: Account identifier tag. + database_id: D1 database identifier (UUID). + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -881,6 +907,8 @@ async def import_( Args: account_id: Account identifier tag. + database_id: D1 database identifier (UUID). + action: Indicates you have a new SQL file to upload. etag: Required when action is 'init' or 'ingest'. An md5 hash of the file you're @@ -921,6 +949,8 @@ async def import_( Args: account_id: Account identifier tag. + database_id: D1 database identifier (UUID). + action: Indicates you've finished uploading to tell the D1 to start consuming it etag: An md5 hash of the file you're uploading. Used to check if it already exists, @@ -961,6 +991,8 @@ async def import_( Args: account_id: Account identifier tag. + database_id: D1 database identifier (UUID). + action: Indicates you've finished uploading to tell the D1 to start consuming it current_bookmark: This identifies the currently-running import, checking its status. @@ -1041,6 +1073,8 @@ def query( Args: account_id: Account identifier tag. + database_id: D1 database identifier (UUID). + sql: Your SQL query. Supports multiple statements, joined by semicolons, which will be executed as a batch. @@ -1095,6 +1129,8 @@ def raw( Args: account_id: Account identifier tag. + database_id: D1 database identifier (UUID). + sql: Your SQL query. Supports multiple statements, joined by semicolons, which will be executed as a batch. diff --git a/src/cloudflare/types/d1/d1.py b/src/cloudflare/types/d1/d1.py index 047e12ac928..36fae4a4492 100644 --- a/src/cloudflare/types/d1/d1.py +++ b/src/cloudflare/types/d1/d1.py @@ -16,9 +16,11 @@ class D1(BaseModel): """The D1 database's size, in bytes.""" name: Optional[str] = None + """D1 database name.""" num_tables: Optional[float] = None uuid: Optional[str] = None + """D1 database identifier (UUID).""" version: Optional[str] = None diff --git a/src/cloudflare/types/d1/database_create_params.py b/src/cloudflare/types/d1/database_create_params.py index 3db8ef15021..76619229a50 100644 --- a/src/cloudflare/types/d1/database_create_params.py +++ b/src/cloudflare/types/d1/database_create_params.py @@ -12,6 +12,7 @@ class DatabaseCreateParams(TypedDict, total=False): """Account identifier tag.""" name: Required[str] + """D1 database name.""" primary_location_hint: Literal["wnam", "enam", "weur", "eeur", "apac", "oc"] """Specify the region to create the D1 primary, if available. diff --git a/src/cloudflare/types/d1/database_list_response.py b/src/cloudflare/types/d1/database_list_response.py index e767682a8c2..bdcb159357d 100644 --- a/src/cloudflare/types/d1/database_list_response.py +++ b/src/cloudflare/types/d1/database_list_response.py @@ -13,7 +13,9 @@ class DatabaseListResponse(BaseModel): """Specifies the timestamp the resource was created as an ISO8601 string.""" name: Optional[str] = None + """D1 database name.""" uuid: Optional[str] = None + """D1 database identifier (UUID).""" version: Optional[str] = None From 9d996cad565ab9da17272ae77f63e517f6b5d3b2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 19:17:43 +0000 Subject: [PATCH 114/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 9890061ba23..f3c978f2e90 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-013c26b947bc82da7dfa6f50d9e66450b455bb9400b244ac190bc6ecaf5c158f.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b9c3a90028bf6b940420332aee2ee13b3cf1fa04e607205d7efe8fdb1c7d41e8.yml From 5ee78eec670351783034e8a44cff67787943f715 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 23:57:56 +0000 Subject: [PATCH 115/358] feat(terraform): add datasource for `zero_trust_tunnel_cloudflared_token` (#2427) --- .stats.yml | 2 +- .../resources/ai_gateway/ai_gateway.py | 16 --------- src/cloudflare/resources/d1/database.py | 36 ------------------- .../ai_gateway/ai_gateway_create_params.py | 4 --- .../ai_gateway/ai_gateway_create_response.py | 4 --- .../ai_gateway/ai_gateway_delete_response.py | 4 --- .../ai_gateway/ai_gateway_get_response.py | 4 --- .../ai_gateway/ai_gateway_list_response.py | 4 --- .../ai_gateway/ai_gateway_update_params.py | 4 --- .../ai_gateway/ai_gateway_update_response.py | 4 --- src/cloudflare/types/d1/d1.py | 2 -- .../types/d1/database_create_params.py | 1 - .../types/d1/database_list_response.py | 2 -- .../types/durable_objects/namespace.py | 2 -- tests/api_resources/test_ai_gateway.py | 8 ----- 15 files changed, 1 insertion(+), 96 deletions(-) diff --git a/.stats.yml b/.stats.yml index f3c978f2e90..de6e07fc6c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b9c3a90028bf6b940420332aee2ee13b3cf1fa04e607205d7efe8fdb1c7d41e8.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e342173dad9584a0439eeec0f609a40c16844e18a138f65e8c9787885da92013.yml diff --git a/src/cloudflare/resources/ai_gateway/ai_gateway.py b/src/cloudflare/resources/ai_gateway/ai_gateway.py index 04527825a3f..1da57375627 100644 --- a/src/cloudflare/resources/ai_gateway/ai_gateway.py +++ b/src/cloudflare/resources/ai_gateway/ai_gateway.py @@ -112,8 +112,6 @@ def create( rate_limiting_interval: Optional[int], rate_limiting_limit: Optional[int], rate_limiting_technique: Literal["fixed", "sliding"], - authentication: bool | NotGiven = NOT_GIVEN, - log_management: Optional[int] | NotGiven = NOT_GIVEN, logpush: bool | NotGiven = NOT_GIVEN, logpush_public_key: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -150,8 +148,6 @@ def create( "rate_limiting_interval": rate_limiting_interval, "rate_limiting_limit": rate_limiting_limit, "rate_limiting_technique": rate_limiting_technique, - "authentication": authentication, - "log_management": log_management, "logpush": logpush, "logpush_public_key": logpush_public_key, }, @@ -178,8 +174,6 @@ def update( rate_limiting_interval: Optional[int], rate_limiting_limit: Optional[int], rate_limiting_technique: Literal["fixed", "sliding"], - authentication: bool | NotGiven = NOT_GIVEN, - log_management: Optional[int] | NotGiven = NOT_GIVEN, logpush: bool | NotGiven = NOT_GIVEN, logpush_public_key: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -217,8 +211,6 @@ def update( "rate_limiting_interval": rate_limiting_interval, "rate_limiting_limit": rate_limiting_limit, "rate_limiting_technique": rate_limiting_technique, - "authentication": authentication, - "log_management": log_management, "logpush": logpush, "logpush_public_key": logpush_public_key, }, @@ -416,8 +408,6 @@ async def create( rate_limiting_interval: Optional[int], rate_limiting_limit: Optional[int], rate_limiting_technique: Literal["fixed", "sliding"], - authentication: bool | NotGiven = NOT_GIVEN, - log_management: Optional[int] | NotGiven = NOT_GIVEN, logpush: bool | NotGiven = NOT_GIVEN, logpush_public_key: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -454,8 +444,6 @@ async def create( "rate_limiting_interval": rate_limiting_interval, "rate_limiting_limit": rate_limiting_limit, "rate_limiting_technique": rate_limiting_technique, - "authentication": authentication, - "log_management": log_management, "logpush": logpush, "logpush_public_key": logpush_public_key, }, @@ -482,8 +470,6 @@ async def update( rate_limiting_interval: Optional[int], rate_limiting_limit: Optional[int], rate_limiting_technique: Literal["fixed", "sliding"], - authentication: bool | NotGiven = NOT_GIVEN, - log_management: Optional[int] | NotGiven = NOT_GIVEN, logpush: bool | NotGiven = NOT_GIVEN, logpush_public_key: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -521,8 +507,6 @@ async def update( "rate_limiting_interval": rate_limiting_interval, "rate_limiting_limit": rate_limiting_limit, "rate_limiting_technique": rate_limiting_technique, - "authentication": authentication, - "log_management": log_management, "logpush": logpush, "logpush_public_key": logpush_public_key, }, diff --git a/src/cloudflare/resources/d1/database.py b/src/cloudflare/resources/d1/database.py index 055b3d6d2fe..025094dabe8 100644 --- a/src/cloudflare/resources/d1/database.py +++ b/src/cloudflare/resources/d1/database.py @@ -81,8 +81,6 @@ def create( Args: account_id: Account identifier tag. - name: D1 database name. - primary_location_hint: Specify the region to create the D1 primary, if available. If this option is omitted, the D1 will be created as close as possible to the current user. @@ -189,8 +187,6 @@ def delete( Args: account_id: Account identifier tag. - database_id: D1 database identifier (UUID). - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -240,8 +236,6 @@ def export( Args: account_id: Account identifier tag. - database_id: D1 database identifier (UUID). - output_format: Specifies that you will poll this endpoint until the export completes current_bookmark: To poll an in-progress export, provide the current bookmark (returned by your @@ -297,8 +291,6 @@ def get( Args: account_id: Account identifier tag. - database_id: D1 database identifier (UUID). - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -346,8 +338,6 @@ def import_( Args: account_id: Account identifier tag. - database_id: D1 database identifier (UUID). - action: Indicates you have a new SQL file to upload. etag: Required when action is 'init' or 'ingest'. An md5 hash of the file you're @@ -388,8 +378,6 @@ def import_( Args: account_id: Account identifier tag. - database_id: D1 database identifier (UUID). - action: Indicates you've finished uploading to tell the D1 to start consuming it etag: An md5 hash of the file you're uploading. Used to check if it already exists, @@ -430,8 +418,6 @@ def import_( Args: account_id: Account identifier tag. - database_id: D1 database identifier (UUID). - action: Indicates you've finished uploading to tell the D1 to start consuming it current_bookmark: This identifies the currently-running import, checking its status. @@ -512,8 +498,6 @@ def query( Args: account_id: Account identifier tag. - database_id: D1 database identifier (UUID). - sql: Your SQL query. Supports multiple statements, joined by semicolons, which will be executed as a batch. @@ -568,8 +552,6 @@ def raw( Args: account_id: Account identifier tag. - database_id: D1 database identifier (UUID). - sql: Your SQL query. Supports multiple statements, joined by semicolons, which will be executed as a batch. @@ -642,8 +624,6 @@ async def create( Args: account_id: Account identifier tag. - name: D1 database name. - primary_location_hint: Specify the region to create the D1 primary, if available. If this option is omitted, the D1 will be created as close as possible to the current user. @@ -750,8 +730,6 @@ async def delete( Args: account_id: Account identifier tag. - database_id: D1 database identifier (UUID). - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -801,8 +779,6 @@ async def export( Args: account_id: Account identifier tag. - database_id: D1 database identifier (UUID). - output_format: Specifies that you will poll this endpoint until the export completes current_bookmark: To poll an in-progress export, provide the current bookmark (returned by your @@ -858,8 +834,6 @@ async def get( Args: account_id: Account identifier tag. - database_id: D1 database identifier (UUID). - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -907,8 +881,6 @@ async def import_( Args: account_id: Account identifier tag. - database_id: D1 database identifier (UUID). - action: Indicates you have a new SQL file to upload. etag: Required when action is 'init' or 'ingest'. An md5 hash of the file you're @@ -949,8 +921,6 @@ async def import_( Args: account_id: Account identifier tag. - database_id: D1 database identifier (UUID). - action: Indicates you've finished uploading to tell the D1 to start consuming it etag: An md5 hash of the file you're uploading. Used to check if it already exists, @@ -991,8 +961,6 @@ async def import_( Args: account_id: Account identifier tag. - database_id: D1 database identifier (UUID). - action: Indicates you've finished uploading to tell the D1 to start consuming it current_bookmark: This identifies the currently-running import, checking its status. @@ -1073,8 +1041,6 @@ def query( Args: account_id: Account identifier tag. - database_id: D1 database identifier (UUID). - sql: Your SQL query. Supports multiple statements, joined by semicolons, which will be executed as a batch. @@ -1129,8 +1095,6 @@ def raw( Args: account_id: Account identifier tag. - database_id: D1 database identifier (UUID). - sql: Your SQL query. Supports multiple statements, joined by semicolons, which will be executed as a batch. diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_create_params.py b/src/cloudflare/types/ai_gateway/ai_gateway_create_params.py index 1242db27329..0e0f3aee9a3 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_create_params.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_create_params.py @@ -26,10 +26,6 @@ class AIGatewayCreateParams(TypedDict, total=False): rate_limiting_technique: Required[Literal["fixed", "sliding"]] - authentication: bool - - log_management: Optional[int] - logpush: bool logpush_public_key: Optional[str] diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_create_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_create_response.py index 659a0523b84..8c4df8ce75e 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_create_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_create_response.py @@ -35,10 +35,6 @@ class AIGatewayCreateResponse(BaseModel): rate_limiting_technique: Literal["fixed", "sliding"] - authentication: Optional[bool] = None - - log_management: Optional[int] = None - logpush: Optional[bool] = None logpush_public_key: Optional[str] = None diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_delete_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_delete_response.py index 10b0d26861b..56b71b99466 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_delete_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_delete_response.py @@ -35,10 +35,6 @@ class AIGatewayDeleteResponse(BaseModel): rate_limiting_technique: Literal["fixed", "sliding"] - authentication: Optional[bool] = None - - log_management: Optional[int] = None - logpush: Optional[bool] = None logpush_public_key: Optional[str] = None diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_get_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_get_response.py index 665f102fb1b..eed84b4ee8d 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_get_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_get_response.py @@ -35,10 +35,6 @@ class AIGatewayGetResponse(BaseModel): rate_limiting_technique: Literal["fixed", "sliding"] - authentication: Optional[bool] = None - - log_management: Optional[int] = None - logpush: Optional[bool] = None logpush_public_key: Optional[str] = None diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_list_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_list_response.py index 4b68d03f3fe..31dca9345f4 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_list_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_list_response.py @@ -35,10 +35,6 @@ class AIGatewayListResponse(BaseModel): rate_limiting_technique: Literal["fixed", "sliding"] - authentication: Optional[bool] = None - - log_management: Optional[int] = None - logpush: Optional[bool] = None logpush_public_key: Optional[str] = None diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_update_params.py b/src/cloudflare/types/ai_gateway/ai_gateway_update_params.py index 8e088902f48..e10c0992a8c 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_update_params.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_update_params.py @@ -23,10 +23,6 @@ class AIGatewayUpdateParams(TypedDict, total=False): rate_limiting_technique: Required[Literal["fixed", "sliding"]] - authentication: bool - - log_management: Optional[int] - logpush: bool logpush_public_key: Optional[str] diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_update_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_update_response.py index bc0b2aa30db..21e6cd223b6 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_update_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_update_response.py @@ -35,10 +35,6 @@ class AIGatewayUpdateResponse(BaseModel): rate_limiting_technique: Literal["fixed", "sliding"] - authentication: Optional[bool] = None - - log_management: Optional[int] = None - logpush: Optional[bool] = None logpush_public_key: Optional[str] = None diff --git a/src/cloudflare/types/d1/d1.py b/src/cloudflare/types/d1/d1.py index 36fae4a4492..047e12ac928 100644 --- a/src/cloudflare/types/d1/d1.py +++ b/src/cloudflare/types/d1/d1.py @@ -16,11 +16,9 @@ class D1(BaseModel): """The D1 database's size, in bytes.""" name: Optional[str] = None - """D1 database name.""" num_tables: Optional[float] = None uuid: Optional[str] = None - """D1 database identifier (UUID).""" version: Optional[str] = None diff --git a/src/cloudflare/types/d1/database_create_params.py b/src/cloudflare/types/d1/database_create_params.py index 76619229a50..3db8ef15021 100644 --- a/src/cloudflare/types/d1/database_create_params.py +++ b/src/cloudflare/types/d1/database_create_params.py @@ -12,7 +12,6 @@ class DatabaseCreateParams(TypedDict, total=False): """Account identifier tag.""" name: Required[str] - """D1 database name.""" primary_location_hint: Literal["wnam", "enam", "weur", "eeur", "apac", "oc"] """Specify the region to create the D1 primary, if available. diff --git a/src/cloudflare/types/d1/database_list_response.py b/src/cloudflare/types/d1/database_list_response.py index bdcb159357d..e767682a8c2 100644 --- a/src/cloudflare/types/d1/database_list_response.py +++ b/src/cloudflare/types/d1/database_list_response.py @@ -13,9 +13,7 @@ class DatabaseListResponse(BaseModel): """Specifies the timestamp the resource was created as an ISO8601 string.""" name: Optional[str] = None - """D1 database name.""" uuid: Optional[str] = None - """D1 database identifier (UUID).""" version: Optional[str] = None diff --git a/src/cloudflare/types/durable_objects/namespace.py b/src/cloudflare/types/durable_objects/namespace.py index e9922554d84..cb1bb82f93f 100644 --- a/src/cloudflare/types/durable_objects/namespace.py +++ b/src/cloudflare/types/durable_objects/namespace.py @@ -18,6 +18,4 @@ class Namespace(BaseModel): script: Optional[str] = None - use_containers: Optional[bool] = None - use_sqlite: Optional[bool] = None diff --git a/tests/api_resources/test_ai_gateway.py b/tests/api_resources/test_ai_gateway.py index 788a1ea2289..410c03d585f 100644 --- a/tests/api_resources/test_ai_gateway.py +++ b/tests/api_resources/test_ai_gateway.py @@ -49,8 +49,6 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: rate_limiting_interval=0, rate_limiting_limit=0, rate_limiting_technique="fixed", - authentication=True, - log_management=10000, logpush=True, logpush_public_key="xxxxxxxxxxxxxxxx", ) @@ -133,8 +131,6 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: rate_limiting_interval=0, rate_limiting_limit=0, rate_limiting_technique="fixed", - authentication=True, - log_management=10000, logpush=True, logpush_public_key="xxxxxxxxxxxxxxxx", ) @@ -377,8 +373,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare rate_limiting_interval=0, rate_limiting_limit=0, rate_limiting_technique="fixed", - authentication=True, - log_management=10000, logpush=True, logpush_public_key="xxxxxxxxxxxxxxxx", ) @@ -461,8 +455,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare rate_limiting_interval=0, rate_limiting_limit=0, rate_limiting_technique="fixed", - authentication=True, - log_management=10000, logpush=True, logpush_public_key="xxxxxxxxxxxxxxxx", ) From 0eb2862805155f388df50a96eb2620e279a9dd9a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2025 17:16:00 +0000 Subject: [PATCH 116/358] feat(client): send `X-Stainless-Read-Timeout` header (#2428) --- src/cloudflare/_base_client.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/cloudflare/_base_client.py b/src/cloudflare/_base_client.py index c8867a59b53..9376da89fa9 100644 --- a/src/cloudflare/_base_client.py +++ b/src/cloudflare/_base_client.py @@ -418,10 +418,17 @@ def _build_headers(self, options: FinalRequestOptions, *, retries_taken: int = 0 if idempotency_header and options.method.lower() != "get" and idempotency_header not in headers: headers[idempotency_header] = options.idempotency_key or self._idempotency_key() - # Don't set the retry count header if it was already set or removed by the caller. We check + # Don't set these headers if they were already set or removed by the caller. We check # `custom_headers`, which can contain `Omit()`, instead of `headers` to account for the removal case. - if "x-stainless-retry-count" not in (header.lower() for header in custom_headers): + lower_custom_headers = [header.lower() for header in custom_headers] + if "x-stainless-retry-count" not in lower_custom_headers: headers["x-stainless-retry-count"] = str(retries_taken) + if "x-stainless-read-timeout" not in lower_custom_headers: + timeout = self.timeout if isinstance(options.timeout, NotGiven) else options.timeout + if isinstance(timeout, Timeout): + timeout = timeout.read + if timeout is not None: + headers["x-stainless-read-timeout"] = str(timeout) return headers From 8e3c4b853a76ea15c4a2da0dd36e85f71e6a9eb2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2025 23:35:02 +0000 Subject: [PATCH 117/358] feat(api): api update (#2429) --- .stats.yml | 2 +- .../resources/ai_gateway/ai_gateway.py | 16 +++++++++ src/cloudflare/resources/d1/database.py | 36 +++++++++++++++++++ .../ai_gateway/ai_gateway_create_params.py | 4 +++ .../ai_gateway/ai_gateway_create_response.py | 4 +++ .../ai_gateway/ai_gateway_delete_response.py | 4 +++ .../ai_gateway/ai_gateway_get_response.py | 4 +++ .../ai_gateway/ai_gateway_list_response.py | 4 +++ .../ai_gateway/ai_gateway_update_params.py | 4 +++ .../ai_gateway/ai_gateway_update_response.py | 4 +++ src/cloudflare/types/d1/d1.py | 2 ++ .../types/d1/database_create_params.py | 1 + .../types/d1/database_list_response.py | 2 ++ .../types/durable_objects/namespace.py | 2 ++ tests/api_resources/test_ai_gateway.py | 8 +++++ 15 files changed, 96 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index de6e07fc6c3..f3c978f2e90 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e342173dad9584a0439eeec0f609a40c16844e18a138f65e8c9787885da92013.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b9c3a90028bf6b940420332aee2ee13b3cf1fa04e607205d7efe8fdb1c7d41e8.yml diff --git a/src/cloudflare/resources/ai_gateway/ai_gateway.py b/src/cloudflare/resources/ai_gateway/ai_gateway.py index 1da57375627..04527825a3f 100644 --- a/src/cloudflare/resources/ai_gateway/ai_gateway.py +++ b/src/cloudflare/resources/ai_gateway/ai_gateway.py @@ -112,6 +112,8 @@ def create( rate_limiting_interval: Optional[int], rate_limiting_limit: Optional[int], rate_limiting_technique: Literal["fixed", "sliding"], + authentication: bool | NotGiven = NOT_GIVEN, + log_management: Optional[int] | NotGiven = NOT_GIVEN, logpush: bool | NotGiven = NOT_GIVEN, logpush_public_key: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -148,6 +150,8 @@ def create( "rate_limiting_interval": rate_limiting_interval, "rate_limiting_limit": rate_limiting_limit, "rate_limiting_technique": rate_limiting_technique, + "authentication": authentication, + "log_management": log_management, "logpush": logpush, "logpush_public_key": logpush_public_key, }, @@ -174,6 +178,8 @@ def update( rate_limiting_interval: Optional[int], rate_limiting_limit: Optional[int], rate_limiting_technique: Literal["fixed", "sliding"], + authentication: bool | NotGiven = NOT_GIVEN, + log_management: Optional[int] | NotGiven = NOT_GIVEN, logpush: bool | NotGiven = NOT_GIVEN, logpush_public_key: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -211,6 +217,8 @@ def update( "rate_limiting_interval": rate_limiting_interval, "rate_limiting_limit": rate_limiting_limit, "rate_limiting_technique": rate_limiting_technique, + "authentication": authentication, + "log_management": log_management, "logpush": logpush, "logpush_public_key": logpush_public_key, }, @@ -408,6 +416,8 @@ async def create( rate_limiting_interval: Optional[int], rate_limiting_limit: Optional[int], rate_limiting_technique: Literal["fixed", "sliding"], + authentication: bool | NotGiven = NOT_GIVEN, + log_management: Optional[int] | NotGiven = NOT_GIVEN, logpush: bool | NotGiven = NOT_GIVEN, logpush_public_key: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -444,6 +454,8 @@ async def create( "rate_limiting_interval": rate_limiting_interval, "rate_limiting_limit": rate_limiting_limit, "rate_limiting_technique": rate_limiting_technique, + "authentication": authentication, + "log_management": log_management, "logpush": logpush, "logpush_public_key": logpush_public_key, }, @@ -470,6 +482,8 @@ async def update( rate_limiting_interval: Optional[int], rate_limiting_limit: Optional[int], rate_limiting_technique: Literal["fixed", "sliding"], + authentication: bool | NotGiven = NOT_GIVEN, + log_management: Optional[int] | NotGiven = NOT_GIVEN, logpush: bool | NotGiven = NOT_GIVEN, logpush_public_key: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -507,6 +521,8 @@ async def update( "rate_limiting_interval": rate_limiting_interval, "rate_limiting_limit": rate_limiting_limit, "rate_limiting_technique": rate_limiting_technique, + "authentication": authentication, + "log_management": log_management, "logpush": logpush, "logpush_public_key": logpush_public_key, }, diff --git a/src/cloudflare/resources/d1/database.py b/src/cloudflare/resources/d1/database.py index 025094dabe8..055b3d6d2fe 100644 --- a/src/cloudflare/resources/d1/database.py +++ b/src/cloudflare/resources/d1/database.py @@ -81,6 +81,8 @@ def create( Args: account_id: Account identifier tag. + name: D1 database name. + primary_location_hint: Specify the region to create the D1 primary, if available. If this option is omitted, the D1 will be created as close as possible to the current user. @@ -187,6 +189,8 @@ def delete( Args: account_id: Account identifier tag. + database_id: D1 database identifier (UUID). + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -236,6 +240,8 @@ def export( Args: account_id: Account identifier tag. + database_id: D1 database identifier (UUID). + output_format: Specifies that you will poll this endpoint until the export completes current_bookmark: To poll an in-progress export, provide the current bookmark (returned by your @@ -291,6 +297,8 @@ def get( Args: account_id: Account identifier tag. + database_id: D1 database identifier (UUID). + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -338,6 +346,8 @@ def import_( Args: account_id: Account identifier tag. + database_id: D1 database identifier (UUID). + action: Indicates you have a new SQL file to upload. etag: Required when action is 'init' or 'ingest'. An md5 hash of the file you're @@ -378,6 +388,8 @@ def import_( Args: account_id: Account identifier tag. + database_id: D1 database identifier (UUID). + action: Indicates you've finished uploading to tell the D1 to start consuming it etag: An md5 hash of the file you're uploading. Used to check if it already exists, @@ -418,6 +430,8 @@ def import_( Args: account_id: Account identifier tag. + database_id: D1 database identifier (UUID). + action: Indicates you've finished uploading to tell the D1 to start consuming it current_bookmark: This identifies the currently-running import, checking its status. @@ -498,6 +512,8 @@ def query( Args: account_id: Account identifier tag. + database_id: D1 database identifier (UUID). + sql: Your SQL query. Supports multiple statements, joined by semicolons, which will be executed as a batch. @@ -552,6 +568,8 @@ def raw( Args: account_id: Account identifier tag. + database_id: D1 database identifier (UUID). + sql: Your SQL query. Supports multiple statements, joined by semicolons, which will be executed as a batch. @@ -624,6 +642,8 @@ async def create( Args: account_id: Account identifier tag. + name: D1 database name. + primary_location_hint: Specify the region to create the D1 primary, if available. If this option is omitted, the D1 will be created as close as possible to the current user. @@ -730,6 +750,8 @@ async def delete( Args: account_id: Account identifier tag. + database_id: D1 database identifier (UUID). + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -779,6 +801,8 @@ async def export( Args: account_id: Account identifier tag. + database_id: D1 database identifier (UUID). + output_format: Specifies that you will poll this endpoint until the export completes current_bookmark: To poll an in-progress export, provide the current bookmark (returned by your @@ -834,6 +858,8 @@ async def get( Args: account_id: Account identifier tag. + database_id: D1 database identifier (UUID). + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -881,6 +907,8 @@ async def import_( Args: account_id: Account identifier tag. + database_id: D1 database identifier (UUID). + action: Indicates you have a new SQL file to upload. etag: Required when action is 'init' or 'ingest'. An md5 hash of the file you're @@ -921,6 +949,8 @@ async def import_( Args: account_id: Account identifier tag. + database_id: D1 database identifier (UUID). + action: Indicates you've finished uploading to tell the D1 to start consuming it etag: An md5 hash of the file you're uploading. Used to check if it already exists, @@ -961,6 +991,8 @@ async def import_( Args: account_id: Account identifier tag. + database_id: D1 database identifier (UUID). + action: Indicates you've finished uploading to tell the D1 to start consuming it current_bookmark: This identifies the currently-running import, checking its status. @@ -1041,6 +1073,8 @@ def query( Args: account_id: Account identifier tag. + database_id: D1 database identifier (UUID). + sql: Your SQL query. Supports multiple statements, joined by semicolons, which will be executed as a batch. @@ -1095,6 +1129,8 @@ def raw( Args: account_id: Account identifier tag. + database_id: D1 database identifier (UUID). + sql: Your SQL query. Supports multiple statements, joined by semicolons, which will be executed as a batch. diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_create_params.py b/src/cloudflare/types/ai_gateway/ai_gateway_create_params.py index 0e0f3aee9a3..1242db27329 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_create_params.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_create_params.py @@ -26,6 +26,10 @@ class AIGatewayCreateParams(TypedDict, total=False): rate_limiting_technique: Required[Literal["fixed", "sliding"]] + authentication: bool + + log_management: Optional[int] + logpush: bool logpush_public_key: Optional[str] diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_create_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_create_response.py index 8c4df8ce75e..659a0523b84 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_create_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_create_response.py @@ -35,6 +35,10 @@ class AIGatewayCreateResponse(BaseModel): rate_limiting_technique: Literal["fixed", "sliding"] + authentication: Optional[bool] = None + + log_management: Optional[int] = None + logpush: Optional[bool] = None logpush_public_key: Optional[str] = None diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_delete_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_delete_response.py index 56b71b99466..10b0d26861b 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_delete_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_delete_response.py @@ -35,6 +35,10 @@ class AIGatewayDeleteResponse(BaseModel): rate_limiting_technique: Literal["fixed", "sliding"] + authentication: Optional[bool] = None + + log_management: Optional[int] = None + logpush: Optional[bool] = None logpush_public_key: Optional[str] = None diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_get_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_get_response.py index eed84b4ee8d..665f102fb1b 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_get_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_get_response.py @@ -35,6 +35,10 @@ class AIGatewayGetResponse(BaseModel): rate_limiting_technique: Literal["fixed", "sliding"] + authentication: Optional[bool] = None + + log_management: Optional[int] = None + logpush: Optional[bool] = None logpush_public_key: Optional[str] = None diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_list_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_list_response.py index 31dca9345f4..4b68d03f3fe 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_list_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_list_response.py @@ -35,6 +35,10 @@ class AIGatewayListResponse(BaseModel): rate_limiting_technique: Literal["fixed", "sliding"] + authentication: Optional[bool] = None + + log_management: Optional[int] = None + logpush: Optional[bool] = None logpush_public_key: Optional[str] = None diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_update_params.py b/src/cloudflare/types/ai_gateway/ai_gateway_update_params.py index e10c0992a8c..8e088902f48 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_update_params.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_update_params.py @@ -23,6 +23,10 @@ class AIGatewayUpdateParams(TypedDict, total=False): rate_limiting_technique: Required[Literal["fixed", "sliding"]] + authentication: bool + + log_management: Optional[int] + logpush: bool logpush_public_key: Optional[str] diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_update_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_update_response.py index 21e6cd223b6..bc0b2aa30db 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_update_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_update_response.py @@ -35,6 +35,10 @@ class AIGatewayUpdateResponse(BaseModel): rate_limiting_technique: Literal["fixed", "sliding"] + authentication: Optional[bool] = None + + log_management: Optional[int] = None + logpush: Optional[bool] = None logpush_public_key: Optional[str] = None diff --git a/src/cloudflare/types/d1/d1.py b/src/cloudflare/types/d1/d1.py index 047e12ac928..36fae4a4492 100644 --- a/src/cloudflare/types/d1/d1.py +++ b/src/cloudflare/types/d1/d1.py @@ -16,9 +16,11 @@ class D1(BaseModel): """The D1 database's size, in bytes.""" name: Optional[str] = None + """D1 database name.""" num_tables: Optional[float] = None uuid: Optional[str] = None + """D1 database identifier (UUID).""" version: Optional[str] = None diff --git a/src/cloudflare/types/d1/database_create_params.py b/src/cloudflare/types/d1/database_create_params.py index 3db8ef15021..76619229a50 100644 --- a/src/cloudflare/types/d1/database_create_params.py +++ b/src/cloudflare/types/d1/database_create_params.py @@ -12,6 +12,7 @@ class DatabaseCreateParams(TypedDict, total=False): """Account identifier tag.""" name: Required[str] + """D1 database name.""" primary_location_hint: Literal["wnam", "enam", "weur", "eeur", "apac", "oc"] """Specify the region to create the D1 primary, if available. diff --git a/src/cloudflare/types/d1/database_list_response.py b/src/cloudflare/types/d1/database_list_response.py index e767682a8c2..bdcb159357d 100644 --- a/src/cloudflare/types/d1/database_list_response.py +++ b/src/cloudflare/types/d1/database_list_response.py @@ -13,7 +13,9 @@ class DatabaseListResponse(BaseModel): """Specifies the timestamp the resource was created as an ISO8601 string.""" name: Optional[str] = None + """D1 database name.""" uuid: Optional[str] = None + """D1 database identifier (UUID).""" version: Optional[str] = None diff --git a/src/cloudflare/types/durable_objects/namespace.py b/src/cloudflare/types/durable_objects/namespace.py index cb1bb82f93f..e9922554d84 100644 --- a/src/cloudflare/types/durable_objects/namespace.py +++ b/src/cloudflare/types/durable_objects/namespace.py @@ -18,4 +18,6 @@ class Namespace(BaseModel): script: Optional[str] = None + use_containers: Optional[bool] = None + use_sqlite: Optional[bool] = None diff --git a/tests/api_resources/test_ai_gateway.py b/tests/api_resources/test_ai_gateway.py index 410c03d585f..788a1ea2289 100644 --- a/tests/api_resources/test_ai_gateway.py +++ b/tests/api_resources/test_ai_gateway.py @@ -49,6 +49,8 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: rate_limiting_interval=0, rate_limiting_limit=0, rate_limiting_technique="fixed", + authentication=True, + log_management=10000, logpush=True, logpush_public_key="xxxxxxxxxxxxxxxx", ) @@ -131,6 +133,8 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: rate_limiting_interval=0, rate_limiting_limit=0, rate_limiting_technique="fixed", + authentication=True, + log_management=10000, logpush=True, logpush_public_key="xxxxxxxxxxxxxxxx", ) @@ -373,6 +377,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare rate_limiting_interval=0, rate_limiting_limit=0, rate_limiting_technique="fixed", + authentication=True, + log_management=10000, logpush=True, logpush_public_key="xxxxxxxxxxxxxxxx", ) @@ -455,6 +461,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare rate_limiting_interval=0, rate_limiting_limit=0, rate_limiting_technique="fixed", + authentication=True, + log_management=10000, logpush=True, logpush_public_key="xxxxxxxxxxxxxxxx", ) From 414a9d6bf33c0d2b886984742d0b8efbae58ebaa Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2025 23:38:13 +0000 Subject: [PATCH 118/358] feat(api): api update (#2430) --- .stats.yml | 4 +- api.md | 12 -- src/cloudflare/resources/ssl/__init__.py | 14 -- .../resources/ssl/recommendations.py | 178 ------------------ src/cloudflare/resources/ssl/ssl.py | 32 ---- src/cloudflare/types/ssl/__init__.py | 1 - .../types/ssl/recommendation_get_response.py | 18 -- .../api_resources/ssl/test_recommendations.py | 98 ---------- 8 files changed, 2 insertions(+), 355 deletions(-) delete mode 100644 src/cloudflare/resources/ssl/recommendations.py delete mode 100644 src/cloudflare/types/ssl/recommendation_get_response.py delete mode 100644 tests/api_resources/ssl/test_recommendations.py diff --git a/.stats.yml b/.stats.yml index f3c978f2e90..7cd6eed1290 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b9c3a90028bf6b940420332aee2ee13b3cf1fa04e607205d7efe8fdb1c7d41e8.yml +configured_endpoints: 1524 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aa93097d3c029937a6c5f40f1de4e577b20ec66ff43fa27c110f6cd3ea718704.yml diff --git a/api.md b/api.md index cca13f7a82e..97fc9f18ba0 100644 --- a/api.md +++ b/api.md @@ -771,18 +771,6 @@ Methods: - client.ssl.certificate_packs.quota.get(\*, zone_id) -> Optional[QuotaGetResponse] -## Recommendations - -Types: - -```python -from cloudflare.types.ssl import RecommendationGetResponse -``` - -Methods: - -- client.ssl.recommendations.get(zone_identifier) -> Optional[RecommendationGetResponse] - ## Universal ### Settings diff --git a/src/cloudflare/resources/ssl/__init__.py b/src/cloudflare/resources/ssl/__init__.py index 59245e44dfb..a7e69021e50 100644 --- a/src/cloudflare/resources/ssl/__init__.py +++ b/src/cloudflare/resources/ssl/__init__.py @@ -32,14 +32,6 @@ VerificationResourceWithStreamingResponse, AsyncVerificationResourceWithStreamingResponse, ) -from .recommendations import ( - RecommendationsResource, - AsyncRecommendationsResource, - RecommendationsResourceWithRawResponse, - AsyncRecommendationsResourceWithRawResponse, - RecommendationsResourceWithStreamingResponse, - AsyncRecommendationsResourceWithStreamingResponse, -) from .certificate_packs import ( CertificatePacksResource, AsyncCertificatePacksResource, @@ -62,12 +54,6 @@ "AsyncCertificatePacksResourceWithRawResponse", "CertificatePacksResourceWithStreamingResponse", "AsyncCertificatePacksResourceWithStreamingResponse", - "RecommendationsResource", - "AsyncRecommendationsResource", - "RecommendationsResourceWithRawResponse", - "AsyncRecommendationsResourceWithRawResponse", - "RecommendationsResourceWithStreamingResponse", - "AsyncRecommendationsResourceWithStreamingResponse", "UniversalResource", "AsyncUniversalResource", "UniversalResourceWithRawResponse", diff --git a/src/cloudflare/resources/ssl/recommendations.py b/src/cloudflare/resources/ssl/recommendations.py deleted file mode 100644 index 25a8cf712a0..00000000000 --- a/src/cloudflare/resources/ssl/recommendations.py +++ /dev/null @@ -1,178 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Type, Optional, cast - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._wrappers import ResultWrapper -from ..._base_client import make_request_options -from ...types.ssl.recommendation_get_response import RecommendationGetResponse - -__all__ = ["RecommendationsResource", "AsyncRecommendationsResource"] - - -class RecommendationsResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> RecommendationsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return RecommendationsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> RecommendationsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return RecommendationsResourceWithStreamingResponse(self) - - def get( - self, - zone_identifier: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecommendationGetResponse]: - """ - Retrieve the SSL/TLS Recommender's recommendation for a zone. - - Args: - zone_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not zone_identifier: - raise ValueError(f"Expected a non-empty value for `zone_identifier` but received {zone_identifier!r}") - return self._get( - f"/zones/{zone_identifier}/ssl/recommendation", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RecommendationGetResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[RecommendationGetResponse]], ResultWrapper[RecommendationGetResponse]), - ) - - -class AsyncRecommendationsResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncRecommendationsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncRecommendationsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncRecommendationsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncRecommendationsResourceWithStreamingResponse(self) - - async def get( - self, - zone_identifier: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecommendationGetResponse]: - """ - Retrieve the SSL/TLS Recommender's recommendation for a zone. - - Args: - zone_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not zone_identifier: - raise ValueError(f"Expected a non-empty value for `zone_identifier` but received {zone_identifier!r}") - return await self._get( - f"/zones/{zone_identifier}/ssl/recommendation", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RecommendationGetResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[RecommendationGetResponse]], ResultWrapper[RecommendationGetResponse]), - ) - - -class RecommendationsResourceWithRawResponse: - def __init__(self, recommendations: RecommendationsResource) -> None: - self._recommendations = recommendations - - self.get = to_raw_response_wrapper( - recommendations.get, - ) - - -class AsyncRecommendationsResourceWithRawResponse: - def __init__(self, recommendations: AsyncRecommendationsResource) -> None: - self._recommendations = recommendations - - self.get = async_to_raw_response_wrapper( - recommendations.get, - ) - - -class RecommendationsResourceWithStreamingResponse: - def __init__(self, recommendations: RecommendationsResource) -> None: - self._recommendations = recommendations - - self.get = to_streamed_response_wrapper( - recommendations.get, - ) - - -class AsyncRecommendationsResourceWithStreamingResponse: - def __init__(self, recommendations: AsyncRecommendationsResource) -> None: - self._recommendations = recommendations - - self.get = async_to_streamed_response_wrapper( - recommendations.get, - ) diff --git a/src/cloudflare/resources/ssl/ssl.py b/src/cloudflare/resources/ssl/ssl.py index c46c403db8b..8d0acbe4b00 100644 --- a/src/cloudflare/resources/ssl/ssl.py +++ b/src/cloudflare/resources/ssl/ssl.py @@ -20,14 +20,6 @@ VerificationResourceWithStreamingResponse, AsyncVerificationResourceWithStreamingResponse, ) -from .recommendations import ( - RecommendationsResource, - AsyncRecommendationsResource, - RecommendationsResourceWithRawResponse, - AsyncRecommendationsResourceWithRawResponse, - RecommendationsResourceWithStreamingResponse, - AsyncRecommendationsResourceWithStreamingResponse, -) from .universal.universal import ( UniversalResource, AsyncUniversalResource, @@ -57,10 +49,6 @@ def analyze(self) -> AnalyzeResource: def certificate_packs(self) -> CertificatePacksResource: return CertificatePacksResource(self._client) - @cached_property - def recommendations(self) -> RecommendationsResource: - return RecommendationsResource(self._client) - @cached_property def universal(self) -> UniversalResource: return UniversalResource(self._client) @@ -98,10 +86,6 @@ def analyze(self) -> AsyncAnalyzeResource: def certificate_packs(self) -> AsyncCertificatePacksResource: return AsyncCertificatePacksResource(self._client) - @cached_property - def recommendations(self) -> AsyncRecommendationsResource: - return AsyncRecommendationsResource(self._client) - @cached_property def universal(self) -> AsyncUniversalResource: return AsyncUniversalResource(self._client) @@ -142,10 +126,6 @@ def analyze(self) -> AnalyzeResourceWithRawResponse: def certificate_packs(self) -> CertificatePacksResourceWithRawResponse: return CertificatePacksResourceWithRawResponse(self._ssl.certificate_packs) - @cached_property - def recommendations(self) -> RecommendationsResourceWithRawResponse: - return RecommendationsResourceWithRawResponse(self._ssl.recommendations) - @cached_property def universal(self) -> UniversalResourceWithRawResponse: return UniversalResourceWithRawResponse(self._ssl.universal) @@ -167,10 +147,6 @@ def analyze(self) -> AsyncAnalyzeResourceWithRawResponse: def certificate_packs(self) -> AsyncCertificatePacksResourceWithRawResponse: return AsyncCertificatePacksResourceWithRawResponse(self._ssl.certificate_packs) - @cached_property - def recommendations(self) -> AsyncRecommendationsResourceWithRawResponse: - return AsyncRecommendationsResourceWithRawResponse(self._ssl.recommendations) - @cached_property def universal(self) -> AsyncUniversalResourceWithRawResponse: return AsyncUniversalResourceWithRawResponse(self._ssl.universal) @@ -192,10 +168,6 @@ def analyze(self) -> AnalyzeResourceWithStreamingResponse: def certificate_packs(self) -> CertificatePacksResourceWithStreamingResponse: return CertificatePacksResourceWithStreamingResponse(self._ssl.certificate_packs) - @cached_property - def recommendations(self) -> RecommendationsResourceWithStreamingResponse: - return RecommendationsResourceWithStreamingResponse(self._ssl.recommendations) - @cached_property def universal(self) -> UniversalResourceWithStreamingResponse: return UniversalResourceWithStreamingResponse(self._ssl.universal) @@ -217,10 +189,6 @@ def analyze(self) -> AsyncAnalyzeResourceWithStreamingResponse: def certificate_packs(self) -> AsyncCertificatePacksResourceWithStreamingResponse: return AsyncCertificatePacksResourceWithStreamingResponse(self._ssl.certificate_packs) - @cached_property - def recommendations(self) -> AsyncRecommendationsResourceWithStreamingResponse: - return AsyncRecommendationsResourceWithStreamingResponse(self._ssl.recommendations) - @cached_property def universal(self) -> AsyncUniversalResourceWithStreamingResponse: return AsyncUniversalResourceWithStreamingResponse(self._ssl.universal) diff --git a/src/cloudflare/types/ssl/__init__.py b/src/cloudflare/types/ssl/__init__.py index b12a6fb8467..9f91c6c173b 100644 --- a/src/cloudflare/types/ssl/__init__.py +++ b/src/cloudflare/types/ssl/__init__.py @@ -12,7 +12,6 @@ from .verification_edit_params import VerificationEditParams as VerificationEditParams from .verification_get_response import VerificationGetResponse as VerificationGetResponse from .verification_edit_response import VerificationEditResponse as VerificationEditResponse -from .recommendation_get_response import RecommendationGetResponse as RecommendationGetResponse from .certificate_pack_edit_params import CertificatePackEditParams as CertificatePackEditParams from .certificate_pack_list_params import CertificatePackListParams as CertificatePackListParams from .certificate_pack_create_params import CertificatePackCreateParams as CertificatePackCreateParams diff --git a/src/cloudflare/types/ssl/recommendation_get_response.py b/src/cloudflare/types/ssl/recommendation_get_response.py deleted file mode 100644 index 1f7fa47d239..00000000000 --- a/src/cloudflare/types/ssl/recommendation_get_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["RecommendationGetResponse"] - - -class RecommendationGetResponse(BaseModel): - id: Optional[str] = None - """Identifier of a recommedation result.""" - - modified_on: Optional[datetime] = None - - value: Optional[Literal["flexible", "full", "strict"]] = None diff --git a/tests/api_resources/ssl/test_recommendations.py b/tests/api_resources/ssl/test_recommendations.py deleted file mode 100644 index 25c8c9c2841..00000000000 --- a/tests/api_resources/ssl/test_recommendations.py +++ /dev/null @@ -1,98 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, Optional, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.types.ssl import RecommendationGetResponse - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestRecommendations: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_get(self, client: Cloudflare) -> None: - recommendation = client.ssl.recommendations.get( - "023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[RecommendationGetResponse], recommendation, path=["response"]) - - @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.ssl.recommendations.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - recommendation = response.parse() - assert_matches_type(Optional[RecommendationGetResponse], recommendation, path=["response"]) - - @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.ssl.recommendations.with_streaming_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - recommendation = response.parse() - assert_matches_type(Optional[RecommendationGetResponse], recommendation, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_identifier` but received ''"): - client.ssl.recommendations.with_raw_response.get( - "", - ) - - -class TestAsyncRecommendations: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - recommendation = await async_client.ssl.recommendations.get( - "023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[RecommendationGetResponse], recommendation, path=["response"]) - - @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.ssl.recommendations.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - recommendation = await response.parse() - assert_matches_type(Optional[RecommendationGetResponse], recommendation, path=["response"]) - - @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.ssl.recommendations.with_streaming_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - recommendation = await response.parse() - assert_matches_type(Optional[RecommendationGetResponse], recommendation, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_identifier` but received ''"): - await async_client.ssl.recommendations.with_raw_response.get( - "", - ) From 246265af453b2d7c9245c1d0c43547e88ee66b3b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2025 23:41:27 +0000 Subject: [PATCH 119/358] feat(api_token_permission_groups): define `get` operation for datasources (#2431) --- .stats.yml | 4 +- api.md | 15 +- .../accounts/tokens/permission_groups.py | 84 +++++++++ src/cloudflare/resources/ssl/__init__.py | 14 ++ .../resources/ssl/recommendations.py | 178 ++++++++++++++++++ src/cloudflare/resources/ssl/ssl.py | 32 ++++ src/cloudflare/types/ssl/__init__.py | 1 + .../types/ssl/recommendation_get_response.py | 18 ++ .../accounts/tokens/test_permission_groups.py | 84 +++++++++ .../api_resources/ssl/test_recommendations.py | 98 ++++++++++ 10 files changed, 525 insertions(+), 3 deletions(-) create mode 100644 src/cloudflare/resources/ssl/recommendations.py create mode 100644 src/cloudflare/types/ssl/recommendation_get_response.py create mode 100644 tests/api_resources/ssl/test_recommendations.py diff --git a/.stats.yml b/.stats.yml index 7cd6eed1290..f3c978f2e90 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 1524 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aa93097d3c029937a6c5f40f1de4e577b20ec66ff43fa27c110f6cd3ea718704.yml +configured_endpoints: 1525 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b9c3a90028bf6b940420332aee2ee13b3cf1fa04e607205d7efe8fdb1c7d41e8.yml diff --git a/api.md b/api.md index 97fc9f18ba0..740efcac5ba 100644 --- a/api.md +++ b/api.md @@ -109,12 +109,13 @@ Methods: Types: ```python -from cloudflare.types.accounts.tokens import PermissionGroupListResponse +from cloudflare.types.accounts.tokens import PermissionGroupListResponse, PermissionGroupGetResponse ``` Methods: - client.accounts.tokens.permission_groups.list(\*, account_id) -> SyncSinglePage[object] +- client.accounts.tokens.permission_groups.get(\*, account_id) -> SyncSinglePage[object] ### Value @@ -771,6 +772,18 @@ Methods: - client.ssl.certificate_packs.quota.get(\*, zone_id) -> Optional[QuotaGetResponse] +## Recommendations + +Types: + +```python +from cloudflare.types.ssl import RecommendationGetResponse +``` + +Methods: + +- client.ssl.recommendations.get(zone_identifier) -> Optional[RecommendationGetResponse] + ## Universal ### Settings diff --git a/src/cloudflare/resources/accounts/tokens/permission_groups.py b/src/cloudflare/resources/accounts/tokens/permission_groups.py index 75bddadceaf..98e3fe4dec6 100644 --- a/src/cloudflare/resources/accounts/tokens/permission_groups.py +++ b/src/cloudflare/resources/accounts/tokens/permission_groups.py @@ -75,6 +75,42 @@ def list( model=object, ) + def get( + self, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncSinglePage[object]: + """ + Find all available permission groups for Account Owned API Tokens + + Args: + account_id: Account identifier tag. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get_api_list( + f"/accounts/{account_id}/tokens/permission_groups", + page=SyncSinglePage[object], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=object, + ) + class AsyncPermissionGroupsResource(AsyncAPIResource): @cached_property @@ -132,6 +168,42 @@ def list( model=object, ) + def get( + self, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[object, AsyncSinglePage[object]]: + """ + Find all available permission groups for Account Owned API Tokens + + Args: + account_id: Account identifier tag. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get_api_list( + f"/accounts/{account_id}/tokens/permission_groups", + page=AsyncSinglePage[object], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=object, + ) + class PermissionGroupsResourceWithRawResponse: def __init__(self, permission_groups: PermissionGroupsResource) -> None: @@ -140,6 +212,9 @@ def __init__(self, permission_groups: PermissionGroupsResource) -> None: self.list = to_raw_response_wrapper( permission_groups.list, ) + self.get = to_raw_response_wrapper( + permission_groups.get, + ) class AsyncPermissionGroupsResourceWithRawResponse: @@ -149,6 +224,9 @@ def __init__(self, permission_groups: AsyncPermissionGroupsResource) -> None: self.list = async_to_raw_response_wrapper( permission_groups.list, ) + self.get = async_to_raw_response_wrapper( + permission_groups.get, + ) class PermissionGroupsResourceWithStreamingResponse: @@ -158,6 +236,9 @@ def __init__(self, permission_groups: PermissionGroupsResource) -> None: self.list = to_streamed_response_wrapper( permission_groups.list, ) + self.get = to_streamed_response_wrapper( + permission_groups.get, + ) class AsyncPermissionGroupsResourceWithStreamingResponse: @@ -167,3 +248,6 @@ def __init__(self, permission_groups: AsyncPermissionGroupsResource) -> None: self.list = async_to_streamed_response_wrapper( permission_groups.list, ) + self.get = async_to_streamed_response_wrapper( + permission_groups.get, + ) diff --git a/src/cloudflare/resources/ssl/__init__.py b/src/cloudflare/resources/ssl/__init__.py index a7e69021e50..59245e44dfb 100644 --- a/src/cloudflare/resources/ssl/__init__.py +++ b/src/cloudflare/resources/ssl/__init__.py @@ -32,6 +32,14 @@ VerificationResourceWithStreamingResponse, AsyncVerificationResourceWithStreamingResponse, ) +from .recommendations import ( + RecommendationsResource, + AsyncRecommendationsResource, + RecommendationsResourceWithRawResponse, + AsyncRecommendationsResourceWithRawResponse, + RecommendationsResourceWithStreamingResponse, + AsyncRecommendationsResourceWithStreamingResponse, +) from .certificate_packs import ( CertificatePacksResource, AsyncCertificatePacksResource, @@ -54,6 +62,12 @@ "AsyncCertificatePacksResourceWithRawResponse", "CertificatePacksResourceWithStreamingResponse", "AsyncCertificatePacksResourceWithStreamingResponse", + "RecommendationsResource", + "AsyncRecommendationsResource", + "RecommendationsResourceWithRawResponse", + "AsyncRecommendationsResourceWithRawResponse", + "RecommendationsResourceWithStreamingResponse", + "AsyncRecommendationsResourceWithStreamingResponse", "UniversalResource", "AsyncUniversalResource", "UniversalResourceWithRawResponse", diff --git a/src/cloudflare/resources/ssl/recommendations.py b/src/cloudflare/resources/ssl/recommendations.py new file mode 100644 index 00000000000..25a8cf712a0 --- /dev/null +++ b/src/cloudflare/resources/ssl/recommendations.py @@ -0,0 +1,178 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, Optional, cast + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._wrappers import ResultWrapper +from ..._base_client import make_request_options +from ...types.ssl.recommendation_get_response import RecommendationGetResponse + +__all__ = ["RecommendationsResource", "AsyncRecommendationsResource"] + + +class RecommendationsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> RecommendationsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return RecommendationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> RecommendationsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return RecommendationsResourceWithStreamingResponse(self) + + def get( + self, + zone_identifier: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[RecommendationGetResponse]: + """ + Retrieve the SSL/TLS Recommender's recommendation for a zone. + + Args: + zone_identifier: Identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_identifier: + raise ValueError(f"Expected a non-empty value for `zone_identifier` but received {zone_identifier!r}") + return self._get( + f"/zones/{zone_identifier}/ssl/recommendation", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[RecommendationGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[RecommendationGetResponse]], ResultWrapper[RecommendationGetResponse]), + ) + + +class AsyncRecommendationsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncRecommendationsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncRecommendationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncRecommendationsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncRecommendationsResourceWithStreamingResponse(self) + + async def get( + self, + zone_identifier: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[RecommendationGetResponse]: + """ + Retrieve the SSL/TLS Recommender's recommendation for a zone. + + Args: + zone_identifier: Identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_identifier: + raise ValueError(f"Expected a non-empty value for `zone_identifier` but received {zone_identifier!r}") + return await self._get( + f"/zones/{zone_identifier}/ssl/recommendation", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[RecommendationGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[RecommendationGetResponse]], ResultWrapper[RecommendationGetResponse]), + ) + + +class RecommendationsResourceWithRawResponse: + def __init__(self, recommendations: RecommendationsResource) -> None: + self._recommendations = recommendations + + self.get = to_raw_response_wrapper( + recommendations.get, + ) + + +class AsyncRecommendationsResourceWithRawResponse: + def __init__(self, recommendations: AsyncRecommendationsResource) -> None: + self._recommendations = recommendations + + self.get = async_to_raw_response_wrapper( + recommendations.get, + ) + + +class RecommendationsResourceWithStreamingResponse: + def __init__(self, recommendations: RecommendationsResource) -> None: + self._recommendations = recommendations + + self.get = to_streamed_response_wrapper( + recommendations.get, + ) + + +class AsyncRecommendationsResourceWithStreamingResponse: + def __init__(self, recommendations: AsyncRecommendationsResource) -> None: + self._recommendations = recommendations + + self.get = async_to_streamed_response_wrapper( + recommendations.get, + ) diff --git a/src/cloudflare/resources/ssl/ssl.py b/src/cloudflare/resources/ssl/ssl.py index 8d0acbe4b00..c46c403db8b 100644 --- a/src/cloudflare/resources/ssl/ssl.py +++ b/src/cloudflare/resources/ssl/ssl.py @@ -20,6 +20,14 @@ VerificationResourceWithStreamingResponse, AsyncVerificationResourceWithStreamingResponse, ) +from .recommendations import ( + RecommendationsResource, + AsyncRecommendationsResource, + RecommendationsResourceWithRawResponse, + AsyncRecommendationsResourceWithRawResponse, + RecommendationsResourceWithStreamingResponse, + AsyncRecommendationsResourceWithStreamingResponse, +) from .universal.universal import ( UniversalResource, AsyncUniversalResource, @@ -49,6 +57,10 @@ def analyze(self) -> AnalyzeResource: def certificate_packs(self) -> CertificatePacksResource: return CertificatePacksResource(self._client) + @cached_property + def recommendations(self) -> RecommendationsResource: + return RecommendationsResource(self._client) + @cached_property def universal(self) -> UniversalResource: return UniversalResource(self._client) @@ -86,6 +98,10 @@ def analyze(self) -> AsyncAnalyzeResource: def certificate_packs(self) -> AsyncCertificatePacksResource: return AsyncCertificatePacksResource(self._client) + @cached_property + def recommendations(self) -> AsyncRecommendationsResource: + return AsyncRecommendationsResource(self._client) + @cached_property def universal(self) -> AsyncUniversalResource: return AsyncUniversalResource(self._client) @@ -126,6 +142,10 @@ def analyze(self) -> AnalyzeResourceWithRawResponse: def certificate_packs(self) -> CertificatePacksResourceWithRawResponse: return CertificatePacksResourceWithRawResponse(self._ssl.certificate_packs) + @cached_property + def recommendations(self) -> RecommendationsResourceWithRawResponse: + return RecommendationsResourceWithRawResponse(self._ssl.recommendations) + @cached_property def universal(self) -> UniversalResourceWithRawResponse: return UniversalResourceWithRawResponse(self._ssl.universal) @@ -147,6 +167,10 @@ def analyze(self) -> AsyncAnalyzeResourceWithRawResponse: def certificate_packs(self) -> AsyncCertificatePacksResourceWithRawResponse: return AsyncCertificatePacksResourceWithRawResponse(self._ssl.certificate_packs) + @cached_property + def recommendations(self) -> AsyncRecommendationsResourceWithRawResponse: + return AsyncRecommendationsResourceWithRawResponse(self._ssl.recommendations) + @cached_property def universal(self) -> AsyncUniversalResourceWithRawResponse: return AsyncUniversalResourceWithRawResponse(self._ssl.universal) @@ -168,6 +192,10 @@ def analyze(self) -> AnalyzeResourceWithStreamingResponse: def certificate_packs(self) -> CertificatePacksResourceWithStreamingResponse: return CertificatePacksResourceWithStreamingResponse(self._ssl.certificate_packs) + @cached_property + def recommendations(self) -> RecommendationsResourceWithStreamingResponse: + return RecommendationsResourceWithStreamingResponse(self._ssl.recommendations) + @cached_property def universal(self) -> UniversalResourceWithStreamingResponse: return UniversalResourceWithStreamingResponse(self._ssl.universal) @@ -189,6 +217,10 @@ def analyze(self) -> AsyncAnalyzeResourceWithStreamingResponse: def certificate_packs(self) -> AsyncCertificatePacksResourceWithStreamingResponse: return AsyncCertificatePacksResourceWithStreamingResponse(self._ssl.certificate_packs) + @cached_property + def recommendations(self) -> AsyncRecommendationsResourceWithStreamingResponse: + return AsyncRecommendationsResourceWithStreamingResponse(self._ssl.recommendations) + @cached_property def universal(self) -> AsyncUniversalResourceWithStreamingResponse: return AsyncUniversalResourceWithStreamingResponse(self._ssl.universal) diff --git a/src/cloudflare/types/ssl/__init__.py b/src/cloudflare/types/ssl/__init__.py index 9f91c6c173b..b12a6fb8467 100644 --- a/src/cloudflare/types/ssl/__init__.py +++ b/src/cloudflare/types/ssl/__init__.py @@ -12,6 +12,7 @@ from .verification_edit_params import VerificationEditParams as VerificationEditParams from .verification_get_response import VerificationGetResponse as VerificationGetResponse from .verification_edit_response import VerificationEditResponse as VerificationEditResponse +from .recommendation_get_response import RecommendationGetResponse as RecommendationGetResponse from .certificate_pack_edit_params import CertificatePackEditParams as CertificatePackEditParams from .certificate_pack_list_params import CertificatePackListParams as CertificatePackListParams from .certificate_pack_create_params import CertificatePackCreateParams as CertificatePackCreateParams diff --git a/src/cloudflare/types/ssl/recommendation_get_response.py b/src/cloudflare/types/ssl/recommendation_get_response.py new file mode 100644 index 00000000000..1f7fa47d239 --- /dev/null +++ b/src/cloudflare/types/ssl/recommendation_get_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["RecommendationGetResponse"] + + +class RecommendationGetResponse(BaseModel): + id: Optional[str] = None + """Identifier of a recommedation result.""" + + modified_on: Optional[datetime] = None + + value: Optional[Literal["flexible", "full", "strict"]] = None diff --git a/tests/api_resources/accounts/tokens/test_permission_groups.py b/tests/api_resources/accounts/tokens/test_permission_groups.py index cf36ed4a73f..7f5a5d8526b 100644 --- a/tests/api_resources/accounts/tokens/test_permission_groups.py +++ b/tests/api_resources/accounts/tokens/test_permission_groups.py @@ -59,6 +59,48 @@ def test_path_params_list(self, client: Cloudflare) -> None: account_id="", ) + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + permission_group = client.accounts.tokens.permission_groups.get( + account_id="eb78d65290b24279ba6f44721b3ea3c4", + ) + assert_matches_type(SyncSinglePage[object], permission_group, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.accounts.tokens.permission_groups.with_raw_response.get( + account_id="eb78d65290b24279ba6f44721b3ea3c4", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + permission_group = response.parse() + assert_matches_type(SyncSinglePage[object], permission_group, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.accounts.tokens.permission_groups.with_streaming_response.get( + account_id="eb78d65290b24279ba6f44721b3ea3c4", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + permission_group = response.parse() + assert_matches_type(SyncSinglePage[object], permission_group, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.accounts.tokens.permission_groups.with_raw_response.get( + account_id="", + ) + class TestAsyncPermissionGroups: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -104,3 +146,45 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: await async_client.accounts.tokens.permission_groups.with_raw_response.list( account_id="", ) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + permission_group = await async_client.accounts.tokens.permission_groups.get( + account_id="eb78d65290b24279ba6f44721b3ea3c4", + ) + assert_matches_type(AsyncSinglePage[object], permission_group, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.accounts.tokens.permission_groups.with_raw_response.get( + account_id="eb78d65290b24279ba6f44721b3ea3c4", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + permission_group = await response.parse() + assert_matches_type(AsyncSinglePage[object], permission_group, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.accounts.tokens.permission_groups.with_streaming_response.get( + account_id="eb78d65290b24279ba6f44721b3ea3c4", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + permission_group = await response.parse() + assert_matches_type(AsyncSinglePage[object], permission_group, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.accounts.tokens.permission_groups.with_raw_response.get( + account_id="", + ) diff --git a/tests/api_resources/ssl/test_recommendations.py b/tests/api_resources/ssl/test_recommendations.py new file mode 100644 index 00000000000..25c8c9c2841 --- /dev/null +++ b/tests/api_resources/ssl/test_recommendations.py @@ -0,0 +1,98 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.ssl import RecommendationGetResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestRecommendations: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + recommendation = client.ssl.recommendations.get( + "023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[RecommendationGetResponse], recommendation, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.ssl.recommendations.with_raw_response.get( + "023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + recommendation = response.parse() + assert_matches_type(Optional[RecommendationGetResponse], recommendation, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.ssl.recommendations.with_streaming_response.get( + "023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + recommendation = response.parse() + assert_matches_type(Optional[RecommendationGetResponse], recommendation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_identifier` but received ''"): + client.ssl.recommendations.with_raw_response.get( + "", + ) + + +class TestAsyncRecommendations: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + recommendation = await async_client.ssl.recommendations.get( + "023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[RecommendationGetResponse], recommendation, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.ssl.recommendations.with_raw_response.get( + "023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + recommendation = await response.parse() + assert_matches_type(Optional[RecommendationGetResponse], recommendation, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.ssl.recommendations.with_streaming_response.get( + "023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + recommendation = await response.parse() + assert_matches_type(Optional[RecommendationGetResponse], recommendation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_identifier` but received ''"): + await async_client.ssl.recommendations.with_raw_response.get( + "", + ) From 63e2a26275569dbbc89a4d3c10af0dfad91bed69 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 6 Feb 2025 04:29:50 +0000 Subject: [PATCH 120/358] feat(api): automatic updates (#2432) --- api.md | 12 +- .../resources/ai_gateway/evaluation_types.py | 56 ++--- .../resources/load_balancers/searches.py | 61 +++-- .../security_center/insights/insights.py | 238 +++++++++--------- src/cloudflare/types/ai_gateway/__init__.py | 4 +- ...rams.py => evaluation_type_list_params.py} | 4 +- ...se.py => evaluation_type_list_response.py} | 9 +- .../types/load_balancers/__init__.py | 4 +- ...ch_get_params.py => search_list_params.py} | 4 +- ...et_response.py => search_list_response.py} | 4 +- .../types/security_center/__init__.py | 4 +- ...t_get_params.py => insight_list_params.py} | 4 +- ...t_response.py => insight_list_response.py} | 4 +- .../ai_gateway/test_evaluation_types.py | 63 ++--- .../load_balancers/test_searches.py | 59 ++--- .../security_center/test_insights.py | 171 ++++++------- 16 files changed, 347 insertions(+), 354 deletions(-) rename src/cloudflare/types/ai_gateway/{evaluation_type_get_params.py => evaluation_type_list_params.py} (76%) rename src/cloudflare/types/ai_gateway/{evaluation_type_get_response.py => evaluation_type_list_response.py} (54%) rename src/cloudflare/types/load_balancers/{search_get_params.py => search_list_params.py} (84%) rename src/cloudflare/types/load_balancers/{search_get_response.py => search_list_response.py} (91%) rename src/cloudflare/types/security_center/{insight_get_params.py => insight_list_params.py} (94%) rename src/cloudflare/types/security_center/{insight_get_response.py => insight_list_response.py} (92%) diff --git a/api.md b/api.md index 740efcac5ba..5da34f5a0ea 100644 --- a/api.md +++ b/api.md @@ -624,12 +624,12 @@ Methods: Types: ```python -from cloudflare.types.load_balancers import SearchGetResponse +from cloudflare.types.load_balancers import SearchListResponse ``` Methods: -- client.load_balancers.searches.get(\*, account_id, \*\*params) -> SearchGetResponse +- client.load_balancers.searches.list(\*, account_id, \*\*params) -> SyncV4PagePagination[SearchListResponse] # Cache @@ -8236,12 +8236,12 @@ Methods: Types: ```python -from cloudflare.types.ai_gateway import EvaluationTypeGetResponse +from cloudflare.types.ai_gateway import EvaluationTypeListResponse ``` Methods: -- client.ai_gateway.evaluation_types.get(\*, account_id, \*\*params) -> EvaluationTypeGetResponse +- client.ai_gateway.evaluation_types.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[EvaluationTypeListResponse] ## Logs @@ -8732,13 +8732,13 @@ Methods: Types: ```python -from cloudflare.types.security_center import InsightDismissResponse, InsightGetResponse +from cloudflare.types.security_center import InsightListResponse, InsightDismissResponse ``` Methods: +- client.security_center.insights.list(\*, account_id, zone_id, \*\*params) -> SyncV4PagePagination[Optional[InsightListResponse]] - client.security_center.insights.dismiss(issue_id, \*, account_id, zone_id, \*\*params) -> InsightDismissResponse -- client.security_center.insights.get(\*, account_id, zone_id, \*\*params) -> Optional[InsightGetResponse] ### Class diff --git a/src/cloudflare/resources/ai_gateway/evaluation_types.py b/src/cloudflare/resources/ai_gateway/evaluation_types.py index 80f322466ff..047c5936dec 100644 --- a/src/cloudflare/resources/ai_gateway/evaluation_types.py +++ b/src/cloudflare/resources/ai_gateway/evaluation_types.py @@ -2,16 +2,12 @@ from __future__ import annotations -from typing import Type, cast from typing_extensions import Literal import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -20,10 +16,10 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._wrappers import ResultWrapper -from ..._base_client import make_request_options -from ...types.ai_gateway import evaluation_type_get_params -from ...types.ai_gateway.evaluation_type_get_response import EvaluationTypeGetResponse +from ...pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray +from ..._base_client import AsyncPaginator, make_request_options +from ...types.ai_gateway import evaluation_type_list_params +from ...types.ai_gateway.evaluation_type_list_response import EvaluationTypeListResponse __all__ = ["EvaluationTypesResource", "AsyncEvaluationTypesResource"] @@ -48,7 +44,7 @@ def with_streaming_response(self) -> EvaluationTypesResourceWithStreamingRespons """ return EvaluationTypesResourceWithStreamingResponse(self) - def get( + def list( self, *, account_id: str, @@ -62,7 +58,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EvaluationTypeGetResponse: + ) -> SyncV4PagePaginationArray[EvaluationTypeListResponse]: """ List Evaluators @@ -77,8 +73,9 @@ def get( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get( + return self._get_api_list( f"/accounts/{account_id}/ai-gateway/evaluation-types", + page=SyncV4PagePaginationArray[EvaluationTypeListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -91,11 +88,10 @@ def get( "page": page, "per_page": per_page, }, - evaluation_type_get_params.EvaluationTypeGetParams, + evaluation_type_list_params.EvaluationTypeListParams, ), - post_parser=ResultWrapper[EvaluationTypeGetResponse]._unwrapper, ), - cast_to=cast(Type[EvaluationTypeGetResponse], ResultWrapper[EvaluationTypeGetResponse]), + model=EvaluationTypeListResponse, ) @@ -119,7 +115,7 @@ def with_streaming_response(self) -> AsyncEvaluationTypesResourceWithStreamingRe """ return AsyncEvaluationTypesResourceWithStreamingResponse(self) - async def get( + def list( self, *, account_id: str, @@ -133,7 +129,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EvaluationTypeGetResponse: + ) -> AsyncPaginator[EvaluationTypeListResponse, AsyncV4PagePaginationArray[EvaluationTypeListResponse]]: """ List Evaluators @@ -148,25 +144,25 @@ async def get( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._get( + return self._get_api_list( f"/accounts/{account_id}/ai-gateway/evaluation-types", + page=AsyncV4PagePaginationArray[EvaluationTypeListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { "order_by": order_by, "order_by_direction": order_by_direction, "page": page, "per_page": per_page, }, - evaluation_type_get_params.EvaluationTypeGetParams, + evaluation_type_list_params.EvaluationTypeListParams, ), - post_parser=ResultWrapper[EvaluationTypeGetResponse]._unwrapper, ), - cast_to=cast(Type[EvaluationTypeGetResponse], ResultWrapper[EvaluationTypeGetResponse]), + model=EvaluationTypeListResponse, ) @@ -174,8 +170,8 @@ class EvaluationTypesResourceWithRawResponse: def __init__(self, evaluation_types: EvaluationTypesResource) -> None: self._evaluation_types = evaluation_types - self.get = to_raw_response_wrapper( - evaluation_types.get, + self.list = to_raw_response_wrapper( + evaluation_types.list, ) @@ -183,8 +179,8 @@ class AsyncEvaluationTypesResourceWithRawResponse: def __init__(self, evaluation_types: AsyncEvaluationTypesResource) -> None: self._evaluation_types = evaluation_types - self.get = async_to_raw_response_wrapper( - evaluation_types.get, + self.list = async_to_raw_response_wrapper( + evaluation_types.list, ) @@ -192,8 +188,8 @@ class EvaluationTypesResourceWithStreamingResponse: def __init__(self, evaluation_types: EvaluationTypesResource) -> None: self._evaluation_types = evaluation_types - self.get = to_streamed_response_wrapper( - evaluation_types.get, + self.list = to_streamed_response_wrapper( + evaluation_types.list, ) @@ -201,6 +197,6 @@ class AsyncEvaluationTypesResourceWithStreamingResponse: def __init__(self, evaluation_types: AsyncEvaluationTypesResource) -> None: self._evaluation_types = evaluation_types - self.get = async_to_streamed_response_wrapper( - evaluation_types.get, + self.list = async_to_streamed_response_wrapper( + evaluation_types.list, ) diff --git a/src/cloudflare/resources/load_balancers/searches.py b/src/cloudflare/resources/load_balancers/searches.py index cc09d14445d..33f25038c18 100644 --- a/src/cloudflare/resources/load_balancers/searches.py +++ b/src/cloudflare/resources/load_balancers/searches.py @@ -2,15 +2,10 @@ from __future__ import annotations -from typing import Type, cast - import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -19,10 +14,10 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._wrappers import ResultWrapper -from ..._base_client import make_request_options -from ...types.load_balancers import search_get_params -from ...types.load_balancers.search_get_response import SearchGetResponse +from ...pagination import SyncV4PagePagination, AsyncV4PagePagination +from ..._base_client import AsyncPaginator, make_request_options +from ...types.load_balancers import search_list_params +from ...types.load_balancers.search_list_response import SearchListResponse __all__ = ["SearchesResource", "AsyncSearchesResource"] @@ -47,20 +42,20 @@ def with_streaming_response(self) -> SearchesResourceWithStreamingResponse: """ return SearchesResourceWithStreamingResponse(self) - def get( + def list( self, *, account_id: str, page: float | NotGiven = NOT_GIVEN, per_page: float | NotGiven = NOT_GIVEN, - search_params: search_get_params.SearchParams | NotGiven = NOT_GIVEN, + search_params: search_list_params.SearchParams | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SearchGetResponse: + ) -> SyncV4PagePagination[SearchListResponse]: """ Search for Load Balancing resources. @@ -77,8 +72,9 @@ def get( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get( + return self._get_api_list( f"/accounts/{account_id}/load_balancers/search", + page=SyncV4PagePagination[SearchListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -90,11 +86,10 @@ def get( "per_page": per_page, "search_params": search_params, }, - search_get_params.SearchGetParams, + search_list_params.SearchListParams, ), - post_parser=ResultWrapper[SearchGetResponse]._unwrapper, ), - cast_to=cast(Type[SearchGetResponse], ResultWrapper[SearchGetResponse]), + model=SearchListResponse, ) @@ -118,20 +113,20 @@ def with_streaming_response(self) -> AsyncSearchesResourceWithStreamingResponse: """ return AsyncSearchesResourceWithStreamingResponse(self) - async def get( + def list( self, *, account_id: str, page: float | NotGiven = NOT_GIVEN, per_page: float | NotGiven = NOT_GIVEN, - search_params: search_get_params.SearchParams | NotGiven = NOT_GIVEN, + search_params: search_list_params.SearchParams | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SearchGetResponse: + ) -> AsyncPaginator[SearchListResponse, AsyncV4PagePagination[SearchListResponse]]: """ Search for Load Balancing resources. @@ -148,24 +143,24 @@ async def get( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._get( + return self._get_api_list( f"/accounts/{account_id}/load_balancers/search", + page=AsyncV4PagePagination[SearchListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { "page": page, "per_page": per_page, "search_params": search_params, }, - search_get_params.SearchGetParams, + search_list_params.SearchListParams, ), - post_parser=ResultWrapper[SearchGetResponse]._unwrapper, ), - cast_to=cast(Type[SearchGetResponse], ResultWrapper[SearchGetResponse]), + model=SearchListResponse, ) @@ -173,8 +168,8 @@ class SearchesResourceWithRawResponse: def __init__(self, searches: SearchesResource) -> None: self._searches = searches - self.get = to_raw_response_wrapper( - searches.get, + self.list = to_raw_response_wrapper( + searches.list, ) @@ -182,8 +177,8 @@ class AsyncSearchesResourceWithRawResponse: def __init__(self, searches: AsyncSearchesResource) -> None: self._searches = searches - self.get = async_to_raw_response_wrapper( - searches.get, + self.list = async_to_raw_response_wrapper( + searches.list, ) @@ -191,8 +186,8 @@ class SearchesResourceWithStreamingResponse: def __init__(self, searches: SearchesResource) -> None: self._searches = searches - self.get = to_streamed_response_wrapper( - searches.get, + self.list = to_streamed_response_wrapper( + searches.list, ) @@ -200,6 +195,6 @@ class AsyncSearchesResourceWithStreamingResponse: def __init__(self, searches: AsyncSearchesResource) -> None: self._searches = searches - self.get = async_to_streamed_response_wrapper( - searches.get, + self.list = async_to_streamed_response_wrapper( + searches.list, ) diff --git a/src/cloudflare/resources/security_center/insights/insights.py b/src/cloudflare/resources/security_center/insights/insights.py index 223c538d59d..582ed0197fe 100644 --- a/src/cloudflare/resources/security_center/insights/insights.py +++ b/src/cloudflare/resources/security_center/insights/insights.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Type, Optional, cast +from typing import List, Optional import httpx @@ -43,10 +43,10 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...._wrappers import ResultWrapper -from ...._base_client import make_request_options -from ....types.security_center import insight_get_params, insight_dismiss_params -from ....types.security_center.insight_get_response import InsightGetResponse +from ....pagination import SyncV4PagePagination, AsyncV4PagePagination +from ...._base_client import AsyncPaginator, make_request_options +from ....types.security_center import insight_list_params, insight_dismiss_params +from ....types.security_center.insight_list_response import InsightListResponse from ....types.intel.attack_surface_report.issue_type import IssueType from ....types.security_center.insight_dismiss_response import InsightDismissResponse from ....types.intel.attack_surface_report.severity_query_param import SeverityQueryParam @@ -86,60 +86,7 @@ def with_streaming_response(self) -> InsightsResourceWithStreamingResponse: """ return InsightsResourceWithStreamingResponse(self) - def dismiss( - self, - issue_id: str, - *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - dismiss: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> InsightDismissResponse: - """ - Archive Security Center Insight - - Args: - account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. - - zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not issue_id: - raise ValueError(f"Expected a non-empty value for `issue_id` but received {issue_id!r}") - if account_id and zone_id: - raise ValueError("You cannot provide both account_id and zone_id") - - if account_id: - account_or_zone = "accounts" - account_or_zone_id = account_id - else: - if not zone_id: - raise ValueError("You must provide either account_id or zone_id") - - account_or_zone = "zones" - account_or_zone_id = zone_id - return self._put( - f"/{account_or_zone}/{account_or_zone_id}/security-center/insights/{issue_id}/dismiss", - body=maybe_transform({"dismiss": dismiss}, insight_dismiss_params.InsightDismissParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=InsightDismissResponse, - ) - - def get( + def list( self, *, account_id: str | NotGiven = NOT_GIVEN, @@ -163,7 +110,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[InsightGetResponse]: + ) -> SyncV4PagePagination[Optional[InsightListResponse]]: """ Get Security Center Insights @@ -196,8 +143,9 @@ def get( account_or_zone = "zones" account_or_zone_id = zone_id - return self._get( + return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/security-center/insights", + page=SyncV4PagePagination[Optional[InsightListResponse]], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -219,47 +167,13 @@ def get( "subject": subject, "subject_neq": subject_neq, }, - insight_get_params.InsightGetParams, + insight_list_params.InsightListParams, ), - post_parser=ResultWrapper[Optional[InsightGetResponse]]._unwrapper, ), - cast_to=cast(Type[Optional[InsightGetResponse]], ResultWrapper[InsightGetResponse]), + model=InsightListResponse, ) - -class AsyncInsightsResource(AsyncAPIResource): - @cached_property - def class_(self) -> AsyncClassResource: - return AsyncClassResource(self._client) - - @cached_property - def severity(self) -> AsyncSeverityResource: - return AsyncSeverityResource(self._client) - - @cached_property - def type(self) -> AsyncTypeResource: - return AsyncTypeResource(self._client) - - @cached_property - def with_raw_response(self) -> AsyncInsightsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncInsightsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncInsightsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncInsightsResourceWithStreamingResponse(self) - - async def dismiss( + def dismiss( self, issue_id: str, *, @@ -303,16 +217,49 @@ async def dismiss( account_or_zone = "zones" account_or_zone_id = zone_id - return await self._put( + return self._put( f"/{account_or_zone}/{account_or_zone_id}/security-center/insights/{issue_id}/dismiss", - body=await async_maybe_transform({"dismiss": dismiss}, insight_dismiss_params.InsightDismissParams), + body=maybe_transform({"dismiss": dismiss}, insight_dismiss_params.InsightDismissParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=InsightDismissResponse, ) - async def get( + +class AsyncInsightsResource(AsyncAPIResource): + @cached_property + def class_(self) -> AsyncClassResource: + return AsyncClassResource(self._client) + + @cached_property + def severity(self) -> AsyncSeverityResource: + return AsyncSeverityResource(self._client) + + @cached_property + def type(self) -> AsyncTypeResource: + return AsyncTypeResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncInsightsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncInsightsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncInsightsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncInsightsResourceWithStreamingResponse(self) + + def list( self, *, account_id: str | NotGiven = NOT_GIVEN, @@ -336,7 +283,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[InsightGetResponse]: + ) -> AsyncPaginator[Optional[InsightListResponse], AsyncV4PagePagination[Optional[InsightListResponse]]]: """ Get Security Center Insights @@ -369,14 +316,15 @@ async def get( account_or_zone = "zones" account_or_zone_id = zone_id - return await self._get( + return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/security-center/insights", + page=AsyncV4PagePagination[Optional[InsightListResponse]], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { "dismissed": dismissed, "issue_class": issue_class, @@ -392,11 +340,63 @@ async def get( "subject": subject, "subject_neq": subject_neq, }, - insight_get_params.InsightGetParams, + insight_list_params.InsightListParams, ), - post_parser=ResultWrapper[Optional[InsightGetResponse]]._unwrapper, ), - cast_to=cast(Type[Optional[InsightGetResponse]], ResultWrapper[InsightGetResponse]), + model=InsightListResponse, + ) + + async def dismiss( + self, + issue_id: str, + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + dismiss: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> InsightDismissResponse: + """ + Archive Security Center Insight + + Args: + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not issue_id: + raise ValueError(f"Expected a non-empty value for `issue_id` but received {issue_id!r}") + if account_id and zone_id: + raise ValueError("You cannot provide both account_id and zone_id") + + if account_id: + account_or_zone = "accounts" + account_or_zone_id = account_id + else: + if not zone_id: + raise ValueError("You must provide either account_id or zone_id") + + account_or_zone = "zones" + account_or_zone_id = zone_id + return await self._put( + f"/{account_or_zone}/{account_or_zone_id}/security-center/insights/{issue_id}/dismiss", + body=await async_maybe_transform({"dismiss": dismiss}, insight_dismiss_params.InsightDismissParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=InsightDismissResponse, ) @@ -404,12 +404,12 @@ class InsightsResourceWithRawResponse: def __init__(self, insights: InsightsResource) -> None: self._insights = insights + self.list = to_raw_response_wrapper( + insights.list, + ) self.dismiss = to_raw_response_wrapper( insights.dismiss, ) - self.get = to_raw_response_wrapper( - insights.get, - ) @cached_property def class_(self) -> ClassResourceWithRawResponse: @@ -428,12 +428,12 @@ class AsyncInsightsResourceWithRawResponse: def __init__(self, insights: AsyncInsightsResource) -> None: self._insights = insights + self.list = async_to_raw_response_wrapper( + insights.list, + ) self.dismiss = async_to_raw_response_wrapper( insights.dismiss, ) - self.get = async_to_raw_response_wrapper( - insights.get, - ) @cached_property def class_(self) -> AsyncClassResourceWithRawResponse: @@ -452,12 +452,12 @@ class InsightsResourceWithStreamingResponse: def __init__(self, insights: InsightsResource) -> None: self._insights = insights + self.list = to_streamed_response_wrapper( + insights.list, + ) self.dismiss = to_streamed_response_wrapper( insights.dismiss, ) - self.get = to_streamed_response_wrapper( - insights.get, - ) @cached_property def class_(self) -> ClassResourceWithStreamingResponse: @@ -476,12 +476,12 @@ class AsyncInsightsResourceWithStreamingResponse: def __init__(self, insights: AsyncInsightsResource) -> None: self._insights = insights + self.list = async_to_streamed_response_wrapper( + insights.list, + ) self.dismiss = async_to_streamed_response_wrapper( insights.dismiss, ) - self.get = async_to_streamed_response_wrapper( - insights.get, - ) @cached_property def class_(self) -> AsyncClassResourceWithStreamingResponse: diff --git a/src/cloudflare/types/ai_gateway/__init__.py b/src/cloudflare/types/ai_gateway/__init__.py index fbb3b04fbd2..4aee571ef07 100644 --- a/src/cloudflare/types/ai_gateway/__init__.py +++ b/src/cloudflare/types/ai_gateway/__init__.py @@ -30,5 +30,5 @@ from .ai_gateway_update_response import AIGatewayUpdateResponse as AIGatewayUpdateResponse from .evaluation_create_response import EvaluationCreateResponse as EvaluationCreateResponse from .evaluation_delete_response import EvaluationDeleteResponse as EvaluationDeleteResponse -from .evaluation_type_get_params import EvaluationTypeGetParams as EvaluationTypeGetParams -from .evaluation_type_get_response import EvaluationTypeGetResponse as EvaluationTypeGetResponse +from .evaluation_type_list_params import EvaluationTypeListParams as EvaluationTypeListParams +from .evaluation_type_list_response import EvaluationTypeListResponse as EvaluationTypeListResponse diff --git a/src/cloudflare/types/ai_gateway/evaluation_type_get_params.py b/src/cloudflare/types/ai_gateway/evaluation_type_list_params.py similarity index 76% rename from src/cloudflare/types/ai_gateway/evaluation_type_get_params.py rename to src/cloudflare/types/ai_gateway/evaluation_type_list_params.py index 99f3e376187..5a03c32439c 100644 --- a/src/cloudflare/types/ai_gateway/evaluation_type_get_params.py +++ b/src/cloudflare/types/ai_gateway/evaluation_type_list_params.py @@ -4,10 +4,10 @@ from typing_extensions import Literal, Required, TypedDict -__all__ = ["EvaluationTypeGetParams"] +__all__ = ["EvaluationTypeListParams"] -class EvaluationTypeGetParams(TypedDict, total=False): +class EvaluationTypeListParams(TypedDict, total=False): account_id: Required[str] order_by: str diff --git a/src/cloudflare/types/ai_gateway/evaluation_type_get_response.py b/src/cloudflare/types/ai_gateway/evaluation_type_list_response.py similarity index 54% rename from src/cloudflare/types/ai_gateway/evaluation_type_get_response.py rename to src/cloudflare/types/ai_gateway/evaluation_type_list_response.py index 58f8832c954..428f484d00f 100644 --- a/src/cloudflare/types/ai_gateway/evaluation_type_get_response.py +++ b/src/cloudflare/types/ai_gateway/evaluation_type_list_response.py @@ -1,15 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List from datetime import datetime -from typing_extensions import TypeAlias from ..._models import BaseModel -__all__ = ["EvaluationTypeGetResponse", "EvaluationTypeGetResponseItem"] +__all__ = ["EvaluationTypeListResponse"] -class EvaluationTypeGetResponseItem(BaseModel): +class EvaluationTypeListResponse(BaseModel): id: str created_at: datetime @@ -25,6 +23,3 @@ class EvaluationTypeGetResponseItem(BaseModel): name: str type: str - - -EvaluationTypeGetResponse: TypeAlias = List[EvaluationTypeGetResponseItem] diff --git a/src/cloudflare/types/load_balancers/__init__.py b/src/cloudflare/types/load_balancers/__init__.py index 5caf860663d..fcf247a12fb 100644 --- a/src/cloudflare/types/load_balancers/__init__.py +++ b/src/cloudflare/types/load_balancers/__init__.py @@ -24,19 +24,19 @@ from .pool_list_params import PoolListParams as PoolListParams from .session_affinity import SessionAffinity as SessionAffinity from .location_strategy import LocationStrategy as LocationStrategy -from .search_get_params import SearchGetParams as SearchGetParams from .pool_create_params import PoolCreateParams as PoolCreateParams from .pool_update_params import PoolUpdateParams as PoolUpdateParams from .region_list_params import RegionListParams as RegionListParams +from .search_list_params import SearchListParams as SearchListParams from .load_shedding_param import LoadSheddingParam as LoadSheddingParam from .monitor_edit_params import MonitorEditParams as MonitorEditParams from .notification_filter import NotificationFilter as NotificationFilter from .region_get_response import RegionGetResponse as RegionGetResponse -from .search_get_response import SearchGetResponse as SearchGetResponse from .filter_options_param import FilterOptionsParam as FilterOptionsParam from .pool_delete_response import PoolDeleteResponse as PoolDeleteResponse from .preview_get_response import PreviewGetResponse as PreviewGetResponse from .region_list_response import RegionListResponse as RegionListResponse +from .search_list_response import SearchListResponse as SearchListResponse from .monitor_create_params import MonitorCreateParams as MonitorCreateParams from .monitor_update_params import MonitorUpdateParams as MonitorUpdateParams from .origin_steering_param import OriginSteeringParam as OriginSteeringParam diff --git a/src/cloudflare/types/load_balancers/search_get_params.py b/src/cloudflare/types/load_balancers/search_list_params.py similarity index 84% rename from src/cloudflare/types/load_balancers/search_get_params.py rename to src/cloudflare/types/load_balancers/search_list_params.py index 0bfe600047a..38396bdf885 100644 --- a/src/cloudflare/types/load_balancers/search_get_params.py +++ b/src/cloudflare/types/load_balancers/search_list_params.py @@ -4,10 +4,10 @@ from typing_extensions import Literal, Required, TypedDict -__all__ = ["SearchGetParams", "SearchParams"] +__all__ = ["SearchListParams", "SearchParams"] -class SearchGetParams(TypedDict, total=False): +class SearchListParams(TypedDict, total=False): account_id: Required[str] """Identifier""" diff --git a/src/cloudflare/types/load_balancers/search_get_response.py b/src/cloudflare/types/load_balancers/search_list_response.py similarity index 91% rename from src/cloudflare/types/load_balancers/search_get_response.py rename to src/cloudflare/types/load_balancers/search_list_response.py index 87d1af2b8cd..ac481f630e9 100644 --- a/src/cloudflare/types/load_balancers/search_get_response.py +++ b/src/cloudflare/types/load_balancers/search_list_response.py @@ -5,7 +5,7 @@ from ..._models import BaseModel -__all__ = ["SearchGetResponse", "Resource"] +__all__ = ["SearchListResponse", "Resource"] class Resource(BaseModel): @@ -24,6 +24,6 @@ class Resource(BaseModel): """The type of the resource.""" -class SearchGetResponse(BaseModel): +class SearchListResponse(BaseModel): resources: Optional[List[Resource]] = None """A list of resources matching the search query.""" diff --git a/src/cloudflare/types/security_center/__init__.py b/src/cloudflare/types/security_center/__init__.py index 93cbbbdecc0..34e1627b271 100644 --- a/src/cloudflare/types/security_center/__init__.py +++ b/src/cloudflare/types/security_center/__init__.py @@ -2,7 +2,7 @@ from __future__ import annotations -from .insight_get_params import InsightGetParams as InsightGetParams -from .insight_get_response import InsightGetResponse as InsightGetResponse +from .insight_list_params import InsightListParams as InsightListParams +from .insight_list_response import InsightListResponse as InsightListResponse from .insight_dismiss_params import InsightDismissParams as InsightDismissParams from .insight_dismiss_response import InsightDismissResponse as InsightDismissResponse diff --git a/src/cloudflare/types/security_center/insight_get_params.py b/src/cloudflare/types/security_center/insight_list_params.py similarity index 94% rename from src/cloudflare/types/security_center/insight_get_params.py rename to src/cloudflare/types/security_center/insight_list_params.py index be46b8d1bb8..d95706d144b 100644 --- a/src/cloudflare/types/security_center/insight_get_params.py +++ b/src/cloudflare/types/security_center/insight_list_params.py @@ -9,10 +9,10 @@ from ..intel.attack_surface_report.issue_type import IssueType from ..intel.attack_surface_report.severity_query_param import SeverityQueryParam -__all__ = ["InsightGetParams"] +__all__ = ["InsightListParams"] -class InsightGetParams(TypedDict, total=False): +class InsightListParams(TypedDict, total=False): account_id: str """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" diff --git a/src/cloudflare/types/security_center/insight_get_response.py b/src/cloudflare/types/security_center/insight_list_response.py similarity index 92% rename from src/cloudflare/types/security_center/insight_get_response.py rename to src/cloudflare/types/security_center/insight_list_response.py index 445c062edcc..499127ff06a 100644 --- a/src/cloudflare/types/security_center/insight_get_response.py +++ b/src/cloudflare/types/security_center/insight_list_response.py @@ -7,7 +7,7 @@ from ..._models import BaseModel from ..intel.attack_surface_report.issue_type import IssueType -__all__ = ["InsightGetResponse", "Issue"] +__all__ = ["InsightListResponse", "Issue"] class Issue(BaseModel): @@ -34,7 +34,7 @@ class Issue(BaseModel): timestamp: Optional[datetime] = None -class InsightGetResponse(BaseModel): +class InsightListResponse(BaseModel): count: Optional[int] = None """Total number of results""" diff --git a/tests/api_resources/ai_gateway/test_evaluation_types.py b/tests/api_resources/ai_gateway/test_evaluation_types.py index 0b83a3809f8..d03554b8df8 100644 --- a/tests/api_resources/ai_gateway/test_evaluation_types.py +++ b/tests/api_resources/ai_gateway/test_evaluation_types.py @@ -9,7 +9,8 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.ai_gateway import EvaluationTypeGetResponse +from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray +from cloudflare.types.ai_gateway import EvaluationTypeListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -18,51 +19,53 @@ class TestEvaluationTypes: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize - def test_method_get(self, client: Cloudflare) -> None: - evaluation_type = client.ai_gateway.evaluation_types.get( + def test_method_list(self, client: Cloudflare) -> None: + evaluation_type = client.ai_gateway.evaluation_types.list( account_id="0d37909e38d3e99c29fa2cd343ac421a", ) - assert_matches_type(EvaluationTypeGetResponse, evaluation_type, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[EvaluationTypeListResponse], evaluation_type, path=["response"]) @parametrize - def test_method_get_with_all_params(self, client: Cloudflare) -> None: - evaluation_type = client.ai_gateway.evaluation_types.get( + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + evaluation_type = client.ai_gateway.evaluation_types.list( account_id="0d37909e38d3e99c29fa2cd343ac421a", order_by="order_by", order_by_direction="asc", page=1, per_page=5, ) - assert_matches_type(EvaluationTypeGetResponse, evaluation_type, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[EvaluationTypeListResponse], evaluation_type, path=["response"]) @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.ai_gateway.evaluation_types.with_raw_response.get( + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.ai_gateway.evaluation_types.with_raw_response.list( account_id="0d37909e38d3e99c29fa2cd343ac421a", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" evaluation_type = response.parse() - assert_matches_type(EvaluationTypeGetResponse, evaluation_type, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[EvaluationTypeListResponse], evaluation_type, path=["response"]) @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.ai_gateway.evaluation_types.with_streaming_response.get( + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.ai_gateway.evaluation_types.with_streaming_response.list( account_id="0d37909e38d3e99c29fa2cd343ac421a", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" evaluation_type = response.parse() - assert_matches_type(EvaluationTypeGetResponse, evaluation_type, path=["response"]) + assert_matches_type( + SyncV4PagePaginationArray[EvaluationTypeListResponse], evaluation_type, path=["response"] + ) assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: + def test_path_params_list(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.ai_gateway.evaluation_types.with_raw_response.get( + client.ai_gateway.evaluation_types.with_raw_response.list( account_id="", ) @@ -71,50 +74,52 @@ class TestAsyncEvaluationTypes: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - evaluation_type = await async_client.ai_gateway.evaluation_types.get( + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + evaluation_type = await async_client.ai_gateway.evaluation_types.list( account_id="0d37909e38d3e99c29fa2cd343ac421a", ) - assert_matches_type(EvaluationTypeGetResponse, evaluation_type, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[EvaluationTypeListResponse], evaluation_type, path=["response"]) @parametrize - async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: - evaluation_type = await async_client.ai_gateway.evaluation_types.get( + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + evaluation_type = await async_client.ai_gateway.evaluation_types.list( account_id="0d37909e38d3e99c29fa2cd343ac421a", order_by="order_by", order_by_direction="asc", page=1, per_page=5, ) - assert_matches_type(EvaluationTypeGetResponse, evaluation_type, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[EvaluationTypeListResponse], evaluation_type, path=["response"]) @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.ai_gateway.evaluation_types.with_raw_response.get( + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.ai_gateway.evaluation_types.with_raw_response.list( account_id="0d37909e38d3e99c29fa2cd343ac421a", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" evaluation_type = await response.parse() - assert_matches_type(EvaluationTypeGetResponse, evaluation_type, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[EvaluationTypeListResponse], evaluation_type, path=["response"]) @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.ai_gateway.evaluation_types.with_streaming_response.get( + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.ai_gateway.evaluation_types.with_streaming_response.list( account_id="0d37909e38d3e99c29fa2cd343ac421a", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" evaluation_type = await response.parse() - assert_matches_type(EvaluationTypeGetResponse, evaluation_type, path=["response"]) + assert_matches_type( + AsyncV4PagePaginationArray[EvaluationTypeListResponse], evaluation_type, path=["response"] + ) assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.ai_gateway.evaluation_types.with_raw_response.get( + await async_client.ai_gateway.evaluation_types.with_raw_response.list( account_id="", ) diff --git a/tests/api_resources/load_balancers/test_searches.py b/tests/api_resources/load_balancers/test_searches.py index 7ba156e3a88..d8d3ef9211f 100644 --- a/tests/api_resources/load_balancers/test_searches.py +++ b/tests/api_resources/load_balancers/test_searches.py @@ -9,7 +9,8 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.load_balancers import SearchGetResponse +from cloudflare.pagination import SyncV4PagePagination, AsyncV4PagePagination +from cloudflare.types.load_balancers import SearchListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,16 +20,16 @@ class TestSearches: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_get(self, client: Cloudflare) -> None: - search = client.load_balancers.searches.get( + def test_method_list(self, client: Cloudflare) -> None: + search = client.load_balancers.searches.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SearchGetResponse, search, path=["response"]) + assert_matches_type(SyncV4PagePagination[SearchListResponse], search, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_get_with_all_params(self, client: Cloudflare) -> None: - search = client.load_balancers.searches.get( + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + search = client.load_balancers.searches.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", page=1, per_page=1, @@ -37,39 +38,39 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: "references": "", }, ) - assert_matches_type(SearchGetResponse, search, path=["response"]) + assert_matches_type(SyncV4PagePagination[SearchListResponse], search, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.load_balancers.searches.with_raw_response.get( + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.load_balancers.searches.with_raw_response.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" search = response.parse() - assert_matches_type(SearchGetResponse, search, path=["response"]) + assert_matches_type(SyncV4PagePagination[SearchListResponse], search, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.load_balancers.searches.with_streaming_response.get( + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.load_balancers.searches.with_streaming_response.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" search = response.parse() - assert_matches_type(SearchGetResponse, search, path=["response"]) + assert_matches_type(SyncV4PagePagination[SearchListResponse], search, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: + def test_path_params_list(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.load_balancers.searches.with_raw_response.get( + client.load_balancers.searches.with_raw_response.list( account_id="", ) @@ -79,16 +80,16 @@ class TestAsyncSearches: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - search = await async_client.load_balancers.searches.get( + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + search = await async_client.load_balancers.searches.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SearchGetResponse, search, path=["response"]) + assert_matches_type(AsyncV4PagePagination[SearchListResponse], search, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: - search = await async_client.load_balancers.searches.get( + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + search = await async_client.load_balancers.searches.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", page=1, per_page=1, @@ -97,38 +98,38 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - "references": "", }, ) - assert_matches_type(SearchGetResponse, search, path=["response"]) + assert_matches_type(AsyncV4PagePagination[SearchListResponse], search, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.load_balancers.searches.with_raw_response.get( + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.load_balancers.searches.with_raw_response.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" search = await response.parse() - assert_matches_type(SearchGetResponse, search, path=["response"]) + assert_matches_type(AsyncV4PagePagination[SearchListResponse], search, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.load_balancers.searches.with_streaming_response.get( + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.load_balancers.searches.with_streaming_response.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" search = await response.parse() - assert_matches_type(SearchGetResponse, search, path=["response"]) + assert_matches_type(AsyncV4PagePagination[SearchListResponse], search, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.load_balancers.searches.with_raw_response.get( + await async_client.load_balancers.searches.with_raw_response.list( account_id="", ) diff --git a/tests/api_resources/security_center/test_insights.py b/tests/api_resources/security_center/test_insights.py index 531c0ba49dc..31edeb1e303 100644 --- a/tests/api_resources/security_center/test_insights.py +++ b/tests/api_resources/security_center/test_insights.py @@ -9,8 +9,9 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare.pagination import SyncV4PagePagination, AsyncV4PagePagination from cloudflare.types.security_center import ( - InsightGetResponse, + InsightListResponse, InsightDismissResponse, ) @@ -20,6 +21,69 @@ class TestInsights: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + insight = client.security_center.insights.list( + account_id="account_id", + ) + assert_matches_type(SyncV4PagePagination[Optional[InsightListResponse]], insight, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + insight = client.security_center.insights.list( + account_id="account_id", + dismissed=False, + issue_class=["a_record_dangling", "always_use_https_not_enabled"], + issue_class_neq=["a_record_dangling", "always_use_https_not_enabled"], + issue_type=["compliance_violation", "email_security"], + issue_type_neq=["compliance_violation", "email_security"], + page=1, + per_page=25, + product=["access", "dns"], + product_neq=["access", "dns"], + severity=["low", "moderate"], + severity_neq=["low", "moderate"], + subject=["example.com"], + subject_neq=["example.com"], + ) + assert_matches_type(SyncV4PagePagination[Optional[InsightListResponse]], insight, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.security_center.insights.with_raw_response.list( + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + insight = response.parse() + assert_matches_type(SyncV4PagePagination[Optional[InsightListResponse]], insight, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.security_center.insights.with_streaming_response.list( + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + insight = response.parse() + assert_matches_type(SyncV4PagePagination[Optional[InsightListResponse]], insight, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + client.security_center.insights.with_raw_response.list( + account_id="", + ) + + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + client.security_center.insights.with_raw_response.list( + account_id="account_id", + ) + @parametrize def test_method_dismiss(self, client: Cloudflare) -> None: insight = client.security_center.insights.dismiss( @@ -83,16 +147,20 @@ def test_path_params_dismiss(self, client: Cloudflare) -> None: account_id="account_id", ) + +class TestAsyncInsights: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @parametrize - def test_method_get(self, client: Cloudflare) -> None: - insight = client.security_center.insights.get( + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + insight = await async_client.security_center.insights.list( account_id="account_id", ) - assert_matches_type(Optional[InsightGetResponse], insight, path=["response"]) + assert_matches_type(AsyncV4PagePagination[Optional[InsightListResponse]], insight, path=["response"]) @parametrize - def test_method_get_with_all_params(self, client: Cloudflare) -> None: - insight = client.security_center.insights.get( + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + insight = await async_client.security_center.insights.list( account_id="account_id", dismissed=False, issue_class=["a_record_dangling", "always_use_https_not_enabled"], @@ -108,48 +176,44 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: subject=["example.com"], subject_neq=["example.com"], ) - assert_matches_type(Optional[InsightGetResponse], insight, path=["response"]) + assert_matches_type(AsyncV4PagePagination[Optional[InsightListResponse]], insight, path=["response"]) @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.security_center.insights.with_raw_response.get( + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.security_center.insights.with_raw_response.list( account_id="account_id", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - insight = response.parse() - assert_matches_type(Optional[InsightGetResponse], insight, path=["response"]) + insight = await response.parse() + assert_matches_type(AsyncV4PagePagination[Optional[InsightListResponse]], insight, path=["response"]) @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.security_center.insights.with_streaming_response.get( + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.security_center.insights.with_streaming_response.list( account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - insight = response.parse() - assert_matches_type(Optional[InsightGetResponse], insight, path=["response"]) + insight = await response.parse() + assert_matches_type(AsyncV4PagePagination[Optional[InsightListResponse]], insight, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): - client.security_center.insights.with_raw_response.get( + await async_client.security_center.insights.with_raw_response.list( account_id="", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): - client.security_center.insights.with_raw_response.get( + await async_client.security_center.insights.with_raw_response.list( account_id="account_id", ) - -class TestAsyncInsights: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @parametrize async def test_method_dismiss(self, async_client: AsyncCloudflare) -> None: insight = await async_client.security_center.insights.dismiss( @@ -212,66 +276,3 @@ async def test_path_params_dismiss(self, async_client: AsyncCloudflare) -> None: issue_id="issue_id", account_id="account_id", ) - - @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - insight = await async_client.security_center.insights.get( - account_id="account_id", - ) - assert_matches_type(Optional[InsightGetResponse], insight, path=["response"]) - - @parametrize - async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: - insight = await async_client.security_center.insights.get( - account_id="account_id", - dismissed=False, - issue_class=["a_record_dangling", "always_use_https_not_enabled"], - issue_class_neq=["a_record_dangling", "always_use_https_not_enabled"], - issue_type=["compliance_violation", "email_security"], - issue_type_neq=["compliance_violation", "email_security"], - page=1, - per_page=25, - product=["access", "dns"], - product_neq=["access", "dns"], - severity=["low", "moderate"], - severity_neq=["low", "moderate"], - subject=["example.com"], - subject_neq=["example.com"], - ) - assert_matches_type(Optional[InsightGetResponse], insight, path=["response"]) - - @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.security_center.insights.with_raw_response.get( - account_id="account_id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - insight = await response.parse() - assert_matches_type(Optional[InsightGetResponse], insight, path=["response"]) - - @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.security_center.insights.with_streaming_response.get( - account_id="account_id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - insight = await response.parse() - assert_matches_type(Optional[InsightGetResponse], insight, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): - await async_client.security_center.insights.with_raw_response.get( - account_id="", - ) - - with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): - await async_client.security_center.insights.with_raw_response.get( - account_id="account_id", - ) From bf559949de9365e33ad06a4b1721b12979a956fb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 6 Feb 2025 06:07:29 +0000 Subject: [PATCH 121/358] feat(api): api update (#2433) --- .stats.yml | 4 +- api.md | 12 -- src/cloudflare/resources/ssl/__init__.py | 14 -- .../resources/ssl/recommendations.py | 178 ------------------ src/cloudflare/resources/ssl/ssl.py | 32 ---- src/cloudflare/types/ssl/__init__.py | 1 - .../types/ssl/recommendation_get_response.py | 18 -- .../api_resources/ssl/test_recommendations.py | 98 ---------- 8 files changed, 2 insertions(+), 355 deletions(-) delete mode 100644 src/cloudflare/resources/ssl/recommendations.py delete mode 100644 src/cloudflare/types/ssl/recommendation_get_response.py delete mode 100644 tests/api_resources/ssl/test_recommendations.py diff --git a/.stats.yml b/.stats.yml index f3c978f2e90..7cd6eed1290 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b9c3a90028bf6b940420332aee2ee13b3cf1fa04e607205d7efe8fdb1c7d41e8.yml +configured_endpoints: 1524 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aa93097d3c029937a6c5f40f1de4e577b20ec66ff43fa27c110f6cd3ea718704.yml diff --git a/api.md b/api.md index 5da34f5a0ea..e693bbf9997 100644 --- a/api.md +++ b/api.md @@ -772,18 +772,6 @@ Methods: - client.ssl.certificate_packs.quota.get(\*, zone_id) -> Optional[QuotaGetResponse] -## Recommendations - -Types: - -```python -from cloudflare.types.ssl import RecommendationGetResponse -``` - -Methods: - -- client.ssl.recommendations.get(zone_identifier) -> Optional[RecommendationGetResponse] - ## Universal ### Settings diff --git a/src/cloudflare/resources/ssl/__init__.py b/src/cloudflare/resources/ssl/__init__.py index 59245e44dfb..a7e69021e50 100644 --- a/src/cloudflare/resources/ssl/__init__.py +++ b/src/cloudflare/resources/ssl/__init__.py @@ -32,14 +32,6 @@ VerificationResourceWithStreamingResponse, AsyncVerificationResourceWithStreamingResponse, ) -from .recommendations import ( - RecommendationsResource, - AsyncRecommendationsResource, - RecommendationsResourceWithRawResponse, - AsyncRecommendationsResourceWithRawResponse, - RecommendationsResourceWithStreamingResponse, - AsyncRecommendationsResourceWithStreamingResponse, -) from .certificate_packs import ( CertificatePacksResource, AsyncCertificatePacksResource, @@ -62,12 +54,6 @@ "AsyncCertificatePacksResourceWithRawResponse", "CertificatePacksResourceWithStreamingResponse", "AsyncCertificatePacksResourceWithStreamingResponse", - "RecommendationsResource", - "AsyncRecommendationsResource", - "RecommendationsResourceWithRawResponse", - "AsyncRecommendationsResourceWithRawResponse", - "RecommendationsResourceWithStreamingResponse", - "AsyncRecommendationsResourceWithStreamingResponse", "UniversalResource", "AsyncUniversalResource", "UniversalResourceWithRawResponse", diff --git a/src/cloudflare/resources/ssl/recommendations.py b/src/cloudflare/resources/ssl/recommendations.py deleted file mode 100644 index 25a8cf712a0..00000000000 --- a/src/cloudflare/resources/ssl/recommendations.py +++ /dev/null @@ -1,178 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Type, Optional, cast - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._wrappers import ResultWrapper -from ..._base_client import make_request_options -from ...types.ssl.recommendation_get_response import RecommendationGetResponse - -__all__ = ["RecommendationsResource", "AsyncRecommendationsResource"] - - -class RecommendationsResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> RecommendationsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return RecommendationsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> RecommendationsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return RecommendationsResourceWithStreamingResponse(self) - - def get( - self, - zone_identifier: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecommendationGetResponse]: - """ - Retrieve the SSL/TLS Recommender's recommendation for a zone. - - Args: - zone_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not zone_identifier: - raise ValueError(f"Expected a non-empty value for `zone_identifier` but received {zone_identifier!r}") - return self._get( - f"/zones/{zone_identifier}/ssl/recommendation", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RecommendationGetResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[RecommendationGetResponse]], ResultWrapper[RecommendationGetResponse]), - ) - - -class AsyncRecommendationsResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncRecommendationsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncRecommendationsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncRecommendationsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncRecommendationsResourceWithStreamingResponse(self) - - async def get( - self, - zone_identifier: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecommendationGetResponse]: - """ - Retrieve the SSL/TLS Recommender's recommendation for a zone. - - Args: - zone_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not zone_identifier: - raise ValueError(f"Expected a non-empty value for `zone_identifier` but received {zone_identifier!r}") - return await self._get( - f"/zones/{zone_identifier}/ssl/recommendation", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[RecommendationGetResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[RecommendationGetResponse]], ResultWrapper[RecommendationGetResponse]), - ) - - -class RecommendationsResourceWithRawResponse: - def __init__(self, recommendations: RecommendationsResource) -> None: - self._recommendations = recommendations - - self.get = to_raw_response_wrapper( - recommendations.get, - ) - - -class AsyncRecommendationsResourceWithRawResponse: - def __init__(self, recommendations: AsyncRecommendationsResource) -> None: - self._recommendations = recommendations - - self.get = async_to_raw_response_wrapper( - recommendations.get, - ) - - -class RecommendationsResourceWithStreamingResponse: - def __init__(self, recommendations: RecommendationsResource) -> None: - self._recommendations = recommendations - - self.get = to_streamed_response_wrapper( - recommendations.get, - ) - - -class AsyncRecommendationsResourceWithStreamingResponse: - def __init__(self, recommendations: AsyncRecommendationsResource) -> None: - self._recommendations = recommendations - - self.get = async_to_streamed_response_wrapper( - recommendations.get, - ) diff --git a/src/cloudflare/resources/ssl/ssl.py b/src/cloudflare/resources/ssl/ssl.py index c46c403db8b..8d0acbe4b00 100644 --- a/src/cloudflare/resources/ssl/ssl.py +++ b/src/cloudflare/resources/ssl/ssl.py @@ -20,14 +20,6 @@ VerificationResourceWithStreamingResponse, AsyncVerificationResourceWithStreamingResponse, ) -from .recommendations import ( - RecommendationsResource, - AsyncRecommendationsResource, - RecommendationsResourceWithRawResponse, - AsyncRecommendationsResourceWithRawResponse, - RecommendationsResourceWithStreamingResponse, - AsyncRecommendationsResourceWithStreamingResponse, -) from .universal.universal import ( UniversalResource, AsyncUniversalResource, @@ -57,10 +49,6 @@ def analyze(self) -> AnalyzeResource: def certificate_packs(self) -> CertificatePacksResource: return CertificatePacksResource(self._client) - @cached_property - def recommendations(self) -> RecommendationsResource: - return RecommendationsResource(self._client) - @cached_property def universal(self) -> UniversalResource: return UniversalResource(self._client) @@ -98,10 +86,6 @@ def analyze(self) -> AsyncAnalyzeResource: def certificate_packs(self) -> AsyncCertificatePacksResource: return AsyncCertificatePacksResource(self._client) - @cached_property - def recommendations(self) -> AsyncRecommendationsResource: - return AsyncRecommendationsResource(self._client) - @cached_property def universal(self) -> AsyncUniversalResource: return AsyncUniversalResource(self._client) @@ -142,10 +126,6 @@ def analyze(self) -> AnalyzeResourceWithRawResponse: def certificate_packs(self) -> CertificatePacksResourceWithRawResponse: return CertificatePacksResourceWithRawResponse(self._ssl.certificate_packs) - @cached_property - def recommendations(self) -> RecommendationsResourceWithRawResponse: - return RecommendationsResourceWithRawResponse(self._ssl.recommendations) - @cached_property def universal(self) -> UniversalResourceWithRawResponse: return UniversalResourceWithRawResponse(self._ssl.universal) @@ -167,10 +147,6 @@ def analyze(self) -> AsyncAnalyzeResourceWithRawResponse: def certificate_packs(self) -> AsyncCertificatePacksResourceWithRawResponse: return AsyncCertificatePacksResourceWithRawResponse(self._ssl.certificate_packs) - @cached_property - def recommendations(self) -> AsyncRecommendationsResourceWithRawResponse: - return AsyncRecommendationsResourceWithRawResponse(self._ssl.recommendations) - @cached_property def universal(self) -> AsyncUniversalResourceWithRawResponse: return AsyncUniversalResourceWithRawResponse(self._ssl.universal) @@ -192,10 +168,6 @@ def analyze(self) -> AnalyzeResourceWithStreamingResponse: def certificate_packs(self) -> CertificatePacksResourceWithStreamingResponse: return CertificatePacksResourceWithStreamingResponse(self._ssl.certificate_packs) - @cached_property - def recommendations(self) -> RecommendationsResourceWithStreamingResponse: - return RecommendationsResourceWithStreamingResponse(self._ssl.recommendations) - @cached_property def universal(self) -> UniversalResourceWithStreamingResponse: return UniversalResourceWithStreamingResponse(self._ssl.universal) @@ -217,10 +189,6 @@ def analyze(self) -> AsyncAnalyzeResourceWithStreamingResponse: def certificate_packs(self) -> AsyncCertificatePacksResourceWithStreamingResponse: return AsyncCertificatePacksResourceWithStreamingResponse(self._ssl.certificate_packs) - @cached_property - def recommendations(self) -> AsyncRecommendationsResourceWithStreamingResponse: - return AsyncRecommendationsResourceWithStreamingResponse(self._ssl.recommendations) - @cached_property def universal(self) -> AsyncUniversalResourceWithStreamingResponse: return AsyncUniversalResourceWithStreamingResponse(self._ssl.universal) diff --git a/src/cloudflare/types/ssl/__init__.py b/src/cloudflare/types/ssl/__init__.py index b12a6fb8467..9f91c6c173b 100644 --- a/src/cloudflare/types/ssl/__init__.py +++ b/src/cloudflare/types/ssl/__init__.py @@ -12,7 +12,6 @@ from .verification_edit_params import VerificationEditParams as VerificationEditParams from .verification_get_response import VerificationGetResponse as VerificationGetResponse from .verification_edit_response import VerificationEditResponse as VerificationEditResponse -from .recommendation_get_response import RecommendationGetResponse as RecommendationGetResponse from .certificate_pack_edit_params import CertificatePackEditParams as CertificatePackEditParams from .certificate_pack_list_params import CertificatePackListParams as CertificatePackListParams from .certificate_pack_create_params import CertificatePackCreateParams as CertificatePackCreateParams diff --git a/src/cloudflare/types/ssl/recommendation_get_response.py b/src/cloudflare/types/ssl/recommendation_get_response.py deleted file mode 100644 index 1f7fa47d239..00000000000 --- a/src/cloudflare/types/ssl/recommendation_get_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["RecommendationGetResponse"] - - -class RecommendationGetResponse(BaseModel): - id: Optional[str] = None - """Identifier of a recommedation result.""" - - modified_on: Optional[datetime] = None - - value: Optional[Literal["flexible", "full", "strict"]] = None diff --git a/tests/api_resources/ssl/test_recommendations.py b/tests/api_resources/ssl/test_recommendations.py deleted file mode 100644 index 25c8c9c2841..00000000000 --- a/tests/api_resources/ssl/test_recommendations.py +++ /dev/null @@ -1,98 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, Optional, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.types.ssl import RecommendationGetResponse - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestRecommendations: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_get(self, client: Cloudflare) -> None: - recommendation = client.ssl.recommendations.get( - "023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[RecommendationGetResponse], recommendation, path=["response"]) - - @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.ssl.recommendations.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - recommendation = response.parse() - assert_matches_type(Optional[RecommendationGetResponse], recommendation, path=["response"]) - - @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.ssl.recommendations.with_streaming_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - recommendation = response.parse() - assert_matches_type(Optional[RecommendationGetResponse], recommendation, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_identifier` but received ''"): - client.ssl.recommendations.with_raw_response.get( - "", - ) - - -class TestAsyncRecommendations: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - recommendation = await async_client.ssl.recommendations.get( - "023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[RecommendationGetResponse], recommendation, path=["response"]) - - @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.ssl.recommendations.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - recommendation = await response.parse() - assert_matches_type(Optional[RecommendationGetResponse], recommendation, path=["response"]) - - @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.ssl.recommendations.with_streaming_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - recommendation = await response.parse() - assert_matches_type(Optional[RecommendationGetResponse], recommendation, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_identifier` but received ''"): - await async_client.ssl.recommendations.with_raw_response.get( - "", - ) From e71215df8267baee95173c17567919988b3de209 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 6 Feb 2025 12:58:07 +0000 Subject: [PATCH 122/358] chore(internal): fix type traversing dictionary params (#2434) --- src/cloudflare/_utils/_transform.py | 12 +++++++++++- tests/test_transform.py | 11 ++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/cloudflare/_utils/_transform.py b/src/cloudflare/_utils/_transform.py index a6b62cad0cb..18afd9d8bd5 100644 --- a/src/cloudflare/_utils/_transform.py +++ b/src/cloudflare/_utils/_transform.py @@ -25,7 +25,7 @@ is_annotated_type, strip_annotated_type, ) -from .._compat import model_dump, is_typeddict +from .._compat import get_origin, model_dump, is_typeddict _T = TypeVar("_T") @@ -164,9 +164,14 @@ def _transform_recursive( inner_type = annotation stripped_type = strip_annotated_type(inner_type) + origin = get_origin(stripped_type) or stripped_type if is_typeddict(stripped_type) and is_mapping(data): return _transform_typeddict(data, stripped_type) + if origin == dict and is_mapping(data): + items_type = get_args(stripped_type)[1] + return {key: _transform_recursive(value, annotation=items_type) for key, value in data.items()} + if ( # List[T] (is_list_type(stripped_type) and is_list(data)) @@ -307,9 +312,14 @@ async def _async_transform_recursive( inner_type = annotation stripped_type = strip_annotated_type(inner_type) + origin = get_origin(stripped_type) or stripped_type if is_typeddict(stripped_type) and is_mapping(data): return await _async_transform_typeddict(data, stripped_type) + if origin == dict and is_mapping(data): + items_type = get_args(stripped_type)[1] + return {key: _transform_recursive(value, annotation=items_type) for key, value in data.items()} + if ( # List[T] (is_list_type(stripped_type) and is_list(data)) diff --git a/tests/test_transform.py b/tests/test_transform.py index 1fe676823ff..5dd5095a716 100644 --- a/tests/test_transform.py +++ b/tests/test_transform.py @@ -2,7 +2,7 @@ import io import pathlib -from typing import Any, List, Union, TypeVar, Iterable, Optional, cast +from typing import Any, Dict, List, Union, TypeVar, Iterable, Optional, cast from datetime import date, datetime from typing_extensions import Required, Annotated, TypedDict @@ -388,6 +388,15 @@ def my_iter() -> Iterable[Baz8]: } +@parametrize +@pytest.mark.asyncio +async def test_dictionary_items(use_async: bool) -> None: + class DictItems(TypedDict): + foo_baz: Annotated[str, PropertyInfo(alias="fooBaz")] + + assert await transform({"foo": {"foo_baz": "bar"}}, Dict[str, DictItems], use_async) == {"foo": {"fooBaz": "bar"}} + + class TypedDictIterableUnionStr(TypedDict): foo: Annotated[Union[str, Iterable[Baz8]], PropertyInfo(alias="FOO")] From 0286bd240491b5cf25d3cfe53fdcb2fb51db9ba6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 6 Feb 2025 15:16:36 +0000 Subject: [PATCH 123/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 7cd6eed1290..2ae7a8155f6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1524 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aa93097d3c029937a6c5f40f1de4e577b20ec66ff43fa27c110f6cd3ea718704.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-91def25893b54caf3aa7b582cc081910665063f295909a2f487e14bcb5765862.yml From 440bfad1b59bcfdfc321d00729fcca133cf29e07 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 6 Feb 2025 15:19:31 +0000 Subject: [PATCH 124/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 2ae7a8155f6..7cd6eed1290 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1524 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-91def25893b54caf3aa7b582cc081910665063f295909a2f487e14bcb5765862.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aa93097d3c029937a6c5f40f1de4e577b20ec66ff43fa27c110f6cd3ea718704.yml From 48261bd0c7443b4766de1fa2a97b13d36a118919 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 6 Feb 2025 15:22:27 +0000 Subject: [PATCH 125/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 7cd6eed1290..2ae7a8155f6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1524 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aa93097d3c029937a6c5f40f1de4e577b20ec66ff43fa27c110f6cd3ea718704.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-91def25893b54caf3aa7b582cc081910665063f295909a2f487e14bcb5765862.yml From a61bc4420dcc82b04d9d4b5d18ec4c4c1caf3ffe Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 6 Feb 2025 15:25:46 +0000 Subject: [PATCH 126/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 2ae7a8155f6..7cd6eed1290 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1524 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-91def25893b54caf3aa7b582cc081910665063f295909a2f487e14bcb5765862.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aa93097d3c029937a6c5f40f1de4e577b20ec66ff43fa27c110f6cd3ea718704.yml From 06e91c303666493ccf1134cc64e40db06e064964 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 6 Feb 2025 16:22:24 +0000 Subject: [PATCH 127/358] chore(internal): minor type handling changes (#2435) --- src/cloudflare/_models.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cloudflare/_models.py b/src/cloudflare/_models.py index 12c34b7d177..c4401ff868e 100644 --- a/src/cloudflare/_models.py +++ b/src/cloudflare/_models.py @@ -426,10 +426,16 @@ def construct_type(*, value: object, type_: object) -> object: If the given value does not match the expected type then it is returned as-is. """ + + # store a reference to the original type we were given before we extract any inner + # types so that we can properly resolve forward references in `TypeAliasType` annotations + original_type = None + # we allow `object` as the input type because otherwise, passing things like # `Literal['value']` will be reported as a type error by type checkers type_ = cast("type[object]", type_) if is_type_alias_type(type_): + original_type = type_ # type: ignore[unreachable] type_ = type_.__value__ # type: ignore[unreachable] # unwrap `Annotated[T, ...]` -> `T` @@ -446,7 +452,7 @@ def construct_type(*, value: object, type_: object) -> object: if is_union(origin): try: - return validate_type(type_=cast("type[object]", type_), value=value) + return validate_type(type_=cast("type[object]", original_type or type_), value=value) except Exception: pass From ea1f7c48b1dce1f9d982e5f8ac13742c536e7941 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 6 Feb 2025 16:58:07 +0000 Subject: [PATCH 128/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 7cd6eed1290..2ae7a8155f6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1524 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aa93097d3c029937a6c5f40f1de4e577b20ec66ff43fa27c110f6cd3ea718704.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-91def25893b54caf3aa7b582cc081910665063f295909a2f487e14bcb5765862.yml From ec602a244123ead785e94f95f104ce64cacf73c7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 6 Feb 2025 18:03:50 +0000 Subject: [PATCH 129/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 2ae7a8155f6..7cd6eed1290 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1524 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-91def25893b54caf3aa7b582cc081910665063f295909a2f487e14bcb5765862.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aa93097d3c029937a6c5f40f1de4e577b20ec66ff43fa27c110f6cd3ea718704.yml From be2ab333129e41b707cda81bfd8d56d0c4a68b1f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 6 Feb 2025 19:05:51 +0000 Subject: [PATCH 130/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 7cd6eed1290..2ae7a8155f6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1524 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aa93097d3c029937a6c5f40f1de4e577b20ec66ff43fa27c110f6cd3ea718704.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-91def25893b54caf3aa7b582cc081910665063f295909a2f487e14bcb5765862.yml From 2f32745cbbccb496dc248d4acb49c5c6d4195a58 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 7 Feb 2025 09:47:09 +0000 Subject: [PATCH 131/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 2ae7a8155f6..2daef895f43 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1524 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-91def25893b54caf3aa7b582cc081910665063f295909a2f487e14bcb5765862.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-27f0f5ebe4bbd109abf08c150c3ce21c3faab069e0b39459c2ae092d58c50fbb.yml From e60bc44e271130bfa35b09101581a438119afb82 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 7 Feb 2025 15:56:42 +0000 Subject: [PATCH 132/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 2daef895f43..2ef88212d80 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1524 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-27f0f5ebe4bbd109abf08c150c3ce21c3faab069e0b39459c2ae092d58c50fbb.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-adc38ec246adc4929b526403b39c1d6cfaf23bd224730f2ab5498224c34a17bb.yml From 949ab067065bc75ab9e782f54fd8bed9410634ac Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 7 Feb 2025 16:20:38 +0000 Subject: [PATCH 133/358] chore: minor change to tests (#2436) --- tests/api_resources/test_dns_firewall.py | 8 ++++---- tests/api_resources/workers/scripts/test_versions.py | 2 ++ tests/api_resources/workers/test_scripts.py | 2 ++ .../dispatch/namespaces/scripts/test_settings.py | 2 ++ .../dispatch/namespaces/test_scripts.py | 2 ++ 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/api_resources/test_dns_firewall.py b/tests/api_resources/test_dns_firewall.py index 2ad3347bb0c..8418d862c4a 100644 --- a/tests/api_resources/test_dns_firewall.py +++ b/tests/api_resources/test_dns_firewall.py @@ -49,7 +49,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: negative_cache_ttl=900, ratelimit=600, retries=2, - upstream_ips=["192.0.2.1", "198.51.100.1", "string"], + upstream_ips=["192.0.2.1", "198.51.100.1", "2001:DB8:100::CF"], ) assert_matches_type(Optional[DNSFirewallCreateResponse], dns_firewall, path=["response"]) @@ -209,7 +209,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: negative_cache_ttl=900, ratelimit=600, retries=2, - upstream_ips=["192.0.2.1", "198.51.100.1", "string"], + upstream_ips=["192.0.2.1", "198.51.100.1", "2001:DB8:100::CF"], ) assert_matches_type(Optional[DNSFirewallEditResponse], dns_firewall, path=["response"]) @@ -333,7 +333,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare negative_cache_ttl=900, ratelimit=600, retries=2, - upstream_ips=["192.0.2.1", "198.51.100.1", "string"], + upstream_ips=["192.0.2.1", "198.51.100.1", "2001:DB8:100::CF"], ) assert_matches_type(Optional[DNSFirewallCreateResponse], dns_firewall, path=["response"]) @@ -493,7 +493,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) negative_cache_ttl=900, ratelimit=600, retries=2, - upstream_ips=["192.0.2.1", "198.51.100.1", "string"], + upstream_ips=["192.0.2.1", "198.51.100.1", "2001:DB8:100::CF"], ) assert_matches_type(Optional[DNSFirewallEditResponse], dns_firewall, path=["response"]) diff --git a/tests/api_resources/workers/scripts/test_versions.py b/tests/api_resources/workers/scripts/test_versions.py index 5fbc0e71d33..e27ca173031 100644 --- a/tests/api_resources/workers/scripts/test_versions.py +++ b/tests/api_resources/workers/scripts/test_versions.py @@ -47,6 +47,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "bindings": [ { "name": "MY_ENV_VAR", + "text": "my_data", "type": "plain_text", } ], @@ -253,6 +254,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "bindings": [ { "name": "MY_ENV_VAR", + "text": "my_data", "type": "plain_text", } ], diff --git a/tests/api_resources/workers/test_scripts.py b/tests/api_resources/workers/test_scripts.py index 00f0d53b953..0c4b3980605 100644 --- a/tests/api_resources/workers/test_scripts.py +++ b/tests/api_resources/workers/test_scripts.py @@ -50,6 +50,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "bindings": [ { "name": "MY_ENV_VAR", + "text": "my_data", "type": "plain_text", } ], @@ -321,6 +322,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "bindings": [ { "name": "MY_ENV_VAR", + "text": "my_data", "type": "plain_text", } ], diff --git a/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_settings.py b/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_settings.py index b3a2e96a5d1..8fece3883d7 100644 --- a/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_settings.py +++ b/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_settings.py @@ -41,6 +41,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: "bindings": [ { "name": "MY_ENV_VAR", + "text": "my_data", "type": "plain_text", } ], @@ -225,6 +226,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) "bindings": [ { "name": "MY_ENV_VAR", + "text": "my_data", "type": "plain_text", } ], diff --git a/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py b/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py index feb536104b4..5877f5318b9 100644 --- a/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py +++ b/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py @@ -51,6 +51,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "bindings": [ { "name": "MY_ENV_VAR", + "text": "my_data", "type": "plain_text", } ], @@ -323,6 +324,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "bindings": [ { "name": "MY_ENV_VAR", + "text": "my_data", "type": "plain_text", } ], From 67f7a8a932995240d3b5b678fbf96e33de345511 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 8 Feb 2025 00:54:42 +0000 Subject: [PATCH 134/358] feat(api): api update (#2437) --- .stats.yml | 2 +- src/cloudflare/resources/waiting_rooms/statuses.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 2ef88212d80..5e85cd296ba 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1524 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-adc38ec246adc4929b526403b39c1d6cfaf23bd224730f2ab5498224c34a17bb.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-201a9d77b2e238cb2f8c2c952b00b976608e2a53fe4230369e801971fda29edc.yml diff --git a/src/cloudflare/resources/waiting_rooms/statuses.py b/src/cloudflare/resources/waiting_rooms/statuses.py index bcd50bc1b39..39b2dd22108 100644 --- a/src/cloudflare/resources/waiting_rooms/statuses.py +++ b/src/cloudflare/resources/waiting_rooms/statuses.py @@ -66,6 +66,7 @@ def get( held in the waiting room. - **event_prequeueing** indicates that an event is active and is currently prequeueing users before it starts. + - **suspended** indicates that the room is suspended. 2. `event_id`: String of the current event's `id` if an event is active, otherwise an empty string. 3. `estimated_queued_users`: Integer of the estimated number of users currently @@ -147,6 +148,7 @@ async def get( held in the waiting room. - **event_prequeueing** indicates that an event is active and is currently prequeueing users before it starts. + - **suspended** indicates that the room is suspended. 2. `event_id`: String of the current event's `id` if an event is active, otherwise an empty string. 3. `estimated_queued_users`: Integer of the estimated number of users currently From 62bceb0628a4c903d7fd44927a22b7eefcb72b0d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 9 Feb 2025 22:27:23 +0000 Subject: [PATCH 135/358] feat(r2_bucket_event_notification): add resource and flatten method hierarchy (#2438) --- api.md | 26 +- .../resources/r2/buckets/buckets.py | 4 +- .../queues.py => event_notifications.py} | 203 +++++++++++---- .../buckets/event_notifications/__init__.py | 33 --- .../configuration/__init__.py | 33 --- .../configuration/configuration.py | 236 ------------------ .../event_notifications.py | 102 -------- src/cloudflare/types/r2/buckets/__init__.py | 2 + ....py => event_notification_get_response.py} | 6 +- ...py => event_notification_update_params.py} | 6 +- .../buckets/event_notifications/__init__.py | 5 - .../configuration/__init__.py | 5 - .../buckets/event_notifications/__init__.py | 1 - .../configuration/__init__.py | 1 - .../event_notifications/test_configuration.py | 146 ----------- ..._queues.py => test_event_notifications.py} | 233 +++++++++++++---- 16 files changed, 356 insertions(+), 686 deletions(-) rename src/cloudflare/resources/r2/buckets/{event_notifications/configuration/queues.py => event_notifications.py} (60%) delete mode 100644 src/cloudflare/resources/r2/buckets/event_notifications/__init__.py delete mode 100644 src/cloudflare/resources/r2/buckets/event_notifications/configuration/__init__.py delete mode 100644 src/cloudflare/resources/r2/buckets/event_notifications/configuration/configuration.py delete mode 100644 src/cloudflare/resources/r2/buckets/event_notifications/event_notifications.py rename src/cloudflare/types/r2/buckets/{event_notifications/configuration_get_response.py => event_notification_get_response.py} (90%) rename src/cloudflare/types/r2/buckets/{event_notifications/configuration/queue_update_params.py => event_notification_update_params.py} (88%) delete mode 100644 src/cloudflare/types/r2/buckets/event_notifications/__init__.py delete mode 100644 src/cloudflare/types/r2/buckets/event_notifications/configuration/__init__.py delete mode 100644 tests/api_resources/r2/buckets/event_notifications/__init__.py delete mode 100644 tests/api_resources/r2/buckets/event_notifications/configuration/__init__.py delete mode 100644 tests/api_resources/r2/buckets/event_notifications/test_configuration.py rename tests/api_resources/r2/buckets/{event_notifications/configuration/test_queues.py => test_event_notifications.py} (53%) diff --git a/api.md b/api.md index e693bbf9997..ccec68cf7ee 100644 --- a/api.md +++ b/api.md @@ -4673,33 +4673,21 @@ Methods: ### EventNotifications -#### Configuration - -Types: - -```python -from cloudflare.types.r2.buckets.event_notifications import ConfigurationGetResponse -``` - -Methods: - -- client.r2.buckets.event_notifications.configuration.get(bucket_name, \*, account_id) -> ConfigurationGetResponse - -##### Queues - Types: ```python -from cloudflare.types.r2.buckets.event_notifications.configuration import ( - QueueUpdateResponse, - QueueDeleteResponse, +from cloudflare.types.r2.buckets import ( + EventNotificationUpdateResponse, + EventNotificationDeleteResponse, + EventNotificationGetResponse, ) ``` Methods: -- client.r2.buckets.event_notifications.configuration.queues.update(queue_id, \*, account_id, bucket_name, \*\*params) -> object -- client.r2.buckets.event_notifications.configuration.queues.delete(queue_id, \*, account_id, bucket_name) -> object +- client.r2.buckets.event_notifications.update(queue_id, \*, account_id, bucket_name, \*\*params) -> object +- client.r2.buckets.event_notifications.delete(queue_id, \*, account_id, bucket_name) -> object +- client.r2.buckets.event_notifications.get(bucket_name, \*, account_id) -> EventNotificationGetResponse ### Locks diff --git a/src/cloudflare/resources/r2/buckets/buckets.py b/src/cloudflare/resources/r2/buckets/buckets.py index f70e2b42881..acebae8e4ce 100644 --- a/src/cloudflare/resources/r2/buckets/buckets.py +++ b/src/cloudflare/resources/r2/buckets/buckets.py @@ -74,8 +74,7 @@ AsyncDomainsResourceWithStreamingResponse, ) from ....types.r2.bucket import Bucket -from ....types.r2.bucket_list_response import BucketListResponse -from .event_notifications.event_notifications import ( +from .event_notifications import ( EventNotificationsResource, AsyncEventNotificationsResource, EventNotificationsResourceWithRawResponse, @@ -83,6 +82,7 @@ EventNotificationsResourceWithStreamingResponse, AsyncEventNotificationsResourceWithStreamingResponse, ) +from ....types.r2.bucket_list_response import BucketListResponse __all__ = ["BucketsResource", "AsyncBucketsResource"] diff --git a/src/cloudflare/resources/r2/buckets/event_notifications/configuration/queues.py b/src/cloudflare/resources/r2/buckets/event_notifications.py similarity index 60% rename from src/cloudflare/resources/r2/buckets/event_notifications/configuration/queues.py rename to src/cloudflare/resources/r2/buckets/event_notifications.py index 29e477f3b5e..8e54bb787c8 100644 --- a/src/cloudflare/resources/r2/buckets/event_notifications/configuration/queues.py +++ b/src/cloudflare/resources/r2/buckets/event_notifications.py @@ -7,47 +7,48 @@ import httpx -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ......_utils import ( +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( is_given, maybe_transform, strip_not_given, async_maybe_transform, ) -from ......_compat import cached_property -from ......_resource import SyncAPIResource, AsyncAPIResource -from ......_response import ( +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ......_wrappers import ResultWrapper -from ......_base_client import make_request_options -from ......types.r2.buckets.event_notifications.configuration import queue_update_params +from ...._wrappers import ResultWrapper +from ...._base_client import make_request_options +from ....types.r2.buckets import event_notification_update_params +from ....types.r2.buckets.event_notification_get_response import EventNotificationGetResponse -__all__ = ["QueuesResource", "AsyncQueuesResource"] +__all__ = ["EventNotificationsResource", "AsyncEventNotificationsResource"] -class QueuesResource(SyncAPIResource): +class EventNotificationsResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> QueuesResourceWithRawResponse: + def with_raw_response(self) -> EventNotificationsResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers """ - return QueuesResourceWithRawResponse(self) + return EventNotificationsResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> QueuesResourceWithStreamingResponse: + def with_streaming_response(self) -> EventNotificationsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response """ - return QueuesResourceWithStreamingResponse(self) + return EventNotificationsResourceWithStreamingResponse(self) def update( self, @@ -55,7 +56,7 @@ def update( *, account_id: str, bucket_name: str, - rules: Iterable[queue_update_params.Rule] | NotGiven = NOT_GIVEN, + rules: Iterable[event_notification_update_params.Rule] | NotGiven = NOT_GIVEN, jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -98,7 +99,7 @@ def update( } return self._put( f"/accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration/queues/{queue_id}", - body=maybe_transform({"rules": rules}, queue_update_params.QueueUpdateParams), + body=maybe_transform({"rules": rules}, event_notification_update_params.EventNotificationUpdateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -167,26 +168,77 @@ def delete( cast_to=cast(Type[object], ResultWrapper[object]), ) + def get( + self, + bucket_name: str, + *, + account_id: str, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EventNotificationGetResponse: + """ + List all event notification rules for a bucket. -class AsyncQueuesResource(AsyncAPIResource): + Args: + account_id: Account ID + + bucket_name: Name of the bucket + + jurisdiction: The bucket jurisdiction + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not bucket_name: + raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") + extra_headers = { + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **(extra_headers or {}), + } + return self._get( + f"/accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[EventNotificationGetResponse]._unwrapper, + ), + cast_to=cast(Type[EventNotificationGetResponse], ResultWrapper[EventNotificationGetResponse]), + ) + + +class AsyncEventNotificationsResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncQueuesResourceWithRawResponse: + def with_raw_response(self) -> AsyncEventNotificationsResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers """ - return AsyncQueuesResourceWithRawResponse(self) + return AsyncEventNotificationsResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncQueuesResourceWithStreamingResponse: + def with_streaming_response(self) -> AsyncEventNotificationsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response """ - return AsyncQueuesResourceWithStreamingResponse(self) + return AsyncEventNotificationsResourceWithStreamingResponse(self) async def update( self, @@ -194,7 +246,7 @@ async def update( *, account_id: str, bucket_name: str, - rules: Iterable[queue_update_params.Rule] | NotGiven = NOT_GIVEN, + rules: Iterable[event_notification_update_params.Rule] | NotGiven = NOT_GIVEN, jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -237,7 +289,9 @@ async def update( } return await self._put( f"/accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration/queues/{queue_id}", - body=await async_maybe_transform({"rules": rules}, queue_update_params.QueueUpdateParams), + body=await async_maybe_transform( + {"rules": rules}, event_notification_update_params.EventNotificationUpdateParams + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -306,50 +360,113 @@ async def delete( cast_to=cast(Type[object], ResultWrapper[object]), ) + async def get( + self, + bucket_name: str, + *, + account_id: str, + jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> EventNotificationGetResponse: + """ + List all event notification rules for a bucket. + + Args: + account_id: Account ID + + bucket_name: Name of the bucket + + jurisdiction: The bucket jurisdiction + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not bucket_name: + raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") + extra_headers = { + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **(extra_headers or {}), + } + return await self._get( + f"/accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[EventNotificationGetResponse]._unwrapper, + ), + cast_to=cast(Type[EventNotificationGetResponse], ResultWrapper[EventNotificationGetResponse]), + ) -class QueuesResourceWithRawResponse: - def __init__(self, queues: QueuesResource) -> None: - self._queues = queues + +class EventNotificationsResourceWithRawResponse: + def __init__(self, event_notifications: EventNotificationsResource) -> None: + self._event_notifications = event_notifications self.update = to_raw_response_wrapper( - queues.update, + event_notifications.update, ) self.delete = to_raw_response_wrapper( - queues.delete, + event_notifications.delete, + ) + self.get = to_raw_response_wrapper( + event_notifications.get, ) -class AsyncQueuesResourceWithRawResponse: - def __init__(self, queues: AsyncQueuesResource) -> None: - self._queues = queues +class AsyncEventNotificationsResourceWithRawResponse: + def __init__(self, event_notifications: AsyncEventNotificationsResource) -> None: + self._event_notifications = event_notifications self.update = async_to_raw_response_wrapper( - queues.update, + event_notifications.update, ) self.delete = async_to_raw_response_wrapper( - queues.delete, + event_notifications.delete, + ) + self.get = async_to_raw_response_wrapper( + event_notifications.get, ) -class QueuesResourceWithStreamingResponse: - def __init__(self, queues: QueuesResource) -> None: - self._queues = queues +class EventNotificationsResourceWithStreamingResponse: + def __init__(self, event_notifications: EventNotificationsResource) -> None: + self._event_notifications = event_notifications self.update = to_streamed_response_wrapper( - queues.update, + event_notifications.update, ) self.delete = to_streamed_response_wrapper( - queues.delete, + event_notifications.delete, + ) + self.get = to_streamed_response_wrapper( + event_notifications.get, ) -class AsyncQueuesResourceWithStreamingResponse: - def __init__(self, queues: AsyncQueuesResource) -> None: - self._queues = queues +class AsyncEventNotificationsResourceWithStreamingResponse: + def __init__(self, event_notifications: AsyncEventNotificationsResource) -> None: + self._event_notifications = event_notifications self.update = async_to_streamed_response_wrapper( - queues.update, + event_notifications.update, ) self.delete = async_to_streamed_response_wrapper( - queues.delete, + event_notifications.delete, + ) + self.get = async_to_streamed_response_wrapper( + event_notifications.get, ) diff --git a/src/cloudflare/resources/r2/buckets/event_notifications/__init__.py b/src/cloudflare/resources/r2/buckets/event_notifications/__init__.py deleted file mode 100644 index d4e0f8be76d..00000000000 --- a/src/cloudflare/resources/r2/buckets/event_notifications/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from .configuration import ( - ConfigurationResource, - AsyncConfigurationResource, - ConfigurationResourceWithRawResponse, - AsyncConfigurationResourceWithRawResponse, - ConfigurationResourceWithStreamingResponse, - AsyncConfigurationResourceWithStreamingResponse, -) -from .event_notifications import ( - EventNotificationsResource, - AsyncEventNotificationsResource, - EventNotificationsResourceWithRawResponse, - AsyncEventNotificationsResourceWithRawResponse, - EventNotificationsResourceWithStreamingResponse, - AsyncEventNotificationsResourceWithStreamingResponse, -) - -__all__ = [ - "ConfigurationResource", - "AsyncConfigurationResource", - "ConfigurationResourceWithRawResponse", - "AsyncConfigurationResourceWithRawResponse", - "ConfigurationResourceWithStreamingResponse", - "AsyncConfigurationResourceWithStreamingResponse", - "EventNotificationsResource", - "AsyncEventNotificationsResource", - "EventNotificationsResourceWithRawResponse", - "AsyncEventNotificationsResourceWithRawResponse", - "EventNotificationsResourceWithStreamingResponse", - "AsyncEventNotificationsResourceWithStreamingResponse", -] diff --git a/src/cloudflare/resources/r2/buckets/event_notifications/configuration/__init__.py b/src/cloudflare/resources/r2/buckets/event_notifications/configuration/__init__.py deleted file mode 100644 index 500f08ff784..00000000000 --- a/src/cloudflare/resources/r2/buckets/event_notifications/configuration/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from .queues import ( - QueuesResource, - AsyncQueuesResource, - QueuesResourceWithRawResponse, - AsyncQueuesResourceWithRawResponse, - QueuesResourceWithStreamingResponse, - AsyncQueuesResourceWithStreamingResponse, -) -from .configuration import ( - ConfigurationResource, - AsyncConfigurationResource, - ConfigurationResourceWithRawResponse, - AsyncConfigurationResourceWithRawResponse, - ConfigurationResourceWithStreamingResponse, - AsyncConfigurationResourceWithStreamingResponse, -) - -__all__ = [ - "QueuesResource", - "AsyncQueuesResource", - "QueuesResourceWithRawResponse", - "AsyncQueuesResourceWithRawResponse", - "QueuesResourceWithStreamingResponse", - "AsyncQueuesResourceWithStreamingResponse", - "ConfigurationResource", - "AsyncConfigurationResource", - "ConfigurationResourceWithRawResponse", - "AsyncConfigurationResourceWithRawResponse", - "ConfigurationResourceWithStreamingResponse", - "AsyncConfigurationResourceWithStreamingResponse", -] diff --git a/src/cloudflare/resources/r2/buckets/event_notifications/configuration/configuration.py b/src/cloudflare/resources/r2/buckets/event_notifications/configuration/configuration.py deleted file mode 100644 index c5a29f5f723..00000000000 --- a/src/cloudflare/resources/r2/buckets/event_notifications/configuration/configuration.py +++ /dev/null @@ -1,236 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Type, cast -from typing_extensions import Literal - -import httpx - -from .queues import ( - QueuesResource, - AsyncQueuesResource, - QueuesResourceWithRawResponse, - AsyncQueuesResourceWithRawResponse, - QueuesResourceWithStreamingResponse, - AsyncQueuesResourceWithStreamingResponse, -) -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ......_utils import is_given, strip_not_given -from ......_compat import cached_property -from ......_resource import SyncAPIResource, AsyncAPIResource -from ......_response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ......_wrappers import ResultWrapper -from ......_base_client import make_request_options -from ......types.r2.buckets.event_notifications.configuration_get_response import ConfigurationGetResponse - -__all__ = ["ConfigurationResource", "AsyncConfigurationResource"] - - -class ConfigurationResource(SyncAPIResource): - @cached_property - def queues(self) -> QueuesResource: - return QueuesResource(self._client) - - @cached_property - def with_raw_response(self) -> ConfigurationResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return ConfigurationResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> ConfigurationResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return ConfigurationResourceWithStreamingResponse(self) - - def get( - self, - bucket_name: str, - *, - account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigurationGetResponse: - """ - List all event notification rules for a bucket. - - Args: - account_id: Account ID - - bucket_name: Name of the bucket - - jurisdiction: The bucket jurisdiction - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not bucket_name: - raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") - extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), - **(extra_headers or {}), - } - return self._get( - f"/accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ConfigurationGetResponse]._unwrapper, - ), - cast_to=cast(Type[ConfigurationGetResponse], ResultWrapper[ConfigurationGetResponse]), - ) - - -class AsyncConfigurationResource(AsyncAPIResource): - @cached_property - def queues(self) -> AsyncQueuesResource: - return AsyncQueuesResource(self._client) - - @cached_property - def with_raw_response(self) -> AsyncConfigurationResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncConfigurationResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncConfigurationResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncConfigurationResourceWithStreamingResponse(self) - - async def get( - self, - bucket_name: str, - *, - account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigurationGetResponse: - """ - List all event notification rules for a bucket. - - Args: - account_id: Account ID - - bucket_name: Name of the bucket - - jurisdiction: The bucket jurisdiction - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not bucket_name: - raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") - extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), - **(extra_headers or {}), - } - return await self._get( - f"/accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ConfigurationGetResponse]._unwrapper, - ), - cast_to=cast(Type[ConfigurationGetResponse], ResultWrapper[ConfigurationGetResponse]), - ) - - -class ConfigurationResourceWithRawResponse: - def __init__(self, configuration: ConfigurationResource) -> None: - self._configuration = configuration - - self.get = to_raw_response_wrapper( - configuration.get, - ) - - @cached_property - def queues(self) -> QueuesResourceWithRawResponse: - return QueuesResourceWithRawResponse(self._configuration.queues) - - -class AsyncConfigurationResourceWithRawResponse: - def __init__(self, configuration: AsyncConfigurationResource) -> None: - self._configuration = configuration - - self.get = async_to_raw_response_wrapper( - configuration.get, - ) - - @cached_property - def queues(self) -> AsyncQueuesResourceWithRawResponse: - return AsyncQueuesResourceWithRawResponse(self._configuration.queues) - - -class ConfigurationResourceWithStreamingResponse: - def __init__(self, configuration: ConfigurationResource) -> None: - self._configuration = configuration - - self.get = to_streamed_response_wrapper( - configuration.get, - ) - - @cached_property - def queues(self) -> QueuesResourceWithStreamingResponse: - return QueuesResourceWithStreamingResponse(self._configuration.queues) - - -class AsyncConfigurationResourceWithStreamingResponse: - def __init__(self, configuration: AsyncConfigurationResource) -> None: - self._configuration = configuration - - self.get = async_to_streamed_response_wrapper( - configuration.get, - ) - - @cached_property - def queues(self) -> AsyncQueuesResourceWithStreamingResponse: - return AsyncQueuesResourceWithStreamingResponse(self._configuration.queues) diff --git a/src/cloudflare/resources/r2/buckets/event_notifications/event_notifications.py b/src/cloudflare/resources/r2/buckets/event_notifications/event_notifications.py deleted file mode 100644 index 51773e46bcd..00000000000 --- a/src/cloudflare/resources/r2/buckets/event_notifications/event_notifications.py +++ /dev/null @@ -1,102 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from ....._compat import cached_property -from ....._resource import SyncAPIResource, AsyncAPIResource -from .configuration.configuration import ( - ConfigurationResource, - AsyncConfigurationResource, - ConfigurationResourceWithRawResponse, - AsyncConfigurationResourceWithRawResponse, - ConfigurationResourceWithStreamingResponse, - AsyncConfigurationResourceWithStreamingResponse, -) - -__all__ = ["EventNotificationsResource", "AsyncEventNotificationsResource"] - - -class EventNotificationsResource(SyncAPIResource): - @cached_property - def configuration(self) -> ConfigurationResource: - return ConfigurationResource(self._client) - - @cached_property - def with_raw_response(self) -> EventNotificationsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return EventNotificationsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> EventNotificationsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return EventNotificationsResourceWithStreamingResponse(self) - - -class AsyncEventNotificationsResource(AsyncAPIResource): - @cached_property - def configuration(self) -> AsyncConfigurationResource: - return AsyncConfigurationResource(self._client) - - @cached_property - def with_raw_response(self) -> AsyncEventNotificationsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncEventNotificationsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncEventNotificationsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncEventNotificationsResourceWithStreamingResponse(self) - - -class EventNotificationsResourceWithRawResponse: - def __init__(self, event_notifications: EventNotificationsResource) -> None: - self._event_notifications = event_notifications - - @cached_property - def configuration(self) -> ConfigurationResourceWithRawResponse: - return ConfigurationResourceWithRawResponse(self._event_notifications.configuration) - - -class AsyncEventNotificationsResourceWithRawResponse: - def __init__(self, event_notifications: AsyncEventNotificationsResource) -> None: - self._event_notifications = event_notifications - - @cached_property - def configuration(self) -> AsyncConfigurationResourceWithRawResponse: - return AsyncConfigurationResourceWithRawResponse(self._event_notifications.configuration) - - -class EventNotificationsResourceWithStreamingResponse: - def __init__(self, event_notifications: EventNotificationsResource) -> None: - self._event_notifications = event_notifications - - @cached_property - def configuration(self) -> ConfigurationResourceWithStreamingResponse: - return ConfigurationResourceWithStreamingResponse(self._event_notifications.configuration) - - -class AsyncEventNotificationsResourceWithStreamingResponse: - def __init__(self, event_notifications: AsyncEventNotificationsResource) -> None: - self._event_notifications = event_notifications - - @cached_property - def configuration(self) -> AsyncConfigurationResourceWithStreamingResponse: - return AsyncConfigurationResourceWithStreamingResponse(self._event_notifications.configuration) diff --git a/src/cloudflare/types/r2/buckets/__init__.py b/src/cloudflare/types/r2/buckets/__init__.py index 54d849cf9ef..a0dd48f75d5 100644 --- a/src/cloudflare/types/r2/buckets/__init__.py +++ b/src/cloudflare/types/r2/buckets/__init__.py @@ -13,3 +13,5 @@ from .sippy_delete_response import SippyDeleteResponse as SippyDeleteResponse from .lifecycle_get_response import LifecycleGetResponse as LifecycleGetResponse from .lifecycle_update_params import LifecycleUpdateParams as LifecycleUpdateParams +from .event_notification_get_response import EventNotificationGetResponse as EventNotificationGetResponse +from .event_notification_update_params import EventNotificationUpdateParams as EventNotificationUpdateParams diff --git a/src/cloudflare/types/r2/buckets/event_notifications/configuration_get_response.py b/src/cloudflare/types/r2/buckets/event_notification_get_response.py similarity index 90% rename from src/cloudflare/types/r2/buckets/event_notifications/configuration_get_response.py rename to src/cloudflare/types/r2/buckets/event_notification_get_response.py index 4f3f6ce311e..e2deb9b047c 100644 --- a/src/cloudflare/types/r2/buckets/event_notifications/configuration_get_response.py +++ b/src/cloudflare/types/r2/buckets/event_notification_get_response.py @@ -5,9 +5,9 @@ from pydantic import Field as FieldInfo -from ....._models import BaseModel +from ...._models import BaseModel -__all__ = ["ConfigurationGetResponse", "Queue", "QueueRule"] +__all__ = ["EventNotificationGetResponse", "Queue", "QueueRule"] class QueueRule(BaseModel): @@ -43,7 +43,7 @@ class Queue(BaseModel): rules: Optional[List[QueueRule]] = None -class ConfigurationGetResponse(BaseModel): +class EventNotificationGetResponse(BaseModel): bucket_name: Optional[str] = FieldInfo(alias="bucketName", default=None) """Name of the bucket.""" diff --git a/src/cloudflare/types/r2/buckets/event_notifications/configuration/queue_update_params.py b/src/cloudflare/types/r2/buckets/event_notification_update_params.py similarity index 88% rename from src/cloudflare/types/r2/buckets/event_notifications/configuration/queue_update_params.py rename to src/cloudflare/types/r2/buckets/event_notification_update_params.py index 6d0db95320f..834a44e1200 100644 --- a/src/cloudflare/types/r2/buckets/event_notifications/configuration/queue_update_params.py +++ b/src/cloudflare/types/r2/buckets/event_notification_update_params.py @@ -5,12 +5,12 @@ from typing import List, Iterable from typing_extensions import Literal, Required, Annotated, TypedDict -from ......_utils import PropertyInfo +from ...._utils import PropertyInfo -__all__ = ["QueueUpdateParams", "Rule"] +__all__ = ["EventNotificationUpdateParams", "Rule"] -class QueueUpdateParams(TypedDict, total=False): +class EventNotificationUpdateParams(TypedDict, total=False): account_id: Required[str] """Account ID""" diff --git a/src/cloudflare/types/r2/buckets/event_notifications/__init__.py b/src/cloudflare/types/r2/buckets/event_notifications/__init__.py deleted file mode 100644 index b1fcfe993b2..00000000000 --- a/src/cloudflare/types/r2/buckets/event_notifications/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from .configuration_get_response import ConfigurationGetResponse as ConfigurationGetResponse diff --git a/src/cloudflare/types/r2/buckets/event_notifications/configuration/__init__.py b/src/cloudflare/types/r2/buckets/event_notifications/configuration/__init__.py deleted file mode 100644 index 0728e99d04b..00000000000 --- a/src/cloudflare/types/r2/buckets/event_notifications/configuration/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from .queue_update_params import QueueUpdateParams as QueueUpdateParams diff --git a/tests/api_resources/r2/buckets/event_notifications/__init__.py b/tests/api_resources/r2/buckets/event_notifications/__init__.py deleted file mode 100644 index fd8019a9a1a..00000000000 --- a/tests/api_resources/r2/buckets/event_notifications/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/r2/buckets/event_notifications/configuration/__init__.py b/tests/api_resources/r2/buckets/event_notifications/configuration/__init__.py deleted file mode 100644 index fd8019a9a1a..00000000000 --- a/tests/api_resources/r2/buckets/event_notifications/configuration/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/r2/buckets/event_notifications/test_configuration.py b/tests/api_resources/r2/buckets/event_notifications/test_configuration.py deleted file mode 100644 index 48c14e93942..00000000000 --- a/tests/api_resources/r2/buckets/event_notifications/test_configuration.py +++ /dev/null @@ -1,146 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.types.r2.buckets.event_notifications import ConfigurationGetResponse - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestConfiguration: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") - @parametrize - def test_method_get(self, client: Cloudflare) -> None: - configuration = client.r2.buckets.event_notifications.configuration.get( - bucket_name="example-bucket", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(ConfigurationGetResponse, configuration, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") - @parametrize - def test_method_get_with_all_params(self, client: Cloudflare) -> None: - configuration = client.r2.buckets.event_notifications.configuration.get( - bucket_name="example-bucket", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - jurisdiction="default", - ) - assert_matches_type(ConfigurationGetResponse, configuration, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") - @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.r2.buckets.event_notifications.configuration.with_raw_response.get( - bucket_name="example-bucket", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - configuration = response.parse() - assert_matches_type(ConfigurationGetResponse, configuration, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") - @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.r2.buckets.event_notifications.configuration.with_streaming_response.get( - bucket_name="example-bucket", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - configuration = response.parse() - assert_matches_type(ConfigurationGetResponse, configuration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") - @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.r2.buckets.event_notifications.configuration.with_raw_response.get( - bucket_name="example-bucket", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `bucket_name` but received ''"): - client.r2.buckets.event_notifications.configuration.with_raw_response.get( - bucket_name="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - -class TestAsyncConfiguration: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") - @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - configuration = await async_client.r2.buckets.event_notifications.configuration.get( - bucket_name="example-bucket", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(ConfigurationGetResponse, configuration, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") - @parametrize - async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: - configuration = await async_client.r2.buckets.event_notifications.configuration.get( - bucket_name="example-bucket", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - jurisdiction="default", - ) - assert_matches_type(ConfigurationGetResponse, configuration, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") - @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.r2.buckets.event_notifications.configuration.with_raw_response.get( - bucket_name="example-bucket", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - configuration = await response.parse() - assert_matches_type(ConfigurationGetResponse, configuration, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") - @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.r2.buckets.event_notifications.configuration.with_streaming_response.get( - bucket_name="example-bucket", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - configuration = await response.parse() - assert_matches_type(ConfigurationGetResponse, configuration, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") - @parametrize - async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.r2.buckets.event_notifications.configuration.with_raw_response.get( - bucket_name="example-bucket", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `bucket_name` but received ''"): - await async_client.r2.buckets.event_notifications.configuration.with_raw_response.get( - bucket_name="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) diff --git a/tests/api_resources/r2/buckets/event_notifications/configuration/test_queues.py b/tests/api_resources/r2/buckets/test_event_notifications.py similarity index 53% rename from tests/api_resources/r2/buckets/event_notifications/configuration/test_queues.py rename to tests/api_resources/r2/buckets/test_event_notifications.py index 8a8fa2a2102..c5fb18c5bfc 100644 --- a/tests/api_resources/r2/buckets/event_notifications/configuration/test_queues.py +++ b/tests/api_resources/r2/buckets/test_event_notifications.py @@ -9,27 +9,28 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare.types.r2.buckets import EventNotificationGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") -class TestQueues: +class TestEventNotifications: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize def test_method_update(self, client: Cloudflare) -> None: - queue = client.r2.buckets.event_notifications.configuration.queues.update( + event_notification = client.r2.buckets.event_notifications.update( queue_id="queue_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="example-bucket", ) - assert_matches_type(object, queue, path=["response"]) + assert_matches_type(object, event_notification, path=["response"]) @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize def test_method_update_with_all_params(self, client: Cloudflare) -> None: - queue = client.r2.buckets.event_notifications.configuration.queues.update( + event_notification = client.r2.buckets.event_notifications.update( queue_id="queue_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="example-bucket", @@ -43,12 +44,12 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: ], jurisdiction="default", ) - assert_matches_type(object, queue, path=["response"]) + assert_matches_type(object, event_notification, path=["response"]) @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: - response = client.r2.buckets.event_notifications.configuration.queues.with_raw_response.update( + response = client.r2.buckets.event_notifications.with_raw_response.update( queue_id="queue_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="example-bucket", @@ -56,13 +57,13 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - queue = response.parse() - assert_matches_type(object, queue, path=["response"]) + event_notification = response.parse() + assert_matches_type(object, event_notification, path=["response"]) @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: - with client.r2.buckets.event_notifications.configuration.queues.with_streaming_response.update( + with client.r2.buckets.event_notifications.with_streaming_response.update( queue_id="queue_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="example-bucket", @@ -70,8 +71,8 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - queue = response.parse() - assert_matches_type(object, queue, path=["response"]) + event_notification = response.parse() + assert_matches_type(object, event_notification, path=["response"]) assert cast(Any, response.is_closed) is True @@ -79,21 +80,21 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: @parametrize def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.r2.buckets.event_notifications.configuration.queues.with_raw_response.update( + client.r2.buckets.event_notifications.with_raw_response.update( queue_id="queue_id", account_id="", bucket_name="example-bucket", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `bucket_name` but received ''"): - client.r2.buckets.event_notifications.configuration.queues.with_raw_response.update( + client.r2.buckets.event_notifications.with_raw_response.update( queue_id="queue_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `queue_id` but received ''"): - client.r2.buckets.event_notifications.configuration.queues.with_raw_response.update( + client.r2.buckets.event_notifications.with_raw_response.update( queue_id="", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="example-bucket", @@ -102,28 +103,28 @@ def test_path_params_update(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize def test_method_delete(self, client: Cloudflare) -> None: - queue = client.r2.buckets.event_notifications.configuration.queues.delete( + event_notification = client.r2.buckets.event_notifications.delete( queue_id="queue_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="example-bucket", ) - assert_matches_type(object, queue, path=["response"]) + assert_matches_type(object, event_notification, path=["response"]) @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize def test_method_delete_with_all_params(self, client: Cloudflare) -> None: - queue = client.r2.buckets.event_notifications.configuration.queues.delete( + event_notification = client.r2.buckets.event_notifications.delete( queue_id="queue_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="example-bucket", jurisdiction="default", ) - assert_matches_type(object, queue, path=["response"]) + assert_matches_type(object, event_notification, path=["response"]) @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.r2.buckets.event_notifications.configuration.queues.with_raw_response.delete( + response = client.r2.buckets.event_notifications.with_raw_response.delete( queue_id="queue_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="example-bucket", @@ -131,13 +132,13 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - queue = response.parse() - assert_matches_type(object, queue, path=["response"]) + event_notification = response.parse() + assert_matches_type(object, event_notification, path=["response"]) @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.r2.buckets.event_notifications.configuration.queues.with_streaming_response.delete( + with client.r2.buckets.event_notifications.with_streaming_response.delete( queue_id="queue_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="example-bucket", @@ -145,8 +146,8 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - queue = response.parse() - assert_matches_type(object, queue, path=["response"]) + event_notification = response.parse() + assert_matches_type(object, event_notification, path=["response"]) assert cast(Any, response.is_closed) is True @@ -154,44 +155,106 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.r2.buckets.event_notifications.configuration.queues.with_raw_response.delete( + client.r2.buckets.event_notifications.with_raw_response.delete( queue_id="queue_id", account_id="", bucket_name="example-bucket", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `bucket_name` but received ''"): - client.r2.buckets.event_notifications.configuration.queues.with_raw_response.delete( + client.r2.buckets.event_notifications.with_raw_response.delete( queue_id="queue_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `queue_id` but received ''"): - client.r2.buckets.event_notifications.configuration.queues.with_raw_response.delete( + client.r2.buckets.event_notifications.with_raw_response.delete( queue_id="", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="example-bucket", ) + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + event_notification = client.r2.buckets.event_notifications.get( + bucket_name="example-bucket", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(EventNotificationGetResponse, event_notification, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") + @parametrize + def test_method_get_with_all_params(self, client: Cloudflare) -> None: + event_notification = client.r2.buckets.event_notifications.get( + bucket_name="example-bucket", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + jurisdiction="default", + ) + assert_matches_type(EventNotificationGetResponse, event_notification, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.r2.buckets.event_notifications.with_raw_response.get( + bucket_name="example-bucket", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + event_notification = response.parse() + assert_matches_type(EventNotificationGetResponse, event_notification, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.r2.buckets.event_notifications.with_streaming_response.get( + bucket_name="example-bucket", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + event_notification = response.parse() + assert_matches_type(EventNotificationGetResponse, event_notification, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.r2.buckets.event_notifications.with_raw_response.get( + bucket_name="example-bucket", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `bucket_name` but received ''"): + client.r2.buckets.event_notifications.with_raw_response.get( + bucket_name="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + -class TestAsyncQueues: +class TestAsyncEventNotifications: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize async def test_method_update(self, async_client: AsyncCloudflare) -> None: - queue = await async_client.r2.buckets.event_notifications.configuration.queues.update( + event_notification = await async_client.r2.buckets.event_notifications.update( queue_id="queue_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="example-bucket", ) - assert_matches_type(object, queue, path=["response"]) + assert_matches_type(object, event_notification, path=["response"]) @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: - queue = await async_client.r2.buckets.event_notifications.configuration.queues.update( + event_notification = await async_client.r2.buckets.event_notifications.update( queue_id="queue_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="example-bucket", @@ -205,12 +268,12 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare ], jurisdiction="default", ) - assert_matches_type(object, queue, path=["response"]) + assert_matches_type(object, event_notification, path=["response"]) @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: - response = await async_client.r2.buckets.event_notifications.configuration.queues.with_raw_response.update( + response = await async_client.r2.buckets.event_notifications.with_raw_response.update( queue_id="queue_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="example-bucket", @@ -218,13 +281,13 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - queue = await response.parse() - assert_matches_type(object, queue, path=["response"]) + event_notification = await response.parse() + assert_matches_type(object, event_notification, path=["response"]) @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: - async with async_client.r2.buckets.event_notifications.configuration.queues.with_streaming_response.update( + async with async_client.r2.buckets.event_notifications.with_streaming_response.update( queue_id="queue_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="example-bucket", @@ -232,8 +295,8 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - queue = await response.parse() - assert_matches_type(object, queue, path=["response"]) + event_notification = await response.parse() + assert_matches_type(object, event_notification, path=["response"]) assert cast(Any, response.is_closed) is True @@ -241,21 +304,21 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> @parametrize async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.r2.buckets.event_notifications.configuration.queues.with_raw_response.update( + await async_client.r2.buckets.event_notifications.with_raw_response.update( queue_id="queue_id", account_id="", bucket_name="example-bucket", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `bucket_name` but received ''"): - await async_client.r2.buckets.event_notifications.configuration.queues.with_raw_response.update( + await async_client.r2.buckets.event_notifications.with_raw_response.update( queue_id="queue_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `queue_id` but received ''"): - await async_client.r2.buckets.event_notifications.configuration.queues.with_raw_response.update( + await async_client.r2.buckets.event_notifications.with_raw_response.update( queue_id="", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="example-bucket", @@ -264,28 +327,28 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - queue = await async_client.r2.buckets.event_notifications.configuration.queues.delete( + event_notification = await async_client.r2.buckets.event_notifications.delete( queue_id="queue_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="example-bucket", ) - assert_matches_type(object, queue, path=["response"]) + assert_matches_type(object, event_notification, path=["response"]) @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare) -> None: - queue = await async_client.r2.buckets.event_notifications.configuration.queues.delete( + event_notification = await async_client.r2.buckets.event_notifications.delete( queue_id="queue_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="example-bucket", jurisdiction="default", ) - assert_matches_type(object, queue, path=["response"]) + assert_matches_type(object, event_notification, path=["response"]) @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.r2.buckets.event_notifications.configuration.queues.with_raw_response.delete( + response = await async_client.r2.buckets.event_notifications.with_raw_response.delete( queue_id="queue_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="example-bucket", @@ -293,13 +356,13 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - queue = await response.parse() - assert_matches_type(object, queue, path=["response"]) + event_notification = await response.parse() + assert_matches_type(object, event_notification, path=["response"]) @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.r2.buckets.event_notifications.configuration.queues.with_streaming_response.delete( + async with async_client.r2.buckets.event_notifications.with_streaming_response.delete( queue_id="queue_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="example-bucket", @@ -307,8 +370,8 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - queue = await response.parse() - assert_matches_type(object, queue, path=["response"]) + event_notification = await response.parse() + assert_matches_type(object, event_notification, path=["response"]) assert cast(Any, response.is_closed) is True @@ -316,22 +379,84 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.r2.buckets.event_notifications.configuration.queues.with_raw_response.delete( + await async_client.r2.buckets.event_notifications.with_raw_response.delete( queue_id="queue_id", account_id="", bucket_name="example-bucket", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `bucket_name` but received ''"): - await async_client.r2.buckets.event_notifications.configuration.queues.with_raw_response.delete( + await async_client.r2.buckets.event_notifications.with_raw_response.delete( queue_id="queue_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `queue_id` but received ''"): - await async_client.r2.buckets.event_notifications.configuration.queues.with_raw_response.delete( + await async_client.r2.buckets.event_notifications.with_raw_response.delete( queue_id="", account_id="023e105f4ecef8ad9ca31a8372d0c353", bucket_name="example-bucket", ) + + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + event_notification = await async_client.r2.buckets.event_notifications.get( + bucket_name="example-bucket", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(EventNotificationGetResponse, event_notification, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") + @parametrize + async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: + event_notification = await async_client.r2.buckets.event_notifications.get( + bucket_name="example-bucket", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + jurisdiction="default", + ) + assert_matches_type(EventNotificationGetResponse, event_notification, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.r2.buckets.event_notifications.with_raw_response.get( + bucket_name="example-bucket", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + event_notification = await response.parse() + assert_matches_type(EventNotificationGetResponse, event_notification, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.r2.buckets.event_notifications.with_streaming_response.get( + bucket_name="example-bucket", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + event_notification = await response.parse() + assert_matches_type(EventNotificationGetResponse, event_notification, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate auth errors on test suite") + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.r2.buckets.event_notifications.with_raw_response.get( + bucket_name="example-bucket", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `bucket_name` but received ''"): + await async_client.r2.buckets.event_notifications.with_raw_response.get( + bucket_name="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) From 493bb1fa9c6efac7f594dc400e157c98a6f1117c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 9 Feb 2025 23:46:57 +0000 Subject: [PATCH 136/358] feat(access): make `access_requests` singular for model (#2439) --- api.md | 2 +- src/cloudflare/types/zero_trust/access/logs/__init__.py | 2 +- .../access/logs/{access_requests.py => access_request.py} | 4 ++-- .../zero_trust/access/logs/access_request_list_response.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) rename src/cloudflare/types/zero_trust/access/logs/{access_requests.py => access_request.py} (94%) diff --git a/api.md b/api.md index ccec68cf7ee..17b9d708b6a 100644 --- a/api.md +++ b/api.md @@ -5520,7 +5520,7 @@ Methods: Types: ```python -from cloudflare.types.zero_trust.access.logs import AccessRequests +from cloudflare.types.zero_trust.access.logs import AccessRequest ``` ##### Updates diff --git a/src/cloudflare/types/zero_trust/access/logs/__init__.py b/src/cloudflare/types/zero_trust/access/logs/__init__.py index 6054daa920f..a6057a5095f 100644 --- a/src/cloudflare/types/zero_trust/access/logs/__init__.py +++ b/src/cloudflare/types/zero_trust/access/logs/__init__.py @@ -2,6 +2,6 @@ from __future__ import annotations -from .access_requests import AccessRequests as AccessRequests +from .access_request import AccessRequest as AccessRequest from .access_request_list_params import AccessRequestListParams as AccessRequestListParams from .access_request_list_response import AccessRequestListResponse as AccessRequestListResponse diff --git a/src/cloudflare/types/zero_trust/access/logs/access_requests.py b/src/cloudflare/types/zero_trust/access/logs/access_request.py similarity index 94% rename from src/cloudflare/types/zero_trust/access/logs/access_requests.py rename to src/cloudflare/types/zero_trust/access/logs/access_request.py index 7baca33ef79..196239befc8 100644 --- a/src/cloudflare/types/zero_trust/access/logs/access_requests.py +++ b/src/cloudflare/types/zero_trust/access/logs/access_request.py @@ -7,10 +7,10 @@ from ....._models import BaseModel -__all__ = ["AccessRequests"] +__all__ = ["AccessRequest"] -class AccessRequests(BaseModel): +class AccessRequest(BaseModel): action: Optional[str] = None """The event that occurred, such as a login attempt.""" diff --git a/src/cloudflare/types/zero_trust/access/logs/access_request_list_response.py b/src/cloudflare/types/zero_trust/access/logs/access_request_list_response.py index 953cd228fad..1baf2a06331 100644 --- a/src/cloudflare/types/zero_trust/access/logs/access_request_list_response.py +++ b/src/cloudflare/types/zero_trust/access/logs/access_request_list_response.py @@ -3,8 +3,8 @@ from typing import List from typing_extensions import TypeAlias -from .access_requests import AccessRequests +from .access_request import AccessRequest __all__ = ["AccessRequestListResponse"] -AccessRequestListResponse: TypeAlias = List[AccessRequests] +AccessRequestListResponse: TypeAlias = List[AccessRequest] From 0b114b79654c03dc0aa430721da83daccd0ada95 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 9 Feb 2025 23:53:40 +0000 Subject: [PATCH 137/358] feat(api): update internal path (#2440) --- .stats.yml | 2 +- api.md | 12 ++ src/cloudflare/resources/ssl/__init__.py | 14 ++ .../resources/ssl/recommendations.py | 178 ++++++++++++++++++ src/cloudflare/resources/ssl/ssl.py | 32 ++++ src/cloudflare/types/ssl/__init__.py | 1 + .../types/ssl/recommendation_get_response.py | 18 ++ .../api_resources/ssl/test_recommendations.py | 98 ++++++++++ 8 files changed, 354 insertions(+), 1 deletion(-) create mode 100644 src/cloudflare/resources/ssl/recommendations.py create mode 100644 src/cloudflare/types/ssl/recommendation_get_response.py create mode 100644 tests/api_resources/ssl/test_recommendations.py diff --git a/.stats.yml b/.stats.yml index 5e85cd296ba..b74f67c14ad 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 1524 +configured_endpoints: 1525 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-201a9d77b2e238cb2f8c2c952b00b976608e2a53fe4230369e801971fda29edc.yml diff --git a/api.md b/api.md index 17b9d708b6a..6ec5ac010ec 100644 --- a/api.md +++ b/api.md @@ -772,6 +772,18 @@ Methods: - client.ssl.certificate_packs.quota.get(\*, zone_id) -> Optional[QuotaGetResponse] +## Recommendations + +Types: + +```python +from cloudflare.types.ssl import RecommendationGetResponse +``` + +Methods: + +- client.ssl.recommendations.get(\*, zone_id) -> Optional[RecommendationGetResponse] + ## Universal ### Settings diff --git a/src/cloudflare/resources/ssl/__init__.py b/src/cloudflare/resources/ssl/__init__.py index a7e69021e50..59245e44dfb 100644 --- a/src/cloudflare/resources/ssl/__init__.py +++ b/src/cloudflare/resources/ssl/__init__.py @@ -32,6 +32,14 @@ VerificationResourceWithStreamingResponse, AsyncVerificationResourceWithStreamingResponse, ) +from .recommendations import ( + RecommendationsResource, + AsyncRecommendationsResource, + RecommendationsResourceWithRawResponse, + AsyncRecommendationsResourceWithRawResponse, + RecommendationsResourceWithStreamingResponse, + AsyncRecommendationsResourceWithStreamingResponse, +) from .certificate_packs import ( CertificatePacksResource, AsyncCertificatePacksResource, @@ -54,6 +62,12 @@ "AsyncCertificatePacksResourceWithRawResponse", "CertificatePacksResourceWithStreamingResponse", "AsyncCertificatePacksResourceWithStreamingResponse", + "RecommendationsResource", + "AsyncRecommendationsResource", + "RecommendationsResourceWithRawResponse", + "AsyncRecommendationsResourceWithRawResponse", + "RecommendationsResourceWithStreamingResponse", + "AsyncRecommendationsResourceWithStreamingResponse", "UniversalResource", "AsyncUniversalResource", "UniversalResourceWithRawResponse", diff --git a/src/cloudflare/resources/ssl/recommendations.py b/src/cloudflare/resources/ssl/recommendations.py new file mode 100644 index 00000000000..803fe95e45f --- /dev/null +++ b/src/cloudflare/resources/ssl/recommendations.py @@ -0,0 +1,178 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, Optional, cast + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._wrappers import ResultWrapper +from ..._base_client import make_request_options +from ...types.ssl.recommendation_get_response import RecommendationGetResponse + +__all__ = ["RecommendationsResource", "AsyncRecommendationsResource"] + + +class RecommendationsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> RecommendationsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return RecommendationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> RecommendationsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return RecommendationsResourceWithStreamingResponse(self) + + def get( + self, + *, + zone_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[RecommendationGetResponse]: + """ + Retrieve the SSL/TLS Recommender's recommendation for a zone. + + Args: + zone_id: Identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return self._get( + f"/zones/{zone_id}/ssl/recommendation", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[RecommendationGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[RecommendationGetResponse]], ResultWrapper[RecommendationGetResponse]), + ) + + +class AsyncRecommendationsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncRecommendationsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncRecommendationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncRecommendationsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncRecommendationsResourceWithStreamingResponse(self) + + async def get( + self, + *, + zone_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[RecommendationGetResponse]: + """ + Retrieve the SSL/TLS Recommender's recommendation for a zone. + + Args: + zone_id: Identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return await self._get( + f"/zones/{zone_id}/ssl/recommendation", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[RecommendationGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[RecommendationGetResponse]], ResultWrapper[RecommendationGetResponse]), + ) + + +class RecommendationsResourceWithRawResponse: + def __init__(self, recommendations: RecommendationsResource) -> None: + self._recommendations = recommendations + + self.get = to_raw_response_wrapper( + recommendations.get, + ) + + +class AsyncRecommendationsResourceWithRawResponse: + def __init__(self, recommendations: AsyncRecommendationsResource) -> None: + self._recommendations = recommendations + + self.get = async_to_raw_response_wrapper( + recommendations.get, + ) + + +class RecommendationsResourceWithStreamingResponse: + def __init__(self, recommendations: RecommendationsResource) -> None: + self._recommendations = recommendations + + self.get = to_streamed_response_wrapper( + recommendations.get, + ) + + +class AsyncRecommendationsResourceWithStreamingResponse: + def __init__(self, recommendations: AsyncRecommendationsResource) -> None: + self._recommendations = recommendations + + self.get = async_to_streamed_response_wrapper( + recommendations.get, + ) diff --git a/src/cloudflare/resources/ssl/ssl.py b/src/cloudflare/resources/ssl/ssl.py index 8d0acbe4b00..c46c403db8b 100644 --- a/src/cloudflare/resources/ssl/ssl.py +++ b/src/cloudflare/resources/ssl/ssl.py @@ -20,6 +20,14 @@ VerificationResourceWithStreamingResponse, AsyncVerificationResourceWithStreamingResponse, ) +from .recommendations import ( + RecommendationsResource, + AsyncRecommendationsResource, + RecommendationsResourceWithRawResponse, + AsyncRecommendationsResourceWithRawResponse, + RecommendationsResourceWithStreamingResponse, + AsyncRecommendationsResourceWithStreamingResponse, +) from .universal.universal import ( UniversalResource, AsyncUniversalResource, @@ -49,6 +57,10 @@ def analyze(self) -> AnalyzeResource: def certificate_packs(self) -> CertificatePacksResource: return CertificatePacksResource(self._client) + @cached_property + def recommendations(self) -> RecommendationsResource: + return RecommendationsResource(self._client) + @cached_property def universal(self) -> UniversalResource: return UniversalResource(self._client) @@ -86,6 +98,10 @@ def analyze(self) -> AsyncAnalyzeResource: def certificate_packs(self) -> AsyncCertificatePacksResource: return AsyncCertificatePacksResource(self._client) + @cached_property + def recommendations(self) -> AsyncRecommendationsResource: + return AsyncRecommendationsResource(self._client) + @cached_property def universal(self) -> AsyncUniversalResource: return AsyncUniversalResource(self._client) @@ -126,6 +142,10 @@ def analyze(self) -> AnalyzeResourceWithRawResponse: def certificate_packs(self) -> CertificatePacksResourceWithRawResponse: return CertificatePacksResourceWithRawResponse(self._ssl.certificate_packs) + @cached_property + def recommendations(self) -> RecommendationsResourceWithRawResponse: + return RecommendationsResourceWithRawResponse(self._ssl.recommendations) + @cached_property def universal(self) -> UniversalResourceWithRawResponse: return UniversalResourceWithRawResponse(self._ssl.universal) @@ -147,6 +167,10 @@ def analyze(self) -> AsyncAnalyzeResourceWithRawResponse: def certificate_packs(self) -> AsyncCertificatePacksResourceWithRawResponse: return AsyncCertificatePacksResourceWithRawResponse(self._ssl.certificate_packs) + @cached_property + def recommendations(self) -> AsyncRecommendationsResourceWithRawResponse: + return AsyncRecommendationsResourceWithRawResponse(self._ssl.recommendations) + @cached_property def universal(self) -> AsyncUniversalResourceWithRawResponse: return AsyncUniversalResourceWithRawResponse(self._ssl.universal) @@ -168,6 +192,10 @@ def analyze(self) -> AnalyzeResourceWithStreamingResponse: def certificate_packs(self) -> CertificatePacksResourceWithStreamingResponse: return CertificatePacksResourceWithStreamingResponse(self._ssl.certificate_packs) + @cached_property + def recommendations(self) -> RecommendationsResourceWithStreamingResponse: + return RecommendationsResourceWithStreamingResponse(self._ssl.recommendations) + @cached_property def universal(self) -> UniversalResourceWithStreamingResponse: return UniversalResourceWithStreamingResponse(self._ssl.universal) @@ -189,6 +217,10 @@ def analyze(self) -> AsyncAnalyzeResourceWithStreamingResponse: def certificate_packs(self) -> AsyncCertificatePacksResourceWithStreamingResponse: return AsyncCertificatePacksResourceWithStreamingResponse(self._ssl.certificate_packs) + @cached_property + def recommendations(self) -> AsyncRecommendationsResourceWithStreamingResponse: + return AsyncRecommendationsResourceWithStreamingResponse(self._ssl.recommendations) + @cached_property def universal(self) -> AsyncUniversalResourceWithStreamingResponse: return AsyncUniversalResourceWithStreamingResponse(self._ssl.universal) diff --git a/src/cloudflare/types/ssl/__init__.py b/src/cloudflare/types/ssl/__init__.py index 9f91c6c173b..b12a6fb8467 100644 --- a/src/cloudflare/types/ssl/__init__.py +++ b/src/cloudflare/types/ssl/__init__.py @@ -12,6 +12,7 @@ from .verification_edit_params import VerificationEditParams as VerificationEditParams from .verification_get_response import VerificationGetResponse as VerificationGetResponse from .verification_edit_response import VerificationEditResponse as VerificationEditResponse +from .recommendation_get_response import RecommendationGetResponse as RecommendationGetResponse from .certificate_pack_edit_params import CertificatePackEditParams as CertificatePackEditParams from .certificate_pack_list_params import CertificatePackListParams as CertificatePackListParams from .certificate_pack_create_params import CertificatePackCreateParams as CertificatePackCreateParams diff --git a/src/cloudflare/types/ssl/recommendation_get_response.py b/src/cloudflare/types/ssl/recommendation_get_response.py new file mode 100644 index 00000000000..bf29f2b7368 --- /dev/null +++ b/src/cloudflare/types/ssl/recommendation_get_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["RecommendationGetResponse"] + + +class RecommendationGetResponse(BaseModel): + id: Optional[str] = None + """Identifier of a recommendation result.""" + + modified_on: Optional[datetime] = None + + value: Optional[Literal["flexible", "full", "strict"]] = None diff --git a/tests/api_resources/ssl/test_recommendations.py b/tests/api_resources/ssl/test_recommendations.py new file mode 100644 index 00000000000..49520ba3738 --- /dev/null +++ b/tests/api_resources/ssl/test_recommendations.py @@ -0,0 +1,98 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.ssl import RecommendationGetResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestRecommendations: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + recommendation = client.ssl.recommendations.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[RecommendationGetResponse], recommendation, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.ssl.recommendations.with_raw_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + recommendation = response.parse() + assert_matches_type(Optional[RecommendationGetResponse], recommendation, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.ssl.recommendations.with_streaming_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + recommendation = response.parse() + assert_matches_type(Optional[RecommendationGetResponse], recommendation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.ssl.recommendations.with_raw_response.get( + zone_id="", + ) + + +class TestAsyncRecommendations: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + recommendation = await async_client.ssl.recommendations.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[RecommendationGetResponse], recommendation, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.ssl.recommendations.with_raw_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + recommendation = await response.parse() + assert_matches_type(Optional[RecommendationGetResponse], recommendation, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.ssl.recommendations.with_streaming_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + recommendation = await response.parse() + assert_matches_type(Optional[RecommendationGetResponse], recommendation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.ssl.recommendations.with_raw_response.get( + zone_id="", + ) From 46da531e8ab67cab8f9621377ae002804eef6ebe Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 14:15:48 +0000 Subject: [PATCH 138/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index b74f67c14ad..e34d25c4704 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-201a9d77b2e238cb2f8c2c952b00b976608e2a53fe4230369e801971fda29edc.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6395dc43a1d7d31aa6ecc5428acf7cff96531b1a9cb83f350919711c232acfd0.yml From 57c7803d144823bae2870f67f0892d45f5a346b0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 14:36:46 +0000 Subject: [PATCH 139/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index e34d25c4704..b74f67c14ad 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6395dc43a1d7d31aa6ecc5428acf7cff96531b1a9cb83f350919711c232acfd0.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-201a9d77b2e238cb2f8c2c952b00b976608e2a53fe4230369e801971fda29edc.yml From 46f72f28e792acab3e72d403f634ce05978378fb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 14:53:59 +0000 Subject: [PATCH 140/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index b74f67c14ad..e34d25c4704 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-201a9d77b2e238cb2f8c2c952b00b976608e2a53fe4230369e801971fda29edc.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6395dc43a1d7d31aa6ecc5428acf7cff96531b1a9cb83f350919711c232acfd0.yml From 96e682596873e0cba04ecab92b78f958415ee79a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 15:08:38 +0000 Subject: [PATCH 141/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index e34d25c4704..b74f67c14ad 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6395dc43a1d7d31aa6ecc5428acf7cff96531b1a9cb83f350919711c232acfd0.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-201a9d77b2e238cb2f8c2c952b00b976608e2a53fe4230369e801971fda29edc.yml From 59e5b54d6b31b4708193dd5dc546f15e87c7afde Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 15:48:43 +0000 Subject: [PATCH 142/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index b74f67c14ad..e34d25c4704 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-201a9d77b2e238cb2f8c2c952b00b976608e2a53fe4230369e801971fda29edc.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6395dc43a1d7d31aa6ecc5428acf7cff96531b1a9cb83f350919711c232acfd0.yml From 7e7052ae116ccaef405d0f3d88e6fc3fedbb9adf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 15:59:17 +0000 Subject: [PATCH 143/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index e34d25c4704..b74f67c14ad 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6395dc43a1d7d31aa6ecc5428acf7cff96531b1a9cb83f350919711c232acfd0.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-201a9d77b2e238cb2f8c2c952b00b976608e2a53fe4230369e801971fda29edc.yml From 8fc517a2d6189462a3baf9d8131263aa53bea66a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 16:27:37 +0000 Subject: [PATCH 144/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index b74f67c14ad..e34d25c4704 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-201a9d77b2e238cb2f8c2c952b00b976608e2a53fe4230369e801971fda29edc.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6395dc43a1d7d31aa6ecc5428acf7cff96531b1a9cb83f350919711c232acfd0.yml From e361a1b022a8e170895f2f436989492f3ebcbdd7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 16:53:54 +0000 Subject: [PATCH 145/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index e34d25c4704..b74f67c14ad 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6395dc43a1d7d31aa6ecc5428acf7cff96531b1a9cb83f350919711c232acfd0.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-201a9d77b2e238cb2f8c2c952b00b976608e2a53fe4230369e801971fda29edc.yml From f014b76b95396edaa29d861aed703c37badb59cc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 17:54:37 +0000 Subject: [PATCH 146/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index b74f67c14ad..9ad4dc4c2e1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-201a9d77b2e238cb2f8c2c952b00b976608e2a53fe4230369e801971fda29edc.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a19d8d47ccadec52630bf49d288b1a7a6280e882e04cc46b6e3a58291cdb06fb.yml From af0e354d6c5d1e0a897e2aac59a8c5ad8372d35a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 17:57:30 +0000 Subject: [PATCH 147/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 9ad4dc4c2e1..967136e2693 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a19d8d47ccadec52630bf49d288b1a7a6280e882e04cc46b6e3a58291cdb06fb.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-82aac706b43af82bd7c06d6cef2d6f60c990a3abcb92fbf03f8630c33289d8a3.yml From 02f5c176bdba4d27134324016902bd5625e60a91 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 18:03:11 +0000 Subject: [PATCH 148/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 967136e2693..9ad4dc4c2e1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-82aac706b43af82bd7c06d6cef2d6f60c990a3abcb92fbf03f8630c33289d8a3.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a19d8d47ccadec52630bf49d288b1a7a6280e882e04cc46b6e3a58291cdb06fb.yml From 18a34774dafe9701e6649fb8d73dcc907b0fdce0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 18:26:49 +0000 Subject: [PATCH 149/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 9ad4dc4c2e1..9a0c2ddc629 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a19d8d47ccadec52630bf49d288b1a7a6280e882e04cc46b6e3a58291cdb06fb.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8ef1a7fe5223e49933f0d60ed667ec0ce2e2717cc5b07918d7b4e42dc535759d.yml From c4c3100ea4b82ed1e29c016f73943ae30ad3bf26 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 18:29:46 +0000 Subject: [PATCH 150/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 9a0c2ddc629..46e06abaa99 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8ef1a7fe5223e49933f0d60ed667ec0ce2e2717cc5b07918d7b4e42dc535759d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-40165530c887a08f6ef6b26f040d1786794364b8d273a3fbdd8ec46b81db462c.yml From a8db6015b11a26aaba85e12e2ebaeb6921e33621 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 18:40:26 +0000 Subject: [PATCH 151/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 46e06abaa99..9a0c2ddc629 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-40165530c887a08f6ef6b26f040d1786794364b8d273a3fbdd8ec46b81db462c.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8ef1a7fe5223e49933f0d60ed667ec0ce2e2717cc5b07918d7b4e42dc535759d.yml From ab45e5c4a955fb5af4174a0c2f713978953c9717 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 19:22:30 +0000 Subject: [PATCH 152/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 9a0c2ddc629..46e06abaa99 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8ef1a7fe5223e49933f0d60ed667ec0ce2e2717cc5b07918d7b4e42dc535759d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-40165530c887a08f6ef6b26f040d1786794364b8d273a3fbdd8ec46b81db462c.yml From cf47166bd104ea59d24aeb90df82f0376f20e057 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 20:18:27 +0000 Subject: [PATCH 153/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 46e06abaa99..9a0c2ddc629 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-40165530c887a08f6ef6b26f040d1786794364b8d273a3fbdd8ec46b81db462c.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8ef1a7fe5223e49933f0d60ed667ec0ce2e2717cc5b07918d7b4e42dc535759d.yml From 3722cde92751fa71afd6525a940eda7fc3ee9a69 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 21:20:29 +0000 Subject: [PATCH 154/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 9a0c2ddc629..cbeb490bcbd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8ef1a7fe5223e49933f0d60ed667ec0ce2e2717cc5b07918d7b4e42dc535759d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e4e4fe20b25c825f2c21322b8909758f1a84f25cfe0df7ce34571b8a2f2be1c1.yml From 9be71a80202976d624d8a33bb74ae27e12ab596d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 21:57:22 +0000 Subject: [PATCH 155/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index cbeb490bcbd..3efdcbc6efb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e4e4fe20b25c825f2c21322b8909758f1a84f25cfe0df7ce34571b8a2f2be1c1.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ad33415b2a28468e4f737c91634307241a6259352549fa5696d1d81548b9b501.yml From 86b031300da3bcc7a7abec974b39c2b6b7cc1731 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 23:10:55 +0000 Subject: [PATCH 156/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 3efdcbc6efb..cbeb490bcbd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ad33415b2a28468e4f737c91634307241a6259352549fa5696d1d81548b9b501.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e4e4fe20b25c825f2c21322b8909758f1a84f25cfe0df7ce34571b8a2f2be1c1.yml From 5c345391421f38d3a1ef6d1c1d6432b07acdc8e7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 02:08:35 +0000 Subject: [PATCH 157/358] feat(roles): enable correct pagination parameters (#2441) --- .stats.yml | 2 +- api.md | 2 +- src/cloudflare/resources/accounts/roles.py | 48 ++++++++++++++++--- src/cloudflare/types/accounts/__init__.py | 1 + .../types/accounts/role_list_params.py | 18 +++++++ tests/api_resources/accounts/test_roles.py | 32 ++++++++++--- 6 files changed, 87 insertions(+), 16 deletions(-) create mode 100644 src/cloudflare/types/accounts/role_list_params.py diff --git a/.stats.yml b/.stats.yml index cbeb490bcbd..c3ce53a2b87 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e4e4fe20b25c825f2c21322b8909758f1a84f25cfe0df7ce34571b8a2f2be1c1.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4c85e60ad7ca96a7ddadf88e1e3c7b62fb791d39d435bedfe6caac2c27081a48.yml diff --git a/api.md b/api.md index 6ec5ac010ec..4c7bdec1853 100644 --- a/api.md +++ b/api.md @@ -65,7 +65,7 @@ Methods: Methods: -- client.accounts.roles.list(\*, account_id) -> SyncSinglePage[Role] +- client.accounts.roles.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[Role] - client.accounts.roles.get(role_id, \*, account_id) -> Optional[Role] ## Subscriptions diff --git a/src/cloudflare/resources/accounts/roles.py b/src/cloudflare/resources/accounts/roles.py index d7ef52252b4..8c49fb115a9 100644 --- a/src/cloudflare/resources/accounts/roles.py +++ b/src/cloudflare/resources/accounts/roles.py @@ -7,6 +7,7 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -16,8 +17,9 @@ async_to_streamed_response_wrapper, ) from ..._wrappers import ResultWrapper -from ...pagination import SyncSinglePage, AsyncSinglePage +from ...pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ..._base_client import AsyncPaginator, make_request_options +from ...types.accounts import role_list_params from ...types.shared.role import Role __all__ = ["RolesResource", "AsyncRolesResource"] @@ -47,19 +49,25 @@ def list( self, *, account_id: str, + page: float | NotGiven = NOT_GIVEN, + per_page: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[Role]: + ) -> SyncV4PagePaginationArray[Role]: """ Get all available roles for an account. Args: account_id: Account identifier tag. + page: Page number of paginated results. + + per_page: Number of roles per page. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -72,9 +80,19 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/roles", - page=SyncSinglePage[Role], + page=SyncV4PagePaginationArray[Role], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "page": page, + "per_page": per_page, + }, + role_list_params.RoleListParams, + ), ), model=Role, ) @@ -148,19 +166,25 @@ def list( self, *, account_id: str, + page: float | NotGiven = NOT_GIVEN, + per_page: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[Role, AsyncSinglePage[Role]]: + ) -> AsyncPaginator[Role, AsyncV4PagePaginationArray[Role]]: """ Get all available roles for an account. Args: account_id: Account identifier tag. + page: Page number of paginated results. + + per_page: Number of roles per page. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -173,9 +197,19 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/roles", - page=AsyncSinglePage[Role], + page=AsyncV4PagePaginationArray[Role], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "page": page, + "per_page": per_page, + }, + role_list_params.RoleListParams, + ), ), model=Role, ) diff --git a/src/cloudflare/types/accounts/__init__.py b/src/cloudflare/types/accounts/__init__.py index b9452666fc2..7185ea93d97 100644 --- a/src/cloudflare/types/accounts/__init__.py +++ b/src/cloudflare/types/accounts/__init__.py @@ -4,6 +4,7 @@ from .status import Status as Status from .account import Account as Account +from .role_list_params import RoleListParams as RoleListParams from .token_list_params import TokenListParams as TokenListParams from .member_list_params import MemberListParams as MemberListParams from .account_list_params import AccountListParams as AccountListParams diff --git a/src/cloudflare/types/accounts/role_list_params.py b/src/cloudflare/types/accounts/role_list_params.py new file mode 100644 index 00000000000..d4e5289bbec --- /dev/null +++ b/src/cloudflare/types/accounts/role_list_params.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["RoleListParams"] + + +class RoleListParams(TypedDict, total=False): + account_id: Required[str] + """Account identifier tag.""" + + page: float + """Page number of paginated results.""" + + per_page: float + """Number of roles per page.""" diff --git a/tests/api_resources/accounts/test_roles.py b/tests/api_resources/accounts/test_roles.py index 95df57ae04f..18aac24e26f 100644 --- a/tests/api_resources/accounts/test_roles.py +++ b/tests/api_resources/accounts/test_roles.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from cloudflare.types.shared import Role base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +23,16 @@ def test_method_list(self, client: Cloudflare) -> None: role = client.accounts.roles.list( account_id="eb78d65290b24279ba6f44721b3ea3c4", ) - assert_matches_type(SyncSinglePage[Role], role, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Role], role, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + role = client.accounts.roles.list( + account_id="eb78d65290b24279ba6f44721b3ea3c4", + page=1, + per_page=5, + ) + assert_matches_type(SyncV4PagePaginationArray[Role], role, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: @@ -34,7 +43,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" role = response.parse() - assert_matches_type(SyncSinglePage[Role], role, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Role], role, path=["response"]) @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: @@ -45,7 +54,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" role = response.parse() - assert_matches_type(SyncSinglePage[Role], role, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Role], role, path=["response"]) assert cast(Any, response.is_closed) is True @@ -113,7 +122,16 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: role = await async_client.accounts.roles.list( account_id="eb78d65290b24279ba6f44721b3ea3c4", ) - assert_matches_type(AsyncSinglePage[Role], role, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Role], role, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + role = await async_client.accounts.roles.list( + account_id="eb78d65290b24279ba6f44721b3ea3c4", + page=1, + per_page=5, + ) + assert_matches_type(AsyncV4PagePaginationArray[Role], role, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @@ -124,7 +142,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" role = await response.parse() - assert_matches_type(AsyncSinglePage[Role], role, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Role], role, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: @@ -135,7 +153,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" role = await response.parse() - assert_matches_type(AsyncSinglePage[Role], role, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Role], role, path=["response"]) assert cast(Any, response.is_closed) is True From fa77ae732d8e09acec28f74343c31aec2ca0879b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 06:23:47 +0000 Subject: [PATCH 158/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index c3ce53a2b87..34fa80bcbac 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4c85e60ad7ca96a7ddadf88e1e3c7b62fb791d39d435bedfe6caac2c27081a48.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-da7f43f226076ec6177b787810ce7161d3c369e7178a503565c805e678cdb58f.yml From 5cb60b5adafb14068d66eb25f84cd3586c0a05eb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 09:26:33 +0000 Subject: [PATCH 159/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 34fa80bcbac..c3ce53a2b87 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-da7f43f226076ec6177b787810ce7161d3c369e7178a503565c805e678cdb58f.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4c85e60ad7ca96a7ddadf88e1e3c7b62fb791d39d435bedfe6caac2c27081a48.yml From 87f05acb20f20fba104b0f372644da99f0010d3b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 15:16:32 +0000 Subject: [PATCH 160/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index c3ce53a2b87..34fa80bcbac 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4c85e60ad7ca96a7ddadf88e1e3c7b62fb791d39d435bedfe6caac2c27081a48.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-da7f43f226076ec6177b787810ce7161d3c369e7178a503565c805e678cdb58f.yml From 0378708a90684fe96801bc7ff4bf9f5c0437aeb1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 17:48:15 +0000 Subject: [PATCH 161/358] feat(api): api update (#2442) --- .stats.yml | 2 +- .../resources/zero_trust/dlp/profiles/custom.py | 10 ++++++++++ .../resources/zero_trust/dlp/profiles/predefined.py | 4 ++++ .../types/zero_trust/dlp/entry_get_response.py | 2 ++ .../types/zero_trust/dlp/entry_list_response.py | 2 ++ .../types/zero_trust/dlp/entry_update_response.py | 2 ++ src/cloudflare/types/zero_trust/dlp/profile.py | 10 ++++++++++ .../zero_trust/dlp/profiles/custom_create_params.py | 4 ++++ .../zero_trust/dlp/profiles/custom_create_response.py | 10 ++++++++++ .../zero_trust/dlp/profiles/custom_update_params.py | 2 ++ .../dlp/profiles/predefined_update_params.py | 2 ++ .../zero_trust/dlp/profiles/test_custom.py | 4 ++++ .../zero_trust/dlp/profiles/test_predefined.py | 2 ++ 13 files changed, 55 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 34fa80bcbac..343122b3abc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-da7f43f226076ec6177b787810ce7161d3c369e7178a503565c805e678cdb58f.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6ce4ac81a963524d955668d167df40ff990317398073943d13daa6a4d068edf5.yml diff --git a/src/cloudflare/resources/zero_trust/dlp/profiles/custom.py b/src/cloudflare/resources/zero_trust/dlp/profiles/custom.py index bfb1ddd4b52..d5d5cc6af37 100644 --- a/src/cloudflare/resources/zero_trust/dlp/profiles/custom.py +++ b/src/cloudflare/resources/zero_trust/dlp/profiles/custom.py @@ -85,6 +85,7 @@ def create( account_id: str, entries: Iterable[custom_create_params.DLPNewCustomProfileEntry], name: str, + ai_context_enabled: bool | NotGiven = NOT_GIVEN, allowed_match_count: int | NotGiven = NOT_GIVEN, confidence_threshold: Optional[str] | NotGiven = NOT_GIVEN, context_awareness: ContextAwarenessParam | NotGiven = NOT_GIVEN, @@ -130,6 +131,7 @@ def create( profiles: Iterable[custom_create_params.Variant0Profile] | NotGiven = NOT_GIVEN, entries: Iterable[custom_create_params.DLPNewCustomProfileEntry] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, + ai_context_enabled: bool | NotGiven = NOT_GIVEN, allowed_match_count: int | NotGiven = NOT_GIVEN, confidence_threshold: Optional[str] | NotGiven = NOT_GIVEN, context_awareness: ContextAwarenessParam | NotGiven = NOT_GIVEN, @@ -154,6 +156,7 @@ def create( "profiles": profiles, "entries": entries, "name": name, + "ai_context_enabled": ai_context_enabled, "allowed_match_count": allowed_match_count, "confidence_threshold": confidence_threshold, "context_awareness": context_awareness, @@ -182,6 +185,7 @@ def update( *, account_id: str, name: str, + ai_context_enabled: bool | NotGiven = NOT_GIVEN, allowed_match_count: Optional[int] | NotGiven = NOT_GIVEN, confidence_threshold: Optional[str] | NotGiven = NOT_GIVEN, context_awareness: ContextAwarenessParam | NotGiven = NOT_GIVEN, @@ -229,6 +233,7 @@ def update( body=maybe_transform( { "name": name, + "ai_context_enabled": ai_context_enabled, "allowed_match_count": allowed_match_count, "confidence_threshold": confidence_threshold, "context_awareness": context_awareness, @@ -392,6 +397,7 @@ async def create( account_id: str, entries: Iterable[custom_create_params.DLPNewCustomProfileEntry], name: str, + ai_context_enabled: bool | NotGiven = NOT_GIVEN, allowed_match_count: int | NotGiven = NOT_GIVEN, confidence_threshold: Optional[str] | NotGiven = NOT_GIVEN, context_awareness: ContextAwarenessParam | NotGiven = NOT_GIVEN, @@ -437,6 +443,7 @@ async def create( profiles: Iterable[custom_create_params.Variant0Profile] | NotGiven = NOT_GIVEN, entries: Iterable[custom_create_params.DLPNewCustomProfileEntry] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, + ai_context_enabled: bool | NotGiven = NOT_GIVEN, allowed_match_count: int | NotGiven = NOT_GIVEN, confidence_threshold: Optional[str] | NotGiven = NOT_GIVEN, context_awareness: ContextAwarenessParam | NotGiven = NOT_GIVEN, @@ -461,6 +468,7 @@ async def create( "profiles": profiles, "entries": entries, "name": name, + "ai_context_enabled": ai_context_enabled, "allowed_match_count": allowed_match_count, "confidence_threshold": confidence_threshold, "context_awareness": context_awareness, @@ -489,6 +497,7 @@ async def update( *, account_id: str, name: str, + ai_context_enabled: bool | NotGiven = NOT_GIVEN, allowed_match_count: Optional[int] | NotGiven = NOT_GIVEN, confidence_threshold: Optional[str] | NotGiven = NOT_GIVEN, context_awareness: ContextAwarenessParam | NotGiven = NOT_GIVEN, @@ -536,6 +545,7 @@ async def update( body=await async_maybe_transform( { "name": name, + "ai_context_enabled": ai_context_enabled, "allowed_match_count": allowed_match_count, "confidence_threshold": confidence_threshold, "context_awareness": context_awareness, diff --git a/src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py b/src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py index 0ed1ed1b4da..6b0e4c277a4 100644 --- a/src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py +++ b/src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py @@ -54,6 +54,7 @@ def update( *, account_id: str, entries: Iterable[predefined_update_params.Entry], + ai_context_enabled: bool | NotGiven = NOT_GIVEN, allowed_match_count: Optional[int] | NotGiven = NOT_GIVEN, confidence_threshold: Optional[str] | NotGiven = NOT_GIVEN, context_awareness: ContextAwarenessParam | NotGiven = NOT_GIVEN, @@ -92,6 +93,7 @@ def update( body=maybe_transform( { "entries": entries, + "ai_context_enabled": ai_context_enabled, "allowed_match_count": allowed_match_count, "confidence_threshold": confidence_threshold, "context_awareness": context_awareness, @@ -184,6 +186,7 @@ async def update( *, account_id: str, entries: Iterable[predefined_update_params.Entry], + ai_context_enabled: bool | NotGiven = NOT_GIVEN, allowed_match_count: Optional[int] | NotGiven = NOT_GIVEN, confidence_threshold: Optional[str] | NotGiven = NOT_GIVEN, context_awareness: ContextAwarenessParam | NotGiven = NOT_GIVEN, @@ -222,6 +225,7 @@ async def update( body=await async_maybe_transform( { "entries": entries, + "ai_context_enabled": ai_context_enabled, "allowed_match_count": allowed_match_count, "confidence_threshold": confidence_threshold, "context_awareness": context_awareness, diff --git a/src/cloudflare/types/zero_trust/dlp/entry_get_response.py b/src/cloudflare/types/zero_trust/dlp/entry_get_response.py index 0b88f2a8d76..fa0a4958b5b 100644 --- a/src/cloudflare/types/zero_trust/dlp/entry_get_response.py +++ b/src/cloudflare/types/zero_trust/dlp/entry_get_response.py @@ -37,6 +37,8 @@ class CustomEntry(BaseModel): class PredefinedEntryConfidence(BaseModel): + ai_context_available: bool + available: bool """ Indicates whether this entry can be made more or less sensitive by setting a diff --git a/src/cloudflare/types/zero_trust/dlp/entry_list_response.py b/src/cloudflare/types/zero_trust/dlp/entry_list_response.py index 0f9751b42cf..ebb18ace220 100644 --- a/src/cloudflare/types/zero_trust/dlp/entry_list_response.py +++ b/src/cloudflare/types/zero_trust/dlp/entry_list_response.py @@ -37,6 +37,8 @@ class CustomEntry(BaseModel): class PredefinedEntryConfidence(BaseModel): + ai_context_available: bool + available: bool """ Indicates whether this entry can be made more or less sensitive by setting a diff --git a/src/cloudflare/types/zero_trust/dlp/entry_update_response.py b/src/cloudflare/types/zero_trust/dlp/entry_update_response.py index acaa3686d63..c35ef9a00a3 100644 --- a/src/cloudflare/types/zero_trust/dlp/entry_update_response.py +++ b/src/cloudflare/types/zero_trust/dlp/entry_update_response.py @@ -37,6 +37,8 @@ class CustomEntry(BaseModel): class PredefinedEntryConfidence(BaseModel): + ai_context_available: bool + available: bool """ Indicates whether this entry can be made more or less sensitive by setting a diff --git a/src/cloudflare/types/zero_trust/dlp/profile.py b/src/cloudflare/types/zero_trust/dlp/profile.py index 5da04fc0c81..ad31b65a016 100644 --- a/src/cloudflare/types/zero_trust/dlp/profile.py +++ b/src/cloudflare/types/zero_trust/dlp/profile.py @@ -57,6 +57,8 @@ class CustomProfileEntryCustomEntry(BaseModel): class CustomProfileEntryPredefinedEntryConfidence(BaseModel): + ai_context_available: bool + available: bool """ Indicates whether this entry can be made more or less sensitive by setting a @@ -166,6 +168,8 @@ class CustomProfile(BaseModel): updated_at: datetime """When the profile was lasted updated""" + ai_context_enabled: Optional[bool] = None + confidence_threshold: Optional[Literal["low", "medium", "high", "very_high"]] = None description: Optional[str] = None @@ -191,6 +195,8 @@ class PredefinedProfileEntryCustomEntry(BaseModel): class PredefinedProfileEntryPredefinedEntryConfidence(BaseModel): + ai_context_available: bool + available: bool """ Indicates whether this entry can be made more or less sensitive by setting a @@ -285,6 +291,8 @@ class PredefinedProfile(BaseModel): type: Literal["predefined"] + ai_context_enabled: Optional[bool] = None + confidence_threshold: Optional[Literal["low", "medium", "high", "very_high"]] = None context_awareness: Optional[ContextAwareness] = None @@ -318,6 +326,8 @@ class IntegrationProfileEntryCustomEntry(BaseModel): class IntegrationProfileEntryPredefinedEntryConfidence(BaseModel): + ai_context_available: bool + available: bool """ Indicates whether this entry can be made more or less sensitive by setting a diff --git a/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_params.py b/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_params.py index 11c63909781..a7e16531f88 100644 --- a/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_params.py +++ b/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_params.py @@ -102,6 +102,8 @@ class Variant0Profile(TypedDict, total=False): name: Required[str] + ai_context_enabled: bool + allowed_match_count: int """Related DLP policies will trigger when the match count exceeds the number set.""" @@ -133,6 +135,8 @@ class DLPNewCustomProfile(TypedDict, total=False): name: Required[str] + ai_context_enabled: bool + allowed_match_count: int """Related DLP policies will trigger when the match count exceeds the number set.""" diff --git a/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_response.py b/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_response.py index 4ff24e14cb9..eb02589e536 100644 --- a/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_response.py +++ b/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_response.py @@ -57,6 +57,8 @@ class CustomProfileEntryCustomEntry(BaseModel): class CustomProfileEntryPredefinedEntryConfidence(BaseModel): + ai_context_available: bool + available: bool """ Indicates whether this entry can be made more or less sensitive by setting a @@ -166,6 +168,8 @@ class CustomProfile(BaseModel): updated_at: datetime """When the profile was lasted updated""" + ai_context_enabled: Optional[bool] = None + confidence_threshold: Optional[Literal["low", "medium", "high", "very_high"]] = None description: Optional[str] = None @@ -191,6 +195,8 @@ class PredefinedProfileEntryCustomEntry(BaseModel): class PredefinedProfileEntryPredefinedEntryConfidence(BaseModel): + ai_context_available: bool + available: bool """ Indicates whether this entry can be made more or less sensitive by setting a @@ -285,6 +291,8 @@ class PredefinedProfile(BaseModel): type: Literal["predefined"] + ai_context_enabled: Optional[bool] = None + confidence_threshold: Optional[Literal["low", "medium", "high", "very_high"]] = None context_awareness: Optional[ContextAwareness] = None @@ -318,6 +326,8 @@ class IntegrationProfileEntryCustomEntry(BaseModel): class IntegrationProfileEntryPredefinedEntryConfidence(BaseModel): + ai_context_available: bool + available: bool """ Indicates whether this entry can be made more or less sensitive by setting a diff --git a/src/cloudflare/types/zero_trust/dlp/profiles/custom_update_params.py b/src/cloudflare/types/zero_trust/dlp/profiles/custom_update_params.py index 636502f5379..0abc0845f46 100644 --- a/src/cloudflare/types/zero_trust/dlp/profiles/custom_update_params.py +++ b/src/cloudflare/types/zero_trust/dlp/profiles/custom_update_params.py @@ -25,6 +25,8 @@ class CustomUpdateParams(TypedDict, total=False): name: Required[str] + ai_context_enabled: bool + allowed_match_count: Optional[int] confidence_threshold: Optional[str] diff --git a/src/cloudflare/types/zero_trust/dlp/profiles/predefined_update_params.py b/src/cloudflare/types/zero_trust/dlp/profiles/predefined_update_params.py index afc9ae2ad45..0085792d8df 100644 --- a/src/cloudflare/types/zero_trust/dlp/profiles/predefined_update_params.py +++ b/src/cloudflare/types/zero_trust/dlp/profiles/predefined_update_params.py @@ -15,6 +15,8 @@ class PredefinedUpdateParams(TypedDict, total=False): entries: Required[Iterable[Entry]] + ai_context_enabled: bool + allowed_match_count: Optional[int] confidence_threshold: Optional[str] diff --git a/tests/api_resources/zero_trust/dlp/profiles/test_custom.py b/tests/api_resources/zero_trust/dlp/profiles/test_custom.py index 36fd45b8f25..36b3ddbb2a1 100644 --- a/tests/api_resources/zero_trust/dlp/profiles/test_custom.py +++ b/tests/api_resources/zero_trust/dlp/profiles/test_custom.py @@ -134,6 +134,7 @@ def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> N } ], name="name", + ai_context_enabled=True, allowed_match_count=5, confidence_threshold="confidence_threshold", context_awareness={ @@ -222,6 +223,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", account_id="account_id", name="name", + ai_context_enabled=True, allowed_match_count=0, confidence_threshold="confidence_threshold", context_awareness={ @@ -511,6 +513,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn } ], name="name", + ai_context_enabled=True, allowed_match_count=5, confidence_threshold="confidence_threshold", context_awareness={ @@ -599,6 +602,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", account_id="account_id", name="name", + ai_context_enabled=True, allowed_match_count=0, confidence_threshold="confidence_threshold", context_awareness={ diff --git a/tests/api_resources/zero_trust/dlp/profiles/test_predefined.py b/tests/api_resources/zero_trust/dlp/profiles/test_predefined.py index d9a8e2091cf..41cc3323d37 100644 --- a/tests/api_resources/zero_trust/dlp/profiles/test_predefined.py +++ b/tests/api_resources/zero_trust/dlp/profiles/test_predefined.py @@ -42,6 +42,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "enabled": True, } ], + ai_context_enabled=True, allowed_match_count=0, confidence_threshold="confidence_threshold", context_awareness={ @@ -193,6 +194,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "enabled": True, } ], + ai_context_enabled=True, allowed_match_count=0, confidence_threshold="confidence_threshold", context_awareness={ From 81783bbbe83e721ab2a8adf8a730ccc8d53dae4a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 19:48:59 +0000 Subject: [PATCH 162/358] chore(internal): codegen related update (#2443) --- api.md | 58 +++-- .../resources/accounts/subscriptions.py | 13 +- .../resources/api_gateway/configurations.py | 8 - .../api_gateway/discovery/discovery.py | 4 - .../api_gateway/discovery/operations.py | 16 -- .../expression_template/fallthrough.py | 4 - .../api_gateway/operations/operations.py | 24 -- .../operations/schema_validation.py | 12 - .../resources/api_gateway/schemas.py | 4 - .../api_gateway/settings/schema_validation.py | 12 - .../api_gateway/user_schemas/hosts.py | 4 - .../api_gateway/user_schemas/operations.py | 4 - .../api_gateway/user_schemas/user_schemas.py | 20 -- src/cloudflare/resources/dns/records.py | 5 +- src/cloudflare/resources/email_routing/dns.py | 25 +- .../resources/email_routing/email_routing.py | 37 ++- .../resources/email_routing/rules/rules.py | 48 ++-- src/cloudflare/resources/firewall/ua_rules.py | 13 +- .../leaked_credential_checks/detections.py | 16 ++ src/cloudflare/resources/registrar/domains.py | 13 +- src/cloudflare/resources/zones/rate_plans.py | 13 +- .../api_gateway/configuration_get_params.py | 1 - .../configuration_update_params.py | 1 - .../discovery/operation_bulk_edit_params.py | 1 - .../discovery/operation_edit_params.py | 1 - .../discovery/operation_list_params.py | 1 - .../api_gateway/discovery_get_response.py | 3 +- .../types/api_gateway/discovery_operation.py | 3 +- .../fallthrough_create_params.py | 1 - .../operation_bulk_create_params.py | 1 - .../operation_bulk_create_response.py | 4 +- .../api_gateway/operation_create_params.py | 1 - .../api_gateway/operation_create_response.py | 4 +- .../types/api_gateway/operation_get_params.py | 1 - .../api_gateway/operation_get_response.py | 4 +- .../api_gateway/operation_list_params.py | 1 - .../api_gateway/operation_list_response.py | 4 +- .../schema_validation_edit_params.py | 1 - .../schema_validation_update_params.py | 1 - .../types/api_gateway/public_schema.py | 4 +- .../types/api_gateway/schema_list_params.py | 1 - .../settings/schema_validation_edit_params.py | 1 - .../schema_validation_update_params.py | 1 - .../api_gateway/user_schema_create_params.py | 1 - .../api_gateway/user_schema_edit_params.py | 1 - .../api_gateway/user_schema_get_params.py | 1 - .../api_gateway/user_schema_list_params.py | 1 - .../user_schemas/host_list_params.py | 1 - .../user_schemas/host_list_response.py | 4 +- .../user_schemas/operation_list_params.py | 1 - .../user_schemas/operation_list_response.py | 4 +- .../payload_create_response.py | 2 +- .../payload_delete_response.py | 2 +- .../content_scanning/payload_list_response.py | 2 +- .../custom_certificates/custom_certificate.py | 3 +- src/cloudflare/types/dns/batch_patch_param.py | 231 +----------------- src/cloudflare/types/dns/batch_put_param.py | 231 +----------------- .../types/dns/record_batch_params.py | 3 +- .../types/email_routing/__init__.py | 1 - .../types/email_routing/settings.py | 38 --- src/cloudflare/types/firewall/__init__.py | 1 - .../types/firewall/ua_rule_list_response.py | 39 --- .../types/hyperdrive/config_create_params.py | 8 +- .../types/hyperdrive/config_edit_params.py | 8 +- .../types/hyperdrive/config_update_params.py | 8 +- src/cloudflare/types/hyperdrive/hyperdrive.py | 8 +- src/cloudflare/types/intel/domain.py | 41 +--- .../types/intel/domains/bulk_get_response.py | 33 +-- .../detection_create_params.py | 3 + .../detection_create_response.py | 2 +- .../detection_list_response.py | 2 +- .../detection_update_params.py | 3 + .../detection_update_response.py | 2 +- .../types/magic_transit/__init__.py | 1 - .../cf_interconnect_bulk_update_response.py | 3 +- .../cf_interconnect_get_response.py | 3 +- .../cf_interconnect_list_response.py | 3 +- .../cf_interconnect_update_response.py | 3 +- .../types/magic_transit/health_check.py | 52 ---- .../types/memberships/membership.py | 3 +- .../memberships/membership_get_response.py | 3 +- .../memberships/membership_update_response.py | 3 +- src/cloudflare/types/registrar/__init__.py | 1 - src/cloudflare/types/registrar/domain.py | 116 --------- .../analytics/events/bytime_get_response.py | 4 +- .../analytics/events/summary_get_response.py | 4 +- .../types/spectrum/app_create_response.py | 6 +- .../types/spectrum/app_get_response.py | 6 +- .../types/spectrum/app_list_response.py | 6 +- .../types/spectrum/app_update_response.py | 6 +- .../types/workers/scripts/__init__.py | 1 - .../types/workers/scripts/schedule.py | 15 -- .../workers/scripts/schedule_get_response.py | 3 +- .../scripts/schedule_update_response.py | 3 +- .../users/active_session_get_response.py | 3 +- .../zero_trust/devices/device_network.py | 19 +- src/cloudflare/types/zones/__init__.py | 1 - .../types/zones/rate_plan_get_response.py | 39 --- .../accounts/test_subscriptions.py | 13 +- .../api_gateway/discovery/test_operations.py | 68 +++--- .../expression_template/test_fallthrough.py | 12 +- .../operations/test_schema_validation.py | 48 ++-- .../settings/test_schema_validation.py | 44 ++-- .../api_gateway/test_configurations.py | 28 +-- .../api_gateway/test_discovery.py | 12 +- .../api_gateway/test_operations.py | 88 +++---- .../api_resources/api_gateway/test_schemas.py | 16 +- .../api_gateway/test_user_schemas.py | 88 +++---- .../api_gateway/user_schemas/test_hosts.py | 16 +- .../user_schemas/test_operations.py | 20 +- tests/api_resources/dns/test_records.py | 100 +------- tests/api_resources/email_routing/test_dns.py | 32 ++- .../api_resources/email_routing/test_rules.py | 58 ++--- tests/api_resources/firewall/test_ua_rules.py | 17 +- .../api_resources/hyperdrive/test_configs.py | 36 ++- .../test_detections.py | 4 + tests/api_resources/registrar/test_domains.py | 13 +- tests/api_resources/test_email_routing.py | 39 ++- tests/api_resources/zones/test_rate_plans.py | 13 +- 119 files changed, 553 insertions(+), 1598 deletions(-) delete mode 100644 src/cloudflare/types/email_routing/settings.py delete mode 100644 src/cloudflare/types/firewall/ua_rule_list_response.py delete mode 100644 src/cloudflare/types/magic_transit/health_check.py delete mode 100644 src/cloudflare/types/registrar/domain.py delete mode 100644 src/cloudflare/types/workers/scripts/schedule.py delete mode 100644 src/cloudflare/types/zones/rate_plan_get_response.py diff --git a/api.md b/api.md index 4c7bdec1853..3a3522c1b4f 100644 --- a/api.md +++ b/api.md @@ -77,6 +77,7 @@ from cloudflare.types.accounts import ( SubscriptionCreateResponse, SubscriptionUpdateResponse, SubscriptionDeleteResponse, + SubscriptionGetResponse, ) ``` @@ -85,7 +86,7 @@ Methods: - client.accounts.subscriptions.create(\*, account_id, \*\*params) -> SubscriptionCreateResponse - client.accounts.subscriptions.update(subscription_identifier, \*, account_id, \*\*params) -> SubscriptionUpdateResponse - client.accounts.subscriptions.delete(subscription_identifier, \*, account_id) -> SubscriptionDeleteResponse -- client.accounts.subscriptions.get(\*, account_id) -> SyncSinglePage[Subscription] +- client.accounts.subscriptions.get(\*, account_id) -> SyncSinglePage[object] ## Tokens @@ -472,7 +473,7 @@ from cloudflare.types.zones import RatePlanGetResponse Methods: -- client.zones.rate_plans.get(\*, zone_id) -> SyncSinglePage[RatePlanGetResponse] +- client.zones.rate_plans.get(\*, zone_id) -> SyncSinglePage[object] # LoadBalancers @@ -1534,28 +1535,38 @@ Methods: Types: ```python -from cloudflare.types.email_routing import Settings +from cloudflare.types.email_routing import ( + Settings, + EmailRoutingDisableResponse, + EmailRoutingEnableResponse, + EmailRoutingGetResponse, +) ``` Methods: -- client.email_routing.disable(\*, zone_id, \*\*params) -> Optional[Settings] -- client.email_routing.enable(\*, zone_id, \*\*params) -> Optional[Settings] -- client.email_routing.get(\*, zone_id) -> Optional[Settings] +- client.email_routing.disable(\*, zone_id, \*\*params) -> object +- client.email_routing.enable(\*, zone_id, \*\*params) -> object +- client.email_routing.get(\*, zone_id) -> object ## DNS Types: ```python -from cloudflare.types.email_routing import DNSRecord, DNSGetResponse +from cloudflare.types.email_routing import ( + DNSRecord, + DNSCreateResponse, + DNSEditResponse, + DNSGetResponse, +) ``` Methods: -- client.email_routing.dns.create(\*, zone_id, \*\*params) -> Optional[Settings] +- client.email_routing.dns.create(\*, zone_id, \*\*params) -> object - client.email_routing.dns.delete(\*, zone_id) -> SyncSinglePage[DNSRecord] -- client.email_routing.dns.edit(\*, zone_id, \*\*params) -> Optional[Settings] +- client.email_routing.dns.edit(\*, zone_id, \*\*params) -> object - client.email_routing.dns.get(\*, zone_id, \*\*params) -> DNSGetResponse ## Rules @@ -1563,16 +1574,24 @@ Methods: Types: ```python -from cloudflare.types.email_routing import Action, EmailRoutingRule, Matcher +from cloudflare.types.email_routing import ( + Action, + EmailRoutingRule, + Matcher, + RuleCreateResponse, + RuleUpdateResponse, + RuleDeleteResponse, + RuleGetResponse, +) ``` Methods: -- client.email_routing.rules.create(\*, zone_id, \*\*params) -> Optional[EmailRoutingRule] -- client.email_routing.rules.update(rule_identifier, \*, zone_id, \*\*params) -> Optional[EmailRoutingRule] +- client.email_routing.rules.create(\*, zone_id, \*\*params) -> object +- client.email_routing.rules.update(rule_identifier, \*, zone_id, \*\*params) -> object - client.email_routing.rules.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[EmailRoutingRule] -- client.email_routing.rules.delete(rule_identifier, \*, zone_id) -> Optional[EmailRoutingRule] -- client.email_routing.rules.get(rule_identifier, \*, zone_id) -> Optional[EmailRoutingRule] +- client.email_routing.rules.delete(rule_identifier, \*, zone_id) -> object +- client.email_routing.rules.get(rule_identifier, \*, zone_id) -> object ### CatchAlls @@ -1715,7 +1734,7 @@ Methods: - client.firewall.ua_rules.create(\*, zone_id, \*\*params) -> UARuleCreateResponse - client.firewall.ua_rules.update(ua_rule_id, \*, zone_id, \*\*params) -> UARuleUpdateResponse -- client.firewall.ua_rules.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[UARuleListResponse] +- client.firewall.ua_rules.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[object] - client.firewall.ua_rules.delete(ua_rule_id, \*, zone_id) -> UARuleDeleteResponse - client.firewall.ua_rules.get(ua_rule_id, \*, zone_id) -> UARuleGetResponse @@ -4159,13 +4178,18 @@ Methods: Types: ```python -from cloudflare.types.registrar import Domain, DomainUpdateResponse, DomainGetResponse +from cloudflare.types.registrar import ( + Domain, + DomainUpdateResponse, + DomainListResponse, + DomainGetResponse, +) ``` Methods: - client.registrar.domains.update(domain_name, \*, account_id, \*\*params) -> object -- client.registrar.domains.list(\*, account_id) -> SyncSinglePage[Domain] +- client.registrar.domains.list(\*, account_id) -> SyncSinglePage[object] - client.registrar.domains.get(domain_name, \*, account_id) -> object # RequestTracers diff --git a/src/cloudflare/resources/accounts/subscriptions.py b/src/cloudflare/resources/accounts/subscriptions.py index 542727c8900..35ac71b5b36 100644 --- a/src/cloudflare/resources/accounts/subscriptions.py +++ b/src/cloudflare/resources/accounts/subscriptions.py @@ -24,7 +24,6 @@ from ...pagination import SyncSinglePage, AsyncSinglePage from ..._base_client import AsyncPaginator, make_request_options from ...types.accounts import subscription_create_params, subscription_update_params -from ...types.shared.subscription import Subscription from ...types.shared_params.rate_plan import RatePlan from ...types.accounts.subscription_create_response import SubscriptionCreateResponse from ...types.accounts.subscription_delete_response import SubscriptionDeleteResponse @@ -230,7 +229,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[Subscription]: + ) -> SyncSinglePage[object]: """ Lists all of an account's subscriptions. @@ -249,11 +248,11 @@ def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/subscriptions", - page=SyncSinglePage[Subscription], + page=SyncSinglePage[object], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=Subscription, + model=object, ) @@ -454,7 +453,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[Subscription, AsyncSinglePage[Subscription]]: + ) -> AsyncPaginator[object, AsyncSinglePage[object]]: """ Lists all of an account's subscriptions. @@ -473,11 +472,11 @@ def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/subscriptions", - page=AsyncSinglePage[Subscription], + page=AsyncSinglePage[object], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=Subscription, + model=object, ) diff --git a/src/cloudflare/resources/api_gateway/configurations.py b/src/cloudflare/resources/api_gateway/configurations.py index 450f5205f0d..676deb86ac8 100644 --- a/src/cloudflare/resources/api_gateway/configurations.py +++ b/src/cloudflare/resources/api_gateway/configurations.py @@ -65,8 +65,6 @@ def update( Set configuration properties Args: - zone_id: Identifier - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -105,8 +103,6 @@ def get( Retrieve information about specific configuration properties Args: - zone_id: Identifier - properties: Requests information about certain properties. extra_headers: Send extra headers @@ -169,8 +165,6 @@ async def update( Set configuration properties Args: - zone_id: Identifier - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -209,8 +203,6 @@ async def get( Retrieve information about specific configuration properties Args: - zone_id: Identifier - properties: Requests information about certain properties. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/api_gateway/discovery/discovery.py b/src/cloudflare/resources/api_gateway/discovery/discovery.py index 9c3152dd49b..21681a59777 100644 --- a/src/cloudflare/resources/api_gateway/discovery/discovery.py +++ b/src/cloudflare/resources/api_gateway/discovery/discovery.py @@ -70,8 +70,6 @@ def get( schemas Args: - zone_id: Identifier - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -135,8 +133,6 @@ async def get( schemas Args: - zone_id: Identifier - extra_headers: Send extra headers extra_query: Add additional query parameters to the request diff --git a/src/cloudflare/resources/api_gateway/discovery/operations.py b/src/cloudflare/resources/api_gateway/discovery/operations.py index f7a8556479a..c819e5e33d7 100644 --- a/src/cloudflare/resources/api_gateway/discovery/operations.py +++ b/src/cloudflare/resources/api_gateway/discovery/operations.py @@ -77,8 +77,6 @@ def list( Retrieve the most up to date view of discovered operations Args: - zone_id: Identifier - diff: When `true`, only return API Discovery results that are not saved into API Shield Endpoint Management @@ -165,8 +163,6 @@ def bulk_edit( Update the `state` on one or more discovered operations Args: - zone_id: Identifier - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -207,10 +203,6 @@ def edit( Update the `state` on a discovered operation Args: - zone_id: Identifier - - operation_id: UUID - state: Mark state of operation in API Discovery - `review` - Mark operation as for review @@ -288,8 +280,6 @@ def list( Retrieve the most up to date view of discovered operations Args: - zone_id: Identifier - diff: When `true`, only return API Discovery results that are not saved into API Shield Endpoint Management @@ -376,8 +366,6 @@ async def bulk_edit( Update the `state` on one or more discovered operations Args: - zone_id: Identifier - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -418,10 +406,6 @@ async def edit( Update the `state` on a discovered operation Args: - zone_id: Identifier - - operation_id: UUID - state: Mark state of operation in API Discovery - `review` - Mark operation as for review diff --git a/src/cloudflare/resources/api_gateway/expression_template/fallthrough.py b/src/cloudflare/resources/api_gateway/expression_template/fallthrough.py index 1cb60fb64c1..600d3b0e0eb 100644 --- a/src/cloudflare/resources/api_gateway/expression_template/fallthrough.py +++ b/src/cloudflare/resources/api_gateway/expression_template/fallthrough.py @@ -63,8 +63,6 @@ def create( Generate fallthrough WAF expression template from a set of API hosts Args: - zone_id: Identifier - hosts: List of hosts to be targeted in the expression extra_headers: Send extra headers @@ -127,8 +125,6 @@ async def create( Generate fallthrough WAF expression template from a set of API hosts Args: - zone_id: Identifier - hosts: List of hosts to be targeted in the expression extra_headers: Send extra headers diff --git a/src/cloudflare/resources/api_gateway/operations/operations.py b/src/cloudflare/resources/api_gateway/operations/operations.py index eae381497ff..8313d6da3c1 100644 --- a/src/cloudflare/resources/api_gateway/operations/operations.py +++ b/src/cloudflare/resources/api_gateway/operations/operations.py @@ -94,8 +94,6 @@ def create( last_updated date. Args: - zone_id: Identifier - endpoint: The endpoint which can contain path parameter templates in curly braces, each will be replaced from left to right with {varN}, starting with {var1}, during insertion. This will further be Cloudflare-normalized upon insertion. See: @@ -158,8 +156,6 @@ def list( Retrieve information about all operations on a zone Args: - zone_id: Identifier - direction: Direction to order results. endpoint: Filter results to only include endpoints containing this pattern. @@ -230,8 +226,6 @@ def delete( Delete an operation Args: - zone_id: Identifier - operation_id: UUID extra_headers: Send extra headers @@ -275,8 +269,6 @@ def bulk_create( its last_updated date. Args: - zone_id: Identifier - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -313,8 +305,6 @@ def bulk_delete( Delete multiple operations Args: - zone_id: Identifier - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -350,8 +340,6 @@ def get( Retrieve information about an operation Args: - zone_id: Identifier - operation_id: UUID feature: Add feature(s) to the results. The feature name that is given here corresponds @@ -431,8 +419,6 @@ async def create( last_updated date. Args: - zone_id: Identifier - endpoint: The endpoint which can contain path parameter templates in curly braces, each will be replaced from left to right with {varN}, starting with {var1}, during insertion. This will further be Cloudflare-normalized upon insertion. See: @@ -495,8 +481,6 @@ def list( Retrieve information about all operations on a zone Args: - zone_id: Identifier - direction: Direction to order results. endpoint: Filter results to only include endpoints containing this pattern. @@ -567,8 +551,6 @@ async def delete( Delete an operation Args: - zone_id: Identifier - operation_id: UUID extra_headers: Send extra headers @@ -612,8 +594,6 @@ def bulk_create( its last_updated date. Args: - zone_id: Identifier - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -650,8 +630,6 @@ async def bulk_delete( Delete multiple operations Args: - zone_id: Identifier - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -687,8 +665,6 @@ async def get( Retrieve information about an operation Args: - zone_id: Identifier - operation_id: UUID feature: Add feature(s) to the results. The feature name that is given here corresponds diff --git a/src/cloudflare/resources/api_gateway/operations/schema_validation.py b/src/cloudflare/resources/api_gateway/operations/schema_validation.py index d08ebba4175..5468e2036a3 100644 --- a/src/cloudflare/resources/api_gateway/operations/schema_validation.py +++ b/src/cloudflare/resources/api_gateway/operations/schema_validation.py @@ -72,8 +72,6 @@ def update( Updates operation-level schema validation settings on the zone Args: - zone_id: Identifier - operation_id: UUID mitigation_action: When set, this applies a mitigation action to this operation @@ -124,8 +122,6 @@ def edit( Updates multiple operation-level schema validation settings on the zone Args: - zone_id: Identifier - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -165,8 +161,6 @@ def get( Retrieves operation-level schema validation settings on the zone Args: - zone_id: Identifier - operation_id: UUID extra_headers: Send extra headers @@ -227,8 +221,6 @@ async def update( Updates operation-level schema validation settings on the zone Args: - zone_id: Identifier - operation_id: UUID mitigation_action: When set, this applies a mitigation action to this operation @@ -279,8 +271,6 @@ async def edit( Updates multiple operation-level schema validation settings on the zone Args: - zone_id: Identifier - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -322,8 +312,6 @@ async def get( Retrieves operation-level schema validation settings on the zone Args: - zone_id: Identifier - operation_id: UUID extra_headers: Send extra headers diff --git a/src/cloudflare/resources/api_gateway/schemas.py b/src/cloudflare/resources/api_gateway/schemas.py index 79611e37e5d..78ea7d6af2d 100644 --- a/src/cloudflare/resources/api_gateway/schemas.py +++ b/src/cloudflare/resources/api_gateway/schemas.py @@ -65,8 +65,6 @@ def list( Retrieve operations and features as OpenAPI schemas Args: - zone_id: Identifier - feature: Add feature(s) to the results. The feature name that is given here corresponds to the resulting feature object. Have a look at the top-level object description for more details on the specific meaning. @@ -140,8 +138,6 @@ async def list( Retrieve operations and features as OpenAPI schemas Args: - zone_id: Identifier - feature: Add feature(s) to the results. The feature name that is given here corresponds to the resulting feature object. Have a look at the top-level object description for more details on the specific meaning. diff --git a/src/cloudflare/resources/api_gateway/settings/schema_validation.py b/src/cloudflare/resources/api_gateway/settings/schema_validation.py index ccb54128e03..a68b0930ca5 100644 --- a/src/cloudflare/resources/api_gateway/settings/schema_validation.py +++ b/src/cloudflare/resources/api_gateway/settings/schema_validation.py @@ -64,8 +64,6 @@ def update( Updates zone level schema validation settings on the zone Args: - zone_id: Identifier - validation_default_mitigation_action: The default mitigation action used when there is no mitigation action defined on the operation @@ -126,8 +124,6 @@ def edit( Updates zone level schema validation settings on the zone Args: - zone_id: Identifier - validation_default_mitigation_action: The default mitigation action used when there is no mitigation action defined on the operation Mitigation actions are as follows: @@ -187,8 +183,6 @@ def get( Retrieves zone level schema validation settings currently set on the zone Args: - zone_id: Identifier - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -245,8 +239,6 @@ async def update( Updates zone level schema validation settings on the zone Args: - zone_id: Identifier - validation_default_mitigation_action: The default mitigation action used when there is no mitigation action defined on the operation @@ -307,8 +299,6 @@ async def edit( Updates zone level schema validation settings on the zone Args: - zone_id: Identifier - validation_default_mitigation_action: The default mitigation action used when there is no mitigation action defined on the operation Mitigation actions are as follows: @@ -368,8 +358,6 @@ async def get( Retrieves zone level schema validation settings currently set on the zone Args: - zone_id: Identifier - extra_headers: Send extra headers extra_query: Add additional query parameters to the request diff --git a/src/cloudflare/resources/api_gateway/user_schemas/hosts.py b/src/cloudflare/resources/api_gateway/user_schemas/hosts.py index aa9fcadb55f..4f5a7b66ae6 100644 --- a/src/cloudflare/resources/api_gateway/user_schemas/hosts.py +++ b/src/cloudflare/resources/api_gateway/user_schemas/hosts.py @@ -59,8 +59,6 @@ def list( Retrieve schema hosts in a zone Args: - zone_id: Identifier - page: Page number of paginated results. per_page: Maximum number of results per page. @@ -132,8 +130,6 @@ def list( Retrieve schema hosts in a zone Args: - zone_id: Identifier - page: Page number of paginated results. per_page: Maximum number of results per page. diff --git a/src/cloudflare/resources/api_gateway/user_schemas/operations.py b/src/cloudflare/resources/api_gateway/user_schemas/operations.py index 5a9c28fa03d..d24ee1f3395 100644 --- a/src/cloudflare/resources/api_gateway/user_schemas/operations.py +++ b/src/cloudflare/resources/api_gateway/user_schemas/operations.py @@ -70,8 +70,6 @@ def list( Shield Endpoint Management will be returned as full operations. Args: - zone_id: Identifier - endpoint: Filter results to only include endpoints containing this pattern. feature: Add feature(s) to the results. The feature name that is given here corresponds @@ -173,8 +171,6 @@ def list( Shield Endpoint Management will be returned as full operations. Args: - zone_id: Identifier - endpoint: Filter results to only include endpoints containing this pattern. feature: Add feature(s) to the results. The feature name that is given here corresponds diff --git a/src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py b/src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py index 35c37f69fb6..67377f8ebb9 100644 --- a/src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py +++ b/src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py @@ -101,8 +101,6 @@ def create( Upload a schema to a zone Args: - zone_id: Identifier - file: Schema file bytes kind: Kind of schema @@ -167,8 +165,6 @@ def list( Retrieve information about all schemas on a zone Args: - zone_id: Identifier - omit_source: Omit the source-files of schemas and only retrieve their meta-data. page: Page number of paginated results. @@ -224,8 +220,6 @@ def delete( Delete a schema Args: - zone_id: Identifier - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -263,8 +257,6 @@ def edit( Enable validation for a schema Args: - zone_id: Identifier - validation_enabled: Flag whether schema is enabled for validation. extra_headers: Send extra headers @@ -311,8 +303,6 @@ def get( Retrieve information about a specific schema on a zone Args: - zone_id: Identifier - omit_source: Omit the source-files of schemas and only retrieve their meta-data. extra_headers: Send extra headers @@ -388,8 +378,6 @@ async def create( Upload a schema to a zone Args: - zone_id: Identifier - file: Schema file bytes kind: Kind of schema @@ -454,8 +442,6 @@ def list( Retrieve information about all schemas on a zone Args: - zone_id: Identifier - omit_source: Omit the source-files of schemas and only retrieve their meta-data. page: Page number of paginated results. @@ -511,8 +497,6 @@ async def delete( Delete a schema Args: - zone_id: Identifier - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -550,8 +534,6 @@ async def edit( Enable validation for a schema Args: - zone_id: Identifier - validation_enabled: Flag whether schema is enabled for validation. extra_headers: Send extra headers @@ -598,8 +580,6 @@ async def get( Retrieve information about a specific schema on a zone Args: - zone_id: Identifier - omit_source: Omit the source-files of schemas and only retrieve their meta-data. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/dns/records.py b/src/cloudflare/resources/dns/records.py index 12304b13aa1..79d0e41d6c3 100644 --- a/src/cloudflare/resources/dns/records.py +++ b/src/cloudflare/resources/dns/records.py @@ -35,7 +35,6 @@ from ..._base_client import AsyncPaginator, make_request_options from ...types.dns.ttl_param import TTLParam from ...types.dns.record_tags import RecordTags -from ...types.dns.record_param import RecordParam from ...types.dns.batch_put_param import BatchPutParam from ...types.dns.record_response import RecordResponse from ...types.dns.batch_patch_param import BatchPatchParam @@ -3158,7 +3157,7 @@ def batch( zone_id: str, deletes: Iterable[record_batch_params.Delete] | NotGiven = NOT_GIVEN, patches: Iterable[BatchPatchParam] | NotGiven = NOT_GIVEN, - posts: Iterable[RecordParam] | NotGiven = NOT_GIVEN, + posts: Iterable[object] | NotGiven = NOT_GIVEN, puts: Iterable[BatchPutParam] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -8023,7 +8022,7 @@ async def batch( zone_id: str, deletes: Iterable[record_batch_params.Delete] | NotGiven = NOT_GIVEN, patches: Iterable[BatchPatchParam] | NotGiven = NOT_GIVEN, - posts: Iterable[RecordParam] | NotGiven = NOT_GIVEN, + posts: Iterable[object] | NotGiven = NOT_GIVEN, puts: Iterable[BatchPutParam] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. diff --git a/src/cloudflare/resources/email_routing/dns.py b/src/cloudflare/resources/email_routing/dns.py index 66a32de1370..06e43976f56 100644 --- a/src/cloudflare/resources/email_routing/dns.py +++ b/src/cloudflare/resources/email_routing/dns.py @@ -23,7 +23,6 @@ from ...pagination import SyncSinglePage, AsyncSinglePage from ..._base_client import AsyncPaginator, make_request_options from ...types.email_routing import dns_get_params, dns_edit_params, dns_create_params -from ...types.email_routing.settings import Settings from ...types.email_routing.dns_record import DNSRecord from ...types.email_routing.dns_get_response import DNSGetResponse @@ -61,7 +60,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[Settings]: + ) -> object: """Enable you Email Routing zone. Add and lock the necessary MX and SPF records. @@ -89,9 +88,9 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[Settings]]._unwrapper, + post_parser=ResultWrapper[Optional[object]]._unwrapper, ), - cast_to=cast(Type[Optional[Settings]], ResultWrapper[Settings]), + cast_to=cast(Type[object], ResultWrapper[object]), ) def delete( @@ -144,7 +143,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[Settings]: + ) -> object: """ Unlock MX Records previously locked by Email Routing. @@ -171,9 +170,9 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[Settings]]._unwrapper, + post_parser=ResultWrapper[Optional[object]]._unwrapper, ), - cast_to=cast(Type[Optional[Settings]], ResultWrapper[Settings]), + cast_to=cast(Type[object], ResultWrapper[object]), ) def get( @@ -253,7 +252,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[Settings]: + ) -> object: """Enable you Email Routing zone. Add and lock the necessary MX and SPF records. @@ -281,9 +280,9 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[Settings]]._unwrapper, + post_parser=ResultWrapper[Optional[object]]._unwrapper, ), - cast_to=cast(Type[Optional[Settings]], ResultWrapper[Settings]), + cast_to=cast(Type[object], ResultWrapper[object]), ) def delete( @@ -336,7 +335,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[Settings]: + ) -> object: """ Unlock MX Records previously locked by Email Routing. @@ -363,9 +362,9 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[Settings]]._unwrapper, + post_parser=ResultWrapper[Optional[object]]._unwrapper, ), - cast_to=cast(Type[Optional[Settings]], ResultWrapper[Settings]), + cast_to=cast(Type[object], ResultWrapper[object]), ) async def get( diff --git a/src/cloudflare/resources/email_routing/email_routing.py b/src/cloudflare/resources/email_routing/email_routing.py index 9d2d44107a3..a16b4c99c51 100644 --- a/src/cloudflare/resources/email_routing/email_routing.py +++ b/src/cloudflare/resources/email_routing/email_routing.py @@ -46,7 +46,6 @@ ) from ..._base_client import make_request_options from ...types.email_routing import email_routing_enable_params, email_routing_disable_params -from ...types.email_routing.settings import Settings __all__ = ["EmailRoutingResource", "AsyncEmailRoutingResource"] @@ -94,7 +93,7 @@ def disable( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[Settings]: + ) -> object: """Disable your Email Routing zone. Also removes additional MX records previously @@ -121,9 +120,9 @@ def disable( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[Settings]]._unwrapper, + post_parser=ResultWrapper[Optional[object]]._unwrapper, ), - cast_to=cast(Type[Optional[Settings]], ResultWrapper[Settings]), + cast_to=cast(Type[object], ResultWrapper[object]), ) def enable( @@ -137,7 +136,7 @@ def enable( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[Settings]: + ) -> object: """Enable you Email Routing zone. Add and lock the necessary MX and SPF records. @@ -163,9 +162,9 @@ def enable( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[Settings]]._unwrapper, + post_parser=ResultWrapper[Optional[object]]._unwrapper, ), - cast_to=cast(Type[Optional[Settings]], ResultWrapper[Settings]), + cast_to=cast(Type[object], ResultWrapper[object]), ) def get( @@ -178,7 +177,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[Settings]: + ) -> object: """ Get information about the settings for your Email Routing zone. @@ -202,9 +201,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[Settings]]._unwrapper, + post_parser=ResultWrapper[Optional[object]]._unwrapper, ), - cast_to=cast(Type[Optional[Settings]], ResultWrapper[Settings]), + cast_to=cast(Type[object], ResultWrapper[object]), ) @@ -251,7 +250,7 @@ async def disable( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[Settings]: + ) -> object: """Disable your Email Routing zone. Also removes additional MX records previously @@ -278,9 +277,9 @@ async def disable( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[Settings]]._unwrapper, + post_parser=ResultWrapper[Optional[object]]._unwrapper, ), - cast_to=cast(Type[Optional[Settings]], ResultWrapper[Settings]), + cast_to=cast(Type[object], ResultWrapper[object]), ) async def enable( @@ -294,7 +293,7 @@ async def enable( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[Settings]: + ) -> object: """Enable you Email Routing zone. Add and lock the necessary MX and SPF records. @@ -320,9 +319,9 @@ async def enable( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[Settings]]._unwrapper, + post_parser=ResultWrapper[Optional[object]]._unwrapper, ), - cast_to=cast(Type[Optional[Settings]], ResultWrapper[Settings]), + cast_to=cast(Type[object], ResultWrapper[object]), ) async def get( @@ -335,7 +334,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[Settings]: + ) -> object: """ Get information about the settings for your Email Routing zone. @@ -359,9 +358,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[Settings]]._unwrapper, + post_parser=ResultWrapper[Optional[object]]._unwrapper, ), - cast_to=cast(Type[Optional[Settings]], ResultWrapper[Settings]), + cast_to=cast(Type[object], ResultWrapper[object]), ) diff --git a/src/cloudflare/resources/email_routing/rules/rules.py b/src/cloudflare/resources/email_routing/rules/rules.py index 02951aa2987..638eedd9711 100644 --- a/src/cloudflare/resources/email_routing/rules/rules.py +++ b/src/cloudflare/resources/email_routing/rules/rules.py @@ -78,7 +78,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[EmailRoutingRule]: + ) -> object: """ Rules consist of a set of criteria for matching emails (such as an email being sent to a specific custom email address) plus a set of actions to take on the @@ -124,9 +124,9 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[EmailRoutingRule]]._unwrapper, + post_parser=ResultWrapper[Optional[object]]._unwrapper, ), - cast_to=cast(Type[Optional[EmailRoutingRule]], ResultWrapper[EmailRoutingRule]), + cast_to=cast(Type[object], ResultWrapper[object]), ) def update( @@ -145,7 +145,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[EmailRoutingRule]: + ) -> object: """ Update actions and matches, or enable/disable specific routing rules. @@ -193,9 +193,9 @@ def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[EmailRoutingRule]]._unwrapper, + post_parser=ResultWrapper[Optional[object]]._unwrapper, ), - cast_to=cast(Type[Optional[EmailRoutingRule]], ResultWrapper[EmailRoutingRule]), + cast_to=cast(Type[object], ResultWrapper[object]), ) def list( @@ -265,7 +265,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[EmailRoutingRule]: + ) -> object: """ Delete a specific routing rule. @@ -293,9 +293,9 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[EmailRoutingRule]]._unwrapper, + post_parser=ResultWrapper[Optional[object]]._unwrapper, ), - cast_to=cast(Type[Optional[EmailRoutingRule]], ResultWrapper[EmailRoutingRule]), + cast_to=cast(Type[object], ResultWrapper[object]), ) def get( @@ -309,7 +309,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[EmailRoutingRule]: + ) -> object: """ Get information for a specific routing rule already created. @@ -337,9 +337,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[EmailRoutingRule]]._unwrapper, + post_parser=ResultWrapper[Optional[object]]._unwrapper, ), - cast_to=cast(Type[Optional[EmailRoutingRule]], ResultWrapper[EmailRoutingRule]), + cast_to=cast(Type[object], ResultWrapper[object]), ) @@ -382,7 +382,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[EmailRoutingRule]: + ) -> object: """ Rules consist of a set of criteria for matching emails (such as an email being sent to a specific custom email address) plus a set of actions to take on the @@ -428,9 +428,9 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[EmailRoutingRule]]._unwrapper, + post_parser=ResultWrapper[Optional[object]]._unwrapper, ), - cast_to=cast(Type[Optional[EmailRoutingRule]], ResultWrapper[EmailRoutingRule]), + cast_to=cast(Type[object], ResultWrapper[object]), ) async def update( @@ -449,7 +449,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[EmailRoutingRule]: + ) -> object: """ Update actions and matches, or enable/disable specific routing rules. @@ -497,9 +497,9 @@ async def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[EmailRoutingRule]]._unwrapper, + post_parser=ResultWrapper[Optional[object]]._unwrapper, ), - cast_to=cast(Type[Optional[EmailRoutingRule]], ResultWrapper[EmailRoutingRule]), + cast_to=cast(Type[object], ResultWrapper[object]), ) def list( @@ -569,7 +569,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[EmailRoutingRule]: + ) -> object: """ Delete a specific routing rule. @@ -597,9 +597,9 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[EmailRoutingRule]]._unwrapper, + post_parser=ResultWrapper[Optional[object]]._unwrapper, ), - cast_to=cast(Type[Optional[EmailRoutingRule]], ResultWrapper[EmailRoutingRule]), + cast_to=cast(Type[object], ResultWrapper[object]), ) async def get( @@ -613,7 +613,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[EmailRoutingRule]: + ) -> object: """ Get information for a specific routing rule already created. @@ -641,9 +641,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[EmailRoutingRule]]._unwrapper, + post_parser=ResultWrapper[Optional[object]]._unwrapper, ), - cast_to=cast(Type[Optional[EmailRoutingRule]], ResultWrapper[EmailRoutingRule]), + cast_to=cast(Type[object], ResultWrapper[object]), ) diff --git a/src/cloudflare/resources/firewall/ua_rules.py b/src/cloudflare/resources/firewall/ua_rules.py index c0fcef7b441..3178868081e 100644 --- a/src/cloudflare/resources/firewall/ua_rules.py +++ b/src/cloudflare/resources/firewall/ua_rules.py @@ -25,7 +25,6 @@ from ..._base_client import AsyncPaginator, make_request_options from ...types.firewall import ua_rule_list_params, ua_rule_create_params, ua_rule_update_params from ...types.firewall.ua_rule_get_response import UARuleGetResponse -from ...types.firewall.ua_rule_list_response import UARuleListResponse from ...types.firewall.ua_rule_create_response import UARuleCreateResponse from ...types.firewall.ua_rule_delete_response import UARuleDeleteResponse from ...types.firewall.ua_rule_update_response import UARuleUpdateResponse @@ -187,7 +186,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncV4PagePaginationArray[UARuleListResponse]: + ) -> SyncV4PagePaginationArray[object]: """Fetches User Agent Blocking rules in a zone. You can filter the results using @@ -219,7 +218,7 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/firewall/ua_rules", - page=SyncV4PagePaginationArray[UARuleListResponse], + page=SyncV4PagePaginationArray[object], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -236,7 +235,7 @@ def list( ua_rule_list_params.UARuleListParams, ), ), - model=UARuleListResponse, + model=object, ) def delete( @@ -487,7 +486,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[UARuleListResponse, AsyncV4PagePaginationArray[UARuleListResponse]]: + ) -> AsyncPaginator[object, AsyncV4PagePaginationArray[object]]: """Fetches User Agent Blocking rules in a zone. You can filter the results using @@ -519,7 +518,7 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/firewall/ua_rules", - page=AsyncV4PagePaginationArray[UARuleListResponse], + page=AsyncV4PagePaginationArray[object], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -536,7 +535,7 @@ def list( ua_rule_list_params.UARuleListParams, ), ), - model=UARuleListResponse, + model=object, ) async def delete( diff --git a/src/cloudflare/resources/leaked_credential_checks/detections.py b/src/cloudflare/resources/leaked_credential_checks/detections.py index 2665ffb5701..fcb8d5e03e4 100644 --- a/src/cloudflare/resources/leaked_credential_checks/detections.py +++ b/src/cloudflare/resources/leaked_credential_checks/detections.py @@ -54,6 +54,7 @@ def create( self, *, zone_id: str, + id: object | NotGiven = NOT_GIVEN, password: str | NotGiven = NOT_GIVEN, username: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -69,6 +70,8 @@ def create( Args: zone_id: Identifier + id: The unique ID for this custom detection + password: The ruleset expression to use in matching the password in a request username: The ruleset expression to use in matching the username in a request @@ -87,6 +90,7 @@ def create( f"/zones/{zone_id}/leaked-credential-checks/detections", body=maybe_transform( { + "id": id, "password": password, "username": username, }, @@ -107,6 +111,7 @@ def update( detection_id: str, *, zone_id: str, + id: object | NotGiven = NOT_GIVEN, password: str | NotGiven = NOT_GIVEN, username: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -124,6 +129,8 @@ def update( detection_id: Identifier + id: The unique ID for this custom detection + password: The ruleset expression to use in matching the password in a request username: The ruleset expression to use in matching the username in a request @@ -144,6 +151,7 @@ def update( f"/zones/{zone_id}/leaked-credential-checks/detections/{detection_id}", body=maybe_transform( { + "id": id, "password": password, "username": username, }, @@ -264,6 +272,7 @@ async def create( self, *, zone_id: str, + id: object | NotGiven = NOT_GIVEN, password: str | NotGiven = NOT_GIVEN, username: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -279,6 +288,8 @@ async def create( Args: zone_id: Identifier + id: The unique ID for this custom detection + password: The ruleset expression to use in matching the password in a request username: The ruleset expression to use in matching the username in a request @@ -297,6 +308,7 @@ async def create( f"/zones/{zone_id}/leaked-credential-checks/detections", body=await async_maybe_transform( { + "id": id, "password": password, "username": username, }, @@ -317,6 +329,7 @@ async def update( detection_id: str, *, zone_id: str, + id: object | NotGiven = NOT_GIVEN, password: str | NotGiven = NOT_GIVEN, username: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -334,6 +347,8 @@ async def update( detection_id: Identifier + id: The unique ID for this custom detection + password: The ruleset expression to use in matching the password in a request username: The ruleset expression to use in matching the username in a request @@ -354,6 +369,7 @@ async def update( f"/zones/{zone_id}/leaked-credential-checks/detections/{detection_id}", body=await async_maybe_transform( { + "id": id, "password": password, "username": username, }, diff --git a/src/cloudflare/resources/registrar/domains.py b/src/cloudflare/resources/registrar/domains.py index a6ce99f600f..0de9a7975a4 100644 --- a/src/cloudflare/resources/registrar/domains.py +++ b/src/cloudflare/resources/registrar/domains.py @@ -23,7 +23,6 @@ from ...pagination import SyncSinglePage, AsyncSinglePage from ..._base_client import AsyncPaginator, make_request_options from ...types.registrar import domain_update_params -from ...types.registrar.domain import Domain __all__ = ["DomainsResource", "AsyncDomainsResource"] @@ -120,7 +119,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[Domain]: + ) -> SyncSinglePage[object]: """ List domains handled by Registrar. @@ -139,11 +138,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/registrar/domains", - page=SyncSinglePage[Domain], + page=SyncSinglePage[object], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=Domain, + model=object, ) def get( @@ -283,7 +282,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[Domain, AsyncSinglePage[Domain]]: + ) -> AsyncPaginator[object, AsyncSinglePage[object]]: """ List domains handled by Registrar. @@ -302,11 +301,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/registrar/domains", - page=AsyncSinglePage[Domain], + page=AsyncSinglePage[object], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=Domain, + model=object, ) async def get( diff --git a/src/cloudflare/resources/zones/rate_plans.py b/src/cloudflare/resources/zones/rate_plans.py index daff981d93f..81b26e08b25 100644 --- a/src/cloudflare/resources/zones/rate_plans.py +++ b/src/cloudflare/resources/zones/rate_plans.py @@ -15,7 +15,6 @@ ) from ...pagination import SyncSinglePage, AsyncSinglePage from ..._base_client import AsyncPaginator, make_request_options -from ...types.zones.rate_plan_get_response import RatePlanGetResponse __all__ = ["RatePlansResource", "AsyncRatePlansResource"] @@ -50,7 +49,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[RatePlanGetResponse]: + ) -> SyncSinglePage[object]: """ Lists all rate plans the zone can subscribe to. @@ -69,11 +68,11 @@ def get( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/available_rate_plans", - page=SyncSinglePage[RatePlanGetResponse], + page=SyncSinglePage[object], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=RatePlanGetResponse, + model=object, ) @@ -107,7 +106,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[RatePlanGetResponse, AsyncSinglePage[RatePlanGetResponse]]: + ) -> AsyncPaginator[object, AsyncSinglePage[object]]: """ Lists all rate plans the zone can subscribe to. @@ -126,11 +125,11 @@ def get( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/available_rate_plans", - page=AsyncSinglePage[RatePlanGetResponse], + page=AsyncSinglePage[object], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=RatePlanGetResponse, + model=object, ) diff --git a/src/cloudflare/types/api_gateway/configuration_get_params.py b/src/cloudflare/types/api_gateway/configuration_get_params.py index c1be0a862e8..ed0f784a14a 100644 --- a/src/cloudflare/types/api_gateway/configuration_get_params.py +++ b/src/cloudflare/types/api_gateway/configuration_get_params.py @@ -10,7 +10,6 @@ class ConfigurationGetParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" properties: List[Literal["auth_id_characteristics"]] """Requests information about certain properties.""" diff --git a/src/cloudflare/types/api_gateway/configuration_update_params.py b/src/cloudflare/types/api_gateway/configuration_update_params.py index 35652656bbe..561f4be6f33 100644 --- a/src/cloudflare/types/api_gateway/configuration_update_params.py +++ b/src/cloudflare/types/api_gateway/configuration_update_params.py @@ -15,7 +15,6 @@ class ConfigurationUpdateParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" auth_id_characteristics: Required[Iterable[AuthIDCharacteristic]] diff --git a/src/cloudflare/types/api_gateway/discovery/operation_bulk_edit_params.py b/src/cloudflare/types/api_gateway/discovery/operation_bulk_edit_params.py index db2119fa7b6..ed4c4ee164a 100644 --- a/src/cloudflare/types/api_gateway/discovery/operation_bulk_edit_params.py +++ b/src/cloudflare/types/api_gateway/discovery/operation_bulk_edit_params.py @@ -10,7 +10,6 @@ class OperationBulkEditParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" body: Required[Dict[str, Body]] diff --git a/src/cloudflare/types/api_gateway/discovery/operation_edit_params.py b/src/cloudflare/types/api_gateway/discovery/operation_edit_params.py index 903d84d39fc..927ff5cf55b 100644 --- a/src/cloudflare/types/api_gateway/discovery/operation_edit_params.py +++ b/src/cloudflare/types/api_gateway/discovery/operation_edit_params.py @@ -9,7 +9,6 @@ class OperationEditParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" state: Literal["review", "ignored"] """Mark state of operation in API Discovery diff --git a/src/cloudflare/types/api_gateway/discovery/operation_list_params.py b/src/cloudflare/types/api_gateway/discovery/operation_list_params.py index 0b33645439c..3ee3223ce89 100644 --- a/src/cloudflare/types/api_gateway/discovery/operation_list_params.py +++ b/src/cloudflare/types/api_gateway/discovery/operation_list_params.py @@ -10,7 +10,6 @@ class OperationListParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" diff: bool """ diff --git a/src/cloudflare/types/api_gateway/discovery_get_response.py b/src/cloudflare/types/api_gateway/discovery_get_response.py index bcc99ffc364..1e4631b8d42 100644 --- a/src/cloudflare/types/api_gateway/discovery_get_response.py +++ b/src/cloudflare/types/api_gateway/discovery_get_response.py @@ -1,7 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List -from datetime import datetime from ..._models import BaseModel @@ -11,4 +10,4 @@ class DiscoveryGetResponse(BaseModel): schemas: List[object] - timestamp: datetime + timestamp: str diff --git a/src/cloudflare/types/api_gateway/discovery_operation.py b/src/cloudflare/types/api_gateway/discovery_operation.py index 8c3fe0a8617..bcdecd31885 100644 --- a/src/cloudflare/types/api_gateway/discovery_operation.py +++ b/src/cloudflare/types/api_gateway/discovery_operation.py @@ -25,7 +25,6 @@ class Features(BaseModel): class DiscoveryOperation(BaseModel): id: str - """UUID""" endpoint: str """ @@ -38,7 +37,7 @@ class DiscoveryOperation(BaseModel): host: str """RFC3986-compliant host.""" - last_updated: datetime + last_updated: str method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"] """The HTTP method used to access the endpoint.""" diff --git a/src/cloudflare/types/api_gateway/expression_template/fallthrough_create_params.py b/src/cloudflare/types/api_gateway/expression_template/fallthrough_create_params.py index 1aa894b2732..c73917263ab 100644 --- a/src/cloudflare/types/api_gateway/expression_template/fallthrough_create_params.py +++ b/src/cloudflare/types/api_gateway/expression_template/fallthrough_create_params.py @@ -10,7 +10,6 @@ class FallthroughCreateParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" hosts: Required[List[str]] """List of hosts to be targeted in the expression""" diff --git a/src/cloudflare/types/api_gateway/operation_bulk_create_params.py b/src/cloudflare/types/api_gateway/operation_bulk_create_params.py index 8672ae972e9..c71aed46f78 100644 --- a/src/cloudflare/types/api_gateway/operation_bulk_create_params.py +++ b/src/cloudflare/types/api_gateway/operation_bulk_create_params.py @@ -10,7 +10,6 @@ class OperationBulkCreateParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" body: Required[Iterable[Body]] diff --git a/src/cloudflare/types/api_gateway/operation_bulk_create_response.py b/src/cloudflare/types/api_gateway/operation_bulk_create_response.py index 9079c8b44c1..f96321499aa 100644 --- a/src/cloudflare/types/api_gateway/operation_bulk_create_response.py +++ b/src/cloudflare/types/api_gateway/operation_bulk_create_response.py @@ -169,7 +169,6 @@ class FeaturesAPIShieldOperationFeatureConfidenceIntervals(BaseModel): class FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema(BaseModel): id: Optional[str] = None - """UUID""" created_at: Optional[datetime] = None @@ -216,12 +215,11 @@ class OperationBulkCreateResponse(BaseModel): host: str """RFC3986-compliant host.""" - last_updated: datetime + last_updated: str method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"] """The HTTP method used to access the endpoint.""" operation_id: str - """UUID""" features: Optional[Features] = None diff --git a/src/cloudflare/types/api_gateway/operation_create_params.py b/src/cloudflare/types/api_gateway/operation_create_params.py index 4563a0f9afb..1e4f3213caf 100644 --- a/src/cloudflare/types/api_gateway/operation_create_params.py +++ b/src/cloudflare/types/api_gateway/operation_create_params.py @@ -9,7 +9,6 @@ class OperationCreateParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" endpoint: Required[str] """ diff --git a/src/cloudflare/types/api_gateway/operation_create_response.py b/src/cloudflare/types/api_gateway/operation_create_response.py index a9b73ff2a91..7ea3979e360 100644 --- a/src/cloudflare/types/api_gateway/operation_create_response.py +++ b/src/cloudflare/types/api_gateway/operation_create_response.py @@ -169,7 +169,6 @@ class FeaturesAPIShieldOperationFeatureConfidenceIntervals(BaseModel): class FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema(BaseModel): id: Optional[str] = None - """UUID""" created_at: Optional[datetime] = None @@ -216,12 +215,11 @@ class OperationCreateResponse(BaseModel): host: str """RFC3986-compliant host.""" - last_updated: datetime + last_updated: str method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"] """The HTTP method used to access the endpoint.""" operation_id: str - """UUID""" features: Optional[Features] = None diff --git a/src/cloudflare/types/api_gateway/operation_get_params.py b/src/cloudflare/types/api_gateway/operation_get_params.py index e752e501aae..b17355a71a7 100644 --- a/src/cloudflare/types/api_gateway/operation_get_params.py +++ b/src/cloudflare/types/api_gateway/operation_get_params.py @@ -10,7 +10,6 @@ class OperationGetParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] """Add feature(s) to the results. diff --git a/src/cloudflare/types/api_gateway/operation_get_response.py b/src/cloudflare/types/api_gateway/operation_get_response.py index 36585cba248..3dd091fde3b 100644 --- a/src/cloudflare/types/api_gateway/operation_get_response.py +++ b/src/cloudflare/types/api_gateway/operation_get_response.py @@ -169,7 +169,6 @@ class FeaturesAPIShieldOperationFeatureConfidenceIntervals(BaseModel): class FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema(BaseModel): id: Optional[str] = None - """UUID""" created_at: Optional[datetime] = None @@ -216,12 +215,11 @@ class OperationGetResponse(BaseModel): host: str """RFC3986-compliant host.""" - last_updated: datetime + last_updated: str method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"] """The HTTP method used to access the endpoint.""" operation_id: str - """UUID""" features: Optional[Features] = None diff --git a/src/cloudflare/types/api_gateway/operation_list_params.py b/src/cloudflare/types/api_gateway/operation_list_params.py index 1244f5a078f..14790c16a4e 100644 --- a/src/cloudflare/types/api_gateway/operation_list_params.py +++ b/src/cloudflare/types/api_gateway/operation_list_params.py @@ -10,7 +10,6 @@ class OperationListParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" direction: Literal["asc", "desc"] """Direction to order results.""" diff --git a/src/cloudflare/types/api_gateway/operation_list_response.py b/src/cloudflare/types/api_gateway/operation_list_response.py index de42fa68ed0..a2cefe6b3f7 100644 --- a/src/cloudflare/types/api_gateway/operation_list_response.py +++ b/src/cloudflare/types/api_gateway/operation_list_response.py @@ -169,7 +169,6 @@ class FeaturesAPIShieldOperationFeatureConfidenceIntervals(BaseModel): class FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema(BaseModel): id: Optional[str] = None - """UUID""" created_at: Optional[datetime] = None @@ -216,12 +215,11 @@ class OperationListResponse(BaseModel): host: str """RFC3986-compliant host.""" - last_updated: datetime + last_updated: str method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"] """The HTTP method used to access the endpoint.""" operation_id: str - """UUID""" features: Optional[Features] = None diff --git a/src/cloudflare/types/api_gateway/operations/schema_validation_edit_params.py b/src/cloudflare/types/api_gateway/operations/schema_validation_edit_params.py index 45926402aa5..b4be0c37076 100644 --- a/src/cloudflare/types/api_gateway/operations/schema_validation_edit_params.py +++ b/src/cloudflare/types/api_gateway/operations/schema_validation_edit_params.py @@ -11,6 +11,5 @@ class SchemaValidationEditParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" settings_multiple_request: Required[SettingsMultipleRequestParam] diff --git a/src/cloudflare/types/api_gateway/operations/schema_validation_update_params.py b/src/cloudflare/types/api_gateway/operations/schema_validation_update_params.py index e9975b01cda..eeaee4a2475 100644 --- a/src/cloudflare/types/api_gateway/operations/schema_validation_update_params.py +++ b/src/cloudflare/types/api_gateway/operations/schema_validation_update_params.py @@ -10,7 +10,6 @@ class SchemaValidationUpdateParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" mitigation_action: Optional[Literal["log", "block", "none"]] """When set, this applies a mitigation action to this operation diff --git a/src/cloudflare/types/api_gateway/public_schema.py b/src/cloudflare/types/api_gateway/public_schema.py index bdff5f529aa..c5f922322f2 100644 --- a/src/cloudflare/types/api_gateway/public_schema.py +++ b/src/cloudflare/types/api_gateway/public_schema.py @@ -1,7 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from datetime import datetime from typing_extensions import Literal from ..._models import BaseModel @@ -10,7 +9,7 @@ class PublicSchema(BaseModel): - created_at: datetime + created_at: str kind: Literal["openapi_v3"] """Kind of schema""" @@ -19,7 +18,6 @@ class PublicSchema(BaseModel): """Name of the schema""" schema_id: str - """UUID""" source: Optional[str] = None """Source of the schema""" diff --git a/src/cloudflare/types/api_gateway/schema_list_params.py b/src/cloudflare/types/api_gateway/schema_list_params.py index 7bc4f9ac025..7447b92f52a 100644 --- a/src/cloudflare/types/api_gateway/schema_list_params.py +++ b/src/cloudflare/types/api_gateway/schema_list_params.py @@ -10,7 +10,6 @@ class SchemaListParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] """Add feature(s) to the results. diff --git a/src/cloudflare/types/api_gateway/settings/schema_validation_edit_params.py b/src/cloudflare/types/api_gateway/settings/schema_validation_edit_params.py index 424471b1283..f57646e5d13 100644 --- a/src/cloudflare/types/api_gateway/settings/schema_validation_edit_params.py +++ b/src/cloudflare/types/api_gateway/settings/schema_validation_edit_params.py @@ -10,7 +10,6 @@ class SchemaValidationEditParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" validation_default_mitigation_action: Optional[Literal["none", "log", "block"]] """ diff --git a/src/cloudflare/types/api_gateway/settings/schema_validation_update_params.py b/src/cloudflare/types/api_gateway/settings/schema_validation_update_params.py index e7ffb4e6bdd..231c72423d5 100644 --- a/src/cloudflare/types/api_gateway/settings/schema_validation_update_params.py +++ b/src/cloudflare/types/api_gateway/settings/schema_validation_update_params.py @@ -10,7 +10,6 @@ class SchemaValidationUpdateParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" validation_default_mitigation_action: Required[Literal["none", "log", "block"]] """ diff --git a/src/cloudflare/types/api_gateway/user_schema_create_params.py b/src/cloudflare/types/api_gateway/user_schema_create_params.py index 10d9593240a..e405c31ee6f 100644 --- a/src/cloudflare/types/api_gateway/user_schema_create_params.py +++ b/src/cloudflare/types/api_gateway/user_schema_create_params.py @@ -11,7 +11,6 @@ class UserSchemaCreateParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" file: Required[FileTypes] """Schema file bytes""" diff --git a/src/cloudflare/types/api_gateway/user_schema_edit_params.py b/src/cloudflare/types/api_gateway/user_schema_edit_params.py index 99e15349c77..9d992d083c7 100644 --- a/src/cloudflare/types/api_gateway/user_schema_edit_params.py +++ b/src/cloudflare/types/api_gateway/user_schema_edit_params.py @@ -9,7 +9,6 @@ class UserSchemaEditParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" validation_enabled: Literal[True] """Flag whether schema is enabled for validation.""" diff --git a/src/cloudflare/types/api_gateway/user_schema_get_params.py b/src/cloudflare/types/api_gateway/user_schema_get_params.py index dbaee3dee47..986685f5007 100644 --- a/src/cloudflare/types/api_gateway/user_schema_get_params.py +++ b/src/cloudflare/types/api_gateway/user_schema_get_params.py @@ -9,7 +9,6 @@ class UserSchemaGetParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" omit_source: bool """Omit the source-files of schemas and only retrieve their meta-data.""" diff --git a/src/cloudflare/types/api_gateway/user_schema_list_params.py b/src/cloudflare/types/api_gateway/user_schema_list_params.py index faca68fa945..5e5d24554f6 100644 --- a/src/cloudflare/types/api_gateway/user_schema_list_params.py +++ b/src/cloudflare/types/api_gateway/user_schema_list_params.py @@ -9,7 +9,6 @@ class UserSchemaListParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" omit_source: bool """Omit the source-files of schemas and only retrieve their meta-data.""" diff --git a/src/cloudflare/types/api_gateway/user_schemas/host_list_params.py b/src/cloudflare/types/api_gateway/user_schemas/host_list_params.py index cc0aed8db98..4e40214d29b 100644 --- a/src/cloudflare/types/api_gateway/user_schemas/host_list_params.py +++ b/src/cloudflare/types/api_gateway/user_schemas/host_list_params.py @@ -9,7 +9,6 @@ class HostListParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" page: int """Page number of paginated results.""" diff --git a/src/cloudflare/types/api_gateway/user_schemas/host_list_response.py b/src/cloudflare/types/api_gateway/user_schemas/host_list_response.py index a56dd1037f5..b5e6a568dc3 100644 --- a/src/cloudflare/types/api_gateway/user_schemas/host_list_response.py +++ b/src/cloudflare/types/api_gateway/user_schemas/host_list_response.py @@ -1,7 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List -from datetime import datetime from ...._models import BaseModel @@ -9,7 +8,7 @@ class HostListResponse(BaseModel): - created_at: datetime + created_at: str hosts: List[str] """Hosts serving the schema, e.g zone.host.com""" @@ -18,4 +17,3 @@ class HostListResponse(BaseModel): """Name of the schema""" schema_id: str - """UUID""" diff --git a/src/cloudflare/types/api_gateway/user_schemas/operation_list_params.py b/src/cloudflare/types/api_gateway/user_schemas/operation_list_params.py index 64cb5bdccae..4a8add15055 100644 --- a/src/cloudflare/types/api_gateway/user_schemas/operation_list_params.py +++ b/src/cloudflare/types/api_gateway/user_schemas/operation_list_params.py @@ -10,7 +10,6 @@ class OperationListParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" endpoint: str """Filter results to only include endpoints containing this pattern.""" diff --git a/src/cloudflare/types/api_gateway/user_schemas/operation_list_response.py b/src/cloudflare/types/api_gateway/user_schemas/operation_list_response.py index cae8a5a0a92..f86acfafe8d 100644 --- a/src/cloudflare/types/api_gateway/user_schemas/operation_list_response.py +++ b/src/cloudflare/types/api_gateway/user_schemas/operation_list_response.py @@ -175,7 +175,6 @@ class APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervals(Bas class APIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema(BaseModel): id: Optional[str] = None - """UUID""" created_at: Optional[datetime] = None @@ -222,13 +221,12 @@ class APIShieldOperation(BaseModel): host: str """RFC3986-compliant host.""" - last_updated: datetime + last_updated: str method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"] """The HTTP method used to access the endpoint.""" operation_id: str - """UUID""" features: Optional[APIShieldOperationFeatures] = None diff --git a/src/cloudflare/types/content_scanning/payload_create_response.py b/src/cloudflare/types/content_scanning/payload_create_response.py index 6cff7ddd70f..6071786c586 100644 --- a/src/cloudflare/types/content_scanning/payload_create_response.py +++ b/src/cloudflare/types/content_scanning/payload_create_response.py @@ -8,7 +8,7 @@ class PayloadCreateResponse(BaseModel): - id: Optional[str] = None + id: Optional[object] = None """The unique ID for this custom scan expression""" payload: Optional[str] = None diff --git a/src/cloudflare/types/content_scanning/payload_delete_response.py b/src/cloudflare/types/content_scanning/payload_delete_response.py index 3025a37b0ca..e8862426857 100644 --- a/src/cloudflare/types/content_scanning/payload_delete_response.py +++ b/src/cloudflare/types/content_scanning/payload_delete_response.py @@ -8,7 +8,7 @@ class PayloadDeleteResponse(BaseModel): - id: Optional[str] = None + id: Optional[object] = None """The unique ID for this custom scan expression""" payload: Optional[str] = None diff --git a/src/cloudflare/types/content_scanning/payload_list_response.py b/src/cloudflare/types/content_scanning/payload_list_response.py index 2ed0a8d1cf3..7461ad385d9 100644 --- a/src/cloudflare/types/content_scanning/payload_list_response.py +++ b/src/cloudflare/types/content_scanning/payload_list_response.py @@ -8,7 +8,7 @@ class PayloadListResponse(BaseModel): - id: Optional[str] = None + id: Optional[object] = None """The unique ID for this custom scan expression""" payload: Optional[str] = None diff --git a/src/cloudflare/types/custom_certificates/custom_certificate.py b/src/cloudflare/types/custom_certificates/custom_certificate.py index b5579f8a95f..1588bf81d02 100644 --- a/src/cloudflare/types/custom_certificates/custom_certificate.py +++ b/src/cloudflare/types/custom_certificates/custom_certificate.py @@ -7,7 +7,6 @@ from ..._models import BaseModel from .geo_restrictions import GeoRestrictions from ..custom_hostnames.bundle_method import BundleMethod -from ..keyless_certificates.keyless_certificate import KeylessCertificate __all__ = ["CustomCertificate"] @@ -66,7 +65,7 @@ class CustomCertificate(BaseModel): for optimal performance. """ - keyless_server: Optional[KeylessCertificate] = None + keyless_server: Optional[object] = None policy: Optional[str] = None """ diff --git a/src/cloudflare/types/dns/batch_patch_param.py b/src/cloudflare/types/dns/batch_patch_param.py index e3e0ae92005..0cfa5b0ca37 100644 --- a/src/cloudflare/types/dns/batch_patch_param.py +++ b/src/cloudflare/types/dns/batch_patch_param.py @@ -2,236 +2,11 @@ from __future__ import annotations -from typing import List, Union -from typing_extensions import Literal, Required, TypeAlias, TypedDict +from typing_extensions import Required, TypedDict -from .ttl_param import TTLParam -from .record_tags import RecordTags -from .a_record_param import ARecordParam -from .ds_record_param import DSRecordParam -from .mx_record_param import MXRecordParam -from .ns_record_param import NSRecordParam -from .caa_record_param import CAARecordParam -from .loc_record_param import LOCRecordParam -from .ptr_record_param import PTRRecordParam -from .srv_record_param import SRVRecordParam -from .txt_record_param import TXTRecordParam -from .uri_record_param import URIRecordParam -from .aaaa_record_param import AAAARecordParam -from .cert_record_param import CERTRecordParam -from .svcb_record_param import SVCBRecordParam -from .tlsa_record_param import TLSARecordParam -from .cname_record_param import CNAMERecordParam -from .https_record_param import HTTPSRecordParam -from .naptr_record_param import NAPTRRecordParam -from .sshfp_record_param import SSHFPRecordParam -from .dnskey_record_param import DNSKEYRecordParam -from .smimea_record_param import SMIMEARecordParam +__all__ = ["BatchPatchParam"] -__all__ = [ - "BatchPatchParam", - "ARecord", - "AAAARecord", - "CAARecord", - "CERTRecord", - "CNAMERecord", - "DNSKEYRecord", - "DSRecord", - "HTTPSRecord", - "LOCRecord", - "MXRecord", - "NAPTRRecord", - "NSRecord", - "Openpgpkey", - "OpenpgpkeySettings", - "PTRRecord", - "SMIMEARecord", - "SRVRecord", - "SSHFPRecord", - "SVCBRecord", - "TLSARecord", - "TXTRecord", - "URIRecord", -] - -class ARecord(ARecordParam): - id: Required[str] - """Identifier""" - - -class AAAARecord(AAAARecordParam): - id: Required[str] - """Identifier""" - - -class CAARecord(CAARecordParam): - id: Required[str] - """Identifier""" - - -class CERTRecord(CERTRecordParam): - id: Required[str] - """Identifier""" - - -class CNAMERecord(CNAMERecordParam): - id: Required[str] - """Identifier""" - - -class DNSKEYRecord(DNSKEYRecordParam): - id: Required[str] - """Identifier""" - - -class DSRecord(DSRecordParam): - id: Required[str] - """Identifier""" - - -class HTTPSRecord(HTTPSRecordParam): - id: Required[str] - """Identifier""" - - -class LOCRecord(LOCRecordParam): - id: Required[str] - """Identifier""" - - -class MXRecord(MXRecordParam): - id: Required[str] - """Identifier""" - - -class NAPTRRecord(NAPTRRecordParam): - id: Required[str] - """Identifier""" - - -class NSRecord(NSRecordParam): - id: Required[str] - """Identifier""" - - -class OpenpgpkeySettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - -class Openpgpkey(TypedDict, total=False): - id: Required[str] - """Identifier""" - - comment: str - """Comments or notes about the DNS record. - - This field has no effect on DNS responses. - """ - - content: str - """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - - proxied: bool - """ - Whether the record is receiving the performance and security benefits of - Cloudflare. - """ - - settings: OpenpgpkeySettings - """Settings for the DNS record.""" - - tags: List[RecordTags] - """Custom tags for the DNS record. This field has no effect on DNS responses.""" - - ttl: TTLParam - """Time To Live (TTL) of the DNS record in seconds. - - Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the - minimum reduced to 30 for Enterprise zones. - """ - - type: Literal["OPENPGPKEY"] - """Record type.""" - - -class PTRRecord(PTRRecordParam): - id: Required[str] - """Identifier""" - - -class SMIMEARecord(SMIMEARecordParam): - id: Required[str] - """Identifier""" - - -class SRVRecord(SRVRecordParam): - id: Required[str] - """Identifier""" - - -class SSHFPRecord(SSHFPRecordParam): - id: Required[str] - """Identifier""" - - -class SVCBRecord(SVCBRecordParam): - id: Required[str] - """Identifier""" - - -class TLSARecord(TLSARecordParam): - id: Required[str] - """Identifier""" - - -class TXTRecord(TXTRecordParam): +class BatchPatchParam(TypedDict, total=False): id: Required[str] """Identifier""" - - -class URIRecord(URIRecordParam): - id: Required[str] - """Identifier""" - - -BatchPatchParam: TypeAlias = Union[ - ARecord, - AAAARecord, - CAARecord, - CERTRecord, - CNAMERecord, - DNSKEYRecord, - DSRecord, - HTTPSRecord, - LOCRecord, - MXRecord, - NAPTRRecord, - NSRecord, - Openpgpkey, - PTRRecord, - SMIMEARecord, - SRVRecord, - SSHFPRecord, - SVCBRecord, - TLSARecord, - TXTRecord, - URIRecord, -] diff --git a/src/cloudflare/types/dns/batch_put_param.py b/src/cloudflare/types/dns/batch_put_param.py index d21c25d5b4c..569562cf422 100644 --- a/src/cloudflare/types/dns/batch_put_param.py +++ b/src/cloudflare/types/dns/batch_put_param.py @@ -2,236 +2,11 @@ from __future__ import annotations -from typing import List, Union -from typing_extensions import Literal, Required, TypeAlias, TypedDict +from typing_extensions import TypedDict -from .ttl_param import TTLParam -from .record_tags import RecordTags -from .a_record_param import ARecordParam -from .ds_record_param import DSRecordParam -from .mx_record_param import MXRecordParam -from .ns_record_param import NSRecordParam -from .caa_record_param import CAARecordParam -from .loc_record_param import LOCRecordParam -from .ptr_record_param import PTRRecordParam -from .srv_record_param import SRVRecordParam -from .txt_record_param import TXTRecordParam -from .uri_record_param import URIRecordParam -from .aaaa_record_param import AAAARecordParam -from .cert_record_param import CERTRecordParam -from .svcb_record_param import SVCBRecordParam -from .tlsa_record_param import TLSARecordParam -from .cname_record_param import CNAMERecordParam -from .https_record_param import HTTPSRecordParam -from .naptr_record_param import NAPTRRecordParam -from .sshfp_record_param import SSHFPRecordParam -from .dnskey_record_param import DNSKEYRecordParam -from .smimea_record_param import SMIMEARecordParam +__all__ = ["BatchPutParam"] -__all__ = [ - "BatchPutParam", - "ARecord", - "AAAARecord", - "CAARecord", - "CERTRecord", - "CNAMERecord", - "DNSKEYRecord", - "DSRecord", - "HTTPSRecord", - "LOCRecord", - "MXRecord", - "NAPTRRecord", - "NSRecord", - "Openpgpkey", - "OpenpgpkeySettings", - "PTRRecord", - "SMIMEARecord", - "SRVRecord", - "SSHFPRecord", - "SVCBRecord", - "TLSARecord", - "TXTRecord", - "URIRecord", -] - -class ARecord(ARecordParam): - id: str - """Identifier""" - - -class AAAARecord(AAAARecordParam): - id: str - """Identifier""" - - -class CAARecord(CAARecordParam): - id: str - """Identifier""" - - -class CERTRecord(CERTRecordParam): - id: str - """Identifier""" - - -class CNAMERecord(CNAMERecordParam): - id: str - """Identifier""" - - -class DNSKEYRecord(DNSKEYRecordParam): - id: str - """Identifier""" - - -class DSRecord(DSRecordParam): - id: str - """Identifier""" - - -class HTTPSRecord(HTTPSRecordParam): - id: str - """Identifier""" - - -class LOCRecord(LOCRecordParam): - id: str - """Identifier""" - - -class MXRecord(MXRecordParam): - id: str - """Identifier""" - - -class NAPTRRecord(NAPTRRecordParam): - id: str - """Identifier""" - - -class NSRecord(NSRecordParam): - id: str - """Identifier""" - - -class OpenpgpkeySettings(TypedDict, total=False): - ipv4_only: bool - """ - When enabled, only A records will be generated, and AAAA records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - ipv6_only: bool - """ - When enabled, only AAAA records will be generated, and A records will not be - created. This setting is intended for exceptional cases. Note that this option - only applies to proxied records and it has no effect on whether Cloudflare - communicates with the origin using IPv4 or IPv6. - """ - - -class Openpgpkey(TypedDict, total=False): - content: Required[str] - """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" - - name: Required[str] - """DNS record name (or @ for the zone apex) in Punycode.""" - - type: Required[Literal["OPENPGPKEY"]] - """Record type.""" - - id: str - """Identifier""" - - comment: str - """Comments or notes about the DNS record. - - This field has no effect on DNS responses. - """ - - proxied: bool - """ - Whether the record is receiving the performance and security benefits of - Cloudflare. - """ - - settings: OpenpgpkeySettings - """Settings for the DNS record.""" - - tags: List[RecordTags] - """Custom tags for the DNS record. This field has no effect on DNS responses.""" - - ttl: TTLParam - """Time To Live (TTL) of the DNS record in seconds. - - Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the - minimum reduced to 30 for Enterprise zones. - """ - - -class PTRRecord(PTRRecordParam): - id: str - """Identifier""" - - -class SMIMEARecord(SMIMEARecordParam): - id: str - """Identifier""" - - -class SRVRecord(SRVRecordParam): - id: str - """Identifier""" - - -class SSHFPRecord(SSHFPRecordParam): - id: str - """Identifier""" - - -class SVCBRecord(SVCBRecordParam): - id: str - """Identifier""" - - -class TLSARecord(TLSARecordParam): - id: str - """Identifier""" - - -class TXTRecord(TXTRecordParam): +class BatchPutParam(TypedDict, total=False): id: str """Identifier""" - - -class URIRecord(URIRecordParam): - id: str - """Identifier""" - - -BatchPutParam: TypeAlias = Union[ - ARecord, - AAAARecord, - CAARecord, - CERTRecord, - CNAMERecord, - DNSKEYRecord, - DSRecord, - HTTPSRecord, - LOCRecord, - MXRecord, - NAPTRRecord, - NSRecord, - Openpgpkey, - PTRRecord, - SMIMEARecord, - SRVRecord, - SSHFPRecord, - SVCBRecord, - TLSARecord, - TXTRecord, - URIRecord, -] diff --git a/src/cloudflare/types/dns/record_batch_params.py b/src/cloudflare/types/dns/record_batch_params.py index cb31cfdef94..2cf352b1a3b 100644 --- a/src/cloudflare/types/dns/record_batch_params.py +++ b/src/cloudflare/types/dns/record_batch_params.py @@ -5,7 +5,6 @@ from typing import Iterable from typing_extensions import Required, TypedDict -from .record_param import RecordParam from .batch_put_param import BatchPutParam from .batch_patch_param import BatchPatchParam @@ -20,7 +19,7 @@ class RecordBatchParams(TypedDict, total=False): patches: Iterable[BatchPatchParam] - posts: Iterable[RecordParam] + posts: Iterable[object] puts: Iterable[BatchPutParam] diff --git a/src/cloudflare/types/email_routing/__init__.py b/src/cloudflare/types/email_routing/__init__.py index 553bab1e508..f7faf7406b5 100644 --- a/src/cloudflare/types/email_routing/__init__.py +++ b/src/cloudflare/types/email_routing/__init__.py @@ -5,7 +5,6 @@ from .action import Action as Action from .address import Address as Address from .matcher import Matcher as Matcher -from .settings import Settings as Settings from .dns_record import DNSRecord as DNSRecord from .action_param import ActionParam as ActionParam from .matcher_param import MatcherParam as MatcherParam diff --git a/src/cloudflare/types/email_routing/settings.py b/src/cloudflare/types/email_routing/settings.py deleted file mode 100644 index 9688cfbe2d1..00000000000 --- a/src/cloudflare/types/email_routing/settings.py +++ /dev/null @@ -1,38 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["Settings"] - - -class Settings(BaseModel): - id: str - """Email Routing settings identifier.""" - - enabled: Literal[True, False] - """State of the zone settings for Email Routing.""" - - name: str - """Domain of your zone.""" - - created: Optional[datetime] = None - """The date and time the settings have been created.""" - - modified: Optional[datetime] = None - """The date and time the settings have been modified.""" - - skip_wizard: Optional[Literal[True, False]] = None - """Flag to check if the user skipped the configuration wizard.""" - - status: Optional[Literal["ready", "unconfigured", "misconfigured", "misconfigured/locked", "unlocked"]] = None - """Show the state of your account, and the type or configuration error.""" - - tag: Optional[str] = None - """Email Routing settings tag. - - (Deprecated, replaced by Email Routing settings identifier) - """ diff --git a/src/cloudflare/types/firewall/__init__.py b/src/cloudflare/types/firewall/__init__.py index 63d1a171785..8ba37c3d7d9 100644 --- a/src/cloudflare/types/firewall/__init__.py +++ b/src/cloudflare/types/firewall/__init__.py @@ -21,7 +21,6 @@ from .country_configuration import CountryConfiguration as CountryConfiguration from .rule_bulk_edit_params import RuleBulkEditParams as RuleBulkEditParams from .ua_rule_create_params import UARuleCreateParams as UARuleCreateParams -from .ua_rule_list_response import UARuleListResponse as UARuleListResponse from .ua_rule_update_params import UARuleUpdateParams as UARuleUpdateParams from .lockdown_create_params import LockdownCreateParams as LockdownCreateParams from .lockdown_update_params import LockdownUpdateParams as LockdownUpdateParams diff --git a/src/cloudflare/types/firewall/ua_rule_list_response.py b/src/cloudflare/types/firewall/ua_rule_list_response.py deleted file mode 100644 index d3426a93fc3..00000000000 --- a/src/cloudflare/types/firewall/ua_rule_list_response.py +++ /dev/null @@ -1,39 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["UARuleListResponse", "Configuration"] - - -class Configuration(BaseModel): - target: Optional[str] = None - """The configuration target for this rule. - - You must set the target to `ua` for User Agent Blocking rules. - """ - - value: Optional[str] = None - """The exact user agent string to match. - - This value will be compared to the received `User-Agent` HTTP header value. - """ - - -class UARuleListResponse(BaseModel): - id: Optional[str] = None - """The unique identifier of the User Agent Blocking rule.""" - - configuration: Optional[Configuration] = None - """The configuration object for the current rule.""" - - description: Optional[str] = None - """An informative summary of the rule.""" - - mode: Optional[Literal["block", "challenge", "js_challenge", "managed_challenge"]] = None - """The action to apply to a matched request.""" - - paused: Optional[bool] = None - """When true, indicates that the rule is currently paused.""" diff --git a/src/cloudflare/types/hyperdrive/config_create_params.py b/src/cloudflare/types/hyperdrive/config_create_params.py index 479ceac25c3..07584b855a0 100644 --- a/src/cloudflare/types/hyperdrive/config_create_params.py +++ b/src/cloudflare/types/hyperdrive/config_create_params.py @@ -11,7 +11,6 @@ "OriginPublicDatabase", "OriginAccessProtectedDatabaseBehindCloudflareTunnel", "Caching", - "CachingHyperdriveHyperdriveCachingCommon", "CachingHyperdriveHyperdriveCachingEnabled", ] @@ -84,11 +83,6 @@ class OriginAccessProtectedDatabaseBehindCloudflareTunnel(TypedDict, total=False Origin: TypeAlias = Union[OriginPublicDatabase, OriginAccessProtectedDatabaseBehindCloudflareTunnel] -class CachingHyperdriveHyperdriveCachingCommon(TypedDict, total=False): - disabled: bool - """When set to true, disables the caching of SQL responses. (Default: false)""" - - class CachingHyperdriveHyperdriveCachingEnabled(TypedDict, total=False): disabled: bool """When set to true, disables the caching of SQL responses. (Default: false)""" @@ -107,4 +101,4 @@ class CachingHyperdriveHyperdriveCachingEnabled(TypedDict, total=False): """ -Caching: TypeAlias = Union[CachingHyperdriveHyperdriveCachingCommon, CachingHyperdriveHyperdriveCachingEnabled] +Caching: TypeAlias = Union[CachingHyperdriveHyperdriveCachingEnabled, object] diff --git a/src/cloudflare/types/hyperdrive/config_edit_params.py b/src/cloudflare/types/hyperdrive/config_edit_params.py index a84932552af..031a114e30a 100644 --- a/src/cloudflare/types/hyperdrive/config_edit_params.py +++ b/src/cloudflare/types/hyperdrive/config_edit_params.py @@ -8,7 +8,6 @@ __all__ = [ "ConfigEditParams", "Caching", - "CachingHyperdriveHyperdriveCachingCommon", "CachingHyperdriveHyperdriveCachingEnabled", "Origin", "OriginHyperdriveHyperdriveDatabase", @@ -28,11 +27,6 @@ class ConfigEditParams(TypedDict, total=False): origin: Origin -class CachingHyperdriveHyperdriveCachingCommon(TypedDict, total=False): - disabled: bool - """When set to true, disables the caching of SQL responses. (Default: false)""" - - class CachingHyperdriveHyperdriveCachingEnabled(TypedDict, total=False): disabled: bool """When set to true, disables the caching of SQL responses. (Default: false)""" @@ -51,7 +45,7 @@ class CachingHyperdriveHyperdriveCachingEnabled(TypedDict, total=False): """ -Caching: TypeAlias = Union[CachingHyperdriveHyperdriveCachingCommon, CachingHyperdriveHyperdriveCachingEnabled] +Caching: TypeAlias = Union[CachingHyperdriveHyperdriveCachingEnabled, object] class OriginHyperdriveHyperdriveDatabase(TypedDict, total=False): diff --git a/src/cloudflare/types/hyperdrive/config_update_params.py b/src/cloudflare/types/hyperdrive/config_update_params.py index e5677f427fe..6301b86feba 100644 --- a/src/cloudflare/types/hyperdrive/config_update_params.py +++ b/src/cloudflare/types/hyperdrive/config_update_params.py @@ -11,7 +11,6 @@ "OriginPublicDatabase", "OriginAccessProtectedDatabaseBehindCloudflareTunnel", "Caching", - "CachingHyperdriveHyperdriveCachingCommon", "CachingHyperdriveHyperdriveCachingEnabled", ] @@ -84,11 +83,6 @@ class OriginAccessProtectedDatabaseBehindCloudflareTunnel(TypedDict, total=False Origin: TypeAlias = Union[OriginPublicDatabase, OriginAccessProtectedDatabaseBehindCloudflareTunnel] -class CachingHyperdriveHyperdriveCachingCommon(TypedDict, total=False): - disabled: bool - """When set to true, disables the caching of SQL responses. (Default: false)""" - - class CachingHyperdriveHyperdriveCachingEnabled(TypedDict, total=False): disabled: bool """When set to true, disables the caching of SQL responses. (Default: false)""" @@ -107,4 +101,4 @@ class CachingHyperdriveHyperdriveCachingEnabled(TypedDict, total=False): """ -Caching: TypeAlias = Union[CachingHyperdriveHyperdriveCachingCommon, CachingHyperdriveHyperdriveCachingEnabled] +Caching: TypeAlias = Union[CachingHyperdriveHyperdriveCachingEnabled, object] diff --git a/src/cloudflare/types/hyperdrive/hyperdrive.py b/src/cloudflare/types/hyperdrive/hyperdrive.py index 7e86822c1ee..3795f53cdda 100644 --- a/src/cloudflare/types/hyperdrive/hyperdrive.py +++ b/src/cloudflare/types/hyperdrive/hyperdrive.py @@ -11,7 +11,6 @@ "OriginPublicDatabase", "OriginAccessProtectedDatabaseBehindCloudflareTunnel", "Caching", - "CachingHyperdriveHyperdriveCachingCommon", "CachingHyperdriveHyperdriveCachingEnabled", ] @@ -55,11 +54,6 @@ class OriginAccessProtectedDatabaseBehindCloudflareTunnel(BaseModel): Origin: TypeAlias = Union[OriginPublicDatabase, OriginAccessProtectedDatabaseBehindCloudflareTunnel] -class CachingHyperdriveHyperdriveCachingCommon(BaseModel): - disabled: Optional[bool] = None - """When set to true, disables the caching of SQL responses. (Default: false)""" - - class CachingHyperdriveHyperdriveCachingEnabled(BaseModel): disabled: Optional[bool] = None """When set to true, disables the caching of SQL responses. (Default: false)""" @@ -78,7 +72,7 @@ class CachingHyperdriveHyperdriveCachingEnabled(BaseModel): """ -Caching: TypeAlias = Union[CachingHyperdriveHyperdriveCachingCommon, CachingHyperdriveHyperdriveCachingEnabled] +Caching: TypeAlias = Union[CachingHyperdriveHyperdriveCachingEnabled, object] class Hyperdrive(BaseModel): diff --git a/src/cloudflare/types/intel/domain.py b/src/cloudflare/types/intel/domain.py index cb2b105cacb..3e23c48daa8 100644 --- a/src/cloudflare/types/intel/domain.py +++ b/src/cloudflare/types/intel/domain.py @@ -4,16 +4,7 @@ from ..._models import BaseModel -__all__ = [ - "Domain", - "AdditionalInformation", - "Application", - "ContentCategory", - "InheritedContentCategory", - "InheritedRiskType", - "ResolvesToRef", - "RiskType", -] +__all__ = ["Domain", "AdditionalInformation", "Application", "ContentCategory", "ResolvesToRef"] class AdditionalInformation(BaseModel): @@ -35,22 +26,6 @@ class ContentCategory(BaseModel): super_category_id: Optional[int] = None -class InheritedContentCategory(BaseModel): - id: Optional[int] = None - - name: Optional[str] = None - - super_category_id: Optional[int] = None - - -class InheritedRiskType(BaseModel): - id: Optional[int] = None - - name: Optional[str] = None - - super_category_id: Optional[int] = None - - class ResolvesToRef(BaseModel): id: Optional[str] = None """ @@ -62,14 +37,6 @@ class ResolvesToRef(BaseModel): """IP address or domain name.""" -class RiskType(BaseModel): - id: Optional[int] = None - - name: Optional[str] = None - - super_category_id: Optional[int] = None - - class Domain(BaseModel): additional_information: Optional[AdditionalInformation] = None """Additional information related to the host name.""" @@ -81,7 +48,7 @@ class Domain(BaseModel): domain: Optional[str] = None - inherited_content_categories: Optional[List[InheritedContentCategory]] = None + inherited_content_categories: Optional[object] = None inherited_from: Optional[str] = None """ @@ -89,7 +56,7 @@ class Domain(BaseModel): inherited, if applicable. """ - inherited_risk_types: Optional[List[InheritedRiskType]] = None + inherited_risk_types: Optional[object] = None popularity_rank: Optional[int] = None """ @@ -109,4 +76,4 @@ class Domain(BaseModel): risk). """ - risk_types: Optional[List[RiskType]] = None + risk_types: Optional[object] = None diff --git a/src/cloudflare/types/intel/domains/bulk_get_response.py b/src/cloudflare/types/intel/domains/bulk_get_response.py index b9f7bf47c05..2f353b7a885 100644 --- a/src/cloudflare/types/intel/domains/bulk_get_response.py +++ b/src/cloudflare/types/intel/domains/bulk_get_response.py @@ -11,9 +11,6 @@ "BulkGetResponseItemAdditionalInformation", "BulkGetResponseItemApplication", "BulkGetResponseItemContentCategory", - "BulkGetResponseItemInheritedContentCategory", - "BulkGetResponseItemInheritedRiskType", - "BulkGetResponseItemRiskType", ] @@ -36,30 +33,6 @@ class BulkGetResponseItemContentCategory(BaseModel): super_category_id: Optional[int] = None -class BulkGetResponseItemInheritedContentCategory(BaseModel): - id: Optional[int] = None - - name: Optional[str] = None - - super_category_id: Optional[int] = None - - -class BulkGetResponseItemInheritedRiskType(BaseModel): - id: Optional[int] = None - - name: Optional[str] = None - - super_category_id: Optional[int] = None - - -class BulkGetResponseItemRiskType(BaseModel): - id: Optional[int] = None - - name: Optional[str] = None - - super_category_id: Optional[int] = None - - class BulkGetResponseItem(BaseModel): additional_information: Optional[BulkGetResponseItemAdditionalInformation] = None """Additional information related to the host name.""" @@ -71,7 +44,7 @@ class BulkGetResponseItem(BaseModel): domain: Optional[str] = None - inherited_content_categories: Optional[List[BulkGetResponseItemInheritedContentCategory]] = None + inherited_content_categories: Optional[object] = None inherited_from: Optional[str] = None """ @@ -79,7 +52,7 @@ class BulkGetResponseItem(BaseModel): inherited, if applicable. """ - inherited_risk_types: Optional[List[BulkGetResponseItemInheritedRiskType]] = None + inherited_risk_types: Optional[object] = None popularity_rank: Optional[int] = None """ @@ -93,7 +66,7 @@ class BulkGetResponseItem(BaseModel): risk). """ - risk_types: Optional[List[BulkGetResponseItemRiskType]] = None + risk_types: Optional[object] = None BulkGetResponse: TypeAlias = List[BulkGetResponseItem] diff --git a/src/cloudflare/types/leaked_credential_checks/detection_create_params.py b/src/cloudflare/types/leaked_credential_checks/detection_create_params.py index f7277cce6d9..22a5952359a 100644 --- a/src/cloudflare/types/leaked_credential_checks/detection_create_params.py +++ b/src/cloudflare/types/leaked_credential_checks/detection_create_params.py @@ -11,6 +11,9 @@ class DetectionCreateParams(TypedDict, total=False): zone_id: Required[str] """Identifier""" + id: object + """The unique ID for this custom detection""" + password: str """The ruleset expression to use in matching the password in a request""" diff --git a/src/cloudflare/types/leaked_credential_checks/detection_create_response.py b/src/cloudflare/types/leaked_credential_checks/detection_create_response.py index e8e7ea5cc6d..e59fbd3083a 100644 --- a/src/cloudflare/types/leaked_credential_checks/detection_create_response.py +++ b/src/cloudflare/types/leaked_credential_checks/detection_create_response.py @@ -8,7 +8,7 @@ class DetectionCreateResponse(BaseModel): - id: Optional[str] = None + id: Optional[object] = None """The unique ID for this custom detection""" password: Optional[str] = None diff --git a/src/cloudflare/types/leaked_credential_checks/detection_list_response.py b/src/cloudflare/types/leaked_credential_checks/detection_list_response.py index 9423f3750aa..52d54c2394f 100644 --- a/src/cloudflare/types/leaked_credential_checks/detection_list_response.py +++ b/src/cloudflare/types/leaked_credential_checks/detection_list_response.py @@ -8,7 +8,7 @@ class DetectionListResponse(BaseModel): - id: Optional[str] = None + id: Optional[object] = None """The unique ID for this custom detection""" password: Optional[str] = None diff --git a/src/cloudflare/types/leaked_credential_checks/detection_update_params.py b/src/cloudflare/types/leaked_credential_checks/detection_update_params.py index cbff67e0ab2..0eb60c62eaa 100644 --- a/src/cloudflare/types/leaked_credential_checks/detection_update_params.py +++ b/src/cloudflare/types/leaked_credential_checks/detection_update_params.py @@ -11,6 +11,9 @@ class DetectionUpdateParams(TypedDict, total=False): zone_id: Required[str] """Identifier""" + id: object + """The unique ID for this custom detection""" + password: str """The ruleset expression to use in matching the password in a request""" diff --git a/src/cloudflare/types/leaked_credential_checks/detection_update_response.py b/src/cloudflare/types/leaked_credential_checks/detection_update_response.py index da71290916a..fa8568955bb 100644 --- a/src/cloudflare/types/leaked_credential_checks/detection_update_response.py +++ b/src/cloudflare/types/leaked_credential_checks/detection_update_response.py @@ -8,7 +8,7 @@ class DetectionUpdateResponse(BaseModel): - id: Optional[str] = None + id: Optional[object] = None """The unique ID for this custom detection""" password: Optional[str] = None diff --git a/src/cloudflare/types/magic_transit/__init__.py b/src/cloudflare/types/magic_transit/__init__.py index 26a12934156..7504cc48f94 100644 --- a/src/cloudflare/types/magic_transit/__init__.py +++ b/src/cloudflare/types/magic_transit/__init__.py @@ -7,7 +7,6 @@ from .scope import Scope as Scope from .pcap_filter import PCAPFilter as PCAPFilter from .scope_param import ScopeParam as ScopeParam -from .health_check import HealthCheck as HealthCheck from .psk_metadata import PSKMetadata as PSKMetadata from .site_location import SiteLocation as SiteLocation from .site_edit_params import SiteEditParams as SiteEditParams diff --git a/src/cloudflare/types/magic_transit/cf_interconnect_bulk_update_response.py b/src/cloudflare/types/magic_transit/cf_interconnect_bulk_update_response.py index 958181967d4..38470793939 100644 --- a/src/cloudflare/types/magic_transit/cf_interconnect_bulk_update_response.py +++ b/src/cloudflare/types/magic_transit/cf_interconnect_bulk_update_response.py @@ -4,7 +4,6 @@ from datetime import datetime from ..._models import BaseModel -from .health_check import HealthCheck __all__ = ["CfInterconnectBulkUpdateResponse", "ModifiedInterconnect", "ModifiedInterconnectGRE"] @@ -33,7 +32,7 @@ class ModifiedInterconnect(BaseModel): gre: Optional[ModifiedInterconnectGRE] = None """The configuration specific to GRE interconnects.""" - health_check: Optional[HealthCheck] = None + health_check: Optional[object] = None interface_address: Optional[str] = None """ diff --git a/src/cloudflare/types/magic_transit/cf_interconnect_get_response.py b/src/cloudflare/types/magic_transit/cf_interconnect_get_response.py index fb80d488f78..d2063c1fceb 100644 --- a/src/cloudflare/types/magic_transit/cf_interconnect_get_response.py +++ b/src/cloudflare/types/magic_transit/cf_interconnect_get_response.py @@ -4,7 +4,6 @@ from datetime import datetime from ..._models import BaseModel -from .health_check import HealthCheck __all__ = ["CfInterconnectGetResponse", "Interconnect", "InterconnectGRE"] @@ -33,7 +32,7 @@ class Interconnect(BaseModel): gre: Optional[InterconnectGRE] = None """The configuration specific to GRE interconnects.""" - health_check: Optional[HealthCheck] = None + health_check: Optional[object] = None interface_address: Optional[str] = None """ diff --git a/src/cloudflare/types/magic_transit/cf_interconnect_list_response.py b/src/cloudflare/types/magic_transit/cf_interconnect_list_response.py index 6dcb1098fe2..e7654b5cec8 100644 --- a/src/cloudflare/types/magic_transit/cf_interconnect_list_response.py +++ b/src/cloudflare/types/magic_transit/cf_interconnect_list_response.py @@ -4,7 +4,6 @@ from datetime import datetime from ..._models import BaseModel -from .health_check import HealthCheck __all__ = ["CfInterconnectListResponse", "Interconnect", "InterconnectGRE"] @@ -33,7 +32,7 @@ class Interconnect(BaseModel): gre: Optional[InterconnectGRE] = None """The configuration specific to GRE interconnects.""" - health_check: Optional[HealthCheck] = None + health_check: Optional[object] = None interface_address: Optional[str] = None """ diff --git a/src/cloudflare/types/magic_transit/cf_interconnect_update_response.py b/src/cloudflare/types/magic_transit/cf_interconnect_update_response.py index ec43a7deb52..b7f541e4475 100644 --- a/src/cloudflare/types/magic_transit/cf_interconnect_update_response.py +++ b/src/cloudflare/types/magic_transit/cf_interconnect_update_response.py @@ -4,7 +4,6 @@ from datetime import datetime from ..._models import BaseModel -from .health_check import HealthCheck __all__ = ["CfInterconnectUpdateResponse", "ModifiedInterconnect", "ModifiedInterconnectGRE"] @@ -33,7 +32,7 @@ class ModifiedInterconnect(BaseModel): gre: Optional[ModifiedInterconnectGRE] = None """The configuration specific to GRE interconnects.""" - health_check: Optional[HealthCheck] = None + health_check: Optional[object] = None interface_address: Optional[str] = None """ diff --git a/src/cloudflare/types/magic_transit/health_check.py b/src/cloudflare/types/magic_transit/health_check.py deleted file mode 100644 index 6ee301b8764..00000000000 --- a/src/cloudflare/types/magic_transit/health_check.py +++ /dev/null @@ -1,52 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .health_check_rate import HealthCheckRate -from .health_check_type import HealthCheckType - -__all__ = ["HealthCheck", "Target", "TargetMagicHealthCheckTarget"] - - -class TargetMagicHealthCheckTarget(BaseModel): - effective: Optional[str] = None - """The effective health check target. - - If 'saved' is empty, then this field will be populated with the calculated - default value on GET requests. Ignored in POST, PUT, and PATCH requests. - """ - - saved: Optional[str] = None - """The saved health check target. - - Setting the value to the empty string indicates that the calculated default - value will be used. - """ - - -Target: TypeAlias = Union[TargetMagicHealthCheckTarget, str] - - -class HealthCheck(BaseModel): - enabled: Optional[bool] = None - """Determines whether to run healthchecks for a tunnel.""" - - rate: Optional[HealthCheckRate] = None - """How frequent the health check is run. The default value is `mid`.""" - - target: Optional[Target] = None - """The destination address in a request type health check. - - After the healthcheck is decapsulated at the customer end of the tunnel, the - ICMP echo will be forwarded to this address. This field defaults to - `customer_gre_endpoint address`. This field is ignored for bidirectional - healthchecks as the interface_address (not assigned to the Cloudflare side of - the tunnel) is used as the target. Must be in object form if the - x-magic-new-hc-target header is set to true and string form if - x-magic-new-hc-target is absent or set to false. - """ - - type: Optional[HealthCheckType] = None - """The type of healthcheck to run, reply or request. The default value is `reply`.""" diff --git a/src/cloudflare/types/memberships/membership.py b/src/cloudflare/types/memberships/membership.py index 58d3be9f330..92727cbd688 100644 --- a/src/cloudflare/types/memberships/membership.py +++ b/src/cloudflare/types/memberships/membership.py @@ -4,7 +4,6 @@ from typing_extensions import Literal from ..._models import BaseModel -from ..accounts.account import Account from ..shared.permission_grant import PermissionGrant __all__ = ["Membership", "Permissions"] @@ -40,7 +39,7 @@ class Membership(BaseModel): id: Optional[str] = None """Membership identifier tag.""" - account: Optional[Account] = None + account: Optional[object] = None api_access_enabled: Optional[bool] = None """Enterprise only. diff --git a/src/cloudflare/types/memberships/membership_get_response.py b/src/cloudflare/types/memberships/membership_get_response.py index 524eaa1ead9..a942338d931 100644 --- a/src/cloudflare/types/memberships/membership_get_response.py +++ b/src/cloudflare/types/memberships/membership_get_response.py @@ -4,7 +4,6 @@ from typing_extensions import Literal from ..._models import BaseModel -from ..accounts.account import Account from ..shared.permission_grant import PermissionGrant __all__ = [ @@ -120,7 +119,7 @@ class MembershipGetResponse(BaseModel): id: Optional[str] = None """Membership identifier tag.""" - account: Optional[Account] = None + account: Optional[object] = None api_access_enabled: Optional[bool] = None """Enterprise only. diff --git a/src/cloudflare/types/memberships/membership_update_response.py b/src/cloudflare/types/memberships/membership_update_response.py index 7f6b238103c..44139a0d7de 100644 --- a/src/cloudflare/types/memberships/membership_update_response.py +++ b/src/cloudflare/types/memberships/membership_update_response.py @@ -4,7 +4,6 @@ from typing_extensions import Literal from ..._models import BaseModel -from ..accounts.account import Account from ..shared.permission_grant import PermissionGrant __all__ = [ @@ -120,7 +119,7 @@ class MembershipUpdateResponse(BaseModel): id: Optional[str] = None """Membership identifier tag.""" - account: Optional[Account] = None + account: Optional[object] = None api_access_enabled: Optional[bool] = None """Enterprise only. diff --git a/src/cloudflare/types/registrar/__init__.py b/src/cloudflare/types/registrar/__init__.py index d6102a096f4..ec299b4608a 100644 --- a/src/cloudflare/types/registrar/__init__.py +++ b/src/cloudflare/types/registrar/__init__.py @@ -2,5 +2,4 @@ from __future__ import annotations -from .domain import Domain as Domain from .domain_update_params import DomainUpdateParams as DomainUpdateParams diff --git a/src/cloudflare/types/registrar/domain.py b/src/cloudflare/types/registrar/domain.py deleted file mode 100644 index 949c123cb82..00000000000 --- a/src/cloudflare/types/registrar/domain.py +++ /dev/null @@ -1,116 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["Domain", "RegistrantContact", "TransferIn"] - - -class RegistrantContact(BaseModel): - address: str - """Address.""" - - city: str - """City.""" - - country: Optional[str] = None - """The country in which the user lives.""" - - first_name: Optional[str] = None - """User's first name""" - - last_name: Optional[str] = None - """User's last name""" - - organization: str - """Name of organization.""" - - phone: Optional[str] = None - """User's telephone number""" - - state: str - """State.""" - - zip: Optional[str] = None - """The zipcode or postal code where the user lives.""" - - id: Optional[str] = None - """Contact Identifier.""" - - address2: Optional[str] = None - """Optional address line for unit, floor, suite, etc.""" - - email: Optional[str] = None - """The contact email address of the user.""" - - fax: Optional[str] = None - """Contact fax number.""" - - -class TransferIn(BaseModel): - accept_foa: Optional[Literal["needed", "ok"]] = None - """Form of authorization has been accepted by the registrant.""" - - approve_transfer: Optional[Literal["needed", "ok", "pending", "trying", "rejected", "unknown"]] = None - """Shows transfer status with the registry.""" - - can_cancel_transfer: Optional[bool] = None - """Indicates if cancellation is still possible.""" - - disable_privacy: Optional[Literal["needed", "ok", "unknown"]] = None - """Privacy guards are disabled at the foreign registrar.""" - - enter_auth_code: Optional[Literal["needed", "ok", "pending", "trying", "rejected"]] = None - """Auth code has been entered and verified.""" - - unlock_domain: Optional[Literal["needed", "ok", "pending", "trying", "unknown"]] = None - """Domain is unlocked at the foreign registrar.""" - - -class Domain(BaseModel): - id: Optional[str] = None - """Domain identifier.""" - - available: Optional[bool] = None - """Shows if a domain is available for transferring into Cloudflare Registrar.""" - - can_register: Optional[bool] = None - """Indicates if the domain can be registered as a new domain.""" - - created_at: Optional[datetime] = None - """Shows time of creation.""" - - current_registrar: Optional[str] = None - """Shows name of current registrar.""" - - expires_at: Optional[datetime] = None - """Shows when domain name registration expires.""" - - locked: Optional[bool] = None - """Shows whether a registrar lock is in place for a domain.""" - - registrant_contact: Optional[RegistrantContact] = None - """Shows contact information for domain registrant.""" - - registry_statuses: Optional[str] = None - """A comma-separated list of registry status codes. - - A full list of status codes can be found at - [EPP Status Codes](https://www.icann.org/resources/pages/epp-status-codes-2014-06-16-en). - """ - - supported_tld: Optional[bool] = None - """Whether a particular TLD is currently supported by Cloudflare Registrar. - - Refer to [TLD Policies](https://www.cloudflare.com/tld-policies/) for a list of - supported TLDs. - """ - - transfer_in: Optional[TransferIn] = None - """Statuses for domain transfers into Cloudflare Registrar.""" - - updated_at: Optional[datetime] = None - """Last updated.""" diff --git a/src/cloudflare/types/spectrum/analytics/events/bytime_get_response.py b/src/cloudflare/types/spectrum/analytics/events/bytime_get_response.py index 9920bd395a4..02e67b40b2e 100644 --- a/src/cloudflare/types/spectrum/analytics/events/bytime_get_response.py +++ b/src/cloudflare/types/spectrum/analytics/events/bytime_get_response.py @@ -71,7 +71,7 @@ class Query(BaseModel): | duration99th | 99th percentile connection duration | 1.0 | Time in milliseconds. | """ - since: Optional[datetime] = None + since: Optional[object] = None """Start of time interval to query, defaults to `until` - 6 hours. Timestamp must be in RFC3339 format and uses UTC unless otherwise specified. @@ -83,7 +83,7 @@ class Query(BaseModel): `dimensions`. """ - until: Optional[datetime] = None + until: Optional[object] = None """End of time interval to query, defaults to current time. Timestamp must be in RFC3339 format and uses UTC unless otherwise specified. diff --git a/src/cloudflare/types/spectrum/analytics/events/summary_get_response.py b/src/cloudflare/types/spectrum/analytics/events/summary_get_response.py index b6e48698e47..c2a86456a7f 100644 --- a/src/cloudflare/types/spectrum/analytics/events/summary_get_response.py +++ b/src/cloudflare/types/spectrum/analytics/events/summary_get_response.py @@ -71,7 +71,7 @@ class Query(BaseModel): | duration99th | 99th percentile connection duration | 1.0 | Time in milliseconds. | """ - since: Optional[datetime] = None + since: Optional[object] = None """Start of time interval to query, defaults to `until` - 6 hours. Timestamp must be in RFC3339 format and uses UTC unless otherwise specified. @@ -83,7 +83,7 @@ class Query(BaseModel): `dimensions`. """ - until: Optional[datetime] = None + until: Optional[object] = None """End of time interval to query, defaults to current time. Timestamp must be in RFC3339 format and uses UTC unless otherwise specified. diff --git a/src/cloudflare/types/spectrum/app_create_response.py b/src/cloudflare/types/spectrum/app_create_response.py index a1517db4c4c..adf3aed78ca 100644 --- a/src/cloudflare/types/spectrum/app_create_response.py +++ b/src/cloudflare/types/spectrum/app_create_response.py @@ -14,10 +14,10 @@ class SpectrumConfigAppConfig(BaseModel): - id: str + id: object """App identifier.""" - created_on: datetime + created_on: object """When the Application was created.""" dns: DNS @@ -29,7 +29,7 @@ class SpectrumConfigAppConfig(BaseModel): applications. """ - modified_on: datetime + modified_on: object """When the Application was last modified.""" protocol: str diff --git a/src/cloudflare/types/spectrum/app_get_response.py b/src/cloudflare/types/spectrum/app_get_response.py index 0042b85955a..7587e4b4973 100644 --- a/src/cloudflare/types/spectrum/app_get_response.py +++ b/src/cloudflare/types/spectrum/app_get_response.py @@ -14,10 +14,10 @@ class SpectrumConfigAppConfig(BaseModel): - id: str + id: object """App identifier.""" - created_on: datetime + created_on: object """When the Application was created.""" dns: DNS @@ -29,7 +29,7 @@ class SpectrumConfigAppConfig(BaseModel): applications. """ - modified_on: datetime + modified_on: object """When the Application was last modified.""" protocol: str diff --git a/src/cloudflare/types/spectrum/app_list_response.py b/src/cloudflare/types/spectrum/app_list_response.py index 2d4dcaa2c89..e4f70569d8f 100644 --- a/src/cloudflare/types/spectrum/app_list_response.py +++ b/src/cloudflare/types/spectrum/app_list_response.py @@ -14,10 +14,10 @@ class UnionMember0(BaseModel): - id: str + id: object """App identifier.""" - created_on: datetime + created_on: object """When the Application was created.""" dns: DNS @@ -29,7 +29,7 @@ class UnionMember0(BaseModel): applications. """ - modified_on: datetime + modified_on: object """When the Application was last modified.""" protocol: str diff --git a/src/cloudflare/types/spectrum/app_update_response.py b/src/cloudflare/types/spectrum/app_update_response.py index d440aa156d6..b11fd8e9b1a 100644 --- a/src/cloudflare/types/spectrum/app_update_response.py +++ b/src/cloudflare/types/spectrum/app_update_response.py @@ -14,10 +14,10 @@ class SpectrumConfigAppConfig(BaseModel): - id: str + id: object """App identifier.""" - created_on: datetime + created_on: object """When the Application was created.""" dns: DNS @@ -29,7 +29,7 @@ class SpectrumConfigAppConfig(BaseModel): applications. """ - modified_on: datetime + modified_on: object """When the Application was last modified.""" protocol: str diff --git a/src/cloudflare/types/workers/scripts/__init__.py b/src/cloudflare/types/workers/scripts/__init__.py index c8b592499c2..2bfe5d911a9 100644 --- a/src/cloudflare/types/workers/scripts/__init__.py +++ b/src/cloudflare/types/workers/scripts/__init__.py @@ -2,7 +2,6 @@ from __future__ import annotations -from .schedule import Schedule as Schedule from .deployment import Deployment as Deployment from .schedule_param import ScheduleParam as ScheduleParam from .consumer_script import ConsumerScript as ConsumerScript diff --git a/src/cloudflare/types/workers/scripts/schedule.py b/src/cloudflare/types/workers/scripts/schedule.py deleted file mode 100644 index 08c504bddf7..00000000000 --- a/src/cloudflare/types/workers/scripts/schedule.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ...._models import BaseModel - -__all__ = ["Schedule"] - - -class Schedule(BaseModel): - created_on: Optional[str] = None - - cron: Optional[str] = None - - modified_on: Optional[str] = None diff --git a/src/cloudflare/types/workers/scripts/schedule_get_response.py b/src/cloudflare/types/workers/scripts/schedule_get_response.py index 5d430c7ce85..f8c45d659a5 100644 --- a/src/cloudflare/types/workers/scripts/schedule_get_response.py +++ b/src/cloudflare/types/workers/scripts/schedule_get_response.py @@ -2,11 +2,10 @@ from typing import List, Optional -from .schedule import Schedule from ...._models import BaseModel __all__ = ["ScheduleGetResponse"] class ScheduleGetResponse(BaseModel): - schedules: Optional[List[Schedule]] = None + schedules: Optional[List[object]] = None diff --git a/src/cloudflare/types/workers/scripts/schedule_update_response.py b/src/cloudflare/types/workers/scripts/schedule_update_response.py index 0024bf49131..200f804bc1e 100644 --- a/src/cloudflare/types/workers/scripts/schedule_update_response.py +++ b/src/cloudflare/types/workers/scripts/schedule_update_response.py @@ -2,11 +2,10 @@ from typing import List, Optional -from .schedule import Schedule from ...._models import BaseModel __all__ = ["ScheduleUpdateResponse"] class ScheduleUpdateResponse(BaseModel): - schedules: Optional[List[Schedule]] = None + schedules: Optional[List[object]] = None diff --git a/src/cloudflare/types/zero_trust/access/users/active_session_get_response.py b/src/cloudflare/types/zero_trust/access/users/active_session_get_response.py index 2414f09a55c..affcc728dad 100644 --- a/src/cloudflare/types/zero_trust/access/users/active_session_get_response.py +++ b/src/cloudflare/types/zero_trust/access/users/active_session_get_response.py @@ -5,7 +5,6 @@ from pydantic import Field as FieldInfo from ....._models import BaseModel -from ..applications.user_policy_check_geo import UserPolicyCheckGeo __all__ = ["ActiveSessionGetResponse", "DeviceSessions", "DevicePosture", "DevicePostureCheck", "IdP", "MTLSAuth"] @@ -73,7 +72,7 @@ class ActiveSessionGetResponse(BaseModel): email: Optional[str] = None - geo: Optional[UserPolicyCheckGeo] = None + geo: Optional[object] = None iat: Optional[float] = None diff --git a/src/cloudflare/types/zero_trust/devices/device_network.py b/src/cloudflare/types/zero_trust/devices/device_network.py index db154213768..c8c7be49ec6 100644 --- a/src/cloudflare/types/zero_trust/devices/device_network.py +++ b/src/cloudflare/types/zero_trust/devices/device_network.py @@ -5,26 +5,11 @@ from ...._models import BaseModel -__all__ = ["DeviceNetwork", "Config"] - - -class Config(BaseModel): - tls_sockaddr: str - """ - A network address of the form "host:port" that the WARP client will use to - detect the presence of a TLS host. - """ - - sha256: Optional[str] = None - """ - The SHA-256 hash of the TLS certificate presented by the host found at - tls_sockaddr. If absent, regular certificate verification (trusted roots, valid - timestamp, etc) will be used to validate the certificate. - """ +__all__ = ["DeviceNetwork"] class DeviceNetwork(BaseModel): - config: Optional[Config] = None + config: Optional[object] = None """ The configuration object containing information for the WARP client to detect the managed network. diff --git a/src/cloudflare/types/zones/__init__.py b/src/cloudflare/types/zones/__init__.py index 5b7501b8935..75e408cfb1e 100644 --- a/src/cloudflare/types/zones/__init__.py +++ b/src/cloudflare/types/zones/__init__.py @@ -90,7 +90,6 @@ from .development_mode_param import DevelopmentModeParam as DevelopmentModeParam from .orange_to_orange_param import OrangeToOrangeParam as OrangeToOrangeParam from .prefetch_preload_param import PrefetchPreloadParam as PrefetchPreloadParam -from .rate_plan_get_response import RatePlanGetResponse as RatePlanGetResponse from .security_headers_param import SecurityHeadersParam as SecurityHeadersParam from .browser_cache_ttl_param import BrowserCacheTTLParam as BrowserCacheTTLParam from .email_obfuscation_param import EmailObfuscationParam as EmailObfuscationParam diff --git a/src/cloudflare/types/zones/rate_plan_get_response.py b/src/cloudflare/types/zones/rate_plan_get_response.py deleted file mode 100644 index 87940e668c0..00000000000 --- a/src/cloudflare/types/zones/rate_plan_get_response.py +++ /dev/null @@ -1,39 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["RatePlanGetResponse", "Component"] - - -class Component(BaseModel): - default: Optional[float] = None - """The default amount allocated.""" - - name: Optional[Literal["zones", "page_rules", "dedicated_certificates", "dedicated_certificates_custom"]] = None - """The unique component.""" - - unit_price: Optional[float] = None - """The unit price of the addon.""" - - -class RatePlanGetResponse(BaseModel): - id: Optional[str] = None - """Plan identifier tag.""" - - components: Optional[List[Component]] = None - """Array of available components values for the plan.""" - - currency: Optional[str] = None - """The monetary unit in which pricing information is displayed.""" - - duration: Optional[float] = None - """The duration of the plan subscription.""" - - frequency: Optional[Literal["weekly", "monthly", "quarterly", "yearly"]] = None - """The frequency at which you will be billed for this plan.""" - - name: Optional[str] = None - """The plan name.""" diff --git a/tests/api_resources/accounts/test_subscriptions.py b/tests/api_resources/accounts/test_subscriptions.py index fe3639ee4a3..8184c5b697e 100644 --- a/tests/api_resources/accounts/test_subscriptions.py +++ b/tests/api_resources/accounts/test_subscriptions.py @@ -10,7 +10,6 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.shared import Subscription from cloudflare.types.accounts import ( SubscriptionCreateResponse, SubscriptionDeleteResponse, @@ -201,7 +200,7 @@ def test_method_get(self, client: Cloudflare) -> None: subscription = client.accounts.subscriptions.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[Subscription], subscription, path=["response"]) + assert_matches_type(SyncSinglePage[object], subscription, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -212,7 +211,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SyncSinglePage[Subscription], subscription, path=["response"]) + assert_matches_type(SyncSinglePage[object], subscription, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -223,7 +222,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SyncSinglePage[Subscription], subscription, path=["response"]) + assert_matches_type(SyncSinglePage[object], subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -416,7 +415,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: subscription = await async_client.accounts.subscriptions.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[Subscription], subscription, path=["response"]) + assert_matches_type(AsyncSinglePage[object], subscription, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -427,7 +426,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(AsyncSinglePage[Subscription], subscription, path=["response"]) + assert_matches_type(AsyncSinglePage[object], subscription, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -438,7 +437,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(AsyncSinglePage[Subscription], subscription, path=["response"]) + assert_matches_type(AsyncSinglePage[object], subscription, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/api_gateway/discovery/test_operations.py b/tests/api_resources/api_gateway/discovery/test_operations.py index 01e6ba3122e..c348411b562 100644 --- a/tests/api_resources/api_gateway/discovery/test_operations.py +++ b/tests/api_resources/api_gateway/discovery/test_operations.py @@ -25,14 +25,14 @@ class TestOperations: @parametrize def test_method_list(self, client: Cloudflare) -> None: operation = client.api_gateway.discovery.operations.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(SyncV4PagePaginationArray[DiscoveryOperation], operation, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: operation = client.api_gateway.discovery.operations.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", diff=True, direction="asc", endpoint="/api/v1", @@ -49,7 +49,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.api_gateway.discovery.operations.with_raw_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -60,7 +60,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.api_gateway.discovery.operations.with_streaming_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -80,7 +80,7 @@ def test_path_params_list(self, client: Cloudflare) -> None: @parametrize def test_method_bulk_edit(self, client: Cloudflare) -> None: operation = client.api_gateway.discovery.operations.bulk_edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", body={ "3818d821-5901-4147-a474-f5f5aec1d54e": {}, "b17c8043-99a0-4202-b7d9-8f7cdbee02cd": {}, @@ -91,7 +91,7 @@ def test_method_bulk_edit(self, client: Cloudflare) -> None: @parametrize def test_raw_response_bulk_edit(self, client: Cloudflare) -> None: response = client.api_gateway.discovery.operations.with_raw_response.bulk_edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", body={ "3818d821-5901-4147-a474-f5f5aec1d54e": {}, "b17c8043-99a0-4202-b7d9-8f7cdbee02cd": {}, @@ -106,7 +106,7 @@ def test_raw_response_bulk_edit(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_bulk_edit(self, client: Cloudflare) -> None: with client.api_gateway.discovery.operations.with_streaming_response.bulk_edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", body={ "3818d821-5901-4147-a474-f5f5aec1d54e": {}, "b17c8043-99a0-4202-b7d9-8f7cdbee02cd": {}, @@ -134,16 +134,16 @@ def test_path_params_bulk_edit(self, client: Cloudflare) -> None: @parametrize def test_method_edit(self, client: Cloudflare) -> None: operation = client.api_gateway.discovery.operations.edit( - operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + operation_id="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + zone_id="zone_id", ) assert_matches_type(OperationEditResponse, operation, path=["response"]) @parametrize def test_method_edit_with_all_params(self, client: Cloudflare) -> None: operation = client.api_gateway.discovery.operations.edit( - operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + operation_id="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + zone_id="zone_id", state="review", ) assert_matches_type(OperationEditResponse, operation, path=["response"]) @@ -151,8 +151,8 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: response = client.api_gateway.discovery.operations.with_raw_response.edit( - operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + operation_id="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + zone_id="zone_id", ) assert response.is_closed is True @@ -163,8 +163,8 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: with client.api_gateway.discovery.operations.with_streaming_response.edit( - operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + operation_id="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -178,14 +178,14 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: def test_path_params_edit(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.api_gateway.discovery.operations.with_raw_response.edit( - operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + operation_id="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", zone_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `operation_id` but received ''"): client.api_gateway.discovery.operations.with_raw_response.edit( operation_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) @@ -195,14 +195,14 @@ class TestAsyncOperations: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.discovery.operations.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(AsyncV4PagePaginationArray[DiscoveryOperation], operation, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.discovery.operations.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", diff=True, direction="asc", endpoint="/api/v1", @@ -219,7 +219,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.discovery.operations.with_raw_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -230,7 +230,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.discovery.operations.with_streaming_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -250,7 +250,7 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_bulk_edit(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.discovery.operations.bulk_edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", body={ "3818d821-5901-4147-a474-f5f5aec1d54e": {}, "b17c8043-99a0-4202-b7d9-8f7cdbee02cd": {}, @@ -261,7 +261,7 @@ async def test_method_bulk_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_bulk_edit(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.discovery.operations.with_raw_response.bulk_edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", body={ "3818d821-5901-4147-a474-f5f5aec1d54e": {}, "b17c8043-99a0-4202-b7d9-8f7cdbee02cd": {}, @@ -276,7 +276,7 @@ async def test_raw_response_bulk_edit(self, async_client: AsyncCloudflare) -> No @parametrize async def test_streaming_response_bulk_edit(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.discovery.operations.with_streaming_response.bulk_edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", body={ "3818d821-5901-4147-a474-f5f5aec1d54e": {}, "b17c8043-99a0-4202-b7d9-8f7cdbee02cd": {}, @@ -304,16 +304,16 @@ async def test_path_params_bulk_edit(self, async_client: AsyncCloudflare) -> Non @parametrize async def test_method_edit(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.discovery.operations.edit( - operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + operation_id="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + zone_id="zone_id", ) assert_matches_type(OperationEditResponse, operation, path=["response"]) @parametrize async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.discovery.operations.edit( - operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + operation_id="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + zone_id="zone_id", state="review", ) assert_matches_type(OperationEditResponse, operation, path=["response"]) @@ -321,8 +321,8 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.discovery.operations.with_raw_response.edit( - operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + operation_id="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + zone_id="zone_id", ) assert response.is_closed is True @@ -333,8 +333,8 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.discovery.operations.with_streaming_response.edit( - operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + operation_id="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -348,12 +348,12 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.api_gateway.discovery.operations.with_raw_response.edit( - operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + operation_id="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", zone_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `operation_id` but received ''"): await async_client.api_gateway.discovery.operations.with_raw_response.edit( operation_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) diff --git a/tests/api_resources/api_gateway/expression_template/test_fallthrough.py b/tests/api_resources/api_gateway/expression_template/test_fallthrough.py index 5dfac36140d..8c4d2b15cf9 100644 --- a/tests/api_resources/api_gateway/expression_template/test_fallthrough.py +++ b/tests/api_resources/api_gateway/expression_template/test_fallthrough.py @@ -20,7 +20,7 @@ class TestFallthrough: @parametrize def test_method_create(self, client: Cloudflare) -> None: fallthrough = client.api_gateway.expression_template.fallthrough.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", hosts=["{zone}.domain1.tld", "domain2.tld"], ) assert_matches_type(FallthroughCreateResponse, fallthrough, path=["response"]) @@ -28,7 +28,7 @@ def test_method_create(self, client: Cloudflare) -> None: @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: response = client.api_gateway.expression_template.fallthrough.with_raw_response.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", hosts=["{zone}.domain1.tld", "domain2.tld"], ) @@ -40,7 +40,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: with client.api_gateway.expression_template.fallthrough.with_streaming_response.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", hosts=["{zone}.domain1.tld", "domain2.tld"], ) as response: assert not response.is_closed @@ -66,7 +66,7 @@ class TestAsyncFallthrough: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: fallthrough = await async_client.api_gateway.expression_template.fallthrough.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", hosts=["{zone}.domain1.tld", "domain2.tld"], ) assert_matches_type(FallthroughCreateResponse, fallthrough, path=["response"]) @@ -74,7 +74,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.expression_template.fallthrough.with_raw_response.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", hosts=["{zone}.domain1.tld", "domain2.tld"], ) @@ -86,7 +86,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.expression_template.fallthrough.with_streaming_response.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", hosts=["{zone}.domain1.tld", "domain2.tld"], ) as response: assert not response.is_closed diff --git a/tests/api_resources/api_gateway/operations/test_schema_validation.py b/tests/api_resources/api_gateway/operations/test_schema_validation.py index 564e422407b..2b01bbd413e 100644 --- a/tests/api_resources/api_gateway/operations/test_schema_validation.py +++ b/tests/api_resources/api_gateway/operations/test_schema_validation.py @@ -25,7 +25,7 @@ class TestSchemaValidation: def test_method_update(self, client: Cloudflare) -> None: schema_validation = client.api_gateway.operations.schema_validation.update( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(SchemaValidationUpdateResponse, schema_validation, path=["response"]) @@ -33,7 +33,7 @@ def test_method_update(self, client: Cloudflare) -> None: def test_method_update_with_all_params(self, client: Cloudflare) -> None: schema_validation = client.api_gateway.operations.schema_validation.update( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", mitigation_action="log", ) assert_matches_type(SchemaValidationUpdateResponse, schema_validation, path=["response"]) @@ -42,7 +42,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_update(self, client: Cloudflare) -> None: response = client.api_gateway.operations.schema_validation.with_raw_response.update( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -54,7 +54,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: def test_streaming_response_update(self, client: Cloudflare) -> None: with client.api_gateway.operations.schema_validation.with_streaming_response.update( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -75,13 +75,13 @@ def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `operation_id` but received ''"): client.api_gateway.operations.schema_validation.with_raw_response.update( operation_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) @parametrize def test_method_edit(self, client: Cloudflare) -> None: schema_validation = client.api_gateway.operations.schema_validation.edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", settings_multiple_request={ "3818d821-5901-4147-a474-f5f5aec1d54e": {}, "b17c8043-99a0-4202-b7d9-8f7cdbee02cd": {}, @@ -92,7 +92,7 @@ def test_method_edit(self, client: Cloudflare) -> None: @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: response = client.api_gateway.operations.schema_validation.with_raw_response.edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", settings_multiple_request={ "3818d821-5901-4147-a474-f5f5aec1d54e": {}, "b17c8043-99a0-4202-b7d9-8f7cdbee02cd": {}, @@ -107,7 +107,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: with client.api_gateway.operations.schema_validation.with_streaming_response.edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", settings_multiple_request={ "3818d821-5901-4147-a474-f5f5aec1d54e": {}, "b17c8043-99a0-4202-b7d9-8f7cdbee02cd": {}, @@ -136,7 +136,7 @@ def test_path_params_edit(self, client: Cloudflare) -> None: def test_method_get(self, client: Cloudflare) -> None: schema_validation = client.api_gateway.operations.schema_validation.get( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(SchemaValidationGetResponse, schema_validation, path=["response"]) @@ -144,7 +144,7 @@ def test_method_get(self, client: Cloudflare) -> None: def test_raw_response_get(self, client: Cloudflare) -> None: response = client.api_gateway.operations.schema_validation.with_raw_response.get( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -156,7 +156,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: def test_streaming_response_get(self, client: Cloudflare) -> None: with client.api_gateway.operations.schema_validation.with_streaming_response.get( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -177,7 +177,7 @@ def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `operation_id` but received ''"): client.api_gateway.operations.schema_validation.with_raw_response.get( operation_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) @@ -188,7 +188,7 @@ class TestAsyncSchemaValidation: async def test_method_update(self, async_client: AsyncCloudflare) -> None: schema_validation = await async_client.api_gateway.operations.schema_validation.update( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(SchemaValidationUpdateResponse, schema_validation, path=["response"]) @@ -196,7 +196,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: schema_validation = await async_client.api_gateway.operations.schema_validation.update( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", mitigation_action="log", ) assert_matches_type(SchemaValidationUpdateResponse, schema_validation, path=["response"]) @@ -205,7 +205,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.operations.schema_validation.with_raw_response.update( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -217,7 +217,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.operations.schema_validation.with_streaming_response.update( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -238,13 +238,13 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `operation_id` but received ''"): await async_client.api_gateway.operations.schema_validation.with_raw_response.update( operation_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) @parametrize async def test_method_edit(self, async_client: AsyncCloudflare) -> None: schema_validation = await async_client.api_gateway.operations.schema_validation.edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", settings_multiple_request={ "3818d821-5901-4147-a474-f5f5aec1d54e": {}, "b17c8043-99a0-4202-b7d9-8f7cdbee02cd": {}, @@ -255,7 +255,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.operations.schema_validation.with_raw_response.edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", settings_multiple_request={ "3818d821-5901-4147-a474-f5f5aec1d54e": {}, "b17c8043-99a0-4202-b7d9-8f7cdbee02cd": {}, @@ -270,7 +270,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.operations.schema_validation.with_streaming_response.edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", settings_multiple_request={ "3818d821-5901-4147-a474-f5f5aec1d54e": {}, "b17c8043-99a0-4202-b7d9-8f7cdbee02cd": {}, @@ -299,7 +299,7 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: async def test_method_get(self, async_client: AsyncCloudflare) -> None: schema_validation = await async_client.api_gateway.operations.schema_validation.get( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(SchemaValidationGetResponse, schema_validation, path=["response"]) @@ -307,7 +307,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.operations.schema_validation.with_raw_response.get( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -319,7 +319,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.operations.schema_validation.with_streaming_response.get( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -340,5 +340,5 @@ async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `operation_id` but received ''"): await async_client.api_gateway.operations.schema_validation.with_raw_response.get( operation_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) diff --git a/tests/api_resources/api_gateway/settings/test_schema_validation.py b/tests/api_resources/api_gateway/settings/test_schema_validation.py index 55734d6ad11..af6c54c4b26 100644 --- a/tests/api_resources/api_gateway/settings/test_schema_validation.py +++ b/tests/api_resources/api_gateway/settings/test_schema_validation.py @@ -22,7 +22,7 @@ class TestSchemaValidation: @parametrize def test_method_update(self, client: Cloudflare) -> None: schema_validation = client.api_gateway.settings.schema_validation.update( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", validation_default_mitigation_action="none", ) assert_matches_type(Settings, schema_validation, path=["response"]) @@ -30,7 +30,7 @@ def test_method_update(self, client: Cloudflare) -> None: @parametrize def test_method_update_with_all_params(self, client: Cloudflare) -> None: schema_validation = client.api_gateway.settings.schema_validation.update( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", validation_default_mitigation_action="none", validation_override_mitigation_action="none", ) @@ -39,7 +39,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: response = client.api_gateway.settings.schema_validation.with_raw_response.update( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", validation_default_mitigation_action="none", ) @@ -51,7 +51,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: with client.api_gateway.settings.schema_validation.with_streaming_response.update( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", validation_default_mitigation_action="none", ) as response: assert not response.is_closed @@ -73,14 +73,14 @@ def test_path_params_update(self, client: Cloudflare) -> None: @parametrize def test_method_edit(self, client: Cloudflare) -> None: schema_validation = client.api_gateway.settings.schema_validation.edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(Settings, schema_validation, path=["response"]) @parametrize def test_method_edit_with_all_params(self, client: Cloudflare) -> None: schema_validation = client.api_gateway.settings.schema_validation.edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", validation_default_mitigation_action="none", validation_override_mitigation_action="none", ) @@ -89,7 +89,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: response = client.api_gateway.settings.schema_validation.with_raw_response.edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -100,7 +100,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: with client.api_gateway.settings.schema_validation.with_streaming_response.edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -120,14 +120,14 @@ def test_path_params_edit(self, client: Cloudflare) -> None: @parametrize def test_method_get(self, client: Cloudflare) -> None: schema_validation = client.api_gateway.settings.schema_validation.get( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(Settings, schema_validation, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: response = client.api_gateway.settings.schema_validation.with_raw_response.get( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -138,7 +138,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: with client.api_gateway.settings.schema_validation.with_streaming_response.get( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -162,7 +162,7 @@ class TestAsyncSchemaValidation: @parametrize async def test_method_update(self, async_client: AsyncCloudflare) -> None: schema_validation = await async_client.api_gateway.settings.schema_validation.update( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", validation_default_mitigation_action="none", ) assert_matches_type(Settings, schema_validation, path=["response"]) @@ -170,7 +170,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: schema_validation = await async_client.api_gateway.settings.schema_validation.update( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", validation_default_mitigation_action="none", validation_override_mitigation_action="none", ) @@ -179,7 +179,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.settings.schema_validation.with_raw_response.update( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", validation_default_mitigation_action="none", ) @@ -191,7 +191,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.settings.schema_validation.with_streaming_response.update( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", validation_default_mitigation_action="none", ) as response: assert not response.is_closed @@ -213,14 +213,14 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_edit(self, async_client: AsyncCloudflare) -> None: schema_validation = await async_client.api_gateway.settings.schema_validation.edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(Settings, schema_validation, path=["response"]) @parametrize async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: schema_validation = await async_client.api_gateway.settings.schema_validation.edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", validation_default_mitigation_action="none", validation_override_mitigation_action="none", ) @@ -229,7 +229,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.settings.schema_validation.with_raw_response.edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -240,7 +240,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.settings.schema_validation.with_streaming_response.edit( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -260,14 +260,14 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: schema_validation = await async_client.api_gateway.settings.schema_validation.get( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(Settings, schema_validation, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.settings.schema_validation.with_raw_response.get( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -278,7 +278,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.settings.schema_validation.with_streaming_response.get( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/api_gateway/test_configurations.py b/tests/api_resources/api_gateway/test_configurations.py index 13bdbc85420..7994bafae24 100644 --- a/tests/api_resources/api_gateway/test_configurations.py +++ b/tests/api_resources/api_gateway/test_configurations.py @@ -23,7 +23,7 @@ class TestConfigurations: @parametrize def test_method_update(self, client: Cloudflare) -> None: configuration = client.api_gateway.configurations.update( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", auth_id_characteristics=[ { "name": "authorization", @@ -36,7 +36,7 @@ def test_method_update(self, client: Cloudflare) -> None: @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: response = client.api_gateway.configurations.with_raw_response.update( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", auth_id_characteristics=[ { "name": "authorization", @@ -53,7 +53,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: with client.api_gateway.configurations.with_streaming_response.update( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", auth_id_characteristics=[ { "name": "authorization", @@ -85,14 +85,14 @@ def test_path_params_update(self, client: Cloudflare) -> None: @parametrize def test_method_get(self, client: Cloudflare) -> None: configuration = client.api_gateway.configurations.get( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(Configuration, configuration, path=["response"]) @parametrize def test_method_get_with_all_params(self, client: Cloudflare) -> None: configuration = client.api_gateway.configurations.get( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", properties=["auth_id_characteristics"], ) assert_matches_type(Configuration, configuration, path=["response"]) @@ -100,7 +100,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: response = client.api_gateway.configurations.with_raw_response.get( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -111,7 +111,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: with client.api_gateway.configurations.with_streaming_response.get( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -135,7 +135,7 @@ class TestAsyncConfigurations: @parametrize async def test_method_update(self, async_client: AsyncCloudflare) -> None: configuration = await async_client.api_gateway.configurations.update( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", auth_id_characteristics=[ { "name": "authorization", @@ -148,7 +148,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.configurations.with_raw_response.update( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", auth_id_characteristics=[ { "name": "authorization", @@ -165,7 +165,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.configurations.with_streaming_response.update( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", auth_id_characteristics=[ { "name": "authorization", @@ -197,14 +197,14 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: configuration = await async_client.api_gateway.configurations.get( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(Configuration, configuration, path=["response"]) @parametrize async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: configuration = await async_client.api_gateway.configurations.get( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", properties=["auth_id_characteristics"], ) assert_matches_type(Configuration, configuration, path=["response"]) @@ -212,7 +212,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.configurations.with_raw_response.get( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -223,7 +223,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.configurations.with_streaming_response.get( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/api_gateway/test_discovery.py b/tests/api_resources/api_gateway/test_discovery.py index f41ab529266..0c2e94534e8 100644 --- a/tests/api_resources/api_gateway/test_discovery.py +++ b/tests/api_resources/api_gateway/test_discovery.py @@ -20,14 +20,14 @@ class TestDiscovery: @parametrize def test_method_get(self, client: Cloudflare) -> None: discovery = client.api_gateway.discovery.get( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(DiscoveryGetResponse, discovery, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: response = client.api_gateway.discovery.with_raw_response.get( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -38,7 +38,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: with client.api_gateway.discovery.with_streaming_response.get( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -62,14 +62,14 @@ class TestAsyncDiscovery: @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: discovery = await async_client.api_gateway.discovery.get( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(DiscoveryGetResponse, discovery, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.discovery.with_raw_response.get( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -80,7 +80,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.discovery.with_streaming_response.get( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/api_gateway/test_operations.py b/tests/api_resources/api_gateway/test_operations.py index c363d5857b1..5750e169f73 100644 --- a/tests/api_resources/api_gateway/test_operations.py +++ b/tests/api_resources/api_gateway/test_operations.py @@ -28,7 +28,7 @@ class TestOperations: @parametrize def test_method_create(self, client: Cloudflare) -> None: operation = client.api_gateway.operations.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", endpoint="/api/v1/users/{var1}", host="www.example.com", method="GET", @@ -38,7 +38,7 @@ def test_method_create(self, client: Cloudflare) -> None: @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: response = client.api_gateway.operations.with_raw_response.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", endpoint="/api/v1/users/{var1}", host="www.example.com", method="GET", @@ -52,7 +52,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: with client.api_gateway.operations.with_streaming_response.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", endpoint="/api/v1/users/{var1}", host="www.example.com", method="GET", @@ -78,14 +78,14 @@ def test_path_params_create(self, client: Cloudflare) -> None: @parametrize def test_method_list(self, client: Cloudflare) -> None: operation = client.api_gateway.operations.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(SyncV4PagePaginationArray[OperationListResponse], operation, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: operation = client.api_gateway.operations.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", direction="asc", endpoint="/api/v1", feature=["thresholds"], @@ -100,7 +100,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.api_gateway.operations.with_raw_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -111,7 +111,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.api_gateway.operations.with_streaming_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -132,7 +132,7 @@ def test_path_params_list(self, client: Cloudflare) -> None: def test_method_delete(self, client: Cloudflare) -> None: operation = client.api_gateway.operations.delete( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(OperationDeleteResponse, operation, path=["response"]) @@ -140,7 +140,7 @@ def test_method_delete(self, client: Cloudflare) -> None: def test_raw_response_delete(self, client: Cloudflare) -> None: response = client.api_gateway.operations.with_raw_response.delete( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -152,7 +152,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: def test_streaming_response_delete(self, client: Cloudflare) -> None: with client.api_gateway.operations.with_streaming_response.delete( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -173,13 +173,13 @@ def test_path_params_delete(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `operation_id` but received ''"): client.api_gateway.operations.with_raw_response.delete( operation_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) @parametrize def test_method_bulk_create(self, client: Cloudflare) -> None: operation = client.api_gateway.operations.bulk_create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", body=[ { "endpoint": "/api/v1/users/{var1}", @@ -193,7 +193,7 @@ def test_method_bulk_create(self, client: Cloudflare) -> None: @parametrize def test_raw_response_bulk_create(self, client: Cloudflare) -> None: response = client.api_gateway.operations.with_raw_response.bulk_create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", body=[ { "endpoint": "/api/v1/users/{var1}", @@ -211,7 +211,7 @@ def test_raw_response_bulk_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_bulk_create(self, client: Cloudflare) -> None: with client.api_gateway.operations.with_streaming_response.bulk_create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", body=[ { "endpoint": "/api/v1/users/{var1}", @@ -245,14 +245,14 @@ def test_path_params_bulk_create(self, client: Cloudflare) -> None: @parametrize def test_method_bulk_delete(self, client: Cloudflare) -> None: operation = client.api_gateway.operations.bulk_delete( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(OperationBulkDeleteResponse, operation, path=["response"]) @parametrize def test_raw_response_bulk_delete(self, client: Cloudflare) -> None: response = client.api_gateway.operations.with_raw_response.bulk_delete( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -263,7 +263,7 @@ def test_raw_response_bulk_delete(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_bulk_delete(self, client: Cloudflare) -> None: with client.api_gateway.operations.with_streaming_response.bulk_delete( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -284,7 +284,7 @@ def test_path_params_bulk_delete(self, client: Cloudflare) -> None: def test_method_get(self, client: Cloudflare) -> None: operation = client.api_gateway.operations.get( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(OperationGetResponse, operation, path=["response"]) @@ -292,7 +292,7 @@ def test_method_get(self, client: Cloudflare) -> None: def test_method_get_with_all_params(self, client: Cloudflare) -> None: operation = client.api_gateway.operations.get( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", feature=["thresholds"], ) assert_matches_type(OperationGetResponse, operation, path=["response"]) @@ -301,7 +301,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_get(self, client: Cloudflare) -> None: response = client.api_gateway.operations.with_raw_response.get( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -313,7 +313,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: def test_streaming_response_get(self, client: Cloudflare) -> None: with client.api_gateway.operations.with_streaming_response.get( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -334,7 +334,7 @@ def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `operation_id` but received ''"): client.api_gateway.operations.with_raw_response.get( operation_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) @@ -344,7 +344,7 @@ class TestAsyncOperations: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.operations.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", endpoint="/api/v1/users/{var1}", host="www.example.com", method="GET", @@ -354,7 +354,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.operations.with_raw_response.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", endpoint="/api/v1/users/{var1}", host="www.example.com", method="GET", @@ -368,7 +368,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.operations.with_streaming_response.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", endpoint="/api/v1/users/{var1}", host="www.example.com", method="GET", @@ -394,14 +394,14 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.operations.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(AsyncV4PagePaginationArray[OperationListResponse], operation, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.operations.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", direction="asc", endpoint="/api/v1", feature=["thresholds"], @@ -416,7 +416,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.operations.with_raw_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -427,7 +427,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.operations.with_streaming_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -448,7 +448,7 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: async def test_method_delete(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.operations.delete( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(OperationDeleteResponse, operation, path=["response"]) @@ -456,7 +456,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.operations.with_raw_response.delete( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -468,7 +468,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.operations.with_streaming_response.delete( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -489,13 +489,13 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `operation_id` but received ''"): await async_client.api_gateway.operations.with_raw_response.delete( operation_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) @parametrize async def test_method_bulk_create(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.operations.bulk_create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", body=[ { "endpoint": "/api/v1/users/{var1}", @@ -509,7 +509,7 @@ async def test_method_bulk_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_bulk_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.operations.with_raw_response.bulk_create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", body=[ { "endpoint": "/api/v1/users/{var1}", @@ -527,7 +527,7 @@ async def test_raw_response_bulk_create(self, async_client: AsyncCloudflare) -> @parametrize async def test_streaming_response_bulk_create(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.operations.with_streaming_response.bulk_create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", body=[ { "endpoint": "/api/v1/users/{var1}", @@ -561,14 +561,14 @@ async def test_path_params_bulk_create(self, async_client: AsyncCloudflare) -> N @parametrize async def test_method_bulk_delete(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.operations.bulk_delete( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(OperationBulkDeleteResponse, operation, path=["response"]) @parametrize async def test_raw_response_bulk_delete(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.operations.with_raw_response.bulk_delete( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -579,7 +579,7 @@ async def test_raw_response_bulk_delete(self, async_client: AsyncCloudflare) -> @parametrize async def test_streaming_response_bulk_delete(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.operations.with_streaming_response.bulk_delete( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -600,7 +600,7 @@ async def test_path_params_bulk_delete(self, async_client: AsyncCloudflare) -> N async def test_method_get(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.operations.get( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(OperationGetResponse, operation, path=["response"]) @@ -608,7 +608,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.operations.get( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", feature=["thresholds"], ) assert_matches_type(OperationGetResponse, operation, path=["response"]) @@ -617,7 +617,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.operations.with_raw_response.get( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -629,7 +629,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.operations.with_streaming_response.get( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -650,5 +650,5 @@ async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `operation_id` but received ''"): await async_client.api_gateway.operations.with_raw_response.get( operation_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) diff --git a/tests/api_resources/api_gateway/test_schemas.py b/tests/api_resources/api_gateway/test_schemas.py index 5c2542b4cb5..0c2cbad5f87 100644 --- a/tests/api_resources/api_gateway/test_schemas.py +++ b/tests/api_resources/api_gateway/test_schemas.py @@ -20,14 +20,14 @@ class TestSchemas: @parametrize def test_method_list(self, client: Cloudflare) -> None: schema = client.api_gateway.schemas.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(SchemaListResponse, schema, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: schema = client.api_gateway.schemas.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", feature=["thresholds"], host=["www.example.com"], ) @@ -36,7 +36,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.api_gateway.schemas.with_raw_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -47,7 +47,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.api_gateway.schemas.with_streaming_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -71,14 +71,14 @@ class TestAsyncSchemas: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: schema = await async_client.api_gateway.schemas.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(SchemaListResponse, schema, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: schema = await async_client.api_gateway.schemas.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", feature=["thresholds"], host=["www.example.com"], ) @@ -87,7 +87,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.schemas.with_raw_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -98,7 +98,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.schemas.with_streaming_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/api_gateway/test_user_schemas.py b/tests/api_resources/api_gateway/test_user_schemas.py index 9ebdf9e6b15..a13d1f897e1 100644 --- a/tests/api_resources/api_gateway/test_user_schemas.py +++ b/tests/api_resources/api_gateway/test_user_schemas.py @@ -25,7 +25,7 @@ class TestUserSchemas: @parametrize def test_method_create(self, client: Cloudflare) -> None: user_schema = client.api_gateway.user_schemas.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", file=b"raw file contents", kind="openapi_v3", ) @@ -34,7 +34,7 @@ def test_method_create(self, client: Cloudflare) -> None: @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: user_schema = client.api_gateway.user_schemas.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", file=b"raw file contents", kind="openapi_v3", name="petstore schema", @@ -45,7 +45,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: response = client.api_gateway.user_schemas.with_raw_response.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", file=b"raw file contents", kind="openapi_v3", ) @@ -58,7 +58,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: with client.api_gateway.user_schemas.with_streaming_response.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", file=b"raw file contents", kind="openapi_v3", ) as response: @@ -82,14 +82,14 @@ def test_path_params_create(self, client: Cloudflare) -> None: @parametrize def test_method_list(self, client: Cloudflare) -> None: user_schema = client.api_gateway.user_schemas.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(SyncV4PagePaginationArray[PublicSchema], user_schema, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: user_schema = client.api_gateway.user_schemas.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", omit_source=True, page=1, per_page=5, @@ -100,7 +100,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.api_gateway.user_schemas.with_raw_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -111,7 +111,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.api_gateway.user_schemas.with_streaming_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -132,7 +132,7 @@ def test_path_params_list(self, client: Cloudflare) -> None: def test_method_delete(self, client: Cloudflare) -> None: user_schema = client.api_gateway.user_schemas.delete( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(UserSchemaDeleteResponse, user_schema, path=["response"]) @@ -140,7 +140,7 @@ def test_method_delete(self, client: Cloudflare) -> None: def test_raw_response_delete(self, client: Cloudflare) -> None: response = client.api_gateway.user_schemas.with_raw_response.delete( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -152,7 +152,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: def test_streaming_response_delete(self, client: Cloudflare) -> None: with client.api_gateway.user_schemas.with_streaming_response.delete( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -173,14 +173,14 @@ def test_path_params_delete(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `schema_id` but received ''"): client.api_gateway.user_schemas.with_raw_response.delete( schema_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) @parametrize def test_method_edit(self, client: Cloudflare) -> None: user_schema = client.api_gateway.user_schemas.edit( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(PublicSchema, user_schema, path=["response"]) @@ -188,7 +188,7 @@ def test_method_edit(self, client: Cloudflare) -> None: def test_method_edit_with_all_params(self, client: Cloudflare) -> None: user_schema = client.api_gateway.user_schemas.edit( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", validation_enabled=True, ) assert_matches_type(PublicSchema, user_schema, path=["response"]) @@ -197,7 +197,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_edit(self, client: Cloudflare) -> None: response = client.api_gateway.user_schemas.with_raw_response.edit( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -209,7 +209,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: def test_streaming_response_edit(self, client: Cloudflare) -> None: with client.api_gateway.user_schemas.with_streaming_response.edit( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -230,14 +230,14 @@ def test_path_params_edit(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `schema_id` but received ''"): client.api_gateway.user_schemas.with_raw_response.edit( schema_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) @parametrize def test_method_get(self, client: Cloudflare) -> None: user_schema = client.api_gateway.user_schemas.get( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(PublicSchema, user_schema, path=["response"]) @@ -245,7 +245,7 @@ def test_method_get(self, client: Cloudflare) -> None: def test_method_get_with_all_params(self, client: Cloudflare) -> None: user_schema = client.api_gateway.user_schemas.get( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", omit_source=True, ) assert_matches_type(PublicSchema, user_schema, path=["response"]) @@ -254,7 +254,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_get(self, client: Cloudflare) -> None: response = client.api_gateway.user_schemas.with_raw_response.get( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -266,7 +266,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: def test_streaming_response_get(self, client: Cloudflare) -> None: with client.api_gateway.user_schemas.with_streaming_response.get( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -287,7 +287,7 @@ def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `schema_id` but received ''"): client.api_gateway.user_schemas.with_raw_response.get( schema_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) @@ -297,7 +297,7 @@ class TestAsyncUserSchemas: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: user_schema = await async_client.api_gateway.user_schemas.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", file=b"raw file contents", kind="openapi_v3", ) @@ -306,7 +306,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: user_schema = await async_client.api_gateway.user_schemas.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", file=b"raw file contents", kind="openapi_v3", name="petstore schema", @@ -317,7 +317,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.user_schemas.with_raw_response.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", file=b"raw file contents", kind="openapi_v3", ) @@ -330,7 +330,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.user_schemas.with_streaming_response.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", file=b"raw file contents", kind="openapi_v3", ) as response: @@ -354,14 +354,14 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: user_schema = await async_client.api_gateway.user_schemas.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(AsyncV4PagePaginationArray[PublicSchema], user_schema, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: user_schema = await async_client.api_gateway.user_schemas.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", omit_source=True, page=1, per_page=5, @@ -372,7 +372,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.user_schemas.with_raw_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -383,7 +383,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.user_schemas.with_streaming_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -404,7 +404,7 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: async def test_method_delete(self, async_client: AsyncCloudflare) -> None: user_schema = await async_client.api_gateway.user_schemas.delete( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(UserSchemaDeleteResponse, user_schema, path=["response"]) @@ -412,7 +412,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.user_schemas.with_raw_response.delete( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -424,7 +424,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.user_schemas.with_streaming_response.delete( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -445,14 +445,14 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `schema_id` but received ''"): await async_client.api_gateway.user_schemas.with_raw_response.delete( schema_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) @parametrize async def test_method_edit(self, async_client: AsyncCloudflare) -> None: user_schema = await async_client.api_gateway.user_schemas.edit( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(PublicSchema, user_schema, path=["response"]) @@ -460,7 +460,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: user_schema = await async_client.api_gateway.user_schemas.edit( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", validation_enabled=True, ) assert_matches_type(PublicSchema, user_schema, path=["response"]) @@ -469,7 +469,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.user_schemas.with_raw_response.edit( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -481,7 +481,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.user_schemas.with_streaming_response.edit( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -502,14 +502,14 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `schema_id` but received ''"): await async_client.api_gateway.user_schemas.with_raw_response.edit( schema_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: user_schema = await async_client.api_gateway.user_schemas.get( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(PublicSchema, user_schema, path=["response"]) @@ -517,7 +517,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: user_schema = await async_client.api_gateway.user_schemas.get( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", omit_source=True, ) assert_matches_type(PublicSchema, user_schema, path=["response"]) @@ -526,7 +526,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.user_schemas.with_raw_response.get( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -538,7 +538,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.user_schemas.with_streaming_response.get( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -559,5 +559,5 @@ async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `schema_id` but received ''"): await async_client.api_gateway.user_schemas.with_raw_response.get( schema_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) diff --git a/tests/api_resources/api_gateway/user_schemas/test_hosts.py b/tests/api_resources/api_gateway/user_schemas/test_hosts.py index 6b9b80c5228..4df913398c7 100644 --- a/tests/api_resources/api_gateway/user_schemas/test_hosts.py +++ b/tests/api_resources/api_gateway/user_schemas/test_hosts.py @@ -21,14 +21,14 @@ class TestHosts: @parametrize def test_method_list(self, client: Cloudflare) -> None: host = client.api_gateway.user_schemas.hosts.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(SyncV4PagePaginationArray[HostListResponse], host, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: host = client.api_gateway.user_schemas.hosts.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", page=1, per_page=5, ) @@ -37,7 +37,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.api_gateway.user_schemas.hosts.with_raw_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -48,7 +48,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.api_gateway.user_schemas.hosts.with_streaming_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -72,14 +72,14 @@ class TestAsyncHosts: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: host = await async_client.api_gateway.user_schemas.hosts.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(AsyncV4PagePaginationArray[HostListResponse], host, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: host = await async_client.api_gateway.user_schemas.hosts.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", page=1, per_page=5, ) @@ -88,7 +88,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.user_schemas.hosts.with_raw_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -99,7 +99,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.user_schemas.hosts.with_streaming_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/api_gateway/user_schemas/test_operations.py b/tests/api_resources/api_gateway/user_schemas/test_operations.py index 64234507893..1d94342c5b2 100644 --- a/tests/api_resources/api_gateway/user_schemas/test_operations.py +++ b/tests/api_resources/api_gateway/user_schemas/test_operations.py @@ -22,7 +22,7 @@ class TestOperations: def test_method_list(self, client: Cloudflare) -> None: operation = client.api_gateway.user_schemas.operations.list( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(SyncV4PagePaginationArray[OperationListResponse], operation, path=["response"]) @@ -30,7 +30,7 @@ def test_method_list(self, client: Cloudflare) -> None: def test_method_list_with_all_params(self, client: Cloudflare) -> None: operation = client.api_gateway.user_schemas.operations.list( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", endpoint="/api/v1", feature=["thresholds"], host=["api.cloudflare.com"], @@ -45,7 +45,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_list(self, client: Cloudflare) -> None: response = client.api_gateway.user_schemas.operations.with_raw_response.list( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -57,7 +57,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: def test_streaming_response_list(self, client: Cloudflare) -> None: with client.api_gateway.user_schemas.operations.with_streaming_response.list( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -78,7 +78,7 @@ def test_path_params_list(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `schema_id` but received ''"): client.api_gateway.user_schemas.operations.with_raw_response.list( schema_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) @@ -89,7 +89,7 @@ class TestAsyncOperations: async def test_method_list(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.user_schemas.operations.list( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert_matches_type(AsyncV4PagePaginationArray[OperationListResponse], operation, path=["response"]) @@ -97,7 +97,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.user_schemas.operations.list( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", endpoint="/api/v1", feature=["thresholds"], host=["api.cloudflare.com"], @@ -112,7 +112,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.user_schemas.operations.with_raw_response.list( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) assert response.is_closed is True @@ -124,7 +124,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.user_schemas.operations.with_streaming_response.list( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -145,5 +145,5 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `schema_id` but received ''"): await async_client.api_gateway.user_schemas.operations.with_raw_response.list( schema_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="zone_id", ) diff --git a/tests/api_resources/dns/test_records.py b/tests/api_resources/dns/test_records.py index d66e3f1af77..df70f04e7bf 100644 --- a/tests/api_resources/dns/test_records.py +++ b/tests/api_resources/dns/test_records.py @@ -3110,53 +3110,9 @@ def test_method_batch_with_all_params(self, client: Cloudflare) -> None: record = client.dns.records.batch( zone_id="023e105f4ecef8ad9ca31a8372d0c353", deletes=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], - patches=[ - { - "comment": "Domain verification record", - "content": "198.51.100.4", - "name": "example.com", - "proxied": True, - "settings": { - "ipv4_only": True, - "ipv6_only": True, - }, - "tags": ["owner:dns-team"], - "ttl": 3600, - "type": "A", - "id": "023e105f4ecef8ad9ca31a8372d0c353", - } - ], - posts=[ - { - "comment": "Domain verification record", - "content": "198.51.100.4", - "name": "example.com", - "proxied": True, - "settings": { - "ipv4_only": True, - "ipv6_only": True, - }, - "tags": ["owner:dns-team"], - "ttl": 3600, - "type": "A", - } - ], - puts=[ - { - "comment": "Domain verification record", - "content": "198.51.100.4", - "name": "example.com", - "proxied": True, - "settings": { - "ipv4_only": True, - "ipv6_only": True, - }, - "tags": ["owner:dns-team"], - "ttl": 3600, - "type": "A", - "id": "023e105f4ecef8ad9ca31a8372d0c353", - } - ], + patches=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + posts=[{}], + puts=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], ) assert_matches_type(Optional[RecordBatchResponse], record, path=["response"]) @@ -8056,53 +8012,9 @@ async def test_method_batch_with_all_params(self, async_client: AsyncCloudflare) record = await async_client.dns.records.batch( zone_id="023e105f4ecef8ad9ca31a8372d0c353", deletes=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], - patches=[ - { - "comment": "Domain verification record", - "content": "198.51.100.4", - "name": "example.com", - "proxied": True, - "settings": { - "ipv4_only": True, - "ipv6_only": True, - }, - "tags": ["owner:dns-team"], - "ttl": 3600, - "type": "A", - "id": "023e105f4ecef8ad9ca31a8372d0c353", - } - ], - posts=[ - { - "comment": "Domain verification record", - "content": "198.51.100.4", - "name": "example.com", - "proxied": True, - "settings": { - "ipv4_only": True, - "ipv6_only": True, - }, - "tags": ["owner:dns-team"], - "ttl": 3600, - "type": "A", - } - ], - puts=[ - { - "comment": "Domain verification record", - "content": "198.51.100.4", - "name": "example.com", - "proxied": True, - "settings": { - "ipv4_only": True, - "ipv6_only": True, - }, - "tags": ["owner:dns-team"], - "ttl": 3600, - "type": "A", - "id": "023e105f4ecef8ad9ca31a8372d0c353", - } - ], + patches=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + posts=[{}], + puts=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], ) assert_matches_type(Optional[RecordBatchResponse], record, path=["response"]) diff --git a/tests/api_resources/email_routing/test_dns.py b/tests/api_resources/email_routing/test_dns.py index a4c80ef0659..08de0686942 100644 --- a/tests/api_resources/email_routing/test_dns.py +++ b/tests/api_resources/email_routing/test_dns.py @@ -3,18 +3,14 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.email_routing import ( - Settings, - DNSRecord, - DNSGetResponse, -) +from cloudflare.types.email_routing import DNSRecord, DNSGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -28,7 +24,7 @@ def test_method_create(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", name="example.net", ) - assert_matches_type(Optional[Settings], dns, path=["response"]) + assert_matches_type(object, dns, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -40,7 +36,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" dns = response.parse() - assert_matches_type(Optional[Settings], dns, path=["response"]) + assert_matches_type(object, dns, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -52,7 +48,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" dns = response.parse() - assert_matches_type(Optional[Settings], dns, path=["response"]) + assert_matches_type(object, dns, path=["response"]) assert cast(Any, response.is_closed) is True @@ -108,7 +104,7 @@ def test_method_edit(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", name="example.net", ) - assert_matches_type(Optional[Settings], dns, path=["response"]) + assert_matches_type(object, dns, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: @@ -120,7 +116,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" dns = response.parse() - assert_matches_type(Optional[Settings], dns, path=["response"]) + assert_matches_type(object, dns, path=["response"]) @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: @@ -132,7 +128,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" dns = response.parse() - assert_matches_type(Optional[Settings], dns, path=["response"]) + assert_matches_type(object, dns, path=["response"]) assert cast(Any, response.is_closed) is True @@ -200,7 +196,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", name="example.net", ) - assert_matches_type(Optional[Settings], dns, path=["response"]) + assert_matches_type(object, dns, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -212,7 +208,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" dns = await response.parse() - assert_matches_type(Optional[Settings], dns, path=["response"]) + assert_matches_type(object, dns, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -224,7 +220,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" dns = await response.parse() - assert_matches_type(Optional[Settings], dns, path=["response"]) + assert_matches_type(object, dns, path=["response"]) assert cast(Any, response.is_closed) is True @@ -280,7 +276,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", name="example.net", ) - assert_matches_type(Optional[Settings], dns, path=["response"]) + assert_matches_type(object, dns, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -292,7 +288,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" dns = await response.parse() - assert_matches_type(Optional[Settings], dns, path=["response"]) + assert_matches_type(object, dns, path=["response"]) @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -304,7 +300,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" dns = await response.parse() - assert_matches_type(Optional[Settings], dns, path=["response"]) + assert_matches_type(object, dns, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/email_routing/test_rules.py b/tests/api_resources/email_routing/test_rules.py index a95fc1387d4..b622f43e98b 100644 --- a/tests/api_resources/email_routing/test_rules.py +++ b/tests/api_resources/email_routing/test_rules.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest @@ -36,7 +36,7 @@ def test_method_create(self, client: Cloudflare) -> None: } ], ) - assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: @@ -59,7 +59,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: name="Send to user@example.net rule.", priority=0, ) - assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -83,7 +83,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -107,7 +107,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -150,7 +150,7 @@ def test_method_update(self, client: Cloudflare) -> None: } ], ) - assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Cloudflare) -> None: @@ -174,7 +174,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: name="Send to user@example.net rule.", priority=0, ) - assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: @@ -199,7 +199,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: @@ -224,7 +224,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -322,7 +322,7 @@ def test_method_delete(self, client: Cloudflare) -> None: rule_identifier="a7e6fb77503c41d8a7f3113c6918f10c", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -334,7 +334,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -346,7 +346,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -370,7 +370,7 @@ def test_method_get(self, client: Cloudflare) -> None: rule_identifier="a7e6fb77503c41d8a7f3113c6918f10c", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -382,7 +382,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -394,7 +394,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -434,7 +434,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: } ], ) - assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -457,7 +457,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare name="Send to user@example.net rule.", priority=0, ) - assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -481,7 +481,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -505,7 +505,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -548,7 +548,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: } ], ) - assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -572,7 +572,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare name="Send to user@example.net rule.", priority=0, ) - assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @@ -597,7 +597,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: @@ -622,7 +622,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -720,7 +720,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: rule_identifier="a7e6fb77503c41d8a7f3113c6918f10c", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -732,7 +732,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -744,7 +744,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -768,7 +768,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: rule_identifier="a7e6fb77503c41d8a7f3113c6918f10c", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -780,7 +780,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -792,7 +792,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/firewall/test_ua_rules.py b/tests/api_resources/firewall/test_ua_rules.py index 4dae57f296b..8f9552e1363 100644 --- a/tests/api_resources/firewall/test_ua_rules.py +++ b/tests/api_resources/firewall/test_ua_rules.py @@ -12,7 +12,6 @@ from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from cloudflare.types.firewall import ( UARuleGetResponse, - UARuleListResponse, UARuleCreateResponse, UARuleDeleteResponse, UARuleUpdateResponse, @@ -168,7 +167,7 @@ def test_method_list(self, client: Cloudflare) -> None: ua_rule = client.firewall.ua_rules.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncV4PagePaginationArray[UARuleListResponse], ua_rule, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[object], ua_rule, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: @@ -180,7 +179,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: per_page=1, ua_search="Safari", ) - assert_matches_type(SyncV4PagePaginationArray[UARuleListResponse], ua_rule, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[object], ua_rule, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: @@ -191,7 +190,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ua_rule = response.parse() - assert_matches_type(SyncV4PagePaginationArray[UARuleListResponse], ua_rule, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[object], ua_rule, path=["response"]) @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: @@ -202,7 +201,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ua_rule = response.parse() - assert_matches_type(SyncV4PagePaginationArray[UARuleListResponse], ua_rule, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[object], ua_rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -457,7 +456,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: ua_rule = await async_client.firewall.ua_rules.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncV4PagePaginationArray[UARuleListResponse], ua_rule, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[object], ua_rule, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -469,7 +468,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) per_page=1, ua_search="Safari", ) - assert_matches_type(AsyncV4PagePaginationArray[UARuleListResponse], ua_rule, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[object], ua_rule, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @@ -480,7 +479,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ua_rule = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[UARuleListResponse], ua_rule, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[object], ua_rule, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: @@ -491,7 +490,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" ua_rule = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[UARuleListResponse], ua_rule, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[object], ua_rule, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/hyperdrive/test_configs.py b/tests/api_resources/hyperdrive/test_configs.py index 1eca48b91d3..a956e3b3240 100644 --- a/tests/api_resources/hyperdrive/test_configs.py +++ b/tests/api_resources/hyperdrive/test_configs.py @@ -55,7 +55,11 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "scheme": "postgres", "user": "postgres", }, - caching={"disabled": True}, + caching={ + "disabled": True, + "max_age": 60, + "stale_while_revalidate": 15, + }, ) assert_matches_type(ConfigCreateResponse, config, path=["response"]) @@ -153,7 +157,11 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "scheme": "postgres", "user": "postgres", }, - caching={"disabled": True}, + caching={ + "disabled": True, + "max_age": 60, + "stale_while_revalidate": 15, + }, ) assert_matches_type(ConfigUpdateResponse, config, path=["response"]) @@ -337,7 +345,11 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: config = client.hyperdrive.configs.edit( hyperdrive_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", - caching={"disabled": True}, + caching={ + "disabled": True, + "max_age": 60, + "stale_while_revalidate": 15, + }, name="example-hyperdrive", origin={ "database": "postgres", @@ -473,7 +485,11 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "scheme": "postgres", "user": "postgres", }, - caching={"disabled": True}, + caching={ + "disabled": True, + "max_age": 60, + "stale_while_revalidate": 15, + }, ) assert_matches_type(ConfigCreateResponse, config, path=["response"]) @@ -571,7 +587,11 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "scheme": "postgres", "user": "postgres", }, - caching={"disabled": True}, + caching={ + "disabled": True, + "max_age": 60, + "stale_while_revalidate": 15, + }, ) assert_matches_type(ConfigUpdateResponse, config, path=["response"]) @@ -755,7 +775,11 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) config = await async_client.hyperdrive.configs.edit( hyperdrive_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", - caching={"disabled": True}, + caching={ + "disabled": True, + "max_age": 60, + "stale_while_revalidate": 15, + }, name="example-hyperdrive", origin={ "database": "postgres", diff --git a/tests/api_resources/leaked_credential_checks/test_detections.py b/tests/api_resources/leaked_credential_checks/test_detections.py index 94a84b84e7f..2be12eecff7 100644 --- a/tests/api_resources/leaked_credential_checks/test_detections.py +++ b/tests/api_resources/leaked_credential_checks/test_detections.py @@ -33,6 +33,7 @@ def test_method_create(self, client: Cloudflare) -> None: def test_method_create_with_all_params(self, client: Cloudflare) -> None: detection = client.leaked_credential_checks.detections.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="18a14bafaa8eb1df04ce683ec18c765e", password='lookup_json_string(http.request.body.raw, "secret")', username='lookup_json_string(http.request.body.raw, "user")', ) @@ -82,6 +83,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: detection = client.leaked_credential_checks.detections.update( detection_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="18a14bafaa8eb1df04ce683ec18c765e", password='lookup_json_string(http.request.body.raw, "secret")', username='lookup_json_string(http.request.body.raw, "user")', ) @@ -228,6 +230,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: detection = await async_client.leaked_credential_checks.detections.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="18a14bafaa8eb1df04ce683ec18c765e", password='lookup_json_string(http.request.body.raw, "secret")', username='lookup_json_string(http.request.body.raw, "user")', ) @@ -277,6 +280,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare detection = await async_client.leaked_credential_checks.detections.update( detection_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="18a14bafaa8eb1df04ce683ec18c765e", password='lookup_json_string(http.request.body.raw, "secret")', username='lookup_json_string(http.request.body.raw, "user")', ) diff --git a/tests/api_resources/registrar/test_domains.py b/tests/api_resources/registrar/test_domains.py index ebd7b48b403..a89cca75394 100644 --- a/tests/api_resources/registrar/test_domains.py +++ b/tests/api_resources/registrar/test_domains.py @@ -10,7 +10,6 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.registrar import Domain base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -82,7 +81,7 @@ def test_method_list(self, client: Cloudflare) -> None: domain = client.registrar.domains.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[Domain], domain, path=["response"]) + assert_matches_type(SyncSinglePage[object], domain, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: @@ -93,7 +92,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" domain = response.parse() - assert_matches_type(SyncSinglePage[Domain], domain, path=["response"]) + assert_matches_type(SyncSinglePage[object], domain, path=["response"]) @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: @@ -104,7 +103,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" domain = response.parse() - assert_matches_type(SyncSinglePage[Domain], domain, path=["response"]) + assert_matches_type(SyncSinglePage[object], domain, path=["response"]) assert cast(Any, response.is_closed) is True @@ -231,7 +230,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: domain = await async_client.registrar.domains.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[Domain], domain, path=["response"]) + assert_matches_type(AsyncSinglePage[object], domain, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @@ -242,7 +241,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" domain = await response.parse() - assert_matches_type(AsyncSinglePage[Domain], domain, path=["response"]) + assert_matches_type(AsyncSinglePage[object], domain, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: @@ -253,7 +252,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" domain = await response.parse() - assert_matches_type(AsyncSinglePage[Domain], domain, path=["response"]) + assert_matches_type(AsyncSinglePage[object], domain, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_email_routing.py b/tests/api_resources/test_email_routing.py index 6f20c5ca8c3..a0bf7eefe87 100644 --- a/tests/api_resources/test_email_routing.py +++ b/tests/api_resources/test_email_routing.py @@ -3,13 +3,12 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.email_routing import Settings base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +22,7 @@ def test_method_disable(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(Optional[Settings], email_routing, path=["response"]) + assert_matches_type(object, email_routing, path=["response"]) @parametrize def test_raw_response_disable(self, client: Cloudflare) -> None: @@ -35,7 +34,7 @@ def test_raw_response_disable(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = response.parse() - assert_matches_type(Optional[Settings], email_routing, path=["response"]) + assert_matches_type(object, email_routing, path=["response"]) @parametrize def test_streaming_response_disable(self, client: Cloudflare) -> None: @@ -47,7 +46,7 @@ def test_streaming_response_disable(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = response.parse() - assert_matches_type(Optional[Settings], email_routing, path=["response"]) + assert_matches_type(object, email_routing, path=["response"]) assert cast(Any, response.is_closed) is True @@ -65,7 +64,7 @@ def test_method_enable(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(Optional[Settings], email_routing, path=["response"]) + assert_matches_type(object, email_routing, path=["response"]) @parametrize def test_raw_response_enable(self, client: Cloudflare) -> None: @@ -77,7 +76,7 @@ def test_raw_response_enable(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = response.parse() - assert_matches_type(Optional[Settings], email_routing, path=["response"]) + assert_matches_type(object, email_routing, path=["response"]) @parametrize def test_streaming_response_enable(self, client: Cloudflare) -> None: @@ -89,7 +88,7 @@ def test_streaming_response_enable(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = response.parse() - assert_matches_type(Optional[Settings], email_routing, path=["response"]) + assert_matches_type(object, email_routing, path=["response"]) assert cast(Any, response.is_closed) is True @@ -106,7 +105,7 @@ def test_method_get(self, client: Cloudflare) -> None: email_routing = client.email_routing.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[Settings], email_routing, path=["response"]) + assert_matches_type(object, email_routing, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -117,7 +116,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = response.parse() - assert_matches_type(Optional[Settings], email_routing, path=["response"]) + assert_matches_type(object, email_routing, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -128,7 +127,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = response.parse() - assert_matches_type(Optional[Settings], email_routing, path=["response"]) + assert_matches_type(object, email_routing, path=["response"]) assert cast(Any, response.is_closed) is True @@ -149,7 +148,7 @@ async def test_method_disable(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(Optional[Settings], email_routing, path=["response"]) + assert_matches_type(object, email_routing, path=["response"]) @parametrize async def test_raw_response_disable(self, async_client: AsyncCloudflare) -> None: @@ -161,7 +160,7 @@ async def test_raw_response_disable(self, async_client: AsyncCloudflare) -> None assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = await response.parse() - assert_matches_type(Optional[Settings], email_routing, path=["response"]) + assert_matches_type(object, email_routing, path=["response"]) @parametrize async def test_streaming_response_disable(self, async_client: AsyncCloudflare) -> None: @@ -173,7 +172,7 @@ async def test_streaming_response_disable(self, async_client: AsyncCloudflare) - assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = await response.parse() - assert_matches_type(Optional[Settings], email_routing, path=["response"]) + assert_matches_type(object, email_routing, path=["response"]) assert cast(Any, response.is_closed) is True @@ -191,7 +190,7 @@ async def test_method_enable(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(Optional[Settings], email_routing, path=["response"]) + assert_matches_type(object, email_routing, path=["response"]) @parametrize async def test_raw_response_enable(self, async_client: AsyncCloudflare) -> None: @@ -203,7 +202,7 @@ async def test_raw_response_enable(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = await response.parse() - assert_matches_type(Optional[Settings], email_routing, path=["response"]) + assert_matches_type(object, email_routing, path=["response"]) @parametrize async def test_streaming_response_enable(self, async_client: AsyncCloudflare) -> None: @@ -215,7 +214,7 @@ async def test_streaming_response_enable(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = await response.parse() - assert_matches_type(Optional[Settings], email_routing, path=["response"]) + assert_matches_type(object, email_routing, path=["response"]) assert cast(Any, response.is_closed) is True @@ -232,7 +231,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: email_routing = await async_client.email_routing.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[Settings], email_routing, path=["response"]) + assert_matches_type(object, email_routing, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -243,7 +242,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = await response.parse() - assert_matches_type(Optional[Settings], email_routing, path=["response"]) + assert_matches_type(object, email_routing, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -254,7 +253,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = await response.parse() - assert_matches_type(Optional[Settings], email_routing, path=["response"]) + assert_matches_type(object, email_routing, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zones/test_rate_plans.py b/tests/api_resources/zones/test_rate_plans.py index 656e6512dd1..a336d10b98d 100644 --- a/tests/api_resources/zones/test_rate_plans.py +++ b/tests/api_resources/zones/test_rate_plans.py @@ -10,7 +10,6 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.zones import RatePlanGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +22,7 @@ def test_method_get(self, client: Cloudflare) -> None: rate_plan = client.zones.rate_plans.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[RatePlanGetResponse], rate_plan, path=["response"]) + assert_matches_type(SyncSinglePage[object], rate_plan, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -34,7 +33,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rate_plan = response.parse() - assert_matches_type(SyncSinglePage[RatePlanGetResponse], rate_plan, path=["response"]) + assert_matches_type(SyncSinglePage[object], rate_plan, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -45,7 +44,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rate_plan = response.parse() - assert_matches_type(SyncSinglePage[RatePlanGetResponse], rate_plan, path=["response"]) + assert_matches_type(SyncSinglePage[object], rate_plan, path=["response"]) assert cast(Any, response.is_closed) is True @@ -65,7 +64,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: rate_plan = await async_client.zones.rate_plans.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[RatePlanGetResponse], rate_plan, path=["response"]) + assert_matches_type(AsyncSinglePage[object], rate_plan, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -76,7 +75,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rate_plan = await response.parse() - assert_matches_type(AsyncSinglePage[RatePlanGetResponse], rate_plan, path=["response"]) + assert_matches_type(AsyncSinglePage[object], rate_plan, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -87,7 +86,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" rate_plan = await response.parse() - assert_matches_type(AsyncSinglePage[RatePlanGetResponse], rate_plan, path=["response"]) + assert_matches_type(AsyncSinglePage[object], rate_plan, path=["response"]) assert cast(Any, response.is_closed) is True From 898893c52d8a25ea9952e968aa60a1de63d85ea2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 21:37:48 +0000 Subject: [PATCH 163/358] feat(api): api update (#2444) --- .stats.yml | 2 +- .../access/applications/access_rule.py | 12 ++++++ .../access/applications/access_rule_param.py | 12 ++++++ .../types/zero_trust/access/saml_saas_app.py | 14 +++++-- .../zero_trust/access/saml_saas_app_param.py | 14 +++++-- .../zero_trust/access/test_applications.py | 40 +++++++++++-------- 6 files changed, 71 insertions(+), 23 deletions(-) diff --git a/.stats.yml b/.stats.yml index 343122b3abc..6990ab7dc9c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6ce4ac81a963524d955668d167df40ff990317398073943d13daa6a4d068edf5.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b444d98432aba21e447e374c83dd19394bccff7c62a17582d5201273f63369c6.yml diff --git a/src/cloudflare/types/zero_trust/access/applications/access_rule.py b/src/cloudflare/types/zero_trust/access/applications/access_rule.py index 57917aaceab..09100b8aa59 100644 --- a/src/cloudflare/types/zero_trust/access/applications/access_rule.py +++ b/src/cloudflare/types/zero_trust/access/applications/access_rule.py @@ -30,6 +30,8 @@ "AccessAuthContextRuleAuthContext", "AccessCommonNameRule", "AccessCommonNameRuleCommonName", + "AccessLoginMethodRule", + "AccessLoginMethodRuleLoginMethod", ] @@ -57,6 +59,15 @@ class AccessCommonNameRule(BaseModel): common_name: AccessCommonNameRuleCommonName +class AccessLoginMethodRuleLoginMethod(BaseModel): + id: str + """The ID of an identity provider.""" + + +class AccessLoginMethodRule(BaseModel): + login_method: AccessLoginMethodRuleLoginMethod + + AccessRule: TypeAlias = Union[ GroupRule, AnyValidServiceTokenRule, @@ -74,6 +85,7 @@ class AccessCommonNameRule(BaseModel): ExternalEvaluationRule, GitHubOrganizationRule, GSuiteGroupRule, + AccessLoginMethodRule, IPListRule, IPRule, OktaGroupRule, diff --git a/src/cloudflare/types/zero_trust/access/applications/access_rule_param.py b/src/cloudflare/types/zero_trust/access/applications/access_rule_param.py index 7de72ff8ced..0e33f24de62 100644 --- a/src/cloudflare/types/zero_trust/access/applications/access_rule_param.py +++ b/src/cloudflare/types/zero_trust/access/applications/access_rule_param.py @@ -31,6 +31,8 @@ "AccessAuthContextRuleAuthContext", "AccessCommonNameRule", "AccessCommonNameRuleCommonName", + "AccessLoginMethodRule", + "AccessLoginMethodRuleLoginMethod", ] @@ -58,6 +60,15 @@ class AccessCommonNameRule(TypedDict, total=False): common_name: Required[AccessCommonNameRuleCommonName] +class AccessLoginMethodRuleLoginMethod(TypedDict, total=False): + id: Required[str] + """The ID of an identity provider.""" + + +class AccessLoginMethodRule(TypedDict, total=False): + login_method: Required[AccessLoginMethodRuleLoginMethod] + + AccessRuleParam: TypeAlias = Union[ GroupRuleParam, AnyValidServiceTokenRuleParam, @@ -75,6 +86,7 @@ class AccessCommonNameRule(TypedDict, total=False): ExternalEvaluationRuleParam, GitHubOrganizationRuleParam, GSuiteGroupRuleParam, + AccessLoginMethodRule, IPListRuleParam, IPRuleParam, OktaGroupRuleParam, diff --git a/src/cloudflare/types/zero_trust/access/saml_saas_app.py b/src/cloudflare/types/zero_trust/access/saml_saas_app.py index 4912e03680d..bbddbc0a4e7 100644 --- a/src/cloudflare/types/zero_trust/access/saml_saas_app.py +++ b/src/cloudflare/types/zero_trust/access/saml_saas_app.py @@ -1,20 +1,28 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Optional +from typing import List, Optional from datetime import datetime from typing_extensions import Literal from ...._models import BaseModel from .saas_app_name_id_format import SaaSAppNameIDFormat -__all__ = ["SAMLSaaSApp", "CustomAttribute", "CustomAttributeSource"] +__all__ = ["SAMLSaaSApp", "CustomAttribute", "CustomAttributeSource", "CustomAttributeSourceNameByIdP"] + + +class CustomAttributeSourceNameByIdP(BaseModel): + idp_id: Optional[str] = None + """The UID of the IdP.""" + + source_name: Optional[str] = None + """The name of the IdP provided attribute.""" class CustomAttributeSource(BaseModel): name: Optional[str] = None """The name of the IdP attribute.""" - name_by_idp: Optional[Dict[str, str]] = None + name_by_idp: Optional[List[CustomAttributeSourceNameByIdP]] = None """A mapping from IdP ID to attribute name.""" diff --git a/src/cloudflare/types/zero_trust/access/saml_saas_app_param.py b/src/cloudflare/types/zero_trust/access/saml_saas_app_param.py index 34f1827a5a0..41c8bf72677 100644 --- a/src/cloudflare/types/zero_trust/access/saml_saas_app_param.py +++ b/src/cloudflare/types/zero_trust/access/saml_saas_app_param.py @@ -2,19 +2,27 @@ from __future__ import annotations -from typing import Dict, Iterable +from typing import Iterable from typing_extensions import Literal, TypedDict from .saas_app_name_id_format import SaaSAppNameIDFormat -__all__ = ["SAMLSaaSAppParam", "CustomAttribute", "CustomAttributeSource"] +__all__ = ["SAMLSaaSAppParam", "CustomAttribute", "CustomAttributeSource", "CustomAttributeSourceNameByIdP"] + + +class CustomAttributeSourceNameByIdP(TypedDict, total=False): + idp_id: str + """The UID of the IdP.""" + + source_name: str + """The name of the IdP provided attribute.""" class CustomAttributeSource(TypedDict, total=False): name: str """The name of the IdP attribute.""" - name_by_idp: Dict[str, str] + name_by_idp: Iterable[CustomAttributeSourceNameByIdP] """A mapping from IdP ID to attribute name.""" diff --git a/tests/api_resources/zero_trust/access/test_applications.py b/tests/api_resources/zero_trust/access/test_applications.py index b705396c846..dc2cd54a31d 100644 --- a/tests/api_resources/zero_trust/access/test_applications.py +++ b/tests/api_resources/zero_trust/access/test_applications.py @@ -222,10 +222,12 @@ def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> N "required": True, "source": { "name": "last_name", - "name_by_idp": { - "exampleIdPID1": "AttributeName1", - "exampleIdPID2": "AttributeName2", - }, + "name_by_idp": [ + { + "idp_id": "exampleIdPID1", + "source_name": "AttributeName1", + } + ], }, } ], @@ -1386,10 +1388,12 @@ def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> N "required": True, "source": { "name": "last_name", - "name_by_idp": { - "exampleIdPID1": "AttributeName1", - "exampleIdPID2": "AttributeName2", - }, + "name_by_idp": [ + { + "idp_id": "exampleIdPID1", + "source_name": "AttributeName1", + } + ], }, } ], @@ -2907,10 +2911,12 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn "required": True, "source": { "name": "last_name", - "name_by_idp": { - "exampleIdPID1": "AttributeName1", - "exampleIdPID2": "AttributeName2", - }, + "name_by_idp": [ + { + "idp_id": "exampleIdPID1", + "source_name": "AttributeName1", + } + ], }, } ], @@ -4071,10 +4077,12 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn "required": True, "source": { "name": "last_name", - "name_by_idp": { - "exampleIdPID1": "AttributeName1", - "exampleIdPID2": "AttributeName2", - }, + "name_by_idp": [ + { + "idp_id": "exampleIdPID1", + "source_name": "AttributeName1", + } + ], }, } ], From 65bd38b5eaaf292cd54771d6dc1987994bd704c0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 21:50:08 +0000 Subject: [PATCH 164/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 6990ab7dc9c..70e19b221d1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b444d98432aba21e447e374c83dd19394bccff7c62a17582d5201273f63369c6.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f2aaab5a0b8eb05cdbea724ed548901b154e4878c777bf4422d1dea6dd99be9d.yml From 92989eb2b39b89fda4c8fbfce16d2bdf85a1a822 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 22:04:35 +0000 Subject: [PATCH 165/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 70e19b221d1..6990ab7dc9c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f2aaab5a0b8eb05cdbea724ed548901b154e4878c777bf4422d1dea6dd99be9d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b444d98432aba21e447e374c83dd19394bccff7c62a17582d5201273f63369c6.yml From 5772c86f7f9c666efd8c85d008d592705242f770 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 22:08:41 +0000 Subject: [PATCH 166/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 6990ab7dc9c..70e19b221d1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b444d98432aba21e447e374c83dd19394bccff7c62a17582d5201273f63369c6.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f2aaab5a0b8eb05cdbea724ed548901b154e4878c777bf4422d1dea6dd99be9d.yml From baa76ee23c8420be194021df7371400c1b2148e3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 01:07:40 +0000 Subject: [PATCH 167/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 70e19b221d1..6990ab7dc9c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f2aaab5a0b8eb05cdbea724ed548901b154e4878c777bf4422d1dea6dd99be9d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b444d98432aba21e447e374c83dd19394bccff7c62a17582d5201273f63369c6.yml From 596bf056c839eb436eac0acc4af26e03b0ea1608 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 06:10:03 +0000 Subject: [PATCH 168/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 6990ab7dc9c..70e19b221d1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b444d98432aba21e447e374c83dd19394bccff7c62a17582d5201273f63369c6.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f2aaab5a0b8eb05cdbea724ed548901b154e4878c777bf4422d1dea6dd99be9d.yml From 4b19e0f7a0afccd2776099b3df737a1f95f57c5d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 09:49:42 +0000 Subject: [PATCH 169/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 70e19b221d1..6990ab7dc9c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f2aaab5a0b8eb05cdbea724ed548901b154e4878c777bf4422d1dea6dd99be9d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b444d98432aba21e447e374c83dd19394bccff7c62a17582d5201273f63369c6.yml From 425db5490c1d41d4197fe9528072249c5b11b068 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 10:58:43 +0000 Subject: [PATCH 170/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 6990ab7dc9c..70e19b221d1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b444d98432aba21e447e374c83dd19394bccff7c62a17582d5201273f63369c6.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f2aaab5a0b8eb05cdbea724ed548901b154e4878c777bf4422d1dea6dd99be9d.yml From b0bbb911acc9d814dee643a0fd06ee0d03875e46 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 11:55:15 +0000 Subject: [PATCH 171/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 70e19b221d1..6990ab7dc9c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f2aaab5a0b8eb05cdbea724ed548901b154e4878c777bf4422d1dea6dd99be9d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b444d98432aba21e447e374c83dd19394bccff7c62a17582d5201273f63369c6.yml From de38205f7c7f5fdd19e2beecf2ac759e452c2c2c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 13:57:45 +0000 Subject: [PATCH 172/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 6990ab7dc9c..70e19b221d1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b444d98432aba21e447e374c83dd19394bccff7c62a17582d5201273f63369c6.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f2aaab5a0b8eb05cdbea724ed548901b154e4878c777bf4422d1dea6dd99be9d.yml From 2bb957b75ed3cb390adc3b1023e3b134c4c4689e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 14:38:02 +0000 Subject: [PATCH 173/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 70e19b221d1..6990ab7dc9c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f2aaab5a0b8eb05cdbea724ed548901b154e4878c777bf4422d1dea6dd99be9d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b444d98432aba21e447e374c83dd19394bccff7c62a17582d5201273f63369c6.yml From 300f1824471870933c7fe517b482dc5b8417057a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 15:20:12 +0000 Subject: [PATCH 174/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 6990ab7dc9c..70e19b221d1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b444d98432aba21e447e374c83dd19394bccff7c62a17582d5201273f63369c6.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f2aaab5a0b8eb05cdbea724ed548901b154e4878c777bf4422d1dea6dd99be9d.yml From 6994fa7a1c4de1d6ac48a5abbf5dc6cc40afdf22 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 17:20:57 +0000 Subject: [PATCH 175/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 70e19b221d1..6990ab7dc9c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f2aaab5a0b8eb05cdbea724ed548901b154e4878c777bf4422d1dea6dd99be9d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b444d98432aba21e447e374c83dd19394bccff7c62a17582d5201273f63369c6.yml From cb0dfdba9b05bba9f65758c05721c11b7cef1783 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 18:30:25 +0000 Subject: [PATCH 176/358] chore(internal): update client tests (#2445) --- tests/test_client.py | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index 5387461aab7..94359cbaa98 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -23,6 +23,7 @@ from cloudflare import Cloudflare, AsyncCloudflare, APIResponseValidationError from cloudflare._types import Omit +from cloudflare._utils import maybe_transform from cloudflare._models import BaseModel, FinalRequestOptions from cloudflare._constants import RAW_RESPONSE_HEADER from cloudflare._exceptions import APIStatusError, APITimeoutError, APIResponseValidationError @@ -32,6 +33,7 @@ BaseClient, make_request_options, ) +from cloudflare.types.zones.zone_create_params import ZoneCreateParams from .utils import update_env @@ -806,7 +808,11 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No self.client.post( "/zones", body=cast( - object, dict(account={"id": "023e105f4ecef8ad9ca31a8372d0c353"}, name="example.com", type="full") + object, + maybe_transform( + dict(account={"id": "023e105f4ecef8ad9ca31a8372d0c353"}, name="example.com", type="full"), + ZoneCreateParams, + ), ), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, @@ -823,7 +829,11 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> Non self.client.post( "/zones", body=cast( - object, dict(account={"id": "023e105f4ecef8ad9ca31a8372d0c353"}, name="example.com", type="full") + object, + maybe_transform( + dict(account={"id": "023e105f4ecef8ad9ca31a8372d0c353"}, name="example.com", type="full"), + ZoneCreateParams, + ), ), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, @@ -1677,7 +1687,11 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) await self.client.post( "/zones", body=cast( - object, dict(account={"id": "023e105f4ecef8ad9ca31a8372d0c353"}, name="example.com", type="full") + object, + maybe_transform( + dict(account={"id": "023e105f4ecef8ad9ca31a8372d0c353"}, name="example.com", type="full"), + ZoneCreateParams, + ), ), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, @@ -1694,7 +1708,11 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) await self.client.post( "/zones", body=cast( - object, dict(account={"id": "023e105f4ecef8ad9ca31a8372d0c353"}, name="example.com", type="full") + object, + maybe_transform( + dict(account={"id": "023e105f4ecef8ad9ca31a8372d0c353"}, name="example.com", type="full"), + ZoneCreateParams, + ), ), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, From dc1bd45cd6e55d9c0ac566218c7eba44c41db13b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 18:57:34 +0000 Subject: [PATCH 177/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 6990ab7dc9c..70e19b221d1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b444d98432aba21e447e374c83dd19394bccff7c62a17582d5201273f63369c6.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f2aaab5a0b8eb05cdbea724ed548901b154e4878c777bf4422d1dea6dd99be9d.yml From 2a0324dd595ebd51ff884829b6a9de9aca54cfbf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 21:15:23 +0000 Subject: [PATCH 178/358] feat(api): api update (#2446) --- .stats.yml | 2 +- api.md | 10 +-- .../accounts/tokens/permission_groups.py | 26 ++++---- .../resources/iam/permission_groups.py | 13 ++-- .../resources/iam/resource_groups.py | 13 ++-- .../user/tokens/permission_groups.py | 13 ++-- .../types/accounts/tokens/__init__.py | 2 + .../tokens/permission_group_get_response.py | 28 ++++++++ .../tokens/permission_group_list_response.py | 28 ++++++++ src/cloudflare/types/iam/__init__.py | 2 + .../iam/permission_group_list_response.py | 24 +++++++ .../types/iam/resource_group_list_response.py | 46 +++++++++++++ .../types/shared_params/token_policy.py | 3 + src/cloudflare/types/user/tokens/__init__.py | 1 + .../tokens/permission_group_list_response.py | 28 ++++++++ tests/api_resources/accounts/test_tokens.py | 64 ++++++++++++++----- .../accounts/tokens/test_permission_groups.py | 25 ++++---- .../iam/test_permission_groups.py | 28 +++++--- .../api_resources/iam/test_resource_groups.py | 19 +++--- tests/api_resources/user/test_tokens.py | 54 ++++++++++++---- .../user/tokens/test_permission_groups.py | 13 ++-- 21 files changed, 341 insertions(+), 101 deletions(-) create mode 100644 src/cloudflare/types/accounts/tokens/permission_group_get_response.py create mode 100644 src/cloudflare/types/accounts/tokens/permission_group_list_response.py create mode 100644 src/cloudflare/types/iam/permission_group_list_response.py create mode 100644 src/cloudflare/types/iam/resource_group_list_response.py create mode 100644 src/cloudflare/types/user/tokens/permission_group_list_response.py diff --git a/.stats.yml b/.stats.yml index 70e19b221d1..c824adf24de 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f2aaab5a0b8eb05cdbea724ed548901b154e4878c777bf4422d1dea6dd99be9d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9c45ec94850683c18483d33cd0f19f407876c58d230e398fe3d9d7909b9686a7.yml diff --git a/api.md b/api.md index 3a3522c1b4f..044ad06ba86 100644 --- a/api.md +++ b/api.md @@ -115,8 +115,8 @@ from cloudflare.types.accounts.tokens import PermissionGroupListResponse, Permis Methods: -- client.accounts.tokens.permission_groups.list(\*, account_id) -> SyncSinglePage[object] -- client.accounts.tokens.permission_groups.get(\*, account_id) -> SyncSinglePage[object] +- client.accounts.tokens.permission_groups.list(\*, account_id) -> SyncSinglePage[PermissionGroupListResponse] +- client.accounts.tokens.permission_groups.get(\*, account_id) -> SyncSinglePage[PermissionGroupGetResponse] ### Value @@ -302,7 +302,7 @@ from cloudflare.types.user.tokens import PermissionGroupListResponse Methods: -- client.user.tokens.permission_groups.list() -> SyncSinglePage[object] +- client.user.tokens.permission_groups.list() -> SyncSinglePage[PermissionGroupListResponse] ### Value @@ -8333,7 +8333,7 @@ from cloudflare.types.iam import PermissionGroupListResponse, PermissionGroupGet Methods: -- client.iam.permission_groups.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[object] +- client.iam.permission_groups.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[PermissionGroupListResponse] - client.iam.permission_groups.get(permission_group_id, \*, account_id) -> PermissionGroupGetResponse ## ResourceGroups @@ -8354,7 +8354,7 @@ Methods: - client.iam.resource_groups.create(\*, account_id, \*\*params) -> ResourceGroupCreateResponse - client.iam.resource_groups.update(resource_group_id, \*, account_id, \*\*params) -> ResourceGroupUpdateResponse -- client.iam.resource_groups.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[object] +- client.iam.resource_groups.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[ResourceGroupListResponse] - client.iam.resource_groups.delete(resource_group_id, \*, account_id) -> Optional[ResourceGroupDeleteResponse] - client.iam.resource_groups.get(resource_group_id, \*, account_id) -> ResourceGroupGetResponse diff --git a/src/cloudflare/resources/accounts/tokens/permission_groups.py b/src/cloudflare/resources/accounts/tokens/permission_groups.py index 98e3fe4dec6..d98d5235ce0 100644 --- a/src/cloudflare/resources/accounts/tokens/permission_groups.py +++ b/src/cloudflare/resources/accounts/tokens/permission_groups.py @@ -15,6 +15,8 @@ ) from ....pagination import SyncSinglePage, AsyncSinglePage from ...._base_client import AsyncPaginator, make_request_options +from ....types.accounts.tokens.permission_group_get_response import PermissionGroupGetResponse +from ....types.accounts.tokens.permission_group_list_response import PermissionGroupListResponse __all__ = ["PermissionGroupsResource", "AsyncPermissionGroupsResource"] @@ -49,7 +51,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[object]: + ) -> SyncSinglePage[PermissionGroupListResponse]: """ Find all available permission groups for Account Owned API Tokens @@ -68,11 +70,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/tokens/permission_groups", - page=SyncSinglePage[object], + page=SyncSinglePage[PermissionGroupListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=object, + model=PermissionGroupListResponse, ) def get( @@ -85,7 +87,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[object]: + ) -> SyncSinglePage[PermissionGroupGetResponse]: """ Find all available permission groups for Account Owned API Tokens @@ -104,11 +106,11 @@ def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/tokens/permission_groups", - page=SyncSinglePage[object], + page=SyncSinglePage[PermissionGroupGetResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=object, + model=PermissionGroupGetResponse, ) @@ -142,7 +144,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[object, AsyncSinglePage[object]]: + ) -> AsyncPaginator[PermissionGroupListResponse, AsyncSinglePage[PermissionGroupListResponse]]: """ Find all available permission groups for Account Owned API Tokens @@ -161,11 +163,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/tokens/permission_groups", - page=AsyncSinglePage[object], + page=AsyncSinglePage[PermissionGroupListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=object, + model=PermissionGroupListResponse, ) def get( @@ -178,7 +180,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[object, AsyncSinglePage[object]]: + ) -> AsyncPaginator[PermissionGroupGetResponse, AsyncSinglePage[PermissionGroupGetResponse]]: """ Find all available permission groups for Account Owned API Tokens @@ -197,11 +199,11 @@ def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/tokens/permission_groups", - page=AsyncSinglePage[object], + page=AsyncSinglePage[PermissionGroupGetResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=object, + model=PermissionGroupGetResponse, ) diff --git a/src/cloudflare/resources/iam/permission_groups.py b/src/cloudflare/resources/iam/permission_groups.py index 78236659d72..e91be564f38 100644 --- a/src/cloudflare/resources/iam/permission_groups.py +++ b/src/cloudflare/resources/iam/permission_groups.py @@ -18,6 +18,7 @@ from ...pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ..._base_client import AsyncPaginator, make_request_options from ...types.iam.permission_group_get_response import PermissionGroupGetResponse +from ...types.iam.permission_group_list_response import PermissionGroupListResponse __all__ = ["PermissionGroupsResource", "AsyncPermissionGroupsResource"] @@ -57,7 +58,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncV4PagePaginationArray[object]: + ) -> SyncV4PagePaginationArray[PermissionGroupListResponse]: """ List all the permissions groups for an account. @@ -86,7 +87,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/iam/permission_groups", - page=SyncV4PagePaginationArray[object], + page=SyncV4PagePaginationArray[PermissionGroupListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -103,7 +104,7 @@ def list( permission_group_list_params.PermissionGroupListParams, ), ), - model=object, + model=PermissionGroupListResponse, ) def get( @@ -184,7 +185,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[object, AsyncV4PagePaginationArray[object]]: + ) -> AsyncPaginator[PermissionGroupListResponse, AsyncV4PagePaginationArray[PermissionGroupListResponse]]: """ List all the permissions groups for an account. @@ -213,7 +214,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/iam/permission_groups", - page=AsyncV4PagePaginationArray[object], + page=AsyncV4PagePaginationArray[PermissionGroupListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -230,7 +231,7 @@ def list( permission_group_list_params.PermissionGroupListParams, ), ), - model=object, + model=PermissionGroupListResponse, ) async def get( diff --git a/src/cloudflare/resources/iam/resource_groups.py b/src/cloudflare/resources/iam/resource_groups.py index 463d3d72b20..a19443fda94 100644 --- a/src/cloudflare/resources/iam/resource_groups.py +++ b/src/cloudflare/resources/iam/resource_groups.py @@ -24,6 +24,7 @@ from ...pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ..._base_client import AsyncPaginator, make_request_options from ...types.iam.resource_group_get_response import ResourceGroupGetResponse +from ...types.iam.resource_group_list_response import ResourceGroupListResponse from ...types.iam.resource_group_create_response import ResourceGroupCreateResponse from ...types.iam.resource_group_delete_response import ResourceGroupDeleteResponse from ...types.iam.resource_group_update_response import ResourceGroupUpdateResponse @@ -166,7 +167,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncV4PagePaginationArray[object]: + ) -> SyncV4PagePaginationArray[ResourceGroupListResponse]: """ List all the resource groups for an account. @@ -193,7 +194,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/iam/resource_groups", - page=SyncV4PagePaginationArray[object], + page=SyncV4PagePaginationArray[ResourceGroupListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -209,7 +210,7 @@ def list( resource_group_list_params.ResourceGroupListParams, ), ), - model=object, + model=ResourceGroupListResponse, ) def delete( @@ -432,7 +433,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[object, AsyncV4PagePaginationArray[object]]: + ) -> AsyncPaginator[ResourceGroupListResponse, AsyncV4PagePaginationArray[ResourceGroupListResponse]]: """ List all the resource groups for an account. @@ -459,7 +460,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/iam/resource_groups", - page=AsyncV4PagePaginationArray[object], + page=AsyncV4PagePaginationArray[ResourceGroupListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -475,7 +476,7 @@ def list( resource_group_list_params.ResourceGroupListParams, ), ), - model=object, + model=ResourceGroupListResponse, ) async def delete( diff --git a/src/cloudflare/resources/user/tokens/permission_groups.py b/src/cloudflare/resources/user/tokens/permission_groups.py index 5c601a36471..87479a4720e 100644 --- a/src/cloudflare/resources/user/tokens/permission_groups.py +++ b/src/cloudflare/resources/user/tokens/permission_groups.py @@ -15,6 +15,7 @@ ) from ....pagination import SyncSinglePage, AsyncSinglePage from ...._base_client import AsyncPaginator, make_request_options +from ....types.user.tokens.permission_group_list_response import PermissionGroupListResponse __all__ = ["PermissionGroupsResource", "AsyncPermissionGroupsResource"] @@ -48,15 +49,15 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[object]: + ) -> SyncSinglePage[PermissionGroupListResponse]: """Find all available permission groups for API Tokens""" return self._get_api_list( "/user/tokens/permission_groups", - page=SyncSinglePage[object], + page=SyncSinglePage[PermissionGroupListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=object, + model=PermissionGroupListResponse, ) @@ -89,15 +90,15 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[object, AsyncSinglePage[object]]: + ) -> AsyncPaginator[PermissionGroupListResponse, AsyncSinglePage[PermissionGroupListResponse]]: """Find all available permission groups for API Tokens""" return self._get_api_list( "/user/tokens/permission_groups", - page=AsyncSinglePage[object], + page=AsyncSinglePage[PermissionGroupListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=object, + model=PermissionGroupListResponse, ) diff --git a/src/cloudflare/types/accounts/tokens/__init__.py b/src/cloudflare/types/accounts/tokens/__init__.py index 8945db29b3e..bc8d7e3d210 100644 --- a/src/cloudflare/types/accounts/tokens/__init__.py +++ b/src/cloudflare/types/accounts/tokens/__init__.py @@ -3,3 +3,5 @@ from __future__ import annotations from .value_update_params import ValueUpdateParams as ValueUpdateParams +from .permission_group_get_response import PermissionGroupGetResponse as PermissionGroupGetResponse +from .permission_group_list_response import PermissionGroupListResponse as PermissionGroupListResponse diff --git a/src/cloudflare/types/accounts/tokens/permission_group_get_response.py b/src/cloudflare/types/accounts/tokens/permission_group_get_response.py new file mode 100644 index 00000000000..f7b20d1bcfb --- /dev/null +++ b/src/cloudflare/types/accounts/tokens/permission_group_get_response.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["PermissionGroupGetResponse"] + + +class PermissionGroupGetResponse(BaseModel): + id: Optional[str] = None + """Public ID.""" + + name: Optional[str] = None + """Permission Group Name""" + + scopes: Optional[ + List[ + Literal[ + "com.cloudflare.api.account", + "com.cloudflare.api.account.zone", + "com.cloudflare.api.user", + "com.cloudflare.edge.r2.bucket", + ] + ] + ] = None + """Resources to which the Permission Group is scoped""" diff --git a/src/cloudflare/types/accounts/tokens/permission_group_list_response.py b/src/cloudflare/types/accounts/tokens/permission_group_list_response.py new file mode 100644 index 00000000000..b34b7ff89c2 --- /dev/null +++ b/src/cloudflare/types/accounts/tokens/permission_group_list_response.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["PermissionGroupListResponse"] + + +class PermissionGroupListResponse(BaseModel): + id: Optional[str] = None + """Public ID.""" + + name: Optional[str] = None + """Permission Group Name""" + + scopes: Optional[ + List[ + Literal[ + "com.cloudflare.api.account", + "com.cloudflare.api.account.zone", + "com.cloudflare.api.user", + "com.cloudflare.edge.r2.bucket", + ] + ] + ] = None + """Resources to which the Permission Group is scoped""" diff --git a/src/cloudflare/types/iam/__init__.py b/src/cloudflare/types/iam/__init__.py index 5982e2443a2..36d1f4d74c0 100644 --- a/src/cloudflare/types/iam/__init__.py +++ b/src/cloudflare/types/iam/__init__.py @@ -6,8 +6,10 @@ from .resource_group_get_response import ResourceGroupGetResponse as ResourceGroupGetResponse from .permission_group_list_params import PermissionGroupListParams as PermissionGroupListParams from .resource_group_create_params import ResourceGroupCreateParams as ResourceGroupCreateParams +from .resource_group_list_response import ResourceGroupListResponse as ResourceGroupListResponse from .resource_group_update_params import ResourceGroupUpdateParams as ResourceGroupUpdateParams from .permission_group_get_response import PermissionGroupGetResponse as PermissionGroupGetResponse +from .permission_group_list_response import PermissionGroupListResponse as PermissionGroupListResponse from .resource_group_create_response import ResourceGroupCreateResponse as ResourceGroupCreateResponse from .resource_group_delete_response import ResourceGroupDeleteResponse as ResourceGroupDeleteResponse from .resource_group_update_response import ResourceGroupUpdateResponse as ResourceGroupUpdateResponse diff --git a/src/cloudflare/types/iam/permission_group_list_response.py b/src/cloudflare/types/iam/permission_group_list_response.py new file mode 100644 index 00000000000..aafdde5605d --- /dev/null +++ b/src/cloudflare/types/iam/permission_group_list_response.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["PermissionGroupListResponse", "Meta"] + + +class Meta(BaseModel): + key: Optional[str] = None + + value: Optional[str] = None + + +class PermissionGroupListResponse(BaseModel): + id: str + """Identifier of the group.""" + + meta: Optional[Meta] = None + """Attributes associated to the permission group.""" + + name: Optional[str] = None + """Name of the group.""" diff --git a/src/cloudflare/types/iam/resource_group_list_response.py b/src/cloudflare/types/iam/resource_group_list_response.py new file mode 100644 index 00000000000..11a7f0f0365 --- /dev/null +++ b/src/cloudflare/types/iam/resource_group_list_response.py @@ -0,0 +1,46 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["ResourceGroupListResponse", "Scope", "ScopeObject", "Meta"] + + +class ScopeObject(BaseModel): + key: str + """ + This is a combination of pre-defined resource name and identifier (like Zone ID + etc.) + """ + + +class Scope(BaseModel): + key: str + """ + This is a combination of pre-defined resource name and identifier (like Account + ID etc.) + """ + + objects: List[ScopeObject] + """A list of scope objects for additional context.""" + + +class Meta(BaseModel): + key: Optional[str] = None + + value: Optional[str] = None + + +class ResourceGroupListResponse(BaseModel): + id: str + """Identifier of the group.""" + + scope: List[Scope] + """The scope associated to the resource group""" + + meta: Optional[Meta] = None + """Attributes associated to the resource group.""" + + name: Optional[str] = None + """Name of the resource group.""" diff --git a/src/cloudflare/types/shared_params/token_policy.py b/src/cloudflare/types/shared_params/token_policy.py index 96b7d37451f..2a6da587407 100644 --- a/src/cloudflare/types/shared_params/token_policy.py +++ b/src/cloudflare/types/shared_params/token_policy.py @@ -15,6 +15,9 @@ class PermissionGroupMeta(TypedDict, total=False): class PermissionGroup(TypedDict, total=False): + id: Required[str] + """Identifier of the group.""" + meta: PermissionGroupMeta """Attributes associated to the permission group.""" diff --git a/src/cloudflare/types/user/tokens/__init__.py b/src/cloudflare/types/user/tokens/__init__.py index 8945db29b3e..9d03684a586 100644 --- a/src/cloudflare/types/user/tokens/__init__.py +++ b/src/cloudflare/types/user/tokens/__init__.py @@ -3,3 +3,4 @@ from __future__ import annotations from .value_update_params import ValueUpdateParams as ValueUpdateParams +from .permission_group_list_response import PermissionGroupListResponse as PermissionGroupListResponse diff --git a/src/cloudflare/types/user/tokens/permission_group_list_response.py b/src/cloudflare/types/user/tokens/permission_group_list_response.py new file mode 100644 index 00000000000..b34b7ff89c2 --- /dev/null +++ b/src/cloudflare/types/user/tokens/permission_group_list_response.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["PermissionGroupListResponse"] + + +class PermissionGroupListResponse(BaseModel): + id: Optional[str] = None + """Public ID.""" + + name: Optional[str] = None + """Permission Group Name""" + + scopes: Optional[ + List[ + Literal[ + "com.cloudflare.api.account", + "com.cloudflare.api.account.zone", + "com.cloudflare.api.user", + "com.cloudflare.edge.r2.bucket", + ] + ] + ] = None + """Resources to which the Permission Group is scoped""" diff --git a/tests/api_resources/accounts/test_tokens.py b/tests/api_resources/accounts/test_tokens.py index dc10d79e1de..8f78469afac 100644 --- a/tests/api_resources/accounts/test_tokens.py +++ b/tests/api_resources/accounts/test_tokens.py @@ -33,7 +33,10 @@ def test_method_create(self, client: Cloudflare) -> None: policies=[ { "effect": "allow", - "permission_groups": [{}, {}], + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], "resources": { "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", @@ -54,16 +57,18 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "effect": "allow", "permission_groups": [ { + "id": "c8fed203ed3043cba015a93ad1616f1f", "meta": { "key": "key", "value": "value", - } + }, }, { + "id": "82e64a83756745bbbb1c9c2701bf816b", "meta": { "key": "key", "value": "value", - } + }, }, ], "resources": { @@ -92,7 +97,10 @@ def test_raw_response_create(self, client: Cloudflare) -> None: policies=[ { "effect": "allow", - "permission_groups": [{}, {}], + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], "resources": { "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", @@ -115,7 +123,10 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: policies=[ { "effect": "allow", - "permission_groups": [{}, {}], + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], "resources": { "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", @@ -141,7 +152,10 @@ def test_path_params_create(self, client: Cloudflare) -> None: policies=[ { "effect": "allow", - "permission_groups": [{}, {}], + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], "resources": { "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", @@ -179,16 +193,18 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "effect": "allow", "permission_groups": [ { + "id": "c8fed203ed3043cba015a93ad1616f1f", "meta": { "key": "key", "value": "value", - } + }, }, { + "id": "82e64a83756745bbbb1c9c2701bf816b", "meta": { "key": "key", "value": "value", - } + }, }, ], "resources": { @@ -456,7 +472,10 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: policies=[ { "effect": "allow", - "permission_groups": [{}, {}], + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], "resources": { "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", @@ -477,16 +496,18 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "effect": "allow", "permission_groups": [ { + "id": "c8fed203ed3043cba015a93ad1616f1f", "meta": { "key": "key", "value": "value", - } + }, }, { + "id": "82e64a83756745bbbb1c9c2701bf816b", "meta": { "key": "key", "value": "value", - } + }, }, ], "resources": { @@ -515,7 +536,10 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: policies=[ { "effect": "allow", - "permission_groups": [{}, {}], + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], "resources": { "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", @@ -538,7 +562,10 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> policies=[ { "effect": "allow", - "permission_groups": [{}, {}], + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], "resources": { "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", @@ -564,7 +591,10 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: policies=[ { "effect": "allow", - "permission_groups": [{}, {}], + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], "resources": { "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", @@ -602,16 +632,18 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "effect": "allow", "permission_groups": [ { + "id": "c8fed203ed3043cba015a93ad1616f1f", "meta": { "key": "key", "value": "value", - } + }, }, { + "id": "82e64a83756745bbbb1c9c2701bf816b", "meta": { "key": "key", "value": "value", - } + }, }, ], "resources": { diff --git a/tests/api_resources/accounts/tokens/test_permission_groups.py b/tests/api_resources/accounts/tokens/test_permission_groups.py index 7f5a5d8526b..d6d6a731a9f 100644 --- a/tests/api_resources/accounts/tokens/test_permission_groups.py +++ b/tests/api_resources/accounts/tokens/test_permission_groups.py @@ -10,6 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.accounts.tokens import PermissionGroupGetResponse, PermissionGroupListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +24,7 @@ def test_method_list(self, client: Cloudflare) -> None: permission_group = client.accounts.tokens.permission_groups.list( account_id="eb78d65290b24279ba6f44721b3ea3c4", ) - assert_matches_type(SyncSinglePage[object], permission_group, path=["response"]) + assert_matches_type(SyncSinglePage[PermissionGroupListResponse], permission_group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -35,7 +36,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" permission_group = response.parse() - assert_matches_type(SyncSinglePage[object], permission_group, path=["response"]) + assert_matches_type(SyncSinglePage[PermissionGroupListResponse], permission_group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -47,7 +48,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" permission_group = response.parse() - assert_matches_type(SyncSinglePage[object], permission_group, path=["response"]) + assert_matches_type(SyncSinglePage[PermissionGroupListResponse], permission_group, path=["response"]) assert cast(Any, response.is_closed) is True @@ -65,7 +66,7 @@ def test_method_get(self, client: Cloudflare) -> None: permission_group = client.accounts.tokens.permission_groups.get( account_id="eb78d65290b24279ba6f44721b3ea3c4", ) - assert_matches_type(SyncSinglePage[object], permission_group, path=["response"]) + assert_matches_type(SyncSinglePage[PermissionGroupGetResponse], permission_group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -77,7 +78,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" permission_group = response.parse() - assert_matches_type(SyncSinglePage[object], permission_group, path=["response"]) + assert_matches_type(SyncSinglePage[PermissionGroupGetResponse], permission_group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -89,7 +90,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" permission_group = response.parse() - assert_matches_type(SyncSinglePage[object], permission_group, path=["response"]) + assert_matches_type(SyncSinglePage[PermissionGroupGetResponse], permission_group, path=["response"]) assert cast(Any, response.is_closed) is True @@ -111,7 +112,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: permission_group = await async_client.accounts.tokens.permission_groups.list( account_id="eb78d65290b24279ba6f44721b3ea3c4", ) - assert_matches_type(AsyncSinglePage[object], permission_group, path=["response"]) + assert_matches_type(AsyncSinglePage[PermissionGroupListResponse], permission_group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -123,7 +124,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" permission_group = await response.parse() - assert_matches_type(AsyncSinglePage[object], permission_group, path=["response"]) + assert_matches_type(AsyncSinglePage[PermissionGroupListResponse], permission_group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -135,7 +136,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" permission_group = await response.parse() - assert_matches_type(AsyncSinglePage[object], permission_group, path=["response"]) + assert_matches_type(AsyncSinglePage[PermissionGroupListResponse], permission_group, path=["response"]) assert cast(Any, response.is_closed) is True @@ -153,7 +154,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: permission_group = await async_client.accounts.tokens.permission_groups.get( account_id="eb78d65290b24279ba6f44721b3ea3c4", ) - assert_matches_type(AsyncSinglePage[object], permission_group, path=["response"]) + assert_matches_type(AsyncSinglePage[PermissionGroupGetResponse], permission_group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -165,7 +166,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" permission_group = await response.parse() - assert_matches_type(AsyncSinglePage[object], permission_group, path=["response"]) + assert_matches_type(AsyncSinglePage[PermissionGroupGetResponse], permission_group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -177,7 +178,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" permission_group = await response.parse() - assert_matches_type(AsyncSinglePage[object], permission_group, path=["response"]) + assert_matches_type(AsyncSinglePage[PermissionGroupGetResponse], permission_group, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/iam/test_permission_groups.py b/tests/api_resources/iam/test_permission_groups.py index b1da71007ab..df808f2577c 100644 --- a/tests/api_resources/iam/test_permission_groups.py +++ b/tests/api_resources/iam/test_permission_groups.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.iam import PermissionGroupGetResponse +from cloudflare.types.iam import PermissionGroupGetResponse, PermissionGroupListResponse from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +23,7 @@ def test_method_list(self, client: Cloudflare) -> None: permission_group = client.iam.permission_groups.list( account_id="eb78d65290b24279ba6f44721b3ea3c4", ) - assert_matches_type(SyncV4PagePaginationArray[object], permission_group, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[PermissionGroupListResponse], permission_group, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: @@ -35,7 +35,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: page=1, per_page=5, ) - assert_matches_type(SyncV4PagePaginationArray[object], permission_group, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[PermissionGroupListResponse], permission_group, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: @@ -46,7 +46,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" permission_group = response.parse() - assert_matches_type(SyncV4PagePaginationArray[object], permission_group, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[PermissionGroupListResponse], permission_group, path=["response"]) @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: @@ -57,7 +57,9 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" permission_group = response.parse() - assert_matches_type(SyncV4PagePaginationArray[object], permission_group, path=["response"]) + assert_matches_type( + SyncV4PagePaginationArray[PermissionGroupListResponse], permission_group, path=["response"] + ) assert cast(Any, response.is_closed) is True @@ -125,7 +127,9 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: permission_group = await async_client.iam.permission_groups.list( account_id="eb78d65290b24279ba6f44721b3ea3c4", ) - assert_matches_type(AsyncV4PagePaginationArray[object], permission_group, path=["response"]) + assert_matches_type( + AsyncV4PagePaginationArray[PermissionGroupListResponse], permission_group, path=["response"] + ) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -137,7 +141,9 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) page=1, per_page=5, ) - assert_matches_type(AsyncV4PagePaginationArray[object], permission_group, path=["response"]) + assert_matches_type( + AsyncV4PagePaginationArray[PermissionGroupListResponse], permission_group, path=["response"] + ) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @@ -148,7 +154,9 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" permission_group = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[object], permission_group, path=["response"]) + assert_matches_type( + AsyncV4PagePaginationArray[PermissionGroupListResponse], permission_group, path=["response"] + ) @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: @@ -159,7 +167,9 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" permission_group = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[object], permission_group, path=["response"]) + assert_matches_type( + AsyncV4PagePaginationArray[PermissionGroupListResponse], permission_group, path=["response"] + ) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/iam/test_resource_groups.py b/tests/api_resources/iam/test_resource_groups.py index e8da4efa4ca..ea40668b453 100644 --- a/tests/api_resources/iam/test_resource_groups.py +++ b/tests/api_resources/iam/test_resource_groups.py @@ -11,6 +11,7 @@ from tests.utils import assert_matches_type from cloudflare.types.iam import ( ResourceGroupGetResponse, + ResourceGroupListResponse, ResourceGroupCreateResponse, ResourceGroupDeleteResponse, ResourceGroupUpdateResponse, @@ -175,7 +176,7 @@ def test_method_list(self, client: Cloudflare) -> None: resource_group = client.iam.resource_groups.list( account_id="eb78d65290b24279ba6f44721b3ea3c4", ) - assert_matches_type(SyncV4PagePaginationArray[object], resource_group, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[ResourceGroupListResponse], resource_group, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: @@ -186,7 +187,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: page=1, per_page=5, ) - assert_matches_type(SyncV4PagePaginationArray[object], resource_group, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[ResourceGroupListResponse], resource_group, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: @@ -197,7 +198,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" resource_group = response.parse() - assert_matches_type(SyncV4PagePaginationArray[object], resource_group, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[ResourceGroupListResponse], resource_group, path=["response"]) @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: @@ -208,7 +209,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" resource_group = response.parse() - assert_matches_type(SyncV4PagePaginationArray[object], resource_group, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[ResourceGroupListResponse], resource_group, path=["response"]) assert cast(Any, response.is_closed) is True @@ -471,7 +472,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: resource_group = await async_client.iam.resource_groups.list( account_id="eb78d65290b24279ba6f44721b3ea3c4", ) - assert_matches_type(AsyncV4PagePaginationArray[object], resource_group, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[ResourceGroupListResponse], resource_group, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -482,7 +483,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) page=1, per_page=5, ) - assert_matches_type(AsyncV4PagePaginationArray[object], resource_group, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[ResourceGroupListResponse], resource_group, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @@ -493,7 +494,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" resource_group = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[object], resource_group, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[ResourceGroupListResponse], resource_group, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: @@ -504,7 +505,9 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" resource_group = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[object], resource_group, path=["response"]) + assert_matches_type( + AsyncV4PagePaginationArray[ResourceGroupListResponse], resource_group, path=["response"] + ) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/user/test_tokens.py b/tests/api_resources/user/test_tokens.py index 3ad7952d607..d7b66d1a580 100644 --- a/tests/api_resources/user/test_tokens.py +++ b/tests/api_resources/user/test_tokens.py @@ -32,7 +32,10 @@ def test_method_create(self, client: Cloudflare) -> None: policies=[ { "effect": "allow", - "permission_groups": [{}, {}], + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], "resources": { "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", @@ -52,16 +55,18 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "effect": "allow", "permission_groups": [ { + "id": "c8fed203ed3043cba015a93ad1616f1f", "meta": { "key": "key", "value": "value", - } + }, }, { + "id": "82e64a83756745bbbb1c9c2701bf816b", "meta": { "key": "key", "value": "value", - } + }, }, ], "resources": { @@ -89,7 +94,10 @@ def test_raw_response_create(self, client: Cloudflare) -> None: policies=[ { "effect": "allow", - "permission_groups": [{}, {}], + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], "resources": { "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", @@ -111,7 +119,10 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: policies=[ { "effect": "allow", - "permission_groups": [{}, {}], + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], "resources": { "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", @@ -154,16 +165,18 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "effect": "allow", "permission_groups": [ { + "id": "c8fed203ed3043cba015a93ad1616f1f", "meta": { "key": "key", "value": "value", - } + }, }, { + "id": "82e64a83756745bbbb1c9c2701bf816b", "meta": { "key": "key", "value": "value", - } + }, }, ], "resources": { @@ -372,7 +385,10 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: policies=[ { "effect": "allow", - "permission_groups": [{}, {}], + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], "resources": { "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", @@ -392,16 +408,18 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "effect": "allow", "permission_groups": [ { + "id": "c8fed203ed3043cba015a93ad1616f1f", "meta": { "key": "key", "value": "value", - } + }, }, { + "id": "82e64a83756745bbbb1c9c2701bf816b", "meta": { "key": "key", "value": "value", - } + }, }, ], "resources": { @@ -429,7 +447,10 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: policies=[ { "effect": "allow", - "permission_groups": [{}, {}], + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], "resources": { "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", @@ -451,7 +472,10 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> policies=[ { "effect": "allow", - "permission_groups": [{}, {}], + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], "resources": { "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", @@ -494,16 +518,18 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "effect": "allow", "permission_groups": [ { + "id": "c8fed203ed3043cba015a93ad1616f1f", "meta": { "key": "key", "value": "value", - } + }, }, { + "id": "82e64a83756745bbbb1c9c2701bf816b", "meta": { "key": "key", "value": "value", - } + }, }, ], "resources": { diff --git a/tests/api_resources/user/tokens/test_permission_groups.py b/tests/api_resources/user/tokens/test_permission_groups.py index 6367a24d176..2ce293ee632 100644 --- a/tests/api_resources/user/tokens/test_permission_groups.py +++ b/tests/api_resources/user/tokens/test_permission_groups.py @@ -10,6 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.user.tokens import PermissionGroupListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -21,7 +22,7 @@ class TestPermissionGroups: @parametrize def test_method_list(self, client: Cloudflare) -> None: permission_group = client.user.tokens.permission_groups.list() - assert_matches_type(SyncSinglePage[object], permission_group, path=["response"]) + assert_matches_type(SyncSinglePage[PermissionGroupListResponse], permission_group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -31,7 +32,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" permission_group = response.parse() - assert_matches_type(SyncSinglePage[object], permission_group, path=["response"]) + assert_matches_type(SyncSinglePage[PermissionGroupListResponse], permission_group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -41,7 +42,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" permission_group = response.parse() - assert_matches_type(SyncSinglePage[object], permission_group, path=["response"]) + assert_matches_type(SyncSinglePage[PermissionGroupListResponse], permission_group, path=["response"]) assert cast(Any, response.is_closed) is True @@ -53,7 +54,7 @@ class TestAsyncPermissionGroups: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: permission_group = await async_client.user.tokens.permission_groups.list() - assert_matches_type(AsyncSinglePage[object], permission_group, path=["response"]) + assert_matches_type(AsyncSinglePage[PermissionGroupListResponse], permission_group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -63,7 +64,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" permission_group = await response.parse() - assert_matches_type(AsyncSinglePage[object], permission_group, path=["response"]) + assert_matches_type(AsyncSinglePage[PermissionGroupListResponse], permission_group, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -73,6 +74,6 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" permission_group = await response.parse() - assert_matches_type(AsyncSinglePage[object], permission_group, path=["response"]) + assert_matches_type(AsyncSinglePage[PermissionGroupListResponse], permission_group, path=["response"]) assert cast(Any, response.is_closed) is True From 25168533bf4a9c79b30e3f0e218c663d1a69d31f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 21:33:44 +0000 Subject: [PATCH 179/358] feat(api): api update (#2447) --- .stats.yml | 2 +- src/cloudflare/resources/zones/settings.py | 76 +++ src/cloudflare/resources/zones/zones.py | 4 +- .../types/zones/setting_edit_params.py | 13 + .../types/zones/setting_edit_response.py | 19 + .../types/zones/setting_get_response.py | 19 + .../types/zones/zone_edit_params.py | 2 +- tests/api_resources/zones/test_settings.py | 440 +++++++++++------- 8 files changed, 409 insertions(+), 166 deletions(-) diff --git a/.stats.yml b/.stats.yml index c824adf24de..8b902c7854c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9c45ec94850683c18483d33cd0f19f407876c58d230e398fe3d9d7909b9686a7.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-79b2980c84173020de4bcd0c81571a5fea7ee2e1ccd8f89959f1aa7e83cf4952.yml diff --git a/src/cloudflare/resources/zones/settings.py b/src/cloudflare/resources/zones/settings.py index a323075a863..aa54b647c50 100644 --- a/src/cloudflare/resources/zones/settings.py +++ b/src/cloudflare/resources/zones/settings.py @@ -1434,6 +1434,43 @@ def edit( """ ... + @overload + def edit( + self, + setting_id: str, + *, + zone_id: str, + id: Literal["privacy_pass"], + value: Literal["on", "off"], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[SettingEditResponse]: + """ + Updates a single zone setting by the identifier + + Args: + zone_id: Identifier + + setting_id: Setting name + + id: ID of the zone setting. + + value: Current value of the zone setting. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + @overload def edit( self, @@ -2216,6 +2253,7 @@ def edit( | Literal["origin_max_http_version"] | Literal["polish"] | Literal["prefetch_preload"] + | Literal["privacy_pass"] | Literal["proxy_read_timeout"] | Literal["pseudo_ipv4"] | Literal["replace_insecure_js"] @@ -3802,6 +3840,43 @@ async def edit( """ ... + @overload + async def edit( + self, + setting_id: str, + *, + zone_id: str, + id: Literal["privacy_pass"], + value: Literal["on", "off"], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[SettingEditResponse]: + """ + Updates a single zone setting by the identifier + + Args: + zone_id: Identifier + + setting_id: Setting name + + id: ID of the zone setting. + + value: Current value of the zone setting. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + @overload async def edit( self, @@ -4584,6 +4659,7 @@ async def edit( | Literal["origin_max_http_version"] | Literal["polish"] | Literal["prefetch_preload"] + | Literal["privacy_pass"] | Literal["proxy_read_timeout"] | Literal["pseudo_ipv4"] | Literal["replace_insecure_js"] diff --git a/src/cloudflare/resources/zones/zones.py b/src/cloudflare/resources/zones/zones.py index 16d28b897fb..fbc53d3ffc7 100644 --- a/src/cloudflare/resources/zones/zones.py +++ b/src/cloudflare/resources/zones/zones.py @@ -309,7 +309,7 @@ def edit( self, *, zone_id: str, - type: Literal["full", "partial", "secondary"] | NotGiven = NOT_GIVEN, + type: Literal["full", "partial", "secondary", "internal"] | NotGiven = NOT_GIVEN, vanity_name_servers: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -624,7 +624,7 @@ async def edit( self, *, zone_id: str, - type: Literal["full", "partial", "secondary"] | NotGiven = NOT_GIVEN, + type: Literal["full", "partial", "secondary", "internal"] | NotGiven = NOT_GIVEN, vanity_name_servers: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. diff --git a/src/cloudflare/types/zones/setting_edit_params.py b/src/cloudflare/types/zones/setting_edit_params.py index 3aa35a79908..83223b79eed 100644 --- a/src/cloudflare/types/zones/setting_edit_params.py +++ b/src/cloudflare/types/zones/setting_edit_params.py @@ -47,6 +47,7 @@ "ZonesCacheRulesOriginMaxHTTPVersion", "ZonesSchemasPolish", "PrefetchPreload", + "ZonesPrivacyPass", "ProxyReadTimeout", "PseudoIPV4", "ZonesReplaceInsecureJS", @@ -540,6 +541,17 @@ class PrefetchPreload(TypedDict, total=False): """Current value of the zone setting.""" +class ZonesPrivacyPass(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + id: Required[Literal["privacy_pass"]] + """ID of the zone setting.""" + + value: Required[Literal["on", "off"]] + """Current value of the zone setting.""" + + class ProxyReadTimeout(TypedDict, total=False): zone_id: Required[str] """Identifier""" @@ -819,6 +831,7 @@ class Websocket(TypedDict, total=False): ZonesCacheRulesOriginMaxHTTPVersion, ZonesSchemasPolish, PrefetchPreload, + ZonesPrivacyPass, ProxyReadTimeout, PseudoIPV4, ZonesReplaceInsecureJS, diff --git a/src/cloudflare/types/zones/setting_edit_response.py b/src/cloudflare/types/zones/setting_edit_response.py index fd0ee081db1..2419b268f58 100644 --- a/src/cloudflare/types/zones/setting_edit_response.py +++ b/src/cloudflare/types/zones/setting_edit_response.py @@ -55,6 +55,7 @@ "ZonesCacheRulesOriginH2MaxStreams", "ZonesCacheRulesOriginMaxHTTPVersion", "ZonesSchemasPolish", + "ZonesPrivacyPass", "ZonesReplaceInsecureJS", "ZonesSchemasResponseBuffering", "ZonesSchemasRocketLoader", @@ -402,6 +403,23 @@ class ZonesSchemasPolish(BaseModel): """last time this setting was modified.""" +class ZonesPrivacyPass(BaseModel): + id: Literal["privacy_pass"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + class ZonesReplaceInsecureJS(BaseModel): id: Literal["replace_insecure_js"] """ID of the zone setting.""" @@ -626,6 +644,7 @@ class ZonesSchemasWAF(BaseModel): ZonesCacheRulesOriginMaxHTTPVersion, ZonesSchemasPolish, PrefetchPreload, + ZonesPrivacyPass, ProxyReadTimeout, PseudoIPV4, ZonesReplaceInsecureJS, diff --git a/src/cloudflare/types/zones/setting_get_response.py b/src/cloudflare/types/zones/setting_get_response.py index f7fd9fbeee5..4a1c521b7ae 100644 --- a/src/cloudflare/types/zones/setting_get_response.py +++ b/src/cloudflare/types/zones/setting_get_response.py @@ -55,6 +55,7 @@ "ZonesCacheRulesOriginH2MaxStreams", "ZonesCacheRulesOriginMaxHTTPVersion", "ZonesSchemasPolish", + "ZonesPrivacyPass", "ZonesReplaceInsecureJS", "ZonesSchemasResponseBuffering", "ZonesSchemasRocketLoader", @@ -402,6 +403,23 @@ class ZonesSchemasPolish(BaseModel): """last time this setting was modified.""" +class ZonesPrivacyPass(BaseModel): + id: Literal["privacy_pass"] + """ID of the zone setting.""" + + value: Literal["on", "off"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + class ZonesReplaceInsecureJS(BaseModel): id: Literal["replace_insecure_js"] """ID of the zone setting.""" @@ -626,6 +644,7 @@ class ZonesSchemasWAF(BaseModel): ZonesCacheRulesOriginMaxHTTPVersion, ZonesSchemasPolish, PrefetchPreload, + ZonesPrivacyPass, ProxyReadTimeout, PseudoIPV4, ZonesReplaceInsecureJS, diff --git a/src/cloudflare/types/zones/zone_edit_params.py b/src/cloudflare/types/zones/zone_edit_params.py index c427c1493eb..a9d04859564 100644 --- a/src/cloudflare/types/zones/zone_edit_params.py +++ b/src/cloudflare/types/zones/zone_edit_params.py @@ -12,7 +12,7 @@ class ZoneEditParams(TypedDict, total=False): zone_id: Required[str] """Identifier""" - type: Literal["full", "partial", "secondary"] + type: Literal["full", "partial", "secondary", "internal"] """A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup. This diff --git a/tests/api_resources/zones/test_settings.py b/tests/api_resources/zones/test_settings.py index e3342d699c7..15e54b130e0 100644 --- a/tests/api_resources/zones/test_settings.py +++ b/tests/api_resources/zones/test_settings.py @@ -2138,6 +2138,64 @@ def test_path_params_edit_overload_36(self, client: Cloudflare) -> None: @parametrize def test_method_edit_overload_37(self, client: Cloudflare) -> None: + setting = client.zones.settings.edit( + setting_id="always_online", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="privacy_pass", + value="on", + ) + assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) + + @parametrize + def test_raw_response_edit_overload_37(self, client: Cloudflare) -> None: + response = client.zones.settings.with_raw_response.edit( + setting_id="always_online", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="privacy_pass", + value="on", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + setting = response.parse() + assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) + + @parametrize + def test_streaming_response_edit_overload_37(self, client: Cloudflare) -> None: + with client.zones.settings.with_streaming_response.edit( + setting_id="always_online", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="privacy_pass", + value="on", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + setting = response.parse() + assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_edit_overload_37(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zones.settings.with_raw_response.edit( + setting_id="always_online", + zone_id="", + id="privacy_pass", + value="on", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"): + client.zones.settings.with_raw_response.edit( + setting_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="privacy_pass", + value="on", + ) + + @parametrize + def test_method_edit_overload_38(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2147,7 +2205,7 @@ def test_method_edit_overload_37(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_37(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_38(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2161,7 +2219,7 @@ def test_raw_response_edit_overload_37(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_37(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_38(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2177,7 +2235,7 @@ def test_streaming_response_edit_overload_37(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_37(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_38(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -2195,7 +2253,7 @@ def test_path_params_edit_overload_37(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_38(self, client: Cloudflare) -> None: + def test_method_edit_overload_39(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2205,7 +2263,7 @@ def test_method_edit_overload_38(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_38(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_39(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2219,7 +2277,7 @@ def test_raw_response_edit_overload_38(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_38(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_39(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2235,7 +2293,7 @@ def test_streaming_response_edit_overload_38(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_38(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_39(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -2253,7 +2311,7 @@ def test_path_params_edit_overload_38(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_39(self, client: Cloudflare) -> None: + def test_method_edit_overload_40(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2263,7 +2321,7 @@ def test_method_edit_overload_39(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_39(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_40(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2277,7 +2335,7 @@ def test_raw_response_edit_overload_39(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_39(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_40(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2293,7 +2351,7 @@ def test_streaming_response_edit_overload_39(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_39(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_40(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -2311,7 +2369,7 @@ def test_path_params_edit_overload_39(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_40(self, client: Cloudflare) -> None: + def test_method_edit_overload_41(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2321,7 +2379,7 @@ def test_method_edit_overload_40(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_40(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_41(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2335,7 +2393,7 @@ def test_raw_response_edit_overload_40(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_40(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_41(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2351,7 +2409,7 @@ def test_streaming_response_edit_overload_40(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_40(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_41(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -2369,7 +2427,7 @@ def test_path_params_edit_overload_40(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_41(self, client: Cloudflare) -> None: + def test_method_edit_overload_42(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2379,7 +2437,7 @@ def test_method_edit_overload_41(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_41(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_42(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2393,7 +2451,7 @@ def test_raw_response_edit_overload_41(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_41(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_42(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2409,7 +2467,7 @@ def test_streaming_response_edit_overload_41(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_41(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_42(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -2427,7 +2485,7 @@ def test_path_params_edit_overload_41(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_42(self, client: Cloudflare) -> None: + def test_method_edit_overload_43(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2444,7 +2502,7 @@ def test_method_edit_overload_42(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_42(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_43(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2465,7 +2523,7 @@ def test_raw_response_edit_overload_42(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_42(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_43(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2488,7 +2546,7 @@ def test_streaming_response_edit_overload_42(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_42(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_43(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -2520,7 +2578,7 @@ def test_path_params_edit_overload_42(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_43(self, client: Cloudflare) -> None: + def test_method_edit_overload_44(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2530,7 +2588,7 @@ def test_method_edit_overload_43(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_method_edit_with_all_params_overload_43(self, client: Cloudflare) -> None: + def test_method_edit_with_all_params_overload_44(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2548,7 +2606,7 @@ def test_method_edit_with_all_params_overload_43(self, client: Cloudflare) -> No assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_43(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_44(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2562,7 +2620,7 @@ def test_raw_response_edit_overload_43(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_43(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_44(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2578,7 +2636,7 @@ def test_streaming_response_edit_overload_43(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_43(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_44(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -2596,7 +2654,7 @@ def test_path_params_edit_overload_43(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_44(self, client: Cloudflare) -> None: + def test_method_edit_overload_45(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2606,7 +2664,7 @@ def test_method_edit_overload_44(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_44(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_45(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2620,7 +2678,7 @@ def test_raw_response_edit_overload_44(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_44(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_45(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2636,7 +2694,7 @@ def test_streaming_response_edit_overload_44(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_44(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_45(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -2654,7 +2712,7 @@ def test_path_params_edit_overload_44(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_45(self, client: Cloudflare) -> None: + def test_method_edit_overload_46(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2664,7 +2722,7 @@ def test_method_edit_overload_45(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_45(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_46(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2678,7 +2736,7 @@ def test_raw_response_edit_overload_45(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_45(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_46(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2694,7 +2752,7 @@ def test_streaming_response_edit_overload_45(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_45(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_46(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -2712,7 +2770,7 @@ def test_path_params_edit_overload_45(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_46(self, client: Cloudflare) -> None: + def test_method_edit_overload_47(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2722,7 +2780,7 @@ def test_method_edit_overload_46(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_46(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_47(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2736,7 +2794,7 @@ def test_raw_response_edit_overload_46(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_46(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_47(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2752,7 +2810,7 @@ def test_streaming_response_edit_overload_46(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_46(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_47(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -2770,7 +2828,7 @@ def test_path_params_edit_overload_46(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_47(self, client: Cloudflare) -> None: + def test_method_edit_overload_48(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2780,7 +2838,7 @@ def test_method_edit_overload_47(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_47(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_48(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2794,7 +2852,7 @@ def test_raw_response_edit_overload_47(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_47(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_48(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2810,7 +2868,7 @@ def test_streaming_response_edit_overload_47(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_47(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_48(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -2828,7 +2886,7 @@ def test_path_params_edit_overload_47(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_48(self, client: Cloudflare) -> None: + def test_method_edit_overload_49(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2838,7 +2896,7 @@ def test_method_edit_overload_48(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_48(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_49(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2852,7 +2910,7 @@ def test_raw_response_edit_overload_48(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_48(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_49(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2868,7 +2926,7 @@ def test_streaming_response_edit_overload_48(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_48(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_49(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -2886,7 +2944,7 @@ def test_path_params_edit_overload_48(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_49(self, client: Cloudflare) -> None: + def test_method_edit_overload_50(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2894,7 +2952,7 @@ def test_method_edit_overload_49(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_method_edit_with_all_params_overload_49(self, client: Cloudflare) -> None: + def test_method_edit_with_all_params_overload_50(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2904,7 +2962,7 @@ def test_method_edit_with_all_params_overload_49(self, client: Cloudflare) -> No assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_49(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_50(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2916,7 +2974,7 @@ def test_raw_response_edit_overload_49(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_49(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_50(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2930,7 +2988,7 @@ def test_streaming_response_edit_overload_49(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_49(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_50(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -2944,7 +3002,7 @@ def test_path_params_edit_overload_49(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_50(self, client: Cloudflare) -> None: + def test_method_edit_overload_51(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2954,7 +3012,7 @@ def test_method_edit_overload_50(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_50(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_51(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2968,7 +3026,7 @@ def test_raw_response_edit_overload_50(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_50(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_51(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -2984,7 +3042,7 @@ def test_streaming_response_edit_overload_50(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_50(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_51(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -3002,7 +3060,7 @@ def test_path_params_edit_overload_50(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_51(self, client: Cloudflare) -> None: + def test_method_edit_overload_52(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3012,7 +3070,7 @@ def test_method_edit_overload_51(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_51(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_52(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3026,7 +3084,7 @@ def test_raw_response_edit_overload_51(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_51(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_52(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3042,7 +3100,7 @@ def test_streaming_response_edit_overload_51(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_51(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_52(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -3060,7 +3118,7 @@ def test_path_params_edit_overload_51(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_52(self, client: Cloudflare) -> None: + def test_method_edit_overload_53(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3070,7 +3128,7 @@ def test_method_edit_overload_52(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_52(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_53(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3084,7 +3142,7 @@ def test_raw_response_edit_overload_52(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_52(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_53(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3100,7 +3158,7 @@ def test_streaming_response_edit_overload_52(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_52(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_53(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -3118,7 +3176,7 @@ def test_path_params_edit_overload_52(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_53(self, client: Cloudflare) -> None: + def test_method_edit_overload_54(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3128,7 +3186,7 @@ def test_method_edit_overload_53(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_53(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_54(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3142,7 +3200,7 @@ def test_raw_response_edit_overload_53(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_53(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_54(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3158,7 +3216,7 @@ def test_streaming_response_edit_overload_53(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_53(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_54(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -3176,7 +3234,7 @@ def test_path_params_edit_overload_53(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_54(self, client: Cloudflare) -> None: + def test_method_edit_overload_55(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3186,7 +3244,7 @@ def test_method_edit_overload_54(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_54(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_55(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3200,7 +3258,7 @@ def test_raw_response_edit_overload_54(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_54(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_55(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3216,7 +3274,7 @@ def test_streaming_response_edit_overload_54(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_54(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_55(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -3234,7 +3292,7 @@ def test_path_params_edit_overload_54(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_55(self, client: Cloudflare) -> None: + def test_method_edit_overload_56(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3244,7 +3302,7 @@ def test_method_edit_overload_55(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_55(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_56(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3258,7 +3316,7 @@ def test_raw_response_edit_overload_55(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_55(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_56(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3274,7 +3332,7 @@ def test_streaming_response_edit_overload_55(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_55(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_56(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -3292,7 +3350,7 @@ def test_path_params_edit_overload_55(self, client: Cloudflare) -> None: ) @parametrize - def test_method_edit_overload_56(self, client: Cloudflare) -> None: + def test_method_edit_overload_57(self, client: Cloudflare) -> None: setting = client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3302,7 +3360,7 @@ def test_method_edit_overload_56(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_raw_response_edit_overload_56(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_57(self, client: Cloudflare) -> None: response = client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3316,7 +3374,7 @@ def test_raw_response_edit_overload_56(self, client: Cloudflare) -> None: assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - def test_streaming_response_edit_overload_56(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_57(self, client: Cloudflare) -> None: with client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -3332,7 +3390,7 @@ def test_streaming_response_edit_overload_56(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_56(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_57(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -5519,6 +5577,64 @@ async def test_path_params_edit_overload_36(self, async_client: AsyncCloudflare) @parametrize async def test_method_edit_overload_37(self, async_client: AsyncCloudflare) -> None: + setting = await async_client.zones.settings.edit( + setting_id="always_online", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="privacy_pass", + value="on", + ) + assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) + + @parametrize + async def test_raw_response_edit_overload_37(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zones.settings.with_raw_response.edit( + setting_id="always_online", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="privacy_pass", + value="on", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + setting = await response.parse() + assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) + + @parametrize + async def test_streaming_response_edit_overload_37(self, async_client: AsyncCloudflare) -> None: + async with async_client.zones.settings.with_streaming_response.edit( + setting_id="always_online", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="privacy_pass", + value="on", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + setting = await response.parse() + assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_edit_overload_37(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zones.settings.with_raw_response.edit( + setting_id="always_online", + zone_id="", + id="privacy_pass", + value="on", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"): + await async_client.zones.settings.with_raw_response.edit( + setting_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + id="privacy_pass", + value="on", + ) + + @parametrize + async def test_method_edit_overload_38(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5528,7 +5644,7 @@ async def test_method_edit_overload_37(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_37(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_38(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5542,7 +5658,7 @@ async def test_raw_response_edit_overload_37(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_37(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_38(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5558,7 +5674,7 @@ async def test_streaming_response_edit_overload_37(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_37(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_38(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -5576,7 +5692,7 @@ async def test_path_params_edit_overload_37(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_38(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_39(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5586,7 +5702,7 @@ async def test_method_edit_overload_38(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_38(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_39(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5600,7 +5716,7 @@ async def test_raw_response_edit_overload_38(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_38(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_39(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5616,7 +5732,7 @@ async def test_streaming_response_edit_overload_38(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_38(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_39(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -5634,7 +5750,7 @@ async def test_path_params_edit_overload_38(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_39(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_40(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5644,7 +5760,7 @@ async def test_method_edit_overload_39(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_39(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_40(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5658,7 +5774,7 @@ async def test_raw_response_edit_overload_39(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_39(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_40(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5674,7 +5790,7 @@ async def test_streaming_response_edit_overload_39(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_39(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_40(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -5692,7 +5808,7 @@ async def test_path_params_edit_overload_39(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_40(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_41(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5702,7 +5818,7 @@ async def test_method_edit_overload_40(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_40(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_41(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5716,7 +5832,7 @@ async def test_raw_response_edit_overload_40(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_40(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_41(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5732,7 +5848,7 @@ async def test_streaming_response_edit_overload_40(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_40(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_41(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -5750,7 +5866,7 @@ async def test_path_params_edit_overload_40(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_41(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_42(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5760,7 +5876,7 @@ async def test_method_edit_overload_41(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_41(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_42(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5774,7 +5890,7 @@ async def test_raw_response_edit_overload_41(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_41(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_42(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5790,7 +5906,7 @@ async def test_streaming_response_edit_overload_41(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_41(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_42(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -5808,7 +5924,7 @@ async def test_path_params_edit_overload_41(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_42(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_43(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5825,7 +5941,7 @@ async def test_method_edit_overload_42(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_42(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_43(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5846,7 +5962,7 @@ async def test_raw_response_edit_overload_42(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_42(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_43(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5869,7 +5985,7 @@ async def test_streaming_response_edit_overload_42(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_42(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_43(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -5901,7 +6017,7 @@ async def test_path_params_edit_overload_42(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_43(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_44(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5911,7 +6027,7 @@ async def test_method_edit_overload_43(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_method_edit_with_all_params_overload_43(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_with_all_params_overload_44(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5929,7 +6045,7 @@ async def test_method_edit_with_all_params_overload_43(self, async_client: Async assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_43(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_44(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5943,7 +6059,7 @@ async def test_raw_response_edit_overload_43(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_43(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_44(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5959,7 +6075,7 @@ async def test_streaming_response_edit_overload_43(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_43(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_44(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -5977,7 +6093,7 @@ async def test_path_params_edit_overload_43(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_44(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_45(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -5987,7 +6103,7 @@ async def test_method_edit_overload_44(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_44(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_45(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6001,7 +6117,7 @@ async def test_raw_response_edit_overload_44(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_44(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_45(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6017,7 +6133,7 @@ async def test_streaming_response_edit_overload_44(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_44(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_45(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -6035,7 +6151,7 @@ async def test_path_params_edit_overload_44(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_45(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_46(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6045,7 +6161,7 @@ async def test_method_edit_overload_45(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_45(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_46(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6059,7 +6175,7 @@ async def test_raw_response_edit_overload_45(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_45(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_46(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6075,7 +6191,7 @@ async def test_streaming_response_edit_overload_45(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_45(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_46(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -6093,7 +6209,7 @@ async def test_path_params_edit_overload_45(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_46(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_47(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6103,7 +6219,7 @@ async def test_method_edit_overload_46(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_46(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_47(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6117,7 +6233,7 @@ async def test_raw_response_edit_overload_46(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_46(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_47(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6133,7 +6249,7 @@ async def test_streaming_response_edit_overload_46(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_46(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_47(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -6151,7 +6267,7 @@ async def test_path_params_edit_overload_46(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_47(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_48(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6161,7 +6277,7 @@ async def test_method_edit_overload_47(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_47(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_48(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6175,7 +6291,7 @@ async def test_raw_response_edit_overload_47(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_47(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_48(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6191,7 +6307,7 @@ async def test_streaming_response_edit_overload_47(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_47(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_48(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -6209,7 +6325,7 @@ async def test_path_params_edit_overload_47(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_48(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_49(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6219,7 +6335,7 @@ async def test_method_edit_overload_48(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_48(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_49(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6233,7 +6349,7 @@ async def test_raw_response_edit_overload_48(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_48(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_49(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6249,7 +6365,7 @@ async def test_streaming_response_edit_overload_48(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_48(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_49(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -6267,7 +6383,7 @@ async def test_path_params_edit_overload_48(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_49(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_50(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6275,7 +6391,7 @@ async def test_method_edit_overload_49(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_method_edit_with_all_params_overload_49(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_with_all_params_overload_50(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6285,7 +6401,7 @@ async def test_method_edit_with_all_params_overload_49(self, async_client: Async assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_49(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_50(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6297,7 +6413,7 @@ async def test_raw_response_edit_overload_49(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_49(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_50(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6311,7 +6427,7 @@ async def test_streaming_response_edit_overload_49(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_49(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_50(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -6325,7 +6441,7 @@ async def test_path_params_edit_overload_49(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_50(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_51(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6335,7 +6451,7 @@ async def test_method_edit_overload_50(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_50(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_51(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6349,7 +6465,7 @@ async def test_raw_response_edit_overload_50(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_50(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_51(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6365,7 +6481,7 @@ async def test_streaming_response_edit_overload_50(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_50(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_51(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -6383,7 +6499,7 @@ async def test_path_params_edit_overload_50(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_51(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_52(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6393,7 +6509,7 @@ async def test_method_edit_overload_51(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_51(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_52(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6407,7 +6523,7 @@ async def test_raw_response_edit_overload_51(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_51(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_52(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6423,7 +6539,7 @@ async def test_streaming_response_edit_overload_51(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_51(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_52(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -6441,7 +6557,7 @@ async def test_path_params_edit_overload_51(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_52(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_53(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6451,7 +6567,7 @@ async def test_method_edit_overload_52(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_52(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_53(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6465,7 +6581,7 @@ async def test_raw_response_edit_overload_52(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_52(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_53(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6481,7 +6597,7 @@ async def test_streaming_response_edit_overload_52(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_52(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_53(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -6499,7 +6615,7 @@ async def test_path_params_edit_overload_52(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_53(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_54(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6509,7 +6625,7 @@ async def test_method_edit_overload_53(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_53(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_54(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6523,7 +6639,7 @@ async def test_raw_response_edit_overload_53(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_53(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_54(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6539,7 +6655,7 @@ async def test_streaming_response_edit_overload_53(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_53(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_54(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -6557,7 +6673,7 @@ async def test_path_params_edit_overload_53(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_54(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_55(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6567,7 +6683,7 @@ async def test_method_edit_overload_54(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_54(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_55(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6581,7 +6697,7 @@ async def test_raw_response_edit_overload_54(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_54(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_55(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6597,7 +6713,7 @@ async def test_streaming_response_edit_overload_54(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_54(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_55(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -6615,7 +6731,7 @@ async def test_path_params_edit_overload_54(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_55(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_56(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6625,7 +6741,7 @@ async def test_method_edit_overload_55(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_55(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_56(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6639,7 +6755,7 @@ async def test_raw_response_edit_overload_55(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_55(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_56(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6655,7 +6771,7 @@ async def test_streaming_response_edit_overload_55(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_55(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_56(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", @@ -6673,7 +6789,7 @@ async def test_path_params_edit_overload_55(self, async_client: AsyncCloudflare) ) @parametrize - async def test_method_edit_overload_56(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_57(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zones.settings.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6683,7 +6799,7 @@ async def test_method_edit_overload_56(self, async_client: AsyncCloudflare) -> N assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_raw_response_edit_overload_56(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_57(self, async_client: AsyncCloudflare) -> None: response = await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6697,7 +6813,7 @@ async def test_raw_response_edit_overload_56(self, async_client: AsyncCloudflare assert_matches_type(Optional[SettingEditResponse], setting, path=["response"]) @parametrize - async def test_streaming_response_edit_overload_56(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_57(self, async_client: AsyncCloudflare) -> None: async with async_client.zones.settings.with_streaming_response.edit( setting_id="always_online", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -6713,7 +6829,7 @@ async def test_streaming_response_edit_overload_56(self, async_client: AsyncClou assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_56(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_57(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zones.settings.with_raw_response.edit( setting_id="always_online", From d2a217c59381f1624530dbe79461ab9846ca4254 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 21:52:05 +0000 Subject: [PATCH 180/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 8b902c7854c..c45e5590c65 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-79b2980c84173020de4bcd0c81571a5fea7ee2e1ccd8f89959f1aa7e83cf4952.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fc562128cab85cd116a8c4e1fe17a0f09a5019da2d1bbe162c476aa999932c4e.yml From 2a844c61654672122a65a8999262aedb635c37ac Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 22:02:47 +0000 Subject: [PATCH 181/358] chore(internal): codegen related update (#2448) --- api.md | 58 ++--- .../resources/accounts/subscriptions.py | 13 +- .../resources/accounts/tokens/tokens.py | 44 ++-- .../resources/api_gateway/configurations.py | 8 + .../api_gateway/discovery/discovery.py | 4 + .../api_gateway/discovery/operations.py | 16 ++ .../expression_template/fallthrough.py | 4 + .../api_gateway/operations/operations.py | 24 ++ .../operations/schema_validation.py | 12 + .../resources/api_gateway/schemas.py | 4 + .../api_gateway/settings/schema_validation.py | 12 + .../api_gateway/user_schemas/hosts.py | 4 + .../api_gateway/user_schemas/operations.py | 4 + .../api_gateway/user_schemas/user_schemas.py | 20 ++ .../resources/content_scanning/payloads.py | 4 +- src/cloudflare/resources/dns/records.py | 5 +- .../resources/dns/settings/views.py | 8 +- .../resources/dns_firewall/dns_firewall.py | 24 +- src/cloudflare/resources/email_routing/dns.py | 25 +- .../resources/email_routing/email_routing.py | 37 +-- .../resources/email_routing/rules/rules.py | 48 ++-- src/cloudflare/resources/firewall/ua_rules.py | 13 +- .../leaked_credential_checks/detections.py | 24 +- src/cloudflare/resources/registrar/domains.py | 13 +- .../spectrum/analytics/events/bytimes.py | 12 + .../spectrum/analytics/events/summaries.py | 12 + src/cloudflare/resources/spectrum/apps.py | 72 ++---- .../resources/user/tokens/tokens.py | 44 ++-- .../resources/zero_trust/devices/networks.py | 12 + src/cloudflare/resources/zones/rate_plans.py | 13 +- .../types/accounts/token_update_params.py | 18 +- .../api_gateway/configuration_get_params.py | 1 + .../configuration_update_params.py | 1 + .../discovery/operation_bulk_edit_params.py | 1 + .../discovery/operation_edit_params.py | 1 + .../discovery/operation_list_params.py | 1 + .../api_gateway/discovery_get_response.py | 3 +- .../types/api_gateway/discovery_operation.py | 3 +- .../fallthrough_create_params.py | 1 + .../operation_bulk_create_params.py | 1 + .../operation_bulk_create_response.py | 4 +- .../api_gateway/operation_create_params.py | 1 + .../api_gateway/operation_create_response.py | 4 +- .../types/api_gateway/operation_get_params.py | 1 + .../api_gateway/operation_get_response.py | 4 +- .../api_gateway/operation_list_params.py | 1 + .../api_gateway/operation_list_response.py | 4 +- .../schema_validation_edit_params.py | 1 + .../schema_validation_update_params.py | 1 + .../types/api_gateway/public_schema.py | 4 +- .../types/api_gateway/schema_list_params.py | 1 + .../settings/schema_validation_edit_params.py | 1 + .../schema_validation_update_params.py | 1 + .../api_gateway/user_schema_create_params.py | 1 + .../api_gateway/user_schema_edit_params.py | 1 + .../api_gateway/user_schema_get_params.py | 1 + .../api_gateway/user_schema_list_params.py | 1 + .../user_schemas/host_list_params.py | 1 + .../user_schemas/host_list_response.py | 4 +- .../user_schemas/operation_list_params.py | 1 + .../user_schemas/operation_list_response.py | 4 +- .../payload_create_response.py | 2 +- .../payload_delete_response.py | 2 +- .../content_scanning/payload_list_response.py | 2 +- .../custom_certificates/custom_certificate.py | 3 +- src/cloudflare/types/dns/batch_patch_param.py | 231 +++++++++++++++++- src/cloudflare/types/dns/batch_put_param.py | 231 +++++++++++++++++- .../types/dns/record_batch_params.py | 3 +- .../types/dns/settings/view_create_params.py | 4 +- .../dns_firewall_create_params.py | 10 +- .../dns_firewall/reverse_dns_edit_response.py | 4 +- .../dns_firewall/reverse_dns_get_response.py | 4 +- .../types/email_routing/__init__.py | 1 + .../types/email_routing/settings.py | 38 +++ src/cloudflare/types/firewall/__init__.py | 1 + .../types/firewall/ua_rule_list_response.py | 39 +++ .../types/hyperdrive/config_create_params.py | 8 +- .../types/hyperdrive/config_edit_params.py | 8 +- .../types/hyperdrive/config_update_params.py | 8 +- src/cloudflare/types/hyperdrive/hyperdrive.py | 8 +- src/cloudflare/types/intel/domain.py | 41 +++- .../types/intel/domains/bulk_get_response.py | 33 ++- .../detection_create_params.py | 3 - .../detection_create_response.py | 2 +- .../detection_list_response.py | 2 +- .../detection_update_params.py | 3 - .../detection_update_response.py | 2 +- .../types/magic_transit/__init__.py | 1 + .../cf_interconnect_bulk_update_response.py | 3 +- .../cf_interconnect_get_response.py | 3 +- .../cf_interconnect_list_response.py | 3 +- .../cf_interconnect_update_response.py | 3 +- .../types/magic_transit/health_check.py | 52 ++++ .../types/memberships/membership.py | 3 +- .../memberships/membership_get_response.py | 3 +- .../memberships/membership_update_response.py | 3 +- src/cloudflare/types/registrar/__init__.py | 1 + src/cloudflare/types/registrar/domain.py | 116 +++++++++ .../analytics/events/bytime_get_params.py | 8 + .../analytics/events/bytime_get_response.py | 4 +- .../analytics/events/summary_get_params.py | 8 + .../analytics/events/summary_get_response.py | 4 +- .../types/spectrum/app_create_params.py | 7 +- .../types/spectrum/app_create_response.py | 10 +- .../types/spectrum/app_get_response.py | 10 +- .../types/spectrum/app_list_params.py | 2 +- .../types/spectrum/app_list_response.py | 10 +- .../types/spectrum/app_update_params.py | 7 +- .../types/spectrum/app_update_response.py | 10 +- .../types/user/token_update_params.py | 20 +- .../types/workers/scripts/__init__.py | 1 + .../types/workers/scripts/schedule.py | 15 ++ .../workers/scripts/schedule_get_response.py | 3 +- .../scripts/schedule_update_response.py | 3 +- .../users/active_session_get_response.py | 3 +- .../zero_trust/devices/device_network.py | 19 +- .../devices/network_create_params.py | 4 + .../devices/network_update_params.py | 4 + .../zero_trust/devices/posture/integration.py | 2 +- src/cloudflare/types/zones/__init__.py | 1 + .../types/zones/rate_plan_get_response.py | 39 +++ .../accounts/test_subscriptions.py | 13 +- tests/api_resources/accounts/test_tokens.py | 182 ++++++++++++-- .../api_gateway/discovery/test_operations.py | 68 +++--- .../expression_template/test_fallthrough.py | 12 +- .../operations/test_schema_validation.py | 48 ++-- .../settings/test_schema_validation.py | 44 ++-- .../api_gateway/test_configurations.py | 28 +-- .../api_gateway/test_discovery.py | 12 +- .../api_gateway/test_operations.py | 88 +++---- .../api_resources/api_gateway/test_schemas.py | 16 +- .../api_gateway/test_user_schemas.py | 88 +++---- .../api_gateway/user_schemas/test_hosts.py | 16 +- .../user_schemas/test_operations.py | 20 +- .../content_scanning/test_payloads.py | 16 +- .../api_resources/dns/settings/test_views.py | 26 +- tests/api_resources/dns/test_records.py | 100 +++++++- tests/api_resources/email_routing/test_dns.py | 32 +-- .../api_resources/email_routing/test_rules.py | 58 ++--- tests/api_resources/firewall/test_ua_rules.py | 17 +- .../api_resources/hyperdrive/test_configs.py | 36 +-- .../test_detections.py | 40 ++- tests/api_resources/pages/test_projects.py | 28 ++- tests/api_resources/registrar/test_domains.py | 13 +- tests/api_resources/spectrum/test_apps.py | 22 -- tests/api_resources/test_dns_firewall.py | 24 +- tests/api_resources/test_email_routing.py | 39 +-- tests/api_resources/user/test_tokens.py | 152 ++++++++++-- .../zero_trust/devices/test_networks.py | 24 +- tests/api_resources/zero_trust/test_seats.py | 12 +- tests/api_resources/zones/test_rate_plans.py | 13 +- 151 files changed, 2198 insertions(+), 833 deletions(-) create mode 100644 src/cloudflare/types/email_routing/settings.py create mode 100644 src/cloudflare/types/firewall/ua_rule_list_response.py create mode 100644 src/cloudflare/types/magic_transit/health_check.py create mode 100644 src/cloudflare/types/registrar/domain.py create mode 100644 src/cloudflare/types/workers/scripts/schedule.py create mode 100644 src/cloudflare/types/zones/rate_plan_get_response.py diff --git a/api.md b/api.md index 044ad06ba86..a395785a472 100644 --- a/api.md +++ b/api.md @@ -77,7 +77,6 @@ from cloudflare.types.accounts import ( SubscriptionCreateResponse, SubscriptionUpdateResponse, SubscriptionDeleteResponse, - SubscriptionGetResponse, ) ``` @@ -86,7 +85,7 @@ Methods: - client.accounts.subscriptions.create(\*, account_id, \*\*params) -> SubscriptionCreateResponse - client.accounts.subscriptions.update(subscription_identifier, \*, account_id, \*\*params) -> SubscriptionUpdateResponse - client.accounts.subscriptions.delete(subscription_identifier, \*, account_id) -> SubscriptionDeleteResponse -- client.accounts.subscriptions.get(\*, account_id) -> SyncSinglePage[object] +- client.accounts.subscriptions.get(\*, account_id) -> SyncSinglePage[Subscription] ## Tokens @@ -473,7 +472,7 @@ from cloudflare.types.zones import RatePlanGetResponse Methods: -- client.zones.rate_plans.get(\*, zone_id) -> SyncSinglePage[object] +- client.zones.rate_plans.get(\*, zone_id) -> SyncSinglePage[RatePlanGetResponse] # LoadBalancers @@ -1535,38 +1534,28 @@ Methods: Types: ```python -from cloudflare.types.email_routing import ( - Settings, - EmailRoutingDisableResponse, - EmailRoutingEnableResponse, - EmailRoutingGetResponse, -) +from cloudflare.types.email_routing import Settings ``` Methods: -- client.email_routing.disable(\*, zone_id, \*\*params) -> object -- client.email_routing.enable(\*, zone_id, \*\*params) -> object -- client.email_routing.get(\*, zone_id) -> object +- client.email_routing.disable(\*, zone_id, \*\*params) -> Optional[Settings] +- client.email_routing.enable(\*, zone_id, \*\*params) -> Optional[Settings] +- client.email_routing.get(\*, zone_id) -> Optional[Settings] ## DNS Types: ```python -from cloudflare.types.email_routing import ( - DNSRecord, - DNSCreateResponse, - DNSEditResponse, - DNSGetResponse, -) +from cloudflare.types.email_routing import DNSRecord, DNSGetResponse ``` Methods: -- client.email_routing.dns.create(\*, zone_id, \*\*params) -> object +- client.email_routing.dns.create(\*, zone_id, \*\*params) -> Optional[Settings] - client.email_routing.dns.delete(\*, zone_id) -> SyncSinglePage[DNSRecord] -- client.email_routing.dns.edit(\*, zone_id, \*\*params) -> object +- client.email_routing.dns.edit(\*, zone_id, \*\*params) -> Optional[Settings] - client.email_routing.dns.get(\*, zone_id, \*\*params) -> DNSGetResponse ## Rules @@ -1574,24 +1563,16 @@ Methods: Types: ```python -from cloudflare.types.email_routing import ( - Action, - EmailRoutingRule, - Matcher, - RuleCreateResponse, - RuleUpdateResponse, - RuleDeleteResponse, - RuleGetResponse, -) +from cloudflare.types.email_routing import Action, EmailRoutingRule, Matcher ``` Methods: -- client.email_routing.rules.create(\*, zone_id, \*\*params) -> object -- client.email_routing.rules.update(rule_identifier, \*, zone_id, \*\*params) -> object +- client.email_routing.rules.create(\*, zone_id, \*\*params) -> Optional[EmailRoutingRule] +- client.email_routing.rules.update(rule_identifier, \*, zone_id, \*\*params) -> Optional[EmailRoutingRule] - client.email_routing.rules.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[EmailRoutingRule] -- client.email_routing.rules.delete(rule_identifier, \*, zone_id) -> object -- client.email_routing.rules.get(rule_identifier, \*, zone_id) -> object +- client.email_routing.rules.delete(rule_identifier, \*, zone_id) -> Optional[EmailRoutingRule] +- client.email_routing.rules.get(rule_identifier, \*, zone_id) -> Optional[EmailRoutingRule] ### CatchAlls @@ -1734,7 +1715,7 @@ Methods: - client.firewall.ua_rules.create(\*, zone_id, \*\*params) -> UARuleCreateResponse - client.firewall.ua_rules.update(ua_rule_id, \*, zone_id, \*\*params) -> UARuleUpdateResponse -- client.firewall.ua_rules.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[object] +- client.firewall.ua_rules.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[UARuleListResponse] - client.firewall.ua_rules.delete(ua_rule_id, \*, zone_id) -> UARuleDeleteResponse - client.firewall.ua_rules.get(ua_rule_id, \*, zone_id) -> UARuleGetResponse @@ -4178,18 +4159,13 @@ Methods: Types: ```python -from cloudflare.types.registrar import ( - Domain, - DomainUpdateResponse, - DomainListResponse, - DomainGetResponse, -) +from cloudflare.types.registrar import Domain, DomainUpdateResponse, DomainGetResponse ``` Methods: - client.registrar.domains.update(domain_name, \*, account_id, \*\*params) -> object -- client.registrar.domains.list(\*, account_id) -> SyncSinglePage[object] +- client.registrar.domains.list(\*, account_id) -> SyncSinglePage[Domain] - client.registrar.domains.get(domain_name, \*, account_id) -> object # RequestTracers diff --git a/src/cloudflare/resources/accounts/subscriptions.py b/src/cloudflare/resources/accounts/subscriptions.py index 35ac71b5b36..542727c8900 100644 --- a/src/cloudflare/resources/accounts/subscriptions.py +++ b/src/cloudflare/resources/accounts/subscriptions.py @@ -24,6 +24,7 @@ from ...pagination import SyncSinglePage, AsyncSinglePage from ..._base_client import AsyncPaginator, make_request_options from ...types.accounts import subscription_create_params, subscription_update_params +from ...types.shared.subscription import Subscription from ...types.shared_params.rate_plan import RatePlan from ...types.accounts.subscription_create_response import SubscriptionCreateResponse from ...types.accounts.subscription_delete_response import SubscriptionDeleteResponse @@ -229,7 +230,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[object]: + ) -> SyncSinglePage[Subscription]: """ Lists all of an account's subscriptions. @@ -248,11 +249,11 @@ def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/subscriptions", - page=SyncSinglePage[object], + page=SyncSinglePage[Subscription], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=object, + model=Subscription, ) @@ -453,7 +454,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[object, AsyncSinglePage[object]]: + ) -> AsyncPaginator[Subscription, AsyncSinglePage[Subscription]]: """ Lists all of an account's subscriptions. @@ -472,11 +473,11 @@ def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/subscriptions", - page=AsyncSinglePage[object], + page=AsyncSinglePage[Subscription], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=object, + model=Subscription, ) diff --git a/src/cloudflare/resources/accounts/tokens/tokens.py b/src/cloudflare/resources/accounts/tokens/tokens.py index a5065793784..5af8755d84e 100644 --- a/src/cloudflare/resources/accounts/tokens/tokens.py +++ b/src/cloudflare/resources/accounts/tokens/tokens.py @@ -146,12 +146,12 @@ def update( token_id: str, *, account_id: str, + name: str, + policies: Iterable[TokenPolicy], + status: Literal["active", "disabled", "expired"], condition: token_update_params.Condition | NotGiven = NOT_GIVEN, expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, not_before: Union[str, datetime] | NotGiven = NOT_GIVEN, - policies: Iterable[TokenPolicy] | NotGiven = NOT_GIVEN, - status: Literal["active", "disabled", "expired"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -167,17 +167,17 @@ def update( token_id: Token identifier tag. - expires_on: The expiration time on or after which the JWT MUST NOT be accepted for - processing. - name: Token name. - not_before: The time before which the token MUST NOT be accepted for processing. - policies: List of access policies assigned to the token. status: Status of the token. + expires_on: The expiration time on or after which the JWT MUST NOT be accepted for + processing. + + not_before: The time before which the token MUST NOT be accepted for processing. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -194,12 +194,12 @@ def update( f"/accounts/{account_id}/tokens/{token_id}", body=maybe_transform( { - "condition": condition, - "expires_on": expires_on, "name": name, - "not_before": not_before, "policies": policies, "status": status, + "condition": condition, + "expires_on": expires_on, + "not_before": not_before, }, token_update_params.TokenUpdateParams, ), @@ -493,12 +493,12 @@ async def update( token_id: str, *, account_id: str, + name: str, + policies: Iterable[TokenPolicy], + status: Literal["active", "disabled", "expired"], condition: token_update_params.Condition | NotGiven = NOT_GIVEN, expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, not_before: Union[str, datetime] | NotGiven = NOT_GIVEN, - policies: Iterable[TokenPolicy] | NotGiven = NOT_GIVEN, - status: Literal["active", "disabled", "expired"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -514,17 +514,17 @@ async def update( token_id: Token identifier tag. - expires_on: The expiration time on or after which the JWT MUST NOT be accepted for - processing. - name: Token name. - not_before: The time before which the token MUST NOT be accepted for processing. - policies: List of access policies assigned to the token. status: Status of the token. + expires_on: The expiration time on or after which the JWT MUST NOT be accepted for + processing. + + not_before: The time before which the token MUST NOT be accepted for processing. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -541,12 +541,12 @@ async def update( f"/accounts/{account_id}/tokens/{token_id}", body=await async_maybe_transform( { - "condition": condition, - "expires_on": expires_on, "name": name, - "not_before": not_before, "policies": policies, "status": status, + "condition": condition, + "expires_on": expires_on, + "not_before": not_before, }, token_update_params.TokenUpdateParams, ), diff --git a/src/cloudflare/resources/api_gateway/configurations.py b/src/cloudflare/resources/api_gateway/configurations.py index 676deb86ac8..450f5205f0d 100644 --- a/src/cloudflare/resources/api_gateway/configurations.py +++ b/src/cloudflare/resources/api_gateway/configurations.py @@ -65,6 +65,8 @@ def update( Set configuration properties Args: + zone_id: Identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -103,6 +105,8 @@ def get( Retrieve information about specific configuration properties Args: + zone_id: Identifier + properties: Requests information about certain properties. extra_headers: Send extra headers @@ -165,6 +169,8 @@ async def update( Set configuration properties Args: + zone_id: Identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -203,6 +209,8 @@ async def get( Retrieve information about specific configuration properties Args: + zone_id: Identifier + properties: Requests information about certain properties. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/api_gateway/discovery/discovery.py b/src/cloudflare/resources/api_gateway/discovery/discovery.py index 21681a59777..9c3152dd49b 100644 --- a/src/cloudflare/resources/api_gateway/discovery/discovery.py +++ b/src/cloudflare/resources/api_gateway/discovery/discovery.py @@ -70,6 +70,8 @@ def get( schemas Args: + zone_id: Identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -133,6 +135,8 @@ async def get( schemas Args: + zone_id: Identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request diff --git a/src/cloudflare/resources/api_gateway/discovery/operations.py b/src/cloudflare/resources/api_gateway/discovery/operations.py index c819e5e33d7..f7a8556479a 100644 --- a/src/cloudflare/resources/api_gateway/discovery/operations.py +++ b/src/cloudflare/resources/api_gateway/discovery/operations.py @@ -77,6 +77,8 @@ def list( Retrieve the most up to date view of discovered operations Args: + zone_id: Identifier + diff: When `true`, only return API Discovery results that are not saved into API Shield Endpoint Management @@ -163,6 +165,8 @@ def bulk_edit( Update the `state` on one or more discovered operations Args: + zone_id: Identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -203,6 +207,10 @@ def edit( Update the `state` on a discovered operation Args: + zone_id: Identifier + + operation_id: UUID + state: Mark state of operation in API Discovery - `review` - Mark operation as for review @@ -280,6 +288,8 @@ def list( Retrieve the most up to date view of discovered operations Args: + zone_id: Identifier + diff: When `true`, only return API Discovery results that are not saved into API Shield Endpoint Management @@ -366,6 +376,8 @@ async def bulk_edit( Update the `state` on one or more discovered operations Args: + zone_id: Identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -406,6 +418,10 @@ async def edit( Update the `state` on a discovered operation Args: + zone_id: Identifier + + operation_id: UUID + state: Mark state of operation in API Discovery - `review` - Mark operation as for review diff --git a/src/cloudflare/resources/api_gateway/expression_template/fallthrough.py b/src/cloudflare/resources/api_gateway/expression_template/fallthrough.py index 600d3b0e0eb..1cb60fb64c1 100644 --- a/src/cloudflare/resources/api_gateway/expression_template/fallthrough.py +++ b/src/cloudflare/resources/api_gateway/expression_template/fallthrough.py @@ -63,6 +63,8 @@ def create( Generate fallthrough WAF expression template from a set of API hosts Args: + zone_id: Identifier + hosts: List of hosts to be targeted in the expression extra_headers: Send extra headers @@ -125,6 +127,8 @@ async def create( Generate fallthrough WAF expression template from a set of API hosts Args: + zone_id: Identifier + hosts: List of hosts to be targeted in the expression extra_headers: Send extra headers diff --git a/src/cloudflare/resources/api_gateway/operations/operations.py b/src/cloudflare/resources/api_gateway/operations/operations.py index 8313d6da3c1..eae381497ff 100644 --- a/src/cloudflare/resources/api_gateway/operations/operations.py +++ b/src/cloudflare/resources/api_gateway/operations/operations.py @@ -94,6 +94,8 @@ def create( last_updated date. Args: + zone_id: Identifier + endpoint: The endpoint which can contain path parameter templates in curly braces, each will be replaced from left to right with {varN}, starting with {var1}, during insertion. This will further be Cloudflare-normalized upon insertion. See: @@ -156,6 +158,8 @@ def list( Retrieve information about all operations on a zone Args: + zone_id: Identifier + direction: Direction to order results. endpoint: Filter results to only include endpoints containing this pattern. @@ -226,6 +230,8 @@ def delete( Delete an operation Args: + zone_id: Identifier + operation_id: UUID extra_headers: Send extra headers @@ -269,6 +275,8 @@ def bulk_create( its last_updated date. Args: + zone_id: Identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -305,6 +313,8 @@ def bulk_delete( Delete multiple operations Args: + zone_id: Identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -340,6 +350,8 @@ def get( Retrieve information about an operation Args: + zone_id: Identifier + operation_id: UUID feature: Add feature(s) to the results. The feature name that is given here corresponds @@ -419,6 +431,8 @@ async def create( last_updated date. Args: + zone_id: Identifier + endpoint: The endpoint which can contain path parameter templates in curly braces, each will be replaced from left to right with {varN}, starting with {var1}, during insertion. This will further be Cloudflare-normalized upon insertion. See: @@ -481,6 +495,8 @@ def list( Retrieve information about all operations on a zone Args: + zone_id: Identifier + direction: Direction to order results. endpoint: Filter results to only include endpoints containing this pattern. @@ -551,6 +567,8 @@ async def delete( Delete an operation Args: + zone_id: Identifier + operation_id: UUID extra_headers: Send extra headers @@ -594,6 +612,8 @@ def bulk_create( its last_updated date. Args: + zone_id: Identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -630,6 +650,8 @@ async def bulk_delete( Delete multiple operations Args: + zone_id: Identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -665,6 +687,8 @@ async def get( Retrieve information about an operation Args: + zone_id: Identifier + operation_id: UUID feature: Add feature(s) to the results. The feature name that is given here corresponds diff --git a/src/cloudflare/resources/api_gateway/operations/schema_validation.py b/src/cloudflare/resources/api_gateway/operations/schema_validation.py index 5468e2036a3..d08ebba4175 100644 --- a/src/cloudflare/resources/api_gateway/operations/schema_validation.py +++ b/src/cloudflare/resources/api_gateway/operations/schema_validation.py @@ -72,6 +72,8 @@ def update( Updates operation-level schema validation settings on the zone Args: + zone_id: Identifier + operation_id: UUID mitigation_action: When set, this applies a mitigation action to this operation @@ -122,6 +124,8 @@ def edit( Updates multiple operation-level schema validation settings on the zone Args: + zone_id: Identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -161,6 +165,8 @@ def get( Retrieves operation-level schema validation settings on the zone Args: + zone_id: Identifier + operation_id: UUID extra_headers: Send extra headers @@ -221,6 +227,8 @@ async def update( Updates operation-level schema validation settings on the zone Args: + zone_id: Identifier + operation_id: UUID mitigation_action: When set, this applies a mitigation action to this operation @@ -271,6 +279,8 @@ async def edit( Updates multiple operation-level schema validation settings on the zone Args: + zone_id: Identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -312,6 +322,8 @@ async def get( Retrieves operation-level schema validation settings on the zone Args: + zone_id: Identifier + operation_id: UUID extra_headers: Send extra headers diff --git a/src/cloudflare/resources/api_gateway/schemas.py b/src/cloudflare/resources/api_gateway/schemas.py index 78ea7d6af2d..79611e37e5d 100644 --- a/src/cloudflare/resources/api_gateway/schemas.py +++ b/src/cloudflare/resources/api_gateway/schemas.py @@ -65,6 +65,8 @@ def list( Retrieve operations and features as OpenAPI schemas Args: + zone_id: Identifier + feature: Add feature(s) to the results. The feature name that is given here corresponds to the resulting feature object. Have a look at the top-level object description for more details on the specific meaning. @@ -138,6 +140,8 @@ async def list( Retrieve operations and features as OpenAPI schemas Args: + zone_id: Identifier + feature: Add feature(s) to the results. The feature name that is given here corresponds to the resulting feature object. Have a look at the top-level object description for more details on the specific meaning. diff --git a/src/cloudflare/resources/api_gateway/settings/schema_validation.py b/src/cloudflare/resources/api_gateway/settings/schema_validation.py index a68b0930ca5..ccb54128e03 100644 --- a/src/cloudflare/resources/api_gateway/settings/schema_validation.py +++ b/src/cloudflare/resources/api_gateway/settings/schema_validation.py @@ -64,6 +64,8 @@ def update( Updates zone level schema validation settings on the zone Args: + zone_id: Identifier + validation_default_mitigation_action: The default mitigation action used when there is no mitigation action defined on the operation @@ -124,6 +126,8 @@ def edit( Updates zone level schema validation settings on the zone Args: + zone_id: Identifier + validation_default_mitigation_action: The default mitigation action used when there is no mitigation action defined on the operation Mitigation actions are as follows: @@ -183,6 +187,8 @@ def get( Retrieves zone level schema validation settings currently set on the zone Args: + zone_id: Identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -239,6 +245,8 @@ async def update( Updates zone level schema validation settings on the zone Args: + zone_id: Identifier + validation_default_mitigation_action: The default mitigation action used when there is no mitigation action defined on the operation @@ -299,6 +307,8 @@ async def edit( Updates zone level schema validation settings on the zone Args: + zone_id: Identifier + validation_default_mitigation_action: The default mitigation action used when there is no mitigation action defined on the operation Mitigation actions are as follows: @@ -358,6 +368,8 @@ async def get( Retrieves zone level schema validation settings currently set on the zone Args: + zone_id: Identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request diff --git a/src/cloudflare/resources/api_gateway/user_schemas/hosts.py b/src/cloudflare/resources/api_gateway/user_schemas/hosts.py index 4f5a7b66ae6..aa9fcadb55f 100644 --- a/src/cloudflare/resources/api_gateway/user_schemas/hosts.py +++ b/src/cloudflare/resources/api_gateway/user_schemas/hosts.py @@ -59,6 +59,8 @@ def list( Retrieve schema hosts in a zone Args: + zone_id: Identifier + page: Page number of paginated results. per_page: Maximum number of results per page. @@ -130,6 +132,8 @@ def list( Retrieve schema hosts in a zone Args: + zone_id: Identifier + page: Page number of paginated results. per_page: Maximum number of results per page. diff --git a/src/cloudflare/resources/api_gateway/user_schemas/operations.py b/src/cloudflare/resources/api_gateway/user_schemas/operations.py index d24ee1f3395..5a9c28fa03d 100644 --- a/src/cloudflare/resources/api_gateway/user_schemas/operations.py +++ b/src/cloudflare/resources/api_gateway/user_schemas/operations.py @@ -70,6 +70,8 @@ def list( Shield Endpoint Management will be returned as full operations. Args: + zone_id: Identifier + endpoint: Filter results to only include endpoints containing this pattern. feature: Add feature(s) to the results. The feature name that is given here corresponds @@ -171,6 +173,8 @@ def list( Shield Endpoint Management will be returned as full operations. Args: + zone_id: Identifier + endpoint: Filter results to only include endpoints containing this pattern. feature: Add feature(s) to the results. The feature name that is given here corresponds diff --git a/src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py b/src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py index 67377f8ebb9..35c37f69fb6 100644 --- a/src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py +++ b/src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py @@ -101,6 +101,8 @@ def create( Upload a schema to a zone Args: + zone_id: Identifier + file: Schema file bytes kind: Kind of schema @@ -165,6 +167,8 @@ def list( Retrieve information about all schemas on a zone Args: + zone_id: Identifier + omit_source: Omit the source-files of schemas and only retrieve their meta-data. page: Page number of paginated results. @@ -220,6 +224,8 @@ def delete( Delete a schema Args: + zone_id: Identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -257,6 +263,8 @@ def edit( Enable validation for a schema Args: + zone_id: Identifier + validation_enabled: Flag whether schema is enabled for validation. extra_headers: Send extra headers @@ -303,6 +311,8 @@ def get( Retrieve information about a specific schema on a zone Args: + zone_id: Identifier + omit_source: Omit the source-files of schemas and only retrieve their meta-data. extra_headers: Send extra headers @@ -378,6 +388,8 @@ async def create( Upload a schema to a zone Args: + zone_id: Identifier + file: Schema file bytes kind: Kind of schema @@ -442,6 +454,8 @@ def list( Retrieve information about all schemas on a zone Args: + zone_id: Identifier + omit_source: Omit the source-files of schemas and only retrieve their meta-data. page: Page number of paginated results. @@ -497,6 +511,8 @@ async def delete( Delete a schema Args: + zone_id: Identifier + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -534,6 +550,8 @@ async def edit( Enable validation for a schema Args: + zone_id: Identifier + validation_enabled: Flag whether schema is enabled for validation. extra_headers: Send extra headers @@ -580,6 +598,8 @@ async def get( Retrieve information about a specific schema on a zone Args: + zone_id: Identifier + omit_source: Omit the source-files of schemas and only retrieve their meta-data. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/content_scanning/payloads.py b/src/cloudflare/resources/content_scanning/payloads.py index 48edd35a89e..af7a8695f58 100644 --- a/src/cloudflare/resources/content_scanning/payloads.py +++ b/src/cloudflare/resources/content_scanning/payloads.py @@ -139,7 +139,7 @@ def delete( Args: zone_id: Identifier - expression_id: Identifier + expression_id: The unique ID for this custom scan expression extra_headers: Send extra headers @@ -277,7 +277,7 @@ def delete( Args: zone_id: Identifier - expression_id: Identifier + expression_id: The unique ID for this custom scan expression extra_headers: Send extra headers diff --git a/src/cloudflare/resources/dns/records.py b/src/cloudflare/resources/dns/records.py index 79d0e41d6c3..12304b13aa1 100644 --- a/src/cloudflare/resources/dns/records.py +++ b/src/cloudflare/resources/dns/records.py @@ -35,6 +35,7 @@ from ..._base_client import AsyncPaginator, make_request_options from ...types.dns.ttl_param import TTLParam from ...types.dns.record_tags import RecordTags +from ...types.dns.record_param import RecordParam from ...types.dns.batch_put_param import BatchPutParam from ...types.dns.record_response import RecordResponse from ...types.dns.batch_patch_param import BatchPatchParam @@ -3157,7 +3158,7 @@ def batch( zone_id: str, deletes: Iterable[record_batch_params.Delete] | NotGiven = NOT_GIVEN, patches: Iterable[BatchPatchParam] | NotGiven = NOT_GIVEN, - posts: Iterable[object] | NotGiven = NOT_GIVEN, + posts: Iterable[RecordParam] | NotGiven = NOT_GIVEN, puts: Iterable[BatchPutParam] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -8022,7 +8023,7 @@ async def batch( zone_id: str, deletes: Iterable[record_batch_params.Delete] | NotGiven = NOT_GIVEN, patches: Iterable[BatchPatchParam] | NotGiven = NOT_GIVEN, - posts: Iterable[object] | NotGiven = NOT_GIVEN, + posts: Iterable[RecordParam] | NotGiven = NOT_GIVEN, puts: Iterable[BatchPutParam] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. diff --git a/src/cloudflare/resources/dns/settings/views.py b/src/cloudflare/resources/dns/settings/views.py index 375150a5f49..85bf160c2ca 100644 --- a/src/cloudflare/resources/dns/settings/views.py +++ b/src/cloudflare/resources/dns/settings/views.py @@ -57,8 +57,8 @@ def create( self, *, account_id: str, - name: str | NotGiven = NOT_GIVEN, - zones: List[str] | NotGiven = NOT_GIVEN, + name: str, + zones: List[str], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -351,8 +351,8 @@ async def create( self, *, account_id: str, - name: str | NotGiven = NOT_GIVEN, - zones: List[str] | NotGiven = NOT_GIVEN, + name: str, + zones: List[str], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/cloudflare/resources/dns_firewall/dns_firewall.py b/src/cloudflare/resources/dns_firewall/dns_firewall.py index fe0264c0f89..ba1b949c1d3 100644 --- a/src/cloudflare/resources/dns_firewall/dns_firewall.py +++ b/src/cloudflare/resources/dns_firewall/dns_firewall.py @@ -86,16 +86,16 @@ def create( self, *, account_id: str, + name: str, + upstream_ips: List[UpstreamIPs], attack_mitigation: Optional[AttackMitigationParam] | NotGiven = NOT_GIVEN, deprecate_any_requests: bool | NotGiven = NOT_GIVEN, ecs_fallback: bool | NotGiven = NOT_GIVEN, maximum_cache_ttl: float | NotGiven = NOT_GIVEN, minimum_cache_ttl: float | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, negative_cache_ttl: Optional[float] | NotGiven = NOT_GIVEN, ratelimit: Optional[float] | NotGiven = NOT_GIVEN, retries: float | NotGiven = NOT_GIVEN, - upstream_ips: List[UpstreamIPs] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -109,6 +109,8 @@ def create( Args: account_id: Identifier + name: DNS Firewall cluster name + attack_mitigation: Attack mitigation settings deprecate_any_requests: Whether to refuse to answer queries for the ANY type @@ -123,8 +125,6 @@ def create( of caching between DNS Firewall and the upstream servers. Lower TTLs will be increased to the minimum defined here for caching purposes. - name: DNS Firewall cluster name - negative_cache_ttl: Negative DNS cache TTL This setting controls how long DNS Firewall should cache negative responses (e.g., NXDOMAIN) from the upstream servers. @@ -148,16 +148,16 @@ def create( f"/accounts/{account_id}/dns_firewall", body=maybe_transform( { + "name": name, + "upstream_ips": upstream_ips, "attack_mitigation": attack_mitigation, "deprecate_any_requests": deprecate_any_requests, "ecs_fallback": ecs_fallback, "maximum_cache_ttl": maximum_cache_ttl, "minimum_cache_ttl": minimum_cache_ttl, - "name": name, "negative_cache_ttl": negative_cache_ttl, "ratelimit": ratelimit, "retries": retries, - "upstream_ips": upstream_ips, }, dns_firewall_create_params.DNSFirewallCreateParams, ), @@ -438,16 +438,16 @@ async def create( self, *, account_id: str, + name: str, + upstream_ips: List[UpstreamIPs], attack_mitigation: Optional[AttackMitigationParam] | NotGiven = NOT_GIVEN, deprecate_any_requests: bool | NotGiven = NOT_GIVEN, ecs_fallback: bool | NotGiven = NOT_GIVEN, maximum_cache_ttl: float | NotGiven = NOT_GIVEN, minimum_cache_ttl: float | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, negative_cache_ttl: Optional[float] | NotGiven = NOT_GIVEN, ratelimit: Optional[float] | NotGiven = NOT_GIVEN, retries: float | NotGiven = NOT_GIVEN, - upstream_ips: List[UpstreamIPs] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -461,6 +461,8 @@ async def create( Args: account_id: Identifier + name: DNS Firewall cluster name + attack_mitigation: Attack mitigation settings deprecate_any_requests: Whether to refuse to answer queries for the ANY type @@ -475,8 +477,6 @@ async def create( of caching between DNS Firewall and the upstream servers. Lower TTLs will be increased to the minimum defined here for caching purposes. - name: DNS Firewall cluster name - negative_cache_ttl: Negative DNS cache TTL This setting controls how long DNS Firewall should cache negative responses (e.g., NXDOMAIN) from the upstream servers. @@ -500,16 +500,16 @@ async def create( f"/accounts/{account_id}/dns_firewall", body=await async_maybe_transform( { + "name": name, + "upstream_ips": upstream_ips, "attack_mitigation": attack_mitigation, "deprecate_any_requests": deprecate_any_requests, "ecs_fallback": ecs_fallback, "maximum_cache_ttl": maximum_cache_ttl, "minimum_cache_ttl": minimum_cache_ttl, - "name": name, "negative_cache_ttl": negative_cache_ttl, "ratelimit": ratelimit, "retries": retries, - "upstream_ips": upstream_ips, }, dns_firewall_create_params.DNSFirewallCreateParams, ), diff --git a/src/cloudflare/resources/email_routing/dns.py b/src/cloudflare/resources/email_routing/dns.py index 06e43976f56..66a32de1370 100644 --- a/src/cloudflare/resources/email_routing/dns.py +++ b/src/cloudflare/resources/email_routing/dns.py @@ -23,6 +23,7 @@ from ...pagination import SyncSinglePage, AsyncSinglePage from ..._base_client import AsyncPaginator, make_request_options from ...types.email_routing import dns_get_params, dns_edit_params, dns_create_params +from ...types.email_routing.settings import Settings from ...types.email_routing.dns_record import DNSRecord from ...types.email_routing.dns_get_response import DNSGetResponse @@ -60,7 +61,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[Settings]: """Enable you Email Routing zone. Add and lock the necessary MX and SPF records. @@ -88,9 +89,9 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[Settings]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[Settings]], ResultWrapper[Settings]), ) def delete( @@ -143,7 +144,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[Settings]: """ Unlock MX Records previously locked by Email Routing. @@ -170,9 +171,9 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[Settings]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[Settings]], ResultWrapper[Settings]), ) def get( @@ -252,7 +253,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[Settings]: """Enable you Email Routing zone. Add and lock the necessary MX and SPF records. @@ -280,9 +281,9 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[Settings]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[Settings]], ResultWrapper[Settings]), ) def delete( @@ -335,7 +336,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[Settings]: """ Unlock MX Records previously locked by Email Routing. @@ -362,9 +363,9 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[Settings]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[Settings]], ResultWrapper[Settings]), ) async def get( diff --git a/src/cloudflare/resources/email_routing/email_routing.py b/src/cloudflare/resources/email_routing/email_routing.py index a16b4c99c51..9d2d44107a3 100644 --- a/src/cloudflare/resources/email_routing/email_routing.py +++ b/src/cloudflare/resources/email_routing/email_routing.py @@ -46,6 +46,7 @@ ) from ..._base_client import make_request_options from ...types.email_routing import email_routing_enable_params, email_routing_disable_params +from ...types.email_routing.settings import Settings __all__ = ["EmailRoutingResource", "AsyncEmailRoutingResource"] @@ -93,7 +94,7 @@ def disable( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[Settings]: """Disable your Email Routing zone. Also removes additional MX records previously @@ -120,9 +121,9 @@ def disable( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[Settings]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[Settings]], ResultWrapper[Settings]), ) def enable( @@ -136,7 +137,7 @@ def enable( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[Settings]: """Enable you Email Routing zone. Add and lock the necessary MX and SPF records. @@ -162,9 +163,9 @@ def enable( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[Settings]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[Settings]], ResultWrapper[Settings]), ) def get( @@ -177,7 +178,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[Settings]: """ Get information about the settings for your Email Routing zone. @@ -201,9 +202,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[Settings]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[Settings]], ResultWrapper[Settings]), ) @@ -250,7 +251,7 @@ async def disable( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[Settings]: """Disable your Email Routing zone. Also removes additional MX records previously @@ -277,9 +278,9 @@ async def disable( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[Settings]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[Settings]], ResultWrapper[Settings]), ) async def enable( @@ -293,7 +294,7 @@ async def enable( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[Settings]: """Enable you Email Routing zone. Add and lock the necessary MX and SPF records. @@ -319,9 +320,9 @@ async def enable( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[Settings]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[Settings]], ResultWrapper[Settings]), ) async def get( @@ -334,7 +335,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[Settings]: """ Get information about the settings for your Email Routing zone. @@ -358,9 +359,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[Settings]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[Settings]], ResultWrapper[Settings]), ) diff --git a/src/cloudflare/resources/email_routing/rules/rules.py b/src/cloudflare/resources/email_routing/rules/rules.py index 638eedd9711..02951aa2987 100644 --- a/src/cloudflare/resources/email_routing/rules/rules.py +++ b/src/cloudflare/resources/email_routing/rules/rules.py @@ -78,7 +78,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[EmailRoutingRule]: """ Rules consist of a set of criteria for matching emails (such as an email being sent to a specific custom email address) plus a set of actions to take on the @@ -124,9 +124,9 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[EmailRoutingRule]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[EmailRoutingRule]], ResultWrapper[EmailRoutingRule]), ) def update( @@ -145,7 +145,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[EmailRoutingRule]: """ Update actions and matches, or enable/disable specific routing rules. @@ -193,9 +193,9 @@ def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[EmailRoutingRule]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[EmailRoutingRule]], ResultWrapper[EmailRoutingRule]), ) def list( @@ -265,7 +265,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[EmailRoutingRule]: """ Delete a specific routing rule. @@ -293,9 +293,9 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[EmailRoutingRule]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[EmailRoutingRule]], ResultWrapper[EmailRoutingRule]), ) def get( @@ -309,7 +309,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[EmailRoutingRule]: """ Get information for a specific routing rule already created. @@ -337,9 +337,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[EmailRoutingRule]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[EmailRoutingRule]], ResultWrapper[EmailRoutingRule]), ) @@ -382,7 +382,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[EmailRoutingRule]: """ Rules consist of a set of criteria for matching emails (such as an email being sent to a specific custom email address) plus a set of actions to take on the @@ -428,9 +428,9 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[EmailRoutingRule]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[EmailRoutingRule]], ResultWrapper[EmailRoutingRule]), ) async def update( @@ -449,7 +449,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[EmailRoutingRule]: """ Update actions and matches, or enable/disable specific routing rules. @@ -497,9 +497,9 @@ async def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[EmailRoutingRule]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[EmailRoutingRule]], ResultWrapper[EmailRoutingRule]), ) def list( @@ -569,7 +569,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[EmailRoutingRule]: """ Delete a specific routing rule. @@ -597,9 +597,9 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[EmailRoutingRule]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[EmailRoutingRule]], ResultWrapper[EmailRoutingRule]), ) async def get( @@ -613,7 +613,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: + ) -> Optional[EmailRoutingRule]: """ Get information for a specific routing rule already created. @@ -641,9 +641,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[object]]._unwrapper, + post_parser=ResultWrapper[Optional[EmailRoutingRule]]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[Optional[EmailRoutingRule]], ResultWrapper[EmailRoutingRule]), ) diff --git a/src/cloudflare/resources/firewall/ua_rules.py b/src/cloudflare/resources/firewall/ua_rules.py index 3178868081e..c0fcef7b441 100644 --- a/src/cloudflare/resources/firewall/ua_rules.py +++ b/src/cloudflare/resources/firewall/ua_rules.py @@ -25,6 +25,7 @@ from ..._base_client import AsyncPaginator, make_request_options from ...types.firewall import ua_rule_list_params, ua_rule_create_params, ua_rule_update_params from ...types.firewall.ua_rule_get_response import UARuleGetResponse +from ...types.firewall.ua_rule_list_response import UARuleListResponse from ...types.firewall.ua_rule_create_response import UARuleCreateResponse from ...types.firewall.ua_rule_delete_response import UARuleDeleteResponse from ...types.firewall.ua_rule_update_response import UARuleUpdateResponse @@ -186,7 +187,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncV4PagePaginationArray[object]: + ) -> SyncV4PagePaginationArray[UARuleListResponse]: """Fetches User Agent Blocking rules in a zone. You can filter the results using @@ -218,7 +219,7 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/firewall/ua_rules", - page=SyncV4PagePaginationArray[object], + page=SyncV4PagePaginationArray[UARuleListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -235,7 +236,7 @@ def list( ua_rule_list_params.UARuleListParams, ), ), - model=object, + model=UARuleListResponse, ) def delete( @@ -486,7 +487,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[object, AsyncV4PagePaginationArray[object]]: + ) -> AsyncPaginator[UARuleListResponse, AsyncV4PagePaginationArray[UARuleListResponse]]: """Fetches User Agent Blocking rules in a zone. You can filter the results using @@ -518,7 +519,7 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/firewall/ua_rules", - page=AsyncV4PagePaginationArray[object], + page=AsyncV4PagePaginationArray[UARuleListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -535,7 +536,7 @@ def list( ua_rule_list_params.UARuleListParams, ), ), - model=object, + model=UARuleListResponse, ) async def delete( diff --git a/src/cloudflare/resources/leaked_credential_checks/detections.py b/src/cloudflare/resources/leaked_credential_checks/detections.py index fcb8d5e03e4..8c448887c53 100644 --- a/src/cloudflare/resources/leaked_credential_checks/detections.py +++ b/src/cloudflare/resources/leaked_credential_checks/detections.py @@ -54,7 +54,6 @@ def create( self, *, zone_id: str, - id: object | NotGiven = NOT_GIVEN, password: str | NotGiven = NOT_GIVEN, username: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -70,8 +69,6 @@ def create( Args: zone_id: Identifier - id: The unique ID for this custom detection - password: The ruleset expression to use in matching the password in a request username: The ruleset expression to use in matching the username in a request @@ -90,7 +87,6 @@ def create( f"/zones/{zone_id}/leaked-credential-checks/detections", body=maybe_transform( { - "id": id, "password": password, "username": username, }, @@ -111,7 +107,6 @@ def update( detection_id: str, *, zone_id: str, - id: object | NotGiven = NOT_GIVEN, password: str | NotGiven = NOT_GIVEN, username: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -127,9 +122,7 @@ def update( Args: zone_id: Identifier - detection_id: Identifier - - id: The unique ID for this custom detection + detection_id: The unique ID for this custom detection password: The ruleset expression to use in matching the password in a request @@ -151,7 +144,6 @@ def update( f"/zones/{zone_id}/leaked-credential-checks/detections/{detection_id}", body=maybe_transform( { - "id": id, "password": password, "username": username, }, @@ -221,7 +213,7 @@ def delete( Args: zone_id: Identifier - detection_id: Identifier + detection_id: The unique ID for this custom detection extra_headers: Send extra headers @@ -272,7 +264,6 @@ async def create( self, *, zone_id: str, - id: object | NotGiven = NOT_GIVEN, password: str | NotGiven = NOT_GIVEN, username: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -288,8 +279,6 @@ async def create( Args: zone_id: Identifier - id: The unique ID for this custom detection - password: The ruleset expression to use in matching the password in a request username: The ruleset expression to use in matching the username in a request @@ -308,7 +297,6 @@ async def create( f"/zones/{zone_id}/leaked-credential-checks/detections", body=await async_maybe_transform( { - "id": id, "password": password, "username": username, }, @@ -329,7 +317,6 @@ async def update( detection_id: str, *, zone_id: str, - id: object | NotGiven = NOT_GIVEN, password: str | NotGiven = NOT_GIVEN, username: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -345,9 +332,7 @@ async def update( Args: zone_id: Identifier - detection_id: Identifier - - id: The unique ID for this custom detection + detection_id: The unique ID for this custom detection password: The ruleset expression to use in matching the password in a request @@ -369,7 +354,6 @@ async def update( f"/zones/{zone_id}/leaked-credential-checks/detections/{detection_id}", body=await async_maybe_transform( { - "id": id, "password": password, "username": username, }, @@ -439,7 +423,7 @@ async def delete( Args: zone_id: Identifier - detection_id: Identifier + detection_id: The unique ID for this custom detection extra_headers: Send extra headers diff --git a/src/cloudflare/resources/registrar/domains.py b/src/cloudflare/resources/registrar/domains.py index 0de9a7975a4..a6ce99f600f 100644 --- a/src/cloudflare/resources/registrar/domains.py +++ b/src/cloudflare/resources/registrar/domains.py @@ -23,6 +23,7 @@ from ...pagination import SyncSinglePage, AsyncSinglePage from ..._base_client import AsyncPaginator, make_request_options from ...types.registrar import domain_update_params +from ...types.registrar.domain import Domain __all__ = ["DomainsResource", "AsyncDomainsResource"] @@ -119,7 +120,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[object]: + ) -> SyncSinglePage[Domain]: """ List domains handled by Registrar. @@ -138,11 +139,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/registrar/domains", - page=SyncSinglePage[object], + page=SyncSinglePage[Domain], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=object, + model=Domain, ) def get( @@ -282,7 +283,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[object, AsyncSinglePage[object]]: + ) -> AsyncPaginator[Domain, AsyncSinglePage[Domain]]: """ List domains handled by Registrar. @@ -301,11 +302,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/registrar/domains", - page=AsyncSinglePage[object], + page=AsyncSinglePage[Domain], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=object, + model=Domain, ) async def get( diff --git a/src/cloudflare/resources/spectrum/analytics/events/bytimes.py b/src/cloudflare/resources/spectrum/analytics/events/bytimes.py index 6cfefed1043..31cb924952b 100644 --- a/src/cloudflare/resources/spectrum/analytics/events/bytimes.py +++ b/src/cloudflare/resources/spectrum/analytics/events/bytimes.py @@ -120,9 +120,15 @@ def get( | duration90th | 90th percentile connection duration | 1.0 | Time in milliseconds | | duration99th | 99th percentile connection duration | 1.0 | Time in milliseconds. | + since: Start of time interval to query, defaults to `until` - 6 hours. Timestamp must + be in RFC3339 format and uses UTC unless otherwise specified. + sort: The sort order for the result set; sort fields must be included in `metrics` or `dimensions`. + until: End of time interval to query, defaults to current time. Timestamp must be in + RFC3339 format and uses UTC unless otherwise specified. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -248,9 +254,15 @@ async def get( | duration90th | 90th percentile connection duration | 1.0 | Time in milliseconds | | duration99th | 99th percentile connection duration | 1.0 | Time in milliseconds. | + since: Start of time interval to query, defaults to `until` - 6 hours. Timestamp must + be in RFC3339 format and uses UTC unless otherwise specified. + sort: The sort order for the result set; sort fields must be included in `metrics` or `dimensions`. + until: End of time interval to query, defaults to current time. Timestamp must be in + RFC3339 format and uses UTC unless otherwise specified. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request diff --git a/src/cloudflare/resources/spectrum/analytics/events/summaries.py b/src/cloudflare/resources/spectrum/analytics/events/summaries.py index 773db386dd0..5956e173e37 100644 --- a/src/cloudflare/resources/spectrum/analytics/events/summaries.py +++ b/src/cloudflare/resources/spectrum/analytics/events/summaries.py @@ -117,9 +117,15 @@ def get( | duration90th | 90th percentile connection duration | 1.0 | Time in milliseconds | | duration99th | 99th percentile connection duration | 1.0 | Time in milliseconds. | + since: Start of time interval to query, defaults to `until` - 6 hours. Timestamp must + be in RFC3339 format and uses UTC unless otherwise specified. + sort: The sort order for the result set; sort fields must be included in `metrics` or `dimensions`. + until: End of time interval to query, defaults to current time. Timestamp must be in + RFC3339 format and uses UTC unless otherwise specified. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -241,9 +247,15 @@ async def get( | duration90th | 90th percentile connection duration | 1.0 | Time in milliseconds | | duration99th | 99th percentile connection duration | 1.0 | Time in milliseconds. | + since: Start of time interval to query, defaults to `until` - 6 hours. Timestamp must + be in RFC3339 format and uses UTC unless otherwise specified. + sort: The sort order for the result set; sort fields must be included in `metrics` or `dimensions`. + until: End of time interval to query, defaults to current time. Timestamp must be in + RFC3339 format and uses UTC unless otherwise specified. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request diff --git a/src/cloudflare/resources/spectrum/apps.py b/src/cloudflare/resources/spectrum/apps.py index e3a0d6ecc1d..cf7cde87c4d 100644 --- a/src/cloudflare/resources/spectrum/apps.py +++ b/src/cloudflare/resources/spectrum/apps.py @@ -86,7 +86,7 @@ def create( origin. Args: - zone_id: Identifier + zone_id: Zone identifier. dns: The name and type of DNS record for the Spectrum application. @@ -140,7 +140,6 @@ def create( self, *, zone_id: str, - id: str, dns: DNSParam, protocol: str, origin_direct: List[str] | NotGiven = NOT_GIVEN, @@ -156,9 +155,7 @@ def create( origin. Args: - zone_id: Identifier - - id: Identifier + zone_id: Zone identifier. dns: The name and type of DNS record for the Spectrum application. @@ -180,7 +177,7 @@ def create( @required_args( ["zone_id", "dns", "ip_firewall", "protocol", "proxy_protocol", "tls", "traffic_type"], - ["zone_id", "id", "dns", "protocol"], + ["zone_id", "dns", "protocol"], ) def create( self, @@ -197,7 +194,6 @@ def create( origin_direct: List[str] | NotGiven = NOT_GIVEN, origin_dns: OriginDNSParam | NotGiven = NOT_GIVEN, origin_port: OriginPortParam | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -224,7 +220,6 @@ def create( "origin_direct": origin_direct, "origin_dns": origin_dns, "origin_port": origin_port, - "id": id, }, app_create_params.AppCreateParams, ), @@ -270,9 +265,9 @@ def update( the origin. Args: - zone_id: Identifier + zone_id: Zone identifier. - app_id: Identifier + app_id: App identifier. dns: The name and type of DNS record for the Spectrum application. @@ -327,7 +322,6 @@ def update( app_id: str, *, zone_id: str, - id: str, dns: DNSParam, protocol: str, origin_direct: List[str] | NotGiven = NOT_GIVEN, @@ -343,11 +337,9 @@ def update( the origin. Args: - zone_id: Identifier - - app_id: Identifier + zone_id: Zone identifier. - id: Identifier + app_id: App identifier. dns: The name and type of DNS record for the Spectrum application. @@ -369,7 +361,7 @@ def update( @required_args( ["zone_id", "dns", "ip_firewall", "protocol", "proxy_protocol", "tls", "traffic_type"], - ["zone_id", "id", "dns", "protocol"], + ["zone_id", "dns", "protocol"], ) def update( self, @@ -387,7 +379,6 @@ def update( origin_direct: List[str] | NotGiven = NOT_GIVEN, origin_dns: OriginDNSParam | NotGiven = NOT_GIVEN, origin_port: OriginPortParam | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -416,7 +407,6 @@ def update( "origin_direct": origin_direct, "origin_dns": origin_dns, "origin_port": origin_port, - "id": id, }, app_update_params.AppUpdateParams, ), @@ -452,7 +442,7 @@ def list( Retrieves a list of currently existing Spectrum applications inside a zone. Args: - zone_id: Identifier + zone_id: Zone identifier. direction: Sets the direction by which results are ordered. @@ -511,9 +501,9 @@ def delete( Deletes a previously existing application. Args: - zone_id: Identifier + zone_id: Zone identifier. - app_id: Identifier + app_id: App identifier. extra_headers: Send extra headers @@ -555,9 +545,9 @@ def get( Gets the application configuration of a specific application inside a zone. Args: - zone_id: Identifier + zone_id: Zone identifier. - app_id: Identifier + app_id: App identifier. extra_headers: Send extra headers @@ -637,7 +627,7 @@ async def create( origin. Args: - zone_id: Identifier + zone_id: Zone identifier. dns: The name and type of DNS record for the Spectrum application. @@ -691,7 +681,6 @@ async def create( self, *, zone_id: str, - id: str, dns: DNSParam, protocol: str, origin_direct: List[str] | NotGiven = NOT_GIVEN, @@ -707,9 +696,7 @@ async def create( origin. Args: - zone_id: Identifier - - id: Identifier + zone_id: Zone identifier. dns: The name and type of DNS record for the Spectrum application. @@ -731,7 +718,7 @@ async def create( @required_args( ["zone_id", "dns", "ip_firewall", "protocol", "proxy_protocol", "tls", "traffic_type"], - ["zone_id", "id", "dns", "protocol"], + ["zone_id", "dns", "protocol"], ) async def create( self, @@ -748,7 +735,6 @@ async def create( origin_direct: List[str] | NotGiven = NOT_GIVEN, origin_dns: OriginDNSParam | NotGiven = NOT_GIVEN, origin_port: OriginPortParam | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -775,7 +761,6 @@ async def create( "origin_direct": origin_direct, "origin_dns": origin_dns, "origin_port": origin_port, - "id": id, }, app_create_params.AppCreateParams, ), @@ -821,9 +806,9 @@ async def update( the origin. Args: - zone_id: Identifier + zone_id: Zone identifier. - app_id: Identifier + app_id: App identifier. dns: The name and type of DNS record for the Spectrum application. @@ -878,7 +863,6 @@ async def update( app_id: str, *, zone_id: str, - id: str, dns: DNSParam, protocol: str, origin_direct: List[str] | NotGiven = NOT_GIVEN, @@ -894,11 +878,9 @@ async def update( the origin. Args: - zone_id: Identifier - - app_id: Identifier + zone_id: Zone identifier. - id: Identifier + app_id: App identifier. dns: The name and type of DNS record for the Spectrum application. @@ -920,7 +902,7 @@ async def update( @required_args( ["zone_id", "dns", "ip_firewall", "protocol", "proxy_protocol", "tls", "traffic_type"], - ["zone_id", "id", "dns", "protocol"], + ["zone_id", "dns", "protocol"], ) async def update( self, @@ -938,7 +920,6 @@ async def update( origin_direct: List[str] | NotGiven = NOT_GIVEN, origin_dns: OriginDNSParam | NotGiven = NOT_GIVEN, origin_port: OriginPortParam | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -967,7 +948,6 @@ async def update( "origin_direct": origin_direct, "origin_dns": origin_dns, "origin_port": origin_port, - "id": id, }, app_update_params.AppUpdateParams, ), @@ -1003,7 +983,7 @@ def list( Retrieves a list of currently existing Spectrum applications inside a zone. Args: - zone_id: Identifier + zone_id: Zone identifier. direction: Sets the direction by which results are ordered. @@ -1062,9 +1042,9 @@ async def delete( Deletes a previously existing application. Args: - zone_id: Identifier + zone_id: Zone identifier. - app_id: Identifier + app_id: App identifier. extra_headers: Send extra headers @@ -1106,9 +1086,9 @@ async def get( Gets the application configuration of a specific application inside a zone. Args: - zone_id: Identifier + zone_id: Zone identifier. - app_id: Identifier + app_id: App identifier. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/user/tokens/tokens.py b/src/cloudflare/resources/user/tokens/tokens.py index 6dda5c6ecc9..58e0def726d 100644 --- a/src/cloudflare/resources/user/tokens/tokens.py +++ b/src/cloudflare/resources/user/tokens/tokens.py @@ -140,12 +140,12 @@ def update( self, token_id: str, *, + name: str, + policies: Iterable[TokenPolicy], + status: Literal["active", "disabled", "expired"], condition: token_update_params.Condition | NotGiven = NOT_GIVEN, expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, not_before: Union[str, datetime] | NotGiven = NOT_GIVEN, - policies: Iterable[TokenPolicy] | NotGiven = NOT_GIVEN, - status: Literal["active", "disabled", "expired"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -159,17 +159,17 @@ def update( Args: token_id: Token identifier tag. - expires_on: The expiration time on or after which the JWT MUST NOT be accepted for - processing. - name: Token name. - not_before: The time before which the token MUST NOT be accepted for processing. - policies: List of access policies assigned to the token. status: Status of the token. + expires_on: The expiration time on or after which the JWT MUST NOT be accepted for + processing. + + not_before: The time before which the token MUST NOT be accepted for processing. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -184,12 +184,12 @@ def update( f"/user/tokens/{token_id}", body=maybe_transform( { - "condition": condition, - "expires_on": expires_on, "name": name, - "not_before": not_before, "policies": policies, "status": status, + "condition": condition, + "expires_on": expires_on, + "not_before": not_before, }, token_update_params.TokenUpdateParams, ), @@ -446,12 +446,12 @@ async def update( self, token_id: str, *, + name: str, + policies: Iterable[TokenPolicy], + status: Literal["active", "disabled", "expired"], condition: token_update_params.Condition | NotGiven = NOT_GIVEN, expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, not_before: Union[str, datetime] | NotGiven = NOT_GIVEN, - policies: Iterable[TokenPolicy] | NotGiven = NOT_GIVEN, - status: Literal["active", "disabled", "expired"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -465,17 +465,17 @@ async def update( Args: token_id: Token identifier tag. - expires_on: The expiration time on or after which the JWT MUST NOT be accepted for - processing. - name: Token name. - not_before: The time before which the token MUST NOT be accepted for processing. - policies: List of access policies assigned to the token. status: Status of the token. + expires_on: The expiration time on or after which the JWT MUST NOT be accepted for + processing. + + not_before: The time before which the token MUST NOT be accepted for processing. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -490,12 +490,12 @@ async def update( f"/user/tokens/{token_id}", body=await async_maybe_transform( { - "condition": condition, - "expires_on": expires_on, "name": name, - "not_before": not_before, "policies": policies, "status": status, + "condition": condition, + "expires_on": expires_on, + "not_before": not_before, }, token_update_params.TokenUpdateParams, ), diff --git a/src/cloudflare/resources/zero_trust/devices/networks.py b/src/cloudflare/resources/zero_trust/devices/networks.py index 0af6f2ec482..307aa815b20 100644 --- a/src/cloudflare/resources/zero_trust/devices/networks.py +++ b/src/cloudflare/resources/zero_trust/devices/networks.py @@ -67,6 +67,9 @@ def create( Creates a new device managed network. Args: + config: The configuration object containing information for the WARP client to detect + the managed network. + name: The name of the device managed network. This name must be unique. type: The type of device managed network. @@ -122,6 +125,9 @@ def update( Args: network_id: API UUID. + config: The configuration object containing information for the WARP client to detect + the managed network. + name: The name of the device managed network. This name must be unique. type: The type of device managed network. @@ -314,6 +320,9 @@ async def create( Creates a new device managed network. Args: + config: The configuration object containing information for the WARP client to detect + the managed network. + name: The name of the device managed network. This name must be unique. type: The type of device managed network. @@ -369,6 +378,9 @@ async def update( Args: network_id: API UUID. + config: The configuration object containing information for the WARP client to detect + the managed network. + name: The name of the device managed network. This name must be unique. type: The type of device managed network. diff --git a/src/cloudflare/resources/zones/rate_plans.py b/src/cloudflare/resources/zones/rate_plans.py index 81b26e08b25..daff981d93f 100644 --- a/src/cloudflare/resources/zones/rate_plans.py +++ b/src/cloudflare/resources/zones/rate_plans.py @@ -15,6 +15,7 @@ ) from ...pagination import SyncSinglePage, AsyncSinglePage from ..._base_client import AsyncPaginator, make_request_options +from ...types.zones.rate_plan_get_response import RatePlanGetResponse __all__ = ["RatePlansResource", "AsyncRatePlansResource"] @@ -49,7 +50,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[object]: + ) -> SyncSinglePage[RatePlanGetResponse]: """ Lists all rate plans the zone can subscribe to. @@ -68,11 +69,11 @@ def get( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/available_rate_plans", - page=SyncSinglePage[object], + page=SyncSinglePage[RatePlanGetResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=object, + model=RatePlanGetResponse, ) @@ -106,7 +107,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[object, AsyncSinglePage[object]]: + ) -> AsyncPaginator[RatePlanGetResponse, AsyncSinglePage[RatePlanGetResponse]]: """ Lists all rate plans the zone can subscribe to. @@ -125,11 +126,11 @@ def get( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/available_rate_plans", - page=AsyncSinglePage[object], + page=AsyncSinglePage[RatePlanGetResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=object, + model=RatePlanGetResponse, ) diff --git a/src/cloudflare/types/accounts/token_update_params.py b/src/cloudflare/types/accounts/token_update_params.py index bec89b38118..fe7ed0cf440 100644 --- a/src/cloudflare/types/accounts/token_update_params.py +++ b/src/cloudflare/types/accounts/token_update_params.py @@ -17,6 +17,15 @@ class TokenUpdateParams(TypedDict, total=False): account_id: Required[str] """Account identifier tag.""" + name: Required[str] + """Token name.""" + + policies: Required[Iterable[TokenPolicy]] + """List of access policies assigned to the token.""" + + status: Required[Literal["active", "disabled", "expired"]] + """Status of the token.""" + condition: Condition expires_on: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] @@ -25,18 +34,9 @@ class TokenUpdateParams(TypedDict, total=False): processing. """ - name: str - """Token name.""" - not_before: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] """The time before which the token MUST NOT be accepted for processing.""" - policies: Iterable[TokenPolicy] - """List of access policies assigned to the token.""" - - status: Literal["active", "disabled", "expired"] - """Status of the token.""" - _ConditionRequestIPReservedKeywords = TypedDict( "_ConditionRequestIPReservedKeywords", diff --git a/src/cloudflare/types/api_gateway/configuration_get_params.py b/src/cloudflare/types/api_gateway/configuration_get_params.py index ed0f784a14a..c1be0a862e8 100644 --- a/src/cloudflare/types/api_gateway/configuration_get_params.py +++ b/src/cloudflare/types/api_gateway/configuration_get_params.py @@ -10,6 +10,7 @@ class ConfigurationGetParams(TypedDict, total=False): zone_id: Required[str] + """Identifier""" properties: List[Literal["auth_id_characteristics"]] """Requests information about certain properties.""" diff --git a/src/cloudflare/types/api_gateway/configuration_update_params.py b/src/cloudflare/types/api_gateway/configuration_update_params.py index 561f4be6f33..35652656bbe 100644 --- a/src/cloudflare/types/api_gateway/configuration_update_params.py +++ b/src/cloudflare/types/api_gateway/configuration_update_params.py @@ -15,6 +15,7 @@ class ConfigurationUpdateParams(TypedDict, total=False): zone_id: Required[str] + """Identifier""" auth_id_characteristics: Required[Iterable[AuthIDCharacteristic]] diff --git a/src/cloudflare/types/api_gateway/discovery/operation_bulk_edit_params.py b/src/cloudflare/types/api_gateway/discovery/operation_bulk_edit_params.py index ed4c4ee164a..db2119fa7b6 100644 --- a/src/cloudflare/types/api_gateway/discovery/operation_bulk_edit_params.py +++ b/src/cloudflare/types/api_gateway/discovery/operation_bulk_edit_params.py @@ -10,6 +10,7 @@ class OperationBulkEditParams(TypedDict, total=False): zone_id: Required[str] + """Identifier""" body: Required[Dict[str, Body]] diff --git a/src/cloudflare/types/api_gateway/discovery/operation_edit_params.py b/src/cloudflare/types/api_gateway/discovery/operation_edit_params.py index 927ff5cf55b..903d84d39fc 100644 --- a/src/cloudflare/types/api_gateway/discovery/operation_edit_params.py +++ b/src/cloudflare/types/api_gateway/discovery/operation_edit_params.py @@ -9,6 +9,7 @@ class OperationEditParams(TypedDict, total=False): zone_id: Required[str] + """Identifier""" state: Literal["review", "ignored"] """Mark state of operation in API Discovery diff --git a/src/cloudflare/types/api_gateway/discovery/operation_list_params.py b/src/cloudflare/types/api_gateway/discovery/operation_list_params.py index 3ee3223ce89..0b33645439c 100644 --- a/src/cloudflare/types/api_gateway/discovery/operation_list_params.py +++ b/src/cloudflare/types/api_gateway/discovery/operation_list_params.py @@ -10,6 +10,7 @@ class OperationListParams(TypedDict, total=False): zone_id: Required[str] + """Identifier""" diff: bool """ diff --git a/src/cloudflare/types/api_gateway/discovery_get_response.py b/src/cloudflare/types/api_gateway/discovery_get_response.py index 1e4631b8d42..bcc99ffc364 100644 --- a/src/cloudflare/types/api_gateway/discovery_get_response.py +++ b/src/cloudflare/types/api_gateway/discovery_get_response.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime from ..._models import BaseModel @@ -10,4 +11,4 @@ class DiscoveryGetResponse(BaseModel): schemas: List[object] - timestamp: str + timestamp: datetime diff --git a/src/cloudflare/types/api_gateway/discovery_operation.py b/src/cloudflare/types/api_gateway/discovery_operation.py index bcdecd31885..8c3fe0a8617 100644 --- a/src/cloudflare/types/api_gateway/discovery_operation.py +++ b/src/cloudflare/types/api_gateway/discovery_operation.py @@ -25,6 +25,7 @@ class Features(BaseModel): class DiscoveryOperation(BaseModel): id: str + """UUID""" endpoint: str """ @@ -37,7 +38,7 @@ class DiscoveryOperation(BaseModel): host: str """RFC3986-compliant host.""" - last_updated: str + last_updated: datetime method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"] """The HTTP method used to access the endpoint.""" diff --git a/src/cloudflare/types/api_gateway/expression_template/fallthrough_create_params.py b/src/cloudflare/types/api_gateway/expression_template/fallthrough_create_params.py index c73917263ab..1aa894b2732 100644 --- a/src/cloudflare/types/api_gateway/expression_template/fallthrough_create_params.py +++ b/src/cloudflare/types/api_gateway/expression_template/fallthrough_create_params.py @@ -10,6 +10,7 @@ class FallthroughCreateParams(TypedDict, total=False): zone_id: Required[str] + """Identifier""" hosts: Required[List[str]] """List of hosts to be targeted in the expression""" diff --git a/src/cloudflare/types/api_gateway/operation_bulk_create_params.py b/src/cloudflare/types/api_gateway/operation_bulk_create_params.py index c71aed46f78..8672ae972e9 100644 --- a/src/cloudflare/types/api_gateway/operation_bulk_create_params.py +++ b/src/cloudflare/types/api_gateway/operation_bulk_create_params.py @@ -10,6 +10,7 @@ class OperationBulkCreateParams(TypedDict, total=False): zone_id: Required[str] + """Identifier""" body: Required[Iterable[Body]] diff --git a/src/cloudflare/types/api_gateway/operation_bulk_create_response.py b/src/cloudflare/types/api_gateway/operation_bulk_create_response.py index f96321499aa..9079c8b44c1 100644 --- a/src/cloudflare/types/api_gateway/operation_bulk_create_response.py +++ b/src/cloudflare/types/api_gateway/operation_bulk_create_response.py @@ -169,6 +169,7 @@ class FeaturesAPIShieldOperationFeatureConfidenceIntervals(BaseModel): class FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema(BaseModel): id: Optional[str] = None + """UUID""" created_at: Optional[datetime] = None @@ -215,11 +216,12 @@ class OperationBulkCreateResponse(BaseModel): host: str """RFC3986-compliant host.""" - last_updated: str + last_updated: datetime method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"] """The HTTP method used to access the endpoint.""" operation_id: str + """UUID""" features: Optional[Features] = None diff --git a/src/cloudflare/types/api_gateway/operation_create_params.py b/src/cloudflare/types/api_gateway/operation_create_params.py index 1e4f3213caf..4563a0f9afb 100644 --- a/src/cloudflare/types/api_gateway/operation_create_params.py +++ b/src/cloudflare/types/api_gateway/operation_create_params.py @@ -9,6 +9,7 @@ class OperationCreateParams(TypedDict, total=False): zone_id: Required[str] + """Identifier""" endpoint: Required[str] """ diff --git a/src/cloudflare/types/api_gateway/operation_create_response.py b/src/cloudflare/types/api_gateway/operation_create_response.py index 7ea3979e360..a9b73ff2a91 100644 --- a/src/cloudflare/types/api_gateway/operation_create_response.py +++ b/src/cloudflare/types/api_gateway/operation_create_response.py @@ -169,6 +169,7 @@ class FeaturesAPIShieldOperationFeatureConfidenceIntervals(BaseModel): class FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema(BaseModel): id: Optional[str] = None + """UUID""" created_at: Optional[datetime] = None @@ -215,11 +216,12 @@ class OperationCreateResponse(BaseModel): host: str """RFC3986-compliant host.""" - last_updated: str + last_updated: datetime method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"] """The HTTP method used to access the endpoint.""" operation_id: str + """UUID""" features: Optional[Features] = None diff --git a/src/cloudflare/types/api_gateway/operation_get_params.py b/src/cloudflare/types/api_gateway/operation_get_params.py index b17355a71a7..e752e501aae 100644 --- a/src/cloudflare/types/api_gateway/operation_get_params.py +++ b/src/cloudflare/types/api_gateway/operation_get_params.py @@ -10,6 +10,7 @@ class OperationGetParams(TypedDict, total=False): zone_id: Required[str] + """Identifier""" feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] """Add feature(s) to the results. diff --git a/src/cloudflare/types/api_gateway/operation_get_response.py b/src/cloudflare/types/api_gateway/operation_get_response.py index 3dd091fde3b..36585cba248 100644 --- a/src/cloudflare/types/api_gateway/operation_get_response.py +++ b/src/cloudflare/types/api_gateway/operation_get_response.py @@ -169,6 +169,7 @@ class FeaturesAPIShieldOperationFeatureConfidenceIntervals(BaseModel): class FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema(BaseModel): id: Optional[str] = None + """UUID""" created_at: Optional[datetime] = None @@ -215,11 +216,12 @@ class OperationGetResponse(BaseModel): host: str """RFC3986-compliant host.""" - last_updated: str + last_updated: datetime method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"] """The HTTP method used to access the endpoint.""" operation_id: str + """UUID""" features: Optional[Features] = None diff --git a/src/cloudflare/types/api_gateway/operation_list_params.py b/src/cloudflare/types/api_gateway/operation_list_params.py index 14790c16a4e..1244f5a078f 100644 --- a/src/cloudflare/types/api_gateway/operation_list_params.py +++ b/src/cloudflare/types/api_gateway/operation_list_params.py @@ -10,6 +10,7 @@ class OperationListParams(TypedDict, total=False): zone_id: Required[str] + """Identifier""" direction: Literal["asc", "desc"] """Direction to order results.""" diff --git a/src/cloudflare/types/api_gateway/operation_list_response.py b/src/cloudflare/types/api_gateway/operation_list_response.py index a2cefe6b3f7..de42fa68ed0 100644 --- a/src/cloudflare/types/api_gateway/operation_list_response.py +++ b/src/cloudflare/types/api_gateway/operation_list_response.py @@ -169,6 +169,7 @@ class FeaturesAPIShieldOperationFeatureConfidenceIntervals(BaseModel): class FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema(BaseModel): id: Optional[str] = None + """UUID""" created_at: Optional[datetime] = None @@ -215,11 +216,12 @@ class OperationListResponse(BaseModel): host: str """RFC3986-compliant host.""" - last_updated: str + last_updated: datetime method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"] """The HTTP method used to access the endpoint.""" operation_id: str + """UUID""" features: Optional[Features] = None diff --git a/src/cloudflare/types/api_gateway/operations/schema_validation_edit_params.py b/src/cloudflare/types/api_gateway/operations/schema_validation_edit_params.py index b4be0c37076..45926402aa5 100644 --- a/src/cloudflare/types/api_gateway/operations/schema_validation_edit_params.py +++ b/src/cloudflare/types/api_gateway/operations/schema_validation_edit_params.py @@ -11,5 +11,6 @@ class SchemaValidationEditParams(TypedDict, total=False): zone_id: Required[str] + """Identifier""" settings_multiple_request: Required[SettingsMultipleRequestParam] diff --git a/src/cloudflare/types/api_gateway/operations/schema_validation_update_params.py b/src/cloudflare/types/api_gateway/operations/schema_validation_update_params.py index eeaee4a2475..e9975b01cda 100644 --- a/src/cloudflare/types/api_gateway/operations/schema_validation_update_params.py +++ b/src/cloudflare/types/api_gateway/operations/schema_validation_update_params.py @@ -10,6 +10,7 @@ class SchemaValidationUpdateParams(TypedDict, total=False): zone_id: Required[str] + """Identifier""" mitigation_action: Optional[Literal["log", "block", "none"]] """When set, this applies a mitigation action to this operation diff --git a/src/cloudflare/types/api_gateway/public_schema.py b/src/cloudflare/types/api_gateway/public_schema.py index c5f922322f2..bdff5f529aa 100644 --- a/src/cloudflare/types/api_gateway/public_schema.py +++ b/src/cloudflare/types/api_gateway/public_schema.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional +from datetime import datetime from typing_extensions import Literal from ..._models import BaseModel @@ -9,7 +10,7 @@ class PublicSchema(BaseModel): - created_at: str + created_at: datetime kind: Literal["openapi_v3"] """Kind of schema""" @@ -18,6 +19,7 @@ class PublicSchema(BaseModel): """Name of the schema""" schema_id: str + """UUID""" source: Optional[str] = None """Source of the schema""" diff --git a/src/cloudflare/types/api_gateway/schema_list_params.py b/src/cloudflare/types/api_gateway/schema_list_params.py index 7447b92f52a..7bc4f9ac025 100644 --- a/src/cloudflare/types/api_gateway/schema_list_params.py +++ b/src/cloudflare/types/api_gateway/schema_list_params.py @@ -10,6 +10,7 @@ class SchemaListParams(TypedDict, total=False): zone_id: Required[str] + """Identifier""" feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] """Add feature(s) to the results. diff --git a/src/cloudflare/types/api_gateway/settings/schema_validation_edit_params.py b/src/cloudflare/types/api_gateway/settings/schema_validation_edit_params.py index f57646e5d13..424471b1283 100644 --- a/src/cloudflare/types/api_gateway/settings/schema_validation_edit_params.py +++ b/src/cloudflare/types/api_gateway/settings/schema_validation_edit_params.py @@ -10,6 +10,7 @@ class SchemaValidationEditParams(TypedDict, total=False): zone_id: Required[str] + """Identifier""" validation_default_mitigation_action: Optional[Literal["none", "log", "block"]] """ diff --git a/src/cloudflare/types/api_gateway/settings/schema_validation_update_params.py b/src/cloudflare/types/api_gateway/settings/schema_validation_update_params.py index 231c72423d5..e7ffb4e6bdd 100644 --- a/src/cloudflare/types/api_gateway/settings/schema_validation_update_params.py +++ b/src/cloudflare/types/api_gateway/settings/schema_validation_update_params.py @@ -10,6 +10,7 @@ class SchemaValidationUpdateParams(TypedDict, total=False): zone_id: Required[str] + """Identifier""" validation_default_mitigation_action: Required[Literal["none", "log", "block"]] """ diff --git a/src/cloudflare/types/api_gateway/user_schema_create_params.py b/src/cloudflare/types/api_gateway/user_schema_create_params.py index e405c31ee6f..10d9593240a 100644 --- a/src/cloudflare/types/api_gateway/user_schema_create_params.py +++ b/src/cloudflare/types/api_gateway/user_schema_create_params.py @@ -11,6 +11,7 @@ class UserSchemaCreateParams(TypedDict, total=False): zone_id: Required[str] + """Identifier""" file: Required[FileTypes] """Schema file bytes""" diff --git a/src/cloudflare/types/api_gateway/user_schema_edit_params.py b/src/cloudflare/types/api_gateway/user_schema_edit_params.py index 9d992d083c7..99e15349c77 100644 --- a/src/cloudflare/types/api_gateway/user_schema_edit_params.py +++ b/src/cloudflare/types/api_gateway/user_schema_edit_params.py @@ -9,6 +9,7 @@ class UserSchemaEditParams(TypedDict, total=False): zone_id: Required[str] + """Identifier""" validation_enabled: Literal[True] """Flag whether schema is enabled for validation.""" diff --git a/src/cloudflare/types/api_gateway/user_schema_get_params.py b/src/cloudflare/types/api_gateway/user_schema_get_params.py index 986685f5007..dbaee3dee47 100644 --- a/src/cloudflare/types/api_gateway/user_schema_get_params.py +++ b/src/cloudflare/types/api_gateway/user_schema_get_params.py @@ -9,6 +9,7 @@ class UserSchemaGetParams(TypedDict, total=False): zone_id: Required[str] + """Identifier""" omit_source: bool """Omit the source-files of schemas and only retrieve their meta-data.""" diff --git a/src/cloudflare/types/api_gateway/user_schema_list_params.py b/src/cloudflare/types/api_gateway/user_schema_list_params.py index 5e5d24554f6..faca68fa945 100644 --- a/src/cloudflare/types/api_gateway/user_schema_list_params.py +++ b/src/cloudflare/types/api_gateway/user_schema_list_params.py @@ -9,6 +9,7 @@ class UserSchemaListParams(TypedDict, total=False): zone_id: Required[str] + """Identifier""" omit_source: bool """Omit the source-files of schemas and only retrieve their meta-data.""" diff --git a/src/cloudflare/types/api_gateway/user_schemas/host_list_params.py b/src/cloudflare/types/api_gateway/user_schemas/host_list_params.py index 4e40214d29b..cc0aed8db98 100644 --- a/src/cloudflare/types/api_gateway/user_schemas/host_list_params.py +++ b/src/cloudflare/types/api_gateway/user_schemas/host_list_params.py @@ -9,6 +9,7 @@ class HostListParams(TypedDict, total=False): zone_id: Required[str] + """Identifier""" page: int """Page number of paginated results.""" diff --git a/src/cloudflare/types/api_gateway/user_schemas/host_list_response.py b/src/cloudflare/types/api_gateway/user_schemas/host_list_response.py index b5e6a568dc3..a56dd1037f5 100644 --- a/src/cloudflare/types/api_gateway/user_schemas/host_list_response.py +++ b/src/cloudflare/types/api_gateway/user_schemas/host_list_response.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List +from datetime import datetime from ...._models import BaseModel @@ -8,7 +9,7 @@ class HostListResponse(BaseModel): - created_at: str + created_at: datetime hosts: List[str] """Hosts serving the schema, e.g zone.host.com""" @@ -17,3 +18,4 @@ class HostListResponse(BaseModel): """Name of the schema""" schema_id: str + """UUID""" diff --git a/src/cloudflare/types/api_gateway/user_schemas/operation_list_params.py b/src/cloudflare/types/api_gateway/user_schemas/operation_list_params.py index 4a8add15055..64cb5bdccae 100644 --- a/src/cloudflare/types/api_gateway/user_schemas/operation_list_params.py +++ b/src/cloudflare/types/api_gateway/user_schemas/operation_list_params.py @@ -10,6 +10,7 @@ class OperationListParams(TypedDict, total=False): zone_id: Required[str] + """Identifier""" endpoint: str """Filter results to only include endpoints containing this pattern.""" diff --git a/src/cloudflare/types/api_gateway/user_schemas/operation_list_response.py b/src/cloudflare/types/api_gateway/user_schemas/operation_list_response.py index f86acfafe8d..cae8a5a0a92 100644 --- a/src/cloudflare/types/api_gateway/user_schemas/operation_list_response.py +++ b/src/cloudflare/types/api_gateway/user_schemas/operation_list_response.py @@ -175,6 +175,7 @@ class APIShieldOperationFeaturesAPIShieldOperationFeatureConfidenceIntervals(Bas class APIShieldOperationFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema(BaseModel): id: Optional[str] = None + """UUID""" created_at: Optional[datetime] = None @@ -221,12 +222,13 @@ class APIShieldOperation(BaseModel): host: str """RFC3986-compliant host.""" - last_updated: str + last_updated: datetime method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"] """The HTTP method used to access the endpoint.""" operation_id: str + """UUID""" features: Optional[APIShieldOperationFeatures] = None diff --git a/src/cloudflare/types/content_scanning/payload_create_response.py b/src/cloudflare/types/content_scanning/payload_create_response.py index 6071786c586..6cff7ddd70f 100644 --- a/src/cloudflare/types/content_scanning/payload_create_response.py +++ b/src/cloudflare/types/content_scanning/payload_create_response.py @@ -8,7 +8,7 @@ class PayloadCreateResponse(BaseModel): - id: Optional[object] = None + id: Optional[str] = None """The unique ID for this custom scan expression""" payload: Optional[str] = None diff --git a/src/cloudflare/types/content_scanning/payload_delete_response.py b/src/cloudflare/types/content_scanning/payload_delete_response.py index e8862426857..3025a37b0ca 100644 --- a/src/cloudflare/types/content_scanning/payload_delete_response.py +++ b/src/cloudflare/types/content_scanning/payload_delete_response.py @@ -8,7 +8,7 @@ class PayloadDeleteResponse(BaseModel): - id: Optional[object] = None + id: Optional[str] = None """The unique ID for this custom scan expression""" payload: Optional[str] = None diff --git a/src/cloudflare/types/content_scanning/payload_list_response.py b/src/cloudflare/types/content_scanning/payload_list_response.py index 7461ad385d9..2ed0a8d1cf3 100644 --- a/src/cloudflare/types/content_scanning/payload_list_response.py +++ b/src/cloudflare/types/content_scanning/payload_list_response.py @@ -8,7 +8,7 @@ class PayloadListResponse(BaseModel): - id: Optional[object] = None + id: Optional[str] = None """The unique ID for this custom scan expression""" payload: Optional[str] = None diff --git a/src/cloudflare/types/custom_certificates/custom_certificate.py b/src/cloudflare/types/custom_certificates/custom_certificate.py index 1588bf81d02..b5579f8a95f 100644 --- a/src/cloudflare/types/custom_certificates/custom_certificate.py +++ b/src/cloudflare/types/custom_certificates/custom_certificate.py @@ -7,6 +7,7 @@ from ..._models import BaseModel from .geo_restrictions import GeoRestrictions from ..custom_hostnames.bundle_method import BundleMethod +from ..keyless_certificates.keyless_certificate import KeylessCertificate __all__ = ["CustomCertificate"] @@ -65,7 +66,7 @@ class CustomCertificate(BaseModel): for optimal performance. """ - keyless_server: Optional[object] = None + keyless_server: Optional[KeylessCertificate] = None policy: Optional[str] = None """ diff --git a/src/cloudflare/types/dns/batch_patch_param.py b/src/cloudflare/types/dns/batch_patch_param.py index 0cfa5b0ca37..e3e0ae92005 100644 --- a/src/cloudflare/types/dns/batch_patch_param.py +++ b/src/cloudflare/types/dns/batch_patch_param.py @@ -2,11 +2,236 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing import List, Union +from typing_extensions import Literal, Required, TypeAlias, TypedDict -__all__ = ["BatchPatchParam"] +from .ttl_param import TTLParam +from .record_tags import RecordTags +from .a_record_param import ARecordParam +from .ds_record_param import DSRecordParam +from .mx_record_param import MXRecordParam +from .ns_record_param import NSRecordParam +from .caa_record_param import CAARecordParam +from .loc_record_param import LOCRecordParam +from .ptr_record_param import PTRRecordParam +from .srv_record_param import SRVRecordParam +from .txt_record_param import TXTRecordParam +from .uri_record_param import URIRecordParam +from .aaaa_record_param import AAAARecordParam +from .cert_record_param import CERTRecordParam +from .svcb_record_param import SVCBRecordParam +from .tlsa_record_param import TLSARecordParam +from .cname_record_param import CNAMERecordParam +from .https_record_param import HTTPSRecordParam +from .naptr_record_param import NAPTRRecordParam +from .sshfp_record_param import SSHFPRecordParam +from .dnskey_record_param import DNSKEYRecordParam +from .smimea_record_param import SMIMEARecordParam +__all__ = [ + "BatchPatchParam", + "ARecord", + "AAAARecord", + "CAARecord", + "CERTRecord", + "CNAMERecord", + "DNSKEYRecord", + "DSRecord", + "HTTPSRecord", + "LOCRecord", + "MXRecord", + "NAPTRRecord", + "NSRecord", + "Openpgpkey", + "OpenpgpkeySettings", + "PTRRecord", + "SMIMEARecord", + "SRVRecord", + "SSHFPRecord", + "SVCBRecord", + "TLSARecord", + "TXTRecord", + "URIRecord", +] -class BatchPatchParam(TypedDict, total=False): + +class ARecord(ARecordParam): + id: Required[str] + """Identifier""" + + +class AAAARecord(AAAARecordParam): + id: Required[str] + """Identifier""" + + +class CAARecord(CAARecordParam): + id: Required[str] + """Identifier""" + + +class CERTRecord(CERTRecordParam): + id: Required[str] + """Identifier""" + + +class CNAMERecord(CNAMERecordParam): + id: Required[str] + """Identifier""" + + +class DNSKEYRecord(DNSKEYRecordParam): + id: Required[str] + """Identifier""" + + +class DSRecord(DSRecordParam): + id: Required[str] + """Identifier""" + + +class HTTPSRecord(HTTPSRecordParam): + id: Required[str] + """Identifier""" + + +class LOCRecord(LOCRecordParam): + id: Required[str] + """Identifier""" + + +class MXRecord(MXRecordParam): + id: Required[str] + """Identifier""" + + +class NAPTRRecord(NAPTRRecordParam): + id: Required[str] + """Identifier""" + + +class NSRecord(NSRecordParam): + id: Required[str] + """Identifier""" + + +class OpenpgpkeySettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + +class Openpgpkey(TypedDict, total=False): + id: Required[str] + """Identifier""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + content: str + """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" + + name: str + """DNS record name (or @ for the zone apex) in Punycode.""" + + proxied: bool + """ + Whether the record is receiving the performance and security benefits of + Cloudflare. + """ + + settings: OpenpgpkeySettings + """Settings for the DNS record.""" + + tags: List[RecordTags] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: TTLParam + """Time To Live (TTL) of the DNS record in seconds. + + Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the + minimum reduced to 30 for Enterprise zones. + """ + + type: Literal["OPENPGPKEY"] + """Record type.""" + + +class PTRRecord(PTRRecordParam): + id: Required[str] + """Identifier""" + + +class SMIMEARecord(SMIMEARecordParam): + id: Required[str] + """Identifier""" + + +class SRVRecord(SRVRecordParam): + id: Required[str] + """Identifier""" + + +class SSHFPRecord(SSHFPRecordParam): + id: Required[str] + """Identifier""" + + +class SVCBRecord(SVCBRecordParam): + id: Required[str] + """Identifier""" + + +class TLSARecord(TLSARecordParam): + id: Required[str] + """Identifier""" + + +class TXTRecord(TXTRecordParam): id: Required[str] """Identifier""" + + +class URIRecord(URIRecordParam): + id: Required[str] + """Identifier""" + + +BatchPatchParam: TypeAlias = Union[ + ARecord, + AAAARecord, + CAARecord, + CERTRecord, + CNAMERecord, + DNSKEYRecord, + DSRecord, + HTTPSRecord, + LOCRecord, + MXRecord, + NAPTRRecord, + NSRecord, + Openpgpkey, + PTRRecord, + SMIMEARecord, + SRVRecord, + SSHFPRecord, + SVCBRecord, + TLSARecord, + TXTRecord, + URIRecord, +] diff --git a/src/cloudflare/types/dns/batch_put_param.py b/src/cloudflare/types/dns/batch_put_param.py index 569562cf422..d21c25d5b4c 100644 --- a/src/cloudflare/types/dns/batch_put_param.py +++ b/src/cloudflare/types/dns/batch_put_param.py @@ -2,11 +2,236 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing import List, Union +from typing_extensions import Literal, Required, TypeAlias, TypedDict -__all__ = ["BatchPutParam"] +from .ttl_param import TTLParam +from .record_tags import RecordTags +from .a_record_param import ARecordParam +from .ds_record_param import DSRecordParam +from .mx_record_param import MXRecordParam +from .ns_record_param import NSRecordParam +from .caa_record_param import CAARecordParam +from .loc_record_param import LOCRecordParam +from .ptr_record_param import PTRRecordParam +from .srv_record_param import SRVRecordParam +from .txt_record_param import TXTRecordParam +from .uri_record_param import URIRecordParam +from .aaaa_record_param import AAAARecordParam +from .cert_record_param import CERTRecordParam +from .svcb_record_param import SVCBRecordParam +from .tlsa_record_param import TLSARecordParam +from .cname_record_param import CNAMERecordParam +from .https_record_param import HTTPSRecordParam +from .naptr_record_param import NAPTRRecordParam +from .sshfp_record_param import SSHFPRecordParam +from .dnskey_record_param import DNSKEYRecordParam +from .smimea_record_param import SMIMEARecordParam +__all__ = [ + "BatchPutParam", + "ARecord", + "AAAARecord", + "CAARecord", + "CERTRecord", + "CNAMERecord", + "DNSKEYRecord", + "DSRecord", + "HTTPSRecord", + "LOCRecord", + "MXRecord", + "NAPTRRecord", + "NSRecord", + "Openpgpkey", + "OpenpgpkeySettings", + "PTRRecord", + "SMIMEARecord", + "SRVRecord", + "SSHFPRecord", + "SVCBRecord", + "TLSARecord", + "TXTRecord", + "URIRecord", +] -class BatchPutParam(TypedDict, total=False): + +class ARecord(ARecordParam): + id: str + """Identifier""" + + +class AAAARecord(AAAARecordParam): + id: str + """Identifier""" + + +class CAARecord(CAARecordParam): + id: str + """Identifier""" + + +class CERTRecord(CERTRecordParam): + id: str + """Identifier""" + + +class CNAMERecord(CNAMERecordParam): + id: str + """Identifier""" + + +class DNSKEYRecord(DNSKEYRecordParam): + id: str + """Identifier""" + + +class DSRecord(DSRecordParam): + id: str + """Identifier""" + + +class HTTPSRecord(HTTPSRecordParam): + id: str + """Identifier""" + + +class LOCRecord(LOCRecordParam): + id: str + """Identifier""" + + +class MXRecord(MXRecordParam): + id: str + """Identifier""" + + +class NAPTRRecord(NAPTRRecordParam): + id: str + """Identifier""" + + +class NSRecord(NSRecordParam): + id: str + """Identifier""" + + +class OpenpgpkeySettings(TypedDict, total=False): + ipv4_only: bool + """ + When enabled, only A records will be generated, and AAAA records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + ipv6_only: bool + """ + When enabled, only AAAA records will be generated, and A records will not be + created. This setting is intended for exceptional cases. Note that this option + only applies to proxied records and it has no effect on whether Cloudflare + communicates with the origin using IPv4 or IPv6. + """ + + +class Openpgpkey(TypedDict, total=False): + content: Required[str] + """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["OPENPGPKEY"]] + """Record type.""" + + id: str + """Identifier""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + proxied: bool + """ + Whether the record is receiving the performance and security benefits of + Cloudflare. + """ + + settings: OpenpgpkeySettings + """Settings for the DNS record.""" + + tags: List[RecordTags] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: TTLParam + """Time To Live (TTL) of the DNS record in seconds. + + Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the + minimum reduced to 30 for Enterprise zones. + """ + + +class PTRRecord(PTRRecordParam): + id: str + """Identifier""" + + +class SMIMEARecord(SMIMEARecordParam): + id: str + """Identifier""" + + +class SRVRecord(SRVRecordParam): + id: str + """Identifier""" + + +class SSHFPRecord(SSHFPRecordParam): + id: str + """Identifier""" + + +class SVCBRecord(SVCBRecordParam): + id: str + """Identifier""" + + +class TLSARecord(TLSARecordParam): + id: str + """Identifier""" + + +class TXTRecord(TXTRecordParam): id: str """Identifier""" + + +class URIRecord(URIRecordParam): + id: str + """Identifier""" + + +BatchPutParam: TypeAlias = Union[ + ARecord, + AAAARecord, + CAARecord, + CERTRecord, + CNAMERecord, + DNSKEYRecord, + DSRecord, + HTTPSRecord, + LOCRecord, + MXRecord, + NAPTRRecord, + NSRecord, + Openpgpkey, + PTRRecord, + SMIMEARecord, + SRVRecord, + SSHFPRecord, + SVCBRecord, + TLSARecord, + TXTRecord, + URIRecord, +] diff --git a/src/cloudflare/types/dns/record_batch_params.py b/src/cloudflare/types/dns/record_batch_params.py index 2cf352b1a3b..cb31cfdef94 100644 --- a/src/cloudflare/types/dns/record_batch_params.py +++ b/src/cloudflare/types/dns/record_batch_params.py @@ -5,6 +5,7 @@ from typing import Iterable from typing_extensions import Required, TypedDict +from .record_param import RecordParam from .batch_put_param import BatchPutParam from .batch_patch_param import BatchPatchParam @@ -19,7 +20,7 @@ class RecordBatchParams(TypedDict, total=False): patches: Iterable[BatchPatchParam] - posts: Iterable[object] + posts: Iterable[RecordParam] puts: Iterable[BatchPutParam] diff --git a/src/cloudflare/types/dns/settings/view_create_params.py b/src/cloudflare/types/dns/settings/view_create_params.py index 4bf2b58d049..cd8bc0500c0 100644 --- a/src/cloudflare/types/dns/settings/view_create_params.py +++ b/src/cloudflare/types/dns/settings/view_create_params.py @@ -12,8 +12,8 @@ class ViewCreateParams(TypedDict, total=False): account_id: Required[str] """Identifier""" - name: str + name: Required[str] """The name of the view.""" - zones: List[str] + zones: Required[List[str]] """The list of zones linked to this view.""" diff --git a/src/cloudflare/types/dns_firewall/dns_firewall_create_params.py b/src/cloudflare/types/dns_firewall/dns_firewall_create_params.py index 4ce7d450a69..8a8c22bfc46 100644 --- a/src/cloudflare/types/dns_firewall/dns_firewall_create_params.py +++ b/src/cloudflare/types/dns_firewall/dns_firewall_create_params.py @@ -15,6 +15,11 @@ class DNSFirewallCreateParams(TypedDict, total=False): account_id: Required[str] """Identifier""" + name: Required[str] + """DNS Firewall cluster name""" + + upstream_ips: Required[List[UpstreamIPs]] + attack_mitigation: Optional[AttackMitigationParam] """Attack mitigation settings""" @@ -38,9 +43,6 @@ class DNSFirewallCreateParams(TypedDict, total=False): increased to the minimum defined here for caching purposes. """ - name: str - """DNS Firewall cluster name""" - negative_cache_ttl: Optional[float] """ Negative DNS cache TTL This setting controls how long DNS Firewall should cache @@ -58,5 +60,3 @@ class DNSFirewallCreateParams(TypedDict, total=False): Number of retries for fetching DNS responses from upstream nameservers (not counting the initial attempt) """ - - upstream_ips: List[UpstreamIPs] diff --git a/src/cloudflare/types/dns_firewall/reverse_dns_edit_response.py b/src/cloudflare/types/dns_firewall/reverse_dns_edit_response.py index 089fc523ef0..2d62ac9f0dd 100644 --- a/src/cloudflare/types/dns_firewall/reverse_dns_edit_response.py +++ b/src/cloudflare/types/dns_firewall/reverse_dns_edit_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, Optional +from typing import Dict from ..._models import BaseModel @@ -8,5 +8,5 @@ class ReverseDNSEditResponse(BaseModel): - ptr: Optional[Dict[str, str]] = None + ptr: Dict[str, str] """Map of cluster IP addresses to PTR record contents""" diff --git a/src/cloudflare/types/dns_firewall/reverse_dns_get_response.py b/src/cloudflare/types/dns_firewall/reverse_dns_get_response.py index cd35a30bf00..21478156b97 100644 --- a/src/cloudflare/types/dns_firewall/reverse_dns_get_response.py +++ b/src/cloudflare/types/dns_firewall/reverse_dns_get_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, Optional +from typing import Dict from ..._models import BaseModel @@ -8,5 +8,5 @@ class ReverseDNSGetResponse(BaseModel): - ptr: Optional[Dict[str, str]] = None + ptr: Dict[str, str] """Map of cluster IP addresses to PTR record contents""" diff --git a/src/cloudflare/types/email_routing/__init__.py b/src/cloudflare/types/email_routing/__init__.py index f7faf7406b5..553bab1e508 100644 --- a/src/cloudflare/types/email_routing/__init__.py +++ b/src/cloudflare/types/email_routing/__init__.py @@ -5,6 +5,7 @@ from .action import Action as Action from .address import Address as Address from .matcher import Matcher as Matcher +from .settings import Settings as Settings from .dns_record import DNSRecord as DNSRecord from .action_param import ActionParam as ActionParam from .matcher_param import MatcherParam as MatcherParam diff --git a/src/cloudflare/types/email_routing/settings.py b/src/cloudflare/types/email_routing/settings.py new file mode 100644 index 00000000000..9688cfbe2d1 --- /dev/null +++ b/src/cloudflare/types/email_routing/settings.py @@ -0,0 +1,38 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["Settings"] + + +class Settings(BaseModel): + id: str + """Email Routing settings identifier.""" + + enabled: Literal[True, False] + """State of the zone settings for Email Routing.""" + + name: str + """Domain of your zone.""" + + created: Optional[datetime] = None + """The date and time the settings have been created.""" + + modified: Optional[datetime] = None + """The date and time the settings have been modified.""" + + skip_wizard: Optional[Literal[True, False]] = None + """Flag to check if the user skipped the configuration wizard.""" + + status: Optional[Literal["ready", "unconfigured", "misconfigured", "misconfigured/locked", "unlocked"]] = None + """Show the state of your account, and the type or configuration error.""" + + tag: Optional[str] = None + """Email Routing settings tag. + + (Deprecated, replaced by Email Routing settings identifier) + """ diff --git a/src/cloudflare/types/firewall/__init__.py b/src/cloudflare/types/firewall/__init__.py index 8ba37c3d7d9..63d1a171785 100644 --- a/src/cloudflare/types/firewall/__init__.py +++ b/src/cloudflare/types/firewall/__init__.py @@ -21,6 +21,7 @@ from .country_configuration import CountryConfiguration as CountryConfiguration from .rule_bulk_edit_params import RuleBulkEditParams as RuleBulkEditParams from .ua_rule_create_params import UARuleCreateParams as UARuleCreateParams +from .ua_rule_list_response import UARuleListResponse as UARuleListResponse from .ua_rule_update_params import UARuleUpdateParams as UARuleUpdateParams from .lockdown_create_params import LockdownCreateParams as LockdownCreateParams from .lockdown_update_params import LockdownUpdateParams as LockdownUpdateParams diff --git a/src/cloudflare/types/firewall/ua_rule_list_response.py b/src/cloudflare/types/firewall/ua_rule_list_response.py new file mode 100644 index 00000000000..d3426a93fc3 --- /dev/null +++ b/src/cloudflare/types/firewall/ua_rule_list_response.py @@ -0,0 +1,39 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["UARuleListResponse", "Configuration"] + + +class Configuration(BaseModel): + target: Optional[str] = None + """The configuration target for this rule. + + You must set the target to `ua` for User Agent Blocking rules. + """ + + value: Optional[str] = None + """The exact user agent string to match. + + This value will be compared to the received `User-Agent` HTTP header value. + """ + + +class UARuleListResponse(BaseModel): + id: Optional[str] = None + """The unique identifier of the User Agent Blocking rule.""" + + configuration: Optional[Configuration] = None + """The configuration object for the current rule.""" + + description: Optional[str] = None + """An informative summary of the rule.""" + + mode: Optional[Literal["block", "challenge", "js_challenge", "managed_challenge"]] = None + """The action to apply to a matched request.""" + + paused: Optional[bool] = None + """When true, indicates that the rule is currently paused.""" diff --git a/src/cloudflare/types/hyperdrive/config_create_params.py b/src/cloudflare/types/hyperdrive/config_create_params.py index 07584b855a0..479ceac25c3 100644 --- a/src/cloudflare/types/hyperdrive/config_create_params.py +++ b/src/cloudflare/types/hyperdrive/config_create_params.py @@ -11,6 +11,7 @@ "OriginPublicDatabase", "OriginAccessProtectedDatabaseBehindCloudflareTunnel", "Caching", + "CachingHyperdriveHyperdriveCachingCommon", "CachingHyperdriveHyperdriveCachingEnabled", ] @@ -83,6 +84,11 @@ class OriginAccessProtectedDatabaseBehindCloudflareTunnel(TypedDict, total=False Origin: TypeAlias = Union[OriginPublicDatabase, OriginAccessProtectedDatabaseBehindCloudflareTunnel] +class CachingHyperdriveHyperdriveCachingCommon(TypedDict, total=False): + disabled: bool + """When set to true, disables the caching of SQL responses. (Default: false)""" + + class CachingHyperdriveHyperdriveCachingEnabled(TypedDict, total=False): disabled: bool """When set to true, disables the caching of SQL responses. (Default: false)""" @@ -101,4 +107,4 @@ class CachingHyperdriveHyperdriveCachingEnabled(TypedDict, total=False): """ -Caching: TypeAlias = Union[CachingHyperdriveHyperdriveCachingEnabled, object] +Caching: TypeAlias = Union[CachingHyperdriveHyperdriveCachingCommon, CachingHyperdriveHyperdriveCachingEnabled] diff --git a/src/cloudflare/types/hyperdrive/config_edit_params.py b/src/cloudflare/types/hyperdrive/config_edit_params.py index 031a114e30a..a84932552af 100644 --- a/src/cloudflare/types/hyperdrive/config_edit_params.py +++ b/src/cloudflare/types/hyperdrive/config_edit_params.py @@ -8,6 +8,7 @@ __all__ = [ "ConfigEditParams", "Caching", + "CachingHyperdriveHyperdriveCachingCommon", "CachingHyperdriveHyperdriveCachingEnabled", "Origin", "OriginHyperdriveHyperdriveDatabase", @@ -27,6 +28,11 @@ class ConfigEditParams(TypedDict, total=False): origin: Origin +class CachingHyperdriveHyperdriveCachingCommon(TypedDict, total=False): + disabled: bool + """When set to true, disables the caching of SQL responses. (Default: false)""" + + class CachingHyperdriveHyperdriveCachingEnabled(TypedDict, total=False): disabled: bool """When set to true, disables the caching of SQL responses. (Default: false)""" @@ -45,7 +51,7 @@ class CachingHyperdriveHyperdriveCachingEnabled(TypedDict, total=False): """ -Caching: TypeAlias = Union[CachingHyperdriveHyperdriveCachingEnabled, object] +Caching: TypeAlias = Union[CachingHyperdriveHyperdriveCachingCommon, CachingHyperdriveHyperdriveCachingEnabled] class OriginHyperdriveHyperdriveDatabase(TypedDict, total=False): diff --git a/src/cloudflare/types/hyperdrive/config_update_params.py b/src/cloudflare/types/hyperdrive/config_update_params.py index 6301b86feba..e5677f427fe 100644 --- a/src/cloudflare/types/hyperdrive/config_update_params.py +++ b/src/cloudflare/types/hyperdrive/config_update_params.py @@ -11,6 +11,7 @@ "OriginPublicDatabase", "OriginAccessProtectedDatabaseBehindCloudflareTunnel", "Caching", + "CachingHyperdriveHyperdriveCachingCommon", "CachingHyperdriveHyperdriveCachingEnabled", ] @@ -83,6 +84,11 @@ class OriginAccessProtectedDatabaseBehindCloudflareTunnel(TypedDict, total=False Origin: TypeAlias = Union[OriginPublicDatabase, OriginAccessProtectedDatabaseBehindCloudflareTunnel] +class CachingHyperdriveHyperdriveCachingCommon(TypedDict, total=False): + disabled: bool + """When set to true, disables the caching of SQL responses. (Default: false)""" + + class CachingHyperdriveHyperdriveCachingEnabled(TypedDict, total=False): disabled: bool """When set to true, disables the caching of SQL responses. (Default: false)""" @@ -101,4 +107,4 @@ class CachingHyperdriveHyperdriveCachingEnabled(TypedDict, total=False): """ -Caching: TypeAlias = Union[CachingHyperdriveHyperdriveCachingEnabled, object] +Caching: TypeAlias = Union[CachingHyperdriveHyperdriveCachingCommon, CachingHyperdriveHyperdriveCachingEnabled] diff --git a/src/cloudflare/types/hyperdrive/hyperdrive.py b/src/cloudflare/types/hyperdrive/hyperdrive.py index 3795f53cdda..7e86822c1ee 100644 --- a/src/cloudflare/types/hyperdrive/hyperdrive.py +++ b/src/cloudflare/types/hyperdrive/hyperdrive.py @@ -11,6 +11,7 @@ "OriginPublicDatabase", "OriginAccessProtectedDatabaseBehindCloudflareTunnel", "Caching", + "CachingHyperdriveHyperdriveCachingCommon", "CachingHyperdriveHyperdriveCachingEnabled", ] @@ -54,6 +55,11 @@ class OriginAccessProtectedDatabaseBehindCloudflareTunnel(BaseModel): Origin: TypeAlias = Union[OriginPublicDatabase, OriginAccessProtectedDatabaseBehindCloudflareTunnel] +class CachingHyperdriveHyperdriveCachingCommon(BaseModel): + disabled: Optional[bool] = None + """When set to true, disables the caching of SQL responses. (Default: false)""" + + class CachingHyperdriveHyperdriveCachingEnabled(BaseModel): disabled: Optional[bool] = None """When set to true, disables the caching of SQL responses. (Default: false)""" @@ -72,7 +78,7 @@ class CachingHyperdriveHyperdriveCachingEnabled(BaseModel): """ -Caching: TypeAlias = Union[CachingHyperdriveHyperdriveCachingEnabled, object] +Caching: TypeAlias = Union[CachingHyperdriveHyperdriveCachingCommon, CachingHyperdriveHyperdriveCachingEnabled] class Hyperdrive(BaseModel): diff --git a/src/cloudflare/types/intel/domain.py b/src/cloudflare/types/intel/domain.py index 3e23c48daa8..cb2b105cacb 100644 --- a/src/cloudflare/types/intel/domain.py +++ b/src/cloudflare/types/intel/domain.py @@ -4,7 +4,16 @@ from ..._models import BaseModel -__all__ = ["Domain", "AdditionalInformation", "Application", "ContentCategory", "ResolvesToRef"] +__all__ = [ + "Domain", + "AdditionalInformation", + "Application", + "ContentCategory", + "InheritedContentCategory", + "InheritedRiskType", + "ResolvesToRef", + "RiskType", +] class AdditionalInformation(BaseModel): @@ -26,6 +35,22 @@ class ContentCategory(BaseModel): super_category_id: Optional[int] = None +class InheritedContentCategory(BaseModel): + id: Optional[int] = None + + name: Optional[str] = None + + super_category_id: Optional[int] = None + + +class InheritedRiskType(BaseModel): + id: Optional[int] = None + + name: Optional[str] = None + + super_category_id: Optional[int] = None + + class ResolvesToRef(BaseModel): id: Optional[str] = None """ @@ -37,6 +62,14 @@ class ResolvesToRef(BaseModel): """IP address or domain name.""" +class RiskType(BaseModel): + id: Optional[int] = None + + name: Optional[str] = None + + super_category_id: Optional[int] = None + + class Domain(BaseModel): additional_information: Optional[AdditionalInformation] = None """Additional information related to the host name.""" @@ -48,7 +81,7 @@ class Domain(BaseModel): domain: Optional[str] = None - inherited_content_categories: Optional[object] = None + inherited_content_categories: Optional[List[InheritedContentCategory]] = None inherited_from: Optional[str] = None """ @@ -56,7 +89,7 @@ class Domain(BaseModel): inherited, if applicable. """ - inherited_risk_types: Optional[object] = None + inherited_risk_types: Optional[List[InheritedRiskType]] = None popularity_rank: Optional[int] = None """ @@ -76,4 +109,4 @@ class Domain(BaseModel): risk). """ - risk_types: Optional[object] = None + risk_types: Optional[List[RiskType]] = None diff --git a/src/cloudflare/types/intel/domains/bulk_get_response.py b/src/cloudflare/types/intel/domains/bulk_get_response.py index 2f353b7a885..b9f7bf47c05 100644 --- a/src/cloudflare/types/intel/domains/bulk_get_response.py +++ b/src/cloudflare/types/intel/domains/bulk_get_response.py @@ -11,6 +11,9 @@ "BulkGetResponseItemAdditionalInformation", "BulkGetResponseItemApplication", "BulkGetResponseItemContentCategory", + "BulkGetResponseItemInheritedContentCategory", + "BulkGetResponseItemInheritedRiskType", + "BulkGetResponseItemRiskType", ] @@ -33,6 +36,30 @@ class BulkGetResponseItemContentCategory(BaseModel): super_category_id: Optional[int] = None +class BulkGetResponseItemInheritedContentCategory(BaseModel): + id: Optional[int] = None + + name: Optional[str] = None + + super_category_id: Optional[int] = None + + +class BulkGetResponseItemInheritedRiskType(BaseModel): + id: Optional[int] = None + + name: Optional[str] = None + + super_category_id: Optional[int] = None + + +class BulkGetResponseItemRiskType(BaseModel): + id: Optional[int] = None + + name: Optional[str] = None + + super_category_id: Optional[int] = None + + class BulkGetResponseItem(BaseModel): additional_information: Optional[BulkGetResponseItemAdditionalInformation] = None """Additional information related to the host name.""" @@ -44,7 +71,7 @@ class BulkGetResponseItem(BaseModel): domain: Optional[str] = None - inherited_content_categories: Optional[object] = None + inherited_content_categories: Optional[List[BulkGetResponseItemInheritedContentCategory]] = None inherited_from: Optional[str] = None """ @@ -52,7 +79,7 @@ class BulkGetResponseItem(BaseModel): inherited, if applicable. """ - inherited_risk_types: Optional[object] = None + inherited_risk_types: Optional[List[BulkGetResponseItemInheritedRiskType]] = None popularity_rank: Optional[int] = None """ @@ -66,7 +93,7 @@ class BulkGetResponseItem(BaseModel): risk). """ - risk_types: Optional[object] = None + risk_types: Optional[List[BulkGetResponseItemRiskType]] = None BulkGetResponse: TypeAlias = List[BulkGetResponseItem] diff --git a/src/cloudflare/types/leaked_credential_checks/detection_create_params.py b/src/cloudflare/types/leaked_credential_checks/detection_create_params.py index 22a5952359a..f7277cce6d9 100644 --- a/src/cloudflare/types/leaked_credential_checks/detection_create_params.py +++ b/src/cloudflare/types/leaked_credential_checks/detection_create_params.py @@ -11,9 +11,6 @@ class DetectionCreateParams(TypedDict, total=False): zone_id: Required[str] """Identifier""" - id: object - """The unique ID for this custom detection""" - password: str """The ruleset expression to use in matching the password in a request""" diff --git a/src/cloudflare/types/leaked_credential_checks/detection_create_response.py b/src/cloudflare/types/leaked_credential_checks/detection_create_response.py index e59fbd3083a..e8e7ea5cc6d 100644 --- a/src/cloudflare/types/leaked_credential_checks/detection_create_response.py +++ b/src/cloudflare/types/leaked_credential_checks/detection_create_response.py @@ -8,7 +8,7 @@ class DetectionCreateResponse(BaseModel): - id: Optional[object] = None + id: Optional[str] = None """The unique ID for this custom detection""" password: Optional[str] = None diff --git a/src/cloudflare/types/leaked_credential_checks/detection_list_response.py b/src/cloudflare/types/leaked_credential_checks/detection_list_response.py index 52d54c2394f..9423f3750aa 100644 --- a/src/cloudflare/types/leaked_credential_checks/detection_list_response.py +++ b/src/cloudflare/types/leaked_credential_checks/detection_list_response.py @@ -8,7 +8,7 @@ class DetectionListResponse(BaseModel): - id: Optional[object] = None + id: Optional[str] = None """The unique ID for this custom detection""" password: Optional[str] = None diff --git a/src/cloudflare/types/leaked_credential_checks/detection_update_params.py b/src/cloudflare/types/leaked_credential_checks/detection_update_params.py index 0eb60c62eaa..cbff67e0ab2 100644 --- a/src/cloudflare/types/leaked_credential_checks/detection_update_params.py +++ b/src/cloudflare/types/leaked_credential_checks/detection_update_params.py @@ -11,9 +11,6 @@ class DetectionUpdateParams(TypedDict, total=False): zone_id: Required[str] """Identifier""" - id: object - """The unique ID for this custom detection""" - password: str """The ruleset expression to use in matching the password in a request""" diff --git a/src/cloudflare/types/leaked_credential_checks/detection_update_response.py b/src/cloudflare/types/leaked_credential_checks/detection_update_response.py index fa8568955bb..da71290916a 100644 --- a/src/cloudflare/types/leaked_credential_checks/detection_update_response.py +++ b/src/cloudflare/types/leaked_credential_checks/detection_update_response.py @@ -8,7 +8,7 @@ class DetectionUpdateResponse(BaseModel): - id: Optional[object] = None + id: Optional[str] = None """The unique ID for this custom detection""" password: Optional[str] = None diff --git a/src/cloudflare/types/magic_transit/__init__.py b/src/cloudflare/types/magic_transit/__init__.py index 7504cc48f94..26a12934156 100644 --- a/src/cloudflare/types/magic_transit/__init__.py +++ b/src/cloudflare/types/magic_transit/__init__.py @@ -7,6 +7,7 @@ from .scope import Scope as Scope from .pcap_filter import PCAPFilter as PCAPFilter from .scope_param import ScopeParam as ScopeParam +from .health_check import HealthCheck as HealthCheck from .psk_metadata import PSKMetadata as PSKMetadata from .site_location import SiteLocation as SiteLocation from .site_edit_params import SiteEditParams as SiteEditParams diff --git a/src/cloudflare/types/magic_transit/cf_interconnect_bulk_update_response.py b/src/cloudflare/types/magic_transit/cf_interconnect_bulk_update_response.py index 38470793939..958181967d4 100644 --- a/src/cloudflare/types/magic_transit/cf_interconnect_bulk_update_response.py +++ b/src/cloudflare/types/magic_transit/cf_interconnect_bulk_update_response.py @@ -4,6 +4,7 @@ from datetime import datetime from ..._models import BaseModel +from .health_check import HealthCheck __all__ = ["CfInterconnectBulkUpdateResponse", "ModifiedInterconnect", "ModifiedInterconnectGRE"] @@ -32,7 +33,7 @@ class ModifiedInterconnect(BaseModel): gre: Optional[ModifiedInterconnectGRE] = None """The configuration specific to GRE interconnects.""" - health_check: Optional[object] = None + health_check: Optional[HealthCheck] = None interface_address: Optional[str] = None """ diff --git a/src/cloudflare/types/magic_transit/cf_interconnect_get_response.py b/src/cloudflare/types/magic_transit/cf_interconnect_get_response.py index d2063c1fceb..fb80d488f78 100644 --- a/src/cloudflare/types/magic_transit/cf_interconnect_get_response.py +++ b/src/cloudflare/types/magic_transit/cf_interconnect_get_response.py @@ -4,6 +4,7 @@ from datetime import datetime from ..._models import BaseModel +from .health_check import HealthCheck __all__ = ["CfInterconnectGetResponse", "Interconnect", "InterconnectGRE"] @@ -32,7 +33,7 @@ class Interconnect(BaseModel): gre: Optional[InterconnectGRE] = None """The configuration specific to GRE interconnects.""" - health_check: Optional[object] = None + health_check: Optional[HealthCheck] = None interface_address: Optional[str] = None """ diff --git a/src/cloudflare/types/magic_transit/cf_interconnect_list_response.py b/src/cloudflare/types/magic_transit/cf_interconnect_list_response.py index e7654b5cec8..6dcb1098fe2 100644 --- a/src/cloudflare/types/magic_transit/cf_interconnect_list_response.py +++ b/src/cloudflare/types/magic_transit/cf_interconnect_list_response.py @@ -4,6 +4,7 @@ from datetime import datetime from ..._models import BaseModel +from .health_check import HealthCheck __all__ = ["CfInterconnectListResponse", "Interconnect", "InterconnectGRE"] @@ -32,7 +33,7 @@ class Interconnect(BaseModel): gre: Optional[InterconnectGRE] = None """The configuration specific to GRE interconnects.""" - health_check: Optional[object] = None + health_check: Optional[HealthCheck] = None interface_address: Optional[str] = None """ diff --git a/src/cloudflare/types/magic_transit/cf_interconnect_update_response.py b/src/cloudflare/types/magic_transit/cf_interconnect_update_response.py index b7f541e4475..ec43a7deb52 100644 --- a/src/cloudflare/types/magic_transit/cf_interconnect_update_response.py +++ b/src/cloudflare/types/magic_transit/cf_interconnect_update_response.py @@ -4,6 +4,7 @@ from datetime import datetime from ..._models import BaseModel +from .health_check import HealthCheck __all__ = ["CfInterconnectUpdateResponse", "ModifiedInterconnect", "ModifiedInterconnectGRE"] @@ -32,7 +33,7 @@ class ModifiedInterconnect(BaseModel): gre: Optional[ModifiedInterconnectGRE] = None """The configuration specific to GRE interconnects.""" - health_check: Optional[object] = None + health_check: Optional[HealthCheck] = None interface_address: Optional[str] = None """ diff --git a/src/cloudflare/types/magic_transit/health_check.py b/src/cloudflare/types/magic_transit/health_check.py new file mode 100644 index 00000000000..6ee301b8764 --- /dev/null +++ b/src/cloudflare/types/magic_transit/health_check.py @@ -0,0 +1,52 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .health_check_rate import HealthCheckRate +from .health_check_type import HealthCheckType + +__all__ = ["HealthCheck", "Target", "TargetMagicHealthCheckTarget"] + + +class TargetMagicHealthCheckTarget(BaseModel): + effective: Optional[str] = None + """The effective health check target. + + If 'saved' is empty, then this field will be populated with the calculated + default value on GET requests. Ignored in POST, PUT, and PATCH requests. + """ + + saved: Optional[str] = None + """The saved health check target. + + Setting the value to the empty string indicates that the calculated default + value will be used. + """ + + +Target: TypeAlias = Union[TargetMagicHealthCheckTarget, str] + + +class HealthCheck(BaseModel): + enabled: Optional[bool] = None + """Determines whether to run healthchecks for a tunnel.""" + + rate: Optional[HealthCheckRate] = None + """How frequent the health check is run. The default value is `mid`.""" + + target: Optional[Target] = None + """The destination address in a request type health check. + + After the healthcheck is decapsulated at the customer end of the tunnel, the + ICMP echo will be forwarded to this address. This field defaults to + `customer_gre_endpoint address`. This field is ignored for bidirectional + healthchecks as the interface_address (not assigned to the Cloudflare side of + the tunnel) is used as the target. Must be in object form if the + x-magic-new-hc-target header is set to true and string form if + x-magic-new-hc-target is absent or set to false. + """ + + type: Optional[HealthCheckType] = None + """The type of healthcheck to run, reply or request. The default value is `reply`.""" diff --git a/src/cloudflare/types/memberships/membership.py b/src/cloudflare/types/memberships/membership.py index 92727cbd688..58d3be9f330 100644 --- a/src/cloudflare/types/memberships/membership.py +++ b/src/cloudflare/types/memberships/membership.py @@ -4,6 +4,7 @@ from typing_extensions import Literal from ..._models import BaseModel +from ..accounts.account import Account from ..shared.permission_grant import PermissionGrant __all__ = ["Membership", "Permissions"] @@ -39,7 +40,7 @@ class Membership(BaseModel): id: Optional[str] = None """Membership identifier tag.""" - account: Optional[object] = None + account: Optional[Account] = None api_access_enabled: Optional[bool] = None """Enterprise only. diff --git a/src/cloudflare/types/memberships/membership_get_response.py b/src/cloudflare/types/memberships/membership_get_response.py index a942338d931..524eaa1ead9 100644 --- a/src/cloudflare/types/memberships/membership_get_response.py +++ b/src/cloudflare/types/memberships/membership_get_response.py @@ -4,6 +4,7 @@ from typing_extensions import Literal from ..._models import BaseModel +from ..accounts.account import Account from ..shared.permission_grant import PermissionGrant __all__ = [ @@ -119,7 +120,7 @@ class MembershipGetResponse(BaseModel): id: Optional[str] = None """Membership identifier tag.""" - account: Optional[object] = None + account: Optional[Account] = None api_access_enabled: Optional[bool] = None """Enterprise only. diff --git a/src/cloudflare/types/memberships/membership_update_response.py b/src/cloudflare/types/memberships/membership_update_response.py index 44139a0d7de..7f6b238103c 100644 --- a/src/cloudflare/types/memberships/membership_update_response.py +++ b/src/cloudflare/types/memberships/membership_update_response.py @@ -4,6 +4,7 @@ from typing_extensions import Literal from ..._models import BaseModel +from ..accounts.account import Account from ..shared.permission_grant import PermissionGrant __all__ = [ @@ -119,7 +120,7 @@ class MembershipUpdateResponse(BaseModel): id: Optional[str] = None """Membership identifier tag.""" - account: Optional[object] = None + account: Optional[Account] = None api_access_enabled: Optional[bool] = None """Enterprise only. diff --git a/src/cloudflare/types/registrar/__init__.py b/src/cloudflare/types/registrar/__init__.py index ec299b4608a..d6102a096f4 100644 --- a/src/cloudflare/types/registrar/__init__.py +++ b/src/cloudflare/types/registrar/__init__.py @@ -2,4 +2,5 @@ from __future__ import annotations +from .domain import Domain as Domain from .domain_update_params import DomainUpdateParams as DomainUpdateParams diff --git a/src/cloudflare/types/registrar/domain.py b/src/cloudflare/types/registrar/domain.py new file mode 100644 index 00000000000..949c123cb82 --- /dev/null +++ b/src/cloudflare/types/registrar/domain.py @@ -0,0 +1,116 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["Domain", "RegistrantContact", "TransferIn"] + + +class RegistrantContact(BaseModel): + address: str + """Address.""" + + city: str + """City.""" + + country: Optional[str] = None + """The country in which the user lives.""" + + first_name: Optional[str] = None + """User's first name""" + + last_name: Optional[str] = None + """User's last name""" + + organization: str + """Name of organization.""" + + phone: Optional[str] = None + """User's telephone number""" + + state: str + """State.""" + + zip: Optional[str] = None + """The zipcode or postal code where the user lives.""" + + id: Optional[str] = None + """Contact Identifier.""" + + address2: Optional[str] = None + """Optional address line for unit, floor, suite, etc.""" + + email: Optional[str] = None + """The contact email address of the user.""" + + fax: Optional[str] = None + """Contact fax number.""" + + +class TransferIn(BaseModel): + accept_foa: Optional[Literal["needed", "ok"]] = None + """Form of authorization has been accepted by the registrant.""" + + approve_transfer: Optional[Literal["needed", "ok", "pending", "trying", "rejected", "unknown"]] = None + """Shows transfer status with the registry.""" + + can_cancel_transfer: Optional[bool] = None + """Indicates if cancellation is still possible.""" + + disable_privacy: Optional[Literal["needed", "ok", "unknown"]] = None + """Privacy guards are disabled at the foreign registrar.""" + + enter_auth_code: Optional[Literal["needed", "ok", "pending", "trying", "rejected"]] = None + """Auth code has been entered and verified.""" + + unlock_domain: Optional[Literal["needed", "ok", "pending", "trying", "unknown"]] = None + """Domain is unlocked at the foreign registrar.""" + + +class Domain(BaseModel): + id: Optional[str] = None + """Domain identifier.""" + + available: Optional[bool] = None + """Shows if a domain is available for transferring into Cloudflare Registrar.""" + + can_register: Optional[bool] = None + """Indicates if the domain can be registered as a new domain.""" + + created_at: Optional[datetime] = None + """Shows time of creation.""" + + current_registrar: Optional[str] = None + """Shows name of current registrar.""" + + expires_at: Optional[datetime] = None + """Shows when domain name registration expires.""" + + locked: Optional[bool] = None + """Shows whether a registrar lock is in place for a domain.""" + + registrant_contact: Optional[RegistrantContact] = None + """Shows contact information for domain registrant.""" + + registry_statuses: Optional[str] = None + """A comma-separated list of registry status codes. + + A full list of status codes can be found at + [EPP Status Codes](https://www.icann.org/resources/pages/epp-status-codes-2014-06-16-en). + """ + + supported_tld: Optional[bool] = None + """Whether a particular TLD is currently supported by Cloudflare Registrar. + + Refer to [TLD Policies](https://www.cloudflare.com/tld-policies/) for a list of + supported TLDs. + """ + + transfer_in: Optional[TransferIn] = None + """Statuses for domain transfers into Cloudflare Registrar.""" + + updated_at: Optional[datetime] = None + """Last updated.""" diff --git a/src/cloudflare/types/spectrum/analytics/events/bytime_get_params.py b/src/cloudflare/types/spectrum/analytics/events/bytime_get_params.py index 6509fec8899..2a998b647d8 100644 --- a/src/cloudflare/types/spectrum/analytics/events/bytime_get_params.py +++ b/src/cloudflare/types/spectrum/analytics/events/bytime_get_params.py @@ -67,6 +67,10 @@ class BytimeGetParams(TypedDict, total=False): """ since: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """Start of time interval to query, defaults to `until` - 6 hours. + + Timestamp must be in RFC3339 format and uses UTC unless otherwise specified. + """ sort: List[str] """ @@ -75,3 +79,7 @@ class BytimeGetParams(TypedDict, total=False): """ until: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """End of time interval to query, defaults to current time. + + Timestamp must be in RFC3339 format and uses UTC unless otherwise specified. + """ diff --git a/src/cloudflare/types/spectrum/analytics/events/bytime_get_response.py b/src/cloudflare/types/spectrum/analytics/events/bytime_get_response.py index 02e67b40b2e..9920bd395a4 100644 --- a/src/cloudflare/types/spectrum/analytics/events/bytime_get_response.py +++ b/src/cloudflare/types/spectrum/analytics/events/bytime_get_response.py @@ -71,7 +71,7 @@ class Query(BaseModel): | duration99th | 99th percentile connection duration | 1.0 | Time in milliseconds. | """ - since: Optional[object] = None + since: Optional[datetime] = None """Start of time interval to query, defaults to `until` - 6 hours. Timestamp must be in RFC3339 format and uses UTC unless otherwise specified. @@ -83,7 +83,7 @@ class Query(BaseModel): `dimensions`. """ - until: Optional[object] = None + until: Optional[datetime] = None """End of time interval to query, defaults to current time. Timestamp must be in RFC3339 format and uses UTC unless otherwise specified. diff --git a/src/cloudflare/types/spectrum/analytics/events/summary_get_params.py b/src/cloudflare/types/spectrum/analytics/events/summary_get_params.py index 71d9e69de87..cd0ece71f19 100644 --- a/src/cloudflare/types/spectrum/analytics/events/summary_get_params.py +++ b/src/cloudflare/types/spectrum/analytics/events/summary_get_params.py @@ -64,6 +64,10 @@ class SummaryGetParams(TypedDict, total=False): """ since: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """Start of time interval to query, defaults to `until` - 6 hours. + + Timestamp must be in RFC3339 format and uses UTC unless otherwise specified. + """ sort: List[str] """ @@ -72,3 +76,7 @@ class SummaryGetParams(TypedDict, total=False): """ until: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """End of time interval to query, defaults to current time. + + Timestamp must be in RFC3339 format and uses UTC unless otherwise specified. + """ diff --git a/src/cloudflare/types/spectrum/analytics/events/summary_get_response.py b/src/cloudflare/types/spectrum/analytics/events/summary_get_response.py index c2a86456a7f..b6e48698e47 100644 --- a/src/cloudflare/types/spectrum/analytics/events/summary_get_response.py +++ b/src/cloudflare/types/spectrum/analytics/events/summary_get_response.py @@ -71,7 +71,7 @@ class Query(BaseModel): | duration99th | 99th percentile connection duration | 1.0 | Time in milliseconds. | """ - since: Optional[object] = None + since: Optional[datetime] = None """Start of time interval to query, defaults to `until` - 6 hours. Timestamp must be in RFC3339 format and uses UTC unless otherwise specified. @@ -83,7 +83,7 @@ class Query(BaseModel): `dimensions`. """ - until: Optional[object] = None + until: Optional[datetime] = None """End of time interval to query, defaults to current time. Timestamp must be in RFC3339 format and uses UTC unless otherwise specified. diff --git a/src/cloudflare/types/spectrum/app_create_params.py b/src/cloudflare/types/spectrum/app_create_params.py index fc47e6b2141..321ca9d6d93 100644 --- a/src/cloudflare/types/spectrum/app_create_params.py +++ b/src/cloudflare/types/spectrum/app_create_params.py @@ -15,7 +15,7 @@ class SpectrumConfigAppConfig(TypedDict, total=False): zone_id: Required[str] - """Identifier""" + """Zone identifier.""" dns: Required[DNSParam] """The name and type of DNS record for the Spectrum application.""" @@ -85,10 +85,7 @@ class SpectrumConfigAppConfig(TypedDict, total=False): class SpectrumConfigPaygoAppConfig(TypedDict, total=False): zone_id: Required[str] - """Identifier""" - - id: Required[str] - """Identifier""" + """Zone identifier.""" dns: Required[DNSParam] """The name and type of DNS record for the Spectrum application.""" diff --git a/src/cloudflare/types/spectrum/app_create_response.py b/src/cloudflare/types/spectrum/app_create_response.py index adf3aed78ca..d6a8d9d9947 100644 --- a/src/cloudflare/types/spectrum/app_create_response.py +++ b/src/cloudflare/types/spectrum/app_create_response.py @@ -14,10 +14,10 @@ class SpectrumConfigAppConfig(BaseModel): - id: object + id: str """App identifier.""" - created_on: object + created_on: datetime """When the Application was created.""" dns: DNS @@ -29,7 +29,7 @@ class SpectrumConfigAppConfig(BaseModel): applications. """ - modified_on: object + modified_on: datetime """When the Application was last modified.""" protocol: str @@ -91,14 +91,16 @@ class SpectrumConfigAppConfig(BaseModel): class SpectrumConfigPaygoAppConfig(BaseModel): id: str - """Identifier""" + """App identifier.""" created_on: datetime + """When the Application was created.""" dns: DNS """The name and type of DNS record for the Spectrum application.""" modified_on: datetime + """When the Application was last modified.""" protocol: str """The port configuration at Cloudflare's edge. diff --git a/src/cloudflare/types/spectrum/app_get_response.py b/src/cloudflare/types/spectrum/app_get_response.py index 7587e4b4973..de88107be2b 100644 --- a/src/cloudflare/types/spectrum/app_get_response.py +++ b/src/cloudflare/types/spectrum/app_get_response.py @@ -14,10 +14,10 @@ class SpectrumConfigAppConfig(BaseModel): - id: object + id: str """App identifier.""" - created_on: object + created_on: datetime """When the Application was created.""" dns: DNS @@ -29,7 +29,7 @@ class SpectrumConfigAppConfig(BaseModel): applications. """ - modified_on: object + modified_on: datetime """When the Application was last modified.""" protocol: str @@ -91,14 +91,16 @@ class SpectrumConfigAppConfig(BaseModel): class SpectrumConfigPaygoAppConfig(BaseModel): id: str - """Identifier""" + """App identifier.""" created_on: datetime + """When the Application was created.""" dns: DNS """The name and type of DNS record for the Spectrum application.""" modified_on: datetime + """When the Application was last modified.""" protocol: str """The port configuration at Cloudflare's edge. diff --git a/src/cloudflare/types/spectrum/app_list_params.py b/src/cloudflare/types/spectrum/app_list_params.py index fb9b5f9aa05..84e5876649c 100644 --- a/src/cloudflare/types/spectrum/app_list_params.py +++ b/src/cloudflare/types/spectrum/app_list_params.py @@ -9,7 +9,7 @@ class AppListParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" + """Zone identifier.""" direction: Literal["asc", "desc"] """Sets the direction by which results are ordered.""" diff --git a/src/cloudflare/types/spectrum/app_list_response.py b/src/cloudflare/types/spectrum/app_list_response.py index e4f70569d8f..b985557d36f 100644 --- a/src/cloudflare/types/spectrum/app_list_response.py +++ b/src/cloudflare/types/spectrum/app_list_response.py @@ -14,10 +14,10 @@ class UnionMember0(BaseModel): - id: object + id: str """App identifier.""" - created_on: object + created_on: datetime """When the Application was created.""" dns: DNS @@ -29,7 +29,7 @@ class UnionMember0(BaseModel): applications. """ - modified_on: object + modified_on: datetime """When the Application was last modified.""" protocol: str @@ -91,14 +91,16 @@ class UnionMember0(BaseModel): class UnionMember1(BaseModel): id: str - """Identifier""" + """App identifier.""" created_on: datetime + """When the Application was created.""" dns: DNS """The name and type of DNS record for the Spectrum application.""" modified_on: datetime + """When the Application was last modified.""" protocol: str """The port configuration at Cloudflare's edge. diff --git a/src/cloudflare/types/spectrum/app_update_params.py b/src/cloudflare/types/spectrum/app_update_params.py index e5b22ea30ad..90905475eac 100644 --- a/src/cloudflare/types/spectrum/app_update_params.py +++ b/src/cloudflare/types/spectrum/app_update_params.py @@ -15,7 +15,7 @@ class SpectrumConfigAppConfig(TypedDict, total=False): zone_id: Required[str] - """Identifier""" + """Zone identifier.""" dns: Required[DNSParam] """The name and type of DNS record for the Spectrum application.""" @@ -85,10 +85,7 @@ class SpectrumConfigAppConfig(TypedDict, total=False): class SpectrumConfigPaygoAppConfig(TypedDict, total=False): zone_id: Required[str] - """Identifier""" - - id: Required[str] - """Identifier""" + """Zone identifier.""" dns: Required[DNSParam] """The name and type of DNS record for the Spectrum application.""" diff --git a/src/cloudflare/types/spectrum/app_update_response.py b/src/cloudflare/types/spectrum/app_update_response.py index b11fd8e9b1a..8ee0649beea 100644 --- a/src/cloudflare/types/spectrum/app_update_response.py +++ b/src/cloudflare/types/spectrum/app_update_response.py @@ -14,10 +14,10 @@ class SpectrumConfigAppConfig(BaseModel): - id: object + id: str """App identifier.""" - created_on: object + created_on: datetime """When the Application was created.""" dns: DNS @@ -29,7 +29,7 @@ class SpectrumConfigAppConfig(BaseModel): applications. """ - modified_on: object + modified_on: datetime """When the Application was last modified.""" protocol: str @@ -91,14 +91,16 @@ class SpectrumConfigAppConfig(BaseModel): class SpectrumConfigPaygoAppConfig(BaseModel): id: str - """Identifier""" + """App identifier.""" created_on: datetime + """When the Application was created.""" dns: DNS """The name and type of DNS record for the Spectrum application.""" modified_on: datetime + """When the Application was last modified.""" protocol: str """The port configuration at Cloudflare's edge. diff --git a/src/cloudflare/types/user/token_update_params.py b/src/cloudflare/types/user/token_update_params.py index b48ae15215b..6df123fcec8 100644 --- a/src/cloudflare/types/user/token_update_params.py +++ b/src/cloudflare/types/user/token_update_params.py @@ -4,7 +4,7 @@ from typing import List, Union, Iterable from datetime import datetime -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo from ..shared_params.token_policy import TokenPolicy @@ -14,6 +14,15 @@ class TokenUpdateParams(TypedDict, total=False): + name: Required[str] + """Token name.""" + + policies: Required[Iterable[TokenPolicy]] + """List of access policies assigned to the token.""" + + status: Required[Literal["active", "disabled", "expired"]] + """Status of the token.""" + condition: Condition expires_on: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] @@ -22,18 +31,9 @@ class TokenUpdateParams(TypedDict, total=False): processing. """ - name: str - """Token name.""" - not_before: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] """The time before which the token MUST NOT be accepted for processing.""" - policies: Iterable[TokenPolicy] - """List of access policies assigned to the token.""" - - status: Literal["active", "disabled", "expired"] - """Status of the token.""" - _ConditionRequestIPReservedKeywords = TypedDict( "_ConditionRequestIPReservedKeywords", diff --git a/src/cloudflare/types/workers/scripts/__init__.py b/src/cloudflare/types/workers/scripts/__init__.py index 2bfe5d911a9..c8b592499c2 100644 --- a/src/cloudflare/types/workers/scripts/__init__.py +++ b/src/cloudflare/types/workers/scripts/__init__.py @@ -2,6 +2,7 @@ from __future__ import annotations +from .schedule import Schedule as Schedule from .deployment import Deployment as Deployment from .schedule_param import ScheduleParam as ScheduleParam from .consumer_script import ConsumerScript as ConsumerScript diff --git a/src/cloudflare/types/workers/scripts/schedule.py b/src/cloudflare/types/workers/scripts/schedule.py new file mode 100644 index 00000000000..08c504bddf7 --- /dev/null +++ b/src/cloudflare/types/workers/scripts/schedule.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["Schedule"] + + +class Schedule(BaseModel): + created_on: Optional[str] = None + + cron: Optional[str] = None + + modified_on: Optional[str] = None diff --git a/src/cloudflare/types/workers/scripts/schedule_get_response.py b/src/cloudflare/types/workers/scripts/schedule_get_response.py index f8c45d659a5..5d430c7ce85 100644 --- a/src/cloudflare/types/workers/scripts/schedule_get_response.py +++ b/src/cloudflare/types/workers/scripts/schedule_get_response.py @@ -2,10 +2,11 @@ from typing import List, Optional +from .schedule import Schedule from ...._models import BaseModel __all__ = ["ScheduleGetResponse"] class ScheduleGetResponse(BaseModel): - schedules: Optional[List[object]] = None + schedules: Optional[List[Schedule]] = None diff --git a/src/cloudflare/types/workers/scripts/schedule_update_response.py b/src/cloudflare/types/workers/scripts/schedule_update_response.py index 200f804bc1e..0024bf49131 100644 --- a/src/cloudflare/types/workers/scripts/schedule_update_response.py +++ b/src/cloudflare/types/workers/scripts/schedule_update_response.py @@ -2,10 +2,11 @@ from typing import List, Optional +from .schedule import Schedule from ...._models import BaseModel __all__ = ["ScheduleUpdateResponse"] class ScheduleUpdateResponse(BaseModel): - schedules: Optional[List[object]] = None + schedules: Optional[List[Schedule]] = None diff --git a/src/cloudflare/types/zero_trust/access/users/active_session_get_response.py b/src/cloudflare/types/zero_trust/access/users/active_session_get_response.py index affcc728dad..2414f09a55c 100644 --- a/src/cloudflare/types/zero_trust/access/users/active_session_get_response.py +++ b/src/cloudflare/types/zero_trust/access/users/active_session_get_response.py @@ -5,6 +5,7 @@ from pydantic import Field as FieldInfo from ....._models import BaseModel +from ..applications.user_policy_check_geo import UserPolicyCheckGeo __all__ = ["ActiveSessionGetResponse", "DeviceSessions", "DevicePosture", "DevicePostureCheck", "IdP", "MTLSAuth"] @@ -72,7 +73,7 @@ class ActiveSessionGetResponse(BaseModel): email: Optional[str] = None - geo: Optional[object] = None + geo: Optional[UserPolicyCheckGeo] = None iat: Optional[float] = None diff --git a/src/cloudflare/types/zero_trust/devices/device_network.py b/src/cloudflare/types/zero_trust/devices/device_network.py index c8c7be49ec6..db154213768 100644 --- a/src/cloudflare/types/zero_trust/devices/device_network.py +++ b/src/cloudflare/types/zero_trust/devices/device_network.py @@ -5,11 +5,26 @@ from ...._models import BaseModel -__all__ = ["DeviceNetwork"] +__all__ = ["DeviceNetwork", "Config"] + + +class Config(BaseModel): + tls_sockaddr: str + """ + A network address of the form "host:port" that the WARP client will use to + detect the presence of a TLS host. + """ + + sha256: Optional[str] = None + """ + The SHA-256 hash of the TLS certificate presented by the host found at + tls_sockaddr. If absent, regular certificate verification (trusted roots, valid + timestamp, etc) will be used to validate the certificate. + """ class DeviceNetwork(BaseModel): - config: Optional[object] = None + config: Optional[Config] = None """ The configuration object containing information for the WARP client to detect the managed network. diff --git a/src/cloudflare/types/zero_trust/devices/network_create_params.py b/src/cloudflare/types/zero_trust/devices/network_create_params.py index 25154e42853..66c61f32f1b 100644 --- a/src/cloudflare/types/zero_trust/devices/network_create_params.py +++ b/src/cloudflare/types/zero_trust/devices/network_create_params.py @@ -11,6 +11,10 @@ class NetworkCreateParams(TypedDict, total=False): account_id: Required[str] config: Required[Config] + """ + The configuration object containing information for the WARP client to detect + the managed network. + """ name: Required[str] """The name of the device managed network. This name must be unique.""" diff --git a/src/cloudflare/types/zero_trust/devices/network_update_params.py b/src/cloudflare/types/zero_trust/devices/network_update_params.py index 5ead0f603f3..ff00a95df86 100644 --- a/src/cloudflare/types/zero_trust/devices/network_update_params.py +++ b/src/cloudflare/types/zero_trust/devices/network_update_params.py @@ -11,6 +11,10 @@ class NetworkUpdateParams(TypedDict, total=False): account_id: Required[str] config: Config + """ + The configuration object containing information for the WARP client to detect + the managed network. + """ name: str """The name of the device managed network. This name must be unique.""" diff --git a/src/cloudflare/types/zero_trust/devices/posture/integration.py b/src/cloudflare/types/zero_trust/devices/posture/integration.py index 7dcc3bb7c74..b517b4a7e70 100644 --- a/src/cloudflare/types/zero_trust/devices/posture/integration.py +++ b/src/cloudflare/types/zero_trust/devices/posture/integration.py @@ -24,7 +24,7 @@ class Integration(BaseModel): """API UUID.""" config: Optional[Config] = None - """The Workspace One Config Response.""" + """The configuration object containing third-party integration information.""" interval: Optional[str] = None """The interval between each posture check with the third-party API. diff --git a/src/cloudflare/types/zones/__init__.py b/src/cloudflare/types/zones/__init__.py index 75e408cfb1e..5b7501b8935 100644 --- a/src/cloudflare/types/zones/__init__.py +++ b/src/cloudflare/types/zones/__init__.py @@ -90,6 +90,7 @@ from .development_mode_param import DevelopmentModeParam as DevelopmentModeParam from .orange_to_orange_param import OrangeToOrangeParam as OrangeToOrangeParam from .prefetch_preload_param import PrefetchPreloadParam as PrefetchPreloadParam +from .rate_plan_get_response import RatePlanGetResponse as RatePlanGetResponse from .security_headers_param import SecurityHeadersParam as SecurityHeadersParam from .browser_cache_ttl_param import BrowserCacheTTLParam as BrowserCacheTTLParam from .email_obfuscation_param import EmailObfuscationParam as EmailObfuscationParam diff --git a/src/cloudflare/types/zones/rate_plan_get_response.py b/src/cloudflare/types/zones/rate_plan_get_response.py new file mode 100644 index 00000000000..87940e668c0 --- /dev/null +++ b/src/cloudflare/types/zones/rate_plan_get_response.py @@ -0,0 +1,39 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["RatePlanGetResponse", "Component"] + + +class Component(BaseModel): + default: Optional[float] = None + """The default amount allocated.""" + + name: Optional[Literal["zones", "page_rules", "dedicated_certificates", "dedicated_certificates_custom"]] = None + """The unique component.""" + + unit_price: Optional[float] = None + """The unit price of the addon.""" + + +class RatePlanGetResponse(BaseModel): + id: Optional[str] = None + """Plan identifier tag.""" + + components: Optional[List[Component]] = None + """Array of available components values for the plan.""" + + currency: Optional[str] = None + """The monetary unit in which pricing information is displayed.""" + + duration: Optional[float] = None + """The duration of the plan subscription.""" + + frequency: Optional[Literal["weekly", "monthly", "quarterly", "yearly"]] = None + """The frequency at which you will be billed for this plan.""" + + name: Optional[str] = None + """The plan name.""" diff --git a/tests/api_resources/accounts/test_subscriptions.py b/tests/api_resources/accounts/test_subscriptions.py index 8184c5b697e..fe3639ee4a3 100644 --- a/tests/api_resources/accounts/test_subscriptions.py +++ b/tests/api_resources/accounts/test_subscriptions.py @@ -10,6 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.shared import Subscription from cloudflare.types.accounts import ( SubscriptionCreateResponse, SubscriptionDeleteResponse, @@ -200,7 +201,7 @@ def test_method_get(self, client: Cloudflare) -> None: subscription = client.accounts.subscriptions.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[object], subscription, path=["response"]) + assert_matches_type(SyncSinglePage[Subscription], subscription, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -211,7 +212,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SyncSinglePage[object], subscription, path=["response"]) + assert_matches_type(SyncSinglePage[Subscription], subscription, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -222,7 +223,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SyncSinglePage[object], subscription, path=["response"]) + assert_matches_type(SyncSinglePage[Subscription], subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -415,7 +416,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: subscription = await async_client.accounts.subscriptions.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[object], subscription, path=["response"]) + assert_matches_type(AsyncSinglePage[Subscription], subscription, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -426,7 +427,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(AsyncSinglePage[object], subscription, path=["response"]) + assert_matches_type(AsyncSinglePage[Subscription], subscription, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -437,7 +438,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(AsyncSinglePage[object], subscription, path=["response"]) + assert_matches_type(AsyncSinglePage[Subscription], subscription, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/accounts/test_tokens.py b/tests/api_resources/accounts/test_tokens.py index 8f78469afac..cdef85095a2 100644 --- a/tests/api_resources/accounts/test_tokens.py +++ b/tests/api_resources/accounts/test_tokens.py @@ -170,6 +170,21 @@ def test_method_update(self, client: Cloudflare) -> None: token = client.accounts.tokens.update( token_id="ed17574386854bf78a67040be0a770b0", account_id="eb78d65290b24279ba6f44721b3ea3c4", + name="readonly token", + policies=[ + { + "effect": "allow", + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], + "resources": { + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }, + } + ], + status="active", ) assert_matches_type(Optional[Token], token, path=["response"]) @@ -179,15 +194,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: token = client.accounts.tokens.update( token_id="ed17574386854bf78a67040be0a770b0", account_id="eb78d65290b24279ba6f44721b3ea3c4", - condition={ - "request_ip": { - "in": ["123.123.123.0/24", "2606:4700::/32"], - "not_in": ["123.123.123.100/24", "2606:4700:4700::/48"], - } - }, - expires_on=parse_datetime("2020-01-01T00:00:00Z"), name="readonly token", - not_before=parse_datetime("2018-07-01T05:20:00Z"), policies=[ { "effect": "allow", @@ -214,6 +221,14 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: } ], status="active", + condition={ + "request_ip": { + "in": ["123.123.123.0/24", "2606:4700::/32"], + "not_in": ["123.123.123.100/24", "2606:4700:4700::/48"], + } + }, + expires_on=parse_datetime("2020-01-01T00:00:00Z"), + not_before=parse_datetime("2018-07-01T05:20:00Z"), ) assert_matches_type(Optional[Token], token, path=["response"]) @@ -223,6 +238,21 @@ def test_raw_response_update(self, client: Cloudflare) -> None: response = client.accounts.tokens.with_raw_response.update( token_id="ed17574386854bf78a67040be0a770b0", account_id="eb78d65290b24279ba6f44721b3ea3c4", + name="readonly token", + policies=[ + { + "effect": "allow", + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], + "resources": { + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }, + } + ], + status="active", ) assert response.is_closed is True @@ -236,6 +266,21 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: with client.accounts.tokens.with_streaming_response.update( token_id="ed17574386854bf78a67040be0a770b0", account_id="eb78d65290b24279ba6f44721b3ea3c4", + name="readonly token", + policies=[ + { + "effect": "allow", + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], + "resources": { + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }, + } + ], + status="active", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -252,12 +297,42 @@ def test_path_params_update(self, client: Cloudflare) -> None: client.accounts.tokens.with_raw_response.update( token_id="ed17574386854bf78a67040be0a770b0", account_id="", + name="readonly token", + policies=[ + { + "effect": "allow", + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], + "resources": { + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }, + } + ], + status="active", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `token_id` but received ''"): client.accounts.tokens.with_raw_response.update( token_id="", account_id="eb78d65290b24279ba6f44721b3ea3c4", + name="readonly token", + policies=[ + { + "effect": "allow", + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], + "resources": { + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }, + } + ], + status="active", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -609,6 +684,21 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: token = await async_client.accounts.tokens.update( token_id="ed17574386854bf78a67040be0a770b0", account_id="eb78d65290b24279ba6f44721b3ea3c4", + name="readonly token", + policies=[ + { + "effect": "allow", + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], + "resources": { + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }, + } + ], + status="active", ) assert_matches_type(Optional[Token], token, path=["response"]) @@ -618,15 +708,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare token = await async_client.accounts.tokens.update( token_id="ed17574386854bf78a67040be0a770b0", account_id="eb78d65290b24279ba6f44721b3ea3c4", - condition={ - "request_ip": { - "in": ["123.123.123.0/24", "2606:4700::/32"], - "not_in": ["123.123.123.100/24", "2606:4700:4700::/48"], - } - }, - expires_on=parse_datetime("2020-01-01T00:00:00Z"), name="readonly token", - not_before=parse_datetime("2018-07-01T05:20:00Z"), policies=[ { "effect": "allow", @@ -653,6 +735,14 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare } ], status="active", + condition={ + "request_ip": { + "in": ["123.123.123.0/24", "2606:4700::/32"], + "not_in": ["123.123.123.100/24", "2606:4700:4700::/48"], + } + }, + expires_on=parse_datetime("2020-01-01T00:00:00Z"), + not_before=parse_datetime("2018-07-01T05:20:00Z"), ) assert_matches_type(Optional[Token], token, path=["response"]) @@ -662,6 +752,21 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.accounts.tokens.with_raw_response.update( token_id="ed17574386854bf78a67040be0a770b0", account_id="eb78d65290b24279ba6f44721b3ea3c4", + name="readonly token", + policies=[ + { + "effect": "allow", + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], + "resources": { + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }, + } + ], + status="active", ) assert response.is_closed is True @@ -675,6 +780,21 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> async with async_client.accounts.tokens.with_streaming_response.update( token_id="ed17574386854bf78a67040be0a770b0", account_id="eb78d65290b24279ba6f44721b3ea3c4", + name="readonly token", + policies=[ + { + "effect": "allow", + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], + "resources": { + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }, + } + ], + status="active", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -691,12 +811,42 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: await async_client.accounts.tokens.with_raw_response.update( token_id="ed17574386854bf78a67040be0a770b0", account_id="", + name="readonly token", + policies=[ + { + "effect": "allow", + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], + "resources": { + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }, + } + ], + status="active", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `token_id` but received ''"): await async_client.accounts.tokens.with_raw_response.update( token_id="", account_id="eb78d65290b24279ba6f44721b3ea3c4", + name="readonly token", + policies=[ + { + "effect": "allow", + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], + "resources": { + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }, + } + ], + status="active", ) @pytest.mark.skip(reason="TODO: investigate broken test") diff --git a/tests/api_resources/api_gateway/discovery/test_operations.py b/tests/api_resources/api_gateway/discovery/test_operations.py index c348411b562..01e6ba3122e 100644 --- a/tests/api_resources/api_gateway/discovery/test_operations.py +++ b/tests/api_resources/api_gateway/discovery/test_operations.py @@ -25,14 +25,14 @@ class TestOperations: @parametrize def test_method_list(self, client: Cloudflare) -> None: operation = client.api_gateway.discovery.operations.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(SyncV4PagePaginationArray[DiscoveryOperation], operation, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: operation = client.api_gateway.discovery.operations.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", diff=True, direction="asc", endpoint="/api/v1", @@ -49,7 +49,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.api_gateway.discovery.operations.with_raw_response.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -60,7 +60,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.api_gateway.discovery.operations.with_streaming_response.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -80,7 +80,7 @@ def test_path_params_list(self, client: Cloudflare) -> None: @parametrize def test_method_bulk_edit(self, client: Cloudflare) -> None: operation = client.api_gateway.discovery.operations.bulk_edit( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", body={ "3818d821-5901-4147-a474-f5f5aec1d54e": {}, "b17c8043-99a0-4202-b7d9-8f7cdbee02cd": {}, @@ -91,7 +91,7 @@ def test_method_bulk_edit(self, client: Cloudflare) -> None: @parametrize def test_raw_response_bulk_edit(self, client: Cloudflare) -> None: response = client.api_gateway.discovery.operations.with_raw_response.bulk_edit( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", body={ "3818d821-5901-4147-a474-f5f5aec1d54e": {}, "b17c8043-99a0-4202-b7d9-8f7cdbee02cd": {}, @@ -106,7 +106,7 @@ def test_raw_response_bulk_edit(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_bulk_edit(self, client: Cloudflare) -> None: with client.api_gateway.discovery.operations.with_streaming_response.bulk_edit( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", body={ "3818d821-5901-4147-a474-f5f5aec1d54e": {}, "b17c8043-99a0-4202-b7d9-8f7cdbee02cd": {}, @@ -134,16 +134,16 @@ def test_path_params_bulk_edit(self, client: Cloudflare) -> None: @parametrize def test_method_edit(self, client: Cloudflare) -> None: operation = client.api_gateway.discovery.operations.edit( - operation_id="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", - zone_id="zone_id", + operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(OperationEditResponse, operation, path=["response"]) @parametrize def test_method_edit_with_all_params(self, client: Cloudflare) -> None: operation = client.api_gateway.discovery.operations.edit( - operation_id="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", - zone_id="zone_id", + operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", state="review", ) assert_matches_type(OperationEditResponse, operation, path=["response"]) @@ -151,8 +151,8 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: response = client.api_gateway.discovery.operations.with_raw_response.edit( - operation_id="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", - zone_id="zone_id", + operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -163,8 +163,8 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: with client.api_gateway.discovery.operations.with_streaming_response.edit( - operation_id="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", - zone_id="zone_id", + operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -178,14 +178,14 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: def test_path_params_edit(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.api_gateway.discovery.operations.with_raw_response.edit( - operation_id="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", zone_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `operation_id` but received ''"): client.api_gateway.discovery.operations.with_raw_response.edit( operation_id="", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -195,14 +195,14 @@ class TestAsyncOperations: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.discovery.operations.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(AsyncV4PagePaginationArray[DiscoveryOperation], operation, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.discovery.operations.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", diff=True, direction="asc", endpoint="/api/v1", @@ -219,7 +219,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.discovery.operations.with_raw_response.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -230,7 +230,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.discovery.operations.with_streaming_response.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -250,7 +250,7 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_bulk_edit(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.discovery.operations.bulk_edit( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", body={ "3818d821-5901-4147-a474-f5f5aec1d54e": {}, "b17c8043-99a0-4202-b7d9-8f7cdbee02cd": {}, @@ -261,7 +261,7 @@ async def test_method_bulk_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_bulk_edit(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.discovery.operations.with_raw_response.bulk_edit( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", body={ "3818d821-5901-4147-a474-f5f5aec1d54e": {}, "b17c8043-99a0-4202-b7d9-8f7cdbee02cd": {}, @@ -276,7 +276,7 @@ async def test_raw_response_bulk_edit(self, async_client: AsyncCloudflare) -> No @parametrize async def test_streaming_response_bulk_edit(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.discovery.operations.with_streaming_response.bulk_edit( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", body={ "3818d821-5901-4147-a474-f5f5aec1d54e": {}, "b17c8043-99a0-4202-b7d9-8f7cdbee02cd": {}, @@ -304,16 +304,16 @@ async def test_path_params_bulk_edit(self, async_client: AsyncCloudflare) -> Non @parametrize async def test_method_edit(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.discovery.operations.edit( - operation_id="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", - zone_id="zone_id", + operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(OperationEditResponse, operation, path=["response"]) @parametrize async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.discovery.operations.edit( - operation_id="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", - zone_id="zone_id", + operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", state="review", ) assert_matches_type(OperationEditResponse, operation, path=["response"]) @@ -321,8 +321,8 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.discovery.operations.with_raw_response.edit( - operation_id="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", - zone_id="zone_id", + operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -333,8 +333,8 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.discovery.operations.with_streaming_response.edit( - operation_id="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", - zone_id="zone_id", + operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -348,12 +348,12 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.api_gateway.discovery.operations.with_raw_response.edit( - operation_id="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", zone_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `operation_id` but received ''"): await async_client.api_gateway.discovery.operations.with_raw_response.edit( operation_id="", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/api_gateway/expression_template/test_fallthrough.py b/tests/api_resources/api_gateway/expression_template/test_fallthrough.py index 8c4d2b15cf9..5dfac36140d 100644 --- a/tests/api_resources/api_gateway/expression_template/test_fallthrough.py +++ b/tests/api_resources/api_gateway/expression_template/test_fallthrough.py @@ -20,7 +20,7 @@ class TestFallthrough: @parametrize def test_method_create(self, client: Cloudflare) -> None: fallthrough = client.api_gateway.expression_template.fallthrough.create( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", hosts=["{zone}.domain1.tld", "domain2.tld"], ) assert_matches_type(FallthroughCreateResponse, fallthrough, path=["response"]) @@ -28,7 +28,7 @@ def test_method_create(self, client: Cloudflare) -> None: @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: response = client.api_gateway.expression_template.fallthrough.with_raw_response.create( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", hosts=["{zone}.domain1.tld", "domain2.tld"], ) @@ -40,7 +40,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: with client.api_gateway.expression_template.fallthrough.with_streaming_response.create( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", hosts=["{zone}.domain1.tld", "domain2.tld"], ) as response: assert not response.is_closed @@ -66,7 +66,7 @@ class TestAsyncFallthrough: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: fallthrough = await async_client.api_gateway.expression_template.fallthrough.create( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", hosts=["{zone}.domain1.tld", "domain2.tld"], ) assert_matches_type(FallthroughCreateResponse, fallthrough, path=["response"]) @@ -74,7 +74,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.expression_template.fallthrough.with_raw_response.create( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", hosts=["{zone}.domain1.tld", "domain2.tld"], ) @@ -86,7 +86,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.expression_template.fallthrough.with_streaming_response.create( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", hosts=["{zone}.domain1.tld", "domain2.tld"], ) as response: assert not response.is_closed diff --git a/tests/api_resources/api_gateway/operations/test_schema_validation.py b/tests/api_resources/api_gateway/operations/test_schema_validation.py index 2b01bbd413e..564e422407b 100644 --- a/tests/api_resources/api_gateway/operations/test_schema_validation.py +++ b/tests/api_resources/api_gateway/operations/test_schema_validation.py @@ -25,7 +25,7 @@ class TestSchemaValidation: def test_method_update(self, client: Cloudflare) -> None: schema_validation = client.api_gateway.operations.schema_validation.update( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(SchemaValidationUpdateResponse, schema_validation, path=["response"]) @@ -33,7 +33,7 @@ def test_method_update(self, client: Cloudflare) -> None: def test_method_update_with_all_params(self, client: Cloudflare) -> None: schema_validation = client.api_gateway.operations.schema_validation.update( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", mitigation_action="log", ) assert_matches_type(SchemaValidationUpdateResponse, schema_validation, path=["response"]) @@ -42,7 +42,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_update(self, client: Cloudflare) -> None: response = client.api_gateway.operations.schema_validation.with_raw_response.update( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -54,7 +54,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: def test_streaming_response_update(self, client: Cloudflare) -> None: with client.api_gateway.operations.schema_validation.with_streaming_response.update( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -75,13 +75,13 @@ def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `operation_id` but received ''"): client.api_gateway.operations.schema_validation.with_raw_response.update( operation_id="", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @parametrize def test_method_edit(self, client: Cloudflare) -> None: schema_validation = client.api_gateway.operations.schema_validation.edit( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", settings_multiple_request={ "3818d821-5901-4147-a474-f5f5aec1d54e": {}, "b17c8043-99a0-4202-b7d9-8f7cdbee02cd": {}, @@ -92,7 +92,7 @@ def test_method_edit(self, client: Cloudflare) -> None: @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: response = client.api_gateway.operations.schema_validation.with_raw_response.edit( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", settings_multiple_request={ "3818d821-5901-4147-a474-f5f5aec1d54e": {}, "b17c8043-99a0-4202-b7d9-8f7cdbee02cd": {}, @@ -107,7 +107,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: with client.api_gateway.operations.schema_validation.with_streaming_response.edit( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", settings_multiple_request={ "3818d821-5901-4147-a474-f5f5aec1d54e": {}, "b17c8043-99a0-4202-b7d9-8f7cdbee02cd": {}, @@ -136,7 +136,7 @@ def test_path_params_edit(self, client: Cloudflare) -> None: def test_method_get(self, client: Cloudflare) -> None: schema_validation = client.api_gateway.operations.schema_validation.get( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(SchemaValidationGetResponse, schema_validation, path=["response"]) @@ -144,7 +144,7 @@ def test_method_get(self, client: Cloudflare) -> None: def test_raw_response_get(self, client: Cloudflare) -> None: response = client.api_gateway.operations.schema_validation.with_raw_response.get( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -156,7 +156,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: def test_streaming_response_get(self, client: Cloudflare) -> None: with client.api_gateway.operations.schema_validation.with_streaming_response.get( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -177,7 +177,7 @@ def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `operation_id` but received ''"): client.api_gateway.operations.schema_validation.with_raw_response.get( operation_id="", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -188,7 +188,7 @@ class TestAsyncSchemaValidation: async def test_method_update(self, async_client: AsyncCloudflare) -> None: schema_validation = await async_client.api_gateway.operations.schema_validation.update( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(SchemaValidationUpdateResponse, schema_validation, path=["response"]) @@ -196,7 +196,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: schema_validation = await async_client.api_gateway.operations.schema_validation.update( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", mitigation_action="log", ) assert_matches_type(SchemaValidationUpdateResponse, schema_validation, path=["response"]) @@ -205,7 +205,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.operations.schema_validation.with_raw_response.update( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -217,7 +217,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.operations.schema_validation.with_streaming_response.update( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -238,13 +238,13 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `operation_id` but received ''"): await async_client.api_gateway.operations.schema_validation.with_raw_response.update( operation_id="", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @parametrize async def test_method_edit(self, async_client: AsyncCloudflare) -> None: schema_validation = await async_client.api_gateway.operations.schema_validation.edit( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", settings_multiple_request={ "3818d821-5901-4147-a474-f5f5aec1d54e": {}, "b17c8043-99a0-4202-b7d9-8f7cdbee02cd": {}, @@ -255,7 +255,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.operations.schema_validation.with_raw_response.edit( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", settings_multiple_request={ "3818d821-5901-4147-a474-f5f5aec1d54e": {}, "b17c8043-99a0-4202-b7d9-8f7cdbee02cd": {}, @@ -270,7 +270,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.operations.schema_validation.with_streaming_response.edit( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", settings_multiple_request={ "3818d821-5901-4147-a474-f5f5aec1d54e": {}, "b17c8043-99a0-4202-b7d9-8f7cdbee02cd": {}, @@ -299,7 +299,7 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: async def test_method_get(self, async_client: AsyncCloudflare) -> None: schema_validation = await async_client.api_gateway.operations.schema_validation.get( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(SchemaValidationGetResponse, schema_validation, path=["response"]) @@ -307,7 +307,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.operations.schema_validation.with_raw_response.get( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -319,7 +319,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.operations.schema_validation.with_streaming_response.get( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -340,5 +340,5 @@ async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `operation_id` but received ''"): await async_client.api_gateway.operations.schema_validation.with_raw_response.get( operation_id="", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/api_gateway/settings/test_schema_validation.py b/tests/api_resources/api_gateway/settings/test_schema_validation.py index af6c54c4b26..55734d6ad11 100644 --- a/tests/api_resources/api_gateway/settings/test_schema_validation.py +++ b/tests/api_resources/api_gateway/settings/test_schema_validation.py @@ -22,7 +22,7 @@ class TestSchemaValidation: @parametrize def test_method_update(self, client: Cloudflare) -> None: schema_validation = client.api_gateway.settings.schema_validation.update( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", validation_default_mitigation_action="none", ) assert_matches_type(Settings, schema_validation, path=["response"]) @@ -30,7 +30,7 @@ def test_method_update(self, client: Cloudflare) -> None: @parametrize def test_method_update_with_all_params(self, client: Cloudflare) -> None: schema_validation = client.api_gateway.settings.schema_validation.update( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", validation_default_mitigation_action="none", validation_override_mitigation_action="none", ) @@ -39,7 +39,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: response = client.api_gateway.settings.schema_validation.with_raw_response.update( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", validation_default_mitigation_action="none", ) @@ -51,7 +51,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: with client.api_gateway.settings.schema_validation.with_streaming_response.update( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", validation_default_mitigation_action="none", ) as response: assert not response.is_closed @@ -73,14 +73,14 @@ def test_path_params_update(self, client: Cloudflare) -> None: @parametrize def test_method_edit(self, client: Cloudflare) -> None: schema_validation = client.api_gateway.settings.schema_validation.edit( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Settings, schema_validation, path=["response"]) @parametrize def test_method_edit_with_all_params(self, client: Cloudflare) -> None: schema_validation = client.api_gateway.settings.schema_validation.edit( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", validation_default_mitigation_action="none", validation_override_mitigation_action="none", ) @@ -89,7 +89,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: response = client.api_gateway.settings.schema_validation.with_raw_response.edit( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -100,7 +100,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: with client.api_gateway.settings.schema_validation.with_streaming_response.edit( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -120,14 +120,14 @@ def test_path_params_edit(self, client: Cloudflare) -> None: @parametrize def test_method_get(self, client: Cloudflare) -> None: schema_validation = client.api_gateway.settings.schema_validation.get( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Settings, schema_validation, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: response = client.api_gateway.settings.schema_validation.with_raw_response.get( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -138,7 +138,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: with client.api_gateway.settings.schema_validation.with_streaming_response.get( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -162,7 +162,7 @@ class TestAsyncSchemaValidation: @parametrize async def test_method_update(self, async_client: AsyncCloudflare) -> None: schema_validation = await async_client.api_gateway.settings.schema_validation.update( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", validation_default_mitigation_action="none", ) assert_matches_type(Settings, schema_validation, path=["response"]) @@ -170,7 +170,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: schema_validation = await async_client.api_gateway.settings.schema_validation.update( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", validation_default_mitigation_action="none", validation_override_mitigation_action="none", ) @@ -179,7 +179,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.settings.schema_validation.with_raw_response.update( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", validation_default_mitigation_action="none", ) @@ -191,7 +191,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.settings.schema_validation.with_streaming_response.update( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", validation_default_mitigation_action="none", ) as response: assert not response.is_closed @@ -213,14 +213,14 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_edit(self, async_client: AsyncCloudflare) -> None: schema_validation = await async_client.api_gateway.settings.schema_validation.edit( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Settings, schema_validation, path=["response"]) @parametrize async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: schema_validation = await async_client.api_gateway.settings.schema_validation.edit( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", validation_default_mitigation_action="none", validation_override_mitigation_action="none", ) @@ -229,7 +229,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.settings.schema_validation.with_raw_response.edit( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -240,7 +240,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.settings.schema_validation.with_streaming_response.edit( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -260,14 +260,14 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: schema_validation = await async_client.api_gateway.settings.schema_validation.get( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Settings, schema_validation, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.settings.schema_validation.with_raw_response.get( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -278,7 +278,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.settings.schema_validation.with_streaming_response.get( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/api_gateway/test_configurations.py b/tests/api_resources/api_gateway/test_configurations.py index 7994bafae24..13bdbc85420 100644 --- a/tests/api_resources/api_gateway/test_configurations.py +++ b/tests/api_resources/api_gateway/test_configurations.py @@ -23,7 +23,7 @@ class TestConfigurations: @parametrize def test_method_update(self, client: Cloudflare) -> None: configuration = client.api_gateway.configurations.update( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", auth_id_characteristics=[ { "name": "authorization", @@ -36,7 +36,7 @@ def test_method_update(self, client: Cloudflare) -> None: @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: response = client.api_gateway.configurations.with_raw_response.update( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", auth_id_characteristics=[ { "name": "authorization", @@ -53,7 +53,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: with client.api_gateway.configurations.with_streaming_response.update( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", auth_id_characteristics=[ { "name": "authorization", @@ -85,14 +85,14 @@ def test_path_params_update(self, client: Cloudflare) -> None: @parametrize def test_method_get(self, client: Cloudflare) -> None: configuration = client.api_gateway.configurations.get( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Configuration, configuration, path=["response"]) @parametrize def test_method_get_with_all_params(self, client: Cloudflare) -> None: configuration = client.api_gateway.configurations.get( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", properties=["auth_id_characteristics"], ) assert_matches_type(Configuration, configuration, path=["response"]) @@ -100,7 +100,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: response = client.api_gateway.configurations.with_raw_response.get( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -111,7 +111,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: with client.api_gateway.configurations.with_streaming_response.get( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -135,7 +135,7 @@ class TestAsyncConfigurations: @parametrize async def test_method_update(self, async_client: AsyncCloudflare) -> None: configuration = await async_client.api_gateway.configurations.update( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", auth_id_characteristics=[ { "name": "authorization", @@ -148,7 +148,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.configurations.with_raw_response.update( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", auth_id_characteristics=[ { "name": "authorization", @@ -165,7 +165,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.configurations.with_streaming_response.update( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", auth_id_characteristics=[ { "name": "authorization", @@ -197,14 +197,14 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: configuration = await async_client.api_gateway.configurations.get( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Configuration, configuration, path=["response"]) @parametrize async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: configuration = await async_client.api_gateway.configurations.get( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", properties=["auth_id_characteristics"], ) assert_matches_type(Configuration, configuration, path=["response"]) @@ -212,7 +212,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.configurations.with_raw_response.get( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -223,7 +223,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.configurations.with_streaming_response.get( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/api_gateway/test_discovery.py b/tests/api_resources/api_gateway/test_discovery.py index 0c2e94534e8..f41ab529266 100644 --- a/tests/api_resources/api_gateway/test_discovery.py +++ b/tests/api_resources/api_gateway/test_discovery.py @@ -20,14 +20,14 @@ class TestDiscovery: @parametrize def test_method_get(self, client: Cloudflare) -> None: discovery = client.api_gateway.discovery.get( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(DiscoveryGetResponse, discovery, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: response = client.api_gateway.discovery.with_raw_response.get( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -38,7 +38,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: with client.api_gateway.discovery.with_streaming_response.get( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -62,14 +62,14 @@ class TestAsyncDiscovery: @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: discovery = await async_client.api_gateway.discovery.get( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(DiscoveryGetResponse, discovery, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.discovery.with_raw_response.get( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -80,7 +80,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.discovery.with_streaming_response.get( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/api_gateway/test_operations.py b/tests/api_resources/api_gateway/test_operations.py index 5750e169f73..c363d5857b1 100644 --- a/tests/api_resources/api_gateway/test_operations.py +++ b/tests/api_resources/api_gateway/test_operations.py @@ -28,7 +28,7 @@ class TestOperations: @parametrize def test_method_create(self, client: Cloudflare) -> None: operation = client.api_gateway.operations.create( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", endpoint="/api/v1/users/{var1}", host="www.example.com", method="GET", @@ -38,7 +38,7 @@ def test_method_create(self, client: Cloudflare) -> None: @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: response = client.api_gateway.operations.with_raw_response.create( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", endpoint="/api/v1/users/{var1}", host="www.example.com", method="GET", @@ -52,7 +52,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: with client.api_gateway.operations.with_streaming_response.create( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", endpoint="/api/v1/users/{var1}", host="www.example.com", method="GET", @@ -78,14 +78,14 @@ def test_path_params_create(self, client: Cloudflare) -> None: @parametrize def test_method_list(self, client: Cloudflare) -> None: operation = client.api_gateway.operations.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(SyncV4PagePaginationArray[OperationListResponse], operation, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: operation = client.api_gateway.operations.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", direction="asc", endpoint="/api/v1", feature=["thresholds"], @@ -100,7 +100,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.api_gateway.operations.with_raw_response.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -111,7 +111,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.api_gateway.operations.with_streaming_response.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -132,7 +132,7 @@ def test_path_params_list(self, client: Cloudflare) -> None: def test_method_delete(self, client: Cloudflare) -> None: operation = client.api_gateway.operations.delete( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(OperationDeleteResponse, operation, path=["response"]) @@ -140,7 +140,7 @@ def test_method_delete(self, client: Cloudflare) -> None: def test_raw_response_delete(self, client: Cloudflare) -> None: response = client.api_gateway.operations.with_raw_response.delete( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -152,7 +152,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: def test_streaming_response_delete(self, client: Cloudflare) -> None: with client.api_gateway.operations.with_streaming_response.delete( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -173,13 +173,13 @@ def test_path_params_delete(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `operation_id` but received ''"): client.api_gateway.operations.with_raw_response.delete( operation_id="", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @parametrize def test_method_bulk_create(self, client: Cloudflare) -> None: operation = client.api_gateway.operations.bulk_create( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", body=[ { "endpoint": "/api/v1/users/{var1}", @@ -193,7 +193,7 @@ def test_method_bulk_create(self, client: Cloudflare) -> None: @parametrize def test_raw_response_bulk_create(self, client: Cloudflare) -> None: response = client.api_gateway.operations.with_raw_response.bulk_create( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", body=[ { "endpoint": "/api/v1/users/{var1}", @@ -211,7 +211,7 @@ def test_raw_response_bulk_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_bulk_create(self, client: Cloudflare) -> None: with client.api_gateway.operations.with_streaming_response.bulk_create( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", body=[ { "endpoint": "/api/v1/users/{var1}", @@ -245,14 +245,14 @@ def test_path_params_bulk_create(self, client: Cloudflare) -> None: @parametrize def test_method_bulk_delete(self, client: Cloudflare) -> None: operation = client.api_gateway.operations.bulk_delete( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(OperationBulkDeleteResponse, operation, path=["response"]) @parametrize def test_raw_response_bulk_delete(self, client: Cloudflare) -> None: response = client.api_gateway.operations.with_raw_response.bulk_delete( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -263,7 +263,7 @@ def test_raw_response_bulk_delete(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_bulk_delete(self, client: Cloudflare) -> None: with client.api_gateway.operations.with_streaming_response.bulk_delete( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -284,7 +284,7 @@ def test_path_params_bulk_delete(self, client: Cloudflare) -> None: def test_method_get(self, client: Cloudflare) -> None: operation = client.api_gateway.operations.get( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(OperationGetResponse, operation, path=["response"]) @@ -292,7 +292,7 @@ def test_method_get(self, client: Cloudflare) -> None: def test_method_get_with_all_params(self, client: Cloudflare) -> None: operation = client.api_gateway.operations.get( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", feature=["thresholds"], ) assert_matches_type(OperationGetResponse, operation, path=["response"]) @@ -301,7 +301,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_get(self, client: Cloudflare) -> None: response = client.api_gateway.operations.with_raw_response.get( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -313,7 +313,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: def test_streaming_response_get(self, client: Cloudflare) -> None: with client.api_gateway.operations.with_streaming_response.get( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -334,7 +334,7 @@ def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `operation_id` but received ''"): client.api_gateway.operations.with_raw_response.get( operation_id="", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -344,7 +344,7 @@ class TestAsyncOperations: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.operations.create( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", endpoint="/api/v1/users/{var1}", host="www.example.com", method="GET", @@ -354,7 +354,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.operations.with_raw_response.create( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", endpoint="/api/v1/users/{var1}", host="www.example.com", method="GET", @@ -368,7 +368,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.operations.with_streaming_response.create( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", endpoint="/api/v1/users/{var1}", host="www.example.com", method="GET", @@ -394,14 +394,14 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.operations.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(AsyncV4PagePaginationArray[OperationListResponse], operation, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.operations.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", direction="asc", endpoint="/api/v1", feature=["thresholds"], @@ -416,7 +416,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.operations.with_raw_response.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -427,7 +427,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.operations.with_streaming_response.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -448,7 +448,7 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: async def test_method_delete(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.operations.delete( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(OperationDeleteResponse, operation, path=["response"]) @@ -456,7 +456,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.operations.with_raw_response.delete( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -468,7 +468,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.operations.with_streaming_response.delete( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -489,13 +489,13 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `operation_id` but received ''"): await async_client.api_gateway.operations.with_raw_response.delete( operation_id="", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @parametrize async def test_method_bulk_create(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.operations.bulk_create( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", body=[ { "endpoint": "/api/v1/users/{var1}", @@ -509,7 +509,7 @@ async def test_method_bulk_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_bulk_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.operations.with_raw_response.bulk_create( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", body=[ { "endpoint": "/api/v1/users/{var1}", @@ -527,7 +527,7 @@ async def test_raw_response_bulk_create(self, async_client: AsyncCloudflare) -> @parametrize async def test_streaming_response_bulk_create(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.operations.with_streaming_response.bulk_create( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", body=[ { "endpoint": "/api/v1/users/{var1}", @@ -561,14 +561,14 @@ async def test_path_params_bulk_create(self, async_client: AsyncCloudflare) -> N @parametrize async def test_method_bulk_delete(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.operations.bulk_delete( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(OperationBulkDeleteResponse, operation, path=["response"]) @parametrize async def test_raw_response_bulk_delete(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.operations.with_raw_response.bulk_delete( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -579,7 +579,7 @@ async def test_raw_response_bulk_delete(self, async_client: AsyncCloudflare) -> @parametrize async def test_streaming_response_bulk_delete(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.operations.with_streaming_response.bulk_delete( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -600,7 +600,7 @@ async def test_path_params_bulk_delete(self, async_client: AsyncCloudflare) -> N async def test_method_get(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.operations.get( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(OperationGetResponse, operation, path=["response"]) @@ -608,7 +608,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.operations.get( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", feature=["thresholds"], ) assert_matches_type(OperationGetResponse, operation, path=["response"]) @@ -617,7 +617,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.operations.with_raw_response.get( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -629,7 +629,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.operations.with_streaming_response.get( operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -650,5 +650,5 @@ async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `operation_id` but received ''"): await async_client.api_gateway.operations.with_raw_response.get( operation_id="", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/api_gateway/test_schemas.py b/tests/api_resources/api_gateway/test_schemas.py index 0c2cbad5f87..5c2542b4cb5 100644 --- a/tests/api_resources/api_gateway/test_schemas.py +++ b/tests/api_resources/api_gateway/test_schemas.py @@ -20,14 +20,14 @@ class TestSchemas: @parametrize def test_method_list(self, client: Cloudflare) -> None: schema = client.api_gateway.schemas.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(SchemaListResponse, schema, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: schema = client.api_gateway.schemas.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", feature=["thresholds"], host=["www.example.com"], ) @@ -36,7 +36,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.api_gateway.schemas.with_raw_response.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -47,7 +47,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.api_gateway.schemas.with_streaming_response.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -71,14 +71,14 @@ class TestAsyncSchemas: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: schema = await async_client.api_gateway.schemas.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(SchemaListResponse, schema, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: schema = await async_client.api_gateway.schemas.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", feature=["thresholds"], host=["www.example.com"], ) @@ -87,7 +87,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.schemas.with_raw_response.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -98,7 +98,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.schemas.with_streaming_response.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/api_gateway/test_user_schemas.py b/tests/api_resources/api_gateway/test_user_schemas.py index a13d1f897e1..9ebdf9e6b15 100644 --- a/tests/api_resources/api_gateway/test_user_schemas.py +++ b/tests/api_resources/api_gateway/test_user_schemas.py @@ -25,7 +25,7 @@ class TestUserSchemas: @parametrize def test_method_create(self, client: Cloudflare) -> None: user_schema = client.api_gateway.user_schemas.create( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", file=b"raw file contents", kind="openapi_v3", ) @@ -34,7 +34,7 @@ def test_method_create(self, client: Cloudflare) -> None: @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: user_schema = client.api_gateway.user_schemas.create( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", file=b"raw file contents", kind="openapi_v3", name="petstore schema", @@ -45,7 +45,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: response = client.api_gateway.user_schemas.with_raw_response.create( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", file=b"raw file contents", kind="openapi_v3", ) @@ -58,7 +58,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: with client.api_gateway.user_schemas.with_streaming_response.create( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", file=b"raw file contents", kind="openapi_v3", ) as response: @@ -82,14 +82,14 @@ def test_path_params_create(self, client: Cloudflare) -> None: @parametrize def test_method_list(self, client: Cloudflare) -> None: user_schema = client.api_gateway.user_schemas.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(SyncV4PagePaginationArray[PublicSchema], user_schema, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: user_schema = client.api_gateway.user_schemas.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", omit_source=True, page=1, per_page=5, @@ -100,7 +100,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.api_gateway.user_schemas.with_raw_response.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -111,7 +111,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.api_gateway.user_schemas.with_streaming_response.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -132,7 +132,7 @@ def test_path_params_list(self, client: Cloudflare) -> None: def test_method_delete(self, client: Cloudflare) -> None: user_schema = client.api_gateway.user_schemas.delete( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(UserSchemaDeleteResponse, user_schema, path=["response"]) @@ -140,7 +140,7 @@ def test_method_delete(self, client: Cloudflare) -> None: def test_raw_response_delete(self, client: Cloudflare) -> None: response = client.api_gateway.user_schemas.with_raw_response.delete( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -152,7 +152,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: def test_streaming_response_delete(self, client: Cloudflare) -> None: with client.api_gateway.user_schemas.with_streaming_response.delete( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -173,14 +173,14 @@ def test_path_params_delete(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `schema_id` but received ''"): client.api_gateway.user_schemas.with_raw_response.delete( schema_id="", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @parametrize def test_method_edit(self, client: Cloudflare) -> None: user_schema = client.api_gateway.user_schemas.edit( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(PublicSchema, user_schema, path=["response"]) @@ -188,7 +188,7 @@ def test_method_edit(self, client: Cloudflare) -> None: def test_method_edit_with_all_params(self, client: Cloudflare) -> None: user_schema = client.api_gateway.user_schemas.edit( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", validation_enabled=True, ) assert_matches_type(PublicSchema, user_schema, path=["response"]) @@ -197,7 +197,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_edit(self, client: Cloudflare) -> None: response = client.api_gateway.user_schemas.with_raw_response.edit( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -209,7 +209,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: def test_streaming_response_edit(self, client: Cloudflare) -> None: with client.api_gateway.user_schemas.with_streaming_response.edit( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -230,14 +230,14 @@ def test_path_params_edit(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `schema_id` but received ''"): client.api_gateway.user_schemas.with_raw_response.edit( schema_id="", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @parametrize def test_method_get(self, client: Cloudflare) -> None: user_schema = client.api_gateway.user_schemas.get( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(PublicSchema, user_schema, path=["response"]) @@ -245,7 +245,7 @@ def test_method_get(self, client: Cloudflare) -> None: def test_method_get_with_all_params(self, client: Cloudflare) -> None: user_schema = client.api_gateway.user_schemas.get( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", omit_source=True, ) assert_matches_type(PublicSchema, user_schema, path=["response"]) @@ -254,7 +254,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_get(self, client: Cloudflare) -> None: response = client.api_gateway.user_schemas.with_raw_response.get( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -266,7 +266,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: def test_streaming_response_get(self, client: Cloudflare) -> None: with client.api_gateway.user_schemas.with_streaming_response.get( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -287,7 +287,7 @@ def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `schema_id` but received ''"): client.api_gateway.user_schemas.with_raw_response.get( schema_id="", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -297,7 +297,7 @@ class TestAsyncUserSchemas: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: user_schema = await async_client.api_gateway.user_schemas.create( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", file=b"raw file contents", kind="openapi_v3", ) @@ -306,7 +306,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: user_schema = await async_client.api_gateway.user_schemas.create( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", file=b"raw file contents", kind="openapi_v3", name="petstore schema", @@ -317,7 +317,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.user_schemas.with_raw_response.create( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", file=b"raw file contents", kind="openapi_v3", ) @@ -330,7 +330,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.user_schemas.with_streaming_response.create( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", file=b"raw file contents", kind="openapi_v3", ) as response: @@ -354,14 +354,14 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: user_schema = await async_client.api_gateway.user_schemas.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(AsyncV4PagePaginationArray[PublicSchema], user_schema, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: user_schema = await async_client.api_gateway.user_schemas.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", omit_source=True, page=1, per_page=5, @@ -372,7 +372,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.user_schemas.with_raw_response.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -383,7 +383,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.user_schemas.with_streaming_response.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -404,7 +404,7 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: async def test_method_delete(self, async_client: AsyncCloudflare) -> None: user_schema = await async_client.api_gateway.user_schemas.delete( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(UserSchemaDeleteResponse, user_schema, path=["response"]) @@ -412,7 +412,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.user_schemas.with_raw_response.delete( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -424,7 +424,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.user_schemas.with_streaming_response.delete( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -445,14 +445,14 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `schema_id` but received ''"): await async_client.api_gateway.user_schemas.with_raw_response.delete( schema_id="", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @parametrize async def test_method_edit(self, async_client: AsyncCloudflare) -> None: user_schema = await async_client.api_gateway.user_schemas.edit( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(PublicSchema, user_schema, path=["response"]) @@ -460,7 +460,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: user_schema = await async_client.api_gateway.user_schemas.edit( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", validation_enabled=True, ) assert_matches_type(PublicSchema, user_schema, path=["response"]) @@ -469,7 +469,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.user_schemas.with_raw_response.edit( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -481,7 +481,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.user_schemas.with_streaming_response.edit( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -502,14 +502,14 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `schema_id` but received ''"): await async_client.api_gateway.user_schemas.with_raw_response.edit( schema_id="", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: user_schema = await async_client.api_gateway.user_schemas.get( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(PublicSchema, user_schema, path=["response"]) @@ -517,7 +517,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: user_schema = await async_client.api_gateway.user_schemas.get( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", omit_source=True, ) assert_matches_type(PublicSchema, user_schema, path=["response"]) @@ -526,7 +526,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.user_schemas.with_raw_response.get( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -538,7 +538,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.user_schemas.with_streaming_response.get( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -559,5 +559,5 @@ async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `schema_id` but received ''"): await async_client.api_gateway.user_schemas.with_raw_response.get( schema_id="", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/api_gateway/user_schemas/test_hosts.py b/tests/api_resources/api_gateway/user_schemas/test_hosts.py index 4df913398c7..6b9b80c5228 100644 --- a/tests/api_resources/api_gateway/user_schemas/test_hosts.py +++ b/tests/api_resources/api_gateway/user_schemas/test_hosts.py @@ -21,14 +21,14 @@ class TestHosts: @parametrize def test_method_list(self, client: Cloudflare) -> None: host = client.api_gateway.user_schemas.hosts.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(SyncV4PagePaginationArray[HostListResponse], host, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: host = client.api_gateway.user_schemas.hosts.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", page=1, per_page=5, ) @@ -37,7 +37,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.api_gateway.user_schemas.hosts.with_raw_response.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -48,7 +48,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.api_gateway.user_schemas.hosts.with_streaming_response.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -72,14 +72,14 @@ class TestAsyncHosts: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: host = await async_client.api_gateway.user_schemas.hosts.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(AsyncV4PagePaginationArray[HostListResponse], host, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: host = await async_client.api_gateway.user_schemas.hosts.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", page=1, per_page=5, ) @@ -88,7 +88,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.user_schemas.hosts.with_raw_response.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -99,7 +99,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.user_schemas.hosts.with_streaming_response.list( - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/api_gateway/user_schemas/test_operations.py b/tests/api_resources/api_gateway/user_schemas/test_operations.py index 1d94342c5b2..64234507893 100644 --- a/tests/api_resources/api_gateway/user_schemas/test_operations.py +++ b/tests/api_resources/api_gateway/user_schemas/test_operations.py @@ -22,7 +22,7 @@ class TestOperations: def test_method_list(self, client: Cloudflare) -> None: operation = client.api_gateway.user_schemas.operations.list( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(SyncV4PagePaginationArray[OperationListResponse], operation, path=["response"]) @@ -30,7 +30,7 @@ def test_method_list(self, client: Cloudflare) -> None: def test_method_list_with_all_params(self, client: Cloudflare) -> None: operation = client.api_gateway.user_schemas.operations.list( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", endpoint="/api/v1", feature=["thresholds"], host=["api.cloudflare.com"], @@ -45,7 +45,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_list(self, client: Cloudflare) -> None: response = client.api_gateway.user_schemas.operations.with_raw_response.list( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -57,7 +57,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: def test_streaming_response_list(self, client: Cloudflare) -> None: with client.api_gateway.user_schemas.operations.with_streaming_response.list( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -78,7 +78,7 @@ def test_path_params_list(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `schema_id` but received ''"): client.api_gateway.user_schemas.operations.with_raw_response.list( schema_id="", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -89,7 +89,7 @@ class TestAsyncOperations: async def test_method_list(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.user_schemas.operations.list( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(AsyncV4PagePaginationArray[OperationListResponse], operation, path=["response"]) @@ -97,7 +97,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: operation = await async_client.api_gateway.user_schemas.operations.list( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", endpoint="/api/v1", feature=["thresholds"], host=["api.cloudflare.com"], @@ -112,7 +112,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.api_gateway.user_schemas.operations.with_raw_response.list( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True @@ -124,7 +124,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.api_gateway.user_schemas.operations.with_streaming_response.list( schema_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -145,5 +145,5 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `schema_id` but received ''"): await async_client.api_gateway.user_schemas.operations.with_raw_response.list( schema_id="", - zone_id="zone_id", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/content_scanning/test_payloads.py b/tests/api_resources/content_scanning/test_payloads.py index 6f45fb1bc6b..3c3be9c5537 100644 --- a/tests/api_resources/content_scanning/test_payloads.py +++ b/tests/api_resources/content_scanning/test_payloads.py @@ -105,7 +105,7 @@ def test_path_params_list(self, client: Cloudflare) -> None: @parametrize def test_method_delete(self, client: Cloudflare) -> None: payload = client.content_scanning.payloads.delete( - expression_id="023e105f4ecef8ad9ca31a8372d0c353", + expression_id="a350a054caa840c9becd89c3b4f0195b", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(SyncSinglePage[PayloadDeleteResponse], payload, path=["response"]) @@ -113,7 +113,7 @@ def test_method_delete(self, client: Cloudflare) -> None: @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: response = client.content_scanning.payloads.with_raw_response.delete( - expression_id="023e105f4ecef8ad9ca31a8372d0c353", + expression_id="a350a054caa840c9becd89c3b4f0195b", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -125,7 +125,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: with client.content_scanning.payloads.with_streaming_response.delete( - expression_id="023e105f4ecef8ad9ca31a8372d0c353", + expression_id="a350a054caa840c9becd89c3b4f0195b", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed @@ -140,7 +140,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: def test_path_params_delete(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.content_scanning.payloads.with_raw_response.delete( - expression_id="023e105f4ecef8ad9ca31a8372d0c353", + expression_id="a350a054caa840c9becd89c3b4f0195b", zone_id="", ) @@ -237,7 +237,7 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_delete(self, async_client: AsyncCloudflare) -> None: payload = await async_client.content_scanning.payloads.delete( - expression_id="023e105f4ecef8ad9ca31a8372d0c353", + expression_id="a350a054caa840c9becd89c3b4f0195b", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(AsyncSinglePage[PayloadDeleteResponse], payload, path=["response"]) @@ -245,7 +245,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: response = await async_client.content_scanning.payloads.with_raw_response.delete( - expression_id="023e105f4ecef8ad9ca31a8372d0c353", + expression_id="a350a054caa840c9becd89c3b4f0195b", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -257,7 +257,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: async with async_client.content_scanning.payloads.with_streaming_response.delete( - expression_id="023e105f4ecef8ad9ca31a8372d0c353", + expression_id="a350a054caa840c9becd89c3b4f0195b", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed @@ -272,7 +272,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.content_scanning.payloads.with_raw_response.delete( - expression_id="023e105f4ecef8ad9ca31a8372d0c353", + expression_id="a350a054caa840c9becd89c3b4f0195b", zone_id="", ) diff --git a/tests/api_resources/dns/settings/test_views.py b/tests/api_resources/dns/settings/test_views.py index 63b070ea910..3187e65af01 100644 --- a/tests/api_resources/dns/settings/test_views.py +++ b/tests/api_resources/dns/settings/test_views.py @@ -26,13 +26,6 @@ class TestViews: @parametrize def test_method_create(self, client: Cloudflare) -> None: - view = client.dns.settings.views.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[ViewCreateResponse], view, path=["response"]) - - @parametrize - def test_method_create_with_all_params(self, client: Cloudflare) -> None: view = client.dns.settings.views.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", name="my view", @@ -44,6 +37,8 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_create(self, client: Cloudflare) -> None: response = client.dns.settings.views.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", + name="my view", + zones=["372e67954025e0ba6aaa6d586b9e0b59"], ) assert response.is_closed is True @@ -55,6 +50,8 @@ def test_raw_response_create(self, client: Cloudflare) -> None: def test_streaming_response_create(self, client: Cloudflare) -> None: with client.dns.settings.views.with_streaming_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", + name="my view", + zones=["372e67954025e0ba6aaa6d586b9e0b59"], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -69,6 +66,8 @@ def test_path_params_create(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.dns.settings.views.with_raw_response.create( account_id="", + name="my view", + zones=["372e67954025e0ba6aaa6d586b9e0b59"], ) @parametrize @@ -289,13 +288,6 @@ class TestAsyncViews: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: - view = await async_client.dns.settings.views.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[ViewCreateResponse], view, path=["response"]) - - @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: view = await async_client.dns.settings.views.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", name="my view", @@ -307,6 +299,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns.settings.views.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", + name="my view", + zones=["372e67954025e0ba6aaa6d586b9e0b59"], ) assert response.is_closed is True @@ -318,6 +312,8 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.dns.settings.views.with_streaming_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", + name="my view", + zones=["372e67954025e0ba6aaa6d586b9e0b59"], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -332,6 +328,8 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.dns.settings.views.with_raw_response.create( account_id="", + name="my view", + zones=["372e67954025e0ba6aaa6d586b9e0b59"], ) @parametrize diff --git a/tests/api_resources/dns/test_records.py b/tests/api_resources/dns/test_records.py index df70f04e7bf..d66e3f1af77 100644 --- a/tests/api_resources/dns/test_records.py +++ b/tests/api_resources/dns/test_records.py @@ -3110,9 +3110,53 @@ def test_method_batch_with_all_params(self, client: Cloudflare) -> None: record = client.dns.records.batch( zone_id="023e105f4ecef8ad9ca31a8372d0c353", deletes=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], - patches=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], - posts=[{}], - puts=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + patches=[ + { + "comment": "Domain verification record", + "content": "198.51.100.4", + "name": "example.com", + "proxied": True, + "settings": { + "ipv4_only": True, + "ipv6_only": True, + }, + "tags": ["owner:dns-team"], + "ttl": 3600, + "type": "A", + "id": "023e105f4ecef8ad9ca31a8372d0c353", + } + ], + posts=[ + { + "comment": "Domain verification record", + "content": "198.51.100.4", + "name": "example.com", + "proxied": True, + "settings": { + "ipv4_only": True, + "ipv6_only": True, + }, + "tags": ["owner:dns-team"], + "ttl": 3600, + "type": "A", + } + ], + puts=[ + { + "comment": "Domain verification record", + "content": "198.51.100.4", + "name": "example.com", + "proxied": True, + "settings": { + "ipv4_only": True, + "ipv6_only": True, + }, + "tags": ["owner:dns-team"], + "ttl": 3600, + "type": "A", + "id": "023e105f4ecef8ad9ca31a8372d0c353", + } + ], ) assert_matches_type(Optional[RecordBatchResponse], record, path=["response"]) @@ -8012,9 +8056,53 @@ async def test_method_batch_with_all_params(self, async_client: AsyncCloudflare) record = await async_client.dns.records.batch( zone_id="023e105f4ecef8ad9ca31a8372d0c353", deletes=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], - patches=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], - posts=[{}], - puts=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + patches=[ + { + "comment": "Domain verification record", + "content": "198.51.100.4", + "name": "example.com", + "proxied": True, + "settings": { + "ipv4_only": True, + "ipv6_only": True, + }, + "tags": ["owner:dns-team"], + "ttl": 3600, + "type": "A", + "id": "023e105f4ecef8ad9ca31a8372d0c353", + } + ], + posts=[ + { + "comment": "Domain verification record", + "content": "198.51.100.4", + "name": "example.com", + "proxied": True, + "settings": { + "ipv4_only": True, + "ipv6_only": True, + }, + "tags": ["owner:dns-team"], + "ttl": 3600, + "type": "A", + } + ], + puts=[ + { + "comment": "Domain verification record", + "content": "198.51.100.4", + "name": "example.com", + "proxied": True, + "settings": { + "ipv4_only": True, + "ipv6_only": True, + }, + "tags": ["owner:dns-team"], + "ttl": 3600, + "type": "A", + "id": "023e105f4ecef8ad9ca31a8372d0c353", + } + ], ) assert_matches_type(Optional[RecordBatchResponse], record, path=["response"]) diff --git a/tests/api_resources/email_routing/test_dns.py b/tests/api_resources/email_routing/test_dns.py index 08de0686942..a4c80ef0659 100644 --- a/tests/api_resources/email_routing/test_dns.py +++ b/tests/api_resources/email_routing/test_dns.py @@ -3,14 +3,18 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.email_routing import DNSRecord, DNSGetResponse +from cloudflare.types.email_routing import ( + Settings, + DNSRecord, + DNSGetResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +28,7 @@ def test_method_create(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", name="example.net", ) - assert_matches_type(object, dns, path=["response"]) + assert_matches_type(Optional[Settings], dns, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -36,7 +40,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" dns = response.parse() - assert_matches_type(object, dns, path=["response"]) + assert_matches_type(Optional[Settings], dns, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -48,7 +52,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" dns = response.parse() - assert_matches_type(object, dns, path=["response"]) + assert_matches_type(Optional[Settings], dns, path=["response"]) assert cast(Any, response.is_closed) is True @@ -104,7 +108,7 @@ def test_method_edit(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", name="example.net", ) - assert_matches_type(object, dns, path=["response"]) + assert_matches_type(Optional[Settings], dns, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: @@ -116,7 +120,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" dns = response.parse() - assert_matches_type(object, dns, path=["response"]) + assert_matches_type(Optional[Settings], dns, path=["response"]) @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: @@ -128,7 +132,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" dns = response.parse() - assert_matches_type(object, dns, path=["response"]) + assert_matches_type(Optional[Settings], dns, path=["response"]) assert cast(Any, response.is_closed) is True @@ -196,7 +200,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", name="example.net", ) - assert_matches_type(object, dns, path=["response"]) + assert_matches_type(Optional[Settings], dns, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -208,7 +212,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" dns = await response.parse() - assert_matches_type(object, dns, path=["response"]) + assert_matches_type(Optional[Settings], dns, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -220,7 +224,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" dns = await response.parse() - assert_matches_type(object, dns, path=["response"]) + assert_matches_type(Optional[Settings], dns, path=["response"]) assert cast(Any, response.is_closed) is True @@ -276,7 +280,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", name="example.net", ) - assert_matches_type(object, dns, path=["response"]) + assert_matches_type(Optional[Settings], dns, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -288,7 +292,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" dns = await response.parse() - assert_matches_type(object, dns, path=["response"]) + assert_matches_type(Optional[Settings], dns, path=["response"]) @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -300,7 +304,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" dns = await response.parse() - assert_matches_type(object, dns, path=["response"]) + assert_matches_type(Optional[Settings], dns, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/email_routing/test_rules.py b/tests/api_resources/email_routing/test_rules.py index b622f43e98b..a95fc1387d4 100644 --- a/tests/api_resources/email_routing/test_rules.py +++ b/tests/api_resources/email_routing/test_rules.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -36,7 +36,7 @@ def test_method_create(self, client: Cloudflare) -> None: } ], ) - assert_matches_type(object, rule, path=["response"]) + assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: @@ -59,7 +59,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: name="Send to user@example.net rule.", priority=0, ) - assert_matches_type(object, rule, path=["response"]) + assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -83,7 +83,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(object, rule, path=["response"]) + assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -107,7 +107,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(object, rule, path=["response"]) + assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -150,7 +150,7 @@ def test_method_update(self, client: Cloudflare) -> None: } ], ) - assert_matches_type(object, rule, path=["response"]) + assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Cloudflare) -> None: @@ -174,7 +174,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: name="Send to user@example.net rule.", priority=0, ) - assert_matches_type(object, rule, path=["response"]) + assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: @@ -199,7 +199,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(object, rule, path=["response"]) + assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: @@ -224,7 +224,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(object, rule, path=["response"]) + assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -322,7 +322,7 @@ def test_method_delete(self, client: Cloudflare) -> None: rule_identifier="a7e6fb77503c41d8a7f3113c6918f10c", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(object, rule, path=["response"]) + assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -334,7 +334,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(object, rule, path=["response"]) + assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -346,7 +346,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(object, rule, path=["response"]) + assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -370,7 +370,7 @@ def test_method_get(self, client: Cloudflare) -> None: rule_identifier="a7e6fb77503c41d8a7f3113c6918f10c", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(object, rule, path=["response"]) + assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -382,7 +382,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(object, rule, path=["response"]) + assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -394,7 +394,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(object, rule, path=["response"]) + assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -434,7 +434,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: } ], ) - assert_matches_type(object, rule, path=["response"]) + assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -457,7 +457,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare name="Send to user@example.net rule.", priority=0, ) - assert_matches_type(object, rule, path=["response"]) + assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -481,7 +481,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(object, rule, path=["response"]) + assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -505,7 +505,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(object, rule, path=["response"]) + assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -548,7 +548,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: } ], ) - assert_matches_type(object, rule, path=["response"]) + assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -572,7 +572,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare name="Send to user@example.net rule.", priority=0, ) - assert_matches_type(object, rule, path=["response"]) + assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @@ -597,7 +597,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(object, rule, path=["response"]) + assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: @@ -622,7 +622,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(object, rule, path=["response"]) + assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -720,7 +720,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: rule_identifier="a7e6fb77503c41d8a7f3113c6918f10c", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(object, rule, path=["response"]) + assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -732,7 +732,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(object, rule, path=["response"]) + assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -744,7 +744,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(object, rule, path=["response"]) + assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -768,7 +768,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: rule_identifier="a7e6fb77503c41d8a7f3113c6918f10c", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(object, rule, path=["response"]) + assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -780,7 +780,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(object, rule, path=["response"]) + assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -792,7 +792,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(object, rule, path=["response"]) + assert_matches_type(Optional[EmailRoutingRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/firewall/test_ua_rules.py b/tests/api_resources/firewall/test_ua_rules.py index 8f9552e1363..4dae57f296b 100644 --- a/tests/api_resources/firewall/test_ua_rules.py +++ b/tests/api_resources/firewall/test_ua_rules.py @@ -12,6 +12,7 @@ from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from cloudflare.types.firewall import ( UARuleGetResponse, + UARuleListResponse, UARuleCreateResponse, UARuleDeleteResponse, UARuleUpdateResponse, @@ -167,7 +168,7 @@ def test_method_list(self, client: Cloudflare) -> None: ua_rule = client.firewall.ua_rules.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncV4PagePaginationArray[object], ua_rule, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[UARuleListResponse], ua_rule, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: @@ -179,7 +180,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: per_page=1, ua_search="Safari", ) - assert_matches_type(SyncV4PagePaginationArray[object], ua_rule, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[UARuleListResponse], ua_rule, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: @@ -190,7 +191,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ua_rule = response.parse() - assert_matches_type(SyncV4PagePaginationArray[object], ua_rule, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[UARuleListResponse], ua_rule, path=["response"]) @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: @@ -201,7 +202,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ua_rule = response.parse() - assert_matches_type(SyncV4PagePaginationArray[object], ua_rule, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[UARuleListResponse], ua_rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -456,7 +457,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: ua_rule = await async_client.firewall.ua_rules.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncV4PagePaginationArray[object], ua_rule, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[UARuleListResponse], ua_rule, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -468,7 +469,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) per_page=1, ua_search="Safari", ) - assert_matches_type(AsyncV4PagePaginationArray[object], ua_rule, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[UARuleListResponse], ua_rule, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @@ -479,7 +480,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ua_rule = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[object], ua_rule, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[UARuleListResponse], ua_rule, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: @@ -490,7 +491,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" ua_rule = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[object], ua_rule, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[UARuleListResponse], ua_rule, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/hyperdrive/test_configs.py b/tests/api_resources/hyperdrive/test_configs.py index a956e3b3240..1eca48b91d3 100644 --- a/tests/api_resources/hyperdrive/test_configs.py +++ b/tests/api_resources/hyperdrive/test_configs.py @@ -55,11 +55,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "scheme": "postgres", "user": "postgres", }, - caching={ - "disabled": True, - "max_age": 60, - "stale_while_revalidate": 15, - }, + caching={"disabled": True}, ) assert_matches_type(ConfigCreateResponse, config, path=["response"]) @@ -157,11 +153,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "scheme": "postgres", "user": "postgres", }, - caching={ - "disabled": True, - "max_age": 60, - "stale_while_revalidate": 15, - }, + caching={"disabled": True}, ) assert_matches_type(ConfigUpdateResponse, config, path=["response"]) @@ -345,11 +337,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: config = client.hyperdrive.configs.edit( hyperdrive_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", - caching={ - "disabled": True, - "max_age": 60, - "stale_while_revalidate": 15, - }, + caching={"disabled": True}, name="example-hyperdrive", origin={ "database": "postgres", @@ -485,11 +473,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "scheme": "postgres", "user": "postgres", }, - caching={ - "disabled": True, - "max_age": 60, - "stale_while_revalidate": 15, - }, + caching={"disabled": True}, ) assert_matches_type(ConfigCreateResponse, config, path=["response"]) @@ -587,11 +571,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "scheme": "postgres", "user": "postgres", }, - caching={ - "disabled": True, - "max_age": 60, - "stale_while_revalidate": 15, - }, + caching={"disabled": True}, ) assert_matches_type(ConfigUpdateResponse, config, path=["response"]) @@ -775,11 +755,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) config = await async_client.hyperdrive.configs.edit( hyperdrive_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", - caching={ - "disabled": True, - "max_age": 60, - "stale_while_revalidate": 15, - }, + caching={"disabled": True}, name="example-hyperdrive", origin={ "database": "postgres", diff --git a/tests/api_resources/leaked_credential_checks/test_detections.py b/tests/api_resources/leaked_credential_checks/test_detections.py index 2be12eecff7..c74c2b245cc 100644 --- a/tests/api_resources/leaked_credential_checks/test_detections.py +++ b/tests/api_resources/leaked_credential_checks/test_detections.py @@ -33,7 +33,6 @@ def test_method_create(self, client: Cloudflare) -> None: def test_method_create_with_all_params(self, client: Cloudflare) -> None: detection = client.leaked_credential_checks.detections.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="18a14bafaa8eb1df04ce683ec18c765e", password='lookup_json_string(http.request.body.raw, "secret")', username='lookup_json_string(http.request.body.raw, "user")', ) @@ -73,7 +72,7 @@ def test_path_params_create(self, client: Cloudflare) -> None: @parametrize def test_method_update(self, client: Cloudflare) -> None: detection = client.leaked_credential_checks.detections.update( - detection_id="023e105f4ecef8ad9ca31a8372d0c353", + detection_id="18a14bafaa8eb1df04ce683ec18c765e", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(DetectionUpdateResponse, detection, path=["response"]) @@ -81,9 +80,8 @@ def test_method_update(self, client: Cloudflare) -> None: @parametrize def test_method_update_with_all_params(self, client: Cloudflare) -> None: detection = client.leaked_credential_checks.detections.update( - detection_id="023e105f4ecef8ad9ca31a8372d0c353", + detection_id="18a14bafaa8eb1df04ce683ec18c765e", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="18a14bafaa8eb1df04ce683ec18c765e", password='lookup_json_string(http.request.body.raw, "secret")', username='lookup_json_string(http.request.body.raw, "user")', ) @@ -92,7 +90,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: response = client.leaked_credential_checks.detections.with_raw_response.update( - detection_id="023e105f4ecef8ad9ca31a8372d0c353", + detection_id="18a14bafaa8eb1df04ce683ec18c765e", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -104,7 +102,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: with client.leaked_credential_checks.detections.with_streaming_response.update( - detection_id="023e105f4ecef8ad9ca31a8372d0c353", + detection_id="18a14bafaa8eb1df04ce683ec18c765e", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed @@ -119,7 +117,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.leaked_credential_checks.detections.with_raw_response.update( - detection_id="023e105f4ecef8ad9ca31a8372d0c353", + detection_id="18a14bafaa8eb1df04ce683ec18c765e", zone_id="", ) @@ -170,7 +168,7 @@ def test_path_params_list(self, client: Cloudflare) -> None: @parametrize def test_method_delete(self, client: Cloudflare) -> None: detection = client.leaked_credential_checks.detections.delete( - detection_id="023e105f4ecef8ad9ca31a8372d0c353", + detection_id="18a14bafaa8eb1df04ce683ec18c765e", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(object, detection, path=["response"]) @@ -178,7 +176,7 @@ def test_method_delete(self, client: Cloudflare) -> None: @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: response = client.leaked_credential_checks.detections.with_raw_response.delete( - detection_id="023e105f4ecef8ad9ca31a8372d0c353", + detection_id="18a14bafaa8eb1df04ce683ec18c765e", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -190,7 +188,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: with client.leaked_credential_checks.detections.with_streaming_response.delete( - detection_id="023e105f4ecef8ad9ca31a8372d0c353", + detection_id="18a14bafaa8eb1df04ce683ec18c765e", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed @@ -205,7 +203,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: def test_path_params_delete(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.leaked_credential_checks.detections.with_raw_response.delete( - detection_id="023e105f4ecef8ad9ca31a8372d0c353", + detection_id="18a14bafaa8eb1df04ce683ec18c765e", zone_id="", ) @@ -230,7 +228,6 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: detection = await async_client.leaked_credential_checks.detections.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="18a14bafaa8eb1df04ce683ec18c765e", password='lookup_json_string(http.request.body.raw, "secret")', username='lookup_json_string(http.request.body.raw, "user")', ) @@ -270,7 +267,7 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_update(self, async_client: AsyncCloudflare) -> None: detection = await async_client.leaked_credential_checks.detections.update( - detection_id="023e105f4ecef8ad9ca31a8372d0c353", + detection_id="18a14bafaa8eb1df04ce683ec18c765e", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(DetectionUpdateResponse, detection, path=["response"]) @@ -278,9 +275,8 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: detection = await async_client.leaked_credential_checks.detections.update( - detection_id="023e105f4ecef8ad9ca31a8372d0c353", + detection_id="18a14bafaa8eb1df04ce683ec18c765e", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="18a14bafaa8eb1df04ce683ec18c765e", password='lookup_json_string(http.request.body.raw, "secret")', username='lookup_json_string(http.request.body.raw, "user")', ) @@ -289,7 +285,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.leaked_credential_checks.detections.with_raw_response.update( - detection_id="023e105f4ecef8ad9ca31a8372d0c353", + detection_id="18a14bafaa8eb1df04ce683ec18c765e", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -301,7 +297,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.leaked_credential_checks.detections.with_streaming_response.update( - detection_id="023e105f4ecef8ad9ca31a8372d0c353", + detection_id="18a14bafaa8eb1df04ce683ec18c765e", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed @@ -316,7 +312,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.leaked_credential_checks.detections.with_raw_response.update( - detection_id="023e105f4ecef8ad9ca31a8372d0c353", + detection_id="18a14bafaa8eb1df04ce683ec18c765e", zone_id="", ) @@ -367,7 +363,7 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_delete(self, async_client: AsyncCloudflare) -> None: detection = await async_client.leaked_credential_checks.detections.delete( - detection_id="023e105f4ecef8ad9ca31a8372d0c353", + detection_id="18a14bafaa8eb1df04ce683ec18c765e", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(object, detection, path=["response"]) @@ -375,7 +371,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: response = await async_client.leaked_credential_checks.detections.with_raw_response.delete( - detection_id="023e105f4ecef8ad9ca31a8372d0c353", + detection_id="18a14bafaa8eb1df04ce683ec18c765e", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -387,7 +383,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: async with async_client.leaked_credential_checks.detections.with_streaming_response.delete( - detection_id="023e105f4ecef8ad9ca31a8372d0c353", + detection_id="18a14bafaa8eb1df04ce683ec18c765e", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed @@ -402,7 +398,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.leaked_credential_checks.detections.with_raw_response.delete( - detection_id="023e105f4ecef8ad9ca31a8372d0c353", + detection_id="18a14bafaa8eb1df04ce683ec18c765e", zone_id="", ) diff --git a/tests/api_resources/pages/test_projects.py b/tests/api_resources/pages/test_projects.py index a6aef5f74c7..5d079787554 100644 --- a/tests/api_resources/pages/test_projects.py +++ b/tests/api_resources/pages/test_projects.py @@ -294,10 +294,18 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: "d1_databases": {"D1_BINDING": {"id": "445e2955-951a-43f8-a35b-a4d0c8138f63"}}, "durable_object_namespaces": {"DO_BINDING": {"namespace_id": "5eb63bbbe01eeed093cb22bb8f5acdc3"}}, "env_vars": { - "foo": { - "value": "hello world", + "BUILD_VERSION": { + "value": "3.3", "type": "plain_text", - } + }, + "delete_this_env_var": { + "value": "value", + "type": "plain_text", + }, + "secret_var": { + "value": "A_CMS_API_TOKEN", + "type": "plain_text", + }, }, "hyperdrive_bindings": {"HYPERDRIVE": {"id": "a76a99bc342644deb02c38d66082262a"}}, "kv_namespaces": {"KV_BINDING": {"namespace_id": "5eb63bbbe01eeed093cb22bb8f5acdc3"}}, @@ -741,10 +749,18 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) "d1_databases": {"D1_BINDING": {"id": "445e2955-951a-43f8-a35b-a4d0c8138f63"}}, "durable_object_namespaces": {"DO_BINDING": {"namespace_id": "5eb63bbbe01eeed093cb22bb8f5acdc3"}}, "env_vars": { - "foo": { - "value": "hello world", + "BUILD_VERSION": { + "value": "3.3", "type": "plain_text", - } + }, + "delete_this_env_var": { + "value": "value", + "type": "plain_text", + }, + "secret_var": { + "value": "A_CMS_API_TOKEN", + "type": "plain_text", + }, }, "hyperdrive_bindings": {"HYPERDRIVE": {"id": "a76a99bc342644deb02c38d66082262a"}}, "kv_namespaces": {"KV_BINDING": {"namespace_id": "5eb63bbbe01eeed093cb22bb8f5acdc3"}}, diff --git a/tests/api_resources/registrar/test_domains.py b/tests/api_resources/registrar/test_domains.py index a89cca75394..ebd7b48b403 100644 --- a/tests/api_resources/registrar/test_domains.py +++ b/tests/api_resources/registrar/test_domains.py @@ -10,6 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.registrar import Domain base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -81,7 +82,7 @@ def test_method_list(self, client: Cloudflare) -> None: domain = client.registrar.domains.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[object], domain, path=["response"]) + assert_matches_type(SyncSinglePage[Domain], domain, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: @@ -92,7 +93,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" domain = response.parse() - assert_matches_type(SyncSinglePage[object], domain, path=["response"]) + assert_matches_type(SyncSinglePage[Domain], domain, path=["response"]) @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: @@ -103,7 +104,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" domain = response.parse() - assert_matches_type(SyncSinglePage[object], domain, path=["response"]) + assert_matches_type(SyncSinglePage[Domain], domain, path=["response"]) assert cast(Any, response.is_closed) is True @@ -230,7 +231,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: domain = await async_client.registrar.domains.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[object], domain, path=["response"]) + assert_matches_type(AsyncSinglePage[Domain], domain, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @@ -241,7 +242,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" domain = await response.parse() - assert_matches_type(AsyncSinglePage[object], domain, path=["response"]) + assert_matches_type(AsyncSinglePage[Domain], domain, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: @@ -252,7 +253,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" domain = await response.parse() - assert_matches_type(AsyncSinglePage[object], domain, path=["response"]) + assert_matches_type(AsyncSinglePage[Domain], domain, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/spectrum/test_apps.py b/tests/api_resources/spectrum/test_apps.py index 406363c48d8..4cd829fd660 100644 --- a/tests/api_resources/spectrum/test_apps.py +++ b/tests/api_resources/spectrum/test_apps.py @@ -124,7 +124,6 @@ def test_path_params_create_overload_1(self, client: Cloudflare) -> None: def test_method_create_overload_2(self, client: Cloudflare) -> None: app = client.spectrum.apps.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) @@ -135,7 +134,6 @@ def test_method_create_overload_2(self, client: Cloudflare) -> None: def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> None: app = client.spectrum.apps.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="023e105f4ecef8ad9ca31a8372d0c353", dns={ "name": "ssh.example.com", "type": "CNAME", @@ -150,7 +148,6 @@ def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> N def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: response = client.spectrum.apps.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) @@ -165,7 +162,6 @@ def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: with client.spectrum.apps.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) as response: @@ -183,7 +179,6 @@ def test_path_params_create_overload_2(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.spectrum.apps.with_raw_response.create( zone_id="", - id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) @@ -306,7 +301,6 @@ def test_method_update_overload_2(self, client: Cloudflare) -> None: app = client.spectrum.apps.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) @@ -318,7 +312,6 @@ def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> N app = client.spectrum.apps.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="023e105f4ecef8ad9ca31a8372d0c353", dns={ "name": "ssh.example.com", "type": "CNAME", @@ -334,7 +327,6 @@ def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: response = client.spectrum.apps.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) @@ -350,7 +342,6 @@ def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: with client.spectrum.apps.with_streaming_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) as response: @@ -369,7 +360,6 @@ def test_path_params_update_overload_2(self, client: Cloudflare) -> None: client.spectrum.apps.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", - id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) @@ -378,7 +368,6 @@ def test_path_params_update_overload_2(self, client: Cloudflare) -> None: client.spectrum.apps.with_raw_response.update( app_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) @@ -637,7 +626,6 @@ async def test_path_params_create_overload_1(self, async_client: AsyncCloudflare async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> None: app = await async_client.spectrum.apps.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) @@ -648,7 +636,6 @@ async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> async def test_method_create_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: app = await async_client.spectrum.apps.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="023e105f4ecef8ad9ca31a8372d0c353", dns={ "name": "ssh.example.com", "type": "CNAME", @@ -663,7 +650,6 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: response = await async_client.spectrum.apps.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) @@ -678,7 +664,6 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflar async def test_streaming_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: async with async_client.spectrum.apps.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) as response: @@ -696,7 +681,6 @@ async def test_path_params_create_overload_2(self, async_client: AsyncCloudflare with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.spectrum.apps.with_raw_response.create( zone_id="", - id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) @@ -819,7 +803,6 @@ async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> app = await async_client.spectrum.apps.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) @@ -831,7 +814,6 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn app = await async_client.spectrum.apps.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="023e105f4ecef8ad9ca31a8372d0c353", dns={ "name": "ssh.example.com", "type": "CNAME", @@ -847,7 +829,6 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflar response = await async_client.spectrum.apps.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) @@ -863,7 +844,6 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncClo async with async_client.spectrum.apps.with_streaming_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) as response: @@ -882,7 +862,6 @@ async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare await async_client.spectrum.apps.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", - id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) @@ -891,7 +870,6 @@ async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare await async_client.spectrum.apps.with_raw_response.update( app_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="023e105f4ecef8ad9ca31a8372d0c353", dns={}, protocol="tcp/22", ) diff --git a/tests/api_resources/test_dns_firewall.py b/tests/api_resources/test_dns_firewall.py index 8418d862c4a..c97f5b3c417 100644 --- a/tests/api_resources/test_dns_firewall.py +++ b/tests/api_resources/test_dns_firewall.py @@ -29,6 +29,8 @@ class TestDNSFirewall: def test_method_create(self, client: Cloudflare) -> None: dns_firewall = client.dns_firewall.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", + name="My Awesome DNS Firewall cluster", + upstream_ips=["192.0.2.1", "198.51.100.1", "2001:DB8:100::CF"], ) assert_matches_type(Optional[DNSFirewallCreateResponse], dns_firewall, path=["response"]) @@ -37,6 +39,8 @@ def test_method_create(self, client: Cloudflare) -> None: def test_method_create_with_all_params(self, client: Cloudflare) -> None: dns_firewall = client.dns_firewall.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", + name="My Awesome DNS Firewall cluster", + upstream_ips=["192.0.2.1", "198.51.100.1", "2001:DB8:100::CF"], attack_mitigation={ "enabled": True, "only_when_upstream_unhealthy": False, @@ -45,11 +49,9 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: ecs_fallback=False, maximum_cache_ttl=900, minimum_cache_ttl=60, - name="My Awesome DNS Firewall cluster", negative_cache_ttl=900, ratelimit=600, retries=2, - upstream_ips=["192.0.2.1", "198.51.100.1", "2001:DB8:100::CF"], ) assert_matches_type(Optional[DNSFirewallCreateResponse], dns_firewall, path=["response"]) @@ -58,6 +60,8 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_create(self, client: Cloudflare) -> None: response = client.dns_firewall.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", + name="My Awesome DNS Firewall cluster", + upstream_ips=["192.0.2.1", "198.51.100.1", "2001:DB8:100::CF"], ) assert response.is_closed is True @@ -70,6 +74,8 @@ def test_raw_response_create(self, client: Cloudflare) -> None: def test_streaming_response_create(self, client: Cloudflare) -> None: with client.dns_firewall.with_streaming_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", + name="My Awesome DNS Firewall cluster", + upstream_ips=["192.0.2.1", "198.51.100.1", "2001:DB8:100::CF"], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -85,6 +91,8 @@ def test_path_params_create(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.dns_firewall.with_raw_response.create( account_id="", + name="My Awesome DNS Firewall cluster", + upstream_ips=["192.0.2.1", "198.51.100.1", "2001:DB8:100::CF"], ) @parametrize @@ -313,6 +321,8 @@ class TestAsyncDNSFirewall: async def test_method_create(self, async_client: AsyncCloudflare) -> None: dns_firewall = await async_client.dns_firewall.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", + name="My Awesome DNS Firewall cluster", + upstream_ips=["192.0.2.1", "198.51.100.1", "2001:DB8:100::CF"], ) assert_matches_type(Optional[DNSFirewallCreateResponse], dns_firewall, path=["response"]) @@ -321,6 +331,8 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: dns_firewall = await async_client.dns_firewall.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", + name="My Awesome DNS Firewall cluster", + upstream_ips=["192.0.2.1", "198.51.100.1", "2001:DB8:100::CF"], attack_mitigation={ "enabled": True, "only_when_upstream_unhealthy": False, @@ -329,11 +341,9 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare ecs_fallback=False, maximum_cache_ttl=900, minimum_cache_ttl=60, - name="My Awesome DNS Firewall cluster", negative_cache_ttl=900, ratelimit=600, retries=2, - upstream_ips=["192.0.2.1", "198.51.100.1", "2001:DB8:100::CF"], ) assert_matches_type(Optional[DNSFirewallCreateResponse], dns_firewall, path=["response"]) @@ -342,6 +352,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns_firewall.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", + name="My Awesome DNS Firewall cluster", + upstream_ips=["192.0.2.1", "198.51.100.1", "2001:DB8:100::CF"], ) assert response.is_closed is True @@ -354,6 +366,8 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.dns_firewall.with_streaming_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", + name="My Awesome DNS Firewall cluster", + upstream_ips=["192.0.2.1", "198.51.100.1", "2001:DB8:100::CF"], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -369,6 +383,8 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.dns_firewall.with_raw_response.create( account_id="", + name="My Awesome DNS Firewall cluster", + upstream_ips=["192.0.2.1", "198.51.100.1", "2001:DB8:100::CF"], ) @parametrize diff --git a/tests/api_resources/test_email_routing.py b/tests/api_resources/test_email_routing.py index a0bf7eefe87..6f20c5ca8c3 100644 --- a/tests/api_resources/test_email_routing.py +++ b/tests/api_resources/test_email_routing.py @@ -3,12 +3,13 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare.types.email_routing import Settings base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -22,7 +23,7 @@ def test_method_disable(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(object, email_routing, path=["response"]) + assert_matches_type(Optional[Settings], email_routing, path=["response"]) @parametrize def test_raw_response_disable(self, client: Cloudflare) -> None: @@ -34,7 +35,7 @@ def test_raw_response_disable(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = response.parse() - assert_matches_type(object, email_routing, path=["response"]) + assert_matches_type(Optional[Settings], email_routing, path=["response"]) @parametrize def test_streaming_response_disable(self, client: Cloudflare) -> None: @@ -46,7 +47,7 @@ def test_streaming_response_disable(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = response.parse() - assert_matches_type(object, email_routing, path=["response"]) + assert_matches_type(Optional[Settings], email_routing, path=["response"]) assert cast(Any, response.is_closed) is True @@ -64,7 +65,7 @@ def test_method_enable(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(object, email_routing, path=["response"]) + assert_matches_type(Optional[Settings], email_routing, path=["response"]) @parametrize def test_raw_response_enable(self, client: Cloudflare) -> None: @@ -76,7 +77,7 @@ def test_raw_response_enable(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = response.parse() - assert_matches_type(object, email_routing, path=["response"]) + assert_matches_type(Optional[Settings], email_routing, path=["response"]) @parametrize def test_streaming_response_enable(self, client: Cloudflare) -> None: @@ -88,7 +89,7 @@ def test_streaming_response_enable(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = response.parse() - assert_matches_type(object, email_routing, path=["response"]) + assert_matches_type(Optional[Settings], email_routing, path=["response"]) assert cast(Any, response.is_closed) is True @@ -105,7 +106,7 @@ def test_method_get(self, client: Cloudflare) -> None: email_routing = client.email_routing.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(object, email_routing, path=["response"]) + assert_matches_type(Optional[Settings], email_routing, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -116,7 +117,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = response.parse() - assert_matches_type(object, email_routing, path=["response"]) + assert_matches_type(Optional[Settings], email_routing, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -127,7 +128,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = response.parse() - assert_matches_type(object, email_routing, path=["response"]) + assert_matches_type(Optional[Settings], email_routing, path=["response"]) assert cast(Any, response.is_closed) is True @@ -148,7 +149,7 @@ async def test_method_disable(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(object, email_routing, path=["response"]) + assert_matches_type(Optional[Settings], email_routing, path=["response"]) @parametrize async def test_raw_response_disable(self, async_client: AsyncCloudflare) -> None: @@ -160,7 +161,7 @@ async def test_raw_response_disable(self, async_client: AsyncCloudflare) -> None assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = await response.parse() - assert_matches_type(object, email_routing, path=["response"]) + assert_matches_type(Optional[Settings], email_routing, path=["response"]) @parametrize async def test_streaming_response_disable(self, async_client: AsyncCloudflare) -> None: @@ -172,7 +173,7 @@ async def test_streaming_response_disable(self, async_client: AsyncCloudflare) - assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = await response.parse() - assert_matches_type(object, email_routing, path=["response"]) + assert_matches_type(Optional[Settings], email_routing, path=["response"]) assert cast(Any, response.is_closed) is True @@ -190,7 +191,7 @@ async def test_method_enable(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(object, email_routing, path=["response"]) + assert_matches_type(Optional[Settings], email_routing, path=["response"]) @parametrize async def test_raw_response_enable(self, async_client: AsyncCloudflare) -> None: @@ -202,7 +203,7 @@ async def test_raw_response_enable(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = await response.parse() - assert_matches_type(object, email_routing, path=["response"]) + assert_matches_type(Optional[Settings], email_routing, path=["response"]) @parametrize async def test_streaming_response_enable(self, async_client: AsyncCloudflare) -> None: @@ -214,7 +215,7 @@ async def test_streaming_response_enable(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = await response.parse() - assert_matches_type(object, email_routing, path=["response"]) + assert_matches_type(Optional[Settings], email_routing, path=["response"]) assert cast(Any, response.is_closed) is True @@ -231,7 +232,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: email_routing = await async_client.email_routing.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(object, email_routing, path=["response"]) + assert_matches_type(Optional[Settings], email_routing, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -242,7 +243,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = await response.parse() - assert_matches_type(object, email_routing, path=["response"]) + assert_matches_type(Optional[Settings], email_routing, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -253,7 +254,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = await response.parse() - assert_matches_type(object, email_routing, path=["response"]) + assert_matches_type(Optional[Settings], email_routing, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/user/test_tokens.py b/tests/api_resources/user/test_tokens.py index d7b66d1a580..83205076e86 100644 --- a/tests/api_resources/user/test_tokens.py +++ b/tests/api_resources/user/test_tokens.py @@ -143,6 +143,21 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: def test_method_update(self, client: Cloudflare) -> None: token = client.user.tokens.update( token_id="ed17574386854bf78a67040be0a770b0", + name="readonly token", + policies=[ + { + "effect": "allow", + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], + "resources": { + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }, + } + ], + status="active", ) assert_matches_type(Optional[Token], token, path=["response"]) @@ -151,15 +166,7 @@ def test_method_update(self, client: Cloudflare) -> None: def test_method_update_with_all_params(self, client: Cloudflare) -> None: token = client.user.tokens.update( token_id="ed17574386854bf78a67040be0a770b0", - condition={ - "request_ip": { - "in": ["123.123.123.0/24", "2606:4700::/32"], - "not_in": ["123.123.123.100/24", "2606:4700:4700::/48"], - } - }, - expires_on=parse_datetime("2020-01-01T00:00:00Z"), name="readonly token", - not_before=parse_datetime("2018-07-01T05:20:00Z"), policies=[ { "effect": "allow", @@ -186,6 +193,14 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: } ], status="active", + condition={ + "request_ip": { + "in": ["123.123.123.0/24", "2606:4700::/32"], + "not_in": ["123.123.123.100/24", "2606:4700:4700::/48"], + } + }, + expires_on=parse_datetime("2020-01-01T00:00:00Z"), + not_before=parse_datetime("2018-07-01T05:20:00Z"), ) assert_matches_type(Optional[Token], token, path=["response"]) @@ -194,6 +209,21 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_update(self, client: Cloudflare) -> None: response = client.user.tokens.with_raw_response.update( token_id="ed17574386854bf78a67040be0a770b0", + name="readonly token", + policies=[ + { + "effect": "allow", + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], + "resources": { + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }, + } + ], + status="active", ) assert response.is_closed is True @@ -206,6 +236,21 @@ def test_raw_response_update(self, client: Cloudflare) -> None: def test_streaming_response_update(self, client: Cloudflare) -> None: with client.user.tokens.with_streaming_response.update( token_id="ed17574386854bf78a67040be0a770b0", + name="readonly token", + policies=[ + { + "effect": "allow", + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], + "resources": { + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }, + } + ], + status="active", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -221,6 +266,21 @@ def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `token_id` but received ''"): client.user.tokens.with_raw_response.update( token_id="", + name="readonly token", + policies=[ + { + "effect": "allow", + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], + "resources": { + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }, + } + ], + status="active", ) @pytest.mark.skip(reason="TODO: investigate broken test") @@ -496,6 +556,21 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> async def test_method_update(self, async_client: AsyncCloudflare) -> None: token = await async_client.user.tokens.update( token_id="ed17574386854bf78a67040be0a770b0", + name="readonly token", + policies=[ + { + "effect": "allow", + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], + "resources": { + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }, + } + ], + status="active", ) assert_matches_type(Optional[Token], token, path=["response"]) @@ -504,15 +579,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: token = await async_client.user.tokens.update( token_id="ed17574386854bf78a67040be0a770b0", - condition={ - "request_ip": { - "in": ["123.123.123.0/24", "2606:4700::/32"], - "not_in": ["123.123.123.100/24", "2606:4700:4700::/48"], - } - }, - expires_on=parse_datetime("2020-01-01T00:00:00Z"), name="readonly token", - not_before=parse_datetime("2018-07-01T05:20:00Z"), policies=[ { "effect": "allow", @@ -539,6 +606,14 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare } ], status="active", + condition={ + "request_ip": { + "in": ["123.123.123.0/24", "2606:4700::/32"], + "not_in": ["123.123.123.100/24", "2606:4700:4700::/48"], + } + }, + expires_on=parse_datetime("2020-01-01T00:00:00Z"), + not_before=parse_datetime("2018-07-01T05:20:00Z"), ) assert_matches_type(Optional[Token], token, path=["response"]) @@ -547,6 +622,21 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.user.tokens.with_raw_response.update( token_id="ed17574386854bf78a67040be0a770b0", + name="readonly token", + policies=[ + { + "effect": "allow", + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], + "resources": { + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }, + } + ], + status="active", ) assert response.is_closed is True @@ -559,6 +649,21 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.user.tokens.with_streaming_response.update( token_id="ed17574386854bf78a67040be0a770b0", + name="readonly token", + policies=[ + { + "effect": "allow", + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], + "resources": { + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }, + } + ], + status="active", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -574,6 +679,21 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `token_id` but received ''"): await async_client.user.tokens.with_raw_response.update( token_id="", + name="readonly token", + policies=[ + { + "effect": "allow", + "permission_groups": [ + {"id": "c8fed203ed3043cba015a93ad1616f1f"}, + {"id": "82e64a83756745bbbb1c9c2701bf816b"}, + ], + "resources": { + "com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43": "*", + "com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4": "*", + }, + } + ], + status="active", ) @pytest.mark.skip(reason="TODO: investigate broken test") diff --git a/tests/api_resources/zero_trust/devices/test_networks.py b/tests/api_resources/zero_trust/devices/test_networks.py index 99742f5be5e..f09f4ba1555 100644 --- a/tests/api_resources/zero_trust/devices/test_networks.py +++ b/tests/api_resources/zero_trust/devices/test_networks.py @@ -22,7 +22,7 @@ class TestNetworks: def test_method_create(self, client: Cloudflare) -> None: network = client.zero_trust.devices.networks.create( account_id="699d98642c564d2e855e9661899b7252", - config={"tls_sockaddr": "foobar:1234"}, + config={"tls_sockaddr": "foo.bar:1234"}, name="managed-network-1", type="tls", ) @@ -33,7 +33,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: network = client.zero_trust.devices.networks.create( account_id="699d98642c564d2e855e9661899b7252", config={ - "tls_sockaddr": "foobar:1234", + "tls_sockaddr": "foo.bar:1234", "sha256": "b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c", }, name="managed-network-1", @@ -45,7 +45,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_create(self, client: Cloudflare) -> None: response = client.zero_trust.devices.networks.with_raw_response.create( account_id="699d98642c564d2e855e9661899b7252", - config={"tls_sockaddr": "foobar:1234"}, + config={"tls_sockaddr": "foo.bar:1234"}, name="managed-network-1", type="tls", ) @@ -59,7 +59,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: def test_streaming_response_create(self, client: Cloudflare) -> None: with client.zero_trust.devices.networks.with_streaming_response.create( account_id="699d98642c564d2e855e9661899b7252", - config={"tls_sockaddr": "foobar:1234"}, + config={"tls_sockaddr": "foo.bar:1234"}, name="managed-network-1", type="tls", ) as response: @@ -76,7 +76,7 @@ def test_path_params_create(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.zero_trust.devices.networks.with_raw_response.create( account_id="", - config={"tls_sockaddr": "foobar:1234"}, + config={"tls_sockaddr": "foo.bar:1234"}, name="managed-network-1", type="tls", ) @@ -95,7 +95,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: network_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", config={ - "tls_sockaddr": "foobar:1234", + "tls_sockaddr": "foo.bar:1234", "sha256": "b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c", }, name="managed-network-1", @@ -285,7 +285,7 @@ class TestAsyncNetworks: async def test_method_create(self, async_client: AsyncCloudflare) -> None: network = await async_client.zero_trust.devices.networks.create( account_id="699d98642c564d2e855e9661899b7252", - config={"tls_sockaddr": "foobar:1234"}, + config={"tls_sockaddr": "foo.bar:1234"}, name="managed-network-1", type="tls", ) @@ -296,7 +296,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare network = await async_client.zero_trust.devices.networks.create( account_id="699d98642c564d2e855e9661899b7252", config={ - "tls_sockaddr": "foobar:1234", + "tls_sockaddr": "foo.bar:1234", "sha256": "b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c", }, name="managed-network-1", @@ -308,7 +308,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.devices.networks.with_raw_response.create( account_id="699d98642c564d2e855e9661899b7252", - config={"tls_sockaddr": "foobar:1234"}, + config={"tls_sockaddr": "foo.bar:1234"}, name="managed-network-1", type="tls", ) @@ -322,7 +322,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.devices.networks.with_streaming_response.create( account_id="699d98642c564d2e855e9661899b7252", - config={"tls_sockaddr": "foobar:1234"}, + config={"tls_sockaddr": "foo.bar:1234"}, name="managed-network-1", type="tls", ) as response: @@ -339,7 +339,7 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.zero_trust.devices.networks.with_raw_response.create( account_id="", - config={"tls_sockaddr": "foobar:1234"}, + config={"tls_sockaddr": "foo.bar:1234"}, name="managed-network-1", type="tls", ) @@ -358,7 +358,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare network_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", config={ - "tls_sockaddr": "foobar:1234", + "tls_sockaddr": "foo.bar:1234", "sha256": "b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c", }, name="managed-network-1", diff --git a/tests/api_resources/zero_trust/test_seats.py b/tests/api_resources/zero_trust/test_seats.py index 983cc57c9a1..b424abaee04 100644 --- a/tests/api_resources/zero_trust/test_seats.py +++ b/tests/api_resources/zero_trust/test_seats.py @@ -22,7 +22,7 @@ class TestSeats: @parametrize def test_method_edit(self, client: Cloudflare) -> None: seat = client.zero_trust.seats.edit( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="699d98642c564d2e855e9661899b7252", body=[ { "access_seat": False, @@ -37,7 +37,7 @@ def test_method_edit(self, client: Cloudflare) -> None: @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: response = client.zero_trust.seats.with_raw_response.edit( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="699d98642c564d2e855e9661899b7252", body=[ { "access_seat": False, @@ -56,7 +56,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: with client.zero_trust.seats.with_streaming_response.edit( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="699d98642c564d2e855e9661899b7252", body=[ { "access_seat": False, @@ -96,7 +96,7 @@ class TestAsyncSeats: @parametrize async def test_method_edit(self, async_client: AsyncCloudflare) -> None: seat = await async_client.zero_trust.seats.edit( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="699d98642c564d2e855e9661899b7252", body=[ { "access_seat": False, @@ -111,7 +111,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.seats.with_raw_response.edit( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="699d98642c564d2e855e9661899b7252", body=[ { "access_seat": False, @@ -130,7 +130,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.seats.with_streaming_response.edit( - account_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="699d98642c564d2e855e9661899b7252", body=[ { "access_seat": False, diff --git a/tests/api_resources/zones/test_rate_plans.py b/tests/api_resources/zones/test_rate_plans.py index a336d10b98d..656e6512dd1 100644 --- a/tests/api_resources/zones/test_rate_plans.py +++ b/tests/api_resources/zones/test_rate_plans.py @@ -10,6 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.zones import RatePlanGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -22,7 +23,7 @@ def test_method_get(self, client: Cloudflare) -> None: rate_plan = client.zones.rate_plans.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[object], rate_plan, path=["response"]) + assert_matches_type(SyncSinglePage[RatePlanGetResponse], rate_plan, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -33,7 +34,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rate_plan = response.parse() - assert_matches_type(SyncSinglePage[object], rate_plan, path=["response"]) + assert_matches_type(SyncSinglePage[RatePlanGetResponse], rate_plan, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -44,7 +45,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rate_plan = response.parse() - assert_matches_type(SyncSinglePage[object], rate_plan, path=["response"]) + assert_matches_type(SyncSinglePage[RatePlanGetResponse], rate_plan, path=["response"]) assert cast(Any, response.is_closed) is True @@ -64,7 +65,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: rate_plan = await async_client.zones.rate_plans.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[object], rate_plan, path=["response"]) + assert_matches_type(AsyncSinglePage[RatePlanGetResponse], rate_plan, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -75,7 +76,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rate_plan = await response.parse() - assert_matches_type(AsyncSinglePage[object], rate_plan, path=["response"]) + assert_matches_type(AsyncSinglePage[RatePlanGetResponse], rate_plan, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -86,7 +87,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" rate_plan = await response.parse() - assert_matches_type(AsyncSinglePage[object], rate_plan, path=["response"]) + assert_matches_type(AsyncSinglePage[RatePlanGetResponse], rate_plan, path=["response"]) assert cast(Any, response.is_closed) is True From aefcfac353af446a9e2087bd90cd5eb0cb68c13c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 22:53:43 +0000 Subject: [PATCH 182/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index c45e5590c65..98e9d38c862 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fc562128cab85cd116a8c4e1fe17a0f09a5019da2d1bbe162c476aa999932c4e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0a83f84690863a4ae3bbe2d8c0c3345ad86e28f5ecd30bb782a61d83df224bb1.yml From 92668c788ddaaa7135f9b90d119941c62b5d13b1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 00:08:40 +0000 Subject: [PATCH 183/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 98e9d38c862..c45e5590c65 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0a83f84690863a4ae3bbe2d8c0c3345ad86e28f5ecd30bb782a61d83df224bb1.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fc562128cab85cd116a8c4e1fe17a0f09a5019da2d1bbe162c476aa999932c4e.yml From 24d88fa2564ee9e23c7b8ecd45f5aafae3979077 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 02:16:53 +0000 Subject: [PATCH 184/358] feat(api): enable zero_trust_tunnel_cloudflared_token (#2449) --- api.md | 24 ++- .../resources/zero_trust/tunnels/tunnels.py | 6 +- .../tunnels/warp_connector/__init__.py | 33 +++ .../tunnels/warp_connector/token.py | 190 ++++++++++++++++++ .../{ => warp_connector}/warp_connector.py | 165 +++++---------- .../types/zero_trust/tunnels/__init__.py | 1 - .../tunnels/warp_connector/__init__.py | 5 + .../token_get_response.py} | 4 +- .../zero_trust/tunnels/test_warp_connector.py | 96 --------- .../tunnels/warp_connector/__init__.py | 1 + .../tunnels/warp_connector/test_token.py | 117 +++++++++++ 11 files changed, 415 insertions(+), 227 deletions(-) create mode 100644 src/cloudflare/resources/zero_trust/tunnels/warp_connector/__init__.py create mode 100644 src/cloudflare/resources/zero_trust/tunnels/warp_connector/token.py rename src/cloudflare/resources/zero_trust/tunnels/{ => warp_connector}/warp_connector.py (85%) create mode 100644 src/cloudflare/types/zero_trust/tunnels/warp_connector/__init__.py rename src/cloudflare/types/zero_trust/tunnels/{warp_connector_token_response.py => warp_connector/token_get_response.py} (60%) create mode 100644 tests/api_resources/zero_trust/tunnels/warp_connector/__init__.py create mode 100644 tests/api_resources/zero_trust/tunnels/warp_connector/test_token.py diff --git a/api.md b/api.md index a395785a472..5434c74eb40 100644 --- a/api.md +++ b/api.md @@ -5862,18 +5862,28 @@ from cloudflare.types.zero_trust.tunnels import ( WARPConnectorDeleteResponse, WARPConnectorEditResponse, WARPConnectorGetResponse, - WARPConnectorTokenResponse, ) ``` Methods: -- client.zero_trust.tunnels.warp_connector.create(\*, account_id, \*\*params) -> WARPConnectorCreateResponse -- client.zero_trust.tunnels.warp_connector.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[WARPConnectorListResponse] -- client.zero_trust.tunnels.warp_connector.delete(tunnel_id, \*, account_id) -> WARPConnectorDeleteResponse -- client.zero_trust.tunnels.warp_connector.edit(tunnel_id, \*, account_id, \*\*params) -> WARPConnectorEditResponse -- client.zero_trust.tunnels.warp_connector.get(tunnel_id, \*, account_id) -> WARPConnectorGetResponse -- client.zero_trust.tunnels.warp_connector.token(tunnel_id, \*, account_id) -> str +- client.zero_trust.tunnels.warp_connector.create(\*, account_id, \*\*params) -> WARPConnectorCreateResponse +- client.zero_trust.tunnels.warp_connector.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[WARPConnectorListResponse] +- client.zero_trust.tunnels.warp_connector.delete(tunnel_id, \*, account_id) -> WARPConnectorDeleteResponse +- client.zero_trust.tunnels.warp_connector.edit(tunnel_id, \*, account_id, \*\*params) -> WARPConnectorEditResponse +- client.zero_trust.tunnels.warp_connector.get(tunnel_id, \*, account_id) -> WARPConnectorGetResponse + +#### Token + +Types: + +```python +from cloudflare.types.zero_trust.tunnels.warp_connector import TokenGetResponse +``` + +Methods: + +- client.zero_trust.tunnels.warp_connector.token.get(tunnel_id, \*, account_id) -> str ### Configurations diff --git a/src/cloudflare/resources/zero_trust/tunnels/tunnels.py b/src/cloudflare/resources/zero_trust/tunnels/tunnels.py index f88ccc08f9f..4f19564ca14 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/tunnels.py +++ b/src/cloudflare/resources/zero_trust/tunnels/tunnels.py @@ -63,7 +63,9 @@ ConfigurationsResourceWithStreamingResponse, AsyncConfigurationsResourceWithStreamingResponse, ) -from .warp_connector import ( +from ...._base_client import AsyncPaginator, make_request_options +from ....types.zero_trust import tunnel_edit_params, tunnel_list_params, tunnel_create_params +from .warp_connector.warp_connector import ( WARPConnectorResource, AsyncWARPConnectorResource, WARPConnectorResourceWithRawResponse, @@ -71,8 +73,6 @@ WARPConnectorResourceWithStreamingResponse, AsyncWARPConnectorResourceWithStreamingResponse, ) -from ...._base_client import AsyncPaginator, make_request_options -from ....types.zero_trust import tunnel_edit_params, tunnel_list_params, tunnel_create_params from ....types.zero_trust.tunnel_get_response import TunnelGetResponse from ....types.zero_trust.tunnel_edit_response import TunnelEditResponse from ....types.zero_trust.tunnel_list_response import TunnelListResponse diff --git a/src/cloudflare/resources/zero_trust/tunnels/warp_connector/__init__.py b/src/cloudflare/resources/zero_trust/tunnels/warp_connector/__init__.py new file mode 100644 index 00000000000..3b5b3b22545 --- /dev/null +++ b/src/cloudflare/resources/zero_trust/tunnels/warp_connector/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .token import ( + TokenResource, + AsyncTokenResource, + TokenResourceWithRawResponse, + AsyncTokenResourceWithRawResponse, + TokenResourceWithStreamingResponse, + AsyncTokenResourceWithStreamingResponse, +) +from .warp_connector import ( + WARPConnectorResource, + AsyncWARPConnectorResource, + WARPConnectorResourceWithRawResponse, + AsyncWARPConnectorResourceWithRawResponse, + WARPConnectorResourceWithStreamingResponse, + AsyncWARPConnectorResourceWithStreamingResponse, +) + +__all__ = [ + "TokenResource", + "AsyncTokenResource", + "TokenResourceWithRawResponse", + "AsyncTokenResourceWithRawResponse", + "TokenResourceWithStreamingResponse", + "AsyncTokenResourceWithStreamingResponse", + "WARPConnectorResource", + "AsyncWARPConnectorResource", + "WARPConnectorResourceWithRawResponse", + "AsyncWARPConnectorResourceWithRawResponse", + "WARPConnectorResourceWithStreamingResponse", + "AsyncWARPConnectorResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/zero_trust/tunnels/warp_connector/token.py b/src/cloudflare/resources/zero_trust/tunnels/warp_connector/token.py new file mode 100644 index 00000000000..e20e979d728 --- /dev/null +++ b/src/cloudflare/resources/zero_trust/tunnels/warp_connector/token.py @@ -0,0 +1,190 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, cast + +import httpx + +from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._compat import cached_property +from ....._resource import SyncAPIResource, AsyncAPIResource +from ....._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ....._wrappers import ResultWrapper +from ....._base_client import make_request_options +from .....types.zero_trust.tunnels.warp_connector.token_get_response import TokenGetResponse + +__all__ = ["TokenResource", "AsyncTokenResource"] + + +class TokenResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> TokenResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return TokenResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> TokenResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return TokenResourceWithStreamingResponse(self) + + def get( + self, + tunnel_id: str, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Gets the token used to associate warp device with a specific Warp Connector + tunnel. + + Args: + account_id: Cloudflare account ID + + tunnel_id: UUID of the tunnel. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not tunnel_id: + raise ValueError(f"Expected a non-empty value for `tunnel_id` but received {tunnel_id!r}") + return self._get( + f"/accounts/{account_id}/warp_connector/{tunnel_id}/token", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[TokenGetResponse]._unwrapper, + ), + cast_to=cast(Type[str], ResultWrapper[str]), + ) + + +class AsyncTokenResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncTokenResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncTokenResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncTokenResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncTokenResourceWithStreamingResponse(self) + + async def get( + self, + tunnel_id: str, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Gets the token used to associate warp device with a specific Warp Connector + tunnel. + + Args: + account_id: Cloudflare account ID + + tunnel_id: UUID of the tunnel. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not tunnel_id: + raise ValueError(f"Expected a non-empty value for `tunnel_id` but received {tunnel_id!r}") + return await self._get( + f"/accounts/{account_id}/warp_connector/{tunnel_id}/token", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[TokenGetResponse]._unwrapper, + ), + cast_to=cast(Type[str], ResultWrapper[str]), + ) + + +class TokenResourceWithRawResponse: + def __init__(self, token: TokenResource) -> None: + self._token = token + + self.get = to_raw_response_wrapper( + token.get, + ) + + +class AsyncTokenResourceWithRawResponse: + def __init__(self, token: AsyncTokenResource) -> None: + self._token = token + + self.get = async_to_raw_response_wrapper( + token.get, + ) + + +class TokenResourceWithStreamingResponse: + def __init__(self, token: TokenResource) -> None: + self._token = token + + self.get = to_streamed_response_wrapper( + token.get, + ) + + +class AsyncTokenResourceWithStreamingResponse: + def __init__(self, token: AsyncTokenResource) -> None: + self._token = token + + self.get = async_to_streamed_response_wrapper( + token.get, + ) diff --git a/src/cloudflare/resources/zero_trust/tunnels/warp_connector.py b/src/cloudflare/resources/zero_trust/tunnels/warp_connector/warp_connector.py similarity index 85% rename from src/cloudflare/resources/zero_trust/tunnels/warp_connector.py rename to src/cloudflare/resources/zero_trust/tunnels/warp_connector/warp_connector.py index c5874232e45..adaaf4ef28e 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/warp_connector.py +++ b/src/cloudflare/resources/zero_trust/tunnels/warp_connector/warp_connector.py @@ -2,44 +2,55 @@ from __future__ import annotations -from typing import Any, Type, Union, cast +from typing import Any, Union, cast from datetime import datetime from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import ( +from .token import ( + TokenResource, + AsyncTokenResource, + TokenResourceWithRawResponse, + AsyncTokenResourceWithRawResponse, + TokenResourceWithStreamingResponse, + AsyncTokenResourceWithStreamingResponse, +) +from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._utils import ( maybe_transform, async_maybe_transform, ) -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( +from ....._compat import cached_property +from ....._resource import SyncAPIResource, AsyncAPIResource +from ....._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...._wrappers import ResultWrapper -from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray -from ...._base_client import AsyncPaginator, make_request_options -from ....types.zero_trust.tunnels import ( +from ....._wrappers import ResultWrapper +from .....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray +from ....._base_client import AsyncPaginator, make_request_options +from .....types.zero_trust.tunnels import ( warp_connector_edit_params, warp_connector_list_params, warp_connector_create_params, ) -from ....types.zero_trust.tunnels.warp_connector_get_response import WARPConnectorGetResponse -from ....types.zero_trust.tunnels.warp_connector_edit_response import WARPConnectorEditResponse -from ....types.zero_trust.tunnels.warp_connector_list_response import WARPConnectorListResponse -from ....types.zero_trust.tunnels.warp_connector_token_response import WARPConnectorTokenResponse -from ....types.zero_trust.tunnels.warp_connector_create_response import WARPConnectorCreateResponse -from ....types.zero_trust.tunnels.warp_connector_delete_response import WARPConnectorDeleteResponse +from .....types.zero_trust.tunnels.warp_connector_get_response import WARPConnectorGetResponse +from .....types.zero_trust.tunnels.warp_connector_edit_response import WARPConnectorEditResponse +from .....types.zero_trust.tunnels.warp_connector_list_response import WARPConnectorListResponse +from .....types.zero_trust.tunnels.warp_connector_create_response import WARPConnectorCreateResponse +from .....types.zero_trust.tunnels.warp_connector_delete_response import WARPConnectorDeleteResponse __all__ = ["WARPConnectorResource", "AsyncWARPConnectorResource"] class WARPConnectorResource(SyncAPIResource): + @cached_property + def token(self) -> TokenResource: + return TokenResource(self._client) + @cached_property def with_raw_response(self) -> WARPConnectorResourceWithRawResponse: """ @@ -355,53 +366,12 @@ def get( ), ) - def token( - self, - tunnel_id: str, - *, - account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Gets the token used to associate warp device with a specific Warp Connector - tunnel. - - Args: - account_id: Cloudflare account ID - - tunnel_id: UUID of the tunnel. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not tunnel_id: - raise ValueError(f"Expected a non-empty value for `tunnel_id` but received {tunnel_id!r}") - return self._get( - f"/accounts/{account_id}/warp_connector/{tunnel_id}/token", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[WARPConnectorTokenResponse]._unwrapper, - ), - cast_to=cast(Type[str], ResultWrapper[str]), - ) - class AsyncWARPConnectorResource(AsyncAPIResource): + @cached_property + def token(self) -> AsyncTokenResource: + return AsyncTokenResource(self._client) + @cached_property def with_raw_response(self) -> AsyncWARPConnectorResourceWithRawResponse: """ @@ -719,51 +689,6 @@ async def get( ), ) - async def token( - self, - tunnel_id: str, - *, - account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Gets the token used to associate warp device with a specific Warp Connector - tunnel. - - Args: - account_id: Cloudflare account ID - - tunnel_id: UUID of the tunnel. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not tunnel_id: - raise ValueError(f"Expected a non-empty value for `tunnel_id` but received {tunnel_id!r}") - return await self._get( - f"/accounts/{account_id}/warp_connector/{tunnel_id}/token", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[WARPConnectorTokenResponse]._unwrapper, - ), - cast_to=cast(Type[str], ResultWrapper[str]), - ) - class WARPConnectorResourceWithRawResponse: def __init__(self, warp_connector: WARPConnectorResource) -> None: @@ -784,9 +709,10 @@ def __init__(self, warp_connector: WARPConnectorResource) -> None: self.get = to_raw_response_wrapper( warp_connector.get, ) - self.token = to_raw_response_wrapper( - warp_connector.token, - ) + + @cached_property + def token(self) -> TokenResourceWithRawResponse: + return TokenResourceWithRawResponse(self._warp_connector.token) class AsyncWARPConnectorResourceWithRawResponse: @@ -808,9 +734,10 @@ def __init__(self, warp_connector: AsyncWARPConnectorResource) -> None: self.get = async_to_raw_response_wrapper( warp_connector.get, ) - self.token = async_to_raw_response_wrapper( - warp_connector.token, - ) + + @cached_property + def token(self) -> AsyncTokenResourceWithRawResponse: + return AsyncTokenResourceWithRawResponse(self._warp_connector.token) class WARPConnectorResourceWithStreamingResponse: @@ -832,9 +759,10 @@ def __init__(self, warp_connector: WARPConnectorResource) -> None: self.get = to_streamed_response_wrapper( warp_connector.get, ) - self.token = to_streamed_response_wrapper( - warp_connector.token, - ) + + @cached_property + def token(self) -> TokenResourceWithStreamingResponse: + return TokenResourceWithStreamingResponse(self._warp_connector.token) class AsyncWARPConnectorResourceWithStreamingResponse: @@ -856,6 +784,7 @@ def __init__(self, warp_connector: AsyncWARPConnectorResource) -> None: self.get = async_to_streamed_response_wrapper( warp_connector.get, ) - self.token = async_to_streamed_response_wrapper( - warp_connector.token, - ) + + @cached_property + def token(self) -> AsyncTokenResourceWithStreamingResponse: + return AsyncTokenResourceWithStreamingResponse(self._warp_connector.token) diff --git a/src/cloudflare/types/zero_trust/tunnels/__init__.py b/src/cloudflare/types/zero_trust/tunnels/__init__.py index c5677bc50a7..6919a9d8226 100644 --- a/src/cloudflare/types/zero_trust/tunnels/__init__.py +++ b/src/cloudflare/types/zero_trust/tunnels/__init__.py @@ -16,6 +16,5 @@ from .warp_connector_edit_response import WARPConnectorEditResponse as WARPConnectorEditResponse from .warp_connector_list_response import WARPConnectorListResponse as WARPConnectorListResponse from .configuration_update_response import ConfigurationUpdateResponse as ConfigurationUpdateResponse -from .warp_connector_token_response import WARPConnectorTokenResponse as WARPConnectorTokenResponse from .warp_connector_create_response import WARPConnectorCreateResponse as WARPConnectorCreateResponse from .warp_connector_delete_response import WARPConnectorDeleteResponse as WARPConnectorDeleteResponse diff --git a/src/cloudflare/types/zero_trust/tunnels/warp_connector/__init__.py b/src/cloudflare/types/zero_trust/tunnels/warp_connector/__init__.py new file mode 100644 index 00000000000..62ef691fccf --- /dev/null +++ b/src/cloudflare/types/zero_trust/tunnels/warp_connector/__init__.py @@ -0,0 +1,5 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .token_get_response import TokenGetResponse as TokenGetResponse diff --git a/src/cloudflare/types/zero_trust/tunnels/warp_connector_token_response.py b/src/cloudflare/types/zero_trust/tunnels/warp_connector/token_get_response.py similarity index 60% rename from src/cloudflare/types/zero_trust/tunnels/warp_connector_token_response.py rename to src/cloudflare/types/zero_trust/tunnels/warp_connector/token_get_response.py index dc454b0c44b..d520a70e730 100644 --- a/src/cloudflare/types/zero_trust/tunnels/warp_connector_token_response.py +++ b/src/cloudflare/types/zero_trust/tunnels/warp_connector/token_get_response.py @@ -2,6 +2,6 @@ from typing_extensions import TypeAlias -__all__ = ["WARPConnectorTokenResponse"] +__all__ = ["TokenGetResponse"] -WARPConnectorTokenResponse: TypeAlias = str +TokenGetResponse: TypeAlias = str diff --git a/tests/api_resources/zero_trust/tunnels/test_warp_connector.py b/tests/api_resources/zero_trust/tunnels/test_warp_connector.py index 05ed298b476..0d52e5a7e14 100644 --- a/tests/api_resources/zero_trust/tunnels/test_warp_connector.py +++ b/tests/api_resources/zero_trust/tunnels/test_warp_connector.py @@ -277,54 +277,6 @@ def test_path_params_get(self, client: Cloudflare) -> None: account_id="699d98642c564d2e855e9661899b7252", ) - @parametrize - def test_method_token(self, client: Cloudflare) -> None: - warp_connector = client.zero_trust.tunnels.warp_connector.token( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) - assert_matches_type(str, warp_connector, path=["response"]) - - @parametrize - def test_raw_response_token(self, client: Cloudflare) -> None: - response = client.zero_trust.tunnels.warp_connector.with_raw_response.token( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - warp_connector = response.parse() - assert_matches_type(str, warp_connector, path=["response"]) - - @parametrize - def test_streaming_response_token(self, client: Cloudflare) -> None: - with client.zero_trust.tunnels.warp_connector.with_streaming_response.token( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - warp_connector = response.parse() - assert_matches_type(str, warp_connector, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_token(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.tunnels.warp_connector.with_raw_response.token( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): - client.zero_trust.tunnels.warp_connector.with_raw_response.token( - tunnel_id="", - account_id="699d98642c564d2e855e9661899b7252", - ) - class TestAsyncWARPConnector: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -582,51 +534,3 @@ async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: tunnel_id="", account_id="699d98642c564d2e855e9661899b7252", ) - - @parametrize - async def test_method_token(self, async_client: AsyncCloudflare) -> None: - warp_connector = await async_client.zero_trust.tunnels.warp_connector.token( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) - assert_matches_type(str, warp_connector, path=["response"]) - - @parametrize - async def test_raw_response_token(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.tunnels.warp_connector.with_raw_response.token( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - warp_connector = await response.parse() - assert_matches_type(str, warp_connector, path=["response"]) - - @parametrize - async def test_streaming_response_token(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.tunnels.warp_connector.with_streaming_response.token( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - warp_connector = await response.parse() - assert_matches_type(str, warp_connector, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_token(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.tunnels.warp_connector.with_raw_response.token( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): - await async_client.zero_trust.tunnels.warp_connector.with_raw_response.token( - tunnel_id="", - account_id="699d98642c564d2e855e9661899b7252", - ) diff --git a/tests/api_resources/zero_trust/tunnels/warp_connector/__init__.py b/tests/api_resources/zero_trust/tunnels/warp_connector/__init__.py new file mode 100644 index 00000000000..fd8019a9a1a --- /dev/null +++ b/tests/api_resources/zero_trust/tunnels/warp_connector/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/zero_trust/tunnels/warp_connector/test_token.py b/tests/api_resources/zero_trust/tunnels/warp_connector/test_token.py new file mode 100644 index 00000000000..998afc6848e --- /dev/null +++ b/tests/api_resources/zero_trust/tunnels/warp_connector/test_token.py @@ -0,0 +1,117 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestToken: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + token = client.zero_trust.tunnels.warp_connector.token.get( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(str, token, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.zero_trust.tunnels.warp_connector.token.with_raw_response.get( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + token = response.parse() + assert_matches_type(str, token, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.zero_trust.tunnels.warp_connector.token.with_streaming_response.get( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + token = response.parse() + assert_matches_type(str, token, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.tunnels.warp_connector.token.with_raw_response.get( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): + client.zero_trust.tunnels.warp_connector.token.with_raw_response.get( + tunnel_id="", + account_id="699d98642c564d2e855e9661899b7252", + ) + + +class TestAsyncToken: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + token = await async_client.zero_trust.tunnels.warp_connector.token.get( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(str, token, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.tunnels.warp_connector.token.with_raw_response.get( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + token = await response.parse() + assert_matches_type(str, token, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.tunnels.warp_connector.token.with_streaming_response.get( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + token = await response.parse() + assert_matches_type(str, token, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.tunnels.warp_connector.token.with_raw_response.get( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): + await async_client.zero_trust.tunnels.warp_connector.token.with_raw_response.get( + tunnel_id="", + account_id="699d98642c564d2e855e9661899b7252", + ) From 0de14b33a0ef0e42cb31055e5ae87e6dff8457f3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 06:09:59 +0000 Subject: [PATCH 185/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index c45e5590c65..98e9d38c862 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fc562128cab85cd116a8c4e1fe17a0f09a5019da2d1bbe162c476aa999932c4e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0a83f84690863a4ae3bbe2d8c0c3345ad86e28f5ecd30bb782a61d83df224bb1.yml From b10d100504ee0d3c4a360d5ab5c34772bd3ae2f7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 11:56:07 +0000 Subject: [PATCH 186/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 98e9d38c862..c45e5590c65 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0a83f84690863a4ae3bbe2d8c0c3345ad86e28f5ecd30bb782a61d83df224bb1.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fc562128cab85cd116a8c4e1fe17a0f09a5019da2d1bbe162c476aa999932c4e.yml From 40fd7640f93e3064c74a61915d15d488cce3a915 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 12:00:33 +0000 Subject: [PATCH 187/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index c45e5590c65..98e9d38c862 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fc562128cab85cd116a8c4e1fe17a0f09a5019da2d1bbe162c476aa999932c4e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0a83f84690863a4ae3bbe2d8c0c3345ad86e28f5ecd30bb782a61d83df224bb1.yml From f6a1477b8eed665cbcdc1dc08e321908fda787b5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 14:34:30 +0000 Subject: [PATCH 188/358] fix: asyncify on non-asyncio runtimes (#2450) --- src/cloudflare/_utils/_sync.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/cloudflare/_utils/_sync.py b/src/cloudflare/_utils/_sync.py index 8b3aaf2b5d2..ad7ec71b76b 100644 --- a/src/cloudflare/_utils/_sync.py +++ b/src/cloudflare/_utils/_sync.py @@ -7,16 +7,20 @@ from typing import Any, TypeVar, Callable, Awaitable from typing_extensions import ParamSpec +import anyio +import sniffio +import anyio.to_thread + T_Retval = TypeVar("T_Retval") T_ParamSpec = ParamSpec("T_ParamSpec") if sys.version_info >= (3, 9): - to_thread = asyncio.to_thread + _asyncio_to_thread = asyncio.to_thread else: # backport of https://docs.python.org/3/library/asyncio-task.html#asyncio.to_thread # for Python 3.8 support - async def to_thread( + async def _asyncio_to_thread( func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs ) -> Any: """Asynchronously run function *func* in a separate thread. @@ -34,6 +38,17 @@ async def to_thread( return await loop.run_in_executor(None, func_call) +async def to_thread( + func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs +) -> T_Retval: + if sniffio.current_async_library() == "asyncio": + return await _asyncio_to_thread(func, *args, **kwargs) + + return await anyio.to_thread.run_sync( + functools.partial(func, *args, **kwargs), + ) + + # inspired by `asyncer`, https://github.com/tiangolo/asyncer def asyncify(function: Callable[T_ParamSpec, T_Retval]) -> Callable[T_ParamSpec, Awaitable[T_Retval]]: """ From 01fb305ca0eb291fd020f389aebe854803d045eb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 15:18:44 +0000 Subject: [PATCH 189/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 98e9d38c862..c45e5590c65 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0a83f84690863a4ae3bbe2d8c0c3345ad86e28f5ecd30bb782a61d83df224bb1.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fc562128cab85cd116a8c4e1fe17a0f09a5019da2d1bbe162c476aa999932c4e.yml From f79a7224063b7e463c72ce0f66903a0ffbb5d6d7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 15:21:58 +0000 Subject: [PATCH 190/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index c45e5590c65..98e9d38c862 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fc562128cab85cd116a8c4e1fe17a0f09a5019da2d1bbe162c476aa999932c4e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0a83f84690863a4ae3bbe2d8c0c3345ad86e28f5ecd30bb782a61d83df224bb1.yml From a490e478fdcb8bfe275cc495f6b76a2f3c18ea41 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 16:15:49 +0000 Subject: [PATCH 191/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 98e9d38c862..c45e5590c65 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0a83f84690863a4ae3bbe2d8c0c3345ad86e28f5ecd30bb782a61d83df224bb1.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fc562128cab85cd116a8c4e1fe17a0f09a5019da2d1bbe162c476aa999932c4e.yml From 0ef9ac3df6300a871129b020f9760cac79ec349a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 18:08:00 +0000 Subject: [PATCH 192/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index c45e5590c65..98e9d38c862 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fc562128cab85cd116a8c4e1fe17a0f09a5019da2d1bbe162c476aa999932c4e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0a83f84690863a4ae3bbe2d8c0c3345ad86e28f5ecd30bb782a61d83df224bb1.yml From 4af95514405795d8e6fa108c82619d92db6309f2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 18:55:33 +0000 Subject: [PATCH 193/358] feat(api): api update (#2451) --- .stats.yml | 2 +- .../zero_trust/networks/routes/routes.py | 15 +++++++-------- .../resources/zero_trust/tunnels/tunnels.py | 12 ++++++------ .../tunnels/warp_connector/warp_connector.py | 12 ++++++------ .../zero_trust/networks/route_list_params.py | 12 ++++-------- .../types/zero_trust/tunnel_list_params.py | 6 +++--- .../tunnels/warp_connector_list_params.py | 6 +++--- .../zero_trust/networks/test_routes.py | 5 ++--- tests/api_resources/zero_trust/test_tunnels.py | 4 ++-- .../zero_trust/tunnels/test_warp_connector.py | 4 ++-- 10 files changed, 36 insertions(+), 42 deletions(-) diff --git a/.stats.yml b/.stats.yml index 98e9d38c862..804cea423e0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0a83f84690863a4ae3bbe2d8c0c3345ad86e28f5ecd30bb782a61d83df224bb1.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b7d976f8cb059323982d4a50ecbd3bf708406f710f069e5f35e05b77bdb4f00c.yml diff --git a/src/cloudflare/resources/zero_trust/networks/routes/routes.py b/src/cloudflare/resources/zero_trust/networks/routes/routes.py index 8f395402e15..c6f2771301f 100644 --- a/src/cloudflare/resources/zero_trust/networks/routes/routes.py +++ b/src/cloudflare/resources/zero_trust/networks/routes/routes.py @@ -2,8 +2,7 @@ from __future__ import annotations -from typing import Type, Union, cast -from datetime import datetime +from typing import Type, cast import httpx @@ -139,7 +138,7 @@ def list( *, account_id: str, comment: str | NotGiven = NOT_GIVEN, - existed_at: Union[str, datetime] | NotGiven = NOT_GIVEN, + existed_at: str | NotGiven = NOT_GIVEN, is_deleted: bool | NotGiven = NOT_GIVEN, network_subset: str | NotGiven = NOT_GIVEN, network_superset: str | NotGiven = NOT_GIVEN, @@ -164,8 +163,8 @@ def list( comment: Optional remark describing the route. - existed_at: If provided, include only tunnels that were created (and not deleted) before - this time. + existed_at: If provided, include only resources that were created (and not deleted) before + this time. URL encoded. is_deleted: If `true`, only include deleted routes. If `false`, exclude deleted routes. If empty, all routes will be included. @@ -473,7 +472,7 @@ def list( *, account_id: str, comment: str | NotGiven = NOT_GIVEN, - existed_at: Union[str, datetime] | NotGiven = NOT_GIVEN, + existed_at: str | NotGiven = NOT_GIVEN, is_deleted: bool | NotGiven = NOT_GIVEN, network_subset: str | NotGiven = NOT_GIVEN, network_superset: str | NotGiven = NOT_GIVEN, @@ -498,8 +497,8 @@ def list( comment: Optional remark describing the route. - existed_at: If provided, include only tunnels that were created (and not deleted) before - this time. + existed_at: If provided, include only resources that were created (and not deleted) before + this time. URL encoded. is_deleted: If `true`, only include deleted routes. If `false`, exclude deleted routes. If empty, all routes will be included. diff --git a/src/cloudflare/resources/zero_trust/tunnels/tunnels.py b/src/cloudflare/resources/zero_trust/tunnels/tunnels.py index 4f19564ca14..074ff6a31b9 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/tunnels.py +++ b/src/cloudflare/resources/zero_trust/tunnels/tunnels.py @@ -195,7 +195,7 @@ def list( *, account_id: str, exclude_prefix: str | NotGiven = NOT_GIVEN, - existed_at: Union[str, datetime] | NotGiven = NOT_GIVEN, + existed_at: str | NotGiven = NOT_GIVEN, include_prefix: str | NotGiven = NOT_GIVEN, is_deleted: bool | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, @@ -218,8 +218,8 @@ def list( Args: account_id: Cloudflare account ID - existed_at: If provided, include only tunnels that were created (and not deleted) before - this time. + existed_at: If provided, include only resources that were created (and not deleted) before + this time. URL encoded. is_deleted: If `true`, only include deleted tunnels. If `false`, exclude deleted tunnels. If empty, all tunnels will be included. @@ -550,7 +550,7 @@ def list( *, account_id: str, exclude_prefix: str | NotGiven = NOT_GIVEN, - existed_at: Union[str, datetime] | NotGiven = NOT_GIVEN, + existed_at: str | NotGiven = NOT_GIVEN, include_prefix: str | NotGiven = NOT_GIVEN, is_deleted: bool | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, @@ -573,8 +573,8 @@ def list( Args: account_id: Cloudflare account ID - existed_at: If provided, include only tunnels that were created (and not deleted) before - this time. + existed_at: If provided, include only resources that were created (and not deleted) before + this time. URL encoded. is_deleted: If `true`, only include deleted tunnels. If `false`, exclude deleted tunnels. If empty, all tunnels will be included. diff --git a/src/cloudflare/resources/zero_trust/tunnels/warp_connector/warp_connector.py b/src/cloudflare/resources/zero_trust/tunnels/warp_connector/warp_connector.py index adaaf4ef28e..515c2f603e0 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/warp_connector/warp_connector.py +++ b/src/cloudflare/resources/zero_trust/tunnels/warp_connector/warp_connector.py @@ -123,7 +123,7 @@ def list( *, account_id: str, exclude_prefix: str | NotGiven = NOT_GIVEN, - existed_at: Union[str, datetime] | NotGiven = NOT_GIVEN, + existed_at: str | NotGiven = NOT_GIVEN, include_prefix: str | NotGiven = NOT_GIVEN, is_deleted: bool | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, @@ -146,8 +146,8 @@ def list( Args: account_id: Cloudflare account ID - existed_at: If provided, include only tunnels that were created (and not deleted) before - this time. + existed_at: If provided, include only resources that were created (and not deleted) before + this time. URL encoded. is_deleted: If `true`, only include deleted tunnels. If `false`, exclude deleted tunnels. If empty, all tunnels will be included. @@ -446,7 +446,7 @@ def list( *, account_id: str, exclude_prefix: str | NotGiven = NOT_GIVEN, - existed_at: Union[str, datetime] | NotGiven = NOT_GIVEN, + existed_at: str | NotGiven = NOT_GIVEN, include_prefix: str | NotGiven = NOT_GIVEN, is_deleted: bool | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, @@ -469,8 +469,8 @@ def list( Args: account_id: Cloudflare account ID - existed_at: If provided, include only tunnels that were created (and not deleted) before - this time. + existed_at: If provided, include only resources that were created (and not deleted) before + this time. URL encoded. is_deleted: If `true`, only include deleted tunnels. If `false`, exclude deleted tunnels. If empty, all tunnels will be included. diff --git a/src/cloudflare/types/zero_trust/networks/route_list_params.py b/src/cloudflare/types/zero_trust/networks/route_list_params.py index 15a5e7bb478..fd2c8fabac3 100644 --- a/src/cloudflare/types/zero_trust/networks/route_list_params.py +++ b/src/cloudflare/types/zero_trust/networks/route_list_params.py @@ -2,11 +2,7 @@ from __future__ import annotations -from typing import Union -from datetime import datetime -from typing_extensions import Required, Annotated, TypedDict - -from ...._utils import PropertyInfo +from typing_extensions import Required, TypedDict __all__ = ["RouteListParams"] @@ -18,10 +14,10 @@ class RouteListParams(TypedDict, total=False): comment: str """Optional remark describing the route.""" - existed_at: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + existed_at: str """ - If provided, include only tunnels that were created (and not deleted) before - this time. + If provided, include only resources that were created (and not deleted) before + this time. URL encoded. """ is_deleted: bool diff --git a/src/cloudflare/types/zero_trust/tunnel_list_params.py b/src/cloudflare/types/zero_trust/tunnel_list_params.py index 85d5c357c36..1fff18dd6f7 100644 --- a/src/cloudflare/types/zero_trust/tunnel_list_params.py +++ b/src/cloudflare/types/zero_trust/tunnel_list_params.py @@ -17,10 +17,10 @@ class TunnelListParams(TypedDict, total=False): exclude_prefix: str - existed_at: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + existed_at: str """ - If provided, include only tunnels that were created (and not deleted) before - this time. + If provided, include only resources that were created (and not deleted) before + this time. URL encoded. """ include_prefix: str diff --git a/src/cloudflare/types/zero_trust/tunnels/warp_connector_list_params.py b/src/cloudflare/types/zero_trust/tunnels/warp_connector_list_params.py index 7a1e3982d4e..a3b8aa866a9 100644 --- a/src/cloudflare/types/zero_trust/tunnels/warp_connector_list_params.py +++ b/src/cloudflare/types/zero_trust/tunnels/warp_connector_list_params.py @@ -17,10 +17,10 @@ class WARPConnectorListParams(TypedDict, total=False): exclude_prefix: str - existed_at: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + existed_at: str """ - If provided, include only tunnels that were created (and not deleted) before - this time. + If provided, include only resources that were created (and not deleted) before + this time. URL encoded. """ include_prefix: str diff --git a/tests/api_resources/zero_trust/networks/test_routes.py b/tests/api_resources/zero_trust/networks/test_routes.py index 057766b11b9..d4d11fee0df 100644 --- a/tests/api_resources/zero_trust/networks/test_routes.py +++ b/tests/api_resources/zero_trust/networks/test_routes.py @@ -9,7 +9,6 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare._utils import parse_datetime from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from cloudflare.types.zero_trust.networks import ( Route, @@ -91,7 +90,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: route = client.zero_trust.networks.routes.list( account_id="699d98642c564d2e855e9661899b7252", comment="Example comment for this route.", - existed_at=parse_datetime("2019-10-12T07:20:50.52Z"), + existed_at="2019-10-12T07%3A20%3A50.52Z", is_deleted=True, network_subset="172.16.0.0/16", network_superset="172.16.0.0/16", @@ -364,7 +363,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) route = await async_client.zero_trust.networks.routes.list( account_id="699d98642c564d2e855e9661899b7252", comment="Example comment for this route.", - existed_at=parse_datetime("2019-10-12T07:20:50.52Z"), + existed_at="2019-10-12T07%3A20%3A50.52Z", is_deleted=True, network_subset="172.16.0.0/16", network_superset="172.16.0.0/16", diff --git a/tests/api_resources/zero_trust/test_tunnels.py b/tests/api_resources/zero_trust/test_tunnels.py index 688f4266a4f..5315b4ecf8e 100644 --- a/tests/api_resources/zero_trust/test_tunnels.py +++ b/tests/api_resources/zero_trust/test_tunnels.py @@ -89,7 +89,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: tunnel = client.zero_trust.tunnels.list( account_id="699d98642c564d2e855e9661899b7252", exclude_prefix="vpc1-", - existed_at=parse_datetime("2019-10-12T07:20:50.52Z"), + existed_at="2019-10-12T07%3A20%3A50.52Z", include_prefix="vpc1-", is_deleted=True, name="blog", @@ -355,7 +355,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) tunnel = await async_client.zero_trust.tunnels.list( account_id="699d98642c564d2e855e9661899b7252", exclude_prefix="vpc1-", - existed_at=parse_datetime("2019-10-12T07:20:50.52Z"), + existed_at="2019-10-12T07%3A20%3A50.52Z", include_prefix="vpc1-", is_deleted=True, name="blog", diff --git a/tests/api_resources/zero_trust/tunnels/test_warp_connector.py b/tests/api_resources/zero_trust/tunnels/test_warp_connector.py index 0d52e5a7e14..047ce37d1bb 100644 --- a/tests/api_resources/zero_trust/tunnels/test_warp_connector.py +++ b/tests/api_resources/zero_trust/tunnels/test_warp_connector.py @@ -79,7 +79,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: warp_connector = client.zero_trust.tunnels.warp_connector.list( account_id="699d98642c564d2e855e9661899b7252", exclude_prefix="vpc1-", - existed_at=parse_datetime("2019-10-12T07:20:50.52Z"), + existed_at="2019-10-12T07%3A20%3A50.52Z", include_prefix="vpc1-", is_deleted=True, name="blog", @@ -335,7 +335,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) warp_connector = await async_client.zero_trust.tunnels.warp_connector.list( account_id="699d98642c564d2e855e9661899b7252", exclude_prefix="vpc1-", - existed_at=parse_datetime("2019-10-12T07:20:50.52Z"), + existed_at="2019-10-12T07%3A20%3A50.52Z", include_prefix="vpc1-", is_deleted=True, name="blog", From d072e2ce96b44f0b57a32c0860f5ac3eaf0b2e1b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 18:59:51 +0000 Subject: [PATCH 194/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 804cea423e0..8bb9626dc69 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b7d976f8cb059323982d4a50ecbd3bf708406f710f069e5f35e05b77bdb4f00c.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-df5e86567121d0d3473b276fbc59fc48a0615916a287883022ba419961cd5cb5.yml From 2603b2e64b905216cc0dd8a06d9a4cd0a0a840ea Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 19:03:05 +0000 Subject: [PATCH 195/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 8bb9626dc69..804cea423e0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-df5e86567121d0d3473b276fbc59fc48a0615916a287883022ba419961cd5cb5.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b7d976f8cb059323982d4a50ecbd3bf708406f710f069e5f35e05b77bdb4f00c.yml From 93ca44808b6723940db562d468685b4e82ee8ba6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 21:23:05 +0000 Subject: [PATCH 196/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 804cea423e0..8bb9626dc69 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b7d976f8cb059323982d4a50ecbd3bf708406f710f069e5f35e05b77bdb4f00c.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-df5e86567121d0d3473b276fbc59fc48a0615916a287883022ba419961cd5cb5.yml From b35a36df6180e6f84c22feff7c2155d57f182e29 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 23:30:38 +0000 Subject: [PATCH 197/358] feat(api): api update (#2452) --- .stats.yml | 2 +- src/cloudflare/types/cache/cache_purge_params.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8bb9626dc69..0d43e47d5e5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-df5e86567121d0d3473b276fbc59fc48a0615916a287883022ba419961cd5cb5.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-796ddf5e628e063cc27e915ad0e01050997eb0017bbc48f7e5d9e23791eb3cf3.yml diff --git a/src/cloudflare/types/cache/cache_purge_params.py b/src/cloudflare/types/cache/cache_purge_params.py index 9a4fb0e7c82..9982fb59f0a 100644 --- a/src/cloudflare/types/cache/cache_purge_params.py +++ b/src/cloudflare/types/cache/cache_purge_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Union, Iterable +from typing import Dict, List, Union, Iterable from typing_extensions import Required, TypeAlias, TypedDict __all__ = [ @@ -78,7 +78,7 @@ class CachePurgeSingleFileWithURLAndHeaders(TypedDict, total=False): class CachePurgeSingleFileWithURLAndHeadersFile(TypedDict, total=False): - headers: object + headers: Dict[str, str] url: str From 0b8c6dddf477f3ad2845b4d26dad18a5a4841c13 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 23:59:17 +0000 Subject: [PATCH 198/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 0d43e47d5e5..2101a4a55a3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1525 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-796ddf5e628e063cc27e915ad0e01050997eb0017bbc48f7e5d9e23791eb3cf3.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e6f75d6387709ef6a98e7327b59c7ca9205e26a1252ea5e370e75be27ec21022.yml From 819be808da8e502380bfa110410a08d3458abb82 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 03:42:51 +0000 Subject: [PATCH 199/358] feat(tunnels)!: move all cloudflared resources into dedicated namespace (#2453) --- .stats.yml | 2 +- api.md | 103 +- .../resources/zero_trust/tunnels/__init__.py | 82 +- .../tunnels/cloudflared/__init__.py | 89 ++ .../tunnels/cloudflared/cloudflared.py | 940 ++++++++++++++++++ .../{ => cloudflared}/configurations.py | 20 +- .../tunnels/{ => cloudflared}/connections.py | 20 +- .../tunnels/{ => cloudflared}/connectors.py | 14 +- .../tunnels/{ => cloudflared}/management.py | 18 +- .../tunnels/{ => cloudflared}/token.py | 14 +- .../resources/zero_trust/tunnels/tunnels.py | 722 +------------- src/cloudflare/types/zero_trust/__init__.py | 6 - .../types/zero_trust/tunnel_list_params.py | 5 +- .../types/zero_trust/tunnels/__init__.py | 16 +- .../tunnels/cloudflared/__init__.py | 12 + .../tunnels/{ => cloudflared}/client.py | 2 +- .../configuration_get_response.py | 2 +- .../configuration_update_params.py | 2 +- .../configuration_update_response.py | 2 +- .../connection_delete_params.py | 0 .../management_create_params.py | 0 .../management_create_response.py | 0 .../{ => cloudflared}/token_get_response.py | 0 .../cloudflared_create_params.py} | 4 +- .../cloudflared_create_response.py} | 8 +- .../tunnels/cloudflared_delete_response.py | 94 ++ .../cloudflared_edit_params.py} | 4 +- .../cloudflared_edit_response.py} | 8 +- .../cloudflared_get_response.py} | 8 +- .../tunnels/cloudflared_list_params.py | 57 ++ .../cloudflared_list_response.py} | 8 +- .../api_resources/zero_trust/test_tunnels.py | 422 +------- .../tunnels/cloudflared/__init__.py | 1 + .../{ => cloudflared}/test_configurations.py | 46 +- .../{ => cloudflared}/test_connections.py | 46 +- .../{ => cloudflared}/test_connectors.py | 26 +- .../{ => cloudflared}/test_management.py | 20 +- .../tunnels/{ => cloudflared}/test_token.py | 20 +- .../zero_trust/tunnels/test_cloudflared.py | 554 +++++++++++ 39 files changed, 2027 insertions(+), 1370 deletions(-) create mode 100644 src/cloudflare/resources/zero_trust/tunnels/cloudflared/__init__.py create mode 100644 src/cloudflare/resources/zero_trust/tunnels/cloudflared/cloudflared.py rename src/cloudflare/resources/zero_trust/tunnels/{ => cloudflared}/configurations.py (94%) rename src/cloudflare/resources/zero_trust/tunnels/{ => cloudflared}/connections.py (95%) rename src/cloudflare/resources/zero_trust/tunnels/{ => cloudflared}/connectors.py (95%) rename src/cloudflare/resources/zero_trust/tunnels/{ => cloudflared}/management.py (93%) rename src/cloudflare/resources/zero_trust/tunnels/{ => cloudflared}/token.py (94%) create mode 100644 src/cloudflare/types/zero_trust/tunnels/cloudflared/__init__.py rename src/cloudflare/types/zero_trust/tunnels/{ => cloudflared}/client.py (98%) rename src/cloudflare/types/zero_trust/tunnels/{ => cloudflared}/configuration_get_response.py (99%) rename src/cloudflare/types/zero_trust/tunnels/{ => cloudflared}/configuration_update_params.py (99%) rename src/cloudflare/types/zero_trust/tunnels/{ => cloudflared}/configuration_update_response.py (99%) rename src/cloudflare/types/zero_trust/tunnels/{ => cloudflared}/connection_delete_params.py (100%) rename src/cloudflare/types/zero_trust/tunnels/{ => cloudflared}/management_create_params.py (100%) rename src/cloudflare/types/zero_trust/tunnels/{ => cloudflared}/management_create_response.py (100%) rename src/cloudflare/types/zero_trust/tunnels/{ => cloudflared}/token_get_response.py (100%) rename src/cloudflare/types/zero_trust/{tunnel_create_params.py => tunnels/cloudflared_create_params.py} (88%) rename src/cloudflare/types/zero_trust/{tunnel_get_response.py => tunnels/cloudflared_create_response.py} (91%) create mode 100644 src/cloudflare/types/zero_trust/tunnels/cloudflared_delete_response.py rename src/cloudflare/types/zero_trust/{tunnel_edit_params.py => tunnels/cloudflared_edit_params.py} (83%) rename src/cloudflare/types/zero_trust/{tunnel_create_response.py => tunnels/cloudflared_edit_response.py} (91%) rename src/cloudflare/types/zero_trust/{tunnel_edit_response.py => tunnels/cloudflared_get_response.py} (91%) create mode 100644 src/cloudflare/types/zero_trust/tunnels/cloudflared_list_params.py rename src/cloudflare/types/zero_trust/{tunnel_delete_response.py => tunnels/cloudflared_list_response.py} (91%) create mode 100644 tests/api_resources/zero_trust/tunnels/cloudflared/__init__.py rename tests/api_resources/zero_trust/tunnels/{ => cloudflared}/test_configurations.py (87%) rename tests/api_resources/zero_trust/tunnels/{ => cloudflared}/test_connections.py (82%) rename tests/api_resources/zero_trust/tunnels/{ => cloudflared}/test_connectors.py (84%) rename tests/api_resources/zero_trust/tunnels/{ => cloudflared}/test_management.py (85%) rename tests/api_resources/zero_trust/tunnels/{ => cloudflared}/test_token.py (84%) create mode 100644 tests/api_resources/zero_trust/tunnels/test_cloudflared.py diff --git a/.stats.yml b/.stats.yml index 2101a4a55a3..586e7223084 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 1525 +configured_endpoints: 1526 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e6f75d6387709ef6a98e7327b59c7ca9205e26a1252ea5e370e75be27ec21022.yml diff --git a/api.md b/api.md index 5434c74eb40..fc77eff415c 100644 --- a/api.md +++ b/api.md @@ -5833,116 +5833,127 @@ Methods: Types: ```python -from cloudflare.types.zero_trust import ( - Connection, - TunnelCreateResponse, - TunnelListResponse, - TunnelDeleteResponse, - TunnelEditResponse, - TunnelGetResponse, -) +from cloudflare.types.zero_trust import Connection, TunnelListResponse ``` Methods: -- client.zero_trust.tunnels.create(\*, account_id, \*\*params) -> TunnelCreateResponse -- client.zero_trust.tunnels.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[TunnelListResponse] -- client.zero_trust.tunnels.delete(tunnel_id, \*, account_id) -> TunnelDeleteResponse -- client.zero_trust.tunnels.edit(tunnel_id, \*, account_id, \*\*params) -> TunnelEditResponse -- client.zero_trust.tunnels.get(tunnel_id, \*, account_id) -> TunnelGetResponse +- client.zero_trust.tunnels.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[TunnelListResponse] -### WARPConnector +### Cloudflared Types: ```python from cloudflare.types.zero_trust.tunnels import ( - WARPConnectorCreateResponse, - WARPConnectorListResponse, - WARPConnectorDeleteResponse, - WARPConnectorEditResponse, - WARPConnectorGetResponse, + CloudflaredCreateResponse, + CloudflaredListResponse, + CloudflaredDeleteResponse, + CloudflaredEditResponse, + CloudflaredGetResponse, ) ``` Methods: -- client.zero_trust.tunnels.warp_connector.create(\*, account_id, \*\*params) -> WARPConnectorCreateResponse -- client.zero_trust.tunnels.warp_connector.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[WARPConnectorListResponse] -- client.zero_trust.tunnels.warp_connector.delete(tunnel_id, \*, account_id) -> WARPConnectorDeleteResponse -- client.zero_trust.tunnels.warp_connector.edit(tunnel_id, \*, account_id, \*\*params) -> WARPConnectorEditResponse -- client.zero_trust.tunnels.warp_connector.get(tunnel_id, \*, account_id) -> WARPConnectorGetResponse +- client.zero_trust.tunnels.cloudflared.create(\*, account_id, \*\*params) -> CloudflaredCreateResponse +- client.zero_trust.tunnels.cloudflared.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[CloudflaredListResponse] +- client.zero_trust.tunnels.cloudflared.delete(tunnel_id, \*, account_id) -> CloudflaredDeleteResponse +- client.zero_trust.tunnels.cloudflared.edit(tunnel_id, \*, account_id, \*\*params) -> CloudflaredEditResponse +- client.zero_trust.tunnels.cloudflared.get(tunnel_id, \*, account_id) -> CloudflaredGetResponse -#### Token +#### Configurations Types: ```python -from cloudflare.types.zero_trust.tunnels.warp_connector import TokenGetResponse +from cloudflare.types.zero_trust.tunnels.cloudflared import ( + ConfigurationUpdateResponse, + ConfigurationGetResponse, +) ``` Methods: -- client.zero_trust.tunnels.warp_connector.token.get(tunnel_id, \*, account_id) -> str +- client.zero_trust.tunnels.cloudflared.configurations.update(tunnel_id, \*, account_id, \*\*params) -> Optional[ConfigurationUpdateResponse] +- client.zero_trust.tunnels.cloudflared.configurations.get(tunnel_id, \*, account_id) -> Optional[ConfigurationGetResponse] -### Configurations +#### Connections Types: ```python -from cloudflare.types.zero_trust.tunnels import ( - ConfigurationUpdateResponse, - ConfigurationGetResponse, -) +from cloudflare.types.zero_trust.tunnels.cloudflared import Client, ConnectionDeleteResponse ``` Methods: -- client.zero_trust.tunnels.configurations.update(tunnel_id, \*, account_id, \*\*params) -> Optional[ConfigurationUpdateResponse] -- client.zero_trust.tunnels.configurations.get(tunnel_id, \*, account_id) -> Optional[ConfigurationGetResponse] +- client.zero_trust.tunnels.cloudflared.connections.delete(tunnel_id, \*, account_id, \*\*params) -> object +- client.zero_trust.tunnels.cloudflared.connections.get(tunnel_id, \*, account_id) -> SyncSinglePage[Client] -### Connections +#### Token Types: ```python -from cloudflare.types.zero_trust.tunnels import Client, ConnectionDeleteResponse +from cloudflare.types.zero_trust.tunnels.cloudflared import TokenGetResponse ``` Methods: -- client.zero_trust.tunnels.connections.delete(tunnel_id, \*, account_id, \*\*params) -> object -- client.zero_trust.tunnels.connections.get(tunnel_id, \*, account_id) -> SyncSinglePage[Client] +- client.zero_trust.tunnels.cloudflared.token.get(tunnel_id, \*, account_id) -> str -### Token +#### Connectors + +Methods: + +- client.zero_trust.tunnels.cloudflared.connectors.get(connector_id, \*, account_id, tunnel_id) -> Client + +#### Management Types: ```python -from cloudflare.types.zero_trust.tunnels import TokenGetResponse +from cloudflare.types.zero_trust.tunnels.cloudflared import ManagementCreateResponse ``` Methods: -- client.zero_trust.tunnels.token.get(tunnel_id, \*, account_id) -> str +- client.zero_trust.tunnels.cloudflared.management.create(tunnel_id, \*, account_id, \*\*params) -> str -### Connectors +### WARPConnector + +Types: + +```python +from cloudflare.types.zero_trust.tunnels import ( + WARPConnectorCreateResponse, + WARPConnectorListResponse, + WARPConnectorDeleteResponse, + WARPConnectorEditResponse, + WARPConnectorGetResponse, +) +``` Methods: -- client.zero_trust.tunnels.connectors.get(connector_id, \*, account_id, tunnel_id) -> Client +- client.zero_trust.tunnels.warp_connector.create(\*, account_id, \*\*params) -> WARPConnectorCreateResponse +- client.zero_trust.tunnels.warp_connector.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[WARPConnectorListResponse] +- client.zero_trust.tunnels.warp_connector.delete(tunnel_id, \*, account_id) -> WARPConnectorDeleteResponse +- client.zero_trust.tunnels.warp_connector.edit(tunnel_id, \*, account_id, \*\*params) -> WARPConnectorEditResponse +- client.zero_trust.tunnels.warp_connector.get(tunnel_id, \*, account_id) -> WARPConnectorGetResponse -### Management +#### Token Types: ```python -from cloudflare.types.zero_trust.tunnels import ManagementCreateResponse +from cloudflare.types.zero_trust.tunnels.warp_connector import TokenGetResponse ``` Methods: -- client.zero_trust.tunnels.management.create(tunnel_id, \*, account_id, \*\*params) -> str +- client.zero_trust.tunnels.warp_connector.token.get(tunnel_id, \*, account_id) -> str ## ConnectivitySettings diff --git a/src/cloudflare/resources/zero_trust/tunnels/__init__.py b/src/cloudflare/resources/zero_trust/tunnels/__init__.py index cbb476ac799..7bd5ec5c21f 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/__init__.py +++ b/src/cloudflare/resources/zero_trust/tunnels/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .token import ( - TokenResource, - AsyncTokenResource, - TokenResourceWithRawResponse, - AsyncTokenResourceWithRawResponse, - TokenResourceWithStreamingResponse, - AsyncTokenResourceWithStreamingResponse, -) from .tunnels import ( TunnelsResource, AsyncTunnelsResource, @@ -16,37 +8,13 @@ TunnelsResourceWithStreamingResponse, AsyncTunnelsResourceWithStreamingResponse, ) -from .connectors import ( - ConnectorsResource, - AsyncConnectorsResource, - ConnectorsResourceWithRawResponse, - AsyncConnectorsResourceWithRawResponse, - ConnectorsResourceWithStreamingResponse, - AsyncConnectorsResourceWithStreamingResponse, -) -from .management import ( - ManagementResource, - AsyncManagementResource, - ManagementResourceWithRawResponse, - AsyncManagementResourceWithRawResponse, - ManagementResourceWithStreamingResponse, - AsyncManagementResourceWithStreamingResponse, -) -from .connections import ( - ConnectionsResource, - AsyncConnectionsResource, - ConnectionsResourceWithRawResponse, - AsyncConnectionsResourceWithRawResponse, - ConnectionsResourceWithStreamingResponse, - AsyncConnectionsResourceWithStreamingResponse, -) -from .configurations import ( - ConfigurationsResource, - AsyncConfigurationsResource, - ConfigurationsResourceWithRawResponse, - AsyncConfigurationsResourceWithRawResponse, - ConfigurationsResourceWithStreamingResponse, - AsyncConfigurationsResourceWithStreamingResponse, +from .cloudflared import ( + CloudflaredResource, + AsyncCloudflaredResource, + CloudflaredResourceWithRawResponse, + AsyncCloudflaredResourceWithRawResponse, + CloudflaredResourceWithStreamingResponse, + AsyncCloudflaredResourceWithStreamingResponse, ) from .warp_connector import ( WARPConnectorResource, @@ -58,42 +26,18 @@ ) __all__ = [ + "CloudflaredResource", + "AsyncCloudflaredResource", + "CloudflaredResourceWithRawResponse", + "AsyncCloudflaredResourceWithRawResponse", + "CloudflaredResourceWithStreamingResponse", + "AsyncCloudflaredResourceWithStreamingResponse", "WARPConnectorResource", "AsyncWARPConnectorResource", "WARPConnectorResourceWithRawResponse", "AsyncWARPConnectorResourceWithRawResponse", "WARPConnectorResourceWithStreamingResponse", "AsyncWARPConnectorResourceWithStreamingResponse", - "ConfigurationsResource", - "AsyncConfigurationsResource", - "ConfigurationsResourceWithRawResponse", - "AsyncConfigurationsResourceWithRawResponse", - "ConfigurationsResourceWithStreamingResponse", - "AsyncConfigurationsResourceWithStreamingResponse", - "ConnectionsResource", - "AsyncConnectionsResource", - "ConnectionsResourceWithRawResponse", - "AsyncConnectionsResourceWithRawResponse", - "ConnectionsResourceWithStreamingResponse", - "AsyncConnectionsResourceWithStreamingResponse", - "TokenResource", - "AsyncTokenResource", - "TokenResourceWithRawResponse", - "AsyncTokenResourceWithRawResponse", - "TokenResourceWithStreamingResponse", - "AsyncTokenResourceWithStreamingResponse", - "ConnectorsResource", - "AsyncConnectorsResource", - "ConnectorsResourceWithRawResponse", - "AsyncConnectorsResourceWithRawResponse", - "ConnectorsResourceWithStreamingResponse", - "AsyncConnectorsResourceWithStreamingResponse", - "ManagementResource", - "AsyncManagementResource", - "ManagementResourceWithRawResponse", - "AsyncManagementResourceWithRawResponse", - "ManagementResourceWithStreamingResponse", - "AsyncManagementResourceWithStreamingResponse", "TunnelsResource", "AsyncTunnelsResource", "TunnelsResourceWithRawResponse", diff --git a/src/cloudflare/resources/zero_trust/tunnels/cloudflared/__init__.py b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/__init__.py new file mode 100644 index 00000000000..1a1c8c15bbe --- /dev/null +++ b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/__init__.py @@ -0,0 +1,89 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .token import ( + TokenResource, + AsyncTokenResource, + TokenResourceWithRawResponse, + AsyncTokenResourceWithRawResponse, + TokenResourceWithStreamingResponse, + AsyncTokenResourceWithStreamingResponse, +) +from .connectors import ( + ConnectorsResource, + AsyncConnectorsResource, + ConnectorsResourceWithRawResponse, + AsyncConnectorsResourceWithRawResponse, + ConnectorsResourceWithStreamingResponse, + AsyncConnectorsResourceWithStreamingResponse, +) +from .management import ( + ManagementResource, + AsyncManagementResource, + ManagementResourceWithRawResponse, + AsyncManagementResourceWithRawResponse, + ManagementResourceWithStreamingResponse, + AsyncManagementResourceWithStreamingResponse, +) +from .cloudflared import ( + CloudflaredResource, + AsyncCloudflaredResource, + CloudflaredResourceWithRawResponse, + AsyncCloudflaredResourceWithRawResponse, + CloudflaredResourceWithStreamingResponse, + AsyncCloudflaredResourceWithStreamingResponse, +) +from .connections import ( + ConnectionsResource, + AsyncConnectionsResource, + ConnectionsResourceWithRawResponse, + AsyncConnectionsResourceWithRawResponse, + ConnectionsResourceWithStreamingResponse, + AsyncConnectionsResourceWithStreamingResponse, +) +from .configurations import ( + ConfigurationsResource, + AsyncConfigurationsResource, + ConfigurationsResourceWithRawResponse, + AsyncConfigurationsResourceWithRawResponse, + ConfigurationsResourceWithStreamingResponse, + AsyncConfigurationsResourceWithStreamingResponse, +) + +__all__ = [ + "ConfigurationsResource", + "AsyncConfigurationsResource", + "ConfigurationsResourceWithRawResponse", + "AsyncConfigurationsResourceWithRawResponse", + "ConfigurationsResourceWithStreamingResponse", + "AsyncConfigurationsResourceWithStreamingResponse", + "ConnectionsResource", + "AsyncConnectionsResource", + "ConnectionsResourceWithRawResponse", + "AsyncConnectionsResourceWithRawResponse", + "ConnectionsResourceWithStreamingResponse", + "AsyncConnectionsResourceWithStreamingResponse", + "TokenResource", + "AsyncTokenResource", + "TokenResourceWithRawResponse", + "AsyncTokenResourceWithRawResponse", + "TokenResourceWithStreamingResponse", + "AsyncTokenResourceWithStreamingResponse", + "ConnectorsResource", + "AsyncConnectorsResource", + "ConnectorsResourceWithRawResponse", + "AsyncConnectorsResourceWithRawResponse", + "ConnectorsResourceWithStreamingResponse", + "AsyncConnectorsResourceWithStreamingResponse", + "ManagementResource", + "AsyncManagementResource", + "ManagementResourceWithRawResponse", + "AsyncManagementResourceWithRawResponse", + "ManagementResourceWithStreamingResponse", + "AsyncManagementResourceWithStreamingResponse", + "CloudflaredResource", + "AsyncCloudflaredResource", + "CloudflaredResourceWithRawResponse", + "AsyncCloudflaredResourceWithRawResponse", + "CloudflaredResourceWithStreamingResponse", + "AsyncCloudflaredResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/zero_trust/tunnels/cloudflared/cloudflared.py b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/cloudflared.py new file mode 100644 index 00000000000..d65559085f6 --- /dev/null +++ b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/cloudflared.py @@ -0,0 +1,940 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Any, Union, cast +from datetime import datetime +from typing_extensions import Literal + +import httpx + +from .token import ( + TokenResource, + AsyncTokenResource, + TokenResourceWithRawResponse, + AsyncTokenResourceWithRawResponse, + TokenResourceWithStreamingResponse, + AsyncTokenResourceWithStreamingResponse, +) +from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._utils import ( + maybe_transform, + async_maybe_transform, +) +from .connectors import ( + ConnectorsResource, + AsyncConnectorsResource, + ConnectorsResourceWithRawResponse, + AsyncConnectorsResourceWithRawResponse, + ConnectorsResourceWithStreamingResponse, + AsyncConnectorsResourceWithStreamingResponse, +) +from .management import ( + ManagementResource, + AsyncManagementResource, + ManagementResourceWithRawResponse, + AsyncManagementResourceWithRawResponse, + ManagementResourceWithStreamingResponse, + AsyncManagementResourceWithStreamingResponse, +) +from ....._compat import cached_property +from .connections import ( + ConnectionsResource, + AsyncConnectionsResource, + ConnectionsResourceWithRawResponse, + AsyncConnectionsResourceWithRawResponse, + ConnectionsResourceWithStreamingResponse, + AsyncConnectionsResourceWithStreamingResponse, +) +from ....._resource import SyncAPIResource, AsyncAPIResource +from ....._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ....._wrappers import ResultWrapper +from .....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray +from .configurations import ( + ConfigurationsResource, + AsyncConfigurationsResource, + ConfigurationsResourceWithRawResponse, + AsyncConfigurationsResourceWithRawResponse, + ConfigurationsResourceWithStreamingResponse, + AsyncConfigurationsResourceWithStreamingResponse, +) +from ....._base_client import AsyncPaginator, make_request_options +from .....types.zero_trust.tunnels import cloudflared_edit_params, cloudflared_list_params, cloudflared_create_params +from .....types.zero_trust.tunnels.cloudflared_get_response import CloudflaredGetResponse +from .....types.zero_trust.tunnels.cloudflared_edit_response import CloudflaredEditResponse +from .....types.zero_trust.tunnels.cloudflared_list_response import CloudflaredListResponse +from .....types.zero_trust.tunnels.cloudflared_create_response import CloudflaredCreateResponse +from .....types.zero_trust.tunnels.cloudflared_delete_response import CloudflaredDeleteResponse + +__all__ = ["CloudflaredResource", "AsyncCloudflaredResource"] + + +class CloudflaredResource(SyncAPIResource): + @cached_property + def configurations(self) -> ConfigurationsResource: + return ConfigurationsResource(self._client) + + @cached_property + def connections(self) -> ConnectionsResource: + return ConnectionsResource(self._client) + + @cached_property + def token(self) -> TokenResource: + return TokenResource(self._client) + + @cached_property + def connectors(self) -> ConnectorsResource: + return ConnectorsResource(self._client) + + @cached_property + def management(self) -> ManagementResource: + return ManagementResource(self._client) + + @cached_property + def with_raw_response(self) -> CloudflaredResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return CloudflaredResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> CloudflaredResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return CloudflaredResourceWithStreamingResponse(self) + + def create( + self, + *, + account_id: str, + name: str, + config_src: Literal["local", "cloudflare"] | NotGiven = NOT_GIVEN, + tunnel_secret: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CloudflaredCreateResponse: + """ + Creates a new Cloudflare Tunnel in an account. + + Args: + account_id: Cloudflare account ID + + name: A user-friendly name for a tunnel. + + config_src: Indicates if this is a locally or remotely configured tunnel. If `local`, manage + the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the + tunnel on the Zero Trust dashboard. + + tunnel_secret: Sets the password required to run a locally-managed tunnel. Must be at least 32 + bytes and encoded as a base64 string. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return cast( + CloudflaredCreateResponse, + self._post( + f"/accounts/{account_id}/cfd_tunnel", + body=maybe_transform( + { + "name": name, + "config_src": config_src, + "tunnel_secret": tunnel_secret, + }, + cloudflared_create_params.CloudflaredCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[CloudflaredCreateResponse]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[CloudflaredCreateResponse] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + def list( + self, + *, + account_id: str, + exclude_prefix: str | NotGiven = NOT_GIVEN, + existed_at: str | NotGiven = NOT_GIVEN, + include_prefix: str | NotGiven = NOT_GIVEN, + is_deleted: bool | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + page: float | NotGiven = NOT_GIVEN, + per_page: float | NotGiven = NOT_GIVEN, + status: Literal["inactive", "degraded", "healthy", "down"] | NotGiven = NOT_GIVEN, + uuid: str | NotGiven = NOT_GIVEN, + was_active_at: Union[str, datetime] | NotGiven = NOT_GIVEN, + was_inactive_at: Union[str, datetime] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncV4PagePaginationArray[CloudflaredListResponse]: + """ + Lists and filters Cloudflare Tunnels in an account. + + Args: + account_id: Cloudflare account ID + + existed_at: If provided, include only resources that were created (and not deleted) before + this time. URL encoded. + + is_deleted: If `true`, only include deleted tunnels. If `false`, exclude deleted tunnels. If + empty, all tunnels will be included. + + name: A user-friendly name for a tunnel. + + page: Page number of paginated results. + + per_page: Number of results to display. + + status: The status of the tunnel. Valid values are `inactive` (tunnel has never been + run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy + state), `healthy` (tunnel is active and able to serve traffic), or `down` + (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). + + uuid: UUID of the tunnel. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get_api_list( + f"/accounts/{account_id}/cfd_tunnel", + page=SyncV4PagePaginationArray[CloudflaredListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "exclude_prefix": exclude_prefix, + "existed_at": existed_at, + "include_prefix": include_prefix, + "is_deleted": is_deleted, + "name": name, + "page": page, + "per_page": per_page, + "status": status, + "uuid": uuid, + "was_active_at": was_active_at, + "was_inactive_at": was_inactive_at, + }, + cloudflared_list_params.CloudflaredListParams, + ), + ), + model=cast(Any, CloudflaredListResponse), # Union types cannot be passed in as arguments in the type system + ) + + def delete( + self, + tunnel_id: str, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CloudflaredDeleteResponse: + """ + Deletes a Cloudflare Tunnel from an account. + + Args: + account_id: Cloudflare account ID + + tunnel_id: UUID of the tunnel. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not tunnel_id: + raise ValueError(f"Expected a non-empty value for `tunnel_id` but received {tunnel_id!r}") + return cast( + CloudflaredDeleteResponse, + self._delete( + f"/accounts/{account_id}/cfd_tunnel/{tunnel_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[CloudflaredDeleteResponse]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[CloudflaredDeleteResponse] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + def edit( + self, + tunnel_id: str, + *, + account_id: str, + name: str | NotGiven = NOT_GIVEN, + tunnel_secret: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CloudflaredEditResponse: + """ + Updates an existing Cloudflare Tunnel. + + Args: + account_id: Cloudflare account ID + + tunnel_id: UUID of the tunnel. + + name: A user-friendly name for a tunnel. + + tunnel_secret: Sets the password required to run a locally-managed tunnel. Must be at least 32 + bytes and encoded as a base64 string. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not tunnel_id: + raise ValueError(f"Expected a non-empty value for `tunnel_id` but received {tunnel_id!r}") + return cast( + CloudflaredEditResponse, + self._patch( + f"/accounts/{account_id}/cfd_tunnel/{tunnel_id}", + body=maybe_transform( + { + "name": name, + "tunnel_secret": tunnel_secret, + }, + cloudflared_edit_params.CloudflaredEditParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[CloudflaredEditResponse]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[CloudflaredEditResponse] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + def get( + self, + tunnel_id: str, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CloudflaredGetResponse: + """ + Fetches a single Cloudflare Tunnel. + + Args: + account_id: Cloudflare account ID + + tunnel_id: UUID of the tunnel. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not tunnel_id: + raise ValueError(f"Expected a non-empty value for `tunnel_id` but received {tunnel_id!r}") + return cast( + CloudflaredGetResponse, + self._get( + f"/accounts/{account_id}/cfd_tunnel/{tunnel_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[CloudflaredGetResponse]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[CloudflaredGetResponse] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + +class AsyncCloudflaredResource(AsyncAPIResource): + @cached_property + def configurations(self) -> AsyncConfigurationsResource: + return AsyncConfigurationsResource(self._client) + + @cached_property + def connections(self) -> AsyncConnectionsResource: + return AsyncConnectionsResource(self._client) + + @cached_property + def token(self) -> AsyncTokenResource: + return AsyncTokenResource(self._client) + + @cached_property + def connectors(self) -> AsyncConnectorsResource: + return AsyncConnectorsResource(self._client) + + @cached_property + def management(self) -> AsyncManagementResource: + return AsyncManagementResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncCloudflaredResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncCloudflaredResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncCloudflaredResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncCloudflaredResourceWithStreamingResponse(self) + + async def create( + self, + *, + account_id: str, + name: str, + config_src: Literal["local", "cloudflare"] | NotGiven = NOT_GIVEN, + tunnel_secret: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CloudflaredCreateResponse: + """ + Creates a new Cloudflare Tunnel in an account. + + Args: + account_id: Cloudflare account ID + + name: A user-friendly name for a tunnel. + + config_src: Indicates if this is a locally or remotely configured tunnel. If `local`, manage + the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the + tunnel on the Zero Trust dashboard. + + tunnel_secret: Sets the password required to run a locally-managed tunnel. Must be at least 32 + bytes and encoded as a base64 string. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return cast( + CloudflaredCreateResponse, + await self._post( + f"/accounts/{account_id}/cfd_tunnel", + body=await async_maybe_transform( + { + "name": name, + "config_src": config_src, + "tunnel_secret": tunnel_secret, + }, + cloudflared_create_params.CloudflaredCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[CloudflaredCreateResponse]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[CloudflaredCreateResponse] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + def list( + self, + *, + account_id: str, + exclude_prefix: str | NotGiven = NOT_GIVEN, + existed_at: str | NotGiven = NOT_GIVEN, + include_prefix: str | NotGiven = NOT_GIVEN, + is_deleted: bool | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + page: float | NotGiven = NOT_GIVEN, + per_page: float | NotGiven = NOT_GIVEN, + status: Literal["inactive", "degraded", "healthy", "down"] | NotGiven = NOT_GIVEN, + uuid: str | NotGiven = NOT_GIVEN, + was_active_at: Union[str, datetime] | NotGiven = NOT_GIVEN, + was_inactive_at: Union[str, datetime] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[CloudflaredListResponse, AsyncV4PagePaginationArray[CloudflaredListResponse]]: + """ + Lists and filters Cloudflare Tunnels in an account. + + Args: + account_id: Cloudflare account ID + + existed_at: If provided, include only resources that were created (and not deleted) before + this time. URL encoded. + + is_deleted: If `true`, only include deleted tunnels. If `false`, exclude deleted tunnels. If + empty, all tunnels will be included. + + name: A user-friendly name for a tunnel. + + page: Page number of paginated results. + + per_page: Number of results to display. + + status: The status of the tunnel. Valid values are `inactive` (tunnel has never been + run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy + state), `healthy` (tunnel is active and able to serve traffic), or `down` + (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). + + uuid: UUID of the tunnel. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get_api_list( + f"/accounts/{account_id}/cfd_tunnel", + page=AsyncV4PagePaginationArray[CloudflaredListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "exclude_prefix": exclude_prefix, + "existed_at": existed_at, + "include_prefix": include_prefix, + "is_deleted": is_deleted, + "name": name, + "page": page, + "per_page": per_page, + "status": status, + "uuid": uuid, + "was_active_at": was_active_at, + "was_inactive_at": was_inactive_at, + }, + cloudflared_list_params.CloudflaredListParams, + ), + ), + model=cast(Any, CloudflaredListResponse), # Union types cannot be passed in as arguments in the type system + ) + + async def delete( + self, + tunnel_id: str, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CloudflaredDeleteResponse: + """ + Deletes a Cloudflare Tunnel from an account. + + Args: + account_id: Cloudflare account ID + + tunnel_id: UUID of the tunnel. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not tunnel_id: + raise ValueError(f"Expected a non-empty value for `tunnel_id` but received {tunnel_id!r}") + return cast( + CloudflaredDeleteResponse, + await self._delete( + f"/accounts/{account_id}/cfd_tunnel/{tunnel_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[CloudflaredDeleteResponse]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[CloudflaredDeleteResponse] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + async def edit( + self, + tunnel_id: str, + *, + account_id: str, + name: str | NotGiven = NOT_GIVEN, + tunnel_secret: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CloudflaredEditResponse: + """ + Updates an existing Cloudflare Tunnel. + + Args: + account_id: Cloudflare account ID + + tunnel_id: UUID of the tunnel. + + name: A user-friendly name for a tunnel. + + tunnel_secret: Sets the password required to run a locally-managed tunnel. Must be at least 32 + bytes and encoded as a base64 string. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not tunnel_id: + raise ValueError(f"Expected a non-empty value for `tunnel_id` but received {tunnel_id!r}") + return cast( + CloudflaredEditResponse, + await self._patch( + f"/accounts/{account_id}/cfd_tunnel/{tunnel_id}", + body=await async_maybe_transform( + { + "name": name, + "tunnel_secret": tunnel_secret, + }, + cloudflared_edit_params.CloudflaredEditParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[CloudflaredEditResponse]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[CloudflaredEditResponse] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + async def get( + self, + tunnel_id: str, + *, + account_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CloudflaredGetResponse: + """ + Fetches a single Cloudflare Tunnel. + + Args: + account_id: Cloudflare account ID + + tunnel_id: UUID of the tunnel. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not tunnel_id: + raise ValueError(f"Expected a non-empty value for `tunnel_id` but received {tunnel_id!r}") + return cast( + CloudflaredGetResponse, + await self._get( + f"/accounts/{account_id}/cfd_tunnel/{tunnel_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[CloudflaredGetResponse]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[CloudflaredGetResponse] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + +class CloudflaredResourceWithRawResponse: + def __init__(self, cloudflared: CloudflaredResource) -> None: + self._cloudflared = cloudflared + + self.create = to_raw_response_wrapper( + cloudflared.create, + ) + self.list = to_raw_response_wrapper( + cloudflared.list, + ) + self.delete = to_raw_response_wrapper( + cloudflared.delete, + ) + self.edit = to_raw_response_wrapper( + cloudflared.edit, + ) + self.get = to_raw_response_wrapper( + cloudflared.get, + ) + + @cached_property + def configurations(self) -> ConfigurationsResourceWithRawResponse: + return ConfigurationsResourceWithRawResponse(self._cloudflared.configurations) + + @cached_property + def connections(self) -> ConnectionsResourceWithRawResponse: + return ConnectionsResourceWithRawResponse(self._cloudflared.connections) + + @cached_property + def token(self) -> TokenResourceWithRawResponse: + return TokenResourceWithRawResponse(self._cloudflared.token) + + @cached_property + def connectors(self) -> ConnectorsResourceWithRawResponse: + return ConnectorsResourceWithRawResponse(self._cloudflared.connectors) + + @cached_property + def management(self) -> ManagementResourceWithRawResponse: + return ManagementResourceWithRawResponse(self._cloudflared.management) + + +class AsyncCloudflaredResourceWithRawResponse: + def __init__(self, cloudflared: AsyncCloudflaredResource) -> None: + self._cloudflared = cloudflared + + self.create = async_to_raw_response_wrapper( + cloudflared.create, + ) + self.list = async_to_raw_response_wrapper( + cloudflared.list, + ) + self.delete = async_to_raw_response_wrapper( + cloudflared.delete, + ) + self.edit = async_to_raw_response_wrapper( + cloudflared.edit, + ) + self.get = async_to_raw_response_wrapper( + cloudflared.get, + ) + + @cached_property + def configurations(self) -> AsyncConfigurationsResourceWithRawResponse: + return AsyncConfigurationsResourceWithRawResponse(self._cloudflared.configurations) + + @cached_property + def connections(self) -> AsyncConnectionsResourceWithRawResponse: + return AsyncConnectionsResourceWithRawResponse(self._cloudflared.connections) + + @cached_property + def token(self) -> AsyncTokenResourceWithRawResponse: + return AsyncTokenResourceWithRawResponse(self._cloudflared.token) + + @cached_property + def connectors(self) -> AsyncConnectorsResourceWithRawResponse: + return AsyncConnectorsResourceWithRawResponse(self._cloudflared.connectors) + + @cached_property + def management(self) -> AsyncManagementResourceWithRawResponse: + return AsyncManagementResourceWithRawResponse(self._cloudflared.management) + + +class CloudflaredResourceWithStreamingResponse: + def __init__(self, cloudflared: CloudflaredResource) -> None: + self._cloudflared = cloudflared + + self.create = to_streamed_response_wrapper( + cloudflared.create, + ) + self.list = to_streamed_response_wrapper( + cloudflared.list, + ) + self.delete = to_streamed_response_wrapper( + cloudflared.delete, + ) + self.edit = to_streamed_response_wrapper( + cloudflared.edit, + ) + self.get = to_streamed_response_wrapper( + cloudflared.get, + ) + + @cached_property + def configurations(self) -> ConfigurationsResourceWithStreamingResponse: + return ConfigurationsResourceWithStreamingResponse(self._cloudflared.configurations) + + @cached_property + def connections(self) -> ConnectionsResourceWithStreamingResponse: + return ConnectionsResourceWithStreamingResponse(self._cloudflared.connections) + + @cached_property + def token(self) -> TokenResourceWithStreamingResponse: + return TokenResourceWithStreamingResponse(self._cloudflared.token) + + @cached_property + def connectors(self) -> ConnectorsResourceWithStreamingResponse: + return ConnectorsResourceWithStreamingResponse(self._cloudflared.connectors) + + @cached_property + def management(self) -> ManagementResourceWithStreamingResponse: + return ManagementResourceWithStreamingResponse(self._cloudflared.management) + + +class AsyncCloudflaredResourceWithStreamingResponse: + def __init__(self, cloudflared: AsyncCloudflaredResource) -> None: + self._cloudflared = cloudflared + + self.create = async_to_streamed_response_wrapper( + cloudflared.create, + ) + self.list = async_to_streamed_response_wrapper( + cloudflared.list, + ) + self.delete = async_to_streamed_response_wrapper( + cloudflared.delete, + ) + self.edit = async_to_streamed_response_wrapper( + cloudflared.edit, + ) + self.get = async_to_streamed_response_wrapper( + cloudflared.get, + ) + + @cached_property + def configurations(self) -> AsyncConfigurationsResourceWithStreamingResponse: + return AsyncConfigurationsResourceWithStreamingResponse(self._cloudflared.configurations) + + @cached_property + def connections(self) -> AsyncConnectionsResourceWithStreamingResponse: + return AsyncConnectionsResourceWithStreamingResponse(self._cloudflared.connections) + + @cached_property + def token(self) -> AsyncTokenResourceWithStreamingResponse: + return AsyncTokenResourceWithStreamingResponse(self._cloudflared.token) + + @cached_property + def connectors(self) -> AsyncConnectorsResourceWithStreamingResponse: + return AsyncConnectorsResourceWithStreamingResponse(self._cloudflared.connectors) + + @cached_property + def management(self) -> AsyncManagementResourceWithStreamingResponse: + return AsyncManagementResourceWithStreamingResponse(self._cloudflared.management) diff --git a/src/cloudflare/resources/zero_trust/tunnels/configurations.py b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/configurations.py similarity index 94% rename from src/cloudflare/resources/zero_trust/tunnels/configurations.py rename to src/cloudflare/resources/zero_trust/tunnels/cloudflared/configurations.py index b2f61626590..1e10e1ddc82 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/configurations.py +++ b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/configurations.py @@ -6,24 +6,24 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import ( +from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._utils import ( maybe_transform, async_maybe_transform, ) -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( +from ....._compat import cached_property +from ....._resource import SyncAPIResource, AsyncAPIResource +from ....._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...._wrappers import ResultWrapper -from ...._base_client import make_request_options -from ....types.zero_trust.tunnels import configuration_update_params -from ....types.zero_trust.tunnels.configuration_get_response import ConfigurationGetResponse -from ....types.zero_trust.tunnels.configuration_update_response import ConfigurationUpdateResponse +from ....._wrappers import ResultWrapper +from ....._base_client import make_request_options +from .....types.zero_trust.tunnels.cloudflared import configuration_update_params +from .....types.zero_trust.tunnels.cloudflared.configuration_get_response import ConfigurationGetResponse +from .....types.zero_trust.tunnels.cloudflared.configuration_update_response import ConfigurationUpdateResponse __all__ = ["ConfigurationsResource", "AsyncConfigurationsResource"] diff --git a/src/cloudflare/resources/zero_trust/tunnels/connections.py b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/connections.py similarity index 95% rename from src/cloudflare/resources/zero_trust/tunnels/connections.py rename to src/cloudflare/resources/zero_trust/tunnels/cloudflared/connections.py index 17707e7c12b..6a38b3ce064 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/connections.py +++ b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/connections.py @@ -6,24 +6,24 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import ( +from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._utils import ( maybe_transform, async_maybe_transform, ) -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( +from ....._compat import cached_property +from ....._resource import SyncAPIResource, AsyncAPIResource +from ....._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...._wrappers import ResultWrapper -from ....pagination import SyncSinglePage, AsyncSinglePage -from ...._base_client import AsyncPaginator, make_request_options -from ....types.zero_trust.tunnels import connection_delete_params -from ....types.zero_trust.tunnels.client import Client +from ....._wrappers import ResultWrapper +from .....pagination import SyncSinglePage, AsyncSinglePage +from ....._base_client import AsyncPaginator, make_request_options +from .....types.zero_trust.tunnels.cloudflared import connection_delete_params +from .....types.zero_trust.tunnels.cloudflared.client import Client __all__ = ["ConnectionsResource", "AsyncConnectionsResource"] diff --git a/src/cloudflare/resources/zero_trust/tunnels/connectors.py b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/connectors.py similarity index 95% rename from src/cloudflare/resources/zero_trust/tunnels/connectors.py rename to src/cloudflare/resources/zero_trust/tunnels/cloudflared/connectors.py index b3ec0ac4218..ca3f2df3469 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/connectors.py +++ b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/connectors.py @@ -6,18 +6,18 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( +from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._compat import cached_property +from ....._resource import SyncAPIResource, AsyncAPIResource +from ....._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...._wrappers import ResultWrapper -from ...._base_client import make_request_options -from ....types.zero_trust.tunnels.client import Client +from ....._wrappers import ResultWrapper +from ....._base_client import make_request_options +from .....types.zero_trust.tunnels.cloudflared.client import Client __all__ = ["ConnectorsResource", "AsyncConnectorsResource"] diff --git a/src/cloudflare/resources/zero_trust/tunnels/management.py b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/management.py similarity index 93% rename from src/cloudflare/resources/zero_trust/tunnels/management.py rename to src/cloudflare/resources/zero_trust/tunnels/cloudflared/management.py index 7fadf30409e..b72e7aa7b72 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/management.py +++ b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/management.py @@ -7,23 +7,23 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import ( +from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._utils import ( maybe_transform, async_maybe_transform, ) -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( +from ....._compat import cached_property +from ....._resource import SyncAPIResource, AsyncAPIResource +from ....._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...._wrappers import ResultWrapper -from ...._base_client import make_request_options -from ....types.zero_trust.tunnels import management_create_params -from ....types.zero_trust.tunnels.management_create_response import ManagementCreateResponse +from ....._wrappers import ResultWrapper +from ....._base_client import make_request_options +from .....types.zero_trust.tunnels.cloudflared import management_create_params +from .....types.zero_trust.tunnels.cloudflared.management_create_response import ManagementCreateResponse __all__ = ["ManagementResource", "AsyncManagementResource"] diff --git a/src/cloudflare/resources/zero_trust/tunnels/token.py b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/token.py similarity index 94% rename from src/cloudflare/resources/zero_trust/tunnels/token.py rename to src/cloudflare/resources/zero_trust/tunnels/cloudflared/token.py index d27bbf0a9a0..b232723a816 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/token.py +++ b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/token.py @@ -6,18 +6,18 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( +from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._compat import cached_property +from ....._resource import SyncAPIResource, AsyncAPIResource +from ....._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...._wrappers import ResultWrapper -from ...._base_client import make_request_options -from ....types.zero_trust.tunnels.token_get_response import TokenGetResponse +from ....._wrappers import ResultWrapper +from ....._base_client import make_request_options +from .....types.zero_trust.tunnels.cloudflared.token_get_response import TokenGetResponse __all__ = ["TokenResource", "AsyncTokenResource"] diff --git a/src/cloudflare/resources/zero_trust/tunnels/tunnels.py b/src/cloudflare/resources/zero_trust/tunnels/tunnels.py index 074ff6a31b9..643d366411c 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/tunnels.py +++ b/src/cloudflare/resources/zero_trust/tunnels/tunnels.py @@ -8,44 +8,9 @@ import httpx -from .token import ( - TokenResource, - AsyncTokenResource, - TokenResourceWithRawResponse, - AsyncTokenResourceWithRawResponse, - TokenResourceWithStreamingResponse, - AsyncTokenResourceWithStreamingResponse, -) from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import ( - maybe_transform, - async_maybe_transform, -) +from ...._utils import maybe_transform from ...._compat import cached_property -from .connectors import ( - ConnectorsResource, - AsyncConnectorsResource, - ConnectorsResourceWithRawResponse, - AsyncConnectorsResourceWithRawResponse, - ConnectorsResourceWithStreamingResponse, - AsyncConnectorsResourceWithStreamingResponse, -) -from .management import ( - ManagementResource, - AsyncManagementResource, - ManagementResourceWithRawResponse, - AsyncManagementResourceWithRawResponse, - ManagementResourceWithStreamingResponse, - AsyncManagementResourceWithStreamingResponse, -) -from .connections import ( - ConnectionsResource, - AsyncConnectionsResource, - ConnectionsResourceWithRawResponse, - AsyncConnectionsResourceWithRawResponse, - ConnectionsResourceWithStreamingResponse, - AsyncConnectionsResourceWithStreamingResponse, -) from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( to_raw_response_wrapper, @@ -53,18 +18,17 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...._wrappers import ResultWrapper from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray -from .configurations import ( - ConfigurationsResource, - AsyncConfigurationsResource, - ConfigurationsResourceWithRawResponse, - AsyncConfigurationsResourceWithRawResponse, - ConfigurationsResourceWithStreamingResponse, - AsyncConfigurationsResourceWithStreamingResponse, -) from ...._base_client import AsyncPaginator, make_request_options -from ....types.zero_trust import tunnel_edit_params, tunnel_list_params, tunnel_create_params +from ....types.zero_trust import tunnel_list_params +from .cloudflared.cloudflared import ( + CloudflaredResource, + AsyncCloudflaredResource, + CloudflaredResourceWithRawResponse, + AsyncCloudflaredResourceWithRawResponse, + CloudflaredResourceWithStreamingResponse, + AsyncCloudflaredResourceWithStreamingResponse, +) from .warp_connector.warp_connector import ( WARPConnectorResource, AsyncWARPConnectorResource, @@ -73,39 +37,19 @@ WARPConnectorResourceWithStreamingResponse, AsyncWARPConnectorResourceWithStreamingResponse, ) -from ....types.zero_trust.tunnel_get_response import TunnelGetResponse -from ....types.zero_trust.tunnel_edit_response import TunnelEditResponse from ....types.zero_trust.tunnel_list_response import TunnelListResponse -from ....types.zero_trust.tunnel_create_response import TunnelCreateResponse -from ....types.zero_trust.tunnel_delete_response import TunnelDeleteResponse __all__ = ["TunnelsResource", "AsyncTunnelsResource"] class TunnelsResource(SyncAPIResource): @cached_property - def warp_connector(self) -> WARPConnectorResource: - return WARPConnectorResource(self._client) - - @cached_property - def configurations(self) -> ConfigurationsResource: - return ConfigurationsResource(self._client) + def cloudflared(self) -> CloudflaredResource: + return CloudflaredResource(self._client) @cached_property - def connections(self) -> ConnectionsResource: - return ConnectionsResource(self._client) - - @cached_property - def token(self) -> TokenResource: - return TokenResource(self._client) - - @cached_property - def connectors(self) -> ConnectorsResource: - return ConnectorsResource(self._client) - - @cached_property - def management(self) -> ManagementResource: - return ManagementResource(self._client) + def warp_connector(self) -> WARPConnectorResource: + return WARPConnectorResource(self._client) @cached_property def with_raw_response(self) -> TunnelsResourceWithRawResponse: @@ -126,70 +70,6 @@ def with_streaming_response(self) -> TunnelsResourceWithStreamingResponse: """ return TunnelsResourceWithStreamingResponse(self) - def create( - self, - *, - account_id: str, - name: str, - config_src: Literal["local", "cloudflare"] | NotGiven = NOT_GIVEN, - tunnel_secret: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TunnelCreateResponse: - """ - Creates a new Cloudflare Tunnel in an account. - - Args: - account_id: Cloudflare account ID - - name: A user-friendly name for a tunnel. - - config_src: Indicates if this is a locally or remotely configured tunnel. If `local`, manage - the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the - tunnel on the Zero Trust dashboard. - - tunnel_secret: Sets the password required to run a locally-managed tunnel. Must be at least 32 - bytes and encoded as a base64 string. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return cast( - TunnelCreateResponse, - self._post( - f"/accounts/{account_id}/cfd_tunnel", - body=maybe_transform( - { - "name": name, - "config_src": config_src, - "tunnel_secret": tunnel_secret, - }, - tunnel_create_params.TunnelCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[TunnelCreateResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[TunnelCreateResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - def list( self, *, @@ -202,6 +82,7 @@ def list( page: float | NotGiven = NOT_GIVEN, per_page: float | NotGiven = NOT_GIVEN, status: Literal["inactive", "degraded", "healthy", "down"] | NotGiven = NOT_GIVEN, + tun_types: str | NotGiven = NOT_GIVEN, uuid: str | NotGiven = NOT_GIVEN, was_active_at: Union[str, datetime] | NotGiven = NOT_GIVEN, was_inactive_at: Union[str, datetime] | NotGiven = NOT_GIVEN, @@ -213,7 +94,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncV4PagePaginationArray[TunnelListResponse]: """ - Lists and filters Cloudflare Tunnels in an account. + Lists and filters all types of Tunnels in an account. Args: account_id: Cloudflare account ID @@ -224,7 +105,7 @@ def list( is_deleted: If `true`, only include deleted tunnels. If `false`, exclude deleted tunnels. If empty, all tunnels will be included. - name: A user-friendly name for a tunnel. + name: A user-friendly name for the tunnel. page: Page number of paginated results. @@ -235,6 +116,8 @@ def list( state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). + tun_types: The types of tunnels to filter separated by a comma. + uuid: UUID of the tunnel. extra_headers: Send extra headers @@ -248,7 +131,7 @@ def list( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( - f"/accounts/{account_id}/cfd_tunnel", + f"/accounts/{account_id}/tunnels", page=SyncV4PagePaginationArray[TunnelListResponse], options=make_request_options( extra_headers=extra_headers, @@ -265,6 +148,7 @@ def list( "page": page, "per_page": per_page, "status": status, + "tun_types": tun_types, "uuid": uuid, "was_active_at": was_active_at, "was_inactive_at": was_inactive_at, @@ -275,192 +159,15 @@ def list( model=cast(Any, TunnelListResponse), # Union types cannot be passed in as arguments in the type system ) - def delete( - self, - tunnel_id: str, - *, - account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TunnelDeleteResponse: - """ - Deletes a Cloudflare Tunnel from an account. - - Args: - account_id: Cloudflare account ID - - tunnel_id: UUID of the tunnel. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not tunnel_id: - raise ValueError(f"Expected a non-empty value for `tunnel_id` but received {tunnel_id!r}") - return cast( - TunnelDeleteResponse, - self._delete( - f"/accounts/{account_id}/cfd_tunnel/{tunnel_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[TunnelDeleteResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[TunnelDeleteResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - def edit( - self, - tunnel_id: str, - *, - account_id: str, - name: str | NotGiven = NOT_GIVEN, - tunnel_secret: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TunnelEditResponse: - """ - Updates an existing Cloudflare Tunnel. - - Args: - account_id: Cloudflare account ID - - tunnel_id: UUID of the tunnel. - - name: A user-friendly name for a tunnel. - - tunnel_secret: Sets the password required to run a locally-managed tunnel. Must be at least 32 - bytes and encoded as a base64 string. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not tunnel_id: - raise ValueError(f"Expected a non-empty value for `tunnel_id` but received {tunnel_id!r}") - return cast( - TunnelEditResponse, - self._patch( - f"/accounts/{account_id}/cfd_tunnel/{tunnel_id}", - body=maybe_transform( - { - "name": name, - "tunnel_secret": tunnel_secret, - }, - tunnel_edit_params.TunnelEditParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[TunnelEditResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[TunnelEditResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - def get( - self, - tunnel_id: str, - *, - account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TunnelGetResponse: - """ - Fetches a single Cloudflare Tunnel. - - Args: - account_id: Cloudflare account ID - - tunnel_id: UUID of the tunnel. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not tunnel_id: - raise ValueError(f"Expected a non-empty value for `tunnel_id` but received {tunnel_id!r}") - return cast( - TunnelGetResponse, - self._get( - f"/accounts/{account_id}/cfd_tunnel/{tunnel_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[TunnelGetResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[TunnelGetResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - class AsyncTunnelsResource(AsyncAPIResource): @cached_property - def warp_connector(self) -> AsyncWARPConnectorResource: - return AsyncWARPConnectorResource(self._client) - - @cached_property - def configurations(self) -> AsyncConfigurationsResource: - return AsyncConfigurationsResource(self._client) - - @cached_property - def connections(self) -> AsyncConnectionsResource: - return AsyncConnectionsResource(self._client) - - @cached_property - def token(self) -> AsyncTokenResource: - return AsyncTokenResource(self._client) - - @cached_property - def connectors(self) -> AsyncConnectorsResource: - return AsyncConnectorsResource(self._client) + def cloudflared(self) -> AsyncCloudflaredResource: + return AsyncCloudflaredResource(self._client) @cached_property - def management(self) -> AsyncManagementResource: - return AsyncManagementResource(self._client) + def warp_connector(self) -> AsyncWARPConnectorResource: + return AsyncWARPConnectorResource(self._client) @cached_property def with_raw_response(self) -> AsyncTunnelsResourceWithRawResponse: @@ -481,70 +188,6 @@ def with_streaming_response(self) -> AsyncTunnelsResourceWithStreamingResponse: """ return AsyncTunnelsResourceWithStreamingResponse(self) - async def create( - self, - *, - account_id: str, - name: str, - config_src: Literal["local", "cloudflare"] | NotGiven = NOT_GIVEN, - tunnel_secret: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TunnelCreateResponse: - """ - Creates a new Cloudflare Tunnel in an account. - - Args: - account_id: Cloudflare account ID - - name: A user-friendly name for a tunnel. - - config_src: Indicates if this is a locally or remotely configured tunnel. If `local`, manage - the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the - tunnel on the Zero Trust dashboard. - - tunnel_secret: Sets the password required to run a locally-managed tunnel. Must be at least 32 - bytes and encoded as a base64 string. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return cast( - TunnelCreateResponse, - await self._post( - f"/accounts/{account_id}/cfd_tunnel", - body=await async_maybe_transform( - { - "name": name, - "config_src": config_src, - "tunnel_secret": tunnel_secret, - }, - tunnel_create_params.TunnelCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[TunnelCreateResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[TunnelCreateResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - def list( self, *, @@ -557,6 +200,7 @@ def list( page: float | NotGiven = NOT_GIVEN, per_page: float | NotGiven = NOT_GIVEN, status: Literal["inactive", "degraded", "healthy", "down"] | NotGiven = NOT_GIVEN, + tun_types: str | NotGiven = NOT_GIVEN, uuid: str | NotGiven = NOT_GIVEN, was_active_at: Union[str, datetime] | NotGiven = NOT_GIVEN, was_inactive_at: Union[str, datetime] | NotGiven = NOT_GIVEN, @@ -568,7 +212,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[TunnelListResponse, AsyncV4PagePaginationArray[TunnelListResponse]]: """ - Lists and filters Cloudflare Tunnels in an account. + Lists and filters all types of Tunnels in an account. Args: account_id: Cloudflare account ID @@ -579,7 +223,7 @@ def list( is_deleted: If `true`, only include deleted tunnels. If `false`, exclude deleted tunnels. If empty, all tunnels will be included. - name: A user-friendly name for a tunnel. + name: A user-friendly name for the tunnel. page: Page number of paginated results. @@ -590,6 +234,8 @@ def list( state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). + tun_types: The types of tunnels to filter separated by a comma. + uuid: UUID of the tunnel. extra_headers: Send extra headers @@ -603,7 +249,7 @@ def list( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( - f"/accounts/{account_id}/cfd_tunnel", + f"/accounts/{account_id}/tunnels", page=AsyncV4PagePaginationArray[TunnelListResponse], options=make_request_options( extra_headers=extra_headers, @@ -620,6 +266,7 @@ def list( "page": page, "per_page": per_page, "status": status, + "tun_types": tun_types, "uuid": uuid, "was_active_at": was_active_at, "was_inactive_at": was_inactive_at, @@ -630,343 +277,70 @@ def list( model=cast(Any, TunnelListResponse), # Union types cannot be passed in as arguments in the type system ) - async def delete( - self, - tunnel_id: str, - *, - account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TunnelDeleteResponse: - """ - Deletes a Cloudflare Tunnel from an account. - - Args: - account_id: Cloudflare account ID - - tunnel_id: UUID of the tunnel. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not tunnel_id: - raise ValueError(f"Expected a non-empty value for `tunnel_id` but received {tunnel_id!r}") - return cast( - TunnelDeleteResponse, - await self._delete( - f"/accounts/{account_id}/cfd_tunnel/{tunnel_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[TunnelDeleteResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[TunnelDeleteResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - async def edit( - self, - tunnel_id: str, - *, - account_id: str, - name: str | NotGiven = NOT_GIVEN, - tunnel_secret: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TunnelEditResponse: - """ - Updates an existing Cloudflare Tunnel. - - Args: - account_id: Cloudflare account ID - - tunnel_id: UUID of the tunnel. - - name: A user-friendly name for a tunnel. - - tunnel_secret: Sets the password required to run a locally-managed tunnel. Must be at least 32 - bytes and encoded as a base64 string. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not tunnel_id: - raise ValueError(f"Expected a non-empty value for `tunnel_id` but received {tunnel_id!r}") - return cast( - TunnelEditResponse, - await self._patch( - f"/accounts/{account_id}/cfd_tunnel/{tunnel_id}", - body=await async_maybe_transform( - { - "name": name, - "tunnel_secret": tunnel_secret, - }, - tunnel_edit_params.TunnelEditParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[TunnelEditResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[TunnelEditResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - async def get( - self, - tunnel_id: str, - *, - account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TunnelGetResponse: - """ - Fetches a single Cloudflare Tunnel. - - Args: - account_id: Cloudflare account ID - - tunnel_id: UUID of the tunnel. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not tunnel_id: - raise ValueError(f"Expected a non-empty value for `tunnel_id` but received {tunnel_id!r}") - return cast( - TunnelGetResponse, - await self._get( - f"/accounts/{account_id}/cfd_tunnel/{tunnel_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[TunnelGetResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[TunnelGetResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - class TunnelsResourceWithRawResponse: def __init__(self, tunnels: TunnelsResource) -> None: self._tunnels = tunnels - self.create = to_raw_response_wrapper( - tunnels.create, - ) self.list = to_raw_response_wrapper( tunnels.list, ) - self.delete = to_raw_response_wrapper( - tunnels.delete, - ) - self.edit = to_raw_response_wrapper( - tunnels.edit, - ) - self.get = to_raw_response_wrapper( - tunnels.get, - ) - - @cached_property - def warp_connector(self) -> WARPConnectorResourceWithRawResponse: - return WARPConnectorResourceWithRawResponse(self._tunnels.warp_connector) - - @cached_property - def configurations(self) -> ConfigurationsResourceWithRawResponse: - return ConfigurationsResourceWithRawResponse(self._tunnels.configurations) - - @cached_property - def connections(self) -> ConnectionsResourceWithRawResponse: - return ConnectionsResourceWithRawResponse(self._tunnels.connections) @cached_property - def token(self) -> TokenResourceWithRawResponse: - return TokenResourceWithRawResponse(self._tunnels.token) + def cloudflared(self) -> CloudflaredResourceWithRawResponse: + return CloudflaredResourceWithRawResponse(self._tunnels.cloudflared) @cached_property - def connectors(self) -> ConnectorsResourceWithRawResponse: - return ConnectorsResourceWithRawResponse(self._tunnels.connectors) - - @cached_property - def management(self) -> ManagementResourceWithRawResponse: - return ManagementResourceWithRawResponse(self._tunnels.management) + def warp_connector(self) -> WARPConnectorResourceWithRawResponse: + return WARPConnectorResourceWithRawResponse(self._tunnels.warp_connector) class AsyncTunnelsResourceWithRawResponse: def __init__(self, tunnels: AsyncTunnelsResource) -> None: self._tunnels = tunnels - self.create = async_to_raw_response_wrapper( - tunnels.create, - ) self.list = async_to_raw_response_wrapper( tunnels.list, ) - self.delete = async_to_raw_response_wrapper( - tunnels.delete, - ) - self.edit = async_to_raw_response_wrapper( - tunnels.edit, - ) - self.get = async_to_raw_response_wrapper( - tunnels.get, - ) @cached_property - def warp_connector(self) -> AsyncWARPConnectorResourceWithRawResponse: - return AsyncWARPConnectorResourceWithRawResponse(self._tunnels.warp_connector) - - @cached_property - def configurations(self) -> AsyncConfigurationsResourceWithRawResponse: - return AsyncConfigurationsResourceWithRawResponse(self._tunnels.configurations) - - @cached_property - def connections(self) -> AsyncConnectionsResourceWithRawResponse: - return AsyncConnectionsResourceWithRawResponse(self._tunnels.connections) + def cloudflared(self) -> AsyncCloudflaredResourceWithRawResponse: + return AsyncCloudflaredResourceWithRawResponse(self._tunnels.cloudflared) @cached_property - def token(self) -> AsyncTokenResourceWithRawResponse: - return AsyncTokenResourceWithRawResponse(self._tunnels.token) - - @cached_property - def connectors(self) -> AsyncConnectorsResourceWithRawResponse: - return AsyncConnectorsResourceWithRawResponse(self._tunnels.connectors) - - @cached_property - def management(self) -> AsyncManagementResourceWithRawResponse: - return AsyncManagementResourceWithRawResponse(self._tunnels.management) + def warp_connector(self) -> AsyncWARPConnectorResourceWithRawResponse: + return AsyncWARPConnectorResourceWithRawResponse(self._tunnels.warp_connector) class TunnelsResourceWithStreamingResponse: def __init__(self, tunnels: TunnelsResource) -> None: self._tunnels = tunnels - self.create = to_streamed_response_wrapper( - tunnels.create, - ) self.list = to_streamed_response_wrapper( tunnels.list, ) - self.delete = to_streamed_response_wrapper( - tunnels.delete, - ) - self.edit = to_streamed_response_wrapper( - tunnels.edit, - ) - self.get = to_streamed_response_wrapper( - tunnels.get, - ) - - @cached_property - def warp_connector(self) -> WARPConnectorResourceWithStreamingResponse: - return WARPConnectorResourceWithStreamingResponse(self._tunnels.warp_connector) - - @cached_property - def configurations(self) -> ConfigurationsResourceWithStreamingResponse: - return ConfigurationsResourceWithStreamingResponse(self._tunnels.configurations) @cached_property - def connections(self) -> ConnectionsResourceWithStreamingResponse: - return ConnectionsResourceWithStreamingResponse(self._tunnels.connections) + def cloudflared(self) -> CloudflaredResourceWithStreamingResponse: + return CloudflaredResourceWithStreamingResponse(self._tunnels.cloudflared) @cached_property - def token(self) -> TokenResourceWithStreamingResponse: - return TokenResourceWithStreamingResponse(self._tunnels.token) - - @cached_property - def connectors(self) -> ConnectorsResourceWithStreamingResponse: - return ConnectorsResourceWithStreamingResponse(self._tunnels.connectors) - - @cached_property - def management(self) -> ManagementResourceWithStreamingResponse: - return ManagementResourceWithStreamingResponse(self._tunnels.management) + def warp_connector(self) -> WARPConnectorResourceWithStreamingResponse: + return WARPConnectorResourceWithStreamingResponse(self._tunnels.warp_connector) class AsyncTunnelsResourceWithStreamingResponse: def __init__(self, tunnels: AsyncTunnelsResource) -> None: self._tunnels = tunnels - self.create = async_to_streamed_response_wrapper( - tunnels.create, - ) self.list = async_to_streamed_response_wrapper( tunnels.list, ) - self.delete = async_to_streamed_response_wrapper( - tunnels.delete, - ) - self.edit = async_to_streamed_response_wrapper( - tunnels.edit, - ) - self.get = async_to_streamed_response_wrapper( - tunnels.get, - ) - - @cached_property - def warp_connector(self) -> AsyncWARPConnectorResourceWithStreamingResponse: - return AsyncWARPConnectorResourceWithStreamingResponse(self._tunnels.warp_connector) @cached_property - def configurations(self) -> AsyncConfigurationsResourceWithStreamingResponse: - return AsyncConfigurationsResourceWithStreamingResponse(self._tunnels.configurations) + def cloudflared(self) -> AsyncCloudflaredResourceWithStreamingResponse: + return AsyncCloudflaredResourceWithStreamingResponse(self._tunnels.cloudflared) @cached_property - def connections(self) -> AsyncConnectionsResourceWithStreamingResponse: - return AsyncConnectionsResourceWithStreamingResponse(self._tunnels.connections) - - @cached_property - def token(self) -> AsyncTokenResourceWithStreamingResponse: - return AsyncTokenResourceWithStreamingResponse(self._tunnels.token) - - @cached_property - def connectors(self) -> AsyncConnectorsResourceWithStreamingResponse: - return AsyncConnectorsResourceWithStreamingResponse(self._tunnels.connectors) - - @cached_property - def management(self) -> AsyncManagementResourceWithStreamingResponse: - return AsyncManagementResourceWithStreamingResponse(self._tunnels.management) + def warp_connector(self) -> AsyncWARPConnectorResourceWithStreamingResponse: + return AsyncWARPConnectorResourceWithStreamingResponse(self._tunnels.warp_connector) diff --git a/src/cloudflare/types/zero_trust/__init__.py b/src/cloudflare/types/zero_trust/__init__.py index 28b23b2cbfa..d273fdf3bb4 100644 --- a/src/cloudflare/types/zero_trust/__init__.py +++ b/src/cloudflare/types/zero_trust/__init__.py @@ -13,19 +13,13 @@ from .seat_edit_params import SeatEditParams as SeatEditParams from .identity_provider import IdentityProvider as IdentityProvider from .login_design_param import LoginDesignParam as LoginDesignParam -from .tunnel_edit_params import TunnelEditParams as TunnelEditParams from .tunnel_list_params import TunnelListParams as TunnelListParams from .device_get_response import DeviceGetResponse as DeviceGetResponse -from .tunnel_get_response import TunnelGetResponse as TunnelGetResponse from .generic_oauth_config import GenericOAuthConfig as GenericOAuthConfig -from .tunnel_create_params import TunnelCreateParams as TunnelCreateParams -from .tunnel_edit_response import TunnelEditResponse as TunnelEditResponse from .tunnel_list_response import TunnelListResponse as TunnelListResponse from .gateway_list_response import GatewayListResponse as GatewayListResponse from .network_path_response import NetworkPathResponse as NetworkPathResponse from .identity_provider_type import IdentityProviderType as IdentityProviderType -from .tunnel_create_response import TunnelCreateResponse as TunnelCreateResponse -from .tunnel_delete_response import TunnelDeleteResponse as TunnelDeleteResponse from .gateway_create_response import GatewayCreateResponse as GatewayCreateResponse from .identity_provider_param import IdentityProviderParam as IdentityProviderParam from .risk_scoring_get_response import RiskScoringGetResponse as RiskScoringGetResponse diff --git a/src/cloudflare/types/zero_trust/tunnel_list_params.py b/src/cloudflare/types/zero_trust/tunnel_list_params.py index 1fff18dd6f7..b13b2cfe8a0 100644 --- a/src/cloudflare/types/zero_trust/tunnel_list_params.py +++ b/src/cloudflare/types/zero_trust/tunnel_list_params.py @@ -32,7 +32,7 @@ class TunnelListParams(TypedDict, total=False): """ name: str - """A user-friendly name for a tunnel.""" + """A user-friendly name for the tunnel.""" page: float """Page number of paginated results.""" @@ -49,6 +49,9 @@ class TunnelListParams(TypedDict, total=False): it has no connections to the Cloudflare Edge). """ + tun_types: str + """The types of tunnels to filter separated by a comma.""" + uuid: str """UUID of the tunnel.""" diff --git a/src/cloudflare/types/zero_trust/tunnels/__init__.py b/src/cloudflare/types/zero_trust/tunnels/__init__.py index 6919a9d8226..53fbc107f71 100644 --- a/src/cloudflare/types/zero_trust/tunnels/__init__.py +++ b/src/cloudflare/types/zero_trust/tunnels/__init__.py @@ -2,19 +2,19 @@ from __future__ import annotations -from .client import Client as Client -from .token_get_response import TokenGetResponse as TokenGetResponse -from .connection_delete_params import ConnectionDeleteParams as ConnectionDeleteParams -from .management_create_params import ManagementCreateParams as ManagementCreateParams -from .configuration_get_response import ConfigurationGetResponse as ConfigurationGetResponse -from .management_create_response import ManagementCreateResponse as ManagementCreateResponse +from .cloudflared_edit_params import CloudflaredEditParams as CloudflaredEditParams +from .cloudflared_list_params import CloudflaredListParams as CloudflaredListParams +from .cloudflared_get_response import CloudflaredGetResponse as CloudflaredGetResponse +from .cloudflared_create_params import CloudflaredCreateParams as CloudflaredCreateParams +from .cloudflared_edit_response import CloudflaredEditResponse as CloudflaredEditResponse +from .cloudflared_list_response import CloudflaredListResponse as CloudflaredListResponse from .warp_connector_edit_params import WARPConnectorEditParams as WARPConnectorEditParams from .warp_connector_list_params import WARPConnectorListParams as WARPConnectorListParams -from .configuration_update_params import ConfigurationUpdateParams as ConfigurationUpdateParams +from .cloudflared_create_response import CloudflaredCreateResponse as CloudflaredCreateResponse +from .cloudflared_delete_response import CloudflaredDeleteResponse as CloudflaredDeleteResponse from .warp_connector_get_response import WARPConnectorGetResponse as WARPConnectorGetResponse from .warp_connector_create_params import WARPConnectorCreateParams as WARPConnectorCreateParams from .warp_connector_edit_response import WARPConnectorEditResponse as WARPConnectorEditResponse from .warp_connector_list_response import WARPConnectorListResponse as WARPConnectorListResponse -from .configuration_update_response import ConfigurationUpdateResponse as ConfigurationUpdateResponse from .warp_connector_create_response import WARPConnectorCreateResponse as WARPConnectorCreateResponse from .warp_connector_delete_response import WARPConnectorDeleteResponse as WARPConnectorDeleteResponse diff --git a/src/cloudflare/types/zero_trust/tunnels/cloudflared/__init__.py b/src/cloudflare/types/zero_trust/tunnels/cloudflared/__init__.py new file mode 100644 index 00000000000..7a1a419e61d --- /dev/null +++ b/src/cloudflare/types/zero_trust/tunnels/cloudflared/__init__.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .client import Client as Client +from .token_get_response import TokenGetResponse as TokenGetResponse +from .connection_delete_params import ConnectionDeleteParams as ConnectionDeleteParams +from .management_create_params import ManagementCreateParams as ManagementCreateParams +from .configuration_get_response import ConfigurationGetResponse as ConfigurationGetResponse +from .management_create_response import ManagementCreateResponse as ManagementCreateResponse +from .configuration_update_params import ConfigurationUpdateParams as ConfigurationUpdateParams +from .configuration_update_response import ConfigurationUpdateResponse as ConfigurationUpdateResponse diff --git a/src/cloudflare/types/zero_trust/tunnels/client.py b/src/cloudflare/types/zero_trust/tunnels/cloudflared/client.py similarity index 98% rename from src/cloudflare/types/zero_trust/tunnels/client.py rename to src/cloudflare/types/zero_trust/tunnels/cloudflared/client.py index 2e8e5b973fc..83fa5ca3bb3 100644 --- a/src/cloudflare/types/zero_trust/tunnels/client.py +++ b/src/cloudflare/types/zero_trust/tunnels/cloudflared/client.py @@ -3,7 +3,7 @@ from typing import List, Optional from datetime import datetime -from ...._models import BaseModel +from ....._models import BaseModel __all__ = ["Client", "Conn"] diff --git a/src/cloudflare/types/zero_trust/tunnels/configuration_get_response.py b/src/cloudflare/types/zero_trust/tunnels/cloudflared/configuration_get_response.py similarity index 99% rename from src/cloudflare/types/zero_trust/tunnels/configuration_get_response.py rename to src/cloudflare/types/zero_trust/tunnels/cloudflared/configuration_get_response.py index 6a0b7fa7a75..e6d61f07870 100644 --- a/src/cloudflare/types/zero_trust/tunnels/configuration_get_response.py +++ b/src/cloudflare/types/zero_trust/tunnels/cloudflared/configuration_get_response.py @@ -6,7 +6,7 @@ from pydantic import Field as FieldInfo -from ...._models import BaseModel +from ....._models import BaseModel __all__ = [ "ConfigurationGetResponse", diff --git a/src/cloudflare/types/zero_trust/tunnels/configuration_update_params.py b/src/cloudflare/types/zero_trust/tunnels/cloudflared/configuration_update_params.py similarity index 99% rename from src/cloudflare/types/zero_trust/tunnels/configuration_update_params.py rename to src/cloudflare/types/zero_trust/tunnels/cloudflared/configuration_update_params.py index 2268ca3e3f2..d03b2ac9864 100644 --- a/src/cloudflare/types/zero_trust/tunnels/configuration_update_params.py +++ b/src/cloudflare/types/zero_trust/tunnels/cloudflared/configuration_update_params.py @@ -5,7 +5,7 @@ from typing import List, Iterable from typing_extensions import Required, Annotated, TypedDict -from ...._utils import PropertyInfo +from ....._utils import PropertyInfo __all__ = [ "ConfigurationUpdateParams", diff --git a/src/cloudflare/types/zero_trust/tunnels/configuration_update_response.py b/src/cloudflare/types/zero_trust/tunnels/cloudflared/configuration_update_response.py similarity index 99% rename from src/cloudflare/types/zero_trust/tunnels/configuration_update_response.py rename to src/cloudflare/types/zero_trust/tunnels/cloudflared/configuration_update_response.py index 7b517480655..b3d9f5820dd 100644 --- a/src/cloudflare/types/zero_trust/tunnels/configuration_update_response.py +++ b/src/cloudflare/types/zero_trust/tunnels/cloudflared/configuration_update_response.py @@ -6,7 +6,7 @@ from pydantic import Field as FieldInfo -from ...._models import BaseModel +from ....._models import BaseModel __all__ = [ "ConfigurationUpdateResponse", diff --git a/src/cloudflare/types/zero_trust/tunnels/connection_delete_params.py b/src/cloudflare/types/zero_trust/tunnels/cloudflared/connection_delete_params.py similarity index 100% rename from src/cloudflare/types/zero_trust/tunnels/connection_delete_params.py rename to src/cloudflare/types/zero_trust/tunnels/cloudflared/connection_delete_params.py diff --git a/src/cloudflare/types/zero_trust/tunnels/management_create_params.py b/src/cloudflare/types/zero_trust/tunnels/cloudflared/management_create_params.py similarity index 100% rename from src/cloudflare/types/zero_trust/tunnels/management_create_params.py rename to src/cloudflare/types/zero_trust/tunnels/cloudflared/management_create_params.py diff --git a/src/cloudflare/types/zero_trust/tunnels/management_create_response.py b/src/cloudflare/types/zero_trust/tunnels/cloudflared/management_create_response.py similarity index 100% rename from src/cloudflare/types/zero_trust/tunnels/management_create_response.py rename to src/cloudflare/types/zero_trust/tunnels/cloudflared/management_create_response.py diff --git a/src/cloudflare/types/zero_trust/tunnels/token_get_response.py b/src/cloudflare/types/zero_trust/tunnels/cloudflared/token_get_response.py similarity index 100% rename from src/cloudflare/types/zero_trust/tunnels/token_get_response.py rename to src/cloudflare/types/zero_trust/tunnels/cloudflared/token_get_response.py diff --git a/src/cloudflare/types/zero_trust/tunnel_create_params.py b/src/cloudflare/types/zero_trust/tunnels/cloudflared_create_params.py similarity index 88% rename from src/cloudflare/types/zero_trust/tunnel_create_params.py rename to src/cloudflare/types/zero_trust/tunnels/cloudflared_create_params.py index d2534885e3a..6e77f7c3e75 100644 --- a/src/cloudflare/types/zero_trust/tunnel_create_params.py +++ b/src/cloudflare/types/zero_trust/tunnels/cloudflared_create_params.py @@ -4,10 +4,10 @@ from typing_extensions import Literal, Required, TypedDict -__all__ = ["TunnelCreateParams"] +__all__ = ["CloudflaredCreateParams"] -class TunnelCreateParams(TypedDict, total=False): +class CloudflaredCreateParams(TypedDict, total=False): account_id: Required[str] """Cloudflare account ID""" diff --git a/src/cloudflare/types/zero_trust/tunnel_get_response.py b/src/cloudflare/types/zero_trust/tunnels/cloudflared_create_response.py similarity index 91% rename from src/cloudflare/types/zero_trust/tunnel_get_response.py rename to src/cloudflare/types/zero_trust/tunnels/cloudflared_create_response.py index be2db79f5d1..752e3006709 100644 --- a/src/cloudflare/types/zero_trust/tunnel_get_response.py +++ b/src/cloudflare/types/zero_trust/tunnels/cloudflared_create_response.py @@ -4,10 +4,10 @@ from datetime import datetime from typing_extensions import Literal, TypeAlias -from ..._models import BaseModel -from ..shared.cloudflare_tunnel import CloudflareTunnel +from ...._models import BaseModel +from ...shared.cloudflare_tunnel import CloudflareTunnel -__all__ = ["TunnelGetResponse", "TunnelWARPConnectorTunnel", "TunnelWARPConnectorTunnelConnection"] +__all__ = ["CloudflaredCreateResponse", "TunnelWARPConnectorTunnel", "TunnelWARPConnectorTunnelConnection"] class TunnelWARPConnectorTunnelConnection(BaseModel): @@ -91,4 +91,4 @@ class TunnelWARPConnectorTunnel(BaseModel): """The type of tunnel.""" -TunnelGetResponse: TypeAlias = Union[CloudflareTunnel, TunnelWARPConnectorTunnel] +CloudflaredCreateResponse: TypeAlias = Union[CloudflareTunnel, TunnelWARPConnectorTunnel] diff --git a/src/cloudflare/types/zero_trust/tunnels/cloudflared_delete_response.py b/src/cloudflare/types/zero_trust/tunnels/cloudflared_delete_response.py new file mode 100644 index 00000000000..3c1aeb12d4a --- /dev/null +++ b/src/cloudflare/types/zero_trust/tunnels/cloudflared_delete_response.py @@ -0,0 +1,94 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal, TypeAlias + +from ...._models import BaseModel +from ...shared.cloudflare_tunnel import CloudflareTunnel + +__all__ = ["CloudflaredDeleteResponse", "TunnelWARPConnectorTunnel", "TunnelWARPConnectorTunnelConnection"] + + +class TunnelWARPConnectorTunnelConnection(BaseModel): + id: Optional[str] = None + """UUID of the Cloudflare Tunnel connection.""" + + client_id: Optional[str] = None + """UUID of the Cloudflare Tunnel connector.""" + + client_version: Optional[str] = None + """The cloudflared version used to establish this connection.""" + + colo_name: Optional[str] = None + """The Cloudflare data center used for this connection.""" + + is_pending_reconnect: Optional[bool] = None + """ + Cloudflare continues to track connections for several minutes after they + disconnect. This is an optimization to improve latency and reliability of + reconnecting. If `true`, the connection has disconnected but is still being + tracked. If `false`, the connection is actively serving traffic. + """ + + opened_at: Optional[datetime] = None + """Timestamp of when the connection was established.""" + + origin_ip: Optional[str] = None + """The public IP address of the host running cloudflared.""" + + uuid: Optional[str] = None + """UUID of the Cloudflare Tunnel connection.""" + + +class TunnelWARPConnectorTunnel(BaseModel): + id: Optional[str] = None + """UUID of the tunnel.""" + + account_tag: Optional[str] = None + """Cloudflare account ID""" + + connections: Optional[List[TunnelWARPConnectorTunnelConnection]] = None + """The Cloudflare Tunnel connections between your origin and Cloudflare's edge.""" + + conns_active_at: Optional[datetime] = None + """ + Timestamp of when the tunnel established at least one connection to Cloudflare's + edge. If `null`, the tunnel is inactive. + """ + + conns_inactive_at: Optional[datetime] = None + """ + Timestamp of when the tunnel became inactive (no connections to Cloudflare's + edge). If `null`, the tunnel is active. + """ + + created_at: Optional[datetime] = None + """Timestamp of when the resource was created.""" + + deleted_at: Optional[datetime] = None + """Timestamp of when the resource was deleted. + + If `null`, the resource has not been deleted. + """ + + metadata: Optional[object] = None + """Metadata associated with the tunnel.""" + + name: Optional[str] = None + """A user-friendly name for a tunnel.""" + + status: Optional[Literal["inactive", "degraded", "healthy", "down"]] = None + """The status of the tunnel. + + Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is + active and able to serve traffic but in an unhealthy state), `healthy` (tunnel + is active and able to serve traffic), or `down` (tunnel can not serve traffic as + it has no connections to the Cloudflare Edge). + """ + + tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "ip_sec", "gre", "cni"]] = None + """The type of tunnel.""" + + +CloudflaredDeleteResponse: TypeAlias = Union[CloudflareTunnel, TunnelWARPConnectorTunnel] diff --git a/src/cloudflare/types/zero_trust/tunnel_edit_params.py b/src/cloudflare/types/zero_trust/tunnels/cloudflared_edit_params.py similarity index 83% rename from src/cloudflare/types/zero_trust/tunnel_edit_params.py rename to src/cloudflare/types/zero_trust/tunnels/cloudflared_edit_params.py index b8174879460..ba11c0c1235 100644 --- a/src/cloudflare/types/zero_trust/tunnel_edit_params.py +++ b/src/cloudflare/types/zero_trust/tunnels/cloudflared_edit_params.py @@ -4,10 +4,10 @@ from typing_extensions import Required, TypedDict -__all__ = ["TunnelEditParams"] +__all__ = ["CloudflaredEditParams"] -class TunnelEditParams(TypedDict, total=False): +class CloudflaredEditParams(TypedDict, total=False): account_id: Required[str] """Cloudflare account ID""" diff --git a/src/cloudflare/types/zero_trust/tunnel_create_response.py b/src/cloudflare/types/zero_trust/tunnels/cloudflared_edit_response.py similarity index 91% rename from src/cloudflare/types/zero_trust/tunnel_create_response.py rename to src/cloudflare/types/zero_trust/tunnels/cloudflared_edit_response.py index a67b3e1c912..5ff0745d83b 100644 --- a/src/cloudflare/types/zero_trust/tunnel_create_response.py +++ b/src/cloudflare/types/zero_trust/tunnels/cloudflared_edit_response.py @@ -4,10 +4,10 @@ from datetime import datetime from typing_extensions import Literal, TypeAlias -from ..._models import BaseModel -from ..shared.cloudflare_tunnel import CloudflareTunnel +from ...._models import BaseModel +from ...shared.cloudflare_tunnel import CloudflareTunnel -__all__ = ["TunnelCreateResponse", "TunnelWARPConnectorTunnel", "TunnelWARPConnectorTunnelConnection"] +__all__ = ["CloudflaredEditResponse", "TunnelWARPConnectorTunnel", "TunnelWARPConnectorTunnelConnection"] class TunnelWARPConnectorTunnelConnection(BaseModel): @@ -91,4 +91,4 @@ class TunnelWARPConnectorTunnel(BaseModel): """The type of tunnel.""" -TunnelCreateResponse: TypeAlias = Union[CloudflareTunnel, TunnelWARPConnectorTunnel] +CloudflaredEditResponse: TypeAlias = Union[CloudflareTunnel, TunnelWARPConnectorTunnel] diff --git a/src/cloudflare/types/zero_trust/tunnel_edit_response.py b/src/cloudflare/types/zero_trust/tunnels/cloudflared_get_response.py similarity index 91% rename from src/cloudflare/types/zero_trust/tunnel_edit_response.py rename to src/cloudflare/types/zero_trust/tunnels/cloudflared_get_response.py index 7ca12ba393b..c0f64bf678d 100644 --- a/src/cloudflare/types/zero_trust/tunnel_edit_response.py +++ b/src/cloudflare/types/zero_trust/tunnels/cloudflared_get_response.py @@ -4,10 +4,10 @@ from datetime import datetime from typing_extensions import Literal, TypeAlias -from ..._models import BaseModel -from ..shared.cloudflare_tunnel import CloudflareTunnel +from ...._models import BaseModel +from ...shared.cloudflare_tunnel import CloudflareTunnel -__all__ = ["TunnelEditResponse", "TunnelWARPConnectorTunnel", "TunnelWARPConnectorTunnelConnection"] +__all__ = ["CloudflaredGetResponse", "TunnelWARPConnectorTunnel", "TunnelWARPConnectorTunnelConnection"] class TunnelWARPConnectorTunnelConnection(BaseModel): @@ -91,4 +91,4 @@ class TunnelWARPConnectorTunnel(BaseModel): """The type of tunnel.""" -TunnelEditResponse: TypeAlias = Union[CloudflareTunnel, TunnelWARPConnectorTunnel] +CloudflaredGetResponse: TypeAlias = Union[CloudflareTunnel, TunnelWARPConnectorTunnel] diff --git a/src/cloudflare/types/zero_trust/tunnels/cloudflared_list_params.py b/src/cloudflare/types/zero_trust/tunnels/cloudflared_list_params.py new file mode 100644 index 00000000000..cd8091795f0 --- /dev/null +++ b/src/cloudflare/types/zero_trust/tunnels/cloudflared_list_params.py @@ -0,0 +1,57 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from datetime import datetime +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ...._utils import PropertyInfo + +__all__ = ["CloudflaredListParams"] + + +class CloudflaredListParams(TypedDict, total=False): + account_id: Required[str] + """Cloudflare account ID""" + + exclude_prefix: str + + existed_at: str + """ + If provided, include only resources that were created (and not deleted) before + this time. URL encoded. + """ + + include_prefix: str + + is_deleted: bool + """If `true`, only include deleted tunnels. + + If `false`, exclude deleted tunnels. If empty, all tunnels will be included. + """ + + name: str + """A user-friendly name for a tunnel.""" + + page: float + """Page number of paginated results.""" + + per_page: float + """Number of results to display.""" + + status: Literal["inactive", "degraded", "healthy", "down"] + """The status of the tunnel. + + Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is + active and able to serve traffic but in an unhealthy state), `healthy` (tunnel + is active and able to serve traffic), or `down` (tunnel can not serve traffic as + it has no connections to the Cloudflare Edge). + """ + + uuid: str + """UUID of the tunnel.""" + + was_active_at: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + + was_inactive_at: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] diff --git a/src/cloudflare/types/zero_trust/tunnel_delete_response.py b/src/cloudflare/types/zero_trust/tunnels/cloudflared_list_response.py similarity index 91% rename from src/cloudflare/types/zero_trust/tunnel_delete_response.py rename to src/cloudflare/types/zero_trust/tunnels/cloudflared_list_response.py index 42932e259b7..a916eb409a0 100644 --- a/src/cloudflare/types/zero_trust/tunnel_delete_response.py +++ b/src/cloudflare/types/zero_trust/tunnels/cloudflared_list_response.py @@ -4,10 +4,10 @@ from datetime import datetime from typing_extensions import Literal, TypeAlias -from ..._models import BaseModel -from ..shared.cloudflare_tunnel import CloudflareTunnel +from ...._models import BaseModel +from ...shared.cloudflare_tunnel import CloudflareTunnel -__all__ = ["TunnelDeleteResponse", "TunnelWARPConnectorTunnel", "TunnelWARPConnectorTunnelConnection"] +__all__ = ["CloudflaredListResponse", "TunnelWARPConnectorTunnel", "TunnelWARPConnectorTunnelConnection"] class TunnelWARPConnectorTunnelConnection(BaseModel): @@ -91,4 +91,4 @@ class TunnelWARPConnectorTunnel(BaseModel): """The type of tunnel.""" -TunnelDeleteResponse: TypeAlias = Union[CloudflareTunnel, TunnelWARPConnectorTunnel] +CloudflaredListResponse: TypeAlias = Union[CloudflareTunnel, TunnelWARPConnectorTunnel] diff --git a/tests/api_resources/zero_trust/test_tunnels.py b/tests/api_resources/zero_trust/test_tunnels.py index 5315b4ecf8e..bb0f5803d31 100644 --- a/tests/api_resources/zero_trust/test_tunnels.py +++ b/tests/api_resources/zero_trust/test_tunnels.py @@ -11,13 +11,7 @@ from tests.utils import assert_matches_type from cloudflare._utils import parse_datetime from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray -from cloudflare.types.zero_trust import ( - TunnelGetResponse, - TunnelEditResponse, - TunnelListResponse, - TunnelCreateResponse, - TunnelDeleteResponse, -) +from cloudflare.types.zero_trust import TunnelListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -25,58 +19,6 @@ class TestTunnels: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @parametrize - def test_method_create(self, client: Cloudflare) -> None: - tunnel = client.zero_trust.tunnels.create( - account_id="699d98642c564d2e855e9661899b7252", - name="blog", - ) - assert_matches_type(TunnelCreateResponse, tunnel, path=["response"]) - - @parametrize - def test_method_create_with_all_params(self, client: Cloudflare) -> None: - tunnel = client.zero_trust.tunnels.create( - account_id="699d98642c564d2e855e9661899b7252", - name="blog", - config_src="local", - tunnel_secret="AQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIAQIDBAUGBwg=", - ) - assert_matches_type(TunnelCreateResponse, tunnel, path=["response"]) - - @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.zero_trust.tunnels.with_raw_response.create( - account_id="699d98642c564d2e855e9661899b7252", - name="blog", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - tunnel = response.parse() - assert_matches_type(TunnelCreateResponse, tunnel, path=["response"]) - - @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.zero_trust.tunnels.with_streaming_response.create( - account_id="699d98642c564d2e855e9661899b7252", - name="blog", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - tunnel = response.parse() - assert_matches_type(TunnelCreateResponse, tunnel, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.tunnels.with_raw_response.create( - account_id="", - name="blog", - ) - @parametrize def test_method_list(self, client: Cloudflare) -> None: tunnel = client.zero_trust.tunnels.list( @@ -96,6 +38,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: page=1, per_page=1, status="inactive", + tun_types="cfd_tunnel,warp_connector", uuid="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", was_active_at=parse_datetime("2009-11-10T23:00:00Z"), was_inactive_at=parse_datetime("2009-11-10T23:00:00Z"), @@ -133,216 +76,10 @@ def test_path_params_list(self, client: Cloudflare) -> None: account_id="", ) - @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - tunnel = client.zero_trust.tunnels.delete( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) - assert_matches_type(TunnelDeleteResponse, tunnel, path=["response"]) - - @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.zero_trust.tunnels.with_raw_response.delete( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - tunnel = response.parse() - assert_matches_type(TunnelDeleteResponse, tunnel, path=["response"]) - - @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.zero_trust.tunnels.with_streaming_response.delete( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - tunnel = response.parse() - assert_matches_type(TunnelDeleteResponse, tunnel, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.tunnels.with_raw_response.delete( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): - client.zero_trust.tunnels.with_raw_response.delete( - tunnel_id="", - account_id="699d98642c564d2e855e9661899b7252", - ) - - @parametrize - def test_method_edit(self, client: Cloudflare) -> None: - tunnel = client.zero_trust.tunnels.edit( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) - assert_matches_type(TunnelEditResponse, tunnel, path=["response"]) - - @parametrize - def test_method_edit_with_all_params(self, client: Cloudflare) -> None: - tunnel = client.zero_trust.tunnels.edit( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - name="blog", - tunnel_secret="AQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIAQIDBAUGBwg=", - ) - assert_matches_type(TunnelEditResponse, tunnel, path=["response"]) - - @parametrize - def test_raw_response_edit(self, client: Cloudflare) -> None: - response = client.zero_trust.tunnels.with_raw_response.edit( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - tunnel = response.parse() - assert_matches_type(TunnelEditResponse, tunnel, path=["response"]) - - @parametrize - def test_streaming_response_edit(self, client: Cloudflare) -> None: - with client.zero_trust.tunnels.with_streaming_response.edit( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - tunnel = response.parse() - assert_matches_type(TunnelEditResponse, tunnel, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_edit(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.tunnels.with_raw_response.edit( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): - client.zero_trust.tunnels.with_raw_response.edit( - tunnel_id="", - account_id="699d98642c564d2e855e9661899b7252", - ) - - @parametrize - def test_method_get(self, client: Cloudflare) -> None: - tunnel = client.zero_trust.tunnels.get( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) - assert_matches_type(TunnelGetResponse, tunnel, path=["response"]) - - @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.zero_trust.tunnels.with_raw_response.get( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - tunnel = response.parse() - assert_matches_type(TunnelGetResponse, tunnel, path=["response"]) - - @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.zero_trust.tunnels.with_streaming_response.get( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - tunnel = response.parse() - assert_matches_type(TunnelGetResponse, tunnel, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.tunnels.with_raw_response.get( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): - client.zero_trust.tunnels.with_raw_response.get( - tunnel_id="", - account_id="699d98642c564d2e855e9661899b7252", - ) - class TestAsyncTunnels: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: - tunnel = await async_client.zero_trust.tunnels.create( - account_id="699d98642c564d2e855e9661899b7252", - name="blog", - ) - assert_matches_type(TunnelCreateResponse, tunnel, path=["response"]) - - @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: - tunnel = await async_client.zero_trust.tunnels.create( - account_id="699d98642c564d2e855e9661899b7252", - name="blog", - config_src="local", - tunnel_secret="AQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIAQIDBAUGBwg=", - ) - assert_matches_type(TunnelCreateResponse, tunnel, path=["response"]) - - @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.tunnels.with_raw_response.create( - account_id="699d98642c564d2e855e9661899b7252", - name="blog", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - tunnel = await response.parse() - assert_matches_type(TunnelCreateResponse, tunnel, path=["response"]) - - @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.tunnels.with_streaming_response.create( - account_id="699d98642c564d2e855e9661899b7252", - name="blog", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - tunnel = await response.parse() - assert_matches_type(TunnelCreateResponse, tunnel, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.tunnels.with_raw_response.create( - account_id="", - name="blog", - ) - @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: tunnel = await async_client.zero_trust.tunnels.list( @@ -362,6 +99,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) page=1, per_page=1, status="inactive", + tun_types="cfd_tunnel,warp_connector", uuid="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", was_active_at=parse_datetime("2009-11-10T23:00:00Z"), was_inactive_at=parse_datetime("2009-11-10T23:00:00Z"), @@ -398,157 +136,3 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: await async_client.zero_trust.tunnels.with_raw_response.list( account_id="", ) - - @parametrize - async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - tunnel = await async_client.zero_trust.tunnels.delete( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) - assert_matches_type(TunnelDeleteResponse, tunnel, path=["response"]) - - @parametrize - async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.tunnels.with_raw_response.delete( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - tunnel = await response.parse() - assert_matches_type(TunnelDeleteResponse, tunnel, path=["response"]) - - @parametrize - async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.tunnels.with_streaming_response.delete( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - tunnel = await response.parse() - assert_matches_type(TunnelDeleteResponse, tunnel, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.tunnels.with_raw_response.delete( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): - await async_client.zero_trust.tunnels.with_raw_response.delete( - tunnel_id="", - account_id="699d98642c564d2e855e9661899b7252", - ) - - @parametrize - async def test_method_edit(self, async_client: AsyncCloudflare) -> None: - tunnel = await async_client.zero_trust.tunnels.edit( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) - assert_matches_type(TunnelEditResponse, tunnel, path=["response"]) - - @parametrize - async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: - tunnel = await async_client.zero_trust.tunnels.edit( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - name="blog", - tunnel_secret="AQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIAQIDBAUGBwg=", - ) - assert_matches_type(TunnelEditResponse, tunnel, path=["response"]) - - @parametrize - async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.tunnels.with_raw_response.edit( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - tunnel = await response.parse() - assert_matches_type(TunnelEditResponse, tunnel, path=["response"]) - - @parametrize - async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.tunnels.with_streaming_response.edit( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - tunnel = await response.parse() - assert_matches_type(TunnelEditResponse, tunnel, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.tunnels.with_raw_response.edit( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): - await async_client.zero_trust.tunnels.with_raw_response.edit( - tunnel_id="", - account_id="699d98642c564d2e855e9661899b7252", - ) - - @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - tunnel = await async_client.zero_trust.tunnels.get( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) - assert_matches_type(TunnelGetResponse, tunnel, path=["response"]) - - @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.tunnels.with_raw_response.get( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - tunnel = await response.parse() - assert_matches_type(TunnelGetResponse, tunnel, path=["response"]) - - @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.tunnels.with_streaming_response.get( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="699d98642c564d2e855e9661899b7252", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - tunnel = await response.parse() - assert_matches_type(TunnelGetResponse, tunnel, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.tunnels.with_raw_response.get( - tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): - await async_client.zero_trust.tunnels.with_raw_response.get( - tunnel_id="", - account_id="699d98642c564d2e855e9661899b7252", - ) diff --git a/tests/api_resources/zero_trust/tunnels/cloudflared/__init__.py b/tests/api_resources/zero_trust/tunnels/cloudflared/__init__.py new file mode 100644 index 00000000000..fd8019a9a1a --- /dev/null +++ b/tests/api_resources/zero_trust/tunnels/cloudflared/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/zero_trust/tunnels/test_configurations.py b/tests/api_resources/zero_trust/tunnels/cloudflared/test_configurations.py similarity index 87% rename from tests/api_resources/zero_trust/tunnels/test_configurations.py rename to tests/api_resources/zero_trust/tunnels/cloudflared/test_configurations.py index eb601aa3bbc..afb71a13e67 100644 --- a/tests/api_resources/zero_trust/tunnels/test_configurations.py +++ b/tests/api_resources/zero_trust/tunnels/cloudflared/test_configurations.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.zero_trust.tunnels import ( +from cloudflare.types.zero_trust.tunnels.cloudflared import ( ConfigurationGetResponse, ConfigurationUpdateResponse, ) @@ -22,7 +22,7 @@ class TestConfigurations: @parametrize def test_method_update(self, client: Cloudflare) -> None: - configuration = client.zero_trust.tunnels.configurations.update( + configuration = client.zero_trust.tunnels.cloudflared.configurations.update( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -30,7 +30,7 @@ def test_method_update(self, client: Cloudflare) -> None: @parametrize def test_method_update_with_all_params(self, client: Cloudflare) -> None: - configuration = client.zero_trust.tunnels.configurations.update( + configuration = client.zero_trust.tunnels.cloudflared.configurations.update( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="023e105f4ecef8ad9ca31a8372d0c353", config={ @@ -87,7 +87,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: - response = client.zero_trust.tunnels.configurations.with_raw_response.update( + response = client.zero_trust.tunnels.cloudflared.configurations.with_raw_response.update( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -99,7 +99,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: - with client.zero_trust.tunnels.configurations.with_streaming_response.update( + with client.zero_trust.tunnels.cloudflared.configurations.with_streaming_response.update( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -114,20 +114,20 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: @parametrize def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.tunnels.configurations.with_raw_response.update( + client.zero_trust.tunnels.cloudflared.configurations.with_raw_response.update( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): - client.zero_trust.tunnels.configurations.with_raw_response.update( + client.zero_trust.tunnels.cloudflared.configurations.with_raw_response.update( tunnel_id="", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @parametrize def test_method_get(self, client: Cloudflare) -> None: - configuration = client.zero_trust.tunnels.configurations.get( + configuration = client.zero_trust.tunnels.cloudflared.configurations.get( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -135,7 +135,7 @@ def test_method_get(self, client: Cloudflare) -> None: @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.zero_trust.tunnels.configurations.with_raw_response.get( + response = client.zero_trust.tunnels.cloudflared.configurations.with_raw_response.get( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -147,7 +147,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.zero_trust.tunnels.configurations.with_streaming_response.get( + with client.zero_trust.tunnels.cloudflared.configurations.with_streaming_response.get( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -162,13 +162,13 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @parametrize def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.tunnels.configurations.with_raw_response.get( + client.zero_trust.tunnels.cloudflared.configurations.with_raw_response.get( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): - client.zero_trust.tunnels.configurations.with_raw_response.get( + client.zero_trust.tunnels.cloudflared.configurations.with_raw_response.get( tunnel_id="", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -179,7 +179,7 @@ class TestAsyncConfigurations: @parametrize async def test_method_update(self, async_client: AsyncCloudflare) -> None: - configuration = await async_client.zero_trust.tunnels.configurations.update( + configuration = await async_client.zero_trust.tunnels.cloudflared.configurations.update( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -187,7 +187,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: - configuration = await async_client.zero_trust.tunnels.configurations.update( + configuration = await async_client.zero_trust.tunnels.cloudflared.configurations.update( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="023e105f4ecef8ad9ca31a8372d0c353", config={ @@ -244,7 +244,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.tunnels.configurations.with_raw_response.update( + response = await async_client.zero_trust.tunnels.cloudflared.configurations.with_raw_response.update( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -256,7 +256,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.tunnels.configurations.with_streaming_response.update( + async with async_client.zero_trust.tunnels.cloudflared.configurations.with_streaming_response.update( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -271,20 +271,20 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> @parametrize async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.tunnels.configurations.with_raw_response.update( + await async_client.zero_trust.tunnels.cloudflared.configurations.with_raw_response.update( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): - await async_client.zero_trust.tunnels.configurations.with_raw_response.update( + await async_client.zero_trust.tunnels.cloudflared.configurations.with_raw_response.update( tunnel_id="", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: - configuration = await async_client.zero_trust.tunnels.configurations.get( + configuration = await async_client.zero_trust.tunnels.cloudflared.configurations.get( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -292,7 +292,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.tunnels.configurations.with_raw_response.get( + response = await async_client.zero_trust.tunnels.cloudflared.configurations.with_raw_response.get( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -304,7 +304,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.tunnels.configurations.with_streaming_response.get( + async with async_client.zero_trust.tunnels.cloudflared.configurations.with_streaming_response.get( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -319,13 +319,13 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.tunnels.configurations.with_raw_response.get( + await async_client.zero_trust.tunnels.cloudflared.configurations.with_raw_response.get( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): - await async_client.zero_trust.tunnels.configurations.with_raw_response.get( + await async_client.zero_trust.tunnels.cloudflared.configurations.with_raw_response.get( tunnel_id="", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/zero_trust/tunnels/test_connections.py b/tests/api_resources/zero_trust/tunnels/cloudflared/test_connections.py similarity index 82% rename from tests/api_resources/zero_trust/tunnels/test_connections.py rename to tests/api_resources/zero_trust/tunnels/cloudflared/test_connections.py index 13749e63f5e..359c067b8af 100644 --- a/tests/api_resources/zero_trust/tunnels/test_connections.py +++ b/tests/api_resources/zero_trust/tunnels/cloudflared/test_connections.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.zero_trust.tunnels import Client +from cloudflare.types.zero_trust.tunnels.cloudflared import Client base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -20,7 +20,7 @@ class TestConnections: @parametrize def test_method_delete(self, client: Cloudflare) -> None: - connection = client.zero_trust.tunnels.connections.delete( + connection = client.zero_trust.tunnels.cloudflared.connections.delete( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) @@ -28,7 +28,7 @@ def test_method_delete(self, client: Cloudflare) -> None: @parametrize def test_method_delete_with_all_params(self, client: Cloudflare) -> None: - connection = client.zero_trust.tunnels.connections.delete( + connection = client.zero_trust.tunnels.cloudflared.connections.delete( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", client_id="1bedc50d-42b3-473c-b108-ff3d10c0d925", @@ -37,7 +37,7 @@ def test_method_delete_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.zero_trust.tunnels.connections.with_raw_response.delete( + response = client.zero_trust.tunnels.cloudflared.connections.with_raw_response.delete( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) @@ -49,7 +49,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.zero_trust.tunnels.connections.with_streaming_response.delete( + with client.zero_trust.tunnels.cloudflared.connections.with_streaming_response.delete( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) as response: @@ -64,20 +64,20 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.tunnels.connections.with_raw_response.delete( + client.zero_trust.tunnels.cloudflared.connections.with_raw_response.delete( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): - client.zero_trust.tunnels.connections.with_raw_response.delete( + client.zero_trust.tunnels.cloudflared.connections.with_raw_response.delete( tunnel_id="", account_id="699d98642c564d2e855e9661899b7252", ) @parametrize def test_method_get(self, client: Cloudflare) -> None: - connection = client.zero_trust.tunnels.connections.get( + connection = client.zero_trust.tunnels.cloudflared.connections.get( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) @@ -85,7 +85,7 @@ def test_method_get(self, client: Cloudflare) -> None: @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.zero_trust.tunnels.connections.with_raw_response.get( + response = client.zero_trust.tunnels.cloudflared.connections.with_raw_response.get( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) @@ -97,7 +97,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.zero_trust.tunnels.connections.with_streaming_response.get( + with client.zero_trust.tunnels.cloudflared.connections.with_streaming_response.get( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) as response: @@ -112,13 +112,13 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @parametrize def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.tunnels.connections.with_raw_response.get( + client.zero_trust.tunnels.cloudflared.connections.with_raw_response.get( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): - client.zero_trust.tunnels.connections.with_raw_response.get( + client.zero_trust.tunnels.cloudflared.connections.with_raw_response.get( tunnel_id="", account_id="699d98642c564d2e855e9661899b7252", ) @@ -129,7 +129,7 @@ class TestAsyncConnections: @parametrize async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - connection = await async_client.zero_trust.tunnels.connections.delete( + connection = await async_client.zero_trust.tunnels.cloudflared.connections.delete( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) @@ -137,7 +137,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare) -> None: - connection = await async_client.zero_trust.tunnels.connections.delete( + connection = await async_client.zero_trust.tunnels.cloudflared.connections.delete( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", client_id="1bedc50d-42b3-473c-b108-ff3d10c0d925", @@ -146,7 +146,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.tunnels.connections.with_raw_response.delete( + response = await async_client.zero_trust.tunnels.cloudflared.connections.with_raw_response.delete( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) @@ -158,7 +158,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.tunnels.connections.with_streaming_response.delete( + async with async_client.zero_trust.tunnels.cloudflared.connections.with_streaming_response.delete( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) as response: @@ -173,20 +173,20 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.tunnels.connections.with_raw_response.delete( + await async_client.zero_trust.tunnels.cloudflared.connections.with_raw_response.delete( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): - await async_client.zero_trust.tunnels.connections.with_raw_response.delete( + await async_client.zero_trust.tunnels.cloudflared.connections.with_raw_response.delete( tunnel_id="", account_id="699d98642c564d2e855e9661899b7252", ) @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: - connection = await async_client.zero_trust.tunnels.connections.get( + connection = await async_client.zero_trust.tunnels.cloudflared.connections.get( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) @@ -194,7 +194,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.tunnels.connections.with_raw_response.get( + response = await async_client.zero_trust.tunnels.cloudflared.connections.with_raw_response.get( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) @@ -206,7 +206,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.tunnels.connections.with_streaming_response.get( + async with async_client.zero_trust.tunnels.cloudflared.connections.with_streaming_response.get( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) as response: @@ -221,13 +221,13 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.tunnels.connections.with_raw_response.get( + await async_client.zero_trust.tunnels.cloudflared.connections.with_raw_response.get( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): - await async_client.zero_trust.tunnels.connections.with_raw_response.get( + await async_client.zero_trust.tunnels.cloudflared.connections.with_raw_response.get( tunnel_id="", account_id="699d98642c564d2e855e9661899b7252", ) diff --git a/tests/api_resources/zero_trust/tunnels/test_connectors.py b/tests/api_resources/zero_trust/tunnels/cloudflared/test_connectors.py similarity index 84% rename from tests/api_resources/zero_trust/tunnels/test_connectors.py rename to tests/api_resources/zero_trust/tunnels/cloudflared/test_connectors.py index 639188dd181..a18b48bb4d3 100644 --- a/tests/api_resources/zero_trust/tunnels/test_connectors.py +++ b/tests/api_resources/zero_trust/tunnels/cloudflared/test_connectors.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.zero_trust.tunnels import Client +from cloudflare.types.zero_trust.tunnels.cloudflared import Client base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,7 +19,7 @@ class TestConnectors: @parametrize def test_method_get(self, client: Cloudflare) -> None: - connector = client.zero_trust.tunnels.connectors.get( + connector = client.zero_trust.tunnels.cloudflared.connectors.get( connector_id="1bedc50d-42b3-473c-b108-ff3d10c0d925", account_id="699d98642c564d2e855e9661899b7252", tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", @@ -28,7 +28,7 @@ def test_method_get(self, client: Cloudflare) -> None: @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.zero_trust.tunnels.connectors.with_raw_response.get( + response = client.zero_trust.tunnels.cloudflared.connectors.with_raw_response.get( connector_id="1bedc50d-42b3-473c-b108-ff3d10c0d925", account_id="699d98642c564d2e855e9661899b7252", tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", @@ -41,7 +41,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.zero_trust.tunnels.connectors.with_streaming_response.get( + with client.zero_trust.tunnels.cloudflared.connectors.with_streaming_response.get( connector_id="1bedc50d-42b3-473c-b108-ff3d10c0d925", account_id="699d98642c564d2e855e9661899b7252", tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", @@ -57,21 +57,21 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @parametrize def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.tunnels.connectors.with_raw_response.get( + client.zero_trust.tunnels.cloudflared.connectors.with_raw_response.get( connector_id="1bedc50d-42b3-473c-b108-ff3d10c0d925", account_id="", tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): - client.zero_trust.tunnels.connectors.with_raw_response.get( + client.zero_trust.tunnels.cloudflared.connectors.with_raw_response.get( connector_id="1bedc50d-42b3-473c-b108-ff3d10c0d925", account_id="699d98642c564d2e855e9661899b7252", tunnel_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `connector_id` but received ''"): - client.zero_trust.tunnels.connectors.with_raw_response.get( + client.zero_trust.tunnels.cloudflared.connectors.with_raw_response.get( connector_id="", account_id="699d98642c564d2e855e9661899b7252", tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", @@ -83,7 +83,7 @@ class TestAsyncConnectors: @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: - connector = await async_client.zero_trust.tunnels.connectors.get( + connector = await async_client.zero_trust.tunnels.cloudflared.connectors.get( connector_id="1bedc50d-42b3-473c-b108-ff3d10c0d925", account_id="699d98642c564d2e855e9661899b7252", tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", @@ -92,7 +92,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.tunnels.connectors.with_raw_response.get( + response = await async_client.zero_trust.tunnels.cloudflared.connectors.with_raw_response.get( connector_id="1bedc50d-42b3-473c-b108-ff3d10c0d925", account_id="699d98642c564d2e855e9661899b7252", tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", @@ -105,7 +105,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.tunnels.connectors.with_streaming_response.get( + async with async_client.zero_trust.tunnels.cloudflared.connectors.with_streaming_response.get( connector_id="1bedc50d-42b3-473c-b108-ff3d10c0d925", account_id="699d98642c564d2e855e9661899b7252", tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", @@ -121,21 +121,21 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.tunnels.connectors.with_raw_response.get( + await async_client.zero_trust.tunnels.cloudflared.connectors.with_raw_response.get( connector_id="1bedc50d-42b3-473c-b108-ff3d10c0d925", account_id="", tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): - await async_client.zero_trust.tunnels.connectors.with_raw_response.get( + await async_client.zero_trust.tunnels.cloudflared.connectors.with_raw_response.get( connector_id="1bedc50d-42b3-473c-b108-ff3d10c0d925", account_id="699d98642c564d2e855e9661899b7252", tunnel_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `connector_id` but received ''"): - await async_client.zero_trust.tunnels.connectors.with_raw_response.get( + await async_client.zero_trust.tunnels.cloudflared.connectors.with_raw_response.get( connector_id="", account_id="699d98642c564d2e855e9661899b7252", tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", diff --git a/tests/api_resources/zero_trust/tunnels/test_management.py b/tests/api_resources/zero_trust/tunnels/cloudflared/test_management.py similarity index 85% rename from tests/api_resources/zero_trust/tunnels/test_management.py rename to tests/api_resources/zero_trust/tunnels/cloudflared/test_management.py index 8c1d2934db9..366d43ed8eb 100644 --- a/tests/api_resources/zero_trust/tunnels/test_management.py +++ b/tests/api_resources/zero_trust/tunnels/cloudflared/test_management.py @@ -18,7 +18,7 @@ class TestManagement: @parametrize def test_method_create(self, client: Cloudflare) -> None: - management = client.zero_trust.tunnels.management.create( + management = client.zero_trust.tunnels.cloudflared.management.create( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", resources=["logs"], @@ -27,7 +27,7 @@ def test_method_create(self, client: Cloudflare) -> None: @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.zero_trust.tunnels.management.with_raw_response.create( + response = client.zero_trust.tunnels.cloudflared.management.with_raw_response.create( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", resources=["logs"], @@ -40,7 +40,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.zero_trust.tunnels.management.with_streaming_response.create( + with client.zero_trust.tunnels.cloudflared.management.with_streaming_response.create( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", resources=["logs"], @@ -56,14 +56,14 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: @parametrize def test_path_params_create(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.tunnels.management.with_raw_response.create( + client.zero_trust.tunnels.cloudflared.management.with_raw_response.create( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="", resources=["logs"], ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): - client.zero_trust.tunnels.management.with_raw_response.create( + client.zero_trust.tunnels.cloudflared.management.with_raw_response.create( tunnel_id="", account_id="699d98642c564d2e855e9661899b7252", resources=["logs"], @@ -75,7 +75,7 @@ class TestAsyncManagement: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: - management = await async_client.zero_trust.tunnels.management.create( + management = await async_client.zero_trust.tunnels.cloudflared.management.create( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", resources=["logs"], @@ -84,7 +84,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.tunnels.management.with_raw_response.create( + response = await async_client.zero_trust.tunnels.cloudflared.management.with_raw_response.create( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", resources=["logs"], @@ -97,7 +97,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.tunnels.management.with_streaming_response.create( + async with async_client.zero_trust.tunnels.cloudflared.management.with_streaming_response.create( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", resources=["logs"], @@ -113,14 +113,14 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> @parametrize async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.tunnels.management.with_raw_response.create( + await async_client.zero_trust.tunnels.cloudflared.management.with_raw_response.create( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="", resources=["logs"], ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): - await async_client.zero_trust.tunnels.management.with_raw_response.create( + await async_client.zero_trust.tunnels.cloudflared.management.with_raw_response.create( tunnel_id="", account_id="699d98642c564d2e855e9661899b7252", resources=["logs"], diff --git a/tests/api_resources/zero_trust/tunnels/test_token.py b/tests/api_resources/zero_trust/tunnels/cloudflared/test_token.py similarity index 84% rename from tests/api_resources/zero_trust/tunnels/test_token.py rename to tests/api_resources/zero_trust/tunnels/cloudflared/test_token.py index 784ce03fe18..bcd08c85974 100644 --- a/tests/api_resources/zero_trust/tunnels/test_token.py +++ b/tests/api_resources/zero_trust/tunnels/cloudflared/test_token.py @@ -18,7 +18,7 @@ class TestToken: @parametrize def test_method_get(self, client: Cloudflare) -> None: - token = client.zero_trust.tunnels.token.get( + token = client.zero_trust.tunnels.cloudflared.token.get( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) @@ -26,7 +26,7 @@ def test_method_get(self, client: Cloudflare) -> None: @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.zero_trust.tunnels.token.with_raw_response.get( + response = client.zero_trust.tunnels.cloudflared.token.with_raw_response.get( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) @@ -38,7 +38,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.zero_trust.tunnels.token.with_streaming_response.get( + with client.zero_trust.tunnels.cloudflared.token.with_streaming_response.get( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) as response: @@ -53,13 +53,13 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @parametrize def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.tunnels.token.with_raw_response.get( + client.zero_trust.tunnels.cloudflared.token.with_raw_response.get( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): - client.zero_trust.tunnels.token.with_raw_response.get( + client.zero_trust.tunnels.cloudflared.token.with_raw_response.get( tunnel_id="", account_id="699d98642c564d2e855e9661899b7252", ) @@ -70,7 +70,7 @@ class TestAsyncToken: @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: - token = await async_client.zero_trust.tunnels.token.get( + token = await async_client.zero_trust.tunnels.cloudflared.token.get( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) @@ -78,7 +78,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.tunnels.token.with_raw_response.get( + response = await async_client.zero_trust.tunnels.cloudflared.token.with_raw_response.get( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) @@ -90,7 +90,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.tunnels.token.with_streaming_response.get( + async with async_client.zero_trust.tunnels.cloudflared.token.with_streaming_response.get( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) as response: @@ -105,13 +105,13 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.tunnels.token.with_raw_response.get( + await async_client.zero_trust.tunnels.cloudflared.token.with_raw_response.get( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): - await async_client.zero_trust.tunnels.token.with_raw_response.get( + await async_client.zero_trust.tunnels.cloudflared.token.with_raw_response.get( tunnel_id="", account_id="699d98642c564d2e855e9661899b7252", ) diff --git a/tests/api_resources/zero_trust/tunnels/test_cloudflared.py b/tests/api_resources/zero_trust/tunnels/test_cloudflared.py new file mode 100644 index 00000000000..48168fc2d89 --- /dev/null +++ b/tests/api_resources/zero_trust/tunnels/test_cloudflared.py @@ -0,0 +1,554 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare._utils import parse_datetime +from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray +from cloudflare.types.zero_trust.tunnels import ( + CloudflaredGetResponse, + CloudflaredEditResponse, + CloudflaredListResponse, + CloudflaredCreateResponse, + CloudflaredDeleteResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestCloudflared: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Cloudflare) -> None: + cloudflared = client.zero_trust.tunnels.cloudflared.create( + account_id="699d98642c564d2e855e9661899b7252", + name="blog", + ) + assert_matches_type(CloudflaredCreateResponse, cloudflared, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Cloudflare) -> None: + cloudflared = client.zero_trust.tunnels.cloudflared.create( + account_id="699d98642c564d2e855e9661899b7252", + name="blog", + config_src="local", + tunnel_secret="AQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIAQIDBAUGBwg=", + ) + assert_matches_type(CloudflaredCreateResponse, cloudflared, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Cloudflare) -> None: + response = client.zero_trust.tunnels.cloudflared.with_raw_response.create( + account_id="699d98642c564d2e855e9661899b7252", + name="blog", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + cloudflared = response.parse() + assert_matches_type(CloudflaredCreateResponse, cloudflared, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Cloudflare) -> None: + with client.zero_trust.tunnels.cloudflared.with_streaming_response.create( + account_id="699d98642c564d2e855e9661899b7252", + name="blog", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + cloudflared = response.parse() + assert_matches_type(CloudflaredCreateResponse, cloudflared, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.tunnels.cloudflared.with_raw_response.create( + account_id="", + name="blog", + ) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + cloudflared = client.zero_trust.tunnels.cloudflared.list( + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(SyncV4PagePaginationArray[CloudflaredListResponse], cloudflared, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + cloudflared = client.zero_trust.tunnels.cloudflared.list( + account_id="699d98642c564d2e855e9661899b7252", + exclude_prefix="vpc1-", + existed_at="2019-10-12T07%3A20%3A50.52Z", + include_prefix="vpc1-", + is_deleted=True, + name="blog", + page=1, + per_page=1, + status="inactive", + uuid="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + was_active_at=parse_datetime("2009-11-10T23:00:00Z"), + was_inactive_at=parse_datetime("2009-11-10T23:00:00Z"), + ) + assert_matches_type(SyncV4PagePaginationArray[CloudflaredListResponse], cloudflared, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.zero_trust.tunnels.cloudflared.with_raw_response.list( + account_id="699d98642c564d2e855e9661899b7252", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + cloudflared = response.parse() + assert_matches_type(SyncV4PagePaginationArray[CloudflaredListResponse], cloudflared, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.zero_trust.tunnels.cloudflared.with_streaming_response.list( + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + cloudflared = response.parse() + assert_matches_type(SyncV4PagePaginationArray[CloudflaredListResponse], cloudflared, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.tunnels.cloudflared.with_raw_response.list( + account_id="", + ) + + @parametrize + def test_method_delete(self, client: Cloudflare) -> None: + cloudflared = client.zero_trust.tunnels.cloudflared.delete( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(CloudflaredDeleteResponse, cloudflared, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.zero_trust.tunnels.cloudflared.with_raw_response.delete( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + cloudflared = response.parse() + assert_matches_type(CloudflaredDeleteResponse, cloudflared, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.zero_trust.tunnels.cloudflared.with_streaming_response.delete( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + cloudflared = response.parse() + assert_matches_type(CloudflaredDeleteResponse, cloudflared, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.tunnels.cloudflared.with_raw_response.delete( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): + client.zero_trust.tunnels.cloudflared.with_raw_response.delete( + tunnel_id="", + account_id="699d98642c564d2e855e9661899b7252", + ) + + @parametrize + def test_method_edit(self, client: Cloudflare) -> None: + cloudflared = client.zero_trust.tunnels.cloudflared.edit( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(CloudflaredEditResponse, cloudflared, path=["response"]) + + @parametrize + def test_method_edit_with_all_params(self, client: Cloudflare) -> None: + cloudflared = client.zero_trust.tunnels.cloudflared.edit( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + name="blog", + tunnel_secret="AQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIAQIDBAUGBwg=", + ) + assert_matches_type(CloudflaredEditResponse, cloudflared, path=["response"]) + + @parametrize + def test_raw_response_edit(self, client: Cloudflare) -> None: + response = client.zero_trust.tunnels.cloudflared.with_raw_response.edit( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + cloudflared = response.parse() + assert_matches_type(CloudflaredEditResponse, cloudflared, path=["response"]) + + @parametrize + def test_streaming_response_edit(self, client: Cloudflare) -> None: + with client.zero_trust.tunnels.cloudflared.with_streaming_response.edit( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + cloudflared = response.parse() + assert_matches_type(CloudflaredEditResponse, cloudflared, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_edit(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.tunnels.cloudflared.with_raw_response.edit( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): + client.zero_trust.tunnels.cloudflared.with_raw_response.edit( + tunnel_id="", + account_id="699d98642c564d2e855e9661899b7252", + ) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + cloudflared = client.zero_trust.tunnels.cloudflared.get( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(CloudflaredGetResponse, cloudflared, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.zero_trust.tunnels.cloudflared.with_raw_response.get( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + cloudflared = response.parse() + assert_matches_type(CloudflaredGetResponse, cloudflared, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.zero_trust.tunnels.cloudflared.with_streaming_response.get( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + cloudflared = response.parse() + assert_matches_type(CloudflaredGetResponse, cloudflared, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.tunnels.cloudflared.with_raw_response.get( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): + client.zero_trust.tunnels.cloudflared.with_raw_response.get( + tunnel_id="", + account_id="699d98642c564d2e855e9661899b7252", + ) + + +class TestAsyncCloudflared: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncCloudflare) -> None: + cloudflared = await async_client.zero_trust.tunnels.cloudflared.create( + account_id="699d98642c564d2e855e9661899b7252", + name="blog", + ) + assert_matches_type(CloudflaredCreateResponse, cloudflared, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: + cloudflared = await async_client.zero_trust.tunnels.cloudflared.create( + account_id="699d98642c564d2e855e9661899b7252", + name="blog", + config_src="local", + tunnel_secret="AQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIAQIDBAUGBwg=", + ) + assert_matches_type(CloudflaredCreateResponse, cloudflared, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.tunnels.cloudflared.with_raw_response.create( + account_id="699d98642c564d2e855e9661899b7252", + name="blog", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + cloudflared = await response.parse() + assert_matches_type(CloudflaredCreateResponse, cloudflared, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.tunnels.cloudflared.with_streaming_response.create( + account_id="699d98642c564d2e855e9661899b7252", + name="blog", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + cloudflared = await response.parse() + assert_matches_type(CloudflaredCreateResponse, cloudflared, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.tunnels.cloudflared.with_raw_response.create( + account_id="", + name="blog", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + cloudflared = await async_client.zero_trust.tunnels.cloudflared.list( + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(AsyncV4PagePaginationArray[CloudflaredListResponse], cloudflared, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + cloudflared = await async_client.zero_trust.tunnels.cloudflared.list( + account_id="699d98642c564d2e855e9661899b7252", + exclude_prefix="vpc1-", + existed_at="2019-10-12T07%3A20%3A50.52Z", + include_prefix="vpc1-", + is_deleted=True, + name="blog", + page=1, + per_page=1, + status="inactive", + uuid="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + was_active_at=parse_datetime("2009-11-10T23:00:00Z"), + was_inactive_at=parse_datetime("2009-11-10T23:00:00Z"), + ) + assert_matches_type(AsyncV4PagePaginationArray[CloudflaredListResponse], cloudflared, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.tunnels.cloudflared.with_raw_response.list( + account_id="699d98642c564d2e855e9661899b7252", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + cloudflared = await response.parse() + assert_matches_type(AsyncV4PagePaginationArray[CloudflaredListResponse], cloudflared, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.tunnels.cloudflared.with_streaming_response.list( + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + cloudflared = await response.parse() + assert_matches_type(AsyncV4PagePaginationArray[CloudflaredListResponse], cloudflared, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.tunnels.cloudflared.with_raw_response.list( + account_id="", + ) + + @parametrize + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + cloudflared = await async_client.zero_trust.tunnels.cloudflared.delete( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(CloudflaredDeleteResponse, cloudflared, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.tunnels.cloudflared.with_raw_response.delete( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + cloudflared = await response.parse() + assert_matches_type(CloudflaredDeleteResponse, cloudflared, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.tunnels.cloudflared.with_streaming_response.delete( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + cloudflared = await response.parse() + assert_matches_type(CloudflaredDeleteResponse, cloudflared, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.tunnels.cloudflared.with_raw_response.delete( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): + await async_client.zero_trust.tunnels.cloudflared.with_raw_response.delete( + tunnel_id="", + account_id="699d98642c564d2e855e9661899b7252", + ) + + @parametrize + async def test_method_edit(self, async_client: AsyncCloudflare) -> None: + cloudflared = await async_client.zero_trust.tunnels.cloudflared.edit( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(CloudflaredEditResponse, cloudflared, path=["response"]) + + @parametrize + async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: + cloudflared = await async_client.zero_trust.tunnels.cloudflared.edit( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + name="blog", + tunnel_secret="AQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIAQIDBAUGBwg=", + ) + assert_matches_type(CloudflaredEditResponse, cloudflared, path=["response"]) + + @parametrize + async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.tunnels.cloudflared.with_raw_response.edit( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + cloudflared = await response.parse() + assert_matches_type(CloudflaredEditResponse, cloudflared, path=["response"]) + + @parametrize + async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.tunnels.cloudflared.with_streaming_response.edit( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + cloudflared = await response.parse() + assert_matches_type(CloudflaredEditResponse, cloudflared, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.tunnels.cloudflared.with_raw_response.edit( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): + await async_client.zero_trust.tunnels.cloudflared.with_raw_response.edit( + tunnel_id="", + account_id="699d98642c564d2e855e9661899b7252", + ) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + cloudflared = await async_client.zero_trust.tunnels.cloudflared.get( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(CloudflaredGetResponse, cloudflared, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.tunnels.cloudflared.with_raw_response.get( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + cloudflared = await response.parse() + assert_matches_type(CloudflaredGetResponse, cloudflared, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.tunnels.cloudflared.with_streaming_response.get( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + cloudflared = await response.parse() + assert_matches_type(CloudflaredGetResponse, cloudflared, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.tunnels.cloudflared.with_raw_response.get( + tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): + await async_client.zero_trust.tunnels.cloudflared.with_raw_response.get( + tunnel_id="", + account_id="699d98642c564d2e855e9661899b7252", + ) From 260750c1c31c6e690638034df62b5aa49e60199c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 03:48:56 +0000 Subject: [PATCH 200/358] feat(zero_trust): add subnets (#2454) --- .stats.yml | 2 +- api.md | 24 ++ .../resources/zero_trust/networks/__init__.py | 14 + .../resources/zero_trust/networks/networks.py | 32 ++ .../zero_trust/networks/subnets/__init__.py | 33 ++ .../networks/subnets/cloudflare_source.py | 228 +++++++++++++ .../zero_trust/networks/subnets/subnets.py | 318 ++++++++++++++++++ .../types/zero_trust/networks/__init__.py | 2 + .../zero_trust/networks/subnet_list_params.py | 59 ++++ .../networks/subnet_list_response.py | 41 +++ .../zero_trust/networks/subnets/__init__.py | 6 + .../cloudflare_source_update_params.py | 21 ++ .../cloudflare_source_update_response.py | 41 +++ .../zero_trust/networks/subnets/__init__.py | 1 + .../subnets/test_cloudflare_source.py | 128 +++++++ .../zero_trust/networks/test_subnets.py | 135 ++++++++ 16 files changed, 1084 insertions(+), 1 deletion(-) create mode 100644 src/cloudflare/resources/zero_trust/networks/subnets/__init__.py create mode 100644 src/cloudflare/resources/zero_trust/networks/subnets/cloudflare_source.py create mode 100644 src/cloudflare/resources/zero_trust/networks/subnets/subnets.py create mode 100644 src/cloudflare/types/zero_trust/networks/subnet_list_params.py create mode 100644 src/cloudflare/types/zero_trust/networks/subnet_list_response.py create mode 100644 src/cloudflare/types/zero_trust/networks/subnets/__init__.py create mode 100644 src/cloudflare/types/zero_trust/networks/subnets/cloudflare_source_update_params.py create mode 100644 src/cloudflare/types/zero_trust/networks/subnets/cloudflare_source_update_response.py create mode 100644 tests/api_resources/zero_trust/networks/subnets/__init__.py create mode 100644 tests/api_resources/zero_trust/networks/subnets/test_cloudflare_source.py create mode 100644 tests/api_resources/zero_trust/networks/test_subnets.py diff --git a/.stats.yml b/.stats.yml index 586e7223084..c08771babc2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 1526 +configured_endpoints: 1528 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e6f75d6387709ef6a98e7327b59c7ca9205e26a1252ea5e370e75be27ec21022.yml diff --git a/api.md b/api.md index fc77eff415c..219c1f447b3 100644 --- a/api.md +++ b/api.md @@ -6450,6 +6450,30 @@ Methods: - client.zero_trust.networks.virtual_networks.edit(virtual_network_id, \*, account_id, \*\*params) -> VirtualNetwork - client.zero_trust.networks.virtual_networks.get(virtual_network_id, \*, account_id) -> VirtualNetwork +### Subnets + +Types: + +```python +from cloudflare.types.zero_trust.networks import SubnetListResponse +``` + +Methods: + +- client.zero_trust.networks.subnets.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[SubnetListResponse] + +#### CloudflareSource + +Types: + +```python +from cloudflare.types.zero_trust.networks.subnets import CloudflareSourceUpdateResponse +``` + +Methods: + +- client.zero_trust.networks.subnets.cloudflare_source.update(address_family, \*, account_id, \*\*params) -> CloudflareSourceUpdateResponse + ## RiskScoring Types: diff --git a/src/cloudflare/resources/zero_trust/networks/__init__.py b/src/cloudflare/resources/zero_trust/networks/__init__.py index 0672f0849f0..fb7c82eee63 100644 --- a/src/cloudflare/resources/zero_trust/networks/__init__.py +++ b/src/cloudflare/resources/zero_trust/networks/__init__.py @@ -8,6 +8,14 @@ RoutesResourceWithStreamingResponse, AsyncRoutesResourceWithStreamingResponse, ) +from .subnets import ( + SubnetsResource, + AsyncSubnetsResource, + SubnetsResourceWithRawResponse, + AsyncSubnetsResourceWithRawResponse, + SubnetsResourceWithStreamingResponse, + AsyncSubnetsResourceWithStreamingResponse, +) from .networks import ( NetworksResource, AsyncNetworksResource, @@ -38,6 +46,12 @@ "AsyncVirtualNetworksResourceWithRawResponse", "VirtualNetworksResourceWithStreamingResponse", "AsyncVirtualNetworksResourceWithStreamingResponse", + "SubnetsResource", + "AsyncSubnetsResource", + "SubnetsResourceWithRawResponse", + "AsyncSubnetsResourceWithRawResponse", + "SubnetsResourceWithStreamingResponse", + "AsyncSubnetsResourceWithStreamingResponse", "NetworksResource", "AsyncNetworksResource", "NetworksResourceWithRawResponse", diff --git a/src/cloudflare/resources/zero_trust/networks/networks.py b/src/cloudflare/resources/zero_trust/networks/networks.py index 602ba12061d..62a188d9b05 100644 --- a/src/cloudflare/resources/zero_trust/networks/networks.py +++ b/src/cloudflare/resources/zero_trust/networks/networks.py @@ -12,6 +12,14 @@ RoutesResourceWithStreamingResponse, AsyncRoutesResourceWithStreamingResponse, ) +from .subnets.subnets import ( + SubnetsResource, + AsyncSubnetsResource, + SubnetsResourceWithRawResponse, + AsyncSubnetsResourceWithRawResponse, + SubnetsResourceWithStreamingResponse, + AsyncSubnetsResourceWithStreamingResponse, +) from .virtual_networks import ( VirtualNetworksResource, AsyncVirtualNetworksResource, @@ -33,6 +41,10 @@ def routes(self) -> RoutesResource: def virtual_networks(self) -> VirtualNetworksResource: return VirtualNetworksResource(self._client) + @cached_property + def subnets(self) -> SubnetsResource: + return SubnetsResource(self._client) + @cached_property def with_raw_response(self) -> NetworksResourceWithRawResponse: """ @@ -62,6 +74,10 @@ def routes(self) -> AsyncRoutesResource: def virtual_networks(self) -> AsyncVirtualNetworksResource: return AsyncVirtualNetworksResource(self._client) + @cached_property + def subnets(self) -> AsyncSubnetsResource: + return AsyncSubnetsResource(self._client) + @cached_property def with_raw_response(self) -> AsyncNetworksResourceWithRawResponse: """ @@ -94,6 +110,10 @@ def routes(self) -> RoutesResourceWithRawResponse: def virtual_networks(self) -> VirtualNetworksResourceWithRawResponse: return VirtualNetworksResourceWithRawResponse(self._networks.virtual_networks) + @cached_property + def subnets(self) -> SubnetsResourceWithRawResponse: + return SubnetsResourceWithRawResponse(self._networks.subnets) + class AsyncNetworksResourceWithRawResponse: def __init__(self, networks: AsyncNetworksResource) -> None: @@ -107,6 +127,10 @@ def routes(self) -> AsyncRoutesResourceWithRawResponse: def virtual_networks(self) -> AsyncVirtualNetworksResourceWithRawResponse: return AsyncVirtualNetworksResourceWithRawResponse(self._networks.virtual_networks) + @cached_property + def subnets(self) -> AsyncSubnetsResourceWithRawResponse: + return AsyncSubnetsResourceWithRawResponse(self._networks.subnets) + class NetworksResourceWithStreamingResponse: def __init__(self, networks: NetworksResource) -> None: @@ -120,6 +144,10 @@ def routes(self) -> RoutesResourceWithStreamingResponse: def virtual_networks(self) -> VirtualNetworksResourceWithStreamingResponse: return VirtualNetworksResourceWithStreamingResponse(self._networks.virtual_networks) + @cached_property + def subnets(self) -> SubnetsResourceWithStreamingResponse: + return SubnetsResourceWithStreamingResponse(self._networks.subnets) + class AsyncNetworksResourceWithStreamingResponse: def __init__(self, networks: AsyncNetworksResource) -> None: @@ -132,3 +160,7 @@ def routes(self) -> AsyncRoutesResourceWithStreamingResponse: @cached_property def virtual_networks(self) -> AsyncVirtualNetworksResourceWithStreamingResponse: return AsyncVirtualNetworksResourceWithStreamingResponse(self._networks.virtual_networks) + + @cached_property + def subnets(self) -> AsyncSubnetsResourceWithStreamingResponse: + return AsyncSubnetsResourceWithStreamingResponse(self._networks.subnets) diff --git a/src/cloudflare/resources/zero_trust/networks/subnets/__init__.py b/src/cloudflare/resources/zero_trust/networks/subnets/__init__.py new file mode 100644 index 00000000000..3af4ace5d3b --- /dev/null +++ b/src/cloudflare/resources/zero_trust/networks/subnets/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .subnets import ( + SubnetsResource, + AsyncSubnetsResource, + SubnetsResourceWithRawResponse, + AsyncSubnetsResourceWithRawResponse, + SubnetsResourceWithStreamingResponse, + AsyncSubnetsResourceWithStreamingResponse, +) +from .cloudflare_source import ( + CloudflareSourceResource, + AsyncCloudflareSourceResource, + CloudflareSourceResourceWithRawResponse, + AsyncCloudflareSourceResourceWithRawResponse, + CloudflareSourceResourceWithStreamingResponse, + AsyncCloudflareSourceResourceWithStreamingResponse, +) + +__all__ = [ + "CloudflareSourceResource", + "AsyncCloudflareSourceResource", + "CloudflareSourceResourceWithRawResponse", + "AsyncCloudflareSourceResourceWithRawResponse", + "CloudflareSourceResourceWithStreamingResponse", + "AsyncCloudflareSourceResourceWithStreamingResponse", + "SubnetsResource", + "AsyncSubnetsResource", + "SubnetsResourceWithRawResponse", + "AsyncSubnetsResourceWithRawResponse", + "SubnetsResourceWithStreamingResponse", + "AsyncSubnetsResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/zero_trust/networks/subnets/cloudflare_source.py b/src/cloudflare/resources/zero_trust/networks/subnets/cloudflare_source.py new file mode 100644 index 00000000000..cef2d6f9ac5 --- /dev/null +++ b/src/cloudflare/resources/zero_trust/networks/subnets/cloudflare_source.py @@ -0,0 +1,228 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, cast +from typing_extensions import Literal + +import httpx + +from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._utils import ( + maybe_transform, + async_maybe_transform, +) +from ....._compat import cached_property +from ....._resource import SyncAPIResource, AsyncAPIResource +from ....._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ....._wrappers import ResultWrapper +from ....._base_client import make_request_options +from .....types.zero_trust.networks.subnets import cloudflare_source_update_params +from .....types.zero_trust.networks.subnets.cloudflare_source_update_response import CloudflareSourceUpdateResponse + +__all__ = ["CloudflareSourceResource", "AsyncCloudflareSourceResource"] + + +class CloudflareSourceResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> CloudflareSourceResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return CloudflareSourceResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> CloudflareSourceResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return CloudflareSourceResourceWithStreamingResponse(self) + + def update( + self, + address_family: Literal["v4", "v6"], + *, + account_id: str, + comment: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + network: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CloudflareSourceUpdateResponse: + """ + Updates the Cloudflare Source subnet of the given address family + + Args: + account_id: Cloudflare account ID + + address_family: IP address family, either `v4` (IPv4) or `v6` (IPv6) + + comment: An optional description of the subnet. + + name: A user-friendly name for the subnet. + + network: The private IPv4 or IPv6 range defining the subnet, in CIDR notation. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not address_family: + raise ValueError(f"Expected a non-empty value for `address_family` but received {address_family!r}") + return self._patch( + f"/accounts/{account_id}/zerotrust/subnets/cloudflare_source/{address_family}", + body=maybe_transform( + { + "comment": comment, + "name": name, + "network": network, + }, + cloudflare_source_update_params.CloudflareSourceUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[CloudflareSourceUpdateResponse]._unwrapper, + ), + cast_to=cast(Type[CloudflareSourceUpdateResponse], ResultWrapper[CloudflareSourceUpdateResponse]), + ) + + +class AsyncCloudflareSourceResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncCloudflareSourceResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncCloudflareSourceResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncCloudflareSourceResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncCloudflareSourceResourceWithStreamingResponse(self) + + async def update( + self, + address_family: Literal["v4", "v6"], + *, + account_id: str, + comment: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + network: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CloudflareSourceUpdateResponse: + """ + Updates the Cloudflare Source subnet of the given address family + + Args: + account_id: Cloudflare account ID + + address_family: IP address family, either `v4` (IPv4) or `v6` (IPv6) + + comment: An optional description of the subnet. + + name: A user-friendly name for the subnet. + + network: The private IPv4 or IPv6 range defining the subnet, in CIDR notation. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not address_family: + raise ValueError(f"Expected a non-empty value for `address_family` but received {address_family!r}") + return await self._patch( + f"/accounts/{account_id}/zerotrust/subnets/cloudflare_source/{address_family}", + body=await async_maybe_transform( + { + "comment": comment, + "name": name, + "network": network, + }, + cloudflare_source_update_params.CloudflareSourceUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[CloudflareSourceUpdateResponse]._unwrapper, + ), + cast_to=cast(Type[CloudflareSourceUpdateResponse], ResultWrapper[CloudflareSourceUpdateResponse]), + ) + + +class CloudflareSourceResourceWithRawResponse: + def __init__(self, cloudflare_source: CloudflareSourceResource) -> None: + self._cloudflare_source = cloudflare_source + + self.update = to_raw_response_wrapper( + cloudflare_source.update, + ) + + +class AsyncCloudflareSourceResourceWithRawResponse: + def __init__(self, cloudflare_source: AsyncCloudflareSourceResource) -> None: + self._cloudflare_source = cloudflare_source + + self.update = async_to_raw_response_wrapper( + cloudflare_source.update, + ) + + +class CloudflareSourceResourceWithStreamingResponse: + def __init__(self, cloudflare_source: CloudflareSourceResource) -> None: + self._cloudflare_source = cloudflare_source + + self.update = to_streamed_response_wrapper( + cloudflare_source.update, + ) + + +class AsyncCloudflareSourceResourceWithStreamingResponse: + def __init__(self, cloudflare_source: AsyncCloudflareSourceResource) -> None: + self._cloudflare_source = cloudflare_source + + self.update = async_to_streamed_response_wrapper( + cloudflare_source.update, + ) diff --git a/src/cloudflare/resources/zero_trust/networks/subnets/subnets.py b/src/cloudflare/resources/zero_trust/networks/subnets/subnets.py new file mode 100644 index 00000000000..05239d182af --- /dev/null +++ b/src/cloudflare/resources/zero_trust/networks/subnets/subnets.py @@ -0,0 +1,318 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal + +import httpx + +from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._utils import maybe_transform +from ....._compat import cached_property +from ....._resource import SyncAPIResource, AsyncAPIResource +from ....._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray +from ....._base_client import AsyncPaginator, make_request_options +from .cloudflare_source import ( + CloudflareSourceResource, + AsyncCloudflareSourceResource, + CloudflareSourceResourceWithRawResponse, + AsyncCloudflareSourceResourceWithRawResponse, + CloudflareSourceResourceWithStreamingResponse, + AsyncCloudflareSourceResourceWithStreamingResponse, +) +from .....types.zero_trust.networks import subnet_list_params +from .....types.zero_trust.networks.subnet_list_response import SubnetListResponse + +__all__ = ["SubnetsResource", "AsyncSubnetsResource"] + + +class SubnetsResource(SyncAPIResource): + @cached_property + def cloudflare_source(self) -> CloudflareSourceResource: + return CloudflareSourceResource(self._client) + + @cached_property + def with_raw_response(self) -> SubnetsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return SubnetsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> SubnetsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return SubnetsResourceWithStreamingResponse(self) + + def list( + self, + *, + account_id: str, + address_family: Literal["v4", "v6"] | NotGiven = NOT_GIVEN, + comment: str | NotGiven = NOT_GIVEN, + existed_at: str | NotGiven = NOT_GIVEN, + is_default_network: bool | NotGiven = NOT_GIVEN, + is_deleted: bool | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + network: str | NotGiven = NOT_GIVEN, + page: float | NotGiven = NOT_GIVEN, + per_page: float | NotGiven = NOT_GIVEN, + sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, + subnet_types: Literal["cloudflare_source"] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncV4PagePaginationArray[SubnetListResponse]: + """ + Lists and filters subnets in an account. + + Args: + account_id: Cloudflare account ID + + address_family: If set, only include subnets in the given address family - `v4` or `v6` + + comment: If set, only list subnets with the given comment. + + existed_at: If provided, include only resources that were created (and not deleted) before + this time. URL encoded. + + is_default_network: If `true`, only include default subnets. If `false`, exclude default subnets + subnets. If not set, all subnets will be included. + + is_deleted: If `true`, only include deleted subnets. If `false`, exclude deleted subnets. If + not set, all subnets will be included. + + name: If set, only list subnets with the given name + + network: If set, only list the subnet whose network exactly matches the given CIDR. + + page: Page number of paginated results. + + per_page: Number of results to display. + + sort_order: Sort order of the results. `asc` means oldest to newest, `desc` means newest to + oldest. If not set, they will not be in any particular order. + + subnet_types: If set, the types of subnets to include, separated by comma. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get_api_list( + f"/accounts/{account_id}/zerotrust/subnets", + page=SyncV4PagePaginationArray[SubnetListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "address_family": address_family, + "comment": comment, + "existed_at": existed_at, + "is_default_network": is_default_network, + "is_deleted": is_deleted, + "name": name, + "network": network, + "page": page, + "per_page": per_page, + "sort_order": sort_order, + "subnet_types": subnet_types, + }, + subnet_list_params.SubnetListParams, + ), + ), + model=SubnetListResponse, + ) + + +class AsyncSubnetsResource(AsyncAPIResource): + @cached_property + def cloudflare_source(self) -> AsyncCloudflareSourceResource: + return AsyncCloudflareSourceResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncSubnetsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncSubnetsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncSubnetsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncSubnetsResourceWithStreamingResponse(self) + + def list( + self, + *, + account_id: str, + address_family: Literal["v4", "v6"] | NotGiven = NOT_GIVEN, + comment: str | NotGiven = NOT_GIVEN, + existed_at: str | NotGiven = NOT_GIVEN, + is_default_network: bool | NotGiven = NOT_GIVEN, + is_deleted: bool | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + network: str | NotGiven = NOT_GIVEN, + page: float | NotGiven = NOT_GIVEN, + per_page: float | NotGiven = NOT_GIVEN, + sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, + subnet_types: Literal["cloudflare_source"] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[SubnetListResponse, AsyncV4PagePaginationArray[SubnetListResponse]]: + """ + Lists and filters subnets in an account. + + Args: + account_id: Cloudflare account ID + + address_family: If set, only include subnets in the given address family - `v4` or `v6` + + comment: If set, only list subnets with the given comment. + + existed_at: If provided, include only resources that were created (and not deleted) before + this time. URL encoded. + + is_default_network: If `true`, only include default subnets. If `false`, exclude default subnets + subnets. If not set, all subnets will be included. + + is_deleted: If `true`, only include deleted subnets. If `false`, exclude deleted subnets. If + not set, all subnets will be included. + + name: If set, only list subnets with the given name + + network: If set, only list the subnet whose network exactly matches the given CIDR. + + page: Page number of paginated results. + + per_page: Number of results to display. + + sort_order: Sort order of the results. `asc` means oldest to newest, `desc` means newest to + oldest. If not set, they will not be in any particular order. + + subnet_types: If set, the types of subnets to include, separated by comma. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get_api_list( + f"/accounts/{account_id}/zerotrust/subnets", + page=AsyncV4PagePaginationArray[SubnetListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "address_family": address_family, + "comment": comment, + "existed_at": existed_at, + "is_default_network": is_default_network, + "is_deleted": is_deleted, + "name": name, + "network": network, + "page": page, + "per_page": per_page, + "sort_order": sort_order, + "subnet_types": subnet_types, + }, + subnet_list_params.SubnetListParams, + ), + ), + model=SubnetListResponse, + ) + + +class SubnetsResourceWithRawResponse: + def __init__(self, subnets: SubnetsResource) -> None: + self._subnets = subnets + + self.list = to_raw_response_wrapper( + subnets.list, + ) + + @cached_property + def cloudflare_source(self) -> CloudflareSourceResourceWithRawResponse: + return CloudflareSourceResourceWithRawResponse(self._subnets.cloudflare_source) + + +class AsyncSubnetsResourceWithRawResponse: + def __init__(self, subnets: AsyncSubnetsResource) -> None: + self._subnets = subnets + + self.list = async_to_raw_response_wrapper( + subnets.list, + ) + + @cached_property + def cloudflare_source(self) -> AsyncCloudflareSourceResourceWithRawResponse: + return AsyncCloudflareSourceResourceWithRawResponse(self._subnets.cloudflare_source) + + +class SubnetsResourceWithStreamingResponse: + def __init__(self, subnets: SubnetsResource) -> None: + self._subnets = subnets + + self.list = to_streamed_response_wrapper( + subnets.list, + ) + + @cached_property + def cloudflare_source(self) -> CloudflareSourceResourceWithStreamingResponse: + return CloudflareSourceResourceWithStreamingResponse(self._subnets.cloudflare_source) + + +class AsyncSubnetsResourceWithStreamingResponse: + def __init__(self, subnets: AsyncSubnetsResource) -> None: + self._subnets = subnets + + self.list = async_to_streamed_response_wrapper( + subnets.list, + ) + + @cached_property + def cloudflare_source(self) -> AsyncCloudflareSourceResourceWithStreamingResponse: + return AsyncCloudflareSourceResourceWithStreamingResponse(self._subnets.cloudflare_source) diff --git a/src/cloudflare/types/zero_trust/networks/__init__.py b/src/cloudflare/types/zero_trust/networks/__init__.py index 6765e5b618e..6435f559cf9 100644 --- a/src/cloudflare/types/zero_trust/networks/__init__.py +++ b/src/cloudflare/types/zero_trust/networks/__init__.py @@ -7,7 +7,9 @@ from .virtual_network import VirtualNetwork as VirtualNetwork from .route_edit_params import RouteEditParams as RouteEditParams from .route_list_params import RouteListParams as RouteListParams +from .subnet_list_params import SubnetListParams as SubnetListParams from .route_create_params import RouteCreateParams as RouteCreateParams +from .subnet_list_response import SubnetListResponse as SubnetListResponse from .virtual_network_edit_params import VirtualNetworkEditParams as VirtualNetworkEditParams from .virtual_network_list_params import VirtualNetworkListParams as VirtualNetworkListParams from .virtual_network_create_params import VirtualNetworkCreateParams as VirtualNetworkCreateParams diff --git a/src/cloudflare/types/zero_trust/networks/subnet_list_params.py b/src/cloudflare/types/zero_trust/networks/subnet_list_params.py new file mode 100644 index 00000000000..1c340e64613 --- /dev/null +++ b/src/cloudflare/types/zero_trust/networks/subnet_list_params.py @@ -0,0 +1,59 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["SubnetListParams"] + + +class SubnetListParams(TypedDict, total=False): + account_id: Required[str] + """Cloudflare account ID""" + + address_family: Literal["v4", "v6"] + """If set, only include subnets in the given address family - `v4` or `v6`""" + + comment: str + """If set, only list subnets with the given comment.""" + + existed_at: str + """ + If provided, include only resources that were created (and not deleted) before + this time. URL encoded. + """ + + is_default_network: bool + """If `true`, only include default subnets. + + If `false`, exclude default subnets subnets. If not set, all subnets will be + included. + """ + + is_deleted: bool + """If `true`, only include deleted subnets. + + If `false`, exclude deleted subnets. If not set, all subnets will be included. + """ + + name: str + """If set, only list subnets with the given name""" + + network: str + """If set, only list the subnet whose network exactly matches the given CIDR.""" + + page: float + """Page number of paginated results.""" + + per_page: float + """Number of results to display.""" + + sort_order: Literal["asc", "desc"] + """Sort order of the results. + + `asc` means oldest to newest, `desc` means newest to oldest. If not set, they + will not be in any particular order. + """ + + subnet_types: Literal["cloudflare_source"] + """If set, the types of subnets to include, separated by comma.""" diff --git a/src/cloudflare/types/zero_trust/networks/subnet_list_response.py b/src/cloudflare/types/zero_trust/networks/subnet_list_response.py new file mode 100644 index 00000000000..c6218a22a82 --- /dev/null +++ b/src/cloudflare/types/zero_trust/networks/subnet_list_response.py @@ -0,0 +1,41 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["SubnetListResponse"] + + +class SubnetListResponse(BaseModel): + id: Optional[str] = None + """The UUID of the subnet.""" + + comment: Optional[str] = None + """An optional description of the subnet.""" + + created_at: Optional[datetime] = None + """Timestamp of when the resource was created.""" + + deleted_at: Optional[datetime] = None + """Timestamp of when the resource was deleted. + + If `null`, the resource has not been deleted. + """ + + is_default_network: Optional[bool] = None + """If `true`, this is the default subnet for the account. + + There can only be one default subnet per account. + """ + + name: Optional[str] = None + """A user-friendly name for the subnet.""" + + network: Optional[str] = None + """The private IPv4 or IPv6 range defining the subnet, in CIDR notation.""" + + subnet_type: Optional[Literal["cloudflare_source"]] = None + """The type of subnet.""" diff --git a/src/cloudflare/types/zero_trust/networks/subnets/__init__.py b/src/cloudflare/types/zero_trust/networks/subnets/__init__.py new file mode 100644 index 00000000000..afa04bcaada --- /dev/null +++ b/src/cloudflare/types/zero_trust/networks/subnets/__init__.py @@ -0,0 +1,6 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .cloudflare_source_update_params import CloudflareSourceUpdateParams as CloudflareSourceUpdateParams +from .cloudflare_source_update_response import CloudflareSourceUpdateResponse as CloudflareSourceUpdateResponse diff --git a/src/cloudflare/types/zero_trust/networks/subnets/cloudflare_source_update_params.py b/src/cloudflare/types/zero_trust/networks/subnets/cloudflare_source_update_params.py new file mode 100644 index 00000000000..a45818011ea --- /dev/null +++ b/src/cloudflare/types/zero_trust/networks/subnets/cloudflare_source_update_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["CloudflareSourceUpdateParams"] + + +class CloudflareSourceUpdateParams(TypedDict, total=False): + account_id: Required[str] + """Cloudflare account ID""" + + comment: str + """An optional description of the subnet.""" + + name: str + """A user-friendly name for the subnet.""" + + network: str + """The private IPv4 or IPv6 range defining the subnet, in CIDR notation.""" diff --git a/src/cloudflare/types/zero_trust/networks/subnets/cloudflare_source_update_response.py b/src/cloudflare/types/zero_trust/networks/subnets/cloudflare_source_update_response.py new file mode 100644 index 00000000000..7630e9fe39a --- /dev/null +++ b/src/cloudflare/types/zero_trust/networks/subnets/cloudflare_source_update_response.py @@ -0,0 +1,41 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ....._models import BaseModel + +__all__ = ["CloudflareSourceUpdateResponse"] + + +class CloudflareSourceUpdateResponse(BaseModel): + id: Optional[str] = None + """The UUID of the subnet.""" + + comment: Optional[str] = None + """An optional description of the subnet.""" + + created_at: Optional[datetime] = None + """Timestamp of when the resource was created.""" + + deleted_at: Optional[datetime] = None + """Timestamp of when the resource was deleted. + + If `null`, the resource has not been deleted. + """ + + is_default_network: Optional[bool] = None + """If `true`, this is the default subnet for the account. + + There can only be one default subnet per account. + """ + + name: Optional[str] = None + """A user-friendly name for the subnet.""" + + network: Optional[str] = None + """The private IPv4 or IPv6 range defining the subnet, in CIDR notation.""" + + subnet_type: Optional[Literal["cloudflare_source"]] = None + """The type of subnet.""" diff --git a/tests/api_resources/zero_trust/networks/subnets/__init__.py b/tests/api_resources/zero_trust/networks/subnets/__init__.py new file mode 100644 index 00000000000..fd8019a9a1a --- /dev/null +++ b/tests/api_resources/zero_trust/networks/subnets/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/zero_trust/networks/subnets/test_cloudflare_source.py b/tests/api_resources/zero_trust/networks/subnets/test_cloudflare_source.py new file mode 100644 index 00000000000..367f7785d4b --- /dev/null +++ b/tests/api_resources/zero_trust/networks/subnets/test_cloudflare_source.py @@ -0,0 +1,128 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.zero_trust.networks.subnets import CloudflareSourceUpdateResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestCloudflareSource: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_update(self, client: Cloudflare) -> None: + cloudflare_source = client.zero_trust.networks.subnets.cloudflare_source.update( + address_family="v4", + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(CloudflareSourceUpdateResponse, cloudflare_source, path=["response"]) + + @parametrize + def test_method_update_with_all_params(self, client: Cloudflare) -> None: + cloudflare_source = client.zero_trust.networks.subnets.cloudflare_source.update( + address_family="v4", + account_id="699d98642c564d2e855e9661899b7252", + comment="example comment", + name="IPv4 Cloudflare Source IPs", + network="100.64.0.0/12", + ) + assert_matches_type(CloudflareSourceUpdateResponse, cloudflare_source, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Cloudflare) -> None: + response = client.zero_trust.networks.subnets.cloudflare_source.with_raw_response.update( + address_family="v4", + account_id="699d98642c564d2e855e9661899b7252", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + cloudflare_source = response.parse() + assert_matches_type(CloudflareSourceUpdateResponse, cloudflare_source, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Cloudflare) -> None: + with client.zero_trust.networks.subnets.cloudflare_source.with_streaming_response.update( + address_family="v4", + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + cloudflare_source = response.parse() + assert_matches_type(CloudflareSourceUpdateResponse, cloudflare_source, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.networks.subnets.cloudflare_source.with_raw_response.update( + address_family="v4", + account_id="", + ) + + +class TestAsyncCloudflareSource: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_update(self, async_client: AsyncCloudflare) -> None: + cloudflare_source = await async_client.zero_trust.networks.subnets.cloudflare_source.update( + address_family="v4", + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(CloudflareSourceUpdateResponse, cloudflare_source, path=["response"]) + + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: + cloudflare_source = await async_client.zero_trust.networks.subnets.cloudflare_source.update( + address_family="v4", + account_id="699d98642c564d2e855e9661899b7252", + comment="example comment", + name="IPv4 Cloudflare Source IPs", + network="100.64.0.0/12", + ) + assert_matches_type(CloudflareSourceUpdateResponse, cloudflare_source, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.networks.subnets.cloudflare_source.with_raw_response.update( + address_family="v4", + account_id="699d98642c564d2e855e9661899b7252", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + cloudflare_source = await response.parse() + assert_matches_type(CloudflareSourceUpdateResponse, cloudflare_source, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.networks.subnets.cloudflare_source.with_streaming_response.update( + address_family="v4", + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + cloudflare_source = await response.parse() + assert_matches_type(CloudflareSourceUpdateResponse, cloudflare_source, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.networks.subnets.cloudflare_source.with_raw_response.update( + address_family="v4", + account_id="", + ) diff --git a/tests/api_resources/zero_trust/networks/test_subnets.py b/tests/api_resources/zero_trust/networks/test_subnets.py new file mode 100644 index 00000000000..8e7f03de8e2 --- /dev/null +++ b/tests/api_resources/zero_trust/networks/test_subnets.py @@ -0,0 +1,135 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray +from cloudflare.types.zero_trust.networks import SubnetListResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestSubnets: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + subnet = client.zero_trust.networks.subnets.list( + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(SyncV4PagePaginationArray[SubnetListResponse], subnet, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + subnet = client.zero_trust.networks.subnets.list( + account_id="699d98642c564d2e855e9661899b7252", + address_family="v4", + comment="example%20comment", + existed_at="2019-10-12T07%3A20%3A50.52Z", + is_default_network=True, + is_deleted=True, + name="IPv4%20Cloudflare%20Source%20IPs", + network="172.16.0.0%2F16", + page=1, + per_page=1, + sort_order="asc", + subnet_types="cloudflare_source", + ) + assert_matches_type(SyncV4PagePaginationArray[SubnetListResponse], subnet, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.zero_trust.networks.subnets.with_raw_response.list( + account_id="699d98642c564d2e855e9661899b7252", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + subnet = response.parse() + assert_matches_type(SyncV4PagePaginationArray[SubnetListResponse], subnet, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.zero_trust.networks.subnets.with_streaming_response.list( + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + subnet = response.parse() + assert_matches_type(SyncV4PagePaginationArray[SubnetListResponse], subnet, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.networks.subnets.with_raw_response.list( + account_id="", + ) + + +class TestAsyncSubnets: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + subnet = await async_client.zero_trust.networks.subnets.list( + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(AsyncV4PagePaginationArray[SubnetListResponse], subnet, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + subnet = await async_client.zero_trust.networks.subnets.list( + account_id="699d98642c564d2e855e9661899b7252", + address_family="v4", + comment="example%20comment", + existed_at="2019-10-12T07%3A20%3A50.52Z", + is_default_network=True, + is_deleted=True, + name="IPv4%20Cloudflare%20Source%20IPs", + network="172.16.0.0%2F16", + page=1, + per_page=1, + sort_order="asc", + subnet_types="cloudflare_source", + ) + assert_matches_type(AsyncV4PagePaginationArray[SubnetListResponse], subnet, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.networks.subnets.with_raw_response.list( + account_id="699d98642c564d2e855e9661899b7252", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + subnet = await response.parse() + assert_matches_type(AsyncV4PagePaginationArray[SubnetListResponse], subnet, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.networks.subnets.with_streaming_response.list( + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + subnet = await response.parse() + assert_matches_type(AsyncV4PagePaginationArray[SubnetListResponse], subnet, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.networks.subnets.with_raw_response.list( + account_id="", + ) From a2cc34d1a6f8cb974eb17c6f78b259f7ad69529a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 09:12:23 +0000 Subject: [PATCH 201/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index c08771babc2..39f4a3cf5a3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1528 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e6f75d6387709ef6a98e7327b59c7ca9205e26a1252ea5e370e75be27ec21022.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aece5451985ec339219cd0686c2d7e6fedca4113251cf9f2377a889f824c8756.yml From 4b7293784b54a4ffdae7581f087030ecdbbc100f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 15:52:13 +0000 Subject: [PATCH 202/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 39f4a3cf5a3..d07128961d1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1528 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aece5451985ec339219cd0686c2d7e6fedca4113251cf9f2377a889f824c8756.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-001fad053f2dfb0c0a983bde866a32038f7c3cd97e5e92635188dcf2dec8e488.yml From 7f3ac24c6ca239af0bb4aaee765417570d455463 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 16:25:47 +0000 Subject: [PATCH 203/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d07128961d1..39f4a3cf5a3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1528 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-001fad053f2dfb0c0a983bde866a32038f7c3cd97e5e92635188dcf2dec8e488.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aece5451985ec339219cd0686c2d7e6fedca4113251cf9f2377a889f824c8756.yml From 4c4c4349f0049678df0e42474f67d92b0f50595d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 16:28:43 +0000 Subject: [PATCH 204/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 39f4a3cf5a3..d07128961d1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1528 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aece5451985ec339219cd0686c2d7e6fedca4113251cf9f2377a889f824c8756.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-001fad053f2dfb0c0a983bde866a32038f7c3cd97e5e92635188dcf2dec8e488.yml From ff901b74ef317956d7cd43557d51f2d216d4da73 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 16:31:33 +0000 Subject: [PATCH 205/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d07128961d1..39f4a3cf5a3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1528 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-001fad053f2dfb0c0a983bde866a32038f7c3cd97e5e92635188dcf2dec8e488.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aece5451985ec339219cd0686c2d7e6fedca4113251cf9f2377a889f824c8756.yml From d9a5eb24b8254343a999d8ba014535b8c7bc235c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 20:29:56 +0000 Subject: [PATCH 206/358] chore: change api.md to use accounts_or_zones (#2455) --- .stats.yml | 2 +- api.md | 162 ++++++++++++++++++++++++++--------------------------- 2 files changed, 82 insertions(+), 82 deletions(-) diff --git a/.stats.yml b/.stats.yml index 39f4a3cf5a3..8a9702d8156 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1528 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aece5451985ec339219cd0686c2d7e6fedca4113251cf9f2377a889f824c8756.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0f9e94fd4449c611f6a3da40ca7ba5a4a6d79ba6e1ae3925519c17474513f1fc.yml diff --git a/api.md b/api.md index 219c1f447b3..6bcac4385b8 100644 --- a/api.md +++ b/api.md @@ -1136,8 +1136,8 @@ from cloudflare.types.dns import DNSSetting, SettingEditResponse, SettingGetResp Methods: -- client.dns.settings.edit(\*, account_id, zone_id, \*\*params) -> Optional[SettingEditResponse] -- client.dns.settings.get(\*, account_id, zone_id) -> Optional[SettingGetResponse] +- client.dns.settings.edit(\*, account_id, zone_id, \*\*params) -> Optional[SettingEditResponse] +- client.dns.settings.get(\*, account_id, zone_id) -> Optional[SettingGetResponse] ### Views @@ -1691,11 +1691,11 @@ from cloudflare.types.firewall import ( Methods: -- client.firewall.access_rules.create(\*, account_id, zone_id, \*\*params) -> AccessRuleCreateResponse -- client.firewall.access_rules.list(\*, account_id, zone_id, \*\*params) -> SyncV4PagePaginationArray[AccessRuleListResponse] -- client.firewall.access_rules.delete(rule_id, \*, account_id, zone_id) -> Optional[AccessRuleDeleteResponse] -- client.firewall.access_rules.edit(rule_id, \*, account_id, zone_id, \*\*params) -> AccessRuleEditResponse -- client.firewall.access_rules.get(rule_id, \*, account_id, zone_id) -> AccessRuleGetResponse +- client.firewall.access_rules.create(\*, account_id, zone_id, \*\*params) -> AccessRuleCreateResponse +- client.firewall.access_rules.list(\*, account_id, zone_id, \*\*params) -> SyncV4PagePaginationArray[AccessRuleListResponse] +- client.firewall.access_rules.delete(rule_id, \*, account_id, zone_id) -> Optional[AccessRuleDeleteResponse] +- client.firewall.access_rules.edit(rule_id, \*, account_id, zone_id, \*\*params) -> AccessRuleEditResponse +- client.firewall.access_rules.get(rule_id, \*, account_id, zone_id) -> AccessRuleGetResponse ## UARules @@ -1862,13 +1862,13 @@ from cloudflare.types.logpush.datasets import FieldGetResponse Methods: -- client.logpush.datasets.fields.get(dataset_id, \*, account_id, zone_id) -> object +- client.logpush.datasets.fields.get(dataset_id, \*, account_id, zone_id) -> object ### Jobs Methods: -- client.logpush.datasets.jobs.get(dataset_id, \*, account_id, zone_id) -> SyncSinglePage[Optional[LogpushJob]] +- client.logpush.datasets.jobs.get(dataset_id, \*, account_id, zone_id) -> SyncSinglePage[Optional[LogpushJob]] ## Edge @@ -1893,11 +1893,11 @@ from cloudflare.types.logpush import LogpushJob, OutputOptions, JobDeleteRespons Methods: -- client.logpush.jobs.create(\*, account_id, zone_id, \*\*params) -> Optional[LogpushJob] -- client.logpush.jobs.update(job_id, \*, account_id, zone_id, \*\*params) -> Optional[LogpushJob] -- client.logpush.jobs.list(\*, account_id, zone_id) -> SyncSinglePage[Optional[LogpushJob]] -- client.logpush.jobs.delete(job_id, \*, account_id, zone_id) -> Optional[JobDeleteResponse] -- client.logpush.jobs.get(job_id, \*, account_id, zone_id) -> Optional[LogpushJob] +- client.logpush.jobs.create(\*, account_id, zone_id, \*\*params) -> Optional[LogpushJob] +- client.logpush.jobs.update(job_id, \*, account_id, zone_id, \*\*params) -> Optional[LogpushJob] +- client.logpush.jobs.list(\*, account_id, zone_id) -> SyncSinglePage[Optional[LogpushJob]] +- client.logpush.jobs.delete(job_id, \*, account_id, zone_id) -> Optional[JobDeleteResponse] +- client.logpush.jobs.get(job_id, \*, account_id, zone_id) -> Optional[LogpushJob] ## Ownership @@ -1909,8 +1909,8 @@ from cloudflare.types.logpush import OwnershipValidation, OwnershipCreateRespons Methods: -- client.logpush.ownership.create(\*, account_id, zone_id, \*\*params) -> Optional[OwnershipCreateResponse] -- client.logpush.ownership.validate(\*, account_id, zone_id, \*\*params) -> Optional[OwnershipValidation] +- client.logpush.ownership.create(\*, account_id, zone_id, \*\*params) -> Optional[OwnershipCreateResponse] +- client.logpush.ownership.validate(\*, account_id, zone_id, \*\*params) -> Optional[OwnershipValidation] ## Validate @@ -1926,9 +1926,9 @@ from cloudflare.types.logpush import ( Methods: -- client.logpush.validate.destination(\*, account_id, zone_id, \*\*params) -> Optional[ValidateDestinationResponse] -- client.logpush.validate.destination_exists(\*, account_id, zone_id, \*\*params) -> Optional[ValidateDestinationExistsResponse] -- client.logpush.validate.origin(\*, account_id, zone_id, \*\*params) -> Optional[ValidateOriginResponse] +- client.logpush.validate.destination(\*, account_id, zone_id, \*\*params) -> Optional[ValidateDestinationResponse] +- client.logpush.validate.destination_exists(\*, account_id, zone_id, \*\*params) -> Optional[ValidateDestinationExistsResponse] +- client.logpush.validate.origin(\*, account_id, zone_id, \*\*params) -> Optional[ValidateOriginResponse] # Logs @@ -2906,11 +2906,11 @@ from cloudflare.types.rulesets import ( Methods: -- client.rulesets.create(\*, account_id, zone_id, \*\*params) -> RulesetCreateResponse -- client.rulesets.update(ruleset_id, \*, account_id, zone_id, \*\*params) -> RulesetUpdateResponse -- client.rulesets.list(\*, account_id, zone_id, \*\*params) -> SyncCursorPagination[RulesetListResponse] -- client.rulesets.delete(ruleset_id, \*, account_id, zone_id) -> None -- client.rulesets.get(ruleset_id, \*, account_id, zone_id) -> RulesetGetResponse +- client.rulesets.create(\*, account_id, zone_id, \*\*params) -> RulesetCreateResponse +- client.rulesets.update(ruleset_id, \*, account_id, zone_id, \*\*params) -> RulesetUpdateResponse +- client.rulesets.list(\*, account_id, zone_id, \*\*params) -> SyncCursorPagination[RulesetListResponse] +- client.rulesets.delete(ruleset_id, \*, account_id, zone_id) -> None +- client.rulesets.get(ruleset_id, \*, account_id, zone_id) -> RulesetGetResponse ## Phases @@ -2922,8 +2922,8 @@ from cloudflare.types.rulesets import PhaseUpdateResponse, PhaseGetResponse Methods: -- client.rulesets.phases.update(ruleset_phase, \*, account_id, zone_id, \*\*params) -> PhaseUpdateResponse -- client.rulesets.phases.get(ruleset_phase, \*, account_id, zone_id) -> PhaseGetResponse +- client.rulesets.phases.update(ruleset_phase, \*, account_id, zone_id, \*\*params) -> PhaseUpdateResponse +- client.rulesets.phases.get(ruleset_phase, \*, account_id, zone_id) -> PhaseGetResponse ### Versions @@ -2935,8 +2935,8 @@ from cloudflare.types.rulesets.phases import VersionListResponse, VersionGetResp Methods: -- client.rulesets.phases.versions.list(ruleset_phase, \*, account_id, zone_id) -> SyncSinglePage[VersionListResponse] -- client.rulesets.phases.versions.get(ruleset_version, \*, ruleset_phase, account_id, zone_id) -> VersionGetResponse +- client.rulesets.phases.versions.list(ruleset_phase, \*, account_id, zone_id) -> SyncSinglePage[VersionListResponse] +- client.rulesets.phases.versions.get(ruleset_version, \*, ruleset_phase, account_id, zone_id) -> VersionGetResponse ## Rules @@ -2971,9 +2971,9 @@ from cloudflare.types.rulesets import ( Methods: -- client.rulesets.rules.create(ruleset_id, \*, account_id, zone_id, \*\*params) -> RuleCreateResponse -- client.rulesets.rules.delete(rule_id, \*, ruleset_id, account_id, zone_id) -> RuleDeleteResponse -- client.rulesets.rules.edit(rule_id, \*, ruleset_id, account_id, zone_id, \*\*params) -> RuleEditResponse +- client.rulesets.rules.create(ruleset_id, \*, account_id, zone_id, \*\*params) -> RuleCreateResponse +- client.rulesets.rules.delete(rule_id, \*, ruleset_id, account_id, zone_id) -> RuleDeleteResponse +- client.rulesets.rules.edit(rule_id, \*, ruleset_id, account_id, zone_id, \*\*params) -> RuleEditResponse ## Versions @@ -2985,9 +2985,9 @@ from cloudflare.types.rulesets import VersionListResponse, VersionGetResponse Methods: -- client.rulesets.versions.list(ruleset_id, \*, account_id, zone_id) -> SyncSinglePage[VersionListResponse] -- client.rulesets.versions.delete(ruleset_version, \*, ruleset_id, account_id, zone_id) -> None -- client.rulesets.versions.get(ruleset_version, \*, ruleset_id, account_id, zone_id) -> VersionGetResponse +- client.rulesets.versions.list(ruleset_id, \*, account_id, zone_id) -> SyncSinglePage[VersionListResponse] +- client.rulesets.versions.delete(ruleset_version, \*, ruleset_id, account_id, zone_id) -> None +- client.rulesets.versions.get(ruleset_version, \*, ruleset_id, account_id, zone_id) -> VersionGetResponse # URLNormalization @@ -5156,11 +5156,11 @@ from cloudflare.types.zero_trust import ( Methods: -- client.zero_trust.identity_providers.create(\*, account_id, zone_id, \*\*params) -> Optional[IdentityProvider] -- client.zero_trust.identity_providers.update(identity_provider_id, \*, account_id, zone_id, \*\*params) -> Optional[IdentityProvider] -- client.zero_trust.identity_providers.list(\*, account_id, zone_id, \*\*params) -> SyncSinglePage[IdentityProviderListResponse] -- client.zero_trust.identity_providers.delete(identity_provider_id, \*, account_id, zone_id) -> Optional[IdentityProviderDeleteResponse] -- client.zero_trust.identity_providers.get(identity_provider_id, \*, account_id, zone_id) -> Optional[IdentityProvider] +- client.zero_trust.identity_providers.create(\*, account_id, zone_id, \*\*params) -> Optional[IdentityProvider] +- client.zero_trust.identity_providers.update(identity_provider_id, \*, account_id, zone_id, \*\*params) -> Optional[IdentityProvider] +- client.zero_trust.identity_providers.list(\*, account_id, zone_id, \*\*params) -> SyncSinglePage[IdentityProviderListResponse] +- client.zero_trust.identity_providers.delete(identity_provider_id, \*, account_id, zone_id) -> Optional[IdentityProviderDeleteResponse] +- client.zero_trust.identity_providers.get(identity_provider_id, \*, account_id, zone_id) -> Optional[IdentityProvider] ### SCIM @@ -5186,10 +5186,10 @@ from cloudflare.types.zero_trust import LoginDesign, Organization, OrganizationR Methods: -- client.zero_trust.organizations.create(\*, account_id, zone_id, \*\*params) -> Optional[Organization] -- client.zero_trust.organizations.update(\*, account_id, zone_id, \*\*params) -> Optional[Organization] -- client.zero_trust.organizations.list(\*, account_id, zone_id) -> Optional[Organization] -- client.zero_trust.organizations.revoke_users(\*, account_id, zone_id, \*\*params) -> Optional[OrganizationRevokeUsersResponse] +- client.zero_trust.organizations.create(\*, account_id, zone_id, \*\*params) -> Optional[Organization] +- client.zero_trust.organizations.update(\*, account_id, zone_id, \*\*params) -> Optional[Organization] +- client.zero_trust.organizations.list(\*, account_id, zone_id) -> Optional[Organization] +- client.zero_trust.organizations.revoke_users(\*, account_id, zone_id, \*\*params) -> Optional[OrganizationRevokeUsersResponse] ### DOH @@ -5298,12 +5298,12 @@ from cloudflare.types.zero_trust.access import ( Methods: -- client.zero_trust.access.applications.create(\*, account_id, zone_id, \*\*params) -> Optional[ApplicationCreateResponse] -- client.zero_trust.access.applications.update(app_id, \*, account_id, zone_id, \*\*params) -> Optional[ApplicationUpdateResponse] -- client.zero_trust.access.applications.list(\*, account_id, zone_id, \*\*params) -> SyncSinglePage[ApplicationListResponse] -- client.zero_trust.access.applications.delete(app_id, \*, account_id, zone_id) -> Optional[ApplicationDeleteResponse] -- client.zero_trust.access.applications.get(app_id, \*, account_id, zone_id) -> Optional[ApplicationGetResponse] -- client.zero_trust.access.applications.revoke_tokens(app_id, \*, account_id, zone_id) -> object +- client.zero_trust.access.applications.create(\*, account_id, zone_id, \*\*params) -> Optional[ApplicationCreateResponse] +- client.zero_trust.access.applications.update(app_id, \*, account_id, zone_id, \*\*params) -> Optional[ApplicationUpdateResponse] +- client.zero_trust.access.applications.list(\*, account_id, zone_id, \*\*params) -> SyncSinglePage[ApplicationListResponse] +- client.zero_trust.access.applications.delete(app_id, \*, account_id, zone_id) -> Optional[ApplicationDeleteResponse] +- client.zero_trust.access.applications.get(app_id, \*, account_id, zone_id) -> Optional[ApplicationGetResponse] +- client.zero_trust.access.applications.revoke_tokens(app_id, \*, account_id, zone_id) -> object #### CAs @@ -5315,10 +5315,10 @@ from cloudflare.types.zero_trust.access.applications import CA, CADeleteResponse Methods: -- client.zero_trust.access.applications.cas.create(app_id, \*, account_id, zone_id) -> Optional[CA] -- client.zero_trust.access.applications.cas.list(\*, account_id, zone_id) -> SyncSinglePage[CA] -- client.zero_trust.access.applications.cas.delete(app_id, \*, account_id, zone_id) -> Optional[CADeleteResponse] -- client.zero_trust.access.applications.cas.get(app_id, \*, account_id, zone_id) -> Optional[CA] +- client.zero_trust.access.applications.cas.create(app_id, \*, account_id, zone_id) -> Optional[CA] +- client.zero_trust.access.applications.cas.list(\*, account_id, zone_id) -> SyncSinglePage[CA] +- client.zero_trust.access.applications.cas.delete(app_id, \*, account_id, zone_id) -> Optional[CADeleteResponse] +- client.zero_trust.access.applications.cas.get(app_id, \*, account_id, zone_id) -> Optional[CA] #### UserPolicyChecks @@ -5333,7 +5333,7 @@ from cloudflare.types.zero_trust.access.applications import ( Methods: -- client.zero_trust.access.applications.user_policy_checks.list(app_id, \*, account_id, zone_id) -> Optional[UserPolicyCheckListResponse] +- client.zero_trust.access.applications.user_policy_checks.list(app_id, \*, account_id, zone_id) -> Optional[UserPolicyCheckListResponse] #### Policies @@ -5371,11 +5371,11 @@ from cloudflare.types.zero_trust.access.applications import ( Methods: -- client.zero_trust.access.applications.policies.create(app_id, \*, account_id, zone_id, \*\*params) -> Optional[PolicyCreateResponse] -- client.zero_trust.access.applications.policies.update(policy_id, \*, app_id, account_id, zone_id, \*\*params) -> Optional[PolicyUpdateResponse] -- client.zero_trust.access.applications.policies.list(app_id, \*, account_id, zone_id) -> SyncSinglePage[PolicyListResponse] -- client.zero_trust.access.applications.policies.delete(policy_id, \*, app_id, account_id, zone_id) -> Optional[PolicyDeleteResponse] -- client.zero_trust.access.applications.policies.get(policy_id, \*, app_id, account_id, zone_id) -> Optional[PolicyGetResponse] +- client.zero_trust.access.applications.policies.create(app_id, \*, account_id, zone_id, \*\*params) -> Optional[PolicyCreateResponse] +- client.zero_trust.access.applications.policies.update(policy_id, \*, app_id, account_id, zone_id, \*\*params) -> Optional[PolicyUpdateResponse] +- client.zero_trust.access.applications.policies.list(app_id, \*, account_id, zone_id) -> SyncSinglePage[PolicyListResponse] +- client.zero_trust.access.applications.policies.delete(policy_id, \*, app_id, account_id, zone_id) -> Optional[PolicyDeleteResponse] +- client.zero_trust.access.applications.policies.get(policy_id, \*, app_id, account_id, zone_id) -> Optional[PolicyGetResponse] #### PolicyTests @@ -5419,11 +5419,11 @@ from cloudflare.types.zero_trust.access import ( Methods: -- client.zero_trust.access.certificates.create(\*, account_id, zone_id, \*\*params) -> Optional[Certificate] -- client.zero_trust.access.certificates.update(certificate_id, \*, account_id, zone_id, \*\*params) -> Optional[Certificate] -- client.zero_trust.access.certificates.list(\*, account_id, zone_id) -> SyncSinglePage[Certificate] -- client.zero_trust.access.certificates.delete(certificate_id, \*, account_id, zone_id) -> Optional[CertificateDeleteResponse] -- client.zero_trust.access.certificates.get(certificate_id, \*, account_id, zone_id) -> Optional[Certificate] +- client.zero_trust.access.certificates.create(\*, account_id, zone_id, \*\*params) -> Optional[Certificate] +- client.zero_trust.access.certificates.update(certificate_id, \*, account_id, zone_id, \*\*params) -> Optional[Certificate] +- client.zero_trust.access.certificates.list(\*, account_id, zone_id) -> SyncSinglePage[Certificate] +- client.zero_trust.access.certificates.delete(certificate_id, \*, account_id, zone_id) -> Optional[CertificateDeleteResponse] +- client.zero_trust.access.certificates.get(certificate_id, \*, account_id, zone_id) -> Optional[Certificate] #### Settings @@ -5435,8 +5435,8 @@ from cloudflare.types.zero_trust.access.certificates import CertificateSettings Methods: -- client.zero_trust.access.certificates.settings.update(\*, account_id, zone_id, \*\*params) -> SyncSinglePage[CertificateSettings] -- client.zero_trust.access.certificates.settings.get(\*, account_id, zone_id) -> SyncSinglePage[CertificateSettings] +- client.zero_trust.access.certificates.settings.update(\*, account_id, zone_id, \*\*params) -> SyncSinglePage[CertificateSettings] +- client.zero_trust.access.certificates.settings.get(\*, account_id, zone_id) -> SyncSinglePage[CertificateSettings] ### Groups @@ -5455,11 +5455,11 @@ from cloudflare.types.zero_trust.access import ( Methods: -- client.zero_trust.access.groups.create(\*, account_id, zone_id, \*\*params) -> Optional[GroupCreateResponse] -- client.zero_trust.access.groups.update(group_id, \*, account_id, zone_id, \*\*params) -> Optional[GroupUpdateResponse] -- client.zero_trust.access.groups.list(\*, account_id, zone_id, \*\*params) -> SyncSinglePage[GroupListResponse] -- client.zero_trust.access.groups.delete(group_id, \*, account_id, zone_id) -> Optional[GroupDeleteResponse] -- client.zero_trust.access.groups.get(group_id, \*, account_id, zone_id) -> Optional[GroupGetResponse] +- client.zero_trust.access.groups.create(\*, account_id, zone_id, \*\*params) -> Optional[GroupCreateResponse] +- client.zero_trust.access.groups.update(group_id, \*, account_id, zone_id, \*\*params) -> Optional[GroupUpdateResponse] +- client.zero_trust.access.groups.list(\*, account_id, zone_id, \*\*params) -> SyncSinglePage[GroupListResponse] +- client.zero_trust.access.groups.delete(group_id, \*, account_id, zone_id) -> Optional[GroupDeleteResponse] +- client.zero_trust.access.groups.get(group_id, \*, account_id, zone_id) -> Optional[GroupGetResponse] ### ServiceTokens @@ -5475,11 +5475,11 @@ from cloudflare.types.zero_trust.access import ( Methods: -- client.zero_trust.access.service_tokens.create(\*, account_id, zone_id, \*\*params) -> Optional[ServiceTokenCreateResponse] -- client.zero_trust.access.service_tokens.update(service_token_id, \*, account_id, zone_id, \*\*params) -> Optional[ServiceToken] -- client.zero_trust.access.service_tokens.list(\*, account_id, zone_id, \*\*params) -> SyncSinglePage[ServiceToken] -- client.zero_trust.access.service_tokens.delete(service_token_id, \*, account_id, zone_id) -> Optional[ServiceToken] -- client.zero_trust.access.service_tokens.get(service_token_id, \*, account_id, zone_id) -> Optional[ServiceToken] +- client.zero_trust.access.service_tokens.create(\*, account_id, zone_id, \*\*params) -> Optional[ServiceTokenCreateResponse] +- client.zero_trust.access.service_tokens.update(service_token_id, \*, account_id, zone_id, \*\*params) -> Optional[ServiceToken] +- client.zero_trust.access.service_tokens.list(\*, account_id, zone_id, \*\*params) -> SyncSinglePage[ServiceToken] +- client.zero_trust.access.service_tokens.delete(service_token_id, \*, account_id, zone_id) -> Optional[ServiceToken] +- client.zero_trust.access.service_tokens.get(service_token_id, \*, account_id, zone_id) -> Optional[ServiceToken] - client.zero_trust.access.service_tokens.refresh(service_token_id, \*, account_id) -> Optional[ServiceToken] - client.zero_trust.access.service_tokens.rotate(service_token_id, \*, account_id) -> Optional[ServiceTokenRotateResponse] @@ -8770,8 +8770,8 @@ from cloudflare.types.security_center import InsightListResponse, InsightDismiss Methods: -- client.security_center.insights.list(\*, account_id, zone_id, \*\*params) -> SyncV4PagePagination[Optional[InsightListResponse]] -- client.security_center.insights.dismiss(issue_id, \*, account_id, zone_id, \*\*params) -> InsightDismissResponse +- client.security_center.insights.list(\*, account_id, zone_id, \*\*params) -> SyncV4PagePagination[Optional[InsightListResponse]] +- client.security_center.insights.dismiss(issue_id, \*, account_id, zone_id, \*\*params) -> InsightDismissResponse ### Class @@ -8783,7 +8783,7 @@ from cloudflare.types.security_center.insights import ClassGetResponse Methods: -- client.security*center.insights.class*.get(\*, account_id, zone_id, \*\*params) -> Optional[ClassGetResponse] +- client.security*center.insights.class*.get(\*, account_id, zone_id, \*\*params) -> Optional[ClassGetResponse] ### Severity @@ -8795,7 +8795,7 @@ from cloudflare.types.security_center.insights import SeverityGetResponse Methods: -- client.security_center.insights.severity.get(\*, account_id, zone_id, \*\*params) -> Optional[SeverityGetResponse] +- client.security_center.insights.severity.get(\*, account_id, zone_id, \*\*params) -> Optional[SeverityGetResponse] ### Type @@ -8807,4 +8807,4 @@ from cloudflare.types.security_center.insights import TypeGetResponse Methods: -- client.security_center.insights.type.get(\*, account_id, zone_id, \*\*params) -> Optional[TypeGetResponse] +- client.security_center.insights.type.get(\*, account_id, zone_id, \*\*params) -> Optional[TypeGetResponse] From 5bd96723657c6156e3c68e73c8a19d55d77d082b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 12:38:47 +0000 Subject: [PATCH 207/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 8a9702d8156..1ee743c42ca 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1528 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0f9e94fd4449c611f6a3da40ca7ba5a4a6d79ba6e1ae3925519c17474513f1fc.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-887ade36d2957effd1eab81d57757494f1d219baf3d5f3f89e03cebfb618b0aa.yml From 02c1e4e5d7ba1ee26941188e7d78609db1aeca4e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 14:25:41 +0000 Subject: [PATCH 208/358] feat(api): api update (#2456) --- .stats.yml | 2 +- src/cloudflare/resources/ai_gateway/ai_gateway.py | 8 ++++++++ .../types/ai_gateway/ai_gateway_create_params.py | 2 ++ .../types/ai_gateway/ai_gateway_create_response.py | 2 ++ .../types/ai_gateway/ai_gateway_delete_response.py | 2 ++ .../types/ai_gateway/ai_gateway_get_response.py | 2 ++ .../types/ai_gateway/ai_gateway_list_response.py | 2 ++ .../types/ai_gateway/ai_gateway_update_params.py | 2 ++ .../types/ai_gateway/ai_gateway_update_response.py | 2 ++ tests/api_resources/test_ai_gateway.py | 4 ++++ 10 files changed, 27 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 1ee743c42ca..4ae209d6082 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1528 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-887ade36d2957effd1eab81d57757494f1d219baf3d5f3f89e03cebfb618b0aa.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-94b03770d4a7121d03199dcc37cc9f476690fe3f591ca874dc3d8d5500059a16.yml diff --git a/src/cloudflare/resources/ai_gateway/ai_gateway.py b/src/cloudflare/resources/ai_gateway/ai_gateway.py index 04527825a3f..feb9806e49e 100644 --- a/src/cloudflare/resources/ai_gateway/ai_gateway.py +++ b/src/cloudflare/resources/ai_gateway/ai_gateway.py @@ -114,6 +114,7 @@ def create( rate_limiting_technique: Literal["fixed", "sliding"], authentication: bool | NotGiven = NOT_GIVEN, log_management: Optional[int] | NotGiven = NOT_GIVEN, + log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] | NotGiven = NOT_GIVEN, logpush: bool | NotGiven = NOT_GIVEN, logpush_public_key: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -152,6 +153,7 @@ def create( "rate_limiting_technique": rate_limiting_technique, "authentication": authentication, "log_management": log_management, + "log_management_strategy": log_management_strategy, "logpush": logpush, "logpush_public_key": logpush_public_key, }, @@ -180,6 +182,7 @@ def update( rate_limiting_technique: Literal["fixed", "sliding"], authentication: bool | NotGiven = NOT_GIVEN, log_management: Optional[int] | NotGiven = NOT_GIVEN, + log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] | NotGiven = NOT_GIVEN, logpush: bool | NotGiven = NOT_GIVEN, logpush_public_key: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -219,6 +222,7 @@ def update( "rate_limiting_technique": rate_limiting_technique, "authentication": authentication, "log_management": log_management, + "log_management_strategy": log_management_strategy, "logpush": logpush, "logpush_public_key": logpush_public_key, }, @@ -418,6 +422,7 @@ async def create( rate_limiting_technique: Literal["fixed", "sliding"], authentication: bool | NotGiven = NOT_GIVEN, log_management: Optional[int] | NotGiven = NOT_GIVEN, + log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] | NotGiven = NOT_GIVEN, logpush: bool | NotGiven = NOT_GIVEN, logpush_public_key: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -456,6 +461,7 @@ async def create( "rate_limiting_technique": rate_limiting_technique, "authentication": authentication, "log_management": log_management, + "log_management_strategy": log_management_strategy, "logpush": logpush, "logpush_public_key": logpush_public_key, }, @@ -484,6 +490,7 @@ async def update( rate_limiting_technique: Literal["fixed", "sliding"], authentication: bool | NotGiven = NOT_GIVEN, log_management: Optional[int] | NotGiven = NOT_GIVEN, + log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] | NotGiven = NOT_GIVEN, logpush: bool | NotGiven = NOT_GIVEN, logpush_public_key: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -523,6 +530,7 @@ async def update( "rate_limiting_technique": rate_limiting_technique, "authentication": authentication, "log_management": log_management, + "log_management_strategy": log_management_strategy, "logpush": logpush, "logpush_public_key": logpush_public_key, }, diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_create_params.py b/src/cloudflare/types/ai_gateway/ai_gateway_create_params.py index 1242db27329..8fb1ff57e1c 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_create_params.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_create_params.py @@ -30,6 +30,8 @@ class AIGatewayCreateParams(TypedDict, total=False): log_management: Optional[int] + log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] + logpush: bool logpush_public_key: Optional[str] diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_create_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_create_response.py index 659a0523b84..6f48d005f7d 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_create_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_create_response.py @@ -39,6 +39,8 @@ class AIGatewayCreateResponse(BaseModel): log_management: Optional[int] = None + log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] = None + logpush: Optional[bool] = None logpush_public_key: Optional[str] = None diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_delete_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_delete_response.py index 10b0d26861b..b3bfb5e0092 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_delete_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_delete_response.py @@ -39,6 +39,8 @@ class AIGatewayDeleteResponse(BaseModel): log_management: Optional[int] = None + log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] = None + logpush: Optional[bool] = None logpush_public_key: Optional[str] = None diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_get_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_get_response.py index 665f102fb1b..ba3263f0cc8 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_get_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_get_response.py @@ -39,6 +39,8 @@ class AIGatewayGetResponse(BaseModel): log_management: Optional[int] = None + log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] = None + logpush: Optional[bool] = None logpush_public_key: Optional[str] = None diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_list_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_list_response.py index 4b68d03f3fe..882b4e684c2 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_list_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_list_response.py @@ -39,6 +39,8 @@ class AIGatewayListResponse(BaseModel): log_management: Optional[int] = None + log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] = None + logpush: Optional[bool] = None logpush_public_key: Optional[str] = None diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_update_params.py b/src/cloudflare/types/ai_gateway/ai_gateway_update_params.py index 8e088902f48..3408639a7d7 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_update_params.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_update_params.py @@ -27,6 +27,8 @@ class AIGatewayUpdateParams(TypedDict, total=False): log_management: Optional[int] + log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] + logpush: bool logpush_public_key: Optional[str] diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_update_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_update_response.py index bc0b2aa30db..7f865b278ed 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_update_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_update_response.py @@ -39,6 +39,8 @@ class AIGatewayUpdateResponse(BaseModel): log_management: Optional[int] = None + log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] = None + logpush: Optional[bool] = None logpush_public_key: Optional[str] = None diff --git a/tests/api_resources/test_ai_gateway.py b/tests/api_resources/test_ai_gateway.py index 788a1ea2289..be57afddcff 100644 --- a/tests/api_resources/test_ai_gateway.py +++ b/tests/api_resources/test_ai_gateway.py @@ -51,6 +51,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: rate_limiting_technique="fixed", authentication=True, log_management=10000, + log_management_strategy="STOP_INSERTING", logpush=True, logpush_public_key="xxxxxxxxxxxxxxxx", ) @@ -135,6 +136,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: rate_limiting_technique="fixed", authentication=True, log_management=10000, + log_management_strategy="STOP_INSERTING", logpush=True, logpush_public_key="xxxxxxxxxxxxxxxx", ) @@ -379,6 +381,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare rate_limiting_technique="fixed", authentication=True, log_management=10000, + log_management_strategy="STOP_INSERTING", logpush=True, logpush_public_key="xxxxxxxxxxxxxxxx", ) @@ -463,6 +466,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare rate_limiting_technique="fixed", authentication=True, log_management=10000, + log_management_strategy="STOP_INSERTING", logpush=True, logpush_public_key="xxxxxxxxxxxxxxxx", ) From 89e9d32cbe5e7fb992d367906592b69a2bd696de Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 17:09:48 +0000 Subject: [PATCH 209/358] chore(internal): codegen related update (#2457) --- README.md | 19 +++++++++++++++++++ src/cloudflare/_files.py | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ca473229f1c..3f6263c150d 100644 --- a/README.md +++ b/README.md @@ -142,6 +142,25 @@ for account in first_page.result: # Remove `await` for non-async usage. ``` +## File uploads + +Request parameters that correspond to file uploads can be passed as `bytes`, a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`. + +```python +from pathlib import Path +from cloudflare import Cloudflare + +client = Cloudflare() + +client.api_gateway.user_schemas.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + file=Path("/path/to/file"), + kind="openapi_v3", +) +``` + +The async client uses the exact same interface. If you pass a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance, the file contents will be read asynchronously automatically. + ## Handling errors When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `cloudflare.APIConnectionError` is raised. diff --git a/src/cloudflare/_files.py b/src/cloudflare/_files.py index 715cc2078d1..8c03622633a 100644 --- a/src/cloudflare/_files.py +++ b/src/cloudflare/_files.py @@ -34,7 +34,7 @@ def assert_is_file_content(obj: object, *, key: str | None = None) -> None: if not is_file_content(obj): prefix = f"Expected entry at `{key}`" if key is not None else f"Expected file input `{obj!r}`" raise RuntimeError( - f"{prefix} to be bytes, an io.IOBase instance, PathLike or a tuple but received {type(obj)} instead." + f"{prefix} to be bytes, an io.IOBase instance, PathLike or a tuple but received {type(obj)} instead. See https://github.com/cloudflare/cloudflare-python/tree/main#file-uploads" ) from None From 9491b055820de585ad37df2fdbf3abf57f72a11e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 18:23:40 +0000 Subject: [PATCH 210/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 4ae209d6082..dc1d643071a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1528 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-94b03770d4a7121d03199dcc37cc9f476690fe3f591ca874dc3d8d5500059a16.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ee6b0ebcaaeb5fabb294c801955fade228195fe720429fe46bc98a5c03c74e41.yml From 67abb9e761eeac857b3703c36bbc46995271054d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 18:43:23 +0000 Subject: [PATCH 211/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index dc1d643071a..4ae209d6082 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1528 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ee6b0ebcaaeb5fabb294c801955fade228195fe720429fe46bc98a5c03c74e41.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-94b03770d4a7121d03199dcc37cc9f476690fe3f591ca874dc3d8d5500059a16.yml From 7b08f99a12b8fecdec2f798744876f1cdb2ed348 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 19:20:46 +0000 Subject: [PATCH 212/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 4ae209d6082..dc1d643071a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1528 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-94b03770d4a7121d03199dcc37cc9f476690fe3f591ca874dc3d8d5500059a16.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ee6b0ebcaaeb5fabb294c801955fade228195fe720429fe46bc98a5c03c74e41.yml From 25d39d166c1b53443cc678065bf64c2e87816c8c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 19:31:22 +0000 Subject: [PATCH 213/358] feat(api): api update (#2458) --- .stats.yml | 2 +- .../devices/policies/custom/custom.py | 44 +++++++++++++++++++ .../devices/policies/default/default.py | 22 ++++++++++ .../devices/policies/custom_create_params.py | 13 ++++++ .../devices/policies/custom_edit_params.py | 13 ++++++ .../devices/policies/default_edit_params.py | 13 ++++++ .../devices/policies/default_edit_response.py | 13 ++++++ .../devices/policies/default_get_response.py | 13 ++++++ .../zero_trust/devices/settings_policy.py | 13 ++++++ .../devices/policies/test_custom.py | 8 ++++ .../devices/policies/test_default.py | 4 ++ 11 files changed, 157 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index dc1d643071a..953e6f3b870 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1528 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ee6b0ebcaaeb5fabb294c801955fade228195fe720429fe46bc98a5c03c74e41.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a9e85bad713be0131dc6634e1c1e9b76c69f06887fffc104202fd7c18898dcb5.yml diff --git a/src/cloudflare/resources/zero_trust/devices/policies/custom/custom.py b/src/cloudflare/resources/zero_trust/devices/policies/custom/custom.py index 5f57c159651..d7c60a55111 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/custom/custom.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/custom/custom.py @@ -98,10 +98,12 @@ def create( captive_portal: float | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, disable_auto_fallback: bool | NotGiven = NOT_GIVEN, + doh_in_tunnel: bool | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, exclude_office_ips: bool | NotGiven = NOT_GIVEN, lan_allow_minutes: float | NotGiven = NOT_GIVEN, lan_allow_subnet_size: float | NotGiven = NOT_GIVEN, + register_interface_ip_with_dns: bool | NotGiven = NOT_GIVEN, service_mode_v2: custom_create_params.ServiceModeV2 | NotGiven = NOT_GIVEN, support_url: str | NotGiven = NOT_GIVEN, switch_locked: bool | NotGiven = NOT_GIVEN, @@ -142,6 +144,10 @@ def create( fall back to a best guess of the default/system DNS resolvers unless this policy option is set to `true`. + doh_in_tunnel: Determines how the WARP client sends DNS requests to Cloudflare Gateway. When + `true`, DNS traffic is sent over DoH inside the WARP tunnel. When `false`, the + DoH connection operates outside of the WARP tunnel. + enabled: Whether the policy will be applied to matching devices. exclude_office_ips: Whether to add Microsoft IPs to Split Tunnel exclusions. @@ -154,6 +160,9 @@ def create( lan_allow_subnet_size: The size of the subnet for the local access network. Note that this field is omitted from the response if null or unset. + register_interface_ip_with_dns: Determines if the operating system will register WARP's local interface IP with + your on-premises DNS server. + support_url: The URL to launch when the Send Feedback button is clicked. switch_locked: Whether to allow the user to turn off the WARP switch and disconnect the client. @@ -184,10 +193,12 @@ def create( "captive_portal": captive_portal, "description": description, "disable_auto_fallback": disable_auto_fallback, + "doh_in_tunnel": doh_in_tunnel, "enabled": enabled, "exclude_office_ips": exclude_office_ips, "lan_allow_minutes": lan_allow_minutes, "lan_allow_subnet_size": lan_allow_subnet_size, + "register_interface_ip_with_dns": register_interface_ip_with_dns, "service_mode_v2": service_mode_v2, "support_url": support_url, "switch_locked": switch_locked, @@ -292,11 +303,13 @@ def edit( captive_portal: float | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, disable_auto_fallback: bool | NotGiven = NOT_GIVEN, + doh_in_tunnel: bool | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, exclude_office_ips: bool | NotGiven = NOT_GIVEN, match: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, precedence: float | NotGiven = NOT_GIVEN, + register_interface_ip_with_dns: bool | NotGiven = NOT_GIVEN, service_mode_v2: custom_edit_params.ServiceModeV2 | NotGiven = NOT_GIVEN, support_url: str | NotGiven = NOT_GIVEN, switch_locked: bool | NotGiven = NOT_GIVEN, @@ -331,6 +344,10 @@ def edit( fall back to a best guess of the default/system DNS resolvers unless this policy option is set to `true`. + doh_in_tunnel: Determines how the WARP client sends DNS requests to Cloudflare Gateway. When + `true`, DNS traffic is sent over DoH inside the WARP tunnel. When `false`, the + DoH connection operates outside of the WARP tunnel. + enabled: Whether the policy will be applied to matching devices. exclude_office_ips: Whether to add Microsoft IPs to Split Tunnel exclusions. @@ -342,6 +359,9 @@ def edit( precedence: The precedence of the policy. Lower values indicate higher precedence. Policies will be evaluated in ascending order of this field. + register_interface_ip_with_dns: Determines if the operating system will register WARP's local interface IP with + your on-premises DNS server. + support_url: The URL to launch when the Send Feedback button is clicked. switch_locked: Whether to allow the user to turn off the WARP switch and disconnect the client. @@ -371,11 +391,13 @@ def edit( "captive_portal": captive_portal, "description": description, "disable_auto_fallback": disable_auto_fallback, + "doh_in_tunnel": doh_in_tunnel, "enabled": enabled, "exclude_office_ips": exclude_office_ips, "match": match, "name": name, "precedence": precedence, + "register_interface_ip_with_dns": register_interface_ip_with_dns, "service_mode_v2": service_mode_v2, "support_url": support_url, "switch_locked": switch_locked, @@ -482,10 +504,12 @@ async def create( captive_portal: float | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, disable_auto_fallback: bool | NotGiven = NOT_GIVEN, + doh_in_tunnel: bool | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, exclude_office_ips: bool | NotGiven = NOT_GIVEN, lan_allow_minutes: float | NotGiven = NOT_GIVEN, lan_allow_subnet_size: float | NotGiven = NOT_GIVEN, + register_interface_ip_with_dns: bool | NotGiven = NOT_GIVEN, service_mode_v2: custom_create_params.ServiceModeV2 | NotGiven = NOT_GIVEN, support_url: str | NotGiven = NOT_GIVEN, switch_locked: bool | NotGiven = NOT_GIVEN, @@ -526,6 +550,10 @@ async def create( fall back to a best guess of the default/system DNS resolvers unless this policy option is set to `true`. + doh_in_tunnel: Determines how the WARP client sends DNS requests to Cloudflare Gateway. When + `true`, DNS traffic is sent over DoH inside the WARP tunnel. When `false`, the + DoH connection operates outside of the WARP tunnel. + enabled: Whether the policy will be applied to matching devices. exclude_office_ips: Whether to add Microsoft IPs to Split Tunnel exclusions. @@ -538,6 +566,9 @@ async def create( lan_allow_subnet_size: The size of the subnet for the local access network. Note that this field is omitted from the response if null or unset. + register_interface_ip_with_dns: Determines if the operating system will register WARP's local interface IP with + your on-premises DNS server. + support_url: The URL to launch when the Send Feedback button is clicked. switch_locked: Whether to allow the user to turn off the WARP switch and disconnect the client. @@ -568,10 +599,12 @@ async def create( "captive_portal": captive_portal, "description": description, "disable_auto_fallback": disable_auto_fallback, + "doh_in_tunnel": doh_in_tunnel, "enabled": enabled, "exclude_office_ips": exclude_office_ips, "lan_allow_minutes": lan_allow_minutes, "lan_allow_subnet_size": lan_allow_subnet_size, + "register_interface_ip_with_dns": register_interface_ip_with_dns, "service_mode_v2": service_mode_v2, "support_url": support_url, "switch_locked": switch_locked, @@ -676,11 +709,13 @@ async def edit( captive_portal: float | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, disable_auto_fallback: bool | NotGiven = NOT_GIVEN, + doh_in_tunnel: bool | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, exclude_office_ips: bool | NotGiven = NOT_GIVEN, match: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, precedence: float | NotGiven = NOT_GIVEN, + register_interface_ip_with_dns: bool | NotGiven = NOT_GIVEN, service_mode_v2: custom_edit_params.ServiceModeV2 | NotGiven = NOT_GIVEN, support_url: str | NotGiven = NOT_GIVEN, switch_locked: bool | NotGiven = NOT_GIVEN, @@ -715,6 +750,10 @@ async def edit( fall back to a best guess of the default/system DNS resolvers unless this policy option is set to `true`. + doh_in_tunnel: Determines how the WARP client sends DNS requests to Cloudflare Gateway. When + `true`, DNS traffic is sent over DoH inside the WARP tunnel. When `false`, the + DoH connection operates outside of the WARP tunnel. + enabled: Whether the policy will be applied to matching devices. exclude_office_ips: Whether to add Microsoft IPs to Split Tunnel exclusions. @@ -726,6 +765,9 @@ async def edit( precedence: The precedence of the policy. Lower values indicate higher precedence. Policies will be evaluated in ascending order of this field. + register_interface_ip_with_dns: Determines if the operating system will register WARP's local interface IP with + your on-premises DNS server. + support_url: The URL to launch when the Send Feedback button is clicked. switch_locked: Whether to allow the user to turn off the WARP switch and disconnect the client. @@ -755,11 +797,13 @@ async def edit( "captive_portal": captive_portal, "description": description, "disable_auto_fallback": disable_auto_fallback, + "doh_in_tunnel": doh_in_tunnel, "enabled": enabled, "exclude_office_ips": exclude_office_ips, "match": match, "name": name, "precedence": precedence, + "register_interface_ip_with_dns": register_interface_ip_with_dns, "service_mode_v2": service_mode_v2, "support_url": support_url, "switch_locked": switch_locked, diff --git a/src/cloudflare/resources/zero_trust/devices/policies/default/default.py b/src/cloudflare/resources/zero_trust/devices/policies/default/default.py index a2935974660..219481d780e 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/default/default.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/default/default.py @@ -106,7 +106,9 @@ def edit( auto_connect: float | NotGiven = NOT_GIVEN, captive_portal: float | NotGiven = NOT_GIVEN, disable_auto_fallback: bool | NotGiven = NOT_GIVEN, + doh_in_tunnel: bool | NotGiven = NOT_GIVEN, exclude_office_ips: bool | NotGiven = NOT_GIVEN, + register_interface_ip_with_dns: bool | NotGiven = NOT_GIVEN, service_mode_v2: default_edit_params.ServiceModeV2 | NotGiven = NOT_GIVEN, support_url: str | NotGiven = NOT_GIVEN, switch_locked: bool | NotGiven = NOT_GIVEN, @@ -137,8 +139,15 @@ def edit( fall back to a best guess of the default/system DNS resolvers unless this policy option is set to `true`. + doh_in_tunnel: Determines how the WARP client sends DNS requests to Cloudflare Gateway. When + `true`, DNS traffic is sent over DoH inside the WARP tunnel. When `false`, the + DoH connection operates outside of the WARP tunnel. + exclude_office_ips: Whether to add Microsoft IPs to Split Tunnel exclusions. + register_interface_ip_with_dns: Determines if the operating system will register WARP's local interface IP with + your on-premises DNS server. + support_url: The URL to launch when the Send Feedback button is clicked. switch_locked: Whether to allow the user to turn off the WARP switch and disconnect the client. @@ -165,7 +174,9 @@ def edit( "auto_connect": auto_connect, "captive_portal": captive_portal, "disable_auto_fallback": disable_auto_fallback, + "doh_in_tunnel": doh_in_tunnel, "exclude_office_ips": exclude_office_ips, + "register_interface_ip_with_dns": register_interface_ip_with_dns, "service_mode_v2": service_mode_v2, "support_url": support_url, "switch_locked": switch_locked, @@ -267,7 +278,9 @@ async def edit( auto_connect: float | NotGiven = NOT_GIVEN, captive_portal: float | NotGiven = NOT_GIVEN, disable_auto_fallback: bool | NotGiven = NOT_GIVEN, + doh_in_tunnel: bool | NotGiven = NOT_GIVEN, exclude_office_ips: bool | NotGiven = NOT_GIVEN, + register_interface_ip_with_dns: bool | NotGiven = NOT_GIVEN, service_mode_v2: default_edit_params.ServiceModeV2 | NotGiven = NOT_GIVEN, support_url: str | NotGiven = NOT_GIVEN, switch_locked: bool | NotGiven = NOT_GIVEN, @@ -298,8 +311,15 @@ async def edit( fall back to a best guess of the default/system DNS resolvers unless this policy option is set to `true`. + doh_in_tunnel: Determines how the WARP client sends DNS requests to Cloudflare Gateway. When + `true`, DNS traffic is sent over DoH inside the WARP tunnel. When `false`, the + DoH connection operates outside of the WARP tunnel. + exclude_office_ips: Whether to add Microsoft IPs to Split Tunnel exclusions. + register_interface_ip_with_dns: Determines if the operating system will register WARP's local interface IP with + your on-premises DNS server. + support_url: The URL to launch when the Send Feedback button is clicked. switch_locked: Whether to allow the user to turn off the WARP switch and disconnect the client. @@ -326,7 +346,9 @@ async def edit( "auto_connect": auto_connect, "captive_portal": captive_portal, "disable_auto_fallback": disable_auto_fallback, + "doh_in_tunnel": doh_in_tunnel, "exclude_office_ips": exclude_office_ips, + "register_interface_ip_with_dns": register_interface_ip_with_dns, "service_mode_v2": service_mode_v2, "support_url": support_url, "switch_locked": switch_locked, diff --git a/src/cloudflare/types/zero_trust/devices/policies/custom_create_params.py b/src/cloudflare/types/zero_trust/devices/policies/custom_create_params.py index d8ae4b09f98..7966ef7e504 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/custom_create_params.py +++ b/src/cloudflare/types/zero_trust/devices/policies/custom_create_params.py @@ -51,6 +51,13 @@ class CustomCreateParams(TypedDict, total=False): option is set to `true`. """ + doh_in_tunnel: bool + """Determines how the WARP client sends DNS requests to Cloudflare Gateway. + + When `true`, DNS traffic is sent over DoH inside the WARP tunnel. When `false`, + the DoH connection operates outside of the WARP tunnel. + """ + enabled: bool """Whether the policy will be applied to matching devices.""" @@ -71,6 +78,12 @@ class CustomCreateParams(TypedDict, total=False): Note that this field is omitted from the response if null or unset. """ + register_interface_ip_with_dns: bool + """ + Determines if the operating system will register WARP's local interface IP with + your on-premises DNS server. + """ + service_mode_v2: ServiceModeV2 support_url: str diff --git a/src/cloudflare/types/zero_trust/devices/policies/custom_edit_params.py b/src/cloudflare/types/zero_trust/devices/policies/custom_edit_params.py index 3f5d0618429..ac6f433aff6 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/custom_edit_params.py +++ b/src/cloudflare/types/zero_trust/devices/policies/custom_edit_params.py @@ -38,6 +38,13 @@ class CustomEditParams(TypedDict, total=False): option is set to `true`. """ + doh_in_tunnel: bool + """Determines how the WARP client sends DNS requests to Cloudflare Gateway. + + When `true`, DNS traffic is sent over DoH inside the WARP tunnel. When `false`, + the DoH connection operates outside of the WARP tunnel. + """ + enabled: bool """Whether the policy will be applied to matching devices.""" @@ -57,6 +64,12 @@ class CustomEditParams(TypedDict, total=False): order of this field. """ + register_interface_ip_with_dns: bool + """ + Determines if the operating system will register WARP's local interface IP with + your on-premises DNS server. + """ + service_mode_v2: ServiceModeV2 support_url: str diff --git a/src/cloudflare/types/zero_trust/devices/policies/default_edit_params.py b/src/cloudflare/types/zero_trust/devices/policies/default_edit_params.py index a8da2673535..20777e5642d 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/default_edit_params.py +++ b/src/cloudflare/types/zero_trust/devices/policies/default_edit_params.py @@ -35,9 +35,22 @@ class DefaultEditParams(TypedDict, total=False): option is set to `true`. """ + doh_in_tunnel: bool + """Determines how the WARP client sends DNS requests to Cloudflare Gateway. + + When `true`, DNS traffic is sent over DoH inside the WARP tunnel. When `false`, + the DoH connection operates outside of the WARP tunnel. + """ + exclude_office_ips: bool """Whether to add Microsoft IPs to Split Tunnel exclusions.""" + register_interface_ip_with_dns: bool + """ + Determines if the operating system will register WARP's local interface IP with + your on-premises DNS server. + """ + service_mode_v2: ServiceModeV2 support_url: str diff --git a/src/cloudflare/types/zero_trust/devices/policies/default_edit_response.py b/src/cloudflare/types/zero_trust/devices/policies/default_edit_response.py index 2b837a1f4f2..cba59aca89e 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/default_edit_response.py +++ b/src/cloudflare/types/zero_trust/devices/policies/default_edit_response.py @@ -47,6 +47,13 @@ class DefaultEditResponse(BaseModel): option is set to `true`. """ + doh_in_tunnel: Optional[bool] = None + """Determines how the WARP client sends DNS requests to Cloudflare Gateway. + + When `true`, DNS traffic is sent over DoH inside the WARP tunnel. When `false`, + the DoH connection operates outside of the WARP tunnel. + """ + enabled: Optional[bool] = None """Whether the policy will be applied to matching devices.""" @@ -61,6 +68,12 @@ class DefaultEditResponse(BaseModel): include: Optional[List[SplitTunnelInclude]] = None + register_interface_ip_with_dns: Optional[bool] = None + """ + Determines if the operating system will register WARP's local interface IP with + your on-premises DNS server. + """ + service_mode_v2: Optional[ServiceModeV2] = None support_url: Optional[str] = None diff --git a/src/cloudflare/types/zero_trust/devices/policies/default_get_response.py b/src/cloudflare/types/zero_trust/devices/policies/default_get_response.py index a88250c4286..a79eeab0e0c 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/default_get_response.py +++ b/src/cloudflare/types/zero_trust/devices/policies/default_get_response.py @@ -47,6 +47,13 @@ class DefaultGetResponse(BaseModel): option is set to `true`. """ + doh_in_tunnel: Optional[bool] = None + """Determines how the WARP client sends DNS requests to Cloudflare Gateway. + + When `true`, DNS traffic is sent over DoH inside the WARP tunnel. When `false`, + the DoH connection operates outside of the WARP tunnel. + """ + enabled: Optional[bool] = None """Whether the policy will be applied to matching devices.""" @@ -61,6 +68,12 @@ class DefaultGetResponse(BaseModel): include: Optional[List[SplitTunnelInclude]] = None + register_interface_ip_with_dns: Optional[bool] = None + """ + Determines if the operating system will register WARP's local interface IP with + your on-premises DNS server. + """ + service_mode_v2: Optional[ServiceModeV2] = None support_url: Optional[str] = None diff --git a/src/cloudflare/types/zero_trust/devices/settings_policy.py b/src/cloudflare/types/zero_trust/devices/settings_policy.py index d8e810c70b1..8b6ae8733ec 100644 --- a/src/cloudflare/types/zero_trust/devices/settings_policy.py +++ b/src/cloudflare/types/zero_trust/devices/settings_policy.py @@ -58,6 +58,13 @@ class SettingsPolicy(BaseModel): option is set to `true`. """ + doh_in_tunnel: Optional[bool] = None + """Determines how the WARP client sends DNS requests to Cloudflare Gateway. + + When `true`, DNS traffic is sent over DoH inside the WARP tunnel. When `false`, + the DoH connection operates outside of the WARP tunnel. + """ + enabled: Optional[bool] = None """Whether the policy will be applied to matching devices.""" @@ -102,6 +109,12 @@ class SettingsPolicy(BaseModel): order of this field. """ + register_interface_ip_with_dns: Optional[bool] = None + """ + Determines if the operating system will register WARP's local interface IP with + your on-premises DNS server. + """ + service_mode_v2: Optional[ServiceModeV2] = None support_url: Optional[str] = None diff --git a/tests/api_resources/zero_trust/devices/policies/test_custom.py b/tests/api_resources/zero_trust/devices/policies/test_custom.py index 562a6302412..21cd1f9b23e 100644 --- a/tests/api_resources/zero_trust/devices/policies/test_custom.py +++ b/tests/api_resources/zero_trust/devices/policies/test_custom.py @@ -44,10 +44,12 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: captive_portal=180, description="Policy for test teams.", disable_auto_fallback=True, + doh_in_tunnel=True, enabled=True, exclude_office_ips=True, lan_allow_minutes=30, lan_allow_subnet_size=24, + register_interface_ip_with_dns=True, service_mode_v2={ "mode": "proxy", "port": 3000, @@ -209,11 +211,13 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: captive_portal=180, description="Policy for test teams.", disable_auto_fallback=True, + doh_in_tunnel=True, enabled=True, exclude_office_ips=True, match='user.identity == "test@cloudflare.com"', name="Allow Developers", precedence=100, + register_interface_ip_with_dns=True, service_mode_v2={ "mode": "proxy", "port": 3000, @@ -349,10 +353,12 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare captive_portal=180, description="Policy for test teams.", disable_auto_fallback=True, + doh_in_tunnel=True, enabled=True, exclude_office_ips=True, lan_allow_minutes=30, lan_allow_subnet_size=24, + register_interface_ip_with_dns=True, service_mode_v2={ "mode": "proxy", "port": 3000, @@ -514,11 +520,13 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) captive_portal=180, description="Policy for test teams.", disable_auto_fallback=True, + doh_in_tunnel=True, enabled=True, exclude_office_ips=True, match='user.identity == "test@cloudflare.com"', name="Allow Developers", precedence=100, + register_interface_ip_with_dns=True, service_mode_v2={ "mode": "proxy", "port": 3000, diff --git a/tests/api_resources/zero_trust/devices/policies/test_default.py b/tests/api_resources/zero_trust/devices/policies/test_default.py index 166f4259bcc..d01fcfd8a7d 100644 --- a/tests/api_resources/zero_trust/devices/policies/test_default.py +++ b/tests/api_resources/zero_trust/devices/policies/test_default.py @@ -34,7 +34,9 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: auto_connect=0, captive_portal=180, disable_auto_fallback=True, + doh_in_tunnel=True, exclude_office_ips=True, + register_interface_ip_with_dns=True, service_mode_v2={ "mode": "proxy", "port": 3000, @@ -135,7 +137,9 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) auto_connect=0, captive_portal=180, disable_auto_fallback=True, + doh_in_tunnel=True, exclude_office_ips=True, + register_interface_ip_with_dns=True, service_mode_v2={ "mode": "proxy", "port": 3000, From b181496b8bafca60cf86bfb77f33eaa3f4c513cf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 20:13:41 +0000 Subject: [PATCH 214/358] feat(api): api update (#2459) --- .stats.yml | 2 +- .../resources/magic_transit/pcaps/pcaps.py | 15 ++++++++++++++- src/cloudflare/types/magic_transit/pcap.py | 8 ++++++++ .../types/magic_transit/pcap_create_params.py | 11 ++++++++++- tests/api_resources/magic_transit/test_pcaps.py | 3 +++ 5 files changed, 36 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 953e6f3b870..a1d1b1fc9c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1528 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a9e85bad713be0131dc6634e1c1e9b76c69f06887fffc104202fd7c18898dcb5.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5ccb565ee8508335116b0ce9efa6068ddb775fe825726cf3fad2731c6f814f77.yml diff --git a/src/cloudflare/resources/magic_transit/pcaps/pcaps.py b/src/cloudflare/resources/magic_transit/pcaps/pcaps.py index ebaa2c63e69..66770f6309f 100644 --- a/src/cloudflare/resources/magic_transit/pcaps/pcaps.py +++ b/src/cloudflare/resources/magic_transit/pcaps/pcaps.py @@ -2,7 +2,8 @@ from __future__ import annotations -from typing import Any, cast +from typing import Any, Union, cast +from datetime import datetime from typing_extensions import Literal, overload import httpx @@ -87,6 +88,7 @@ def create( time_limit: float, type: Literal["simple", "full"], filter_v1: PCAPFilterParam | NotGiven = NOT_GIVEN, + offset_time: Union[str, datetime] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -111,6 +113,9 @@ def create( filter_v1: The packet capture filter. When this field is empty, all packets are captured. + offset_time: The RFC 3339 offset timestamp from which to query backwards for packets. Must be + within the last 24h. When this field is empty, defaults to time of request. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -190,6 +195,7 @@ def create( time_limit: float, type: Literal["simple", "full"], filter_v1: PCAPFilterParam | NotGiven = NOT_GIVEN, + offset_time: Union[str, datetime] | NotGiven = NOT_GIVEN, colo_name: str | NotGiven = NOT_GIVEN, destination_conf: str | NotGiven = NOT_GIVEN, byte_limit: float | NotGiven = NOT_GIVEN, @@ -213,6 +219,7 @@ def create( "time_limit": time_limit, "type": type, "filter_v1": filter_v1, + "offset_time": offset_time, "colo_name": colo_name, "destination_conf": destination_conf, "byte_limit": byte_limit, @@ -356,6 +363,7 @@ async def create( time_limit: float, type: Literal["simple", "full"], filter_v1: PCAPFilterParam | NotGiven = NOT_GIVEN, + offset_time: Union[str, datetime] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -380,6 +388,9 @@ async def create( filter_v1: The packet capture filter. When this field is empty, all packets are captured. + offset_time: The RFC 3339 offset timestamp from which to query backwards for packets. Must be + within the last 24h. When this field is empty, defaults to time of request. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -459,6 +470,7 @@ async def create( time_limit: float, type: Literal["simple", "full"], filter_v1: PCAPFilterParam | NotGiven = NOT_GIVEN, + offset_time: Union[str, datetime] | NotGiven = NOT_GIVEN, colo_name: str | NotGiven = NOT_GIVEN, destination_conf: str | NotGiven = NOT_GIVEN, byte_limit: float | NotGiven = NOT_GIVEN, @@ -482,6 +494,7 @@ async def create( "time_limit": time_limit, "type": type, "filter_v1": filter_v1, + "offset_time": offset_time, "colo_name": colo_name, "destination_conf": destination_conf, "byte_limit": byte_limit, diff --git a/src/cloudflare/types/magic_transit/pcap.py b/src/cloudflare/types/magic_transit/pcap.py index 849b466015c..f7e1d7cb30d 100644 --- a/src/cloudflare/types/magic_transit/pcap.py +++ b/src/cloudflare/types/magic_transit/pcap.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional +from datetime import datetime from typing_extensions import Literal from ..._models import BaseModel @@ -16,6 +17,13 @@ class PCAP(BaseModel): filter_v1: Optional[PCAPFilter] = None """The packet capture filter. When this field is empty, all packets are captured.""" + offset_time: Optional[datetime] = None + """The RFC 3339 offset timestamp from which to query backwards for packets. + + Must be within the last 24h. When this field is empty, defaults to time of + request. + """ + status: Optional[ Literal[ "unknown", "success", "pending", "running", "conversion_pending", "conversion_running", "complete", "failed" diff --git a/src/cloudflare/types/magic_transit/pcap_create_params.py b/src/cloudflare/types/magic_transit/pcap_create_params.py index b84be410701..f1bcd763956 100644 --- a/src/cloudflare/types/magic_transit/pcap_create_params.py +++ b/src/cloudflare/types/magic_transit/pcap_create_params.py @@ -3,8 +3,10 @@ from __future__ import annotations from typing import Union -from typing_extensions import Literal, Required, TypeAlias, TypedDict +from datetime import datetime +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from ..._utils import PropertyInfo from .pcap_filter_param import PCAPFilterParam __all__ = ["PCAPCreateParams", "MagicVisibilityPCAPsPCAPsRequestSimple", "MagicVisibilityPCAPsPCAPsRequestFull"] @@ -33,6 +35,13 @@ class MagicVisibilityPCAPsPCAPsRequestSimple(TypedDict, total=False): filter_v1: PCAPFilterParam """The packet capture filter. When this field is empty, all packets are captured.""" + offset_time: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """The RFC 3339 offset timestamp from which to query backwards for packets. + + Must be within the last 24h. When this field is empty, defaults to time of + request. + """ + class MagicVisibilityPCAPsPCAPsRequestFull(TypedDict, total=False): account_id: Required[str] diff --git a/tests/api_resources/magic_transit/test_pcaps.py b/tests/api_resources/magic_transit/test_pcaps.py index 71c0d0d2a0e..f20959c6efb 100644 --- a/tests/api_resources/magic_transit/test_pcaps.py +++ b/tests/api_resources/magic_transit/test_pcaps.py @@ -9,6 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare._utils import parse_datetime from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.magic_transit import ( PCAPGetResponse, @@ -48,6 +49,7 @@ def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> N "source_address": "1.2.3.4", "source_port": 123, }, + offset_time=parse_datetime("2020-01-01T08:00:00Z"), ) assert_matches_type(PCAPCreateResponse, pcap, path=["response"]) @@ -289,6 +291,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn "source_address": "1.2.3.4", "source_port": 123, }, + offset_time=parse_datetime("2020-01-01T08:00:00Z"), ) assert_matches_type(PCAPCreateResponse, pcap, path=["response"]) From 0616d2ff427c0f6c27150db06e84a5f754dbf8b0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 20:47:04 +0000 Subject: [PATCH 215/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index a1d1b1fc9c3..33e8ffea9b0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1528 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5ccb565ee8508335116b0ce9efa6068ddb775fe825726cf3fad2731c6f814f77.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-098958c3d34c1f726db27a49f075f6e8e2c9204777a0a5d6aa49ca54fc803022.yml From 08ac5af0b5189de22c0d2646535de06526bb064e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 20:53:21 +0000 Subject: [PATCH 216/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 33e8ffea9b0..a1d1b1fc9c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1528 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-098958c3d34c1f726db27a49f075f6e8e2c9204777a0a5d6aa49ca54fc803022.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5ccb565ee8508335116b0ce9efa6068ddb775fe825726cf3fad2731c6f814f77.yml From bf47c618ebfdc4c78ac884bd17ab4d2526bc2d48 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 21:41:22 +0000 Subject: [PATCH 217/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index a1d1b1fc9c3..33e8ffea9b0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1528 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5ccb565ee8508335116b0ce9efa6068ddb775fe825726cf3fad2731c6f814f77.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-098958c3d34c1f726db27a49f075f6e8e2c9204777a0a5d6aa49ca54fc803022.yml From 3614d2e808b9dbba6910e5c1f5d5a6f31653df9d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 23:00:11 +0000 Subject: [PATCH 218/358] feat(zaraz): re-enable resources (#2460) --- .stats.yml | 2 +- api.md | 86 ++ src/cloudflare/_client.py | 38 + src/cloudflare/resources/zaraz/__init__.py | 103 +++ src/cloudflare/resources/zaraz/config.py | 377 +++++++++ src/cloudflare/resources/zaraz/default.py | 178 ++++ src/cloudflare/resources/zaraz/export.py | 169 ++++ .../resources/zaraz/history/__init__.py | 33 + .../resources/zaraz/history/configs.py | 191 +++++ .../resources/zaraz/history/history.py | 358 ++++++++ src/cloudflare/resources/zaraz/publish.py | 191 +++++ src/cloudflare/resources/zaraz/workflow.py | 178 ++++ src/cloudflare/resources/zaraz/zaraz.py | 383 +++++++++ src/cloudflare/types/zaraz/__init__.py | 17 + .../types/zaraz/button_text_translation.py | 18 + .../zaraz/button_text_translation_param.py | 19 + .../types/zaraz/config_update_params.py | 603 ++++++++++++++ src/cloudflare/types/zaraz/configuration.py | 596 +++++++++++++ .../types/zaraz/history/__init__.py | 6 + .../types/zaraz/history/config_get_params.py | 16 + .../zaraz/history/config_get_response.py | 32 + .../types/zaraz/history_list_params.py | 28 + .../types/zaraz/history_list_response.py | 26 + .../types/zaraz/history_update_params.py | 15 + src/cloudflare/types/zaraz/neo_event.py | 23 + src/cloudflare/types/zaraz/neo_event_param.py | 24 + .../types/zaraz/publish_create_params.py | 15 + .../types/zaraz/publish_create_response.py | 7 + src/cloudflare/types/zaraz/workflow.py | 7 + .../types/zaraz/zaraz_update_params.py | 17 + tests/api_resources/test_zaraz.py | 106 +++ tests/api_resources/zaraz/__init__.py | 1 + tests/api_resources/zaraz/history/__init__.py | 1 + .../zaraz/history/test_configs.py | 106 +++ tests/api_resources/zaraz/test_config.py | 782 ++++++++++++++++++ tests/api_resources/zaraz/test_default.py | 98 +++ tests/api_resources/zaraz/test_export.py | 98 +++ tests/api_resources/zaraz/test_history.py | 205 +++++ tests/api_resources/zaraz/test_publish.py | 105 +++ tests/api_resources/zaraz/test_workflow.py | 98 +++ 40 files changed, 5355 insertions(+), 1 deletion(-) create mode 100644 src/cloudflare/resources/zaraz/__init__.py create mode 100644 src/cloudflare/resources/zaraz/config.py create mode 100644 src/cloudflare/resources/zaraz/default.py create mode 100644 src/cloudflare/resources/zaraz/export.py create mode 100644 src/cloudflare/resources/zaraz/history/__init__.py create mode 100644 src/cloudflare/resources/zaraz/history/configs.py create mode 100644 src/cloudflare/resources/zaraz/history/history.py create mode 100644 src/cloudflare/resources/zaraz/publish.py create mode 100644 src/cloudflare/resources/zaraz/workflow.py create mode 100644 src/cloudflare/resources/zaraz/zaraz.py create mode 100644 src/cloudflare/types/zaraz/__init__.py create mode 100644 src/cloudflare/types/zaraz/button_text_translation.py create mode 100644 src/cloudflare/types/zaraz/button_text_translation_param.py create mode 100644 src/cloudflare/types/zaraz/config_update_params.py create mode 100644 src/cloudflare/types/zaraz/configuration.py create mode 100644 src/cloudflare/types/zaraz/history/__init__.py create mode 100644 src/cloudflare/types/zaraz/history/config_get_params.py create mode 100644 src/cloudflare/types/zaraz/history/config_get_response.py create mode 100644 src/cloudflare/types/zaraz/history_list_params.py create mode 100644 src/cloudflare/types/zaraz/history_list_response.py create mode 100644 src/cloudflare/types/zaraz/history_update_params.py create mode 100644 src/cloudflare/types/zaraz/neo_event.py create mode 100644 src/cloudflare/types/zaraz/neo_event_param.py create mode 100644 src/cloudflare/types/zaraz/publish_create_params.py create mode 100644 src/cloudflare/types/zaraz/publish_create_response.py create mode 100644 src/cloudflare/types/zaraz/workflow.py create mode 100644 src/cloudflare/types/zaraz/zaraz_update_params.py create mode 100644 tests/api_resources/test_zaraz.py create mode 100644 tests/api_resources/zaraz/__init__.py create mode 100644 tests/api_resources/zaraz/history/__init__.py create mode 100644 tests/api_resources/zaraz/history/test_configs.py create mode 100644 tests/api_resources/zaraz/test_config.py create mode 100644 tests/api_resources/zaraz/test_default.py create mode 100644 tests/api_resources/zaraz/test_export.py create mode 100644 tests/api_resources/zaraz/test_history.py create mode 100644 tests/api_resources/zaraz/test_publish.py create mode 100644 tests/api_resources/zaraz/test_workflow.py diff --git a/.stats.yml b/.stats.yml index 33e8ffea9b0..2b754c290a2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 1528 +configured_endpoints: 1538 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-098958c3d34c1f726db27a49f075f6e8e2c9204777a0a5d6aa49ca54fc803022.yml diff --git a/api.md b/api.md index 6bcac4385b8..5dab35e574a 100644 --- a/api.md +++ b/api.md @@ -7979,6 +7979,92 @@ Methods: - client.origin_post_quantum_encryption.update(\*, zone_id, \*\*params) -> Optional[OriginPostQuantumEncryptionUpdateResponse] - client.origin_post_quantum_encryption.get(\*, zone_id) -> Optional[OriginPostQuantumEncryptionGetResponse] +# Zaraz + +Types: + +```python +from cloudflare.types.zaraz import ButtonTextTranslation, NeoEvent +``` + +Methods: + +- client.zaraz.update(\*, zone_id, \*\*params) -> Workflow + +## Config + +Types: + +```python +from cloudflare.types.zaraz import Configuration +``` + +Methods: + +- client.zaraz.config.update(\*, zone_id, \*\*params) -> Configuration +- client.zaraz.config.get(\*, zone_id) -> Configuration + +## Default + +Methods: + +- client.zaraz.default.get(\*, zone_id) -> Configuration + +## Export + +Methods: + +- client.zaraz.export.get(\*, zone_id) -> Configuration + +## History + +Types: + +```python +from cloudflare.types.zaraz import HistoryListResponse +``` + +Methods: + +- client.zaraz.history.update(\*, zone_id, \*\*params) -> Configuration +- client.zaraz.history.list(\*, zone_id, \*\*params) -> SyncSinglePage[HistoryListResponse] + +### Configs + +Types: + +```python +from cloudflare.types.zaraz.history import ConfigGetResponse +``` + +Methods: + +- client.zaraz.history.configs.get(\*, zone_id, \*\*params) -> ConfigGetResponse + +## Publish + +Types: + +```python +from cloudflare.types.zaraz import PublishCreateResponse +``` + +Methods: + +- client.zaraz.publish.create(\*, zone_id, \*\*params) -> str + +## Workflow + +Types: + +```python +from cloudflare.types.zaraz import Workflow +``` + +Methods: + +- client.zaraz.workflow.get(\*, zone_id) -> Workflow + # Speed Types: diff --git a/src/cloudflare/_client.py b/src/cloudflare/_client.py index 6427a186cad..fe72ce537f8 100644 --- a/src/cloudflare/_client.py +++ b/src/cloudflare/_client.py @@ -57,6 +57,7 @@ radar, rules, speed, + zaraz, zones, images, queues, @@ -151,6 +152,7 @@ from .resources.rate_limits import RateLimitsResource, AsyncRateLimitsResource from .resources.rules.rules import RulesResource, AsyncRulesResource from .resources.speed.speed import SpeedResource, AsyncSpeedResource + from .resources.zaraz.zaraz import ZarazResource, AsyncZarazResource from .resources.zones.zones import ZonesResource, AsyncZonesResource from .resources.security_txt import SecurityTXTResource, AsyncSecurityTXTResource from .resources.abuse_reports import AbuseReportsResource, AsyncAbuseReportsResource @@ -743,6 +745,12 @@ def origin_post_quantum_encryption(self) -> OriginPostQuantumEncryptionResource: return OriginPostQuantumEncryptionResource(self) + @cached_property + def zaraz(self) -> ZarazResource: + from .resources.zaraz import ZarazResource + + return ZarazResource(self) + @cached_property def speed(self) -> SpeedResource: from .resources.speed import SpeedResource @@ -1526,6 +1534,12 @@ def origin_post_quantum_encryption(self) -> AsyncOriginPostQuantumEncryptionReso return AsyncOriginPostQuantumEncryptionResource(self) + @cached_property + def zaraz(self) -> AsyncZarazResource: + from .resources.zaraz import AsyncZarazResource + + return AsyncZarazResource(self) + @cached_property def speed(self) -> AsyncSpeedResource: from .resources.speed import AsyncSpeedResource @@ -2244,6 +2258,12 @@ def origin_post_quantum_encryption( return OriginPostQuantumEncryptionResourceWithRawResponse(self._client.origin_post_quantum_encryption) + @cached_property + def zaraz(self) -> zaraz.ZarazResourceWithRawResponse: + from .resources.zaraz import ZarazResourceWithRawResponse + + return ZarazResourceWithRawResponse(self._client.zaraz) + @cached_property def speed(self) -> speed.SpeedResourceWithRawResponse: from .resources.speed import SpeedResourceWithRawResponse @@ -2781,6 +2801,12 @@ def origin_post_quantum_encryption( return AsyncOriginPostQuantumEncryptionResourceWithRawResponse(self._client.origin_post_quantum_encryption) + @cached_property + def zaraz(self) -> zaraz.AsyncZarazResourceWithRawResponse: + from .resources.zaraz import AsyncZarazResourceWithRawResponse + + return AsyncZarazResourceWithRawResponse(self._client.zaraz) + @cached_property def speed(self) -> speed.AsyncSpeedResourceWithRawResponse: from .resources.speed import AsyncSpeedResourceWithRawResponse @@ -3318,6 +3344,12 @@ def origin_post_quantum_encryption( return OriginPostQuantumEncryptionResourceWithStreamingResponse(self._client.origin_post_quantum_encryption) + @cached_property + def zaraz(self) -> zaraz.ZarazResourceWithStreamingResponse: + from .resources.zaraz import ZarazResourceWithStreamingResponse + + return ZarazResourceWithStreamingResponse(self._client.zaraz) + @cached_property def speed(self) -> speed.SpeedResourceWithStreamingResponse: from .resources.speed import SpeedResourceWithStreamingResponse @@ -3863,6 +3895,12 @@ def origin_post_quantum_encryption( self._client.origin_post_quantum_encryption ) + @cached_property + def zaraz(self) -> zaraz.AsyncZarazResourceWithStreamingResponse: + from .resources.zaraz import AsyncZarazResourceWithStreamingResponse + + return AsyncZarazResourceWithStreamingResponse(self._client.zaraz) + @cached_property def speed(self) -> speed.AsyncSpeedResourceWithStreamingResponse: from .resources.speed import AsyncSpeedResourceWithStreamingResponse diff --git a/src/cloudflare/resources/zaraz/__init__.py b/src/cloudflare/resources/zaraz/__init__.py new file mode 100644 index 00000000000..d8a2722e12c --- /dev/null +++ b/src/cloudflare/resources/zaraz/__init__.py @@ -0,0 +1,103 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .zaraz import ( + ZarazResource, + AsyncZarazResource, + ZarazResourceWithRawResponse, + AsyncZarazResourceWithRawResponse, + ZarazResourceWithStreamingResponse, + AsyncZarazResourceWithStreamingResponse, +) +from .config import ( + ConfigResource, + AsyncConfigResource, + ConfigResourceWithRawResponse, + AsyncConfigResourceWithRawResponse, + ConfigResourceWithStreamingResponse, + AsyncConfigResourceWithStreamingResponse, +) +from .export import ( + ExportResource, + AsyncExportResource, + ExportResourceWithRawResponse, + AsyncExportResourceWithRawResponse, + ExportResourceWithStreamingResponse, + AsyncExportResourceWithStreamingResponse, +) +from .default import ( + DefaultResource, + AsyncDefaultResource, + DefaultResourceWithRawResponse, + AsyncDefaultResourceWithRawResponse, + DefaultResourceWithStreamingResponse, + AsyncDefaultResourceWithStreamingResponse, +) +from .history import ( + HistoryResource, + AsyncHistoryResource, + HistoryResourceWithRawResponse, + AsyncHistoryResourceWithRawResponse, + HistoryResourceWithStreamingResponse, + AsyncHistoryResourceWithStreamingResponse, +) +from .publish import ( + PublishResource, + AsyncPublishResource, + PublishResourceWithRawResponse, + AsyncPublishResourceWithRawResponse, + PublishResourceWithStreamingResponse, + AsyncPublishResourceWithStreamingResponse, +) +from .workflow import ( + WorkflowResource, + AsyncWorkflowResource, + WorkflowResourceWithRawResponse, + AsyncWorkflowResourceWithRawResponse, + WorkflowResourceWithStreamingResponse, + AsyncWorkflowResourceWithStreamingResponse, +) + +__all__ = [ + "ConfigResource", + "AsyncConfigResource", + "ConfigResourceWithRawResponse", + "AsyncConfigResourceWithRawResponse", + "ConfigResourceWithStreamingResponse", + "AsyncConfigResourceWithStreamingResponse", + "DefaultResource", + "AsyncDefaultResource", + "DefaultResourceWithRawResponse", + "AsyncDefaultResourceWithRawResponse", + "DefaultResourceWithStreamingResponse", + "AsyncDefaultResourceWithStreamingResponse", + "ExportResource", + "AsyncExportResource", + "ExportResourceWithRawResponse", + "AsyncExportResourceWithRawResponse", + "ExportResourceWithStreamingResponse", + "AsyncExportResourceWithStreamingResponse", + "HistoryResource", + "AsyncHistoryResource", + "HistoryResourceWithRawResponse", + "AsyncHistoryResourceWithRawResponse", + "HistoryResourceWithStreamingResponse", + "AsyncHistoryResourceWithStreamingResponse", + "PublishResource", + "AsyncPublishResource", + "PublishResourceWithRawResponse", + "AsyncPublishResourceWithRawResponse", + "PublishResourceWithStreamingResponse", + "AsyncPublishResourceWithStreamingResponse", + "WorkflowResource", + "AsyncWorkflowResource", + "WorkflowResourceWithRawResponse", + "AsyncWorkflowResourceWithRawResponse", + "WorkflowResourceWithStreamingResponse", + "AsyncWorkflowResourceWithStreamingResponse", + "ZarazResource", + "AsyncZarazResource", + "ZarazResourceWithRawResponse", + "AsyncZarazResourceWithRawResponse", + "ZarazResourceWithStreamingResponse", + "AsyncZarazResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/zaraz/config.py b/src/cloudflare/resources/zaraz/config.py new file mode 100644 index 00000000000..67ed0d75d62 --- /dev/null +++ b/src/cloudflare/resources/zaraz/config.py @@ -0,0 +1,377 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Type, cast + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._wrappers import ResultWrapper +from ...types.zaraz import config_update_params +from ..._base_client import make_request_options +from ...types.zaraz.configuration import Configuration + +__all__ = ["ConfigResource", "AsyncConfigResource"] + + +class ConfigResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> ConfigResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return ConfigResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ConfigResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return ConfigResourceWithStreamingResponse(self) + + def update( + self, + *, + zone_id: str, + data_layer: bool, + debug_key: str, + settings: config_update_params.Settings, + tools: Dict[str, config_update_params.Tools], + triggers: Dict[str, config_update_params.Triggers], + variables: Dict[str, config_update_params.Variables], + zaraz_version: int, + analytics: config_update_params.Analytics | NotGiven = NOT_GIVEN, + consent: config_update_params.Consent | NotGiven = NOT_GIVEN, + history_change: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Configuration: + """ + Updates Zaraz configuration for a zone. + + Args: + zone_id: Identifier + + data_layer: Data layer compatibility mode enabled. + + debug_key: The key for Zaraz debug mode. + + settings: General Zaraz settings. + + tools: Tools set up under Zaraz configuration, where key is the alpha-numeric tool ID + and value is the tool configuration object. + + triggers: Triggers set up under Zaraz configuration, where key is the trigger + alpha-numeric ID and value is the trigger configuration. + + variables: Variables set up under Zaraz configuration, where key is the variable + alpha-numeric ID and value is the variable configuration. Values of variables of + type secret are not included. + + zaraz_version: Zaraz internal version of the config. + + analytics: Cloudflare Monitoring settings. + + consent: Consent management configuration. + + history_change: Single Page Application support enabled. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return self._put( + f"/zones/{zone_id}/settings/zaraz/config", + body=maybe_transform( + { + "data_layer": data_layer, + "debug_key": debug_key, + "settings": settings, + "tools": tools, + "triggers": triggers, + "variables": variables, + "zaraz_version": zaraz_version, + "analytics": analytics, + "consent": consent, + "history_change": history_change, + }, + config_update_params.ConfigUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Configuration]._unwrapper, + ), + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), + ) + + def get( + self, + *, + zone_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Configuration: + """Gets latest Zaraz configuration for a zone. + + It can be preview or published + configuration, whichever was the last updated. Secret variables values will not + be included. + + Args: + zone_id: Identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return self._get( + f"/zones/{zone_id}/settings/zaraz/config", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Configuration]._unwrapper, + ), + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), + ) + + +class AsyncConfigResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncConfigResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncConfigResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncConfigResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncConfigResourceWithStreamingResponse(self) + + async def update( + self, + *, + zone_id: str, + data_layer: bool, + debug_key: str, + settings: config_update_params.Settings, + tools: Dict[str, config_update_params.Tools], + triggers: Dict[str, config_update_params.Triggers], + variables: Dict[str, config_update_params.Variables], + zaraz_version: int, + analytics: config_update_params.Analytics | NotGiven = NOT_GIVEN, + consent: config_update_params.Consent | NotGiven = NOT_GIVEN, + history_change: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Configuration: + """ + Updates Zaraz configuration for a zone. + + Args: + zone_id: Identifier + + data_layer: Data layer compatibility mode enabled. + + debug_key: The key for Zaraz debug mode. + + settings: General Zaraz settings. + + tools: Tools set up under Zaraz configuration, where key is the alpha-numeric tool ID + and value is the tool configuration object. + + triggers: Triggers set up under Zaraz configuration, where key is the trigger + alpha-numeric ID and value is the trigger configuration. + + variables: Variables set up under Zaraz configuration, where key is the variable + alpha-numeric ID and value is the variable configuration. Values of variables of + type secret are not included. + + zaraz_version: Zaraz internal version of the config. + + analytics: Cloudflare Monitoring settings. + + consent: Consent management configuration. + + history_change: Single Page Application support enabled. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return await self._put( + f"/zones/{zone_id}/settings/zaraz/config", + body=await async_maybe_transform( + { + "data_layer": data_layer, + "debug_key": debug_key, + "settings": settings, + "tools": tools, + "triggers": triggers, + "variables": variables, + "zaraz_version": zaraz_version, + "analytics": analytics, + "consent": consent, + "history_change": history_change, + }, + config_update_params.ConfigUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Configuration]._unwrapper, + ), + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), + ) + + async def get( + self, + *, + zone_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Configuration: + """Gets latest Zaraz configuration for a zone. + + It can be preview or published + configuration, whichever was the last updated. Secret variables values will not + be included. + + Args: + zone_id: Identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return await self._get( + f"/zones/{zone_id}/settings/zaraz/config", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Configuration]._unwrapper, + ), + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), + ) + + +class ConfigResourceWithRawResponse: + def __init__(self, config: ConfigResource) -> None: + self._config = config + + self.update = to_raw_response_wrapper( + config.update, + ) + self.get = to_raw_response_wrapper( + config.get, + ) + + +class AsyncConfigResourceWithRawResponse: + def __init__(self, config: AsyncConfigResource) -> None: + self._config = config + + self.update = async_to_raw_response_wrapper( + config.update, + ) + self.get = async_to_raw_response_wrapper( + config.get, + ) + + +class ConfigResourceWithStreamingResponse: + def __init__(self, config: ConfigResource) -> None: + self._config = config + + self.update = to_streamed_response_wrapper( + config.update, + ) + self.get = to_streamed_response_wrapper( + config.get, + ) + + +class AsyncConfigResourceWithStreamingResponse: + def __init__(self, config: AsyncConfigResource) -> None: + self._config = config + + self.update = async_to_streamed_response_wrapper( + config.update, + ) + self.get = async_to_streamed_response_wrapper( + config.get, + ) diff --git a/src/cloudflare/resources/zaraz/default.py b/src/cloudflare/resources/zaraz/default.py new file mode 100644 index 00000000000..753060c08b3 --- /dev/null +++ b/src/cloudflare/resources/zaraz/default.py @@ -0,0 +1,178 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, cast + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._wrappers import ResultWrapper +from ..._base_client import make_request_options +from ...types.zaraz.configuration import Configuration + +__all__ = ["DefaultResource", "AsyncDefaultResource"] + + +class DefaultResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> DefaultResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return DefaultResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> DefaultResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return DefaultResourceWithStreamingResponse(self) + + def get( + self, + *, + zone_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Configuration: + """ + Gets default Zaraz configuration for a zone. + + Args: + zone_id: Identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return self._get( + f"/zones/{zone_id}/settings/zaraz/default", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Configuration]._unwrapper, + ), + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), + ) + + +class AsyncDefaultResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncDefaultResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncDefaultResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncDefaultResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncDefaultResourceWithStreamingResponse(self) + + async def get( + self, + *, + zone_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Configuration: + """ + Gets default Zaraz configuration for a zone. + + Args: + zone_id: Identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return await self._get( + f"/zones/{zone_id}/settings/zaraz/default", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Configuration]._unwrapper, + ), + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), + ) + + +class DefaultResourceWithRawResponse: + def __init__(self, default: DefaultResource) -> None: + self._default = default + + self.get = to_raw_response_wrapper( + default.get, + ) + + +class AsyncDefaultResourceWithRawResponse: + def __init__(self, default: AsyncDefaultResource) -> None: + self._default = default + + self.get = async_to_raw_response_wrapper( + default.get, + ) + + +class DefaultResourceWithStreamingResponse: + def __init__(self, default: DefaultResource) -> None: + self._default = default + + self.get = to_streamed_response_wrapper( + default.get, + ) + + +class AsyncDefaultResourceWithStreamingResponse: + def __init__(self, default: AsyncDefaultResource) -> None: + self._default = default + + self.get = async_to_streamed_response_wrapper( + default.get, + ) diff --git a/src/cloudflare/resources/zaraz/export.py b/src/cloudflare/resources/zaraz/export.py new file mode 100644 index 00000000000..3fb2d2dd239 --- /dev/null +++ b/src/cloudflare/resources/zaraz/export.py @@ -0,0 +1,169 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.zaraz.configuration import Configuration + +__all__ = ["ExportResource", "AsyncExportResource"] + + +class ExportResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> ExportResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return ExportResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ExportResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return ExportResourceWithStreamingResponse(self) + + def get( + self, + *, + zone_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Configuration: + """ + Exports full current published Zaraz configuration for a zone, secret variables + included. + + Args: + zone_id: Identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return self._get( + f"/zones/{zone_id}/settings/zaraz/export", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=Configuration, + ) + + +class AsyncExportResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncExportResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncExportResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncExportResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncExportResourceWithStreamingResponse(self) + + async def get( + self, + *, + zone_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Configuration: + """ + Exports full current published Zaraz configuration for a zone, secret variables + included. + + Args: + zone_id: Identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return await self._get( + f"/zones/{zone_id}/settings/zaraz/export", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=Configuration, + ) + + +class ExportResourceWithRawResponse: + def __init__(self, export: ExportResource) -> None: + self._export = export + + self.get = to_raw_response_wrapper( + export.get, + ) + + +class AsyncExportResourceWithRawResponse: + def __init__(self, export: AsyncExportResource) -> None: + self._export = export + + self.get = async_to_raw_response_wrapper( + export.get, + ) + + +class ExportResourceWithStreamingResponse: + def __init__(self, export: ExportResource) -> None: + self._export = export + + self.get = to_streamed_response_wrapper( + export.get, + ) + + +class AsyncExportResourceWithStreamingResponse: + def __init__(self, export: AsyncExportResource) -> None: + self._export = export + + self.get = async_to_streamed_response_wrapper( + export.get, + ) diff --git a/src/cloudflare/resources/zaraz/history/__init__.py b/src/cloudflare/resources/zaraz/history/__init__.py new file mode 100644 index 00000000000..c1bebe0f4b5 --- /dev/null +++ b/src/cloudflare/resources/zaraz/history/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .configs import ( + ConfigsResource, + AsyncConfigsResource, + ConfigsResourceWithRawResponse, + AsyncConfigsResourceWithRawResponse, + ConfigsResourceWithStreamingResponse, + AsyncConfigsResourceWithStreamingResponse, +) +from .history import ( + HistoryResource, + AsyncHistoryResource, + HistoryResourceWithRawResponse, + AsyncHistoryResourceWithRawResponse, + HistoryResourceWithStreamingResponse, + AsyncHistoryResourceWithStreamingResponse, +) + +__all__ = [ + "ConfigsResource", + "AsyncConfigsResource", + "ConfigsResourceWithRawResponse", + "AsyncConfigsResourceWithRawResponse", + "ConfigsResourceWithStreamingResponse", + "AsyncConfigsResourceWithStreamingResponse", + "HistoryResource", + "AsyncHistoryResource", + "HistoryResourceWithRawResponse", + "AsyncHistoryResourceWithRawResponse", + "HistoryResourceWithStreamingResponse", + "AsyncHistoryResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/zaraz/history/configs.py b/src/cloudflare/resources/zaraz/history/configs.py new file mode 100644 index 00000000000..e47cd373445 --- /dev/null +++ b/src/cloudflare/resources/zaraz/history/configs.py @@ -0,0 +1,191 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, Iterable, cast + +import httpx + +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( + maybe_transform, + async_maybe_transform, +) +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...._wrappers import ResultWrapper +from ...._base_client import make_request_options +from ....types.zaraz.history import config_get_params +from ....types.zaraz.history.config_get_response import ConfigGetResponse + +__all__ = ["ConfigsResource", "AsyncConfigsResource"] + + +class ConfigsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> ConfigsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return ConfigsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ConfigsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return ConfigsResourceWithStreamingResponse(self) + + def get( + self, + *, + zone_id: str, + ids: Iterable[int], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ConfigGetResponse: + """ + Gets a history of published Zaraz configurations by ID(s) for a zone. + + Args: + zone_id: Identifier + + ids: Comma separated list of Zaraz configuration IDs + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return self._get( + f"/zones/{zone_id}/settings/zaraz/history/configs", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"ids": ids}, config_get_params.ConfigGetParams), + post_parser=ResultWrapper[ConfigGetResponse]._unwrapper, + ), + cast_to=cast(Type[ConfigGetResponse], ResultWrapper[ConfigGetResponse]), + ) + + +class AsyncConfigsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncConfigsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncConfigsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncConfigsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncConfigsResourceWithStreamingResponse(self) + + async def get( + self, + *, + zone_id: str, + ids: Iterable[int], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ConfigGetResponse: + """ + Gets a history of published Zaraz configurations by ID(s) for a zone. + + Args: + zone_id: Identifier + + ids: Comma separated list of Zaraz configuration IDs + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return await self._get( + f"/zones/{zone_id}/settings/zaraz/history/configs", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform({"ids": ids}, config_get_params.ConfigGetParams), + post_parser=ResultWrapper[ConfigGetResponse]._unwrapper, + ), + cast_to=cast(Type[ConfigGetResponse], ResultWrapper[ConfigGetResponse]), + ) + + +class ConfigsResourceWithRawResponse: + def __init__(self, configs: ConfigsResource) -> None: + self._configs = configs + + self.get = to_raw_response_wrapper( + configs.get, + ) + + +class AsyncConfigsResourceWithRawResponse: + def __init__(self, configs: AsyncConfigsResource) -> None: + self._configs = configs + + self.get = async_to_raw_response_wrapper( + configs.get, + ) + + +class ConfigsResourceWithStreamingResponse: + def __init__(self, configs: ConfigsResource) -> None: + self._configs = configs + + self.get = to_streamed_response_wrapper( + configs.get, + ) + + +class AsyncConfigsResourceWithStreamingResponse: + def __init__(self, configs: AsyncConfigsResource) -> None: + self._configs = configs + + self.get = async_to_streamed_response_wrapper( + configs.get, + ) diff --git a/src/cloudflare/resources/zaraz/history/history.py b/src/cloudflare/resources/zaraz/history/history.py new file mode 100644 index 00000000000..8c7879ef8c3 --- /dev/null +++ b/src/cloudflare/resources/zaraz/history/history.py @@ -0,0 +1,358 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, cast +from typing_extensions import Literal + +import httpx + +from .configs import ( + ConfigsResource, + AsyncConfigsResource, + ConfigsResourceWithRawResponse, + AsyncConfigsResourceWithRawResponse, + ConfigsResourceWithStreamingResponse, + AsyncConfigsResourceWithStreamingResponse, +) +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( + maybe_transform, + async_maybe_transform, +) +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...._wrappers import ResultWrapper +from ....pagination import SyncSinglePage, AsyncSinglePage +from ....types.zaraz import history_list_params, history_update_params +from ...._base_client import AsyncPaginator, make_request_options +from ....types.zaraz.configuration import Configuration +from ....types.zaraz.history_list_response import HistoryListResponse + +__all__ = ["HistoryResource", "AsyncHistoryResource"] + + +class HistoryResource(SyncAPIResource): + @cached_property + def configs(self) -> ConfigsResource: + return ConfigsResource(self._client) + + @cached_property + def with_raw_response(self) -> HistoryResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return HistoryResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> HistoryResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return HistoryResourceWithStreamingResponse(self) + + def update( + self, + *, + zone_id: str, + body: int, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Configuration: + """ + Restores a historical published Zaraz configuration by ID for a zone. + + Args: + zone_id: Identifier + + body: ID of the Zaraz configuration to restore. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return self._put( + f"/zones/{zone_id}/settings/zaraz/history", + body=maybe_transform(body, history_update_params.HistoryUpdateParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Configuration]._unwrapper, + ), + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), + ) + + def list( + self, + *, + zone_id: str, + limit: int | NotGiven = NOT_GIVEN, + offset: int | NotGiven = NOT_GIVEN, + sort_field: Literal["id", "user_id", "description", "created_at", "updated_at"] | NotGiven = NOT_GIVEN, + sort_order: Literal["DESC", "ASC"] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncSinglePage[HistoryListResponse]: + """ + Lists a history of published Zaraz configuration records for a zone. + + Args: + zone_id: Identifier + + limit: Maximum amount of results to list. Default value is 10. + + offset: Ordinal number to start listing the results with. Default value is 0. + + sort_field: The field to sort by. Default is updated_at. + + sort_order: Sorting order. Default is DESC. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return self._get_api_list( + f"/zones/{zone_id}/settings/zaraz/history", + page=SyncSinglePage[HistoryListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "offset": offset, + "sort_field": sort_field, + "sort_order": sort_order, + }, + history_list_params.HistoryListParams, + ), + ), + model=HistoryListResponse, + ) + + +class AsyncHistoryResource(AsyncAPIResource): + @cached_property + def configs(self) -> AsyncConfigsResource: + return AsyncConfigsResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncHistoryResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncHistoryResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncHistoryResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncHistoryResourceWithStreamingResponse(self) + + async def update( + self, + *, + zone_id: str, + body: int, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Configuration: + """ + Restores a historical published Zaraz configuration by ID for a zone. + + Args: + zone_id: Identifier + + body: ID of the Zaraz configuration to restore. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return await self._put( + f"/zones/{zone_id}/settings/zaraz/history", + body=await async_maybe_transform(body, history_update_params.HistoryUpdateParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Configuration]._unwrapper, + ), + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), + ) + + def list( + self, + *, + zone_id: str, + limit: int | NotGiven = NOT_GIVEN, + offset: int | NotGiven = NOT_GIVEN, + sort_field: Literal["id", "user_id", "description", "created_at", "updated_at"] | NotGiven = NOT_GIVEN, + sort_order: Literal["DESC", "ASC"] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[HistoryListResponse, AsyncSinglePage[HistoryListResponse]]: + """ + Lists a history of published Zaraz configuration records for a zone. + + Args: + zone_id: Identifier + + limit: Maximum amount of results to list. Default value is 10. + + offset: Ordinal number to start listing the results with. Default value is 0. + + sort_field: The field to sort by. Default is updated_at. + + sort_order: Sorting order. Default is DESC. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return self._get_api_list( + f"/zones/{zone_id}/settings/zaraz/history", + page=AsyncSinglePage[HistoryListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "offset": offset, + "sort_field": sort_field, + "sort_order": sort_order, + }, + history_list_params.HistoryListParams, + ), + ), + model=HistoryListResponse, + ) + + +class HistoryResourceWithRawResponse: + def __init__(self, history: HistoryResource) -> None: + self._history = history + + self.update = to_raw_response_wrapper( + history.update, + ) + self.list = to_raw_response_wrapper( + history.list, + ) + + @cached_property + def configs(self) -> ConfigsResourceWithRawResponse: + return ConfigsResourceWithRawResponse(self._history.configs) + + +class AsyncHistoryResourceWithRawResponse: + def __init__(self, history: AsyncHistoryResource) -> None: + self._history = history + + self.update = async_to_raw_response_wrapper( + history.update, + ) + self.list = async_to_raw_response_wrapper( + history.list, + ) + + @cached_property + def configs(self) -> AsyncConfigsResourceWithRawResponse: + return AsyncConfigsResourceWithRawResponse(self._history.configs) + + +class HistoryResourceWithStreamingResponse: + def __init__(self, history: HistoryResource) -> None: + self._history = history + + self.update = to_streamed_response_wrapper( + history.update, + ) + self.list = to_streamed_response_wrapper( + history.list, + ) + + @cached_property + def configs(self) -> ConfigsResourceWithStreamingResponse: + return ConfigsResourceWithStreamingResponse(self._history.configs) + + +class AsyncHistoryResourceWithStreamingResponse: + def __init__(self, history: AsyncHistoryResource) -> None: + self._history = history + + self.update = async_to_streamed_response_wrapper( + history.update, + ) + self.list = async_to_streamed_response_wrapper( + history.list, + ) + + @cached_property + def configs(self) -> AsyncConfigsResourceWithStreamingResponse: + return AsyncConfigsResourceWithStreamingResponse(self._history.configs) diff --git a/src/cloudflare/resources/zaraz/publish.py b/src/cloudflare/resources/zaraz/publish.py new file mode 100644 index 00000000000..d8c9cb42e5c --- /dev/null +++ b/src/cloudflare/resources/zaraz/publish.py @@ -0,0 +1,191 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, cast + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._wrappers import ResultWrapper +from ...types.zaraz import publish_create_params +from ..._base_client import make_request_options +from ...types.zaraz.publish_create_response import PublishCreateResponse + +__all__ = ["PublishResource", "AsyncPublishResource"] + + +class PublishResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> PublishResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return PublishResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> PublishResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return PublishResourceWithStreamingResponse(self) + + def create( + self, + *, + zone_id: str, + body: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Publish current Zaraz preview configuration for a zone. + + Args: + zone_id: Identifier + + body: Zaraz configuration description. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return self._post( + f"/zones/{zone_id}/settings/zaraz/publish", + body=maybe_transform(body, publish_create_params.PublishCreateParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[PublishCreateResponse]._unwrapper, + ), + cast_to=cast(Type[str], ResultWrapper[str]), + ) + + +class AsyncPublishResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncPublishResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncPublishResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncPublishResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncPublishResourceWithStreamingResponse(self) + + async def create( + self, + *, + zone_id: str, + body: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Publish current Zaraz preview configuration for a zone. + + Args: + zone_id: Identifier + + body: Zaraz configuration description. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return await self._post( + f"/zones/{zone_id}/settings/zaraz/publish", + body=await async_maybe_transform(body, publish_create_params.PublishCreateParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[PublishCreateResponse]._unwrapper, + ), + cast_to=cast(Type[str], ResultWrapper[str]), + ) + + +class PublishResourceWithRawResponse: + def __init__(self, publish: PublishResource) -> None: + self._publish = publish + + self.create = to_raw_response_wrapper( + publish.create, + ) + + +class AsyncPublishResourceWithRawResponse: + def __init__(self, publish: AsyncPublishResource) -> None: + self._publish = publish + + self.create = async_to_raw_response_wrapper( + publish.create, + ) + + +class PublishResourceWithStreamingResponse: + def __init__(self, publish: PublishResource) -> None: + self._publish = publish + + self.create = to_streamed_response_wrapper( + publish.create, + ) + + +class AsyncPublishResourceWithStreamingResponse: + def __init__(self, publish: AsyncPublishResource) -> None: + self._publish = publish + + self.create = async_to_streamed_response_wrapper( + publish.create, + ) diff --git a/src/cloudflare/resources/zaraz/workflow.py b/src/cloudflare/resources/zaraz/workflow.py new file mode 100644 index 00000000000..64df5d27064 --- /dev/null +++ b/src/cloudflare/resources/zaraz/workflow.py @@ -0,0 +1,178 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, cast + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._wrappers import ResultWrapper +from ..._base_client import make_request_options +from ...types.zaraz.workflow import Workflow + +__all__ = ["WorkflowResource", "AsyncWorkflowResource"] + + +class WorkflowResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> WorkflowResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return WorkflowResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> WorkflowResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return WorkflowResourceWithStreamingResponse(self) + + def get( + self, + *, + zone_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Workflow: + """ + Gets Zaraz workflow for a zone. + + Args: + zone_id: Identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return self._get( + f"/zones/{zone_id}/settings/zaraz/workflow", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Workflow]._unwrapper, + ), + cast_to=cast(Type[Workflow], ResultWrapper[Workflow]), + ) + + +class AsyncWorkflowResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncWorkflowResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncWorkflowResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncWorkflowResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncWorkflowResourceWithStreamingResponse(self) + + async def get( + self, + *, + zone_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Workflow: + """ + Gets Zaraz workflow for a zone. + + Args: + zone_id: Identifier + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return await self._get( + f"/zones/{zone_id}/settings/zaraz/workflow", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Workflow]._unwrapper, + ), + cast_to=cast(Type[Workflow], ResultWrapper[Workflow]), + ) + + +class WorkflowResourceWithRawResponse: + def __init__(self, workflow: WorkflowResource) -> None: + self._workflow = workflow + + self.get = to_raw_response_wrapper( + workflow.get, + ) + + +class AsyncWorkflowResourceWithRawResponse: + def __init__(self, workflow: AsyncWorkflowResource) -> None: + self._workflow = workflow + + self.get = async_to_raw_response_wrapper( + workflow.get, + ) + + +class WorkflowResourceWithStreamingResponse: + def __init__(self, workflow: WorkflowResource) -> None: + self._workflow = workflow + + self.get = to_streamed_response_wrapper( + workflow.get, + ) + + +class AsyncWorkflowResourceWithStreamingResponse: + def __init__(self, workflow: AsyncWorkflowResource) -> None: + self._workflow = workflow + + self.get = async_to_streamed_response_wrapper( + workflow.get, + ) diff --git a/src/cloudflare/resources/zaraz/zaraz.py b/src/cloudflare/resources/zaraz/zaraz.py new file mode 100644 index 00000000000..60526ce8393 --- /dev/null +++ b/src/cloudflare/resources/zaraz/zaraz.py @@ -0,0 +1,383 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, cast + +import httpx + +from .config import ( + ConfigResource, + AsyncConfigResource, + ConfigResourceWithRawResponse, + AsyncConfigResourceWithRawResponse, + ConfigResourceWithStreamingResponse, + AsyncConfigResourceWithStreamingResponse, +) +from .export import ( + ExportResource, + AsyncExportResource, + ExportResourceWithRawResponse, + AsyncExportResourceWithRawResponse, + ExportResourceWithStreamingResponse, + AsyncExportResourceWithStreamingResponse, +) +from .default import ( + DefaultResource, + AsyncDefaultResource, + DefaultResourceWithRawResponse, + AsyncDefaultResourceWithRawResponse, + DefaultResourceWithStreamingResponse, + AsyncDefaultResourceWithStreamingResponse, +) +from .publish import ( + PublishResource, + AsyncPublishResource, + PublishResourceWithRawResponse, + AsyncPublishResourceWithRawResponse, + PublishResourceWithStreamingResponse, + AsyncPublishResourceWithStreamingResponse, +) +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from .workflow import ( + WorkflowResource, + AsyncWorkflowResource, + WorkflowResourceWithRawResponse, + AsyncWorkflowResourceWithRawResponse, + WorkflowResourceWithStreamingResponse, + AsyncWorkflowResourceWithStreamingResponse, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._wrappers import ResultWrapper +from ...types.zaraz import Workflow, zaraz_update_params +from ..._base_client import make_request_options +from .history.history import ( + HistoryResource, + AsyncHistoryResource, + HistoryResourceWithRawResponse, + AsyncHistoryResourceWithRawResponse, + HistoryResourceWithStreamingResponse, + AsyncHistoryResourceWithStreamingResponse, +) +from ...types.zaraz.workflow import Workflow + +__all__ = ["ZarazResource", "AsyncZarazResource"] + + +class ZarazResource(SyncAPIResource): + @cached_property + def config(self) -> ConfigResource: + return ConfigResource(self._client) + + @cached_property + def default(self) -> DefaultResource: + return DefaultResource(self._client) + + @cached_property + def export(self) -> ExportResource: + return ExportResource(self._client) + + @cached_property + def history(self) -> HistoryResource: + return HistoryResource(self._client) + + @cached_property + def publish(self) -> PublishResource: + return PublishResource(self._client) + + @cached_property + def workflow(self) -> WorkflowResource: + return WorkflowResource(self._client) + + @cached_property + def with_raw_response(self) -> ZarazResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return ZarazResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ZarazResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return ZarazResourceWithStreamingResponse(self) + + def update( + self, + *, + zone_id: str, + workflow: Workflow, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Workflow: + """ + Updates Zaraz workflow for a zone. + + Args: + zone_id: Identifier + + workflow: Zaraz workflow + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return self._put( + f"/zones/{zone_id}/settings/zaraz/workflow", + body=maybe_transform(workflow, zaraz_update_params.ZarazUpdateParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Workflow]._unwrapper, + ), + cast_to=cast(Type[Workflow], ResultWrapper[Workflow]), + ) + + +class AsyncZarazResource(AsyncAPIResource): + @cached_property + def config(self) -> AsyncConfigResource: + return AsyncConfigResource(self._client) + + @cached_property + def default(self) -> AsyncDefaultResource: + return AsyncDefaultResource(self._client) + + @cached_property + def export(self) -> AsyncExportResource: + return AsyncExportResource(self._client) + + @cached_property + def history(self) -> AsyncHistoryResource: + return AsyncHistoryResource(self._client) + + @cached_property + def publish(self) -> AsyncPublishResource: + return AsyncPublishResource(self._client) + + @cached_property + def workflow(self) -> AsyncWorkflowResource: + return AsyncWorkflowResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncZarazResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncZarazResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncZarazResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncZarazResourceWithStreamingResponse(self) + + async def update( + self, + *, + zone_id: str, + workflow: Workflow, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Workflow: + """ + Updates Zaraz workflow for a zone. + + Args: + zone_id: Identifier + + workflow: Zaraz workflow + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return await self._put( + f"/zones/{zone_id}/settings/zaraz/workflow", + body=await async_maybe_transform(workflow, zaraz_update_params.ZarazUpdateParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Workflow]._unwrapper, + ), + cast_to=cast(Type[Workflow], ResultWrapper[Workflow]), + ) + + +class ZarazResourceWithRawResponse: + def __init__(self, zaraz: ZarazResource) -> None: + self._zaraz = zaraz + + self.update = to_raw_response_wrapper( + zaraz.update, + ) + + @cached_property + def config(self) -> ConfigResourceWithRawResponse: + return ConfigResourceWithRawResponse(self._zaraz.config) + + @cached_property + def default(self) -> DefaultResourceWithRawResponse: + return DefaultResourceWithRawResponse(self._zaraz.default) + + @cached_property + def export(self) -> ExportResourceWithRawResponse: + return ExportResourceWithRawResponse(self._zaraz.export) + + @cached_property + def history(self) -> HistoryResourceWithRawResponse: + return HistoryResourceWithRawResponse(self._zaraz.history) + + @cached_property + def publish(self) -> PublishResourceWithRawResponse: + return PublishResourceWithRawResponse(self._zaraz.publish) + + @cached_property + def workflow(self) -> WorkflowResourceWithRawResponse: + return WorkflowResourceWithRawResponse(self._zaraz.workflow) + + +class AsyncZarazResourceWithRawResponse: + def __init__(self, zaraz: AsyncZarazResource) -> None: + self._zaraz = zaraz + + self.update = async_to_raw_response_wrapper( + zaraz.update, + ) + + @cached_property + def config(self) -> AsyncConfigResourceWithRawResponse: + return AsyncConfigResourceWithRawResponse(self._zaraz.config) + + @cached_property + def default(self) -> AsyncDefaultResourceWithRawResponse: + return AsyncDefaultResourceWithRawResponse(self._zaraz.default) + + @cached_property + def export(self) -> AsyncExportResourceWithRawResponse: + return AsyncExportResourceWithRawResponse(self._zaraz.export) + + @cached_property + def history(self) -> AsyncHistoryResourceWithRawResponse: + return AsyncHistoryResourceWithRawResponse(self._zaraz.history) + + @cached_property + def publish(self) -> AsyncPublishResourceWithRawResponse: + return AsyncPublishResourceWithRawResponse(self._zaraz.publish) + + @cached_property + def workflow(self) -> AsyncWorkflowResourceWithRawResponse: + return AsyncWorkflowResourceWithRawResponse(self._zaraz.workflow) + + +class ZarazResourceWithStreamingResponse: + def __init__(self, zaraz: ZarazResource) -> None: + self._zaraz = zaraz + + self.update = to_streamed_response_wrapper( + zaraz.update, + ) + + @cached_property + def config(self) -> ConfigResourceWithStreamingResponse: + return ConfigResourceWithStreamingResponse(self._zaraz.config) + + @cached_property + def default(self) -> DefaultResourceWithStreamingResponse: + return DefaultResourceWithStreamingResponse(self._zaraz.default) + + @cached_property + def export(self) -> ExportResourceWithStreamingResponse: + return ExportResourceWithStreamingResponse(self._zaraz.export) + + @cached_property + def history(self) -> HistoryResourceWithStreamingResponse: + return HistoryResourceWithStreamingResponse(self._zaraz.history) + + @cached_property + def publish(self) -> PublishResourceWithStreamingResponse: + return PublishResourceWithStreamingResponse(self._zaraz.publish) + + @cached_property + def workflow(self) -> WorkflowResourceWithStreamingResponse: + return WorkflowResourceWithStreamingResponse(self._zaraz.workflow) + + +class AsyncZarazResourceWithStreamingResponse: + def __init__(self, zaraz: AsyncZarazResource) -> None: + self._zaraz = zaraz + + self.update = async_to_streamed_response_wrapper( + zaraz.update, + ) + + @cached_property + def config(self) -> AsyncConfigResourceWithStreamingResponse: + return AsyncConfigResourceWithStreamingResponse(self._zaraz.config) + + @cached_property + def default(self) -> AsyncDefaultResourceWithStreamingResponse: + return AsyncDefaultResourceWithStreamingResponse(self._zaraz.default) + + @cached_property + def export(self) -> AsyncExportResourceWithStreamingResponse: + return AsyncExportResourceWithStreamingResponse(self._zaraz.export) + + @cached_property + def history(self) -> AsyncHistoryResourceWithStreamingResponse: + return AsyncHistoryResourceWithStreamingResponse(self._zaraz.history) + + @cached_property + def publish(self) -> AsyncPublishResourceWithStreamingResponse: + return AsyncPublishResourceWithStreamingResponse(self._zaraz.publish) + + @cached_property + def workflow(self) -> AsyncWorkflowResourceWithStreamingResponse: + return AsyncWorkflowResourceWithStreamingResponse(self._zaraz.workflow) diff --git a/src/cloudflare/types/zaraz/__init__.py b/src/cloudflare/types/zaraz/__init__.py new file mode 100644 index 00000000000..7d3831e23ce --- /dev/null +++ b/src/cloudflare/types/zaraz/__init__.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .workflow import Workflow as Workflow +from .neo_event import NeoEvent as NeoEvent +from .configuration import Configuration as Configuration +from .neo_event_param import NeoEventParam as NeoEventParam +from .history_list_params import HistoryListParams as HistoryListParams +from .zaraz_update_params import ZarazUpdateParams as ZarazUpdateParams +from .config_update_params import ConfigUpdateParams as ConfigUpdateParams +from .history_list_response import HistoryListResponse as HistoryListResponse +from .history_update_params import HistoryUpdateParams as HistoryUpdateParams +from .publish_create_params import PublishCreateParams as PublishCreateParams +from .button_text_translation import ButtonTextTranslation as ButtonTextTranslation +from .publish_create_response import PublishCreateResponse as PublishCreateResponse +from .button_text_translation_param import ButtonTextTranslationParam as ButtonTextTranslationParam diff --git a/src/cloudflare/types/zaraz/button_text_translation.py b/src/cloudflare/types/zaraz/button_text_translation.py new file mode 100644 index 00000000000..975accd91f8 --- /dev/null +++ b/src/cloudflare/types/zaraz/button_text_translation.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict + +from ..._models import BaseModel + +__all__ = ["ButtonTextTranslation"] + + +class ButtonTextTranslation(BaseModel): + accept_all: Dict[str, str] + """Object where keys are language codes""" + + confirm_my_choices: Dict[str, str] + """Object where keys are language codes""" + + reject_all: Dict[str, str] + """Object where keys are language codes""" diff --git a/src/cloudflare/types/zaraz/button_text_translation_param.py b/src/cloudflare/types/zaraz/button_text_translation_param.py new file mode 100644 index 00000000000..5458fbecd65 --- /dev/null +++ b/src/cloudflare/types/zaraz/button_text_translation_param.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict +from typing_extensions import Required, TypedDict + +__all__ = ["ButtonTextTranslationParam"] + + +class ButtonTextTranslationParam(TypedDict, total=False): + accept_all: Required[Dict[str, str]] + """Object where keys are language codes""" + + confirm_my_choices: Required[Dict[str, str]] + """Object where keys are language codes""" + + reject_all: Required[Dict[str, str]] + """Object where keys are language codes""" diff --git a/src/cloudflare/types/zaraz/config_update_params.py b/src/cloudflare/types/zaraz/config_update_params.py new file mode 100644 index 00000000000..f68a34c7ddf --- /dev/null +++ b/src/cloudflare/types/zaraz/config_update_params.py @@ -0,0 +1,603 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, List, Union, Iterable +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict + +from ..._utils import PropertyInfo +from .neo_event_param import NeoEventParam +from .button_text_translation_param import ButtonTextTranslationParam + +__all__ = [ + "ConfigUpdateParams", + "Settings", + "SettingsContextEnricher", + "Tools", + "ToolsZarazManagedComponent", + "ToolsWorker", + "ToolsWorkerWorker", + "Triggers", + "TriggersExcludeRule", + "TriggersExcludeRuleZarazLoadRule", + "TriggersExcludeRuleZarazClickListenerRule", + "TriggersExcludeRuleZarazClickListenerRuleSettings", + "TriggersExcludeRuleZarazTimerRule", + "TriggersExcludeRuleZarazTimerRuleSettings", + "TriggersExcludeRuleZarazFormSubmissionRule", + "TriggersExcludeRuleZarazFormSubmissionRuleSettings", + "TriggersExcludeRuleZarazVariableMatchRule", + "TriggersExcludeRuleZarazVariableMatchRuleSettings", + "TriggersExcludeRuleZarazScrollDepthRule", + "TriggersExcludeRuleZarazScrollDepthRuleSettings", + "TriggersExcludeRuleZarazElementVisibilityRule", + "TriggersExcludeRuleZarazElementVisibilityRuleSettings", + "TriggersLoadRule", + "TriggersLoadRuleZarazLoadRule", + "TriggersLoadRuleZarazClickListenerRule", + "TriggersLoadRuleZarazClickListenerRuleSettings", + "TriggersLoadRuleZarazTimerRule", + "TriggersLoadRuleZarazTimerRuleSettings", + "TriggersLoadRuleZarazFormSubmissionRule", + "TriggersLoadRuleZarazFormSubmissionRuleSettings", + "TriggersLoadRuleZarazVariableMatchRule", + "TriggersLoadRuleZarazVariableMatchRuleSettings", + "TriggersLoadRuleZarazScrollDepthRule", + "TriggersLoadRuleZarazScrollDepthRuleSettings", + "TriggersLoadRuleZarazElementVisibilityRule", + "TriggersLoadRuleZarazElementVisibilityRuleSettings", + "Variables", + "VariablesUnionMember0", + "VariablesUnionMember1", + "VariablesUnionMember1Value", + "Analytics", + "Consent", + "ConsentPurposes", + "ConsentPurposesWithTranslations", +] + + +class ConfigUpdateParams(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + data_layer: Required[Annotated[bool, PropertyInfo(alias="dataLayer")]] + """Data layer compatibility mode enabled.""" + + debug_key: Required[Annotated[str, PropertyInfo(alias="debugKey")]] + """The key for Zaraz debug mode.""" + + settings: Required[Settings] + """General Zaraz settings.""" + + tools: Required[Dict[str, Tools]] + """ + Tools set up under Zaraz configuration, where key is the alpha-numeric tool ID + and value is the tool configuration object. + """ + + triggers: Required[Dict[str, Triggers]] + """ + Triggers set up under Zaraz configuration, where key is the trigger + alpha-numeric ID and value is the trigger configuration. + """ + + variables: Required[Dict[str, Variables]] + """ + Variables set up under Zaraz configuration, where key is the variable + alpha-numeric ID and value is the variable configuration. Values of variables of + type secret are not included. + """ + + zaraz_version: Required[Annotated[int, PropertyInfo(alias="zarazVersion")]] + """Zaraz internal version of the config.""" + + analytics: Analytics + """Cloudflare Monitoring settings.""" + + consent: Consent + """Consent management configuration.""" + + history_change: Annotated[bool, PropertyInfo(alias="historyChange")] + """Single Page Application support enabled.""" + + +class SettingsContextEnricher(TypedDict, total=False): + escaped_worker_name: Required[Annotated[str, PropertyInfo(alias="escapedWorkerName")]] + + worker_tag: Required[Annotated[str, PropertyInfo(alias="workerTag")]] + + +class Settings(TypedDict, total=False): + auto_inject_script: Required[Annotated[bool, PropertyInfo(alias="autoInjectScript")]] + """Automatic injection of Zaraz scripts enabled.""" + + context_enricher: Annotated[SettingsContextEnricher, PropertyInfo(alias="contextEnricher")] + """Details of the worker that receives and edits Zaraz Context object.""" + + cookie_domain: Annotated[str, PropertyInfo(alias="cookieDomain")] + """The domain Zaraz will use for writing and reading its cookies.""" + + ecommerce: bool + """Ecommerce API enabled.""" + + events_api_path: Annotated[str, PropertyInfo(alias="eventsApiPath")] + """Custom endpoint for server-side track events.""" + + hide_external_referer: Annotated[bool, PropertyInfo(alias="hideExternalReferer")] + """Hiding external referrer URL enabled.""" + + hide_ip_address: Annotated[bool, PropertyInfo(alias="hideIPAddress")] + """Trimming IP address enabled.""" + + hide_query_params: Annotated[bool, PropertyInfo(alias="hideQueryParams")] + """Removing URL query params enabled.""" + + hide_user_agent: Annotated[bool, PropertyInfo(alias="hideUserAgent")] + """Removing sensitive data from User Aagent string enabled.""" + + init_path: Annotated[str, PropertyInfo(alias="initPath")] + """Custom endpoint for Zaraz init script.""" + + inject_iframes: Annotated[bool, PropertyInfo(alias="injectIframes")] + """Injection of Zaraz scripts into iframes enabled.""" + + mc_root_path: Annotated[str, PropertyInfo(alias="mcRootPath")] + """Custom path for Managed Components server functionalities.""" + + script_path: Annotated[str, PropertyInfo(alias="scriptPath")] + """Custom endpoint for Zaraz main script.""" + + track_path: Annotated[str, PropertyInfo(alias="trackPath")] + """Custom endpoint for Zaraz tracking requests.""" + + +class ToolsZarazManagedComponent(TypedDict, total=False): + blocking_triggers: Required[Annotated[List[str], PropertyInfo(alias="blockingTriggers")]] + """List of blocking trigger IDs""" + + component: Required[str] + """Tool's internal name""" + + default_fields: Required[Annotated[Dict[str, Union[str, bool]], PropertyInfo(alias="defaultFields")]] + """Default fields for tool's actions""" + + enabled: Required[bool] + """Whether tool is enabled""" + + name: Required[str] + """Tool's name defined by the user""" + + permissions: Required[List[str]] + """List of permissions granted to the component""" + + settings: Required[Dict[str, Union[str, bool]]] + """Tool's settings""" + + type: Required[Literal["component"]] + + actions: Dict[str, NeoEventParam] + """Actions configured on a tool. Either this or neoEvents field is required.""" + + default_purpose: Annotated[str, PropertyInfo(alias="defaultPurpose")] + """Default consent purpose ID""" + + neo_events: Annotated[Iterable[NeoEventParam], PropertyInfo(alias="neoEvents")] + """DEPRECATED - List of actions configured on a tool. + + Either this or actions field is required. If both are present, actions field + will take precedence. + """ + + vendor_name: Annotated[str, PropertyInfo(alias="vendorName")] + """ + Vendor name for TCF compliant consent modal, required for Custom Managed + Components and Custom HTML tool with a defaultPurpose assigned + """ + + vendor_policy_url: Annotated[str, PropertyInfo(alias="vendorPolicyUrl")] + """ + Vendor's Privacy Policy URL for TCF compliant consent modal, required for Custom + Managed Components and Custom HTML tool with a defaultPurpose assigned + """ + + +class ToolsWorkerWorker(TypedDict, total=False): + escaped_worker_name: Required[Annotated[str, PropertyInfo(alias="escapedWorkerName")]] + + worker_tag: Required[Annotated[str, PropertyInfo(alias="workerTag")]] + + +class ToolsWorker(TypedDict, total=False): + blocking_triggers: Required[Annotated[List[str], PropertyInfo(alias="blockingTriggers")]] + """List of blocking trigger IDs""" + + component: Required[str] + """Tool's internal name""" + + default_fields: Required[Annotated[Dict[str, Union[str, bool]], PropertyInfo(alias="defaultFields")]] + """Default fields for tool's actions""" + + enabled: Required[bool] + """Whether tool is enabled""" + + name: Required[str] + """Tool's name defined by the user""" + + permissions: Required[List[str]] + """List of permissions granted to the component""" + + settings: Required[Dict[str, Union[str, bool]]] + """Tool's settings""" + + type: Required[Literal["custom-mc"]] + + worker: Required[ToolsWorkerWorker] + """Cloudflare worker that acts as a managed component""" + + actions: Dict[str, NeoEventParam] + """Actions configured on a tool. Either this or neoEvents field is required.""" + + default_purpose: Annotated[str, PropertyInfo(alias="defaultPurpose")] + """Default consent purpose ID""" + + neo_events: Annotated[Iterable[NeoEventParam], PropertyInfo(alias="neoEvents")] + """DEPRECATED - List of actions configured on a tool. + + Either this or actions field is required. If both are present, actions field + will take precedence. + """ + + vendor_name: Annotated[str, PropertyInfo(alias="vendorName")] + """ + Vendor name for TCF compliant consent modal, required for Custom Managed + Components and Custom HTML tool with a defaultPurpose assigned + """ + + vendor_policy_url: Annotated[str, PropertyInfo(alias="vendorPolicyUrl")] + """ + Vendor's Privacy Policy URL for TCF compliant consent modal, required for Custom + Managed Components and Custom HTML tool with a defaultPurpose assigned + """ + + +Tools: TypeAlias = Union[ToolsZarazManagedComponent, ToolsWorker] + + +class TriggersExcludeRuleZarazLoadRule(TypedDict, total=False): + id: Required[str] + + match: Required[str] + + op: Required[ + Literal[ + "CONTAINS", + "EQUALS", + "STARTS_WITH", + "ENDS_WITH", + "MATCH_REGEX", + "NOT_MATCH_REGEX", + "GREATER_THAN", + "GREATER_THAN_OR_EQUAL", + "LESS_THAN", + "LESS_THAN_OR_EQUAL", + ] + ] + + value: Required[str] + + +class TriggersExcludeRuleZarazClickListenerRuleSettings(TypedDict, total=False): + selector: Required[str] + + type: Required[Literal["xpath", "css"]] + + wait_for_tags: Required[Annotated[int, PropertyInfo(alias="waitForTags")]] + + +class TriggersExcludeRuleZarazClickListenerRule(TypedDict, total=False): + id: Required[str] + + action: Required[Literal["clickListener"]] + + settings: Required[TriggersExcludeRuleZarazClickListenerRuleSettings] + + +class TriggersExcludeRuleZarazTimerRuleSettings(TypedDict, total=False): + interval: Required[int] + + limit: Required[int] + + +class TriggersExcludeRuleZarazTimerRule(TypedDict, total=False): + id: Required[str] + + action: Required[Literal["timer"]] + + settings: Required[TriggersExcludeRuleZarazTimerRuleSettings] + + +class TriggersExcludeRuleZarazFormSubmissionRuleSettings(TypedDict, total=False): + selector: Required[str] + + validate: Required[bool] + + +class TriggersExcludeRuleZarazFormSubmissionRule(TypedDict, total=False): + id: Required[str] + + action: Required[Literal["formSubmission"]] + + settings: Required[TriggersExcludeRuleZarazFormSubmissionRuleSettings] + + +class TriggersExcludeRuleZarazVariableMatchRuleSettings(TypedDict, total=False): + match: Required[str] + + variable: Required[str] + + +class TriggersExcludeRuleZarazVariableMatchRule(TypedDict, total=False): + id: Required[str] + + action: Required[Literal["variableMatch"]] + + settings: Required[TriggersExcludeRuleZarazVariableMatchRuleSettings] + + +class TriggersExcludeRuleZarazScrollDepthRuleSettings(TypedDict, total=False): + positions: Required[str] + + +class TriggersExcludeRuleZarazScrollDepthRule(TypedDict, total=False): + id: Required[str] + + action: Required[Literal["scrollDepth"]] + + settings: Required[TriggersExcludeRuleZarazScrollDepthRuleSettings] + + +class TriggersExcludeRuleZarazElementVisibilityRuleSettings(TypedDict, total=False): + selector: Required[str] + + +class TriggersExcludeRuleZarazElementVisibilityRule(TypedDict, total=False): + id: Required[str] + + action: Required[Literal["elementVisibility"]] + + settings: Required[TriggersExcludeRuleZarazElementVisibilityRuleSettings] + + +TriggersExcludeRule: TypeAlias = Union[ + TriggersExcludeRuleZarazLoadRule, + TriggersExcludeRuleZarazClickListenerRule, + TriggersExcludeRuleZarazTimerRule, + TriggersExcludeRuleZarazFormSubmissionRule, + TriggersExcludeRuleZarazVariableMatchRule, + TriggersExcludeRuleZarazScrollDepthRule, + TriggersExcludeRuleZarazElementVisibilityRule, +] + + +class TriggersLoadRuleZarazLoadRule(TypedDict, total=False): + id: Required[str] + + match: Required[str] + + op: Required[ + Literal[ + "CONTAINS", + "EQUALS", + "STARTS_WITH", + "ENDS_WITH", + "MATCH_REGEX", + "NOT_MATCH_REGEX", + "GREATER_THAN", + "GREATER_THAN_OR_EQUAL", + "LESS_THAN", + "LESS_THAN_OR_EQUAL", + ] + ] + + value: Required[str] + + +class TriggersLoadRuleZarazClickListenerRuleSettings(TypedDict, total=False): + selector: Required[str] + + type: Required[Literal["xpath", "css"]] + + wait_for_tags: Required[Annotated[int, PropertyInfo(alias="waitForTags")]] + + +class TriggersLoadRuleZarazClickListenerRule(TypedDict, total=False): + id: Required[str] + + action: Required[Literal["clickListener"]] + + settings: Required[TriggersLoadRuleZarazClickListenerRuleSettings] + + +class TriggersLoadRuleZarazTimerRuleSettings(TypedDict, total=False): + interval: Required[int] + + limit: Required[int] + + +class TriggersLoadRuleZarazTimerRule(TypedDict, total=False): + id: Required[str] + + action: Required[Literal["timer"]] + + settings: Required[TriggersLoadRuleZarazTimerRuleSettings] + + +class TriggersLoadRuleZarazFormSubmissionRuleSettings(TypedDict, total=False): + selector: Required[str] + + validate: Required[bool] + + +class TriggersLoadRuleZarazFormSubmissionRule(TypedDict, total=False): + id: Required[str] + + action: Required[Literal["formSubmission"]] + + settings: Required[TriggersLoadRuleZarazFormSubmissionRuleSettings] + + +class TriggersLoadRuleZarazVariableMatchRuleSettings(TypedDict, total=False): + match: Required[str] + + variable: Required[str] + + +class TriggersLoadRuleZarazVariableMatchRule(TypedDict, total=False): + id: Required[str] + + action: Required[Literal["variableMatch"]] + + settings: Required[TriggersLoadRuleZarazVariableMatchRuleSettings] + + +class TriggersLoadRuleZarazScrollDepthRuleSettings(TypedDict, total=False): + positions: Required[str] + + +class TriggersLoadRuleZarazScrollDepthRule(TypedDict, total=False): + id: Required[str] + + action: Required[Literal["scrollDepth"]] + + settings: Required[TriggersLoadRuleZarazScrollDepthRuleSettings] + + +class TriggersLoadRuleZarazElementVisibilityRuleSettings(TypedDict, total=False): + selector: Required[str] + + +class TriggersLoadRuleZarazElementVisibilityRule(TypedDict, total=False): + id: Required[str] + + action: Required[Literal["elementVisibility"]] + + settings: Required[TriggersLoadRuleZarazElementVisibilityRuleSettings] + + +TriggersLoadRule: TypeAlias = Union[ + TriggersLoadRuleZarazLoadRule, + TriggersLoadRuleZarazClickListenerRule, + TriggersLoadRuleZarazTimerRule, + TriggersLoadRuleZarazFormSubmissionRule, + TriggersLoadRuleZarazVariableMatchRule, + TriggersLoadRuleZarazScrollDepthRule, + TriggersLoadRuleZarazElementVisibilityRule, +] + + +class Triggers(TypedDict, total=False): + exclude_rules: Required[Annotated[Iterable[TriggersExcludeRule], PropertyInfo(alias="excludeRules")]] + """Rules defining when the trigger is not fired.""" + + load_rules: Required[Annotated[Iterable[TriggersLoadRule], PropertyInfo(alias="loadRules")]] + """Rules defining when the trigger is fired.""" + + name: Required[str] + """Trigger name.""" + + description: str + """Trigger description.""" + + system: Literal["pageload"] + + +class VariablesUnionMember0(TypedDict, total=False): + name: Required[str] + + type: Required[Literal["string", "secret"]] + + value: Required[str] + + +class VariablesUnionMember1Value(TypedDict, total=False): + escaped_worker_name: Required[Annotated[str, PropertyInfo(alias="escapedWorkerName")]] + + worker_tag: Required[Annotated[str, PropertyInfo(alias="workerTag")]] + + +class VariablesUnionMember1(TypedDict, total=False): + name: Required[str] + + type: Required[Literal["worker"]] + + value: Required[VariablesUnionMember1Value] + + +Variables: TypeAlias = Union[VariablesUnionMember0, VariablesUnionMember1] + + +class Analytics(TypedDict, total=False): + default_purpose: Annotated[str, PropertyInfo(alias="defaultPurpose")] + """Consent purpose assigned to Monitoring.""" + + enabled: bool + """Whether Advanced Monitoring reports are enabled.""" + + session_exp_time: Annotated[int, PropertyInfo(alias="sessionExpTime")] + """Session expiration time (seconds).""" + + +class ConsentPurposes(TypedDict, total=False): + description: Required[str] + + name: Required[str] + + +class ConsentPurposesWithTranslations(TypedDict, total=False): + description: Required[Dict[str, str]] + """Object where keys are language codes""" + + name: Required[Dict[str, str]] + """Object where keys are language codes""" + + order: Required[int] + + +class Consent(TypedDict, total=False): + enabled: Required[bool] + + button_text_translations: Annotated[ButtonTextTranslationParam, PropertyInfo(alias="buttonTextTranslations")] + + company_email: Annotated[str, PropertyInfo(alias="companyEmail")] + + company_name: Annotated[str, PropertyInfo(alias="companyName")] + + company_street_address: Annotated[str, PropertyInfo(alias="companyStreetAddress")] + + consent_modal_intro_html: Annotated[str, PropertyInfo(alias="consentModalIntroHTML")] + + consent_modal_intro_html_with_translations: Annotated[ + Dict[str, str], PropertyInfo(alias="consentModalIntroHTMLWithTranslations") + ] + """Object where keys are language codes""" + + cookie_name: Annotated[str, PropertyInfo(alias="cookieName")] + + custom_css: Annotated[str, PropertyInfo(alias="customCSS")] + + custom_intro_disclaimer_dismissed: Annotated[bool, PropertyInfo(alias="customIntroDisclaimerDismissed")] + + default_language: Annotated[str, PropertyInfo(alias="defaultLanguage")] + + hide_modal: Annotated[bool, PropertyInfo(alias="hideModal")] + + purposes: Dict[str, ConsentPurposes] + """Object where keys are purpose alpha-numeric IDs""" + + purposes_with_translations: Annotated[ + Dict[str, ConsentPurposesWithTranslations], PropertyInfo(alias="purposesWithTranslations") + ] + """Object where keys are purpose alpha-numeric IDs""" + + tcf_compliant: Annotated[bool, PropertyInfo(alias="tcfCompliant")] diff --git a/src/cloudflare/types/zaraz/configuration.py b/src/cloudflare/types/zaraz/configuration.py new file mode 100644 index 00000000000..ee888554d40 --- /dev/null +++ b/src/cloudflare/types/zaraz/configuration.py @@ -0,0 +1,596 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from typing_extensions import Literal, TypeAlias + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .neo_event import NeoEvent +from .button_text_translation import ButtonTextTranslation + +__all__ = [ + "Configuration", + "Settings", + "SettingsContextEnricher", + "Tools", + "ToolsZarazManagedComponent", + "ToolsWorker", + "ToolsWorkerWorker", + "Triggers", + "TriggersExcludeRule", + "TriggersExcludeRuleZarazLoadRule", + "TriggersExcludeRuleZarazClickListenerRule", + "TriggersExcludeRuleZarazClickListenerRuleSettings", + "TriggersExcludeRuleZarazTimerRule", + "TriggersExcludeRuleZarazTimerRuleSettings", + "TriggersExcludeRuleZarazFormSubmissionRule", + "TriggersExcludeRuleZarazFormSubmissionRuleSettings", + "TriggersExcludeRuleZarazVariableMatchRule", + "TriggersExcludeRuleZarazVariableMatchRuleSettings", + "TriggersExcludeRuleZarazScrollDepthRule", + "TriggersExcludeRuleZarazScrollDepthRuleSettings", + "TriggersExcludeRuleZarazElementVisibilityRule", + "TriggersExcludeRuleZarazElementVisibilityRuleSettings", + "TriggersLoadRule", + "TriggersLoadRuleZarazLoadRule", + "TriggersLoadRuleZarazClickListenerRule", + "TriggersLoadRuleZarazClickListenerRuleSettings", + "TriggersLoadRuleZarazTimerRule", + "TriggersLoadRuleZarazTimerRuleSettings", + "TriggersLoadRuleZarazFormSubmissionRule", + "TriggersLoadRuleZarazFormSubmissionRuleSettings", + "TriggersLoadRuleZarazVariableMatchRule", + "TriggersLoadRuleZarazVariableMatchRuleSettings", + "TriggersLoadRuleZarazScrollDepthRule", + "TriggersLoadRuleZarazScrollDepthRuleSettings", + "TriggersLoadRuleZarazElementVisibilityRule", + "TriggersLoadRuleZarazElementVisibilityRuleSettings", + "Variables", + "VariablesUnionMember0", + "VariablesUnionMember1", + "VariablesUnionMember1Value", + "Analytics", + "Consent", + "ConsentPurposes", + "ConsentPurposesWithTranslations", +] + + +class SettingsContextEnricher(BaseModel): + escaped_worker_name: str = FieldInfo(alias="escapedWorkerName") + + worker_tag: str = FieldInfo(alias="workerTag") + + +class Settings(BaseModel): + auto_inject_script: bool = FieldInfo(alias="autoInjectScript") + """Automatic injection of Zaraz scripts enabled.""" + + context_enricher: Optional[SettingsContextEnricher] = FieldInfo(alias="contextEnricher", default=None) + """Details of the worker that receives and edits Zaraz Context object.""" + + cookie_domain: Optional[str] = FieldInfo(alias="cookieDomain", default=None) + """The domain Zaraz will use for writing and reading its cookies.""" + + ecommerce: Optional[bool] = None + """Ecommerce API enabled.""" + + events_api_path: Optional[str] = FieldInfo(alias="eventsApiPath", default=None) + """Custom endpoint for server-side track events.""" + + hide_external_referer: Optional[bool] = FieldInfo(alias="hideExternalReferer", default=None) + """Hiding external referrer URL enabled.""" + + hide_ip_address: Optional[bool] = FieldInfo(alias="hideIPAddress", default=None) + """Trimming IP address enabled.""" + + hide_query_params: Optional[bool] = FieldInfo(alias="hideQueryParams", default=None) + """Removing URL query params enabled.""" + + hide_user_agent: Optional[bool] = FieldInfo(alias="hideUserAgent", default=None) + """Removing sensitive data from User Aagent string enabled.""" + + init_path: Optional[str] = FieldInfo(alias="initPath", default=None) + """Custom endpoint for Zaraz init script.""" + + inject_iframes: Optional[bool] = FieldInfo(alias="injectIframes", default=None) + """Injection of Zaraz scripts into iframes enabled.""" + + mc_root_path: Optional[str] = FieldInfo(alias="mcRootPath", default=None) + """Custom path for Managed Components server functionalities.""" + + script_path: Optional[str] = FieldInfo(alias="scriptPath", default=None) + """Custom endpoint for Zaraz main script.""" + + track_path: Optional[str] = FieldInfo(alias="trackPath", default=None) + """Custom endpoint for Zaraz tracking requests.""" + + +class ToolsZarazManagedComponent(BaseModel): + blocking_triggers: List[str] = FieldInfo(alias="blockingTriggers") + """List of blocking trigger IDs""" + + component: str + """Tool's internal name""" + + default_fields: Dict[str, Union[str, bool]] = FieldInfo(alias="defaultFields") + """Default fields for tool's actions""" + + enabled: bool + """Whether tool is enabled""" + + name: str + """Tool's name defined by the user""" + + permissions: List[str] + """List of permissions granted to the component""" + + settings: Dict[str, Union[str, bool]] + """Tool's settings""" + + type: Literal["component"] + + actions: Optional[Dict[str, NeoEvent]] = None + """Actions configured on a tool. Either this or neoEvents field is required.""" + + default_purpose: Optional[str] = FieldInfo(alias="defaultPurpose", default=None) + """Default consent purpose ID""" + + neo_events: Optional[List[NeoEvent]] = FieldInfo(alias="neoEvents", default=None) + """DEPRECATED - List of actions configured on a tool. + + Either this or actions field is required. If both are present, actions field + will take precedence. + """ + + vendor_name: Optional[str] = FieldInfo(alias="vendorName", default=None) + """ + Vendor name for TCF compliant consent modal, required for Custom Managed + Components and Custom HTML tool with a defaultPurpose assigned + """ + + vendor_policy_url: Optional[str] = FieldInfo(alias="vendorPolicyUrl", default=None) + """ + Vendor's Privacy Policy URL for TCF compliant consent modal, required for Custom + Managed Components and Custom HTML tool with a defaultPurpose assigned + """ + + +class ToolsWorkerWorker(BaseModel): + escaped_worker_name: str = FieldInfo(alias="escapedWorkerName") + + worker_tag: str = FieldInfo(alias="workerTag") + + +class ToolsWorker(BaseModel): + blocking_triggers: List[str] = FieldInfo(alias="blockingTriggers") + """List of blocking trigger IDs""" + + component: str + """Tool's internal name""" + + default_fields: Dict[str, Union[str, bool]] = FieldInfo(alias="defaultFields") + """Default fields for tool's actions""" + + enabled: bool + """Whether tool is enabled""" + + name: str + """Tool's name defined by the user""" + + permissions: List[str] + """List of permissions granted to the component""" + + settings: Dict[str, Union[str, bool]] + """Tool's settings""" + + type: Literal["custom-mc"] + + worker: ToolsWorkerWorker + """Cloudflare worker that acts as a managed component""" + + actions: Optional[Dict[str, NeoEvent]] = None + """Actions configured on a tool. Either this or neoEvents field is required.""" + + default_purpose: Optional[str] = FieldInfo(alias="defaultPurpose", default=None) + """Default consent purpose ID""" + + neo_events: Optional[List[NeoEvent]] = FieldInfo(alias="neoEvents", default=None) + """DEPRECATED - List of actions configured on a tool. + + Either this or actions field is required. If both are present, actions field + will take precedence. + """ + + vendor_name: Optional[str] = FieldInfo(alias="vendorName", default=None) + """ + Vendor name for TCF compliant consent modal, required for Custom Managed + Components and Custom HTML tool with a defaultPurpose assigned + """ + + vendor_policy_url: Optional[str] = FieldInfo(alias="vendorPolicyUrl", default=None) + """ + Vendor's Privacy Policy URL for TCF compliant consent modal, required for Custom + Managed Components and Custom HTML tool with a defaultPurpose assigned + """ + + +Tools: TypeAlias = Union[ToolsZarazManagedComponent, ToolsWorker] + + +class TriggersExcludeRuleZarazLoadRule(BaseModel): + id: str + + match: str + + op: Literal[ + "CONTAINS", + "EQUALS", + "STARTS_WITH", + "ENDS_WITH", + "MATCH_REGEX", + "NOT_MATCH_REGEX", + "GREATER_THAN", + "GREATER_THAN_OR_EQUAL", + "LESS_THAN", + "LESS_THAN_OR_EQUAL", + ] + + value: str + + +class TriggersExcludeRuleZarazClickListenerRuleSettings(BaseModel): + selector: str + + type: Literal["xpath", "css"] + + wait_for_tags: int = FieldInfo(alias="waitForTags") + + +class TriggersExcludeRuleZarazClickListenerRule(BaseModel): + id: str + + action: Literal["clickListener"] + + settings: TriggersExcludeRuleZarazClickListenerRuleSettings + + +class TriggersExcludeRuleZarazTimerRuleSettings(BaseModel): + interval: int + + limit: int + + +class TriggersExcludeRuleZarazTimerRule(BaseModel): + id: str + + action: Literal["timer"] + + settings: TriggersExcludeRuleZarazTimerRuleSettings + + +class TriggersExcludeRuleZarazFormSubmissionRuleSettings(BaseModel): + selector: str + + validate_: bool = FieldInfo(alias="validate") + + +class TriggersExcludeRuleZarazFormSubmissionRule(BaseModel): + id: str + + action: Literal["formSubmission"] + + settings: TriggersExcludeRuleZarazFormSubmissionRuleSettings + + +class TriggersExcludeRuleZarazVariableMatchRuleSettings(BaseModel): + match: str + + variable: str + + +class TriggersExcludeRuleZarazVariableMatchRule(BaseModel): + id: str + + action: Literal["variableMatch"] + + settings: TriggersExcludeRuleZarazVariableMatchRuleSettings + + +class TriggersExcludeRuleZarazScrollDepthRuleSettings(BaseModel): + positions: str + + +class TriggersExcludeRuleZarazScrollDepthRule(BaseModel): + id: str + + action: Literal["scrollDepth"] + + settings: TriggersExcludeRuleZarazScrollDepthRuleSettings + + +class TriggersExcludeRuleZarazElementVisibilityRuleSettings(BaseModel): + selector: str + + +class TriggersExcludeRuleZarazElementVisibilityRule(BaseModel): + id: str + + action: Literal["elementVisibility"] + + settings: TriggersExcludeRuleZarazElementVisibilityRuleSettings + + +TriggersExcludeRule: TypeAlias = Union[ + TriggersExcludeRuleZarazLoadRule, + TriggersExcludeRuleZarazClickListenerRule, + TriggersExcludeRuleZarazTimerRule, + TriggersExcludeRuleZarazFormSubmissionRule, + TriggersExcludeRuleZarazVariableMatchRule, + TriggersExcludeRuleZarazScrollDepthRule, + TriggersExcludeRuleZarazElementVisibilityRule, +] + + +class TriggersLoadRuleZarazLoadRule(BaseModel): + id: str + + match: str + + op: Literal[ + "CONTAINS", + "EQUALS", + "STARTS_WITH", + "ENDS_WITH", + "MATCH_REGEX", + "NOT_MATCH_REGEX", + "GREATER_THAN", + "GREATER_THAN_OR_EQUAL", + "LESS_THAN", + "LESS_THAN_OR_EQUAL", + ] + + value: str + + +class TriggersLoadRuleZarazClickListenerRuleSettings(BaseModel): + selector: str + + type: Literal["xpath", "css"] + + wait_for_tags: int = FieldInfo(alias="waitForTags") + + +class TriggersLoadRuleZarazClickListenerRule(BaseModel): + id: str + + action: Literal["clickListener"] + + settings: TriggersLoadRuleZarazClickListenerRuleSettings + + +class TriggersLoadRuleZarazTimerRuleSettings(BaseModel): + interval: int + + limit: int + + +class TriggersLoadRuleZarazTimerRule(BaseModel): + id: str + + action: Literal["timer"] + + settings: TriggersLoadRuleZarazTimerRuleSettings + + +class TriggersLoadRuleZarazFormSubmissionRuleSettings(BaseModel): + selector: str + + validate_: bool = FieldInfo(alias="validate") + + +class TriggersLoadRuleZarazFormSubmissionRule(BaseModel): + id: str + + action: Literal["formSubmission"] + + settings: TriggersLoadRuleZarazFormSubmissionRuleSettings + + +class TriggersLoadRuleZarazVariableMatchRuleSettings(BaseModel): + match: str + + variable: str + + +class TriggersLoadRuleZarazVariableMatchRule(BaseModel): + id: str + + action: Literal["variableMatch"] + + settings: TriggersLoadRuleZarazVariableMatchRuleSettings + + +class TriggersLoadRuleZarazScrollDepthRuleSettings(BaseModel): + positions: str + + +class TriggersLoadRuleZarazScrollDepthRule(BaseModel): + id: str + + action: Literal["scrollDepth"] + + settings: TriggersLoadRuleZarazScrollDepthRuleSettings + + +class TriggersLoadRuleZarazElementVisibilityRuleSettings(BaseModel): + selector: str + + +class TriggersLoadRuleZarazElementVisibilityRule(BaseModel): + id: str + + action: Literal["elementVisibility"] + + settings: TriggersLoadRuleZarazElementVisibilityRuleSettings + + +TriggersLoadRule: TypeAlias = Union[ + TriggersLoadRuleZarazLoadRule, + TriggersLoadRuleZarazClickListenerRule, + TriggersLoadRuleZarazTimerRule, + TriggersLoadRuleZarazFormSubmissionRule, + TriggersLoadRuleZarazVariableMatchRule, + TriggersLoadRuleZarazScrollDepthRule, + TriggersLoadRuleZarazElementVisibilityRule, +] + + +class Triggers(BaseModel): + exclude_rules: List[TriggersExcludeRule] = FieldInfo(alias="excludeRules") + """Rules defining when the trigger is not fired.""" + + load_rules: List[TriggersLoadRule] = FieldInfo(alias="loadRules") + """Rules defining when the trigger is fired.""" + + name: str + """Trigger name.""" + + description: Optional[str] = None + """Trigger description.""" + + system: Optional[Literal["pageload"]] = None + + +class VariablesUnionMember0(BaseModel): + name: str + + type: Literal["string", "secret"] + + value: str + + +class VariablesUnionMember1Value(BaseModel): + escaped_worker_name: str = FieldInfo(alias="escapedWorkerName") + + worker_tag: str = FieldInfo(alias="workerTag") + + +class VariablesUnionMember1(BaseModel): + name: str + + type: Literal["worker"] + + value: VariablesUnionMember1Value + + +Variables: TypeAlias = Union[VariablesUnionMember0, VariablesUnionMember1] + + +class Analytics(BaseModel): + default_purpose: Optional[str] = FieldInfo(alias="defaultPurpose", default=None) + """Consent purpose assigned to Monitoring.""" + + enabled: Optional[bool] = None + """Whether Advanced Monitoring reports are enabled.""" + + session_exp_time: Optional[int] = FieldInfo(alias="sessionExpTime", default=None) + """Session expiration time (seconds).""" + + +class ConsentPurposes(BaseModel): + description: str + + name: str + + +class ConsentPurposesWithTranslations(BaseModel): + description: Dict[str, str] + """Object where keys are language codes""" + + name: Dict[str, str] + """Object where keys are language codes""" + + order: int + + +class Consent(BaseModel): + enabled: bool + + button_text_translations: Optional[ButtonTextTranslation] = FieldInfo(alias="buttonTextTranslations", default=None) + + company_email: Optional[str] = FieldInfo(alias="companyEmail", default=None) + + company_name: Optional[str] = FieldInfo(alias="companyName", default=None) + + company_street_address: Optional[str] = FieldInfo(alias="companyStreetAddress", default=None) + + consent_modal_intro_html: Optional[str] = FieldInfo(alias="consentModalIntroHTML", default=None) + + consent_modal_intro_html_with_translations: Optional[Dict[str, str]] = FieldInfo( + alias="consentModalIntroHTMLWithTranslations", default=None + ) + """Object where keys are language codes""" + + cookie_name: Optional[str] = FieldInfo(alias="cookieName", default=None) + + custom_css: Optional[str] = FieldInfo(alias="customCSS", default=None) + + custom_intro_disclaimer_dismissed: Optional[bool] = FieldInfo(alias="customIntroDisclaimerDismissed", default=None) + + default_language: Optional[str] = FieldInfo(alias="defaultLanguage", default=None) + + hide_modal: Optional[bool] = FieldInfo(alias="hideModal", default=None) + + purposes: Optional[Dict[str, ConsentPurposes]] = None + """Object where keys are purpose alpha-numeric IDs""" + + purposes_with_translations: Optional[Dict[str, ConsentPurposesWithTranslations]] = FieldInfo( + alias="purposesWithTranslations", default=None + ) + """Object where keys are purpose alpha-numeric IDs""" + + tcf_compliant: Optional[bool] = FieldInfo(alias="tcfCompliant", default=None) + + +class Configuration(BaseModel): + data_layer: bool = FieldInfo(alias="dataLayer") + """Data layer compatibility mode enabled.""" + + debug_key: str = FieldInfo(alias="debugKey") + """The key for Zaraz debug mode.""" + + settings: Settings + """General Zaraz settings.""" + + tools: Dict[str, Tools] + """ + Tools set up under Zaraz configuration, where key is the alpha-numeric tool ID + and value is the tool configuration object. + """ + + triggers: Dict[str, Triggers] + """ + Triggers set up under Zaraz configuration, where key is the trigger + alpha-numeric ID and value is the trigger configuration. + """ + + variables: Dict[str, Variables] + """ + Variables set up under Zaraz configuration, where key is the variable + alpha-numeric ID and value is the variable configuration. Values of variables of + type secret are not included. + """ + + zaraz_version: int = FieldInfo(alias="zarazVersion") + """Zaraz internal version of the config.""" + + analytics: Optional[Analytics] = None + """Cloudflare Monitoring settings.""" + + consent: Optional[Consent] = None + """Consent management configuration.""" + + history_change: Optional[bool] = FieldInfo(alias="historyChange", default=None) + """Single Page Application support enabled.""" diff --git a/src/cloudflare/types/zaraz/history/__init__.py b/src/cloudflare/types/zaraz/history/__init__.py new file mode 100644 index 00000000000..9437a1aa751 --- /dev/null +++ b/src/cloudflare/types/zaraz/history/__init__.py @@ -0,0 +1,6 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .config_get_params import ConfigGetParams as ConfigGetParams +from .config_get_response import ConfigGetResponse as ConfigGetResponse diff --git a/src/cloudflare/types/zaraz/history/config_get_params.py b/src/cloudflare/types/zaraz/history/config_get_params.py new file mode 100644 index 00000000000..da17eaa30e7 --- /dev/null +++ b/src/cloudflare/types/zaraz/history/config_get_params.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["ConfigGetParams"] + + +class ConfigGetParams(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + ids: Required[Iterable[int]] + """Comma separated list of Zaraz configuration IDs""" diff --git a/src/cloudflare/types/zaraz/history/config_get_response.py b/src/cloudflare/types/zaraz/history/config_get_response.py new file mode 100644 index 00000000000..9223c2922d8 --- /dev/null +++ b/src/cloudflare/types/zaraz/history/config_get_response.py @@ -0,0 +1,32 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict +from datetime import datetime +from typing_extensions import TypeAlias + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel +from ..configuration import Configuration + +__all__ = ["ConfigGetResponse", "ConfigGetResponseItem"] + + +class ConfigGetResponseItem(BaseModel): + id: int + """ID of the configuration""" + + config: Configuration + """Zaraz configuration""" + + created_at: datetime = FieldInfo(alias="createdAt") + """Date and time the configuration was created""" + + updated_at: datetime = FieldInfo(alias="updatedAt") + """Date and time the configuration was last updated""" + + user_id: str = FieldInfo(alias="userId") + """Alpha-numeric ID of the account user who published the configuration""" + + +ConfigGetResponse: TypeAlias = Dict[str, ConfigGetResponseItem] diff --git a/src/cloudflare/types/zaraz/history_list_params.py b/src/cloudflare/types/zaraz/history_list_params.py new file mode 100644 index 00000000000..38cfc5d54c0 --- /dev/null +++ b/src/cloudflare/types/zaraz/history_list_params.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["HistoryListParams"] + + +class HistoryListParams(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + limit: int + """Maximum amount of results to list. Default value is 10.""" + + offset: int + """Ordinal number to start listing the results with. Default value is 0.""" + + sort_field: Annotated[ + Literal["id", "user_id", "description", "created_at", "updated_at"], PropertyInfo(alias="sortField") + ] + """The field to sort by. Default is updated_at.""" + + sort_order: Annotated[Literal["DESC", "ASC"], PropertyInfo(alias="sortOrder")] + """Sorting order. Default is DESC.""" diff --git a/src/cloudflare/types/zaraz/history_list_response.py b/src/cloudflare/types/zaraz/history_list_response.py new file mode 100644 index 00000000000..0cec64478b9 --- /dev/null +++ b/src/cloudflare/types/zaraz/history_list_response.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from datetime import datetime + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HistoryListResponse"] + + +class HistoryListResponse(BaseModel): + id: int + """ID of the configuration""" + + created_at: datetime = FieldInfo(alias="createdAt") + """Date and time the configuration was created""" + + description: str + """Configuration description provided by the user who published this configuration""" + + updated_at: datetime = FieldInfo(alias="updatedAt") + """Date and time the configuration was last updated""" + + user_id: str = FieldInfo(alias="userId") + """Alpha-numeric ID of the account user who published the configuration""" diff --git a/src/cloudflare/types/zaraz/history_update_params.py b/src/cloudflare/types/zaraz/history_update_params.py new file mode 100644 index 00000000000..59b7e9dd565 --- /dev/null +++ b/src/cloudflare/types/zaraz/history_update_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["HistoryUpdateParams"] + + +class HistoryUpdateParams(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + body: Required[int] + """ID of the Zaraz configuration to restore.""" diff --git a/src/cloudflare/types/zaraz/neo_event.py b/src/cloudflare/types/zaraz/neo_event.py new file mode 100644 index 00000000000..deef96e304d --- /dev/null +++ b/src/cloudflare/types/zaraz/neo_event.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["NeoEvent"] + + +class NeoEvent(BaseModel): + action_type: str = FieldInfo(alias="actionType") + """Tool event type""" + + blocking_triggers: List[str] = FieldInfo(alias="blockingTriggers") + """List of blocking triggers IDs""" + + data: object + """Event payload""" + + firing_triggers: List[str] = FieldInfo(alias="firingTriggers") + """List of firing triggers IDs""" diff --git a/src/cloudflare/types/zaraz/neo_event_param.py b/src/cloudflare/types/zaraz/neo_event_param.py new file mode 100644 index 00000000000..e154520b973 --- /dev/null +++ b/src/cloudflare/types/zaraz/neo_event_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["NeoEventParam"] + + +class NeoEventParam(TypedDict, total=False): + action_type: Required[Annotated[str, PropertyInfo(alias="actionType")]] + """Tool event type""" + + blocking_triggers: Required[Annotated[List[str], PropertyInfo(alias="blockingTriggers")]] + """List of blocking triggers IDs""" + + data: Required[object] + """Event payload""" + + firing_triggers: Required[Annotated[List[str], PropertyInfo(alias="firingTriggers")]] + """List of firing triggers IDs""" diff --git a/src/cloudflare/types/zaraz/publish_create_params.py b/src/cloudflare/types/zaraz/publish_create_params.py new file mode 100644 index 00000000000..62c446e0638 --- /dev/null +++ b/src/cloudflare/types/zaraz/publish_create_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["PublishCreateParams"] + + +class PublishCreateParams(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + body: Required[str] + """Zaraz configuration description.""" diff --git a/src/cloudflare/types/zaraz/publish_create_response.py b/src/cloudflare/types/zaraz/publish_create_response.py new file mode 100644 index 00000000000..a599dfc09d8 --- /dev/null +++ b/src/cloudflare/types/zaraz/publish_create_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["PublishCreateResponse"] + +PublishCreateResponse: TypeAlias = str diff --git a/src/cloudflare/types/zaraz/workflow.py b/src/cloudflare/types/zaraz/workflow.py new file mode 100644 index 00000000000..d31e94cb893 --- /dev/null +++ b/src/cloudflare/types/zaraz/workflow.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["Workflow"] + +Workflow: TypeAlias = Literal["realtime", "preview"] diff --git a/src/cloudflare/types/zaraz/zaraz_update_params.py b/src/cloudflare/types/zaraz/zaraz_update_params.py new file mode 100644 index 00000000000..b5ece4f2285 --- /dev/null +++ b/src/cloudflare/types/zaraz/zaraz_update_params.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .workflow import Workflow + +__all__ = ["ZarazUpdateParams"] + + +class ZarazUpdateParams(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + workflow: Required[Workflow] + """Zaraz workflow""" diff --git a/tests/api_resources/test_zaraz.py b/tests/api_resources/test_zaraz.py new file mode 100644 index 00000000000..5b9e0b3829c --- /dev/null +++ b/tests/api_resources/test_zaraz.py @@ -0,0 +1,106 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.zaraz import Workflow + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestZaraz: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_update(self, client: Cloudflare) -> None: + zaraz = client.zaraz.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + workflow="realtime", + ) + assert_matches_type(Workflow, zaraz, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Cloudflare) -> None: + response = client.zaraz.with_raw_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + workflow="realtime", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + zaraz = response.parse() + assert_matches_type(Workflow, zaraz, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Cloudflare) -> None: + with client.zaraz.with_streaming_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + workflow="realtime", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + zaraz = response.parse() + assert_matches_type(Workflow, zaraz, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zaraz.with_raw_response.update( + zone_id="", + workflow="realtime", + ) + + +class TestAsyncZaraz: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_update(self, async_client: AsyncCloudflare) -> None: + zaraz = await async_client.zaraz.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + workflow="realtime", + ) + assert_matches_type(Workflow, zaraz, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zaraz.with_raw_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + workflow="realtime", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + zaraz = await response.parse() + assert_matches_type(Workflow, zaraz, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async with async_client.zaraz.with_streaming_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + workflow="realtime", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + zaraz = await response.parse() + assert_matches_type(Workflow, zaraz, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zaraz.with_raw_response.update( + zone_id="", + workflow="realtime", + ) diff --git a/tests/api_resources/zaraz/__init__.py b/tests/api_resources/zaraz/__init__.py new file mode 100644 index 00000000000..fd8019a9a1a --- /dev/null +++ b/tests/api_resources/zaraz/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/zaraz/history/__init__.py b/tests/api_resources/zaraz/history/__init__.py new file mode 100644 index 00000000000..fd8019a9a1a --- /dev/null +++ b/tests/api_resources/zaraz/history/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/zaraz/history/test_configs.py b/tests/api_resources/zaraz/history/test_configs.py new file mode 100644 index 00000000000..64707d5d443 --- /dev/null +++ b/tests/api_resources/zaraz/history/test_configs.py @@ -0,0 +1,106 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.zaraz.history import ConfigGetResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestConfigs: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + config = client.zaraz.history.configs.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ids=[0], + ) + assert_matches_type(ConfigGetResponse, config, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.zaraz.history.configs.with_raw_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ids=[0], + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + config = response.parse() + assert_matches_type(ConfigGetResponse, config, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.zaraz.history.configs.with_streaming_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ids=[0], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + config = response.parse() + assert_matches_type(ConfigGetResponse, config, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zaraz.history.configs.with_raw_response.get( + zone_id="", + ids=[0], + ) + + +class TestAsyncConfigs: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + config = await async_client.zaraz.history.configs.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ids=[0], + ) + assert_matches_type(ConfigGetResponse, config, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zaraz.history.configs.with_raw_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ids=[0], + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + config = await response.parse() + assert_matches_type(ConfigGetResponse, config, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.zaraz.history.configs.with_streaming_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ids=[0], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + config = await response.parse() + assert_matches_type(ConfigGetResponse, config, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zaraz.history.configs.with_raw_response.get( + zone_id="", + ids=[0], + ) diff --git a/tests/api_resources/zaraz/test_config.py b/tests/api_resources/zaraz/test_config.py new file mode 100644 index 00000000000..15a39c60cac --- /dev/null +++ b/tests/api_resources/zaraz/test_config.py @@ -0,0 +1,782 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.zaraz import Configuration + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestConfig: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_update(self, client: Cloudflare) -> None: + config = client.zaraz.config.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data_layer=True, + debug_key="debugKey", + settings={"auto_inject_script": True}, + tools={ + "foo": { + "blocking_triggers": ["string"], + "component": "component", + "default_fields": {"foo": "string"}, + "enabled": True, + "name": "name", + "permissions": ["string"], + "settings": {"foo": "string"}, + "type": "component", + } + }, + triggers={ + "foo": { + "exclude_rules": [ + { + "id": "id", + "match": "match", + "op": "CONTAINS", + "value": "value", + } + ], + "load_rules": [ + { + "id": "id", + "match": "match", + "op": "CONTAINS", + "value": "value", + } + ], + "name": "name", + } + }, + variables={ + "foo": { + "name": "name", + "type": "string", + "value": "value", + } + }, + zaraz_version=0, + ) + assert_matches_type(Configuration, config, path=["response"]) + + @parametrize + def test_method_update_with_all_params(self, client: Cloudflare) -> None: + config = client.zaraz.config.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data_layer=True, + debug_key="debugKey", + settings={ + "auto_inject_script": True, + "context_enricher": { + "escaped_worker_name": "escapedWorkerName", + "worker_tag": "workerTag", + }, + "cookie_domain": "cookieDomain", + "ecommerce": True, + "events_api_path": "eventsApiPath", + "hide_external_referer": True, + "hide_ip_address": True, + "hide_query_params": True, + "hide_user_agent": True, + "init_path": "initPath", + "inject_iframes": True, + "mc_root_path": "mcRootPath", + "script_path": "scriptPath", + "track_path": "trackPath", + }, + tools={ + "foo": { + "blocking_triggers": ["string"], + "component": "component", + "default_fields": {"foo": "string"}, + "enabled": True, + "name": "name", + "permissions": ["string"], + "settings": {"foo": "string"}, + "type": "component", + "actions": { + "foo": { + "action_type": "actionType", + "blocking_triggers": ["string"], + "data": {}, + "firing_triggers": ["string"], + } + }, + "default_purpose": "defaultPurpose", + "neo_events": [ + { + "action_type": "actionType", + "blocking_triggers": ["string"], + "data": {}, + "firing_triggers": ["string"], + } + ], + "vendor_name": "vendorName", + "vendor_policy_url": "vendorPolicyUrl", + } + }, + triggers={ + "foo": { + "exclude_rules": [ + { + "id": "id", + "match": "match", + "op": "CONTAINS", + "value": "value", + } + ], + "load_rules": [ + { + "id": "id", + "match": "match", + "op": "CONTAINS", + "value": "value", + } + ], + "name": "name", + "description": "description", + "system": "pageload", + } + }, + variables={ + "foo": { + "name": "name", + "type": "string", + "value": "value", + } + }, + zaraz_version=0, + analytics={ + "default_purpose": "defaultPurpose", + "enabled": True, + "session_exp_time": 60, + }, + consent={ + "enabled": True, + "button_text_translations": { + "accept_all": {"foo": "string"}, + "confirm_my_choices": {"foo": "string"}, + "reject_all": {"foo": "string"}, + }, + "company_email": "companyEmail", + "company_name": "companyName", + "company_street_address": "companyStreetAddress", + "consent_modal_intro_html": "consentModalIntroHTML", + "consent_modal_intro_html_with_translations": {"foo": "string"}, + "cookie_name": "cookieName", + "custom_css": "customCSS", + "custom_intro_disclaimer_dismissed": True, + "default_language": "defaultLanguage", + "hide_modal": True, + "purposes": { + "foo": { + "description": "description", + "name": "name", + } + }, + "purposes_with_translations": { + "foo": { + "description": {"foo": "string"}, + "name": {"foo": "string"}, + "order": 0, + } + }, + "tcf_compliant": True, + }, + history_change=True, + ) + assert_matches_type(Configuration, config, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Cloudflare) -> None: + response = client.zaraz.config.with_raw_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data_layer=True, + debug_key="debugKey", + settings={"auto_inject_script": True}, + tools={ + "foo": { + "blocking_triggers": ["string"], + "component": "component", + "default_fields": {"foo": "string"}, + "enabled": True, + "name": "name", + "permissions": ["string"], + "settings": {"foo": "string"}, + "type": "component", + } + }, + triggers={ + "foo": { + "exclude_rules": [ + { + "id": "id", + "match": "match", + "op": "CONTAINS", + "value": "value", + } + ], + "load_rules": [ + { + "id": "id", + "match": "match", + "op": "CONTAINS", + "value": "value", + } + ], + "name": "name", + } + }, + variables={ + "foo": { + "name": "name", + "type": "string", + "value": "value", + } + }, + zaraz_version=0, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + config = response.parse() + assert_matches_type(Configuration, config, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Cloudflare) -> None: + with client.zaraz.config.with_streaming_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data_layer=True, + debug_key="debugKey", + settings={"auto_inject_script": True}, + tools={ + "foo": { + "blocking_triggers": ["string"], + "component": "component", + "default_fields": {"foo": "string"}, + "enabled": True, + "name": "name", + "permissions": ["string"], + "settings": {"foo": "string"}, + "type": "component", + } + }, + triggers={ + "foo": { + "exclude_rules": [ + { + "id": "id", + "match": "match", + "op": "CONTAINS", + "value": "value", + } + ], + "load_rules": [ + { + "id": "id", + "match": "match", + "op": "CONTAINS", + "value": "value", + } + ], + "name": "name", + } + }, + variables={ + "foo": { + "name": "name", + "type": "string", + "value": "value", + } + }, + zaraz_version=0, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + config = response.parse() + assert_matches_type(Configuration, config, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zaraz.config.with_raw_response.update( + zone_id="", + data_layer=True, + debug_key="debugKey", + settings={"auto_inject_script": True}, + tools={ + "foo": { + "blocking_triggers": ["string"], + "component": "component", + "default_fields": {"foo": "string"}, + "enabled": True, + "name": "name", + "permissions": ["string"], + "settings": {"foo": "string"}, + "type": "component", + } + }, + triggers={ + "foo": { + "exclude_rules": [ + { + "id": "id", + "match": "match", + "op": "CONTAINS", + "value": "value", + } + ], + "load_rules": [ + { + "id": "id", + "match": "match", + "op": "CONTAINS", + "value": "value", + } + ], + "name": "name", + } + }, + variables={ + "foo": { + "name": "name", + "type": "string", + "value": "value", + } + }, + zaraz_version=0, + ) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + config = client.zaraz.config.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Configuration, config, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.zaraz.config.with_raw_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + config = response.parse() + assert_matches_type(Configuration, config, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.zaraz.config.with_streaming_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + config = response.parse() + assert_matches_type(Configuration, config, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zaraz.config.with_raw_response.get( + zone_id="", + ) + + +class TestAsyncConfig: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_update(self, async_client: AsyncCloudflare) -> None: + config = await async_client.zaraz.config.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data_layer=True, + debug_key="debugKey", + settings={"auto_inject_script": True}, + tools={ + "foo": { + "blocking_triggers": ["string"], + "component": "component", + "default_fields": {"foo": "string"}, + "enabled": True, + "name": "name", + "permissions": ["string"], + "settings": {"foo": "string"}, + "type": "component", + } + }, + triggers={ + "foo": { + "exclude_rules": [ + { + "id": "id", + "match": "match", + "op": "CONTAINS", + "value": "value", + } + ], + "load_rules": [ + { + "id": "id", + "match": "match", + "op": "CONTAINS", + "value": "value", + } + ], + "name": "name", + } + }, + variables={ + "foo": { + "name": "name", + "type": "string", + "value": "value", + } + }, + zaraz_version=0, + ) + assert_matches_type(Configuration, config, path=["response"]) + + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: + config = await async_client.zaraz.config.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data_layer=True, + debug_key="debugKey", + settings={ + "auto_inject_script": True, + "context_enricher": { + "escaped_worker_name": "escapedWorkerName", + "worker_tag": "workerTag", + }, + "cookie_domain": "cookieDomain", + "ecommerce": True, + "events_api_path": "eventsApiPath", + "hide_external_referer": True, + "hide_ip_address": True, + "hide_query_params": True, + "hide_user_agent": True, + "init_path": "initPath", + "inject_iframes": True, + "mc_root_path": "mcRootPath", + "script_path": "scriptPath", + "track_path": "trackPath", + }, + tools={ + "foo": { + "blocking_triggers": ["string"], + "component": "component", + "default_fields": {"foo": "string"}, + "enabled": True, + "name": "name", + "permissions": ["string"], + "settings": {"foo": "string"}, + "type": "component", + "actions": { + "foo": { + "action_type": "actionType", + "blocking_triggers": ["string"], + "data": {}, + "firing_triggers": ["string"], + } + }, + "default_purpose": "defaultPurpose", + "neo_events": [ + { + "action_type": "actionType", + "blocking_triggers": ["string"], + "data": {}, + "firing_triggers": ["string"], + } + ], + "vendor_name": "vendorName", + "vendor_policy_url": "vendorPolicyUrl", + } + }, + triggers={ + "foo": { + "exclude_rules": [ + { + "id": "id", + "match": "match", + "op": "CONTAINS", + "value": "value", + } + ], + "load_rules": [ + { + "id": "id", + "match": "match", + "op": "CONTAINS", + "value": "value", + } + ], + "name": "name", + "description": "description", + "system": "pageload", + } + }, + variables={ + "foo": { + "name": "name", + "type": "string", + "value": "value", + } + }, + zaraz_version=0, + analytics={ + "default_purpose": "defaultPurpose", + "enabled": True, + "session_exp_time": 60, + }, + consent={ + "enabled": True, + "button_text_translations": { + "accept_all": {"foo": "string"}, + "confirm_my_choices": {"foo": "string"}, + "reject_all": {"foo": "string"}, + }, + "company_email": "companyEmail", + "company_name": "companyName", + "company_street_address": "companyStreetAddress", + "consent_modal_intro_html": "consentModalIntroHTML", + "consent_modal_intro_html_with_translations": {"foo": "string"}, + "cookie_name": "cookieName", + "custom_css": "customCSS", + "custom_intro_disclaimer_dismissed": True, + "default_language": "defaultLanguage", + "hide_modal": True, + "purposes": { + "foo": { + "description": "description", + "name": "name", + } + }, + "purposes_with_translations": { + "foo": { + "description": {"foo": "string"}, + "name": {"foo": "string"}, + "order": 0, + } + }, + "tcf_compliant": True, + }, + history_change=True, + ) + assert_matches_type(Configuration, config, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zaraz.config.with_raw_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data_layer=True, + debug_key="debugKey", + settings={"auto_inject_script": True}, + tools={ + "foo": { + "blocking_triggers": ["string"], + "component": "component", + "default_fields": {"foo": "string"}, + "enabled": True, + "name": "name", + "permissions": ["string"], + "settings": {"foo": "string"}, + "type": "component", + } + }, + triggers={ + "foo": { + "exclude_rules": [ + { + "id": "id", + "match": "match", + "op": "CONTAINS", + "value": "value", + } + ], + "load_rules": [ + { + "id": "id", + "match": "match", + "op": "CONTAINS", + "value": "value", + } + ], + "name": "name", + } + }, + variables={ + "foo": { + "name": "name", + "type": "string", + "value": "value", + } + }, + zaraz_version=0, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + config = await response.parse() + assert_matches_type(Configuration, config, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async with async_client.zaraz.config.with_streaming_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data_layer=True, + debug_key="debugKey", + settings={"auto_inject_script": True}, + tools={ + "foo": { + "blocking_triggers": ["string"], + "component": "component", + "default_fields": {"foo": "string"}, + "enabled": True, + "name": "name", + "permissions": ["string"], + "settings": {"foo": "string"}, + "type": "component", + } + }, + triggers={ + "foo": { + "exclude_rules": [ + { + "id": "id", + "match": "match", + "op": "CONTAINS", + "value": "value", + } + ], + "load_rules": [ + { + "id": "id", + "match": "match", + "op": "CONTAINS", + "value": "value", + } + ], + "name": "name", + } + }, + variables={ + "foo": { + "name": "name", + "type": "string", + "value": "value", + } + }, + zaraz_version=0, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + config = await response.parse() + assert_matches_type(Configuration, config, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zaraz.config.with_raw_response.update( + zone_id="", + data_layer=True, + debug_key="debugKey", + settings={"auto_inject_script": True}, + tools={ + "foo": { + "blocking_triggers": ["string"], + "component": "component", + "default_fields": {"foo": "string"}, + "enabled": True, + "name": "name", + "permissions": ["string"], + "settings": {"foo": "string"}, + "type": "component", + } + }, + triggers={ + "foo": { + "exclude_rules": [ + { + "id": "id", + "match": "match", + "op": "CONTAINS", + "value": "value", + } + ], + "load_rules": [ + { + "id": "id", + "match": "match", + "op": "CONTAINS", + "value": "value", + } + ], + "name": "name", + } + }, + variables={ + "foo": { + "name": "name", + "type": "string", + "value": "value", + } + }, + zaraz_version=0, + ) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + config = await async_client.zaraz.config.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Configuration, config, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zaraz.config.with_raw_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + config = await response.parse() + assert_matches_type(Configuration, config, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.zaraz.config.with_streaming_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + config = await response.parse() + assert_matches_type(Configuration, config, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zaraz.config.with_raw_response.get( + zone_id="", + ) diff --git a/tests/api_resources/zaraz/test_default.py b/tests/api_resources/zaraz/test_default.py new file mode 100644 index 00000000000..b0a77bb4a0b --- /dev/null +++ b/tests/api_resources/zaraz/test_default.py @@ -0,0 +1,98 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.zaraz import Configuration + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestDefault: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + default = client.zaraz.default.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Configuration, default, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.zaraz.default.with_raw_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + default = response.parse() + assert_matches_type(Configuration, default, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.zaraz.default.with_streaming_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + default = response.parse() + assert_matches_type(Configuration, default, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zaraz.default.with_raw_response.get( + zone_id="", + ) + + +class TestAsyncDefault: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + default = await async_client.zaraz.default.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Configuration, default, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zaraz.default.with_raw_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + default = await response.parse() + assert_matches_type(Configuration, default, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.zaraz.default.with_streaming_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + default = await response.parse() + assert_matches_type(Configuration, default, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zaraz.default.with_raw_response.get( + zone_id="", + ) diff --git a/tests/api_resources/zaraz/test_export.py b/tests/api_resources/zaraz/test_export.py new file mode 100644 index 00000000000..73ea5604505 --- /dev/null +++ b/tests/api_resources/zaraz/test_export.py @@ -0,0 +1,98 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.zaraz import Configuration + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestExport: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + export = client.zaraz.export.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Configuration, export, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.zaraz.export.with_raw_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + export = response.parse() + assert_matches_type(Configuration, export, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.zaraz.export.with_streaming_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + export = response.parse() + assert_matches_type(Configuration, export, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zaraz.export.with_raw_response.get( + zone_id="", + ) + + +class TestAsyncExport: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + export = await async_client.zaraz.export.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Configuration, export, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zaraz.export.with_raw_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + export = await response.parse() + assert_matches_type(Configuration, export, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.zaraz.export.with_streaming_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + export = await response.parse() + assert_matches_type(Configuration, export, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zaraz.export.with_raw_response.get( + zone_id="", + ) diff --git a/tests/api_resources/zaraz/test_history.py b/tests/api_resources/zaraz/test_history.py new file mode 100644 index 00000000000..7690f5c9b68 --- /dev/null +++ b/tests/api_resources/zaraz/test_history.py @@ -0,0 +1,205 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.zaraz import Configuration, HistoryListResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestHistory: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_update(self, client: Cloudflare) -> None: + history = client.zaraz.history.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body=12345, + ) + assert_matches_type(Configuration, history, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Cloudflare) -> None: + response = client.zaraz.history.with_raw_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body=12345, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + history = response.parse() + assert_matches_type(Configuration, history, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Cloudflare) -> None: + with client.zaraz.history.with_streaming_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body=12345, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + history = response.parse() + assert_matches_type(Configuration, history, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zaraz.history.with_raw_response.update( + zone_id="", + body=12345, + ) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + history = client.zaraz.history.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(SyncSinglePage[HistoryListResponse], history, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + history = client.zaraz.history.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + limit=1, + offset=0, + sort_field="id", + sort_order="DESC", + ) + assert_matches_type(SyncSinglePage[HistoryListResponse], history, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.zaraz.history.with_raw_response.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + history = response.parse() + assert_matches_type(SyncSinglePage[HistoryListResponse], history, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.zaraz.history.with_streaming_response.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + history = response.parse() + assert_matches_type(SyncSinglePage[HistoryListResponse], history, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zaraz.history.with_raw_response.list( + zone_id="", + ) + + +class TestAsyncHistory: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_update(self, async_client: AsyncCloudflare) -> None: + history = await async_client.zaraz.history.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body=12345, + ) + assert_matches_type(Configuration, history, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zaraz.history.with_raw_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body=12345, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + history = await response.parse() + assert_matches_type(Configuration, history, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async with async_client.zaraz.history.with_streaming_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body=12345, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + history = await response.parse() + assert_matches_type(Configuration, history, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zaraz.history.with_raw_response.update( + zone_id="", + body=12345, + ) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + history = await async_client.zaraz.history.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(AsyncSinglePage[HistoryListResponse], history, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + history = await async_client.zaraz.history.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + limit=1, + offset=0, + sort_field="id", + sort_order="DESC", + ) + assert_matches_type(AsyncSinglePage[HistoryListResponse], history, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zaraz.history.with_raw_response.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + history = await response.parse() + assert_matches_type(AsyncSinglePage[HistoryListResponse], history, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.zaraz.history.with_streaming_response.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + history = await response.parse() + assert_matches_type(AsyncSinglePage[HistoryListResponse], history, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zaraz.history.with_raw_response.list( + zone_id="", + ) diff --git a/tests/api_resources/zaraz/test_publish.py b/tests/api_resources/zaraz/test_publish.py new file mode 100644 index 00000000000..dc7705837b7 --- /dev/null +++ b/tests/api_resources/zaraz/test_publish.py @@ -0,0 +1,105 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestPublish: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Cloudflare) -> None: + publish = client.zaraz.publish.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body="Config with enabled ecommerce tracking", + ) + assert_matches_type(str, publish, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Cloudflare) -> None: + response = client.zaraz.publish.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body="Config with enabled ecommerce tracking", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + publish = response.parse() + assert_matches_type(str, publish, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Cloudflare) -> None: + with client.zaraz.publish.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body="Config with enabled ecommerce tracking", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + publish = response.parse() + assert_matches_type(str, publish, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zaraz.publish.with_raw_response.create( + zone_id="", + body="Config with enabled ecommerce tracking", + ) + + +class TestAsyncPublish: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncCloudflare) -> None: + publish = await async_client.zaraz.publish.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body="Config with enabled ecommerce tracking", + ) + assert_matches_type(str, publish, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zaraz.publish.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body="Config with enabled ecommerce tracking", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + publish = await response.parse() + assert_matches_type(str, publish, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: + async with async_client.zaraz.publish.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body="Config with enabled ecommerce tracking", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + publish = await response.parse() + assert_matches_type(str, publish, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zaraz.publish.with_raw_response.create( + zone_id="", + body="Config with enabled ecommerce tracking", + ) diff --git a/tests/api_resources/zaraz/test_workflow.py b/tests/api_resources/zaraz/test_workflow.py new file mode 100644 index 00000000000..52930af6397 --- /dev/null +++ b/tests/api_resources/zaraz/test_workflow.py @@ -0,0 +1,98 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.zaraz import Workflow + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestWorkflow: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + workflow = client.zaraz.workflow.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Workflow, workflow, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.zaraz.workflow.with_raw_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + workflow = response.parse() + assert_matches_type(Workflow, workflow, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.zaraz.workflow.with_streaming_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + workflow = response.parse() + assert_matches_type(Workflow, workflow, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zaraz.workflow.with_raw_response.get( + zone_id="", + ) + + +class TestAsyncWorkflow: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + workflow = await async_client.zaraz.workflow.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Workflow, workflow, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zaraz.workflow.with_raw_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + workflow = await response.parse() + assert_matches_type(Workflow, workflow, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.zaraz.workflow.with_streaming_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + workflow = await response.parse() + assert_matches_type(Workflow, workflow, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zaraz.workflow.with_raw_response.get( + zone_id="", + ) From 83dc1e35373b371458f47e79db768b1d9c092af8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 23:12:44 +0000 Subject: [PATCH 219/358] feat(connectors): add `telemetry` and `snapshots` (#2461) --- .stats.yml | 2 +- api.md | 34 +- .../magic_transit/connectors/__init__.py | 47 ++ .../{ => connectors}/connectors.py | 90 ++- .../magic_transit/connectors/snapshots.py | 298 ++++++++ .../magic_transit/connectors/telemetry.py | 300 ++++++++ .../resources/magic_transit/magic_transit.py | 16 +- .../magic_transit/connectors/__init__.py | 10 + .../connectors/snapshot_get_response.py | 687 ++++++++++++++++++ .../connectors/snapshot_list_params.py | 21 + .../connectors/snapshot_list_response.py | 23 + .../connectors/telemetry_get_response.py | 34 + .../connectors/telemetry_list_params.py | 21 + .../connectors/telemetry_list_response.py | 29 + .../magic_transit/connectors/__init__.py | 1 + .../connectors/test_snapshots.py | 238 ++++++ .../connectors/test_telemetry.py | 246 +++++++ 17 files changed, 2071 insertions(+), 26 deletions(-) create mode 100644 src/cloudflare/resources/magic_transit/connectors/__init__.py rename src/cloudflare/resources/magic_transit/{ => connectors}/connectors.py (86%) create mode 100644 src/cloudflare/resources/magic_transit/connectors/snapshots.py create mode 100644 src/cloudflare/resources/magic_transit/connectors/telemetry.py create mode 100644 src/cloudflare/types/magic_transit/connectors/__init__.py create mode 100644 src/cloudflare/types/magic_transit/connectors/snapshot_get_response.py create mode 100644 src/cloudflare/types/magic_transit/connectors/snapshot_list_params.py create mode 100644 src/cloudflare/types/magic_transit/connectors/snapshot_list_response.py create mode 100644 src/cloudflare/types/magic_transit/connectors/telemetry_get_response.py create mode 100644 src/cloudflare/types/magic_transit/connectors/telemetry_list_params.py create mode 100644 src/cloudflare/types/magic_transit/connectors/telemetry_list_response.py create mode 100644 tests/api_resources/magic_transit/connectors/__init__.py create mode 100644 tests/api_resources/magic_transit/connectors/test_snapshots.py create mode 100644 tests/api_resources/magic_transit/connectors/test_telemetry.py diff --git a/.stats.yml b/.stats.yml index 2b754c290a2..0249b6a6d9b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 1538 +configured_endpoints: 1542 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-098958c3d34c1f726db27a49f075f6e8e2c9204777a0a5d6aa49ca54fc803022.yml diff --git a/api.md b/api.md index 5dab35e574a..72cd5024178 100644 --- a/api.md +++ b/api.md @@ -3877,10 +3877,36 @@ from cloudflare.types.magic_transit import ( Methods: -- client.magic_transit.connectors.update(connector_id, \*, account_id, \*\*params) -> ConnectorUpdateResponse -- client.magic_transit.connectors.list(\*, account_id) -> SyncSinglePage[ConnectorListResponse] -- client.magic_transit.connectors.edit(connector_id, \*, account_id, \*\*params) -> ConnectorEditResponse -- client.magic_transit.connectors.get(connector_id, \*, account_id) -> ConnectorGetResponse +- client.magic_transit.connectors.update(connector_id, \*, account_id, \*\*params) -> ConnectorUpdateResponse +- client.magic_transit.connectors.list(\*, account_id) -> SyncSinglePage[ConnectorListResponse] +- client.magic_transit.connectors.edit(connector_id, \*, account_id, \*\*params) -> ConnectorEditResponse +- client.magic_transit.connectors.get(connector_id, \*, account_id) -> ConnectorGetResponse + +### Telemetry + +Types: + +```python +from cloudflare.types.magic_transit.connectors import TelemetryListResponse, TelemetryGetResponse +``` + +Methods: + +- client.magic_transit.connectors.telemetry.list(connector_id, \*, account_id, \*\*params) -> TelemetryListResponse +- client.magic_transit.connectors.telemetry.get(event_n, \*, account_id, connector_id, event_t) -> TelemetryGetResponse + +### Snapshots + +Types: + +```python +from cloudflare.types.magic_transit.connectors import SnapshotListResponse, SnapshotGetResponse +``` + +Methods: + +- client.magic_transit.connectors.snapshots.list(connector_id, \*, account_id, \*\*params) -> SnapshotListResponse +- client.magic_transit.connectors.snapshots.get(snapshot_t, \*, account_id, connector_id) -> SnapshotGetResponse ## PCAPs diff --git a/src/cloudflare/resources/magic_transit/connectors/__init__.py b/src/cloudflare/resources/magic_transit/connectors/__init__.py new file mode 100644 index 00000000000..7eb748d3559 --- /dev/null +++ b/src/cloudflare/resources/magic_transit/connectors/__init__.py @@ -0,0 +1,47 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .snapshots import ( + SnapshotsResource, + AsyncSnapshotsResource, + SnapshotsResourceWithRawResponse, + AsyncSnapshotsResourceWithRawResponse, + SnapshotsResourceWithStreamingResponse, + AsyncSnapshotsResourceWithStreamingResponse, +) +from .telemetry import ( + TelemetryResource, + AsyncTelemetryResource, + TelemetryResourceWithRawResponse, + AsyncTelemetryResourceWithRawResponse, + TelemetryResourceWithStreamingResponse, + AsyncTelemetryResourceWithStreamingResponse, +) +from .connectors import ( + ConnectorsResource, + AsyncConnectorsResource, + ConnectorsResourceWithRawResponse, + AsyncConnectorsResourceWithRawResponse, + ConnectorsResourceWithStreamingResponse, + AsyncConnectorsResourceWithStreamingResponse, +) + +__all__ = [ + "TelemetryResource", + "AsyncTelemetryResource", + "TelemetryResourceWithRawResponse", + "AsyncTelemetryResourceWithRawResponse", + "TelemetryResourceWithStreamingResponse", + "AsyncTelemetryResourceWithStreamingResponse", + "SnapshotsResource", + "AsyncSnapshotsResource", + "SnapshotsResourceWithRawResponse", + "AsyncSnapshotsResourceWithRawResponse", + "SnapshotsResourceWithStreamingResponse", + "AsyncSnapshotsResourceWithStreamingResponse", + "ConnectorsResource", + "AsyncConnectorsResource", + "ConnectorsResourceWithRawResponse", + "AsyncConnectorsResourceWithRawResponse", + "ConnectorsResourceWithStreamingResponse", + "AsyncConnectorsResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/magic_transit/connectors.py b/src/cloudflare/resources/magic_transit/connectors/connectors.py similarity index 86% rename from src/cloudflare/resources/magic_transit/connectors.py rename to src/cloudflare/resources/magic_transit/connectors/connectors.py index d25b76ebd2c..93325e05735 100644 --- a/src/cloudflare/resources/magic_transit/connectors.py +++ b/src/cloudflare/resources/magic_transit/connectors/connectors.py @@ -6,32 +6,56 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( maybe_transform, async_maybe_transform, ) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( +from .snapshots import ( + SnapshotsResource, + AsyncSnapshotsResource, + SnapshotsResourceWithRawResponse, + AsyncSnapshotsResourceWithRawResponse, + SnapshotsResourceWithStreamingResponse, + AsyncSnapshotsResourceWithStreamingResponse, +) +from .telemetry import ( + TelemetryResource, + AsyncTelemetryResource, + TelemetryResourceWithRawResponse, + AsyncTelemetryResourceWithRawResponse, + TelemetryResourceWithStreamingResponse, + AsyncTelemetryResourceWithStreamingResponse, +) +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._wrappers import ResultWrapper -from ...pagination import SyncSinglePage, AsyncSinglePage -from ..._base_client import AsyncPaginator, make_request_options -from ...types.magic_transit import connector_edit_params, connector_update_params -from ...types.magic_transit.connector_get_response import ConnectorGetResponse -from ...types.magic_transit.connector_edit_response import ConnectorEditResponse -from ...types.magic_transit.connector_list_response import ConnectorListResponse -from ...types.magic_transit.connector_update_response import ConnectorUpdateResponse +from ...._wrappers import ResultWrapper +from ....pagination import SyncSinglePage, AsyncSinglePage +from ...._base_client import AsyncPaginator, make_request_options +from ....types.magic_transit import connector_edit_params, connector_update_params +from ....types.magic_transit.connector_get_response import ConnectorGetResponse +from ....types.magic_transit.connector_edit_response import ConnectorEditResponse +from ....types.magic_transit.connector_list_response import ConnectorListResponse +from ....types.magic_transit.connector_update_response import ConnectorUpdateResponse __all__ = ["ConnectorsResource", "AsyncConnectorsResource"] class ConnectorsResource(SyncAPIResource): + @cached_property + def telemetry(self) -> TelemetryResource: + return TelemetryResource(self._client) + + @cached_property + def snapshots(self) -> SnapshotsResource: + return SnapshotsResource(self._client) + @cached_property def with_raw_response(self) -> ConnectorsResourceWithRawResponse: """ @@ -245,6 +269,14 @@ def get( class AsyncConnectorsResource(AsyncAPIResource): + @cached_property + def telemetry(self) -> AsyncTelemetryResource: + return AsyncTelemetryResource(self._client) + + @cached_property + def snapshots(self) -> AsyncSnapshotsResource: + return AsyncSnapshotsResource(self._client) + @cached_property def with_raw_response(self) -> AsyncConnectorsResourceWithRawResponse: """ @@ -474,6 +506,14 @@ def __init__(self, connectors: ConnectorsResource) -> None: connectors.get, ) + @cached_property + def telemetry(self) -> TelemetryResourceWithRawResponse: + return TelemetryResourceWithRawResponse(self._connectors.telemetry) + + @cached_property + def snapshots(self) -> SnapshotsResourceWithRawResponse: + return SnapshotsResourceWithRawResponse(self._connectors.snapshots) + class AsyncConnectorsResourceWithRawResponse: def __init__(self, connectors: AsyncConnectorsResource) -> None: @@ -492,6 +532,14 @@ def __init__(self, connectors: AsyncConnectorsResource) -> None: connectors.get, ) + @cached_property + def telemetry(self) -> AsyncTelemetryResourceWithRawResponse: + return AsyncTelemetryResourceWithRawResponse(self._connectors.telemetry) + + @cached_property + def snapshots(self) -> AsyncSnapshotsResourceWithRawResponse: + return AsyncSnapshotsResourceWithRawResponse(self._connectors.snapshots) + class ConnectorsResourceWithStreamingResponse: def __init__(self, connectors: ConnectorsResource) -> None: @@ -510,6 +558,14 @@ def __init__(self, connectors: ConnectorsResource) -> None: connectors.get, ) + @cached_property + def telemetry(self) -> TelemetryResourceWithStreamingResponse: + return TelemetryResourceWithStreamingResponse(self._connectors.telemetry) + + @cached_property + def snapshots(self) -> SnapshotsResourceWithStreamingResponse: + return SnapshotsResourceWithStreamingResponse(self._connectors.snapshots) + class AsyncConnectorsResourceWithStreamingResponse: def __init__(self, connectors: AsyncConnectorsResource) -> None: @@ -527,3 +583,11 @@ def __init__(self, connectors: AsyncConnectorsResource) -> None: self.get = async_to_streamed_response_wrapper( connectors.get, ) + + @cached_property + def telemetry(self) -> AsyncTelemetryResourceWithStreamingResponse: + return AsyncTelemetryResourceWithStreamingResponse(self._connectors.telemetry) + + @cached_property + def snapshots(self) -> AsyncSnapshotsResourceWithStreamingResponse: + return AsyncSnapshotsResourceWithStreamingResponse(self._connectors.snapshots) diff --git a/src/cloudflare/resources/magic_transit/connectors/snapshots.py b/src/cloudflare/resources/magic_transit/connectors/snapshots.py new file mode 100644 index 00000000000..19fa2564e2e --- /dev/null +++ b/src/cloudflare/resources/magic_transit/connectors/snapshots.py @@ -0,0 +1,298 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, cast + +import httpx + +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( + maybe_transform, + async_maybe_transform, +) +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...._wrappers import ResultWrapper +from ...._base_client import make_request_options +from ....types.magic_transit.connectors import snapshot_list_params +from ....types.magic_transit.connectors.snapshot_get_response import SnapshotGetResponse +from ....types.magic_transit.connectors.snapshot_list_response import SnapshotListResponse + +__all__ = ["SnapshotsResource", "AsyncSnapshotsResource"] + + +class SnapshotsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> SnapshotsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return SnapshotsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> SnapshotsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return SnapshotsResourceWithStreamingResponse(self) + + def list( + self, + connector_id: str, + *, + account_id: float, + from_: float, + to: float, + cursor: str | NotGiven = NOT_GIVEN, + limit: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SnapshotListResponse: + """ + List Snapshots + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not connector_id: + raise ValueError(f"Expected a non-empty value for `connector_id` but received {connector_id!r}") + return self._get( + f"/accounts/{account_id}/magic/connectors/{connector_id}/telemetry/snapshots", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "from_": from_, + "to": to, + "cursor": cursor, + "limit": limit, + }, + snapshot_list_params.SnapshotListParams, + ), + post_parser=ResultWrapper[SnapshotListResponse]._unwrapper, + ), + cast_to=cast(Type[SnapshotListResponse], ResultWrapper[SnapshotListResponse]), + ) + + def get( + self, + snapshot_t: float, + *, + account_id: float, + connector_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SnapshotGetResponse: + """ + Get Snapshot + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not connector_id: + raise ValueError(f"Expected a non-empty value for `connector_id` but received {connector_id!r}") + return self._get( + f"/accounts/{account_id}/magic/connectors/{connector_id}/telemetry/snapshots/{snapshot_t}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[SnapshotGetResponse]._unwrapper, + ), + cast_to=cast(Type[SnapshotGetResponse], ResultWrapper[SnapshotGetResponse]), + ) + + +class AsyncSnapshotsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncSnapshotsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncSnapshotsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncSnapshotsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncSnapshotsResourceWithStreamingResponse(self) + + async def list( + self, + connector_id: str, + *, + account_id: float, + from_: float, + to: float, + cursor: str | NotGiven = NOT_GIVEN, + limit: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SnapshotListResponse: + """ + List Snapshots + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not connector_id: + raise ValueError(f"Expected a non-empty value for `connector_id` but received {connector_id!r}") + return await self._get( + f"/accounts/{account_id}/magic/connectors/{connector_id}/telemetry/snapshots", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "from_": from_, + "to": to, + "cursor": cursor, + "limit": limit, + }, + snapshot_list_params.SnapshotListParams, + ), + post_parser=ResultWrapper[SnapshotListResponse]._unwrapper, + ), + cast_to=cast(Type[SnapshotListResponse], ResultWrapper[SnapshotListResponse]), + ) + + async def get( + self, + snapshot_t: float, + *, + account_id: float, + connector_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SnapshotGetResponse: + """ + Get Snapshot + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not connector_id: + raise ValueError(f"Expected a non-empty value for `connector_id` but received {connector_id!r}") + return await self._get( + f"/accounts/{account_id}/magic/connectors/{connector_id}/telemetry/snapshots/{snapshot_t}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[SnapshotGetResponse]._unwrapper, + ), + cast_to=cast(Type[SnapshotGetResponse], ResultWrapper[SnapshotGetResponse]), + ) + + +class SnapshotsResourceWithRawResponse: + def __init__(self, snapshots: SnapshotsResource) -> None: + self._snapshots = snapshots + + self.list = to_raw_response_wrapper( + snapshots.list, + ) + self.get = to_raw_response_wrapper( + snapshots.get, + ) + + +class AsyncSnapshotsResourceWithRawResponse: + def __init__(self, snapshots: AsyncSnapshotsResource) -> None: + self._snapshots = snapshots + + self.list = async_to_raw_response_wrapper( + snapshots.list, + ) + self.get = async_to_raw_response_wrapper( + snapshots.get, + ) + + +class SnapshotsResourceWithStreamingResponse: + def __init__(self, snapshots: SnapshotsResource) -> None: + self._snapshots = snapshots + + self.list = to_streamed_response_wrapper( + snapshots.list, + ) + self.get = to_streamed_response_wrapper( + snapshots.get, + ) + + +class AsyncSnapshotsResourceWithStreamingResponse: + def __init__(self, snapshots: AsyncSnapshotsResource) -> None: + self._snapshots = snapshots + + self.list = async_to_streamed_response_wrapper( + snapshots.list, + ) + self.get = async_to_streamed_response_wrapper( + snapshots.get, + ) diff --git a/src/cloudflare/resources/magic_transit/connectors/telemetry.py b/src/cloudflare/resources/magic_transit/connectors/telemetry.py new file mode 100644 index 00000000000..ebc14f2dd20 --- /dev/null +++ b/src/cloudflare/resources/magic_transit/connectors/telemetry.py @@ -0,0 +1,300 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, cast + +import httpx + +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( + maybe_transform, + async_maybe_transform, +) +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...._wrappers import ResultWrapper +from ...._base_client import make_request_options +from ....types.magic_transit.connectors import telemetry_list_params +from ....types.magic_transit.connectors.telemetry_get_response import TelemetryGetResponse +from ....types.magic_transit.connectors.telemetry_list_response import TelemetryListResponse + +__all__ = ["TelemetryResource", "AsyncTelemetryResource"] + + +class TelemetryResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> TelemetryResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return TelemetryResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> TelemetryResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return TelemetryResourceWithStreamingResponse(self) + + def list( + self, + connector_id: str, + *, + account_id: float, + from_: float, + to: float, + cursor: str | NotGiven = NOT_GIVEN, + limit: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> TelemetryListResponse: + """ + List Events + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not connector_id: + raise ValueError(f"Expected a non-empty value for `connector_id` but received {connector_id!r}") + return self._get( + f"/accounts/{account_id}/magic/connectors/{connector_id}/telemetry/events", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "from_": from_, + "to": to, + "cursor": cursor, + "limit": limit, + }, + telemetry_list_params.TelemetryListParams, + ), + post_parser=ResultWrapper[TelemetryListResponse]._unwrapper, + ), + cast_to=cast(Type[TelemetryListResponse], ResultWrapper[TelemetryListResponse]), + ) + + def get( + self, + event_n: float, + *, + account_id: float, + connector_id: str, + event_t: float, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> TelemetryGetResponse: + """ + Get Event + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not connector_id: + raise ValueError(f"Expected a non-empty value for `connector_id` but received {connector_id!r}") + return self._get( + f"/accounts/{account_id}/magic/connectors/{connector_id}/telemetry/events/{event_t}.{event_n}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[TelemetryGetResponse]._unwrapper, + ), + cast_to=cast(Type[TelemetryGetResponse], ResultWrapper[TelemetryGetResponse]), + ) + + +class AsyncTelemetryResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncTelemetryResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncTelemetryResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncTelemetryResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncTelemetryResourceWithStreamingResponse(self) + + async def list( + self, + connector_id: str, + *, + account_id: float, + from_: float, + to: float, + cursor: str | NotGiven = NOT_GIVEN, + limit: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> TelemetryListResponse: + """ + List Events + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not connector_id: + raise ValueError(f"Expected a non-empty value for `connector_id` but received {connector_id!r}") + return await self._get( + f"/accounts/{account_id}/magic/connectors/{connector_id}/telemetry/events", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "from_": from_, + "to": to, + "cursor": cursor, + "limit": limit, + }, + telemetry_list_params.TelemetryListParams, + ), + post_parser=ResultWrapper[TelemetryListResponse]._unwrapper, + ), + cast_to=cast(Type[TelemetryListResponse], ResultWrapper[TelemetryListResponse]), + ) + + async def get( + self, + event_n: float, + *, + account_id: float, + connector_id: str, + event_t: float, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> TelemetryGetResponse: + """ + Get Event + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not connector_id: + raise ValueError(f"Expected a non-empty value for `connector_id` but received {connector_id!r}") + return await self._get( + f"/accounts/{account_id}/magic/connectors/{connector_id}/telemetry/events/{event_t}.{event_n}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[TelemetryGetResponse]._unwrapper, + ), + cast_to=cast(Type[TelemetryGetResponse], ResultWrapper[TelemetryGetResponse]), + ) + + +class TelemetryResourceWithRawResponse: + def __init__(self, telemetry: TelemetryResource) -> None: + self._telemetry = telemetry + + self.list = to_raw_response_wrapper( + telemetry.list, + ) + self.get = to_raw_response_wrapper( + telemetry.get, + ) + + +class AsyncTelemetryResourceWithRawResponse: + def __init__(self, telemetry: AsyncTelemetryResource) -> None: + self._telemetry = telemetry + + self.list = async_to_raw_response_wrapper( + telemetry.list, + ) + self.get = async_to_raw_response_wrapper( + telemetry.get, + ) + + +class TelemetryResourceWithStreamingResponse: + def __init__(self, telemetry: TelemetryResource) -> None: + self._telemetry = telemetry + + self.list = to_streamed_response_wrapper( + telemetry.list, + ) + self.get = to_streamed_response_wrapper( + telemetry.get, + ) + + +class AsyncTelemetryResourceWithStreamingResponse: + def __init__(self, telemetry: AsyncTelemetryResource) -> None: + self._telemetry = telemetry + + self.list = async_to_streamed_response_wrapper( + telemetry.list, + ) + self.get = async_to_streamed_response_wrapper( + telemetry.get, + ) diff --git a/src/cloudflare/resources/magic_transit/magic_transit.py b/src/cloudflare/resources/magic_transit/magic_transit.py index 45cdcf54510..25525b42650 100644 --- a/src/cloudflare/resources/magic_transit/magic_transit.py +++ b/src/cloudflare/resources/magic_transit/magic_transit.py @@ -19,14 +19,6 @@ AsyncRoutesResourceWithStreamingResponse, ) from ..._compat import cached_property -from .connectors import ( - ConnectorsResource, - AsyncConnectorsResource, - ConnectorsResourceWithRawResponse, - AsyncConnectorsResourceWithRawResponse, - ConnectorsResourceWithStreamingResponse, - AsyncConnectorsResourceWithStreamingResponse, -) from ..._resource import SyncAPIResource, AsyncAPIResource from .gre_tunnels import ( GRETunnelsResource, @@ -68,6 +60,14 @@ CfInterconnectsResourceWithStreamingResponse, AsyncCfInterconnectsResourceWithStreamingResponse, ) +from .connectors.connectors import ( + ConnectorsResource, + AsyncConnectorsResource, + ConnectorsResourceWithRawResponse, + AsyncConnectorsResourceWithRawResponse, + ConnectorsResourceWithStreamingResponse, + AsyncConnectorsResourceWithStreamingResponse, +) __all__ = ["MagicTransitResource", "AsyncMagicTransitResource"] diff --git a/src/cloudflare/types/magic_transit/connectors/__init__.py b/src/cloudflare/types/magic_transit/connectors/__init__.py new file mode 100644 index 00000000000..85e717bb914 --- /dev/null +++ b/src/cloudflare/types/magic_transit/connectors/__init__.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .snapshot_list_params import SnapshotListParams as SnapshotListParams +from .snapshot_get_response import SnapshotGetResponse as SnapshotGetResponse +from .telemetry_list_params import TelemetryListParams as TelemetryListParams +from .snapshot_list_response import SnapshotListResponse as SnapshotListResponse +from .telemetry_get_response import TelemetryGetResponse as TelemetryGetResponse +from .telemetry_list_response import TelemetryListResponse as TelemetryListResponse diff --git a/src/cloudflare/types/magic_transit/connectors/snapshot_get_response.py b/src/cloudflare/types/magic_transit/connectors/snapshot_get_response.py new file mode 100644 index 00000000000..9ac1c74ef8d --- /dev/null +++ b/src/cloudflare/types/magic_transit/connectors/snapshot_get_response.py @@ -0,0 +1,687 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ...._models import BaseModel + +__all__ = ["SnapshotGetResponse", "Disk", "Mount", "Netdev", "Thermal"] + + +class Disk(BaseModel): + in_progress: float + """I/Os currently in progress""" + + major: float + """Device major number""" + + merged: float + """Reads merged""" + + minor: float + """Device minor number""" + + name: str + """Device name""" + + reads: float + """Reads completed successfully""" + + sectors_read: float + """Sectors read successfully""" + + sectors_written: float + """Sectors written successfully""" + + time_in_progress_ms: float + """Time spent doing I/Os (milliseconds)""" + + time_reading_ms: float + """Time spent reading (milliseconds)""" + + time_writing_ms: float + """Time spent writing (milliseconds)""" + + weighted_time_in_progress_ms: float + """Weighted time spent doing I/Os (milliseconds)""" + + writes: float + """Writes completed""" + + writes_merged: float + """Writes merged""" + + connector_id: Optional[str] = None + """Connector identifier""" + + discards: Optional[float] = None + """Discards completed successfully""" + + discards_merged: Optional[float] = None + """Discards merged""" + + flushes: Optional[float] = None + """Flushes completed successfully""" + + sectors_discarded: Optional[float] = None + """Sectors discarded""" + + time_discarding_ms: Optional[float] = None + """Time spent discarding (milliseconds)""" + + time_flushing_ms: Optional[float] = None + """Time spent flushing (milliseconds)""" + + +class Mount(BaseModel): + file_system: str + """File system on disk (EXT4, NTFS, etc.)""" + + kind: str + """Kind of disk (HDD, SSD, etc.)""" + + mount_point: str + """Path where disk is mounted""" + + name: str + """Name of the disk mount""" + + available_bytes: Optional[float] = None + """Available disk size (bytes)""" + + connector_id: Optional[str] = None + """Connector identifier""" + + is_read_only: Optional[bool] = None + """Determines whether the disk is read-only""" + + is_removable: Optional[bool] = None + """Determines whether the disk is removable""" + + total_bytes: Optional[float] = None + """Total disk size (bytes)""" + + +class Netdev(BaseModel): + name: str + """Name of the network device""" + + recv_bytes: float + """Total bytes received""" + + recv_compressed: float + """Compressed packets received""" + + recv_drop: float + """Packets dropped""" + + recv_errs: float + """Bad packets received""" + + recv_fifo: float + """FIFO overruns""" + + recv_frame: float + """Frame alignment errors""" + + recv_multicast: float + """Multicast packets received""" + + recv_packets: float + """Total packets received""" + + sent_bytes: float + """Total bytes transmitted""" + + sent_carrier: float + """Number of packets not sent due to carrier errors""" + + sent_colls: float + """Number of collisions""" + + sent_compressed: float + """Number of compressed packets transmitted""" + + sent_drop: float + """Number of packets dropped during transmission""" + + sent_errs: float + """Number of transmission errors""" + + sent_fifo: float + """FIFO overruns""" + + sent_packets: float + """Total packets transmitted""" + + connector_id: Optional[str] = None + """Connector identifier""" + + +class Thermal(BaseModel): + label: str + """Sensor identifier for the component""" + + connector_id: Optional[str] = None + """Connector identifier""" + + critical_celcius: Optional[float] = None + """Critical failure temperature of the component (degrees Celsius)""" + + current_celcius: Optional[float] = None + """Current temperature of the component (degrees Celsius)""" + + max_celcius: Optional[float] = None + """Maximum temperature of the component (degrees Celsius)""" + + +class SnapshotGetResponse(BaseModel): + count_reclaim_failures: float + """Count of failures to reclaim space""" + + count_reclaimed_paths: float + """Count of reclaimed paths""" + + count_record_failed: float + """Count of failed snapshot recordings""" + + count_transmit_failures: float + """Count of failed snapshot transmissions""" + + t: float + """Time the Snapshot was recorded (seconds since the Unix epoch)""" + + v: str + """Version""" + + cpu_count: Optional[float] = None + """Count of processors/cores""" + + cpu_pressure_10s: Optional[float] = None + """Percentage of time over a 10 second window that tasks were stalled""" + + cpu_pressure_300s: Optional[float] = None + """Percentage of time over a 5 minute window that tasks were stalled""" + + cpu_pressure_60s: Optional[float] = None + """Percentage of time over a 1 minute window that tasks were stalled""" + + cpu_pressure_total_us: Optional[float] = None + """Total stall time (microseconds)""" + + cpu_time_guest_ms: Optional[float] = None + """Time spent running a virtual CPU or guest OS (milliseconds)""" + + cpu_time_guest_nice_ms: Optional[float] = None + """Time spent running a niced guest (milliseconds)""" + + cpu_time_idle_ms: Optional[float] = None + """Time spent in idle state (milliseconds)""" + + cpu_time_iowait_ms: Optional[float] = None + """Time spent wait for I/O to complete (milliseconds)""" + + cpu_time_irq_ms: Optional[float] = None + """Time spent servicing interrupts (milliseconds)""" + + cpu_time_nice_ms: Optional[float] = None + """Time spent in low-priority user mode (milliseconds)""" + + cpu_time_softirq_ms: Optional[float] = None + """Time spent servicing softirqs (milliseconds)""" + + cpu_time_steal_ms: Optional[float] = None + """Time stolen (milliseconds)""" + + cpu_time_system_ms: Optional[float] = None + """Time spent in system mode (milliseconds)""" + + cpu_time_user_ms: Optional[float] = None + """Time spent in user mode (milliseconds)""" + + disks: Optional[List[Disk]] = None + + io_pressure_full_10s: Optional[float] = None + """Percentage of time over a 10 second window that all tasks were stalled""" + + io_pressure_full_300s: Optional[float] = None + """Percentage of time over a 5 minute window that all tasks were stalled""" + + io_pressure_full_60s: Optional[float] = None + """Percentage of time over a 1 minute window that all tasks were stalled""" + + io_pressure_full_total_us: Optional[float] = None + """Total stall time (microseconds)""" + + io_pressure_some_10s: Optional[float] = None + """Percentage of time over a 10 second window that some tasks were stalled""" + + io_pressure_some_300s: Optional[float] = None + """Percentage of time over a 3 minute window that some tasks were stalled""" + + io_pressure_some_60s: Optional[float] = None + """Percentage of time over a 1 minute window that some tasks were stalled""" + + io_pressure_some_total_us: Optional[float] = None + """Total stall time (microseconds)""" + + kernel_btime: Optional[float] = None + """Boot time (seconds since Unix epoch)""" + + kernel_ctxt: Optional[float] = None + """Number of context switches that the system underwent""" + + kernel_processes: Optional[float] = None + """Number of forks since boot""" + + kernel_processes_blocked: Optional[float] = None + """Number of processes blocked waiting for I/O""" + + kernel_processes_running: Optional[float] = None + """Number of processes in runnable state""" + + load_average_15m: Optional[float] = None + """The fifteen-minute load average""" + + load_average_1m: Optional[float] = None + """The one-minute load average""" + + load_average_5m: Optional[float] = None + """The five-minute load average""" + + load_average_cur: Optional[float] = None + """Number of currently runnable kernel scheduling entities""" + + load_average_max: Optional[float] = None + """Number of kernel scheduling entities that currently exist on the system""" + + memory_active_bytes: Optional[float] = None + """Memory that has been used more recently""" + + memory_anon_hugepages_bytes: Optional[float] = None + """Non-file backed huge pages mapped into user-space page tables""" + + memory_anon_pages_bytes: Optional[float] = None + """Non-file backed pages mapped into user-space page tables""" + + memory_available_bytes: Optional[float] = None + """Estimate of how much memory is available for starting new applications""" + + memory_bounce_bytes: Optional[float] = None + """Memory used for block device bounce buffers""" + + memory_buffers_bytes: Optional[float] = None + """Relatively temporary storage for raw disk blocks""" + + memory_cached_bytes: Optional[float] = None + """In-memory cache for files read from the disk""" + + memory_cma_free_bytes: Optional[float] = None + """Free CMA (Contiguous Memory Allocator) pages""" + + memory_cma_total_bytes: Optional[float] = None + """Total CMA (Contiguous Memory Allocator) pages""" + + memory_commit_limit_bytes: Optional[float] = None + """Total amount of memory currently available to be allocated on the system""" + + memory_committed_as_bytes: Optional[float] = None + """Amount of memory presently allocated on the system""" + + memory_dirty_bytes: Optional[float] = None + """Memory which is waiting to get written back to the disk""" + + memory_free_bytes: Optional[float] = None + """The sum of LowFree and HighFree""" + + memory_high_free_bytes: Optional[float] = None + """Amount of free highmem""" + + memory_high_total_bytes: Optional[float] = None + """Total amount of highmem""" + + memory_hugepages_free: Optional[float] = None + """The number of huge pages in the pool that are not yet allocated""" + + memory_hugepages_rsvd: Optional[float] = None + """ + Number of huge pages for which a commitment has been made, but no allocation has + yet been made + """ + + memory_hugepages_surp: Optional[float] = None + """Number of huge pages in the pool above the threshold""" + + memory_hugepages_total: Optional[float] = None + """The size of the pool of huge pages""" + + memory_hugepagesize_bytes: Optional[float] = None + """The size of huge pages""" + + memory_inactive_bytes: Optional[float] = None + """Memory which has been less recently used""" + + memory_k_reclaimable_bytes: Optional[float] = None + """ + Kernel allocations that the kernel will attempt to reclaim under memory pressure + """ + + memory_kernel_stack_bytes: Optional[float] = None + """Amount of memory allocated to kernel stacks""" + + memory_low_free_bytes: Optional[float] = None + """Amount of free lowmem""" + + memory_low_total_bytes: Optional[float] = None + """Total amount of lowmem""" + + memory_mapped_bytes: Optional[float] = None + """Files which have been mapped into memory""" + + memory_page_tables_bytes: Optional[float] = None + """Amount of memory dedicated to the lowest level of page tables""" + + memory_per_cpu_bytes: Optional[float] = None + """Memory allocated to the per-cpu alloctor used to back per-cpu allocations""" + + memory_pressure_full_10s: Optional[float] = None + """Percentage of time over a 10 second window that all tasks were stalled""" + + memory_pressure_full_300s: Optional[float] = None + """Percentage of time over a 5 minute window that all tasks were stalled""" + + memory_pressure_full_60s: Optional[float] = None + """Percentage of time over a 1 minute window that all tasks were stalled""" + + memory_pressure_full_total_us: Optional[float] = None + """Total stall time (microseconds)""" + + memory_pressure_some_10s: Optional[float] = None + """Percentage of time over a 10 second window that some tasks were stalled""" + + memory_pressure_some_300s: Optional[float] = None + """Percentage of time over a 5 minute window that some tasks were stalled""" + + memory_pressure_some_60s: Optional[float] = None + """Percentage of time over a 1 minute window that some tasks were stalled""" + + memory_pressure_some_total_us: Optional[float] = None + """Total stall time (microseconds)""" + + memory_s_reclaimable_bytes: Optional[float] = None + """Part of slab that can be reclaimed on memory pressure""" + + memory_s_unreclaim_bytes: Optional[float] = None + """Part of slab that cannot be reclaimed on memory pressure""" + + memory_secondary_page_tables_bytes: Optional[float] = None + """Amount of memory dedicated to the lowest level of page tables""" + + memory_shmem_bytes: Optional[float] = None + """Amount of memory consumed by tmpfs""" + + memory_shmem_hugepages_bytes: Optional[float] = None + """Memory used by shmem and tmpfs, allocated with huge pages""" + + memory_shmem_pmd_mapped_bytes: Optional[float] = None + """Shared memory mapped into user space with huge pages""" + + memory_slab_bytes: Optional[float] = None + """In-kernel data structures cache""" + + memory_swap_cached_bytes: Optional[float] = None + """Memory swapped out and back in while still in swap file""" + + memory_swap_free_bytes: Optional[float] = None + """Amount of swap space that is currently unused""" + + memory_swap_total_bytes: Optional[float] = None + """Total amount of swap space available""" + + memory_total_bytes: Optional[float] = None + """Total usable RAM""" + + memory_vmalloc_chunk_bytes: Optional[float] = None + """Largest contiguous block of vmalloc area which is free""" + + memory_vmalloc_total_bytes: Optional[float] = None + """Total size of vmalloc memory area""" + + memory_vmalloc_used_bytes: Optional[float] = None + """Amount of vmalloc area which is used""" + + memory_writeback_bytes: Optional[float] = None + """Memory which is actively being written back to the disk""" + + memory_writeback_tmp_bytes: Optional[float] = None + """Memory used by FUSE for temporary writeback buffers""" + + memory_z_swap_bytes: Optional[float] = None + """Memory consumed by the zswap backend, compressed""" + + memory_z_swapped_bytes: Optional[float] = None + """Amount of anonymous memory stored in zswap, uncompressed""" + + mounts: Optional[List[Mount]] = None + + netdevs: Optional[List[Netdev]] = None + + snmp_icmp_in_addr_mask_reps: Optional[float] = None + """Number of ICMP Address Mask Reply messages received""" + + snmp_icmp_in_addr_masks: Optional[float] = None + """Number of ICMP Address Mask Request messages received""" + + snmp_icmp_in_csum_errors: Optional[float] = None + """Number of ICMP messages received with bad checksums""" + + snmp_icmp_in_dest_unreachs: Optional[float] = None + """Number of ICMP Destination Unreachable messages received""" + + snmp_icmp_in_echo_reps: Optional[float] = None + """Number of ICMP Echo Reply messages received""" + + snmp_icmp_in_echos: Optional[float] = None + """Number of ICMP Echo (request) messages received""" + + snmp_icmp_in_errors: Optional[float] = None + """Number of ICMP messages received with ICMP-specific errors""" + + snmp_icmp_in_msgs: Optional[float] = None + """Number of ICMP messages received""" + + snmp_icmp_in_parm_probs: Optional[float] = None + """Number of ICMP Parameter Problem messages received""" + + snmp_icmp_in_redirects: Optional[float] = None + """Number of ICMP Redirect messages received""" + + snmp_icmp_in_src_quenchs: Optional[float] = None + """Number of ICMP Source Quench messages received""" + + snmp_icmp_in_time_excds: Optional[float] = None + """Number of ICMP Time Exceeded messages received""" + + snmp_icmp_in_timestamp_reps: Optional[float] = None + """Number of ICMP Address Mask Request messages received""" + + snmp_icmp_in_timestamps: Optional[float] = None + """Number of ICMP Timestamp (request) messages received""" + + snmp_icmp_out_addr_mask_reps: Optional[float] = None + """Number of ICMP Address Mask Reply messages sent""" + + snmp_icmp_out_addr_masks: Optional[float] = None + """Number of ICMP Address Mask Request messages sent""" + + snmp_icmp_out_dest_unreachs: Optional[float] = None + """Number of ICMP Destination Unreachable messages sent""" + + snmp_icmp_out_echo_reps: Optional[float] = None + """Number of ICMP Echo Reply messages sent""" + + snmp_icmp_out_echos: Optional[float] = None + """Number of ICMP Echo (request) messages sent""" + + snmp_icmp_out_errors: Optional[float] = None + """ + Number of ICMP messages which this entity did not send due to ICMP-specific + errors + """ + + snmp_icmp_out_msgs: Optional[float] = None + """Number of ICMP messages attempted to send""" + + snmp_icmp_out_parm_probs: Optional[float] = None + """Number of ICMP Parameter Problem messages sent""" + + snmp_icmp_out_redirects: Optional[float] = None + """Number of ICMP Redirect messages sent""" + + snmp_icmp_out_src_quenchs: Optional[float] = None + """Number of ICMP Source Quench messages sent""" + + snmp_icmp_out_time_excds: Optional[float] = None + """Number of ICMP Time Exceeded messages sent""" + + snmp_icmp_out_timestamp_reps: Optional[float] = None + """Number of ICMP Timestamp Reply messages sent""" + + snmp_icmp_out_timestamps: Optional[float] = None + """Number of ICMP Timestamp (request) messages sent""" + + snmp_ip_default_ttl: Optional[float] = None + """Default value of the Time-To-Live field of the IP header""" + + snmp_ip_forw_datagrams: Optional[float] = None + """Number of datagrams forwarded to their final destination""" + + snmp_ip_forwarding_enabled: Optional[bool] = None + """Set when acting as an IP gateway""" + + snmp_ip_frag_creates: Optional[float] = None + """Number of datagrams generated by fragmentation""" + + snmp_ip_frag_fails: Optional[float] = None + """Number of datagrams discarded because fragmentation failed""" + + snmp_ip_frag_oks: Optional[float] = None + """Number of datagrams successfully fragmented""" + + snmp_ip_in_addr_errors: Optional[float] = None + """Number of input datagrams discarded due to errors in the IP address""" + + snmp_ip_in_delivers: Optional[float] = None + """Number of input datagrams successfully delivered to IP user-protocols""" + + snmp_ip_in_discards: Optional[float] = None + """Number of input datagrams otherwise discarded""" + + snmp_ip_in_hdr_errors: Optional[float] = None + """Number of input datagrams discarded due to errors in the IP header""" + + snmp_ip_in_receives: Optional[float] = None + """Number of input datagrams received from interfaces""" + + snmp_ip_in_unknown_protos: Optional[float] = None + """Number of input datagrams discarded due unknown or unsupported protocol""" + + snmp_ip_out_discards: Optional[float] = None + """Number of output datagrams otherwise discarded""" + + snmp_ip_out_no_routes: Optional[float] = None + """Number of output datagrams discarded because no route matched""" + + snmp_ip_out_requests: Optional[float] = None + """Number of datagrams supplied for transmission""" + + snmp_ip_reasm_fails: Optional[float] = None + """Number of failures detected by the reassembly algorithm""" + + snmp_ip_reasm_oks: Optional[float] = None + """Number of datagrams successfully reassembled""" + + snmp_ip_reasm_reqds: Optional[float] = None + """Number of fragments received which needed to be reassembled""" + + snmp_ip_reasm_timeout: Optional[float] = None + """Number of seconds fragments are held while awaiting reassembly""" + + snmp_tcp_active_opens: Optional[float] = None + """Number of times TCP transitions to SYN-SENT from CLOSED""" + + snmp_tcp_attempt_fails: Optional[float] = None + """ + Number of times TCP transitions to CLOSED from SYN-SENT or SYN-RCVD, plus + transitions to LISTEN from SYN-RCVD + """ + + snmp_tcp_curr_estab: Optional[float] = None + """Number of TCP connections in ESTABLISHED or CLOSE-WAIT""" + + snmp_tcp_estab_resets: Optional[float] = None + """Number of times TCP transitions to CLOSED from ESTABLISHED or CLOSE-WAIT""" + + snmp_tcp_in_csum_errors: Optional[float] = None + """Number of TCP segments received with checksum errors""" + + snmp_tcp_in_errs: Optional[float] = None + """Number of TCP segments received in error""" + + snmp_tcp_in_segs: Optional[float] = None + """Number of TCP segments received""" + + snmp_tcp_max_conn: Optional[float] = None + """Limit on the total number of TCP connections""" + + snmp_tcp_out_rsts: Optional[float] = None + """Number of TCP segments sent with RST flag""" + + snmp_tcp_out_segs: Optional[float] = None + """Number of TCP segments sent""" + + snmp_tcp_passive_opens: Optional[float] = None + """Number of times TCP transitions to SYN-RCVD from LISTEN""" + + snmp_tcp_retrans_segs: Optional[float] = None + """Number of TCP segments retransmitted""" + + snmp_tcp_rto_max: Optional[float] = None + """ + Maximum value permitted by a TCP implementation for the retransmission timeout + (milliseconds) + """ + + snmp_tcp_rto_min: Optional[float] = None + """ + Minimum value permitted by a TCP implementation for the retransmission timeout + (milliseconds) + """ + + snmp_udp_in_datagrams: Optional[float] = None + """Number of UDP datagrams delivered to UDP applications""" + + snmp_udp_in_errors: Optional[float] = None + """ + Number of UDP datagrams failed to be delivered for reasons other than lack of + application at the destination port + """ + + snmp_udp_no_ports: Optional[float] = None + """ + Number of UDP datagrams received for which there was not application at the + destination port + """ + + snmp_udp_out_datagrams: Optional[float] = None + """Number of UDP datagrams sent""" + + system_boot_time_s: Optional[float] = None + """Boottime of the system (seconds since the Unix epoch)""" + + thermals: Optional[List[Thermal]] = None + + uptime_idle_ms: Optional[float] = None + """Sum of how much time each core has spent idle""" + + uptime_total_ms: Optional[float] = None + """Uptime of the system, including time spent in suspend""" diff --git a/src/cloudflare/types/magic_transit/connectors/snapshot_list_params.py b/src/cloudflare/types/magic_transit/connectors/snapshot_list_params.py new file mode 100644 index 00000000000..89b4547c722 --- /dev/null +++ b/src/cloudflare/types/magic_transit/connectors/snapshot_list_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ...._utils import PropertyInfo + +__all__ = ["SnapshotListParams"] + + +class SnapshotListParams(TypedDict, total=False): + account_id: Required[float] + + from_: Required[Annotated[float, PropertyInfo(alias="from")]] + + to: Required[float] + + cursor: str + + limit: float diff --git a/src/cloudflare/types/magic_transit/connectors/snapshot_list_response.py b/src/cloudflare/types/magic_transit/connectors/snapshot_list_response.py new file mode 100644 index 00000000000..5c26f94cfb5 --- /dev/null +++ b/src/cloudflare/types/magic_transit/connectors/snapshot_list_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ...._models import BaseModel + +__all__ = ["SnapshotListResponse", "Item"] + + +class Item(BaseModel): + a: float + """Time the Snapshot was collected (seconds since the Unix epoch)""" + + t: float + """Time the Snapshot was recorded (seconds since the Unix epoch)""" + + +class SnapshotListResponse(BaseModel): + count: float + + items: List[Item] + + cursor: Optional[str] = None diff --git a/src/cloudflare/types/magic_transit/connectors/telemetry_get_response.py b/src/cloudflare/types/magic_transit/connectors/telemetry_get_response.py new file mode 100644 index 00000000000..9a344dfec74 --- /dev/null +++ b/src/cloudflare/types/magic_transit/connectors/telemetry_get_response.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import Literal, TypeAlias + +from ...._models import BaseModel + +__all__ = ["TelemetryGetResponse", "E", "EK", "EUnionMember8"] + + +class EK(BaseModel): + k: Literal["Init"] + """Initialized process""" + + +class EUnionMember8(BaseModel): + k: Literal["StartUpgrade"] + """Started upgrade""" + + url: str + """Location of upgrade bundle""" + + +E: TypeAlias = Union[EK, EK, EK, EK, EK, EK, EK, EK, EUnionMember8, EK, EK, EK, EK] + + +class TelemetryGetResponse(BaseModel): + e: E + + n: float + """Sequence number, used to order events with the same timestamp""" + + t: float + """Time the Event was recorded (seconds since the Unix epoch)""" diff --git a/src/cloudflare/types/magic_transit/connectors/telemetry_list_params.py b/src/cloudflare/types/magic_transit/connectors/telemetry_list_params.py new file mode 100644 index 00000000000..07460db26b4 --- /dev/null +++ b/src/cloudflare/types/magic_transit/connectors/telemetry_list_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ...._utils import PropertyInfo + +__all__ = ["TelemetryListParams"] + + +class TelemetryListParams(TypedDict, total=False): + account_id: Required[float] + + from_: Required[Annotated[float, PropertyInfo(alias="from")]] + + to: Required[float] + + cursor: str + + limit: float diff --git a/src/cloudflare/types/magic_transit/connectors/telemetry_list_response.py b/src/cloudflare/types/magic_transit/connectors/telemetry_list_response.py new file mode 100644 index 00000000000..59669be4a4f --- /dev/null +++ b/src/cloudflare/types/magic_transit/connectors/telemetry_list_response.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ...._models import BaseModel + +__all__ = ["TelemetryListResponse", "Item"] + + +class Item(BaseModel): + a: float + """Time the Event was collected (seconds since the Unix epoch)""" + + k: str + """Kind""" + + n: float + """Sequence number, used to order events with the same timestamp""" + + t: float + """Time the Event was recorded (seconds since the Unix epoch)""" + + +class TelemetryListResponse(BaseModel): + count: float + + items: List[Item] + + cursor: Optional[str] = None diff --git a/tests/api_resources/magic_transit/connectors/__init__.py b/tests/api_resources/magic_transit/connectors/__init__.py new file mode 100644 index 00000000000..fd8019a9a1a --- /dev/null +++ b/tests/api_resources/magic_transit/connectors/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/magic_transit/connectors/test_snapshots.py b/tests/api_resources/magic_transit/connectors/test_snapshots.py new file mode 100644 index 00000000000..ca3ac201824 --- /dev/null +++ b/tests/api_resources/magic_transit/connectors/test_snapshots.py @@ -0,0 +1,238 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.magic_transit.connectors import SnapshotGetResponse, SnapshotListResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestSnapshots: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + snapshot = client.magic_transit.connectors.snapshots.list( + connector_id="connector_id", + account_id=0, + from_=0, + to=0, + ) + assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + snapshot = client.magic_transit.connectors.snapshots.list( + connector_id="connector_id", + account_id=0, + from_=0, + to=0, + cursor="cursor", + limit=0, + ) + assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.magic_transit.connectors.snapshots.with_raw_response.list( + connector_id="connector_id", + account_id=0, + from_=0, + to=0, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + snapshot = response.parse() + assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.magic_transit.connectors.snapshots.with_streaming_response.list( + connector_id="connector_id", + account_id=0, + from_=0, + to=0, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + snapshot = response.parse() + assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `connector_id` but received ''"): + client.magic_transit.connectors.snapshots.with_raw_response.list( + connector_id="", + account_id=0, + from_=0, + to=0, + ) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + snapshot = client.magic_transit.connectors.snapshots.get( + snapshot_t=0, + account_id=0, + connector_id="connector_id", + ) + assert_matches_type(SnapshotGetResponse, snapshot, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.magic_transit.connectors.snapshots.with_raw_response.get( + snapshot_t=0, + account_id=0, + connector_id="connector_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + snapshot = response.parse() + assert_matches_type(SnapshotGetResponse, snapshot, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.magic_transit.connectors.snapshots.with_streaming_response.get( + snapshot_t=0, + account_id=0, + connector_id="connector_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + snapshot = response.parse() + assert_matches_type(SnapshotGetResponse, snapshot, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `connector_id` but received ''"): + client.magic_transit.connectors.snapshots.with_raw_response.get( + snapshot_t=0, + account_id=0, + connector_id="", + ) + + +class TestAsyncSnapshots: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + snapshot = await async_client.magic_transit.connectors.snapshots.list( + connector_id="connector_id", + account_id=0, + from_=0, + to=0, + ) + assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + snapshot = await async_client.magic_transit.connectors.snapshots.list( + connector_id="connector_id", + account_id=0, + from_=0, + to=0, + cursor="cursor", + limit=0, + ) + assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.magic_transit.connectors.snapshots.with_raw_response.list( + connector_id="connector_id", + account_id=0, + from_=0, + to=0, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + snapshot = await response.parse() + assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.magic_transit.connectors.snapshots.with_streaming_response.list( + connector_id="connector_id", + account_id=0, + from_=0, + to=0, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + snapshot = await response.parse() + assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `connector_id` but received ''"): + await async_client.magic_transit.connectors.snapshots.with_raw_response.list( + connector_id="", + account_id=0, + from_=0, + to=0, + ) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + snapshot = await async_client.magic_transit.connectors.snapshots.get( + snapshot_t=0, + account_id=0, + connector_id="connector_id", + ) + assert_matches_type(SnapshotGetResponse, snapshot, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.magic_transit.connectors.snapshots.with_raw_response.get( + snapshot_t=0, + account_id=0, + connector_id="connector_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + snapshot = await response.parse() + assert_matches_type(SnapshotGetResponse, snapshot, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.magic_transit.connectors.snapshots.with_streaming_response.get( + snapshot_t=0, + account_id=0, + connector_id="connector_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + snapshot = await response.parse() + assert_matches_type(SnapshotGetResponse, snapshot, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `connector_id` but received ''"): + await async_client.magic_transit.connectors.snapshots.with_raw_response.get( + snapshot_t=0, + account_id=0, + connector_id="", + ) diff --git a/tests/api_resources/magic_transit/connectors/test_telemetry.py b/tests/api_resources/magic_transit/connectors/test_telemetry.py new file mode 100644 index 00000000000..4fa3d3dda27 --- /dev/null +++ b/tests/api_resources/magic_transit/connectors/test_telemetry.py @@ -0,0 +1,246 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.magic_transit.connectors import TelemetryGetResponse, TelemetryListResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestTelemetry: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + telemetry = client.magic_transit.connectors.telemetry.list( + connector_id="connector_id", + account_id=0, + from_=0, + to=0, + ) + assert_matches_type(TelemetryListResponse, telemetry, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + telemetry = client.magic_transit.connectors.telemetry.list( + connector_id="connector_id", + account_id=0, + from_=0, + to=0, + cursor="cursor", + limit=0, + ) + assert_matches_type(TelemetryListResponse, telemetry, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.magic_transit.connectors.telemetry.with_raw_response.list( + connector_id="connector_id", + account_id=0, + from_=0, + to=0, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + telemetry = response.parse() + assert_matches_type(TelemetryListResponse, telemetry, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.magic_transit.connectors.telemetry.with_streaming_response.list( + connector_id="connector_id", + account_id=0, + from_=0, + to=0, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + telemetry = response.parse() + assert_matches_type(TelemetryListResponse, telemetry, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `connector_id` but received ''"): + client.magic_transit.connectors.telemetry.with_raw_response.list( + connector_id="", + account_id=0, + from_=0, + to=0, + ) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + telemetry = client.magic_transit.connectors.telemetry.get( + event_n=0, + account_id=0, + connector_id="connector_id", + event_t=0, + ) + assert_matches_type(TelemetryGetResponse, telemetry, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.magic_transit.connectors.telemetry.with_raw_response.get( + event_n=0, + account_id=0, + connector_id="connector_id", + event_t=0, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + telemetry = response.parse() + assert_matches_type(TelemetryGetResponse, telemetry, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.magic_transit.connectors.telemetry.with_streaming_response.get( + event_n=0, + account_id=0, + connector_id="connector_id", + event_t=0, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + telemetry = response.parse() + assert_matches_type(TelemetryGetResponse, telemetry, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `connector_id` but received ''"): + client.magic_transit.connectors.telemetry.with_raw_response.get( + event_n=0, + account_id=0, + connector_id="", + event_t=0, + ) + + +class TestAsyncTelemetry: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + telemetry = await async_client.magic_transit.connectors.telemetry.list( + connector_id="connector_id", + account_id=0, + from_=0, + to=0, + ) + assert_matches_type(TelemetryListResponse, telemetry, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + telemetry = await async_client.magic_transit.connectors.telemetry.list( + connector_id="connector_id", + account_id=0, + from_=0, + to=0, + cursor="cursor", + limit=0, + ) + assert_matches_type(TelemetryListResponse, telemetry, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.magic_transit.connectors.telemetry.with_raw_response.list( + connector_id="connector_id", + account_id=0, + from_=0, + to=0, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + telemetry = await response.parse() + assert_matches_type(TelemetryListResponse, telemetry, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.magic_transit.connectors.telemetry.with_streaming_response.list( + connector_id="connector_id", + account_id=0, + from_=0, + to=0, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + telemetry = await response.parse() + assert_matches_type(TelemetryListResponse, telemetry, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `connector_id` but received ''"): + await async_client.magic_transit.connectors.telemetry.with_raw_response.list( + connector_id="", + account_id=0, + from_=0, + to=0, + ) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + telemetry = await async_client.magic_transit.connectors.telemetry.get( + event_n=0, + account_id=0, + connector_id="connector_id", + event_t=0, + ) + assert_matches_type(TelemetryGetResponse, telemetry, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.magic_transit.connectors.telemetry.with_raw_response.get( + event_n=0, + account_id=0, + connector_id="connector_id", + event_t=0, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + telemetry = await response.parse() + assert_matches_type(TelemetryGetResponse, telemetry, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.magic_transit.connectors.telemetry.with_streaming_response.get( + event_n=0, + account_id=0, + connector_id="connector_id", + event_t=0, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + telemetry = await response.parse() + assert_matches_type(TelemetryGetResponse, telemetry, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `connector_id` but received ''"): + await async_client.magic_transit.connectors.telemetry.with_raw_response.get( + event_n=0, + account_id=0, + connector_id="", + event_t=0, + ) From bd30260cd96b03995766f99bd95a384c72d62cfb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 23:27:35 +0000 Subject: [PATCH 220/358] feat(firewall_rules): remove duplicated `id` query parameter (#2462) --- .stats.yml | 2 +- api.md | 2 +- src/cloudflare/resources/firewall/rules.py | 9 -------- src/cloudflare/types/firewall/__init__.py | 1 - .../types/firewall/rule_get_params.py | 15 ------------- tests/api_resources/firewall/test_rules.py | 22 ------------------- 6 files changed, 2 insertions(+), 49 deletions(-) delete mode 100644 src/cloudflare/types/firewall/rule_get_params.py diff --git a/.stats.yml b/.stats.yml index 0249b6a6d9b..f65d91bc5d2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-098958c3d34c1f726db27a49f075f6e8e2c9204777a0a5d6aa49ca54fc803022.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9dd75607c8f8757910cfc7d638e1f86926406f5ea76219c4c3f9afa00eee83bb.yml diff --git a/api.md b/api.md index 72cd5024178..781f229040f 100644 --- a/api.md +++ b/api.md @@ -1668,7 +1668,7 @@ Methods: - client.firewall.rules.bulk_edit(\*, zone_id, \*\*params) -> SyncSinglePage[FirewallRule] - client.firewall.rules.bulk_update(\*, zone_id, \*\*params) -> SyncSinglePage[FirewallRule] - client.firewall.rules.edit(rule_id, \*, zone_id) -> SyncSinglePage[FirewallRule] -- client.firewall.rules.get(rule_id, \*, zone_id, \*\*params) -> FirewallRule +- client.firewall.rules.get(rule_id, \*, zone_id) -> FirewallRule ## AccessRules diff --git a/src/cloudflare/resources/firewall/rules.py b/src/cloudflare/resources/firewall/rules.py index d0f3bc77822..fe76093e6b7 100644 --- a/src/cloudflare/resources/firewall/rules.py +++ b/src/cloudflare/resources/firewall/rules.py @@ -24,7 +24,6 @@ from ...pagination import SyncSinglePage, AsyncSinglePage, SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ..._base_client import AsyncPaginator, make_request_options from ...types.firewall import ( - rule_get_params, rule_list_params, rule_create_params, rule_update_params, @@ -465,7 +464,6 @@ def get( rule_id: str, *, zone_id: str, - id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -481,8 +479,6 @@ def get( rule_id: The unique identifier of the firewall rule. - id: The unique identifier of the firewall rule. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -502,7 +498,6 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=maybe_transform({"id": id}, rule_get_params.RuleGetParams), post_parser=ResultWrapper[FirewallRule]._unwrapper, ), cast_to=cast(Type[FirewallRule], ResultWrapper[FirewallRule]), @@ -937,7 +932,6 @@ async def get( rule_id: str, *, zone_id: str, - id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -953,8 +947,6 @@ async def get( rule_id: The unique identifier of the firewall rule. - id: The unique identifier of the firewall rule. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -974,7 +966,6 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform({"id": id}, rule_get_params.RuleGetParams), post_parser=ResultWrapper[FirewallRule]._unwrapper, ), cast_to=cast(Type[FirewallRule], ResultWrapper[FirewallRule]), diff --git a/src/cloudflare/types/firewall/__init__.py b/src/cloudflare/types/firewall/__init__.py index 63d1a171785..bf8211b7fcf 100644 --- a/src/cloudflare/types/firewall/__init__.py +++ b/src/cloudflare/types/firewall/__init__.py @@ -8,7 +8,6 @@ from .configuration import Configuration as Configuration from .firewall_rule import FirewallRule as FirewallRule from .deleted_filter import DeletedFilter as DeletedFilter -from .rule_get_params import RuleGetParams as RuleGetParams from .rule_list_params import RuleListParams as RuleListParams from .asn_configuration import ASNConfiguration as ASNConfiguration from .ipv6_configuration import IPV6Configuration as IPV6Configuration diff --git a/src/cloudflare/types/firewall/rule_get_params.py b/src/cloudflare/types/firewall/rule_get_params.py deleted file mode 100644 index 6dff4946cc7..00000000000 --- a/src/cloudflare/types/firewall/rule_get_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["RuleGetParams"] - - -class RuleGetParams(TypedDict, total=False): - zone_id: Required[str] - """Identifier""" - - id: str - """The unique identifier of the firewall rule.""" diff --git a/tests/api_resources/firewall/test_rules.py b/tests/api_resources/firewall/test_rules.py index f33337a9a24..d6f4f9905e5 100644 --- a/tests/api_resources/firewall/test_rules.py +++ b/tests/api_resources/firewall/test_rules.py @@ -520,17 +520,6 @@ def test_method_get(self, client: Cloudflare) -> None: assert_matches_type(FirewallRule, rule, path=["response"]) - @parametrize - def test_method_get_with_all_params(self, client: Cloudflare) -> None: - with pytest.warns(DeprecationWarning): - rule = client.firewall.rules.get( - rule_id="372e67954025e0ba6aaa6d586b9e0b60", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="372e67954025e0ba6aaa6d586b9e0b60", - ) - - assert_matches_type(FirewallRule, rule, path=["response"]) - @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: with pytest.warns(DeprecationWarning): @@ -1076,17 +1065,6 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: assert_matches_type(FirewallRule, rule, path=["response"]) - @parametrize - async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: - with pytest.warns(DeprecationWarning): - rule = await async_client.firewall.rules.get( - rule_id="372e67954025e0ba6aaa6d586b9e0b60", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - id="372e67954025e0ba6aaa6d586b9e0b60", - ) - - assert_matches_type(FirewallRule, rule, path=["response"]) - @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: with pytest.warns(DeprecationWarning): From b85440a175b26ccc47ba238843a80bb8f286c159 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 06:13:01 +0000 Subject: [PATCH 221/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index f65d91bc5d2..22a1734a30a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9dd75607c8f8757910cfc7d638e1f86926406f5ea76219c4c3f9afa00eee83bb.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-15dc17b09098f1f0cff16aeb3ba7a85728da54893d149d10f684eafdd9a89671.yml From a9188fcc5d17500396e4aeaf27cb4b6303bd6a08 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 10:49:03 +0000 Subject: [PATCH 222/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 22a1734a30a..f65d91bc5d2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-15dc17b09098f1f0cff16aeb3ba7a85728da54893d149d10f684eafdd9a89671.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9dd75607c8f8757910cfc7d638e1f86926406f5ea76219c4c3f9afa00eee83bb.yml From d49a36a05475760c9c58982aa4b57ef23258090b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 12:39:57 +0000 Subject: [PATCH 223/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index f65d91bc5d2..22a1734a30a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9dd75607c8f8757910cfc7d638e1f86926406f5ea76219c4c3f9afa00eee83bb.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-15dc17b09098f1f0cff16aeb3ba7a85728da54893d149d10f684eafdd9a89671.yml From 8a0e56351d4861f9de8093e18032fc146eff1fbb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 15:23:34 +0000 Subject: [PATCH 224/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 22a1734a30a..f65d91bc5d2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-15dc17b09098f1f0cff16aeb3ba7a85728da54893d149d10f684eafdd9a89671.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9dd75607c8f8757910cfc7d638e1f86926406f5ea76219c4c3f9afa00eee83bb.yml From eae9e64f2b06e3d8c83566ae0a2e6c5bb71c882c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 18:20:41 +0000 Subject: [PATCH 225/358] feat(api): api update (#2463) --- .stats.yml | 2 +- .../types/zero_trust/dlp/entry_get_response.py | 6 +++--- .../zero_trust/dlp/entry_list_response.py | 6 +++--- .../zero_trust/dlp/entry_update_response.py | 6 +++--- src/cloudflare/types/zero_trust/dlp/profile.py | 18 +++++++++--------- .../dlp/profiles/custom_create_response.py | 18 +++++++++--------- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.stats.yml b/.stats.yml index f65d91bc5d2..2982b0f4706 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9dd75607c8f8757910cfc7d638e1f86926406f5ea76219c4c3f9afa00eee83bb.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-129da52f8749b26071ec96ee50527d2bd29145ef6b9747171fe02034356b7b4b.yml diff --git a/src/cloudflare/types/zero_trust/dlp/entry_get_response.py b/src/cloudflare/types/zero_trust/dlp/entry_get_response.py index fa0a4958b5b..f4e8524bcd9 100644 --- a/src/cloudflare/types/zero_trust/dlp/entry_get_response.py +++ b/src/cloudflare/types/zero_trust/dlp/entry_get_response.py @@ -38,12 +38,12 @@ class CustomEntry(BaseModel): class PredefinedEntryConfidence(BaseModel): ai_context_available: bool + """Indicates whether this entry has AI remote service validation""" available: bool """ - Indicates whether this entry can be made more or less sensitive by setting a - confidence threshold. Profiles that use an entry with `available` set to true - can use confidence thresholds + Indicates whether this entry has any form of validation that is not an AI remote + service """ diff --git a/src/cloudflare/types/zero_trust/dlp/entry_list_response.py b/src/cloudflare/types/zero_trust/dlp/entry_list_response.py index ebb18ace220..73e91f5f40c 100644 --- a/src/cloudflare/types/zero_trust/dlp/entry_list_response.py +++ b/src/cloudflare/types/zero_trust/dlp/entry_list_response.py @@ -38,12 +38,12 @@ class CustomEntry(BaseModel): class PredefinedEntryConfidence(BaseModel): ai_context_available: bool + """Indicates whether this entry has AI remote service validation""" available: bool """ - Indicates whether this entry can be made more or less sensitive by setting a - confidence threshold. Profiles that use an entry with `available` set to true - can use confidence thresholds + Indicates whether this entry has any form of validation that is not an AI remote + service """ diff --git a/src/cloudflare/types/zero_trust/dlp/entry_update_response.py b/src/cloudflare/types/zero_trust/dlp/entry_update_response.py index c35ef9a00a3..9cb5928af74 100644 --- a/src/cloudflare/types/zero_trust/dlp/entry_update_response.py +++ b/src/cloudflare/types/zero_trust/dlp/entry_update_response.py @@ -38,12 +38,12 @@ class CustomEntry(BaseModel): class PredefinedEntryConfidence(BaseModel): ai_context_available: bool + """Indicates whether this entry has AI remote service validation""" available: bool """ - Indicates whether this entry can be made more or less sensitive by setting a - confidence threshold. Profiles that use an entry with `available` set to true - can use confidence thresholds + Indicates whether this entry has any form of validation that is not an AI remote + service """ diff --git a/src/cloudflare/types/zero_trust/dlp/profile.py b/src/cloudflare/types/zero_trust/dlp/profile.py index ad31b65a016..db86e9f59de 100644 --- a/src/cloudflare/types/zero_trust/dlp/profile.py +++ b/src/cloudflare/types/zero_trust/dlp/profile.py @@ -58,12 +58,12 @@ class CustomProfileEntryCustomEntry(BaseModel): class CustomProfileEntryPredefinedEntryConfidence(BaseModel): ai_context_available: bool + """Indicates whether this entry has AI remote service validation""" available: bool """ - Indicates whether this entry can be made more or less sensitive by setting a - confidence threshold. Profiles that use an entry with `available` set to true - can use confidence thresholds + Indicates whether this entry has any form of validation that is not an AI remote + service """ @@ -196,12 +196,12 @@ class PredefinedProfileEntryCustomEntry(BaseModel): class PredefinedProfileEntryPredefinedEntryConfidence(BaseModel): ai_context_available: bool + """Indicates whether this entry has AI remote service validation""" available: bool """ - Indicates whether this entry can be made more or less sensitive by setting a - confidence threshold. Profiles that use an entry with `available` set to true - can use confidence thresholds + Indicates whether this entry has any form of validation that is not an AI remote + service """ @@ -327,12 +327,12 @@ class IntegrationProfileEntryCustomEntry(BaseModel): class IntegrationProfileEntryPredefinedEntryConfidence(BaseModel): ai_context_available: bool + """Indicates whether this entry has AI remote service validation""" available: bool """ - Indicates whether this entry can be made more or less sensitive by setting a - confidence threshold. Profiles that use an entry with `available` set to true - can use confidence thresholds + Indicates whether this entry has any form of validation that is not an AI remote + service """ diff --git a/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_response.py b/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_response.py index eb02589e536..371bdbd3f0d 100644 --- a/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_response.py +++ b/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_response.py @@ -58,12 +58,12 @@ class CustomProfileEntryCustomEntry(BaseModel): class CustomProfileEntryPredefinedEntryConfidence(BaseModel): ai_context_available: bool + """Indicates whether this entry has AI remote service validation""" available: bool """ - Indicates whether this entry can be made more or less sensitive by setting a - confidence threshold. Profiles that use an entry with `available` set to true - can use confidence thresholds + Indicates whether this entry has any form of validation that is not an AI remote + service """ @@ -196,12 +196,12 @@ class PredefinedProfileEntryCustomEntry(BaseModel): class PredefinedProfileEntryPredefinedEntryConfidence(BaseModel): ai_context_available: bool + """Indicates whether this entry has AI remote service validation""" available: bool """ - Indicates whether this entry can be made more or less sensitive by setting a - confidence threshold. Profiles that use an entry with `available` set to true - can use confidence thresholds + Indicates whether this entry has any form of validation that is not an AI remote + service """ @@ -327,12 +327,12 @@ class IntegrationProfileEntryCustomEntry(BaseModel): class IntegrationProfileEntryPredefinedEntryConfidence(BaseModel): ai_context_available: bool + """Indicates whether this entry has AI remote service validation""" available: bool """ - Indicates whether this entry can be made more or less sensitive by setting a - confidence threshold. Profiles that use an entry with `available` set to true - can use confidence thresholds + Indicates whether this entry has any form of validation that is not an AI remote + service """ From a1fe38d79c4fe69d94c75dc59ccfe4b74d7b503b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 19:45:06 +0000 Subject: [PATCH 226/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 2982b0f4706..d340bcb7b5b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-129da52f8749b26071ec96ee50527d2bd29145ef6b9747171fe02034356b7b4b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-42f7bee7642f1ac7cf19958c624ca86cb5fbeacde6369142f3e929de88a1981d.yml From 9be865fb165bbae12bf6ff526255c0e1ec2205fd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 19:49:36 +0000 Subject: [PATCH 227/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d340bcb7b5b..e7d16c4d7b8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-42f7bee7642f1ac7cf19958c624ca86cb5fbeacde6369142f3e929de88a1981d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-447799e90094edf7c232fa0f804c9460271d738261ae87dd894dd5939520ac50.yml From 69b819359d33b15a8c6cd23c4e58e08d2e2090a0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 19:52:52 +0000 Subject: [PATCH 228/358] feat(connectors): `telemetry` => `events` (#2464) --- api.md | 8 +- .../magic_transit/connectors/__init__.py | 28 +++--- .../magic_transit/connectors/connectors.py | 40 ++++---- .../connectors/{telemetry.py => events.py} | 96 +++++++++---------- .../magic_transit/connectors/__init__.py | 6 +- ..._get_response.py => event_get_response.py} | 4 +- ...ry_list_params.py => event_list_params.py} | 4 +- ...ist_response.py => event_list_response.py} | 4 +- .../{test_telemetry.py => test_events.py} | 86 ++++++++--------- 9 files changed, 138 insertions(+), 138 deletions(-) rename src/cloudflare/resources/magic_transit/connectors/{telemetry.py => events.py} (76%) rename src/cloudflare/types/magic_transit/connectors/{telemetry_get_response.py => event_get_response.py} (86%) rename src/cloudflare/types/magic_transit/connectors/{telemetry_list_params.py => event_list_params.py} (81%) rename src/cloudflare/types/magic_transit/connectors/{telemetry_list_response.py => event_list_response.py} (86%) rename tests/api_resources/magic_transit/connectors/{test_telemetry.py => test_events.py} (66%) diff --git a/api.md b/api.md index 781f229040f..53c1aeff6d7 100644 --- a/api.md +++ b/api.md @@ -3882,18 +3882,18 @@ Methods: - client.magic_transit.connectors.edit(connector_id, \*, account_id, \*\*params) -> ConnectorEditResponse - client.magic_transit.connectors.get(connector_id, \*, account_id) -> ConnectorGetResponse -### Telemetry +### Events Types: ```python -from cloudflare.types.magic_transit.connectors import TelemetryListResponse, TelemetryGetResponse +from cloudflare.types.magic_transit.connectors import EventListResponse, EventGetResponse ``` Methods: -- client.magic_transit.connectors.telemetry.list(connector_id, \*, account_id, \*\*params) -> TelemetryListResponse -- client.magic_transit.connectors.telemetry.get(event_n, \*, account_id, connector_id, event_t) -> TelemetryGetResponse +- client.magic_transit.connectors.events.list(connector_id, \*, account_id, \*\*params) -> EventListResponse +- client.magic_transit.connectors.events.get(event_n, \*, account_id, connector_id, event_t) -> EventGetResponse ### Snapshots diff --git a/src/cloudflare/resources/magic_transit/connectors/__init__.py b/src/cloudflare/resources/magic_transit/connectors/__init__.py index 7eb748d3559..6382ec9cb9a 100644 --- a/src/cloudflare/resources/magic_transit/connectors/__init__.py +++ b/src/cloudflare/resources/magic_transit/connectors/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .events import ( + EventsResource, + AsyncEventsResource, + EventsResourceWithRawResponse, + AsyncEventsResourceWithRawResponse, + EventsResourceWithStreamingResponse, + AsyncEventsResourceWithStreamingResponse, +) from .snapshots import ( SnapshotsResource, AsyncSnapshotsResource, @@ -8,14 +16,6 @@ SnapshotsResourceWithStreamingResponse, AsyncSnapshotsResourceWithStreamingResponse, ) -from .telemetry import ( - TelemetryResource, - AsyncTelemetryResource, - TelemetryResourceWithRawResponse, - AsyncTelemetryResourceWithRawResponse, - TelemetryResourceWithStreamingResponse, - AsyncTelemetryResourceWithStreamingResponse, -) from .connectors import ( ConnectorsResource, AsyncConnectorsResource, @@ -26,12 +26,12 @@ ) __all__ = [ - "TelemetryResource", - "AsyncTelemetryResource", - "TelemetryResourceWithRawResponse", - "AsyncTelemetryResourceWithRawResponse", - "TelemetryResourceWithStreamingResponse", - "AsyncTelemetryResourceWithStreamingResponse", + "EventsResource", + "AsyncEventsResource", + "EventsResourceWithRawResponse", + "AsyncEventsResourceWithRawResponse", + "EventsResourceWithStreamingResponse", + "AsyncEventsResourceWithStreamingResponse", "SnapshotsResource", "AsyncSnapshotsResource", "SnapshotsResourceWithRawResponse", diff --git a/src/cloudflare/resources/magic_transit/connectors/connectors.py b/src/cloudflare/resources/magic_transit/connectors/connectors.py index 93325e05735..0a01c466f9b 100644 --- a/src/cloudflare/resources/magic_transit/connectors/connectors.py +++ b/src/cloudflare/resources/magic_transit/connectors/connectors.py @@ -6,6 +6,14 @@ import httpx +from .events import ( + EventsResource, + AsyncEventsResource, + EventsResourceWithRawResponse, + AsyncEventsResourceWithRawResponse, + EventsResourceWithStreamingResponse, + AsyncEventsResourceWithStreamingResponse, +) from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( maybe_transform, @@ -19,14 +27,6 @@ SnapshotsResourceWithStreamingResponse, AsyncSnapshotsResourceWithStreamingResponse, ) -from .telemetry import ( - TelemetryResource, - AsyncTelemetryResource, - TelemetryResourceWithRawResponse, - AsyncTelemetryResourceWithRawResponse, - TelemetryResourceWithStreamingResponse, - AsyncTelemetryResourceWithStreamingResponse, -) from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -49,8 +49,8 @@ class ConnectorsResource(SyncAPIResource): @cached_property - def telemetry(self) -> TelemetryResource: - return TelemetryResource(self._client) + def events(self) -> EventsResource: + return EventsResource(self._client) @cached_property def snapshots(self) -> SnapshotsResource: @@ -270,8 +270,8 @@ def get( class AsyncConnectorsResource(AsyncAPIResource): @cached_property - def telemetry(self) -> AsyncTelemetryResource: - return AsyncTelemetryResource(self._client) + def events(self) -> AsyncEventsResource: + return AsyncEventsResource(self._client) @cached_property def snapshots(self) -> AsyncSnapshotsResource: @@ -507,8 +507,8 @@ def __init__(self, connectors: ConnectorsResource) -> None: ) @cached_property - def telemetry(self) -> TelemetryResourceWithRawResponse: - return TelemetryResourceWithRawResponse(self._connectors.telemetry) + def events(self) -> EventsResourceWithRawResponse: + return EventsResourceWithRawResponse(self._connectors.events) @cached_property def snapshots(self) -> SnapshotsResourceWithRawResponse: @@ -533,8 +533,8 @@ def __init__(self, connectors: AsyncConnectorsResource) -> None: ) @cached_property - def telemetry(self) -> AsyncTelemetryResourceWithRawResponse: - return AsyncTelemetryResourceWithRawResponse(self._connectors.telemetry) + def events(self) -> AsyncEventsResourceWithRawResponse: + return AsyncEventsResourceWithRawResponse(self._connectors.events) @cached_property def snapshots(self) -> AsyncSnapshotsResourceWithRawResponse: @@ -559,8 +559,8 @@ def __init__(self, connectors: ConnectorsResource) -> None: ) @cached_property - def telemetry(self) -> TelemetryResourceWithStreamingResponse: - return TelemetryResourceWithStreamingResponse(self._connectors.telemetry) + def events(self) -> EventsResourceWithStreamingResponse: + return EventsResourceWithStreamingResponse(self._connectors.events) @cached_property def snapshots(self) -> SnapshotsResourceWithStreamingResponse: @@ -585,8 +585,8 @@ def __init__(self, connectors: AsyncConnectorsResource) -> None: ) @cached_property - def telemetry(self) -> AsyncTelemetryResourceWithStreamingResponse: - return AsyncTelemetryResourceWithStreamingResponse(self._connectors.telemetry) + def events(self) -> AsyncEventsResourceWithStreamingResponse: + return AsyncEventsResourceWithStreamingResponse(self._connectors.events) @cached_property def snapshots(self) -> AsyncSnapshotsResourceWithStreamingResponse: diff --git a/src/cloudflare/resources/magic_transit/connectors/telemetry.py b/src/cloudflare/resources/magic_transit/connectors/events.py similarity index 76% rename from src/cloudflare/resources/magic_transit/connectors/telemetry.py rename to src/cloudflare/resources/magic_transit/connectors/events.py index ebc14f2dd20..b985e21024c 100644 --- a/src/cloudflare/resources/magic_transit/connectors/telemetry.py +++ b/src/cloudflare/resources/magic_transit/connectors/events.py @@ -21,32 +21,32 @@ ) from ...._wrappers import ResultWrapper from ...._base_client import make_request_options -from ....types.magic_transit.connectors import telemetry_list_params -from ....types.magic_transit.connectors.telemetry_get_response import TelemetryGetResponse -from ....types.magic_transit.connectors.telemetry_list_response import TelemetryListResponse +from ....types.magic_transit.connectors import event_list_params +from ....types.magic_transit.connectors.event_get_response import EventGetResponse +from ....types.magic_transit.connectors.event_list_response import EventListResponse -__all__ = ["TelemetryResource", "AsyncTelemetryResource"] +__all__ = ["EventsResource", "AsyncEventsResource"] -class TelemetryResource(SyncAPIResource): +class EventsResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> TelemetryResourceWithRawResponse: + def with_raw_response(self) -> EventsResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers """ - return TelemetryResourceWithRawResponse(self) + return EventsResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> TelemetryResourceWithStreamingResponse: + def with_streaming_response(self) -> EventsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response """ - return TelemetryResourceWithStreamingResponse(self) + return EventsResourceWithStreamingResponse(self) def list( self, @@ -63,7 +63,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TelemetryListResponse: + ) -> EventListResponse: """ List Events @@ -92,11 +92,11 @@ def list( "cursor": cursor, "limit": limit, }, - telemetry_list_params.TelemetryListParams, + event_list_params.EventListParams, ), - post_parser=ResultWrapper[TelemetryListResponse]._unwrapper, + post_parser=ResultWrapper[EventListResponse]._unwrapper, ), - cast_to=cast(Type[TelemetryListResponse], ResultWrapper[TelemetryListResponse]), + cast_to=cast(Type[EventListResponse], ResultWrapper[EventListResponse]), ) def get( @@ -112,7 +112,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TelemetryGetResponse: + ) -> EventGetResponse: """ Get Event @@ -134,31 +134,31 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[TelemetryGetResponse]._unwrapper, + post_parser=ResultWrapper[EventGetResponse]._unwrapper, ), - cast_to=cast(Type[TelemetryGetResponse], ResultWrapper[TelemetryGetResponse]), + cast_to=cast(Type[EventGetResponse], ResultWrapper[EventGetResponse]), ) -class AsyncTelemetryResource(AsyncAPIResource): +class AsyncEventsResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncTelemetryResourceWithRawResponse: + def with_raw_response(self) -> AsyncEventsResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers """ - return AsyncTelemetryResourceWithRawResponse(self) + return AsyncEventsResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncTelemetryResourceWithStreamingResponse: + def with_streaming_response(self) -> AsyncEventsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response """ - return AsyncTelemetryResourceWithStreamingResponse(self) + return AsyncEventsResourceWithStreamingResponse(self) async def list( self, @@ -175,7 +175,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TelemetryListResponse: + ) -> EventListResponse: """ List Events @@ -204,11 +204,11 @@ async def list( "cursor": cursor, "limit": limit, }, - telemetry_list_params.TelemetryListParams, + event_list_params.EventListParams, ), - post_parser=ResultWrapper[TelemetryListResponse]._unwrapper, + post_parser=ResultWrapper[EventListResponse]._unwrapper, ), - cast_to=cast(Type[TelemetryListResponse], ResultWrapper[TelemetryListResponse]), + cast_to=cast(Type[EventListResponse], ResultWrapper[EventListResponse]), ) async def get( @@ -224,7 +224,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TelemetryGetResponse: + ) -> EventGetResponse: """ Get Event @@ -246,55 +246,55 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[TelemetryGetResponse]._unwrapper, + post_parser=ResultWrapper[EventGetResponse]._unwrapper, ), - cast_to=cast(Type[TelemetryGetResponse], ResultWrapper[TelemetryGetResponse]), + cast_to=cast(Type[EventGetResponse], ResultWrapper[EventGetResponse]), ) -class TelemetryResourceWithRawResponse: - def __init__(self, telemetry: TelemetryResource) -> None: - self._telemetry = telemetry +class EventsResourceWithRawResponse: + def __init__(self, events: EventsResource) -> None: + self._events = events self.list = to_raw_response_wrapper( - telemetry.list, + events.list, ) self.get = to_raw_response_wrapper( - telemetry.get, + events.get, ) -class AsyncTelemetryResourceWithRawResponse: - def __init__(self, telemetry: AsyncTelemetryResource) -> None: - self._telemetry = telemetry +class AsyncEventsResourceWithRawResponse: + def __init__(self, events: AsyncEventsResource) -> None: + self._events = events self.list = async_to_raw_response_wrapper( - telemetry.list, + events.list, ) self.get = async_to_raw_response_wrapper( - telemetry.get, + events.get, ) -class TelemetryResourceWithStreamingResponse: - def __init__(self, telemetry: TelemetryResource) -> None: - self._telemetry = telemetry +class EventsResourceWithStreamingResponse: + def __init__(self, events: EventsResource) -> None: + self._events = events self.list = to_streamed_response_wrapper( - telemetry.list, + events.list, ) self.get = to_streamed_response_wrapper( - telemetry.get, + events.get, ) -class AsyncTelemetryResourceWithStreamingResponse: - def __init__(self, telemetry: AsyncTelemetryResource) -> None: - self._telemetry = telemetry +class AsyncEventsResourceWithStreamingResponse: + def __init__(self, events: AsyncEventsResource) -> None: + self._events = events self.list = async_to_streamed_response_wrapper( - telemetry.list, + events.list, ) self.get = async_to_streamed_response_wrapper( - telemetry.get, + events.get, ) diff --git a/src/cloudflare/types/magic_transit/connectors/__init__.py b/src/cloudflare/types/magic_transit/connectors/__init__.py index 85e717bb914..97c4286eacf 100644 --- a/src/cloudflare/types/magic_transit/connectors/__init__.py +++ b/src/cloudflare/types/magic_transit/connectors/__init__.py @@ -2,9 +2,9 @@ from __future__ import annotations +from .event_list_params import EventListParams as EventListParams +from .event_get_response import EventGetResponse as EventGetResponse +from .event_list_response import EventListResponse as EventListResponse from .snapshot_list_params import SnapshotListParams as SnapshotListParams from .snapshot_get_response import SnapshotGetResponse as SnapshotGetResponse -from .telemetry_list_params import TelemetryListParams as TelemetryListParams from .snapshot_list_response import SnapshotListResponse as SnapshotListResponse -from .telemetry_get_response import TelemetryGetResponse as TelemetryGetResponse -from .telemetry_list_response import TelemetryListResponse as TelemetryListResponse diff --git a/src/cloudflare/types/magic_transit/connectors/telemetry_get_response.py b/src/cloudflare/types/magic_transit/connectors/event_get_response.py similarity index 86% rename from src/cloudflare/types/magic_transit/connectors/telemetry_get_response.py rename to src/cloudflare/types/magic_transit/connectors/event_get_response.py index 9a344dfec74..62e09cdd9c3 100644 --- a/src/cloudflare/types/magic_transit/connectors/telemetry_get_response.py +++ b/src/cloudflare/types/magic_transit/connectors/event_get_response.py @@ -5,7 +5,7 @@ from ...._models import BaseModel -__all__ = ["TelemetryGetResponse", "E", "EK", "EUnionMember8"] +__all__ = ["EventGetResponse", "E", "EK", "EUnionMember8"] class EK(BaseModel): @@ -24,7 +24,7 @@ class EUnionMember8(BaseModel): E: TypeAlias = Union[EK, EK, EK, EK, EK, EK, EK, EK, EUnionMember8, EK, EK, EK, EK] -class TelemetryGetResponse(BaseModel): +class EventGetResponse(BaseModel): e: E n: float diff --git a/src/cloudflare/types/magic_transit/connectors/telemetry_list_params.py b/src/cloudflare/types/magic_transit/connectors/event_list_params.py similarity index 81% rename from src/cloudflare/types/magic_transit/connectors/telemetry_list_params.py rename to src/cloudflare/types/magic_transit/connectors/event_list_params.py index 07460db26b4..68aa2be867c 100644 --- a/src/cloudflare/types/magic_transit/connectors/telemetry_list_params.py +++ b/src/cloudflare/types/magic_transit/connectors/event_list_params.py @@ -6,10 +6,10 @@ from ...._utils import PropertyInfo -__all__ = ["TelemetryListParams"] +__all__ = ["EventListParams"] -class TelemetryListParams(TypedDict, total=False): +class EventListParams(TypedDict, total=False): account_id: Required[float] from_: Required[Annotated[float, PropertyInfo(alias="from")]] diff --git a/src/cloudflare/types/magic_transit/connectors/telemetry_list_response.py b/src/cloudflare/types/magic_transit/connectors/event_list_response.py similarity index 86% rename from src/cloudflare/types/magic_transit/connectors/telemetry_list_response.py rename to src/cloudflare/types/magic_transit/connectors/event_list_response.py index 59669be4a4f..79fcc858511 100644 --- a/src/cloudflare/types/magic_transit/connectors/telemetry_list_response.py +++ b/src/cloudflare/types/magic_transit/connectors/event_list_response.py @@ -4,7 +4,7 @@ from ...._models import BaseModel -__all__ = ["TelemetryListResponse", "Item"] +__all__ = ["EventListResponse", "Item"] class Item(BaseModel): @@ -21,7 +21,7 @@ class Item(BaseModel): """Time the Event was recorded (seconds since the Unix epoch)""" -class TelemetryListResponse(BaseModel): +class EventListResponse(BaseModel): count: float items: List[Item] diff --git a/tests/api_resources/magic_transit/connectors/test_telemetry.py b/tests/api_resources/magic_transit/connectors/test_events.py similarity index 66% rename from tests/api_resources/magic_transit/connectors/test_telemetry.py rename to tests/api_resources/magic_transit/connectors/test_events.py index 4fa3d3dda27..33690ffbd82 100644 --- a/tests/api_resources/magic_transit/connectors/test_telemetry.py +++ b/tests/api_resources/magic_transit/connectors/test_events.py @@ -9,27 +9,27 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.magic_transit.connectors import TelemetryGetResponse, TelemetryListResponse +from cloudflare.types.magic_transit.connectors import EventGetResponse, EventListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") -class TestTelemetry: +class TestEvents: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize def test_method_list(self, client: Cloudflare) -> None: - telemetry = client.magic_transit.connectors.telemetry.list( + event = client.magic_transit.connectors.events.list( connector_id="connector_id", account_id=0, from_=0, to=0, ) - assert_matches_type(TelemetryListResponse, telemetry, path=["response"]) + assert_matches_type(EventListResponse, event, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: - telemetry = client.magic_transit.connectors.telemetry.list( + event = client.magic_transit.connectors.events.list( connector_id="connector_id", account_id=0, from_=0, @@ -37,11 +37,11 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: cursor="cursor", limit=0, ) - assert_matches_type(TelemetryListResponse, telemetry, path=["response"]) + assert_matches_type(EventListResponse, event, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.magic_transit.connectors.telemetry.with_raw_response.list( + response = client.magic_transit.connectors.events.with_raw_response.list( connector_id="connector_id", account_id=0, from_=0, @@ -50,12 +50,12 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - telemetry = response.parse() - assert_matches_type(TelemetryListResponse, telemetry, path=["response"]) + event = response.parse() + assert_matches_type(EventListResponse, event, path=["response"]) @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.magic_transit.connectors.telemetry.with_streaming_response.list( + with client.magic_transit.connectors.events.with_streaming_response.list( connector_id="connector_id", account_id=0, from_=0, @@ -64,15 +64,15 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - telemetry = response.parse() - assert_matches_type(TelemetryListResponse, telemetry, path=["response"]) + event = response.parse() + assert_matches_type(EventListResponse, event, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_list(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `connector_id` but received ''"): - client.magic_transit.connectors.telemetry.with_raw_response.list( + client.magic_transit.connectors.events.with_raw_response.list( connector_id="", account_id=0, from_=0, @@ -81,17 +81,17 @@ def test_path_params_list(self, client: Cloudflare) -> None: @parametrize def test_method_get(self, client: Cloudflare) -> None: - telemetry = client.magic_transit.connectors.telemetry.get( + event = client.magic_transit.connectors.events.get( event_n=0, account_id=0, connector_id="connector_id", event_t=0, ) - assert_matches_type(TelemetryGetResponse, telemetry, path=["response"]) + assert_matches_type(EventGetResponse, event, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.magic_transit.connectors.telemetry.with_raw_response.get( + response = client.magic_transit.connectors.events.with_raw_response.get( event_n=0, account_id=0, connector_id="connector_id", @@ -100,12 +100,12 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - telemetry = response.parse() - assert_matches_type(TelemetryGetResponse, telemetry, path=["response"]) + event = response.parse() + assert_matches_type(EventGetResponse, event, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.magic_transit.connectors.telemetry.with_streaming_response.get( + with client.magic_transit.connectors.events.with_streaming_response.get( event_n=0, account_id=0, connector_id="connector_id", @@ -114,15 +114,15 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - telemetry = response.parse() - assert_matches_type(TelemetryGetResponse, telemetry, path=["response"]) + event = response.parse() + assert_matches_type(EventGetResponse, event, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `connector_id` but received ''"): - client.magic_transit.connectors.telemetry.with_raw_response.get( + client.magic_transit.connectors.events.with_raw_response.get( event_n=0, account_id=0, connector_id="", @@ -130,22 +130,22 @@ def test_path_params_get(self, client: Cloudflare) -> None: ) -class TestAsyncTelemetry: +class TestAsyncEvents: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: - telemetry = await async_client.magic_transit.connectors.telemetry.list( + event = await async_client.magic_transit.connectors.events.list( connector_id="connector_id", account_id=0, from_=0, to=0, ) - assert_matches_type(TelemetryListResponse, telemetry, path=["response"]) + assert_matches_type(EventListResponse, event, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: - telemetry = await async_client.magic_transit.connectors.telemetry.list( + event = await async_client.magic_transit.connectors.events.list( connector_id="connector_id", account_id=0, from_=0, @@ -153,11 +153,11 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) cursor="cursor", limit=0, ) - assert_matches_type(TelemetryListResponse, telemetry, path=["response"]) + assert_matches_type(EventListResponse, event, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.magic_transit.connectors.telemetry.with_raw_response.list( + response = await async_client.magic_transit.connectors.events.with_raw_response.list( connector_id="connector_id", account_id=0, from_=0, @@ -166,12 +166,12 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - telemetry = await response.parse() - assert_matches_type(TelemetryListResponse, telemetry, path=["response"]) + event = await response.parse() + assert_matches_type(EventListResponse, event, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.magic_transit.connectors.telemetry.with_streaming_response.list( + async with async_client.magic_transit.connectors.events.with_streaming_response.list( connector_id="connector_id", account_id=0, from_=0, @@ -180,15 +180,15 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - telemetry = await response.parse() - assert_matches_type(TelemetryListResponse, telemetry, path=["response"]) + event = await response.parse() + assert_matches_type(EventListResponse, event, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `connector_id` but received ''"): - await async_client.magic_transit.connectors.telemetry.with_raw_response.list( + await async_client.magic_transit.connectors.events.with_raw_response.list( connector_id="", account_id=0, from_=0, @@ -197,17 +197,17 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: - telemetry = await async_client.magic_transit.connectors.telemetry.get( + event = await async_client.magic_transit.connectors.events.get( event_n=0, account_id=0, connector_id="connector_id", event_t=0, ) - assert_matches_type(TelemetryGetResponse, telemetry, path=["response"]) + assert_matches_type(EventGetResponse, event, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.magic_transit.connectors.telemetry.with_raw_response.get( + response = await async_client.magic_transit.connectors.events.with_raw_response.get( event_n=0, account_id=0, connector_id="connector_id", @@ -216,12 +216,12 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - telemetry = await response.parse() - assert_matches_type(TelemetryGetResponse, telemetry, path=["response"]) + event = await response.parse() + assert_matches_type(EventGetResponse, event, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.magic_transit.connectors.telemetry.with_streaming_response.get( + async with async_client.magic_transit.connectors.events.with_streaming_response.get( event_n=0, account_id=0, connector_id="connector_id", @@ -230,15 +230,15 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - telemetry = await response.parse() - assert_matches_type(TelemetryGetResponse, telemetry, path=["response"]) + event = await response.parse() + assert_matches_type(EventGetResponse, event, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `connector_id` but received ''"): - await async_client.magic_transit.connectors.telemetry.with_raw_response.get( + await async_client.magic_transit.connectors.events.with_raw_response.get( event_n=0, account_id=0, connector_id="", From 822dafaf9db426a913054fc19159daa3d2ceff56 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 19:59:00 +0000 Subject: [PATCH 229/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index e7d16c4d7b8..d340bcb7b5b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-447799e90094edf7c232fa0f804c9460271d738261ae87dd894dd5939520ac50.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-42f7bee7642f1ac7cf19958c624ca86cb5fbeacde6369142f3e929de88a1981d.yml From 6996e2031388497e03b18d5030cf35ef3c179622 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 20:19:47 +0000 Subject: [PATCH 230/358] feat(api): api update (#2465) --- .stats.yml | 2 +- api.md | 2 +- .../applications/policy_tests/policy_tests.py | 6 ++--- .../access/applications/policy_tests/users.py | 22 +++++++++++++++++-- .../applications/policy_test_create_params.py | 13 ++++++----- .../applications/policy_tests/__init__.py | 1 + .../policy_tests/user_list_params.py | 15 +++++++++++++ .../applications/policy_tests/test_users.py | 18 +++++++++++++++ 8 files changed, 67 insertions(+), 12 deletions(-) create mode 100644 src/cloudflare/types/zero_trust/access/applications/policy_tests/user_list_params.py diff --git a/.stats.yml b/.stats.yml index d340bcb7b5b..6e0c26a26bb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-42f7bee7642f1ac7cf19958c624ca86cb5fbeacde6369142f3e929de88a1981d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a0efee0d78837f3fa1ac42855d0b393e00877ffe51e0159b3fa777056c66372a.yml diff --git a/api.md b/api.md index 53c1aeff6d7..2b5489be823 100644 --- a/api.md +++ b/api.md @@ -5429,7 +5429,7 @@ from cloudflare.types.zero_trust.access.applications.policy_tests import UserLis Methods: -- client.zero_trust.access.applications.policy_tests.users.list(policy_test_id, \*, account_id) -> SyncSinglePage[UserListResponse] +- client.zero_trust.access.applications.policy_tests.users.list(policy_test_id, \*, account_id, \*\*params) -> SyncSinglePage[UserListResponse] ### Certificates diff --git a/src/cloudflare/resources/zero_trust/access/applications/policy_tests/policy_tests.py b/src/cloudflare/resources/zero_trust/access/applications/policy_tests/policy_tests.py index 57bdd9e5aab..0c82192652e 100755 --- a/src/cloudflare/resources/zero_trust/access/applications/policy_tests/policy_tests.py +++ b/src/cloudflare/resources/zero_trust/access/applications/policy_tests/policy_tests.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, Iterable, Optional, cast +from typing import List, Type, Optional, cast import httpx @@ -64,7 +64,7 @@ def create( self, *, account_id: str, - policies: Iterable[policy_test_create_params.Policy] | NotGiven = NOT_GIVEN, + policies: List[policy_test_create_params.Policy] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -176,7 +176,7 @@ async def create( self, *, account_id: str, - policies: Iterable[policy_test_create_params.Policy] | NotGiven = NOT_GIVEN, + policies: List[policy_test_create_params.Policy] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/cloudflare/resources/zero_trust/access/applications/policy_tests/users.py b/src/cloudflare/resources/zero_trust/access/applications/policy_tests/users.py index a051ba2de97..b2d1da2f862 100755 --- a/src/cloudflare/resources/zero_trust/access/applications/policy_tests/users.py +++ b/src/cloudflare/resources/zero_trust/access/applications/policy_tests/users.py @@ -2,9 +2,12 @@ from __future__ import annotations +from typing_extensions import Literal + import httpx from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ......_utils import maybe_transform from ......_compat import cached_property from ......_resource import SyncAPIResource, AsyncAPIResource from ......_response import ( @@ -15,6 +18,7 @@ ) from ......pagination import SyncSinglePage, AsyncSinglePage from ......_base_client import AsyncPaginator, make_request_options +from ......types.zero_trust.access.applications.policy_tests import user_list_params from ......types.zero_trust.access.applications.policy_tests.user_list_response import UserListResponse __all__ = ["UsersResource", "AsyncUsersResource"] @@ -45,6 +49,7 @@ def list( policy_test_id: str, *, account_id: str, + status: Literal["success", "fail"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -60,6 +65,8 @@ def list( policy_test_id: The UUID of the policy test. + status: Filter users by their policy evaluation status. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -76,7 +83,11 @@ def list( f"/accounts/{account_id}/access/policy-tests/{policy_test_id}/users", page=SyncSinglePage[UserListResponse], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"status": status}, user_list_params.UserListParams), ), model=UserListResponse, ) @@ -107,6 +118,7 @@ def list( policy_test_id: str, *, account_id: str, + status: Literal["success", "fail"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -122,6 +134,8 @@ def list( policy_test_id: The UUID of the policy test. + status: Filter users by their policy evaluation status. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -138,7 +152,11 @@ def list( f"/accounts/{account_id}/access/policy-tests/{policy_test_id}/users", page=AsyncSinglePage[UserListResponse], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"status": status}, user_list_params.UserListParams), ), model=UserListResponse, ) diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_test_create_params.py b/src/cloudflare/types/zero_trust/access/applications/policy_test_create_params.py index 29788994d19..316dc004582 100755 --- a/src/cloudflare/types/zero_trust/access/applications/policy_test_create_params.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_test_create_params.py @@ -2,24 +2,24 @@ from __future__ import annotations -from typing import Iterable -from typing_extensions import Required, TypedDict +from typing import List, Union, Iterable +from typing_extensions import Required, TypeAlias, TypedDict from ..decision import Decision from .access_rule_param import AccessRuleParam from ..approval_group_param import ApprovalGroupParam -__all__ = ["PolicyTestCreateParams", "Policy"] +__all__ = ["PolicyTestCreateParams", "Policy", "PolicyUnionMember0"] class PolicyTestCreateParams(TypedDict, total=False): account_id: Required[str] """Identifier""" - policies: Iterable[Policy] + policies: List[Policy] -class Policy(TypedDict, total=False): +class PolicyUnionMember0(TypedDict, total=False): decision: Required[Decision] """The action Access will take if a user matches this policy. @@ -75,3 +75,6 @@ class Policy(TypedDict, total=False): Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. """ + + +Policy: TypeAlias = Union[PolicyUnionMember0, str] diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_tests/__init__.py b/src/cloudflare/types/zero_trust/access/applications/policy_tests/__init__.py index 15f00aa9334..b50e6a6cfa1 100755 --- a/src/cloudflare/types/zero_trust/access/applications/policy_tests/__init__.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_tests/__init__.py @@ -2,4 +2,5 @@ from __future__ import annotations +from .user_list_params import UserListParams as UserListParams from .user_list_response import UserListResponse as UserListResponse diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_tests/user_list_params.py b/src/cloudflare/types/zero_trust/access/applications/policy_tests/user_list_params.py new file mode 100644 index 00000000000..f7103320117 --- /dev/null +++ b/src/cloudflare/types/zero_trust/access/applications/policy_tests/user_list_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["UserListParams"] + + +class UserListParams(TypedDict, total=False): + account_id: Required[str] + """Identifier""" + + status: Literal["success", "fail"] + """Filter users by their policy evaluation status.""" diff --git a/tests/api_resources/zero_trust/access/applications/policy_tests/test_users.py b/tests/api_resources/zero_trust/access/applications/policy_tests/test_users.py index 38f13c7fc15..bb93daa3f31 100755 --- a/tests/api_resources/zero_trust/access/applications/policy_tests/test_users.py +++ b/tests/api_resources/zero_trust/access/applications/policy_tests/test_users.py @@ -26,6 +26,15 @@ def test_method_list(self, client: Cloudflare) -> None: ) assert_matches_type(SyncSinglePage[UserListResponse], user, path=["response"]) + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + user = client.zero_trust.access.applications.policy_tests.users.list( + policy_test_id="f1a8b3c9d4e5f6789a0b1c2d3e4f5678a9b0c1d2e3f4a5b67890c1d2e3f4b5a6", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + status="success", + ) + assert_matches_type(SyncSinglePage[UserListResponse], user, path=["response"]) + @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.zero_trust.access.applications.policy_tests.users.with_raw_response.list( @@ -78,6 +87,15 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: ) assert_matches_type(AsyncSinglePage[UserListResponse], user, path=["response"]) + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + user = await async_client.zero_trust.access.applications.policy_tests.users.list( + policy_test_id="f1a8b3c9d4e5f6789a0b1c2d3e4f5678a9b0c1d2e3f4a5b67890c1d2e3f4b5a6", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + status="success", + ) + assert_matches_type(AsyncSinglePage[UserListResponse], user, path=["response"]) + @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.access.applications.policy_tests.users.with_raw_response.list( From 400cb8a7510b1899410329801fa1f5f4679c0e31 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 20:37:44 +0000 Subject: [PATCH 231/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 6e0c26a26bb..6af4a7b8f6e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a0efee0d78837f3fa1ac42855d0b393e00877ffe51e0159b3fa777056c66372a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-68a410f354f398cf9a4a9d94a2711f7634b9d1ea0453c5d6abfade0dbf5b65ec.yml From 933d13f788eb51d3057ab2cc347bd80633f664a0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 21:24:59 +0000 Subject: [PATCH 232/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 6af4a7b8f6e..8c5e35ae6c8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-68a410f354f398cf9a4a9d94a2711f7634b9d1ea0453c5d6abfade0dbf5b65ec.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3141b572971257d62964340aeb93ac0a18737321069f7543b526b0e8e8464545.yml From f614aed879fd8ad4c6aa8fa8bd86e3b84db219d2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 06:12:07 +0000 Subject: [PATCH 233/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 8c5e35ae6c8..97363f2e214 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3141b572971257d62964340aeb93ac0a18737321069f7543b526b0e8e8464545.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2976a7837f35e9aff118e567bf9bf002467c8724f059066efddfbfd6211f76ac.yml From 7713cd170efea1cbe1208d52514d6725c4e5fd53 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 14:36:42 +0000 Subject: [PATCH 234/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 97363f2e214..3c8ba4a46d5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2976a7837f35e9aff118e567bf9bf002467c8724f059066efddfbfd6211f76ac.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-45e88bdf67dcce60c9b6cf8d03a14ef5126e7c9a587f0e7eb3ea0e8fe9ef546a.yml From 08def6def8273c57d415911e14d0732384eb7fb7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 15:01:48 +0000 Subject: [PATCH 235/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 3c8ba4a46d5..bcd50b79da2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-45e88bdf67dcce60c9b6cf8d03a14ef5126e7c9a587f0e7eb3ea0e8fe9ef546a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6994bfe6112eef15fe814492f56512a92345f8240bd021d3ebe3403314e5d1fb.yml From d5914ce9cde24c9bdd308927436b7c67bd1910d0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 15:50:46 +0000 Subject: [PATCH 236/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index bcd50b79da2..ec64a64a61d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6994bfe6112eef15fe814492f56512a92345f8240bd021d3ebe3403314e5d1fb.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cf4678c6c97583803c9813b6fd0465151c79e6f2a1eeb8d31697df3f3881a16d.yml From 68a0ec56b801cbb0185c793ccc100daeae3a6e7b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 16:16:05 +0000 Subject: [PATCH 237/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index ec64a64a61d..97363f2e214 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cf4678c6c97583803c9813b6fd0465151c79e6f2a1eeb8d31697df3f3881a16d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2976a7837f35e9aff118e567bf9bf002467c8724f059066efddfbfd6211f76ac.yml From 5e9710b5057a1a67f491f320d28817a69d6340f7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 17:16:19 +0000 Subject: [PATCH 238/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 97363f2e214..f908a739d36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2976a7837f35e9aff118e567bf9bf002467c8724f059066efddfbfd6211f76ac.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d0b9a1dfe70e6f93e0b5d52075de430c4bb6eec3485b9264df9aa1d5f36ad8b9.yml From 693257045a7fc0b8c6f6b747fd34ac1e37267610 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 17:35:40 +0000 Subject: [PATCH 239/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index f908a739d36..682c9c43cbd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d0b9a1dfe70e6f93e0b5d52075de430c4bb6eec3485b9264df9aa1d5f36ad8b9.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7154fdfff9999cbe50fefc6ccf5eb89942233ab62a4b2b71f7ce18958af4caaa.yml From dfd04b221e66ce4bf146105ea825cb961226bb30 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 17:49:48 +0000 Subject: [PATCH 240/358] feat(api): api update (#2467) --- .stats.yml | 2 +- src/cloudflare/types/load_balancers/load_balancer.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 682c9c43cbd..e07609210f0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7154fdfff9999cbe50fefc6ccf5eb89942233ab62a4b2b71f7ce18958af4caaa.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-76dd6f8e7b99fdc5b78f779d8379a9d89ae4f2127c7b47ddd16c665950fb7cf2.yml diff --git a/src/cloudflare/types/load_balancers/load_balancer.py b/src/cloudflare/types/load_balancers/load_balancer.py index 6888db12fb8..04f1d1aa9c7 100644 --- a/src/cloudflare/types/load_balancers/load_balancer.py +++ b/src/cloudflare/types/load_balancers/load_balancer.py @@ -181,3 +181,5 @@ class LoadBalancer(BaseModel): Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This only applies to gray-clouded (unproxied) load balancers. """ + + zone_name: Optional[str] = None From 6930f2f9d80aba56ca50491f32e400ea56bb19f3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 18:16:07 +0000 Subject: [PATCH 241/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index e07609210f0..8e758bad3a5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-76dd6f8e7b99fdc5b78f779d8379a9d89ae4f2127c7b47ddd16c665950fb7cf2.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-34b3b78a42fdb01daa3b9e164f44f50898db1a4053831e379c605eac0f746a4f.yml From 6954cfeda2dca3a325ed765dd952ce84299fb5d1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 18:21:42 +0000 Subject: [PATCH 242/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 8e758bad3a5..1b9da22eb4d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-34b3b78a42fdb01daa3b9e164f44f50898db1a4053831e379c605eac0f746a4f.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5c2c8e5cda6355192a05655d3ef683c25bdb2d94828bc88f9b1d092f3fc12f03.yml From 70cd66255b231aab433318993830be4b36770a89 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 18:59:28 +0000 Subject: [PATCH 243/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 1b9da22eb4d..15afbc92b3c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5c2c8e5cda6355192a05655d3ef683c25bdb2d94828bc88f9b1d092f3fc12f03.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2cd7e361551e6d74e3eb4b13939c641885d91a38bda53ef2af6e4ba6099d83c5.yml From bf67fb6066498a1b037ddb0d533f4f43201d1260 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 19:13:08 +0000 Subject: [PATCH 244/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 15afbc92b3c..180aa5c6597 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2cd7e361551e6d74e3eb4b13939c641885d91a38bda53ef2af6e4ba6099d83c5.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0dc508a559f4b43889516426af125bce6e0645d52d270d02a7340c285edf2da7.yml From a95ac20e66c5daa63f4feb884da05dd455f378a1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 19:46:22 +0000 Subject: [PATCH 245/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 180aa5c6597..901016aca88 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0dc508a559f4b43889516426af125bce6e0645d52d270d02a7340c285edf2da7.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-56c1f0ef91c500b78fc754a9ce251ae3ea1656769456ef0f4bf5927f7b5485c7.yml From bcc55df0244205d8c6bc7ab7fe12f1885a963366 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 20:31:13 +0000 Subject: [PATCH 246/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 901016aca88..a4c36e1e46c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-56c1f0ef91c500b78fc754a9ce251ae3ea1656769456ef0f4bf5927f7b5485c7.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d1645fb28cb010d2f3954e13aa34642408fc7ebbbe9758420b5fe07e2db3b0f3.yml From 1f747002fa9fdd9e96153e6cce476488b58ca12b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 20:44:52 +0000 Subject: [PATCH 247/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index a4c36e1e46c..43611fa8715 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d1645fb28cb010d2f3954e13aa34642408fc7ebbbe9758420b5fe07e2db3b0f3.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cc09518347c38481f49c750734e4abfbf0c594496098e3c0352cd0dccc189511.yml From baa8583353d59814abe167c560aa07b13f8a3da6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 21:56:00 +0000 Subject: [PATCH 248/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 43611fa8715..a4c36e1e46c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cc09518347c38481f49c750734e4abfbf0c594496098e3c0352cd0dccc189511.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d1645fb28cb010d2f3954e13aa34642408fc7ebbbe9758420b5fe07e2db3b0f3.yml From 47843113f0a5c5e575dab0dc85834e649a0cea14 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 21:59:08 +0000 Subject: [PATCH 249/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index a4c36e1e46c..a920f243102 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d1645fb28cb010d2f3954e13aa34642408fc7ebbbe9758420b5fe07e2db3b0f3.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-48dbfc4c6943d393b8431657c0456f6c80de26da24068bdf842534e3e1f578e2.yml From 0bec580739870d7f7ffd3e907224a1e9e4aa8f34 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 22:05:02 +0000 Subject: [PATCH 250/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index a920f243102..92f3f58dea0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-48dbfc4c6943d393b8431657c0456f6c80de26da24068bdf842534e3e1f578e2.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-89ab0b9846f060e2899d4d2f5fd842a42d1ee2b9aa8189173bd28bb1e60020e9.yml From 534dbe09de9685f783f6cb2813c430c9dadfb3a0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 22:50:52 +0000 Subject: [PATCH 251/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 92f3f58dea0..658ddac0d0d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-89ab0b9846f060e2899d4d2f5fd842a42d1ee2b9aa8189173bd28bb1e60020e9.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c31cd817ec99644faa7e6140b907afb5344d1b47a8cca8baa199c76adb6c69d3.yml From 2f6ae57ad759e7aeaf2014cf32b4a09359bec62e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 22:54:00 +0000 Subject: [PATCH 252/358] feat(client): allow passing `NotGiven` for body (#2468) fix(client): mark some request bodies as optional --- src/cloudflare/_base_client.py | 2 +- .../resources/cloud_connector/rules.py | 4 +- src/cloudflare/resources/url_scanner/scans.py | 4 +- src/cloudflare/resources/zaraz/publish.py | 4 +- .../cloud_connector/rule_update_params.py | 2 +- .../url_scanner/scan_bulk_create_params.py | 2 +- .../types/zaraz/publish_create_params.py | 2 +- .../cloud_connector/test_rules.py | 42 +++++++++++++++---- tests/api_resources/url_scanner/test_scans.py | 42 +++++++++++++++---- tests/api_resources/zaraz/test_publish.py | 20 ++++++--- 10 files changed, 92 insertions(+), 32 deletions(-) diff --git a/src/cloudflare/_base_client.py b/src/cloudflare/_base_client.py index 9376da89fa9..aa4cc191883 100644 --- a/src/cloudflare/_base_client.py +++ b/src/cloudflare/_base_client.py @@ -518,7 +518,7 @@ def _build_request( # so that passing a `TypedDict` doesn't cause an error. # https://github.com/microsoft/pyright/issues/3526#event-6715453066 params=self.qs.stringify(cast(Mapping[str, Any], params)) if params else None, - json=json_data, + json=json_data if is_given(json_data) else None, files=files, **kwargs, ) diff --git a/src/cloudflare/resources/cloud_connector/rules.py b/src/cloudflare/resources/cloud_connector/rules.py index 6a4ea6bf659..8459468e0ed 100644 --- a/src/cloudflare/resources/cloud_connector/rules.py +++ b/src/cloudflare/resources/cloud_connector/rules.py @@ -49,7 +49,7 @@ def update( self, *, zone_id: str, - rules: Iterable[rule_update_params.Rule], + rules: Iterable[rule_update_params.Rule] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -147,7 +147,7 @@ def update( self, *, zone_id: str, - rules: Iterable[rule_update_params.Rule], + rules: Iterable[rule_update_params.Rule] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/cloudflare/resources/url_scanner/scans.py b/src/cloudflare/resources/url_scanner/scans.py index de37c77ba9e..e997f7edec4 100644 --- a/src/cloudflare/resources/url_scanner/scans.py +++ b/src/cloudflare/resources/url_scanner/scans.py @@ -191,7 +191,7 @@ def bulk_create( self, *, account_id: str, - body: Iterable[scan_bulk_create_params.Body], + body: Iterable[scan_bulk_create_params.Body] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -554,7 +554,7 @@ async def bulk_create( self, *, account_id: str, - body: Iterable[scan_bulk_create_params.Body], + body: Iterable[scan_bulk_create_params.Body] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/cloudflare/resources/zaraz/publish.py b/src/cloudflare/resources/zaraz/publish.py index d8c9cb42e5c..2ecb0a00db4 100644 --- a/src/cloudflare/resources/zaraz/publish.py +++ b/src/cloudflare/resources/zaraz/publish.py @@ -51,7 +51,7 @@ def create( self, *, zone_id: str, - body: str, + body: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -115,7 +115,7 @@ async def create( self, *, zone_id: str, - body: str, + body: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/cloudflare/types/cloud_connector/rule_update_params.py b/src/cloudflare/types/cloud_connector/rule_update_params.py index 41d4e4aaa74..90428382c1f 100644 --- a/src/cloudflare/types/cloud_connector/rule_update_params.py +++ b/src/cloudflare/types/cloud_connector/rule_update_params.py @@ -12,7 +12,7 @@ class RuleUpdateParams(TypedDict, total=False): zone_id: Required[str] """Identifier""" - rules: Required[Iterable[Rule]] + rules: Iterable[Rule] """List of Cloud Connector rules""" diff --git a/src/cloudflare/types/url_scanner/scan_bulk_create_params.py b/src/cloudflare/types/url_scanner/scan_bulk_create_params.py index 6509c75550e..f02ccc3ebee 100644 --- a/src/cloudflare/types/url_scanner/scan_bulk_create_params.py +++ b/src/cloudflare/types/url_scanner/scan_bulk_create_params.py @@ -14,7 +14,7 @@ class ScanBulkCreateParams(TypedDict, total=False): account_id: Required[str] """Account ID.""" - body: Required[Iterable[Body]] + body: Iterable[Body] """List of urls to scan (up to a 100).""" diff --git a/src/cloudflare/types/zaraz/publish_create_params.py b/src/cloudflare/types/zaraz/publish_create_params.py index 62c446e0638..17aaad3ed76 100644 --- a/src/cloudflare/types/zaraz/publish_create_params.py +++ b/src/cloudflare/types/zaraz/publish_create_params.py @@ -11,5 +11,5 @@ class PublishCreateParams(TypedDict, total=False): zone_id: Required[str] """Identifier""" - body: Required[str] + body: str """Zaraz configuration description.""" diff --git a/tests/api_resources/cloud_connector/test_rules.py b/tests/api_resources/cloud_connector/test_rules.py index be4ecd8c702..255f82ba344 100644 --- a/tests/api_resources/cloud_connector/test_rules.py +++ b/tests/api_resources/cloud_connector/test_rules.py @@ -22,7 +22,23 @@ class TestRules: def test_method_update(self, client: Cloudflare) -> None: rule = client.cloud_connector.rules.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - rules=[{}], + ) + assert_matches_type(SyncSinglePage[RuleUpdateResponse], rule, path=["response"]) + + @parametrize + def test_method_update_with_all_params(self, client: Cloudflare) -> None: + rule = client.cloud_connector.rules.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + rules=[ + { + "id": "95c365e17e1b46599cd99e5b231fac4e", + "description": "Rule description", + "enabled": True, + "expression": 'http.cookie eq "a=b"', + "parameters": {"host": "examplebucket.s3.eu-north-1.amazonaws.com"}, + "provider": "aws_s3", + } + ], ) assert_matches_type(SyncSinglePage[RuleUpdateResponse], rule, path=["response"]) @@ -30,7 +46,6 @@ def test_method_update(self, client: Cloudflare) -> None: def test_raw_response_update(self, client: Cloudflare) -> None: response = client.cloud_connector.rules.with_raw_response.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - rules=[{}], ) assert response.is_closed is True @@ -42,7 +57,6 @@ def test_raw_response_update(self, client: Cloudflare) -> None: def test_streaming_response_update(self, client: Cloudflare) -> None: with client.cloud_connector.rules.with_streaming_response.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - rules=[{}], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -57,7 +71,6 @@ def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.cloud_connector.rules.with_raw_response.update( zone_id="", - rules=[{}], ) @parametrize @@ -106,7 +119,23 @@ class TestAsyncRules: async def test_method_update(self, async_client: AsyncCloudflare) -> None: rule = await async_client.cloud_connector.rules.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - rules=[{}], + ) + assert_matches_type(AsyncSinglePage[RuleUpdateResponse], rule, path=["response"]) + + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.cloud_connector.rules.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + rules=[ + { + "id": "95c365e17e1b46599cd99e5b231fac4e", + "description": "Rule description", + "enabled": True, + "expression": 'http.cookie eq "a=b"', + "parameters": {"host": "examplebucket.s3.eu-north-1.amazonaws.com"}, + "provider": "aws_s3", + } + ], ) assert_matches_type(AsyncSinglePage[RuleUpdateResponse], rule, path=["response"]) @@ -114,7 +143,6 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.cloud_connector.rules.with_raw_response.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - rules=[{}], ) assert response.is_closed is True @@ -126,7 +154,6 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.cloud_connector.rules.with_streaming_response.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - rules=[{}], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -141,7 +168,6 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.cloud_connector.rules.with_raw_response.update( zone_id="", - rules=[{}], ) @parametrize diff --git a/tests/api_resources/url_scanner/test_scans.py b/tests/api_resources/url_scanner/test_scans.py index aaa1385a9bb..f80866b0078 100644 --- a/tests/api_resources/url_scanner/test_scans.py +++ b/tests/api_resources/url_scanner/test_scans.py @@ -136,7 +136,23 @@ def test_path_params_list(self, client: Cloudflare) -> None: def test_method_bulk_create(self, client: Cloudflare) -> None: scan = client.url_scanner.scans.bulk_create( account_id="account_id", - body=[{"url": "https://www.example.com"}], + ) + assert_matches_type(ScanBulkCreateResponse, scan, path=["response"]) + + @parametrize + def test_method_bulk_create_with_all_params(self, client: Cloudflare) -> None: + scan = client.url_scanner.scans.bulk_create( + account_id="account_id", + body=[ + { + "url": "https://www.example.com", + "customagent": "customagent", + "custom_headers": {"foo": "string"}, + "referer": "referer", + "screenshots_resolutions": ["desktop"], + "visibility": "Public", + } + ], ) assert_matches_type(ScanBulkCreateResponse, scan, path=["response"]) @@ -144,7 +160,6 @@ def test_method_bulk_create(self, client: Cloudflare) -> None: def test_raw_response_bulk_create(self, client: Cloudflare) -> None: response = client.url_scanner.scans.with_raw_response.bulk_create( account_id="account_id", - body=[{"url": "https://www.example.com"}], ) assert response.is_closed is True @@ -156,7 +171,6 @@ def test_raw_response_bulk_create(self, client: Cloudflare) -> None: def test_streaming_response_bulk_create(self, client: Cloudflare) -> None: with client.url_scanner.scans.with_streaming_response.bulk_create( account_id="account_id", - body=[{"url": "https://www.example.com"}], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -171,7 +185,6 @@ def test_path_params_bulk_create(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.url_scanner.scans.with_raw_response.bulk_create( account_id="", - body=[{"url": "https://www.example.com"}], ) @parametrize @@ -514,7 +527,23 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: async def test_method_bulk_create(self, async_client: AsyncCloudflare) -> None: scan = await async_client.url_scanner.scans.bulk_create( account_id="account_id", - body=[{"url": "https://www.example.com"}], + ) + assert_matches_type(ScanBulkCreateResponse, scan, path=["response"]) + + @parametrize + async def test_method_bulk_create_with_all_params(self, async_client: AsyncCloudflare) -> None: + scan = await async_client.url_scanner.scans.bulk_create( + account_id="account_id", + body=[ + { + "url": "https://www.example.com", + "customagent": "customagent", + "custom_headers": {"foo": "string"}, + "referer": "referer", + "screenshots_resolutions": ["desktop"], + "visibility": "Public", + } + ], ) assert_matches_type(ScanBulkCreateResponse, scan, path=["response"]) @@ -522,7 +551,6 @@ async def test_method_bulk_create(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_bulk_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.url_scanner.scans.with_raw_response.bulk_create( account_id="account_id", - body=[{"url": "https://www.example.com"}], ) assert response.is_closed is True @@ -534,7 +562,6 @@ async def test_raw_response_bulk_create(self, async_client: AsyncCloudflare) -> async def test_streaming_response_bulk_create(self, async_client: AsyncCloudflare) -> None: async with async_client.url_scanner.scans.with_streaming_response.bulk_create( account_id="account_id", - body=[{"url": "https://www.example.com"}], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -549,7 +576,6 @@ async def test_path_params_bulk_create(self, async_client: AsyncCloudflare) -> N with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.url_scanner.scans.with_raw_response.bulk_create( account_id="", - body=[{"url": "https://www.example.com"}], ) @parametrize diff --git a/tests/api_resources/zaraz/test_publish.py b/tests/api_resources/zaraz/test_publish.py index dc7705837b7..0ff472b0f22 100644 --- a/tests/api_resources/zaraz/test_publish.py +++ b/tests/api_resources/zaraz/test_publish.py @@ -18,6 +18,13 @@ class TestPublish: @parametrize def test_method_create(self, client: Cloudflare) -> None: + publish = client.zaraz.publish.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(str, publish, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Cloudflare) -> None: publish = client.zaraz.publish.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", body="Config with enabled ecommerce tracking", @@ -28,7 +35,6 @@ def test_method_create(self, client: Cloudflare) -> None: def test_raw_response_create(self, client: Cloudflare) -> None: response = client.zaraz.publish.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body="Config with enabled ecommerce tracking", ) assert response.is_closed is True @@ -40,7 +46,6 @@ def test_raw_response_create(self, client: Cloudflare) -> None: def test_streaming_response_create(self, client: Cloudflare) -> None: with client.zaraz.publish.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body="Config with enabled ecommerce tracking", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -55,7 +60,6 @@ def test_path_params_create(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zaraz.publish.with_raw_response.create( zone_id="", - body="Config with enabled ecommerce tracking", ) @@ -64,6 +68,13 @@ class TestAsyncPublish: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: + publish = await async_client.zaraz.publish.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(str, publish, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: publish = await async_client.zaraz.publish.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", body="Config with enabled ecommerce tracking", @@ -74,7 +85,6 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.zaraz.publish.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body="Config with enabled ecommerce tracking", ) assert response.is_closed is True @@ -86,7 +96,6 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.zaraz.publish.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - body="Config with enabled ecommerce tracking", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -101,5 +110,4 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.zaraz.publish.with_raw_response.create( zone_id="", - body="Config with enabled ecommerce tracking", ) From fe3cc839767271d044b47ab5b5f2467898f6635f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 23:26:42 +0000 Subject: [PATCH 253/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 658ddac0d0d..e3bdbc93f35 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c31cd817ec99644faa7e6140b907afb5344d1b47a8cca8baa199c76adb6c69d3.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-04c7af76a858766cbccfc99267aabf2568f5616e20a035ef0b48c97f62ebdef0.yml From cf7554511726f6ec1f2f32783a77c56592993039 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2025 00:50:37 +0000 Subject: [PATCH 254/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index e3bdbc93f35..7f63b7a9fa4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-04c7af76a858766cbccfc99267aabf2568f5616e20a035ef0b48c97f62ebdef0.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-58f159e91cff0f66932d3ec06c43b7e778cba2bc6d7b7ebcdf60a86a3292cecc.yml From 68ca21ecb0e7bdfb5a4f93a2d24c560631e3bbba Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2025 06:21:52 +0000 Subject: [PATCH 255/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 7f63b7a9fa4..9a6cdaef7db 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-58f159e91cff0f66932d3ec06c43b7e778cba2bc6d7b7ebcdf60a86a3292cecc.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-759ea133e722ddbccc6f79f7f52b219ca7a3c34631d64bce926a07c53bff1dc7.yml From 60f0a0f57b0ea421e12760b39ce85a919d51d163 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2025 09:23:54 +0000 Subject: [PATCH 256/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 9a6cdaef7db..bd0c62f6b43 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-759ea133e722ddbccc6f79f7f52b219ca7a3c34631d64bce926a07c53bff1dc7.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9874ba84c76150f21873c4a6a9e6b00c685a72c8a28389a07ee2135f20c7d8bd.yml From f3ea490397e12346a0cbdd05f3e4f38f2f986f78 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2025 13:17:10 +0000 Subject: [PATCH 257/358] feat(api): api update (#2469) --- .stats.yml | 2 +- .../resources/radar/ai/bots/summary.py | 12 ++-- .../resources/radar/ai/inference/summary.py | 24 +++++--- .../ai/inference/timeseries_groups/summary.py | 24 +++++--- .../resources/radar/ai/timeseries_groups.py | 12 ++-- .../resources/radar/as112/summary.py | 24 +++++--- .../radar/as112/timeseries_groups.py | 24 +++++--- .../resources/radar/attacks/layer3/summary.py | 12 ++-- .../radar/attacks/layer3/timeseries_groups.py | 36 +++++++---- .../resources/radar/attacks/layer7/summary.py | 36 +++++++---- .../radar/attacks/layer7/timeseries_groups.py | 60 ++++++++++++------- .../resources/radar/http/timeseries_groups.py | 24 +++++--- .../resources/radar/ranking/ranking.py | 16 +++++ .../ai/bots/summary_user_agent_params.py | 6 +- .../ai/inference/summary_model_params.py | 6 +- .../radar/ai/inference/summary_task_params.py | 6 +- .../timeseries_groups/summary_model_params.py | 6 +- .../timeseries_groups/summary_task_params.py | 6 +- .../ai/timeseries_group_user_agent_params.py | 6 +- .../radar/as112/summary_query_type_params.py | 6 +- .../as112/summary_response_codes_params.py | 6 +- .../timeseries_group_query_type_params.py | 6 +- .../timeseries_group_response_codes_params.py | 6 +- .../attacks/layer3/summary_vector_params.py | 6 +- .../timeseries_group_industry_params.py | 6 +- .../layer3/timeseries_group_vector_params.py | 6 +- .../timeseries_group_vertical_params.py | 6 +- .../layer7/summary_http_method_params.py | 6 +- .../layer7/summary_managed_rules_params.py | 6 +- .../summary_mitigation_product_params.py | 6 +- .../timeseries_group_http_method_params.py | 6 +- .../timeseries_group_industry_params.py | 6 +- .../timeseries_group_managed_rules_params.py | 6 +- ...eseries_group_mitigation_product_params.py | 6 +- .../timeseries_group_vertical_params.py | 6 +- .../timeseries_group_browser_family_params.py | 6 +- .../http/timeseries_group_browser_params.py | 6 +- .../radar/ranking/domain_get_response.py | 8 +-- .../radar/ranking_timeseries_groups_params.py | 3 + .../types/radar/ranking_top_params.py | 3 + tests/api_resources/radar/test_ranking.py | 4 ++ 41 files changed, 319 insertions(+), 149 deletions(-) diff --git a/.stats.yml b/.stats.yml index bd0c62f6b43..4c2fe1e05a2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9874ba84c76150f21873c4a6a9e6b00c685a72c8a28389a07ee2135f20c7d8bd.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-51b1f2acb15cc7a66f2a8fc56e81aa748942150e65ff661f6d2de0af53354eeb.yml diff --git a/src/cloudflare/resources/radar/ai/bots/summary.py b/src/cloudflare/resources/radar/ai/bots/summary.py index c875474238f..1076459c8c1 100644 --- a/src/cloudflare/resources/radar/ai/bots/summary.py +++ b/src/cloudflare/resources/radar/ai/bots/summary.py @@ -91,8 +91,10 @@ def user_agent( format: Format results are returned in. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -197,8 +199,10 @@ async def user_agent( format: Format results are returned in. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, diff --git a/src/cloudflare/resources/radar/ai/inference/summary.py b/src/cloudflare/resources/radar/ai/inference/summary.py index 9abc5c5f937..35c328e190b 100644 --- a/src/cloudflare/resources/radar/ai/inference/summary.py +++ b/src/cloudflare/resources/radar/ai/inference/summary.py @@ -80,8 +80,10 @@ def model( format: Format results are returned in. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. name: Array of names that will be used to name the series in responses. @@ -146,8 +148,10 @@ def task( format: Format results are returned in. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. name: Array of names that will be used to name the series in responses. @@ -233,8 +237,10 @@ async def model( format: Format results are returned in. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. name: Array of names that will be used to name the series in responses. @@ -299,8 +305,10 @@ async def task( format: Format results are returned in. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. name: Array of names that will be used to name the series in responses. diff --git a/src/cloudflare/resources/radar/ai/inference/timeseries_groups/summary.py b/src/cloudflare/resources/radar/ai/inference/timeseries_groups/summary.py index b66faca5e4b..07207a2072a 100644 --- a/src/cloudflare/resources/radar/ai/inference/timeseries_groups/summary.py +++ b/src/cloudflare/resources/radar/ai/inference/timeseries_groups/summary.py @@ -85,8 +85,10 @@ def model( format: Format results are returned in. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. name: Array of names that will be used to name the series in responses. @@ -157,8 +159,10 @@ def task( format: Format results are returned in. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. name: Array of names that will be used to name the series in responses. @@ -250,8 +254,10 @@ async def model( format: Format results are returned in. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. name: Array of names that will be used to name the series in responses. @@ -322,8 +328,10 @@ async def task( format: Format results are returned in. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. name: Array of names that will be used to name the series in responses. diff --git a/src/cloudflare/resources/radar/ai/timeseries_groups.py b/src/cloudflare/resources/radar/ai/timeseries_groups.py index fce630369e8..ccd3113a42a 100644 --- a/src/cloudflare/resources/radar/ai/timeseries_groups.py +++ b/src/cloudflare/resources/radar/ai/timeseries_groups.py @@ -95,8 +95,10 @@ def user_agent( format: Format results are returned in. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -206,8 +208,10 @@ async def user_agent( format: Format results are returned in. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, diff --git a/src/cloudflare/resources/radar/as112/summary.py b/src/cloudflare/resources/radar/as112/summary.py index 2eefce896cc..a13d6d2bd54 100644 --- a/src/cloudflare/resources/radar/as112/summary.py +++ b/src/cloudflare/resources/radar/as112/summary.py @@ -418,8 +418,10 @@ def query_type( format: Format results are returned in. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -502,8 +504,10 @@ def response_codes( format: Format results are returned in. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -923,8 +927,10 @@ async def query_type( format: Format results are returned in. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -1007,8 +1013,10 @@ async def response_codes( format: Format results are returned in. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, diff --git a/src/cloudflare/resources/radar/as112/timeseries_groups.py b/src/cloudflare/resources/radar/as112/timeseries_groups.py index 818edcc3eea..db37c9b8831 100644 --- a/src/cloudflare/resources/radar/as112/timeseries_groups.py +++ b/src/cloudflare/resources/radar/as112/timeseries_groups.py @@ -447,8 +447,10 @@ def query_type( format: Format results are returned in. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -538,8 +540,10 @@ def response_codes( format: Format results are returned in. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -991,8 +995,10 @@ async def query_type( format: Format results are returned in. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -1082,8 +1088,10 @@ async def response_codes( format: Format results are returned in. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, diff --git a/src/cloudflare/resources/radar/attacks/layer3/summary.py b/src/cloudflare/resources/radar/attacks/layer3/summary.py index da9c2220a2f..aca17e78a54 100644 --- a/src/cloudflare/resources/radar/attacks/layer3/summary.py +++ b/src/cloudflare/resources/radar/attacks/layer3/summary.py @@ -439,8 +439,10 @@ def vector( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -887,8 +889,10 @@ async def vector( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, diff --git a/src/cloudflare/resources/radar/attacks/layer3/timeseries_groups.py b/src/cloudflare/resources/radar/attacks/layer3/timeseries_groups.py index 3aab1090265..87d14552a5b 100644 --- a/src/cloudflare/resources/radar/attacks/layer3/timeseries_groups.py +++ b/src/cloudflare/resources/radar/attacks/layer3/timeseries_groups.py @@ -307,8 +307,10 @@ def industry( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -595,8 +597,10 @@ def vector( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -697,8 +701,10 @@ def vertical( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -1014,8 +1020,10 @@ async def industry( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -1302,8 +1310,10 @@ async def vector( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -1404,8 +1414,10 @@ async def vertical( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, diff --git a/src/cloudflare/resources/radar/attacks/layer7/summary.py b/src/cloudflare/resources/radar/attacks/layer7/summary.py index 64036045174..a5c52c855e7 100644 --- a/src/cloudflare/resources/radar/attacks/layer7/summary.py +++ b/src/cloudflare/resources/radar/attacks/layer7/summary.py @@ -112,8 +112,10 @@ def http_method( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -558,8 +560,10 @@ def managed_rules( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -707,8 +711,10 @@ def mitigation_product( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -827,8 +833,10 @@ async def http_method( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -1273,8 +1281,10 @@ async def managed_rules( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -1422,8 +1432,10 @@ async def mitigation_product( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, diff --git a/src/cloudflare/resources/radar/attacks/layer7/timeseries_groups.py b/src/cloudflare/resources/radar/attacks/layer7/timeseries_groups.py index c1678312918..56029b47f92 100644 --- a/src/cloudflare/resources/radar/attacks/layer7/timeseries_groups.py +++ b/src/cloudflare/resources/radar/attacks/layer7/timeseries_groups.py @@ -124,8 +124,10 @@ def http_method( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -446,8 +448,10 @@ def industry( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -769,8 +773,10 @@ def managed_rules( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -929,8 +935,10 @@ def mitigation_product( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -1094,8 +1102,10 @@ def vertical( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -1228,8 +1238,10 @@ async def http_method( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -1550,8 +1562,10 @@ async def industry( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -1873,8 +1887,10 @@ async def managed_rules( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -2033,8 +2049,10 @@ async def mitigation_product( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -2198,8 +2216,10 @@ async def vertical( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, diff --git a/src/cloudflare/resources/radar/http/timeseries_groups.py b/src/cloudflare/resources/radar/http/timeseries_groups.py index 49a836dc8ae..f81fb20fd7f 100644 --- a/src/cloudflare/resources/radar/http/timeseries_groups.py +++ b/src/cloudflare/resources/radar/http/timeseries_groups.py @@ -248,8 +248,10 @@ def browser( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -369,8 +371,10 @@ def browser_family( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -1409,8 +1413,10 @@ async def browser( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, @@ -1530,8 +1536,10 @@ async def browser_family( ip_version: Filter for ip version. - limit_per_group: Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. location: Array of comma separated list of locations (alpha-2 country codes). Start with `-` to exclude from results. For example, `-US,PT` excludes results from the US, diff --git a/src/cloudflare/resources/radar/ranking/ranking.py b/src/cloudflare/resources/radar/ranking/ranking.py index 39fcc521abb..5880b49037c 100644 --- a/src/cloudflare/resources/radar/ranking/ranking.py +++ b/src/cloudflare/resources/radar/ranking/ranking.py @@ -80,6 +80,7 @@ def timeseries_groups( date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, date_range: List[str] | NotGiven = NOT_GIVEN, date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, + domain_category: List[str] | NotGiven = NOT_GIVEN, domains: List[str] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, @@ -106,6 +107,8 @@ def timeseries_groups( date_start: Array of datetimes to filter the start of a series. + domain_category: Filter by domain category. + domains: Array of comma separated list of domains names. format: Format results are returned in. @@ -138,6 +141,7 @@ def timeseries_groups( "date_end": date_end, "date_range": date_range, "date_start": date_start, + "domain_category": domain_category, "domains": domains, "format": format, "limit": limit, @@ -156,6 +160,7 @@ def top( self, *, date: List[Union[str, date]] | NotGiven = NOT_GIVEN, + domain_category: List[str] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, @@ -178,6 +183,8 @@ def top( Args: date: Array of dates to filter the ranking. + domain_category: Filter by domain category. + format: Format results are returned in. limit: Limit the number of objects in the response. @@ -206,6 +213,7 @@ def top( query=maybe_transform( { "date": date, + "domain_category": domain_category, "format": format, "limit": limit, "location": location, @@ -254,6 +262,7 @@ async def timeseries_groups( date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, date_range: List[str] | NotGiven = NOT_GIVEN, date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, + domain_category: List[str] | NotGiven = NOT_GIVEN, domains: List[str] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, @@ -280,6 +289,8 @@ async def timeseries_groups( date_start: Array of datetimes to filter the start of a series. + domain_category: Filter by domain category. + domains: Array of comma separated list of domains names. format: Format results are returned in. @@ -312,6 +323,7 @@ async def timeseries_groups( "date_end": date_end, "date_range": date_range, "date_start": date_start, + "domain_category": domain_category, "domains": domains, "format": format, "limit": limit, @@ -330,6 +342,7 @@ async def top( self, *, date: List[Union[str, date]] | NotGiven = NOT_GIVEN, + domain_category: List[str] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, @@ -352,6 +365,8 @@ async def top( Args: date: Array of dates to filter the ranking. + domain_category: Filter by domain category. + format: Format results are returned in. limit: Limit the number of objects in the response. @@ -380,6 +395,7 @@ async def top( query=await async_maybe_transform( { "date": date, + "domain_category": domain_category, "format": format, "limit": limit, "location": location, diff --git a/src/cloudflare/types/radar/ai/bots/summary_user_agent_params.py b/src/cloudflare/types/radar/ai/bots/summary_user_agent_params.py index 448b49a9f2c..c9c5d2a8a7d 100644 --- a/src/cloudflare/types/radar/ai/bots/summary_user_agent_params.py +++ b/src/cloudflare/types/radar/ai/bots/summary_user_agent_params.py @@ -44,8 +44,10 @@ class SummaryUserAgentParams(TypedDict, total=False): limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. """ location: List[str] diff --git a/src/cloudflare/types/radar/ai/inference/summary_model_params.py b/src/cloudflare/types/radar/ai/inference/summary_model_params.py index 050a7e9d487..4c64260d54e 100644 --- a/src/cloudflare/types/radar/ai/inference/summary_model_params.py +++ b/src/cloudflare/types/radar/ai/inference/summary_model_params.py @@ -30,8 +30,10 @@ class SummaryModelParams(TypedDict, total=False): limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. """ name: List[str] diff --git a/src/cloudflare/types/radar/ai/inference/summary_task_params.py b/src/cloudflare/types/radar/ai/inference/summary_task_params.py index 468a554182f..95c3d7c5001 100644 --- a/src/cloudflare/types/radar/ai/inference/summary_task_params.py +++ b/src/cloudflare/types/radar/ai/inference/summary_task_params.py @@ -30,8 +30,10 @@ class SummaryTaskParams(TypedDict, total=False): limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. """ name: List[str] diff --git a/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_model_params.py b/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_model_params.py index 64ddb78649e..15e67216fa4 100644 --- a/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_model_params.py +++ b/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_model_params.py @@ -37,8 +37,10 @@ class SummaryModelParams(TypedDict, total=False): limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. """ name: List[str] diff --git a/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_task_params.py b/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_task_params.py index 13ce2929720..454700028ef 100644 --- a/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_task_params.py +++ b/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_task_params.py @@ -37,8 +37,10 @@ class SummaryTaskParams(TypedDict, total=False): limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. """ name: List[str] diff --git a/src/cloudflare/types/radar/ai/timeseries_group_user_agent_params.py b/src/cloudflare/types/radar/ai/timeseries_group_user_agent_params.py index 3ac969533dc..2872b380571 100644 --- a/src/cloudflare/types/radar/ai/timeseries_group_user_agent_params.py +++ b/src/cloudflare/types/radar/ai/timeseries_group_user_agent_params.py @@ -51,8 +51,10 @@ class TimeseriesGroupUserAgentParams(TypedDict, total=False): limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. """ location: List[str] diff --git a/src/cloudflare/types/radar/as112/summary_query_type_params.py b/src/cloudflare/types/radar/as112/summary_query_type_params.py index 6ff8f600ad8..cf165b13dc5 100644 --- a/src/cloudflare/types/radar/as112/summary_query_type_params.py +++ b/src/cloudflare/types/radar/as112/summary_query_type_params.py @@ -44,8 +44,10 @@ class SummaryQueryTypeParams(TypedDict, total=False): limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. """ location: List[str] diff --git a/src/cloudflare/types/radar/as112/summary_response_codes_params.py b/src/cloudflare/types/radar/as112/summary_response_codes_params.py index 1ee19186ded..8408087e475 100644 --- a/src/cloudflare/types/radar/as112/summary_response_codes_params.py +++ b/src/cloudflare/types/radar/as112/summary_response_codes_params.py @@ -44,8 +44,10 @@ class SummaryResponseCodesParams(TypedDict, total=False): limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. """ location: List[str] diff --git a/src/cloudflare/types/radar/as112/timeseries_group_query_type_params.py b/src/cloudflare/types/radar/as112/timeseries_group_query_type_params.py index cb0afb94023..e8223ad7587 100644 --- a/src/cloudflare/types/radar/as112/timeseries_group_query_type_params.py +++ b/src/cloudflare/types/radar/as112/timeseries_group_query_type_params.py @@ -51,8 +51,10 @@ class TimeseriesGroupQueryTypeParams(TypedDict, total=False): limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. """ location: List[str] diff --git a/src/cloudflare/types/radar/as112/timeseries_group_response_codes_params.py b/src/cloudflare/types/radar/as112/timeseries_group_response_codes_params.py index 50fa3dd1979..f1377b2ca94 100644 --- a/src/cloudflare/types/radar/as112/timeseries_group_response_codes_params.py +++ b/src/cloudflare/types/radar/as112/timeseries_group_response_codes_params.py @@ -51,8 +51,10 @@ class TimeseriesGroupResponseCodesParams(TypedDict, total=False): limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. """ location: List[str] diff --git a/src/cloudflare/types/radar/attacks/layer3/summary_vector_params.py b/src/cloudflare/types/radar/attacks/layer3/summary_vector_params.py index 55e3ea8a30a..6b5744619ee 100644 --- a/src/cloudflare/types/radar/attacks/layer3/summary_vector_params.py +++ b/src/cloudflare/types/radar/attacks/layer3/summary_vector_params.py @@ -46,8 +46,10 @@ class SummaryVectorParams(TypedDict, total=False): limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. """ location: List[str] diff --git a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_industry_params.py b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_industry_params.py index b9474428b97..515faeaacb9 100644 --- a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_industry_params.py +++ b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_industry_params.py @@ -53,8 +53,10 @@ class TimeseriesGroupIndustryParams(TypedDict, total=False): limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. """ location: List[str] diff --git a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_vector_params.py b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_vector_params.py index bdd8255a84a..fbaa2b94630 100644 --- a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_vector_params.py +++ b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_vector_params.py @@ -53,8 +53,10 @@ class TimeseriesGroupVectorParams(TypedDict, total=False): limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. """ location: List[str] diff --git a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_vertical_params.py b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_vertical_params.py index 4e20388b202..d743ba599a2 100644 --- a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_vertical_params.py +++ b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_vertical_params.py @@ -53,8 +53,10 @@ class TimeseriesGroupVerticalParams(TypedDict, total=False): limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. """ location: List[str] diff --git a/src/cloudflare/types/radar/attacks/layer7/summary_http_method_params.py b/src/cloudflare/types/radar/attacks/layer7/summary_http_method_params.py index 056c66ca9f4..bbdab4eeeb2 100644 --- a/src/cloudflare/types/radar/attacks/layer7/summary_http_method_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/summary_http_method_params.py @@ -50,8 +50,10 @@ class SummaryHTTPMethodParams(TypedDict, total=False): limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. """ location: List[str] diff --git a/src/cloudflare/types/radar/attacks/layer7/summary_managed_rules_params.py b/src/cloudflare/types/radar/attacks/layer7/summary_managed_rules_params.py index 16197925be5..7806a0a359f 100644 --- a/src/cloudflare/types/radar/attacks/layer7/summary_managed_rules_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/summary_managed_rules_params.py @@ -105,8 +105,10 @@ class SummaryManagedRulesParams(TypedDict, total=False): limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. """ location: List[str] diff --git a/src/cloudflare/types/radar/attacks/layer7/summary_mitigation_product_params.py b/src/cloudflare/types/radar/attacks/layer7/summary_mitigation_product_params.py index 55a45aa7fc1..4b27aa2249a 100644 --- a/src/cloudflare/types/radar/attacks/layer7/summary_mitigation_product_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/summary_mitigation_product_params.py @@ -105,8 +105,10 @@ class SummaryMitigationProductParams(TypedDict, total=False): limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. """ location: List[str] diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_method_params.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_method_params.py index 098e2050b40..debc2ef8f21 100644 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_method_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_method_params.py @@ -57,8 +57,10 @@ class TimeseriesGroupHTTPMethodParams(TypedDict, total=False): limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. """ location: List[str] diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_industry_params.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_industry_params.py index 274b5be39b6..aa5b1132116 100644 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_industry_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_industry_params.py @@ -112,8 +112,10 @@ class TimeseriesGroupIndustryParams(TypedDict, total=False): limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. """ location: List[str] diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_managed_rules_params.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_managed_rules_params.py index 055a4d3e140..1a5f1348cf7 100644 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_managed_rules_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_managed_rules_params.py @@ -112,8 +112,10 @@ class TimeseriesGroupManagedRulesParams(TypedDict, total=False): limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. """ location: List[str] diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_mitigation_product_params.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_mitigation_product_params.py index 97c71692e3c..f3b8c35235e 100644 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_mitigation_product_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_mitigation_product_params.py @@ -112,8 +112,10 @@ class TimeseriesGroupMitigationProductParams(TypedDict, total=False): limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. """ location: List[str] diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_vertical_params.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_vertical_params.py index 97c91f53136..6d44b7cfad4 100644 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_vertical_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_vertical_params.py @@ -112,8 +112,10 @@ class TimeseriesGroupVerticalParams(TypedDict, total=False): limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. """ location: List[str] diff --git a/src/cloudflare/types/radar/http/timeseries_group_browser_family_params.py b/src/cloudflare/types/radar/http/timeseries_group_browser_family_params.py index ae16d65d0c7..a54c769250c 100644 --- a/src/cloudflare/types/radar/http/timeseries_group_browser_family_params.py +++ b/src/cloudflare/types/radar/http/timeseries_group_browser_family_params.py @@ -70,8 +70,10 @@ class TimeseriesGroupBrowserFamilyParams(TypedDict, total=False): limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. """ location: List[str] diff --git a/src/cloudflare/types/radar/http/timeseries_group_browser_params.py b/src/cloudflare/types/radar/http/timeseries_group_browser_params.py index 7b2bdbd2ab0..2b0aab2a5eb 100644 --- a/src/cloudflare/types/radar/http/timeseries_group_browser_params.py +++ b/src/cloudflare/types/radar/http/timeseries_group_browser_params.py @@ -70,8 +70,10 @@ class TimeseriesGroupBrowserParams(TypedDict, total=False): limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (eg browsers, verticals, etc) to the top items over - the time range. + Limit the number of objects (e.g., browsers, verticals, etc.) to the top items + within the specified time range. If the limitPerGroup is set, the response will + include that number of items, with the remaining items grouped together under an + "other" category. """ location: List[str] diff --git a/src/cloudflare/types/radar/ranking/domain_get_response.py b/src/cloudflare/types/radar/ranking/domain_get_response.py index 1f2feba60f3..64792b86087 100644 --- a/src/cloudflare/types/radar/ranking/domain_get_response.py +++ b/src/cloudflare/types/radar/ranking/domain_get_response.py @@ -10,11 +10,11 @@ class Details0Category(BaseModel): - id: float + id: int name: str - super_category_id: float = FieldInfo(alias="superCategoryId") + super_category_id: int = FieldInfo(alias="superCategoryId") class Details0TopLocation(BaseModel): @@ -28,13 +28,13 @@ class Details0TopLocation(BaseModel): class Details0(BaseModel): categories: List[Details0Category] - top_locations: List[Details0TopLocation] - bucket: Optional[str] = None """Only available in POPULAR ranking for the most recent ranking.""" rank: Optional[int] = None + top_locations: Optional[List[Details0TopLocation]] = None + class DomainGetResponse(BaseModel): details_0: Details0 diff --git a/src/cloudflare/types/radar/ranking_timeseries_groups_params.py b/src/cloudflare/types/radar/ranking_timeseries_groups_params.py index f9f165cc336..e942258f0f9 100644 --- a/src/cloudflare/types/radar/ranking_timeseries_groups_params.py +++ b/src/cloudflare/types/radar/ranking_timeseries_groups_params.py @@ -25,6 +25,9 @@ class RankingTimeseriesGroupsParams(TypedDict, total=False): date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] """Array of datetimes to filter the start of a series.""" + domain_category: Annotated[List[str], PropertyInfo(alias="domainCategory")] + """Filter by domain category.""" + domains: List[str] """Array of comma separated list of domains names.""" diff --git a/src/cloudflare/types/radar/ranking_top_params.py b/src/cloudflare/types/radar/ranking_top_params.py index 903af228882..8508b5159b5 100644 --- a/src/cloudflare/types/radar/ranking_top_params.py +++ b/src/cloudflare/types/radar/ranking_top_params.py @@ -15,6 +15,9 @@ class RankingTopParams(TypedDict, total=False): date: Annotated[List[Union[str, datetime.date]], PropertyInfo(format="iso8601")] """Array of dates to filter the ranking.""" + domain_category: Annotated[List[str], PropertyInfo(alias="domainCategory")] + """Filter by domain category.""" + format: Literal["JSON", "CSV"] """Format results are returned in.""" diff --git a/tests/api_resources/radar/test_ranking.py b/tests/api_resources/radar/test_ranking.py index 6608571dbd3..56dc29a330d 100644 --- a/tests/api_resources/radar/test_ranking.py +++ b/tests/api_resources/radar/test_ranking.py @@ -32,6 +32,7 @@ def test_method_timeseries_groups_with_all_params(self, client: Cloudflare) -> N date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], date_range=["7d"], date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], + domain_category=["string"], domains=["string"], format="JSON", limit=5, @@ -70,6 +71,7 @@ def test_method_top(self, client: Cloudflare) -> None: def test_method_top_with_all_params(self, client: Cloudflare) -> None: ranking = client.radar.ranking.top( date=[parse_date("2019-12-27")], + domain_category=["string"], format="JSON", limit=5, location=["string"], @@ -113,6 +115,7 @@ async def test_method_timeseries_groups_with_all_params(self, async_client: Asyn date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], date_range=["7d"], date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], + domain_category=["string"], domains=["string"], format="JSON", limit=5, @@ -151,6 +154,7 @@ async def test_method_top(self, async_client: AsyncCloudflare) -> None: async def test_method_top_with_all_params(self, async_client: AsyncCloudflare) -> None: ranking = await async_client.radar.ranking.top( date=[parse_date("2019-12-27")], + domain_category=["string"], format="JSON", limit=5, location=["string"], From 76522e5a9df892b51d3318b52d3941f5c0fbf590 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2025 15:02:01 +0000 Subject: [PATCH 258/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 4c2fe1e05a2..7f66324af5c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-51b1f2acb15cc7a66f2a8fc56e81aa748942150e65ff661f6d2de0af53354eeb.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cd12abbd19e3cd03a1a2ef4ae8949df901c87fd0e135f1cb44c9a91ea0c10114.yml From 0b5ad5fffc079e14e07c170229c03384f50ac8e8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2025 15:05:49 +0000 Subject: [PATCH 259/358] chore(internal): fix devcontainers setup (#2470) --- .devcontainer/Dockerfile | 2 +- .devcontainer/devcontainer.json | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index ac9a2e75218..55d20255c90 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -6,4 +6,4 @@ USER vscode RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.35.0" RYE_INSTALL_OPTION="--yes" bash ENV PATH=/home/vscode/.rye/shims:$PATH -RUN echo "[[ -d .venv ]] && source .venv/bin/activate" >> /home/vscode/.bashrc +RUN echo "[[ -d .venv ]] && source .venv/bin/activate || export PATH=\$PATH" >> /home/vscode/.bashrc diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index bbeb30b148c..c17fdc169fc 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -24,6 +24,9 @@ } } } + }, + "features": { + "ghcr.io/devcontainers/features/node:1": {} } // Features to add to the dev container. More info: https://containers.dev/features. From cc270fe1af958d22adaac6dc223b9abd8cfed508 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2025 16:12:17 +0000 Subject: [PATCH 260/358] feat(api): api update (#2471) --- .stats.yml | 2 +- .../resources/rulesets/phases/phases.py | 16 +++--- src/cloudflare/resources/rulesets/rulesets.py | 32 ++++++------ .../types/rulesets/phase_update_params.py | 6 +-- .../types/rulesets/ruleset_create_params.py | 6 +-- .../types/rulesets/ruleset_update_params.py | 6 +-- tests/api_resources/rulesets/test_phases.py | 22 +++----- tests/api_resources/test_rulesets.py | 50 ++++++------------- 8 files changed, 54 insertions(+), 86 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7f66324af5c..d96f26c7bcc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cd12abbd19e3cd03a1a2ef4ae8949df901c87fd0e135f1cb44c9a91ea0c10114.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-810167d438e9db6d2847c28e396935a1f0f7827f3dd93af3ea01d8ebb356f23e.yml diff --git a/src/cloudflare/resources/rulesets/phases/phases.py b/src/cloudflare/resources/rulesets/phases/phases.py index 5102f9d61c4..3f583de189b 100644 --- a/src/cloudflare/resources/rulesets/phases/phases.py +++ b/src/cloudflare/resources/rulesets/phases/phases.py @@ -65,11 +65,11 @@ def update( self, ruleset_phase: Phase, *, - rules: Iterable[phase_update_params.Rule], account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, + rules: Iterable[phase_update_params.Rule] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -83,8 +83,6 @@ def update( Args: ruleset_phase: The phase of the ruleset. - rules: The list of rules in the ruleset. - account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. @@ -93,6 +91,8 @@ def update( name: The human-readable name of the ruleset. + rules: The list of rules in the ruleset. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -119,9 +119,9 @@ def update( f"/{account_or_zone}/{account_or_zone_id}/rulesets/phases/{ruleset_phase}/entrypoint", body=maybe_transform( { - "rules": rules, "description": description, "name": name, + "rules": rules, }, phase_update_params.PhaseUpdateParams, ), @@ -222,11 +222,11 @@ async def update( self, ruleset_phase: Phase, *, - rules: Iterable[phase_update_params.Rule], account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, + rules: Iterable[phase_update_params.Rule] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -240,8 +240,6 @@ async def update( Args: ruleset_phase: The phase of the ruleset. - rules: The list of rules in the ruleset. - account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. @@ -250,6 +248,8 @@ async def update( name: The human-readable name of the ruleset. + rules: The list of rules in the ruleset. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -276,9 +276,9 @@ async def update( f"/{account_or_zone}/{account_or_zone_id}/rulesets/phases/{ruleset_phase}/entrypoint", body=await async_maybe_transform( { - "rules": rules, "description": description, "name": name, + "rules": rules, }, phase_update_params.PhaseUpdateParams, ), diff --git a/src/cloudflare/resources/rulesets/rulesets.py b/src/cloudflare/resources/rulesets/rulesets.py index b77367eb398..dbe08aef624 100644 --- a/src/cloudflare/resources/rulesets/rulesets.py +++ b/src/cloudflare/resources/rulesets/rulesets.py @@ -95,10 +95,10 @@ def create( kind: Kind, name: str, phase: Phase, - rules: Iterable[ruleset_create_params.Rule], account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, + rules: Iterable[ruleset_create_params.Rule] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -116,14 +116,14 @@ def create( phase: The phase of the ruleset. - rules: The list of rules in the ruleset. - account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. description: An informative description of the ruleset. + rules: The list of rules in the ruleset. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -151,8 +151,8 @@ def create( "kind": kind, "name": name, "phase": phase, - "rules": rules, "description": description, + "rules": rules, }, ruleset_create_params.RulesetCreateParams, ), @@ -170,13 +170,13 @@ def update( self, ruleset_id: str, *, - rules: Iterable[ruleset_update_params.Rule], account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, kind: Kind | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, phase: Phase | NotGiven = NOT_GIVEN, + rules: Iterable[ruleset_update_params.Rule] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -190,8 +190,6 @@ def update( Args: ruleset_id: The unique ID of the ruleset. - rules: The list of rules in the ruleset. - account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. @@ -204,6 +202,8 @@ def update( phase: The phase of the ruleset. + rules: The list of rules in the ruleset. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -230,11 +230,11 @@ def update( f"/{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}", body=maybe_transform( { - "rules": rules, "description": description, "kind": kind, "name": name, "phase": phase, + "rules": rules, }, ruleset_update_params.RulesetUpdateParams, ), @@ -463,10 +463,10 @@ async def create( kind: Kind, name: str, phase: Phase, - rules: Iterable[ruleset_create_params.Rule], account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, + rules: Iterable[ruleset_create_params.Rule] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -484,14 +484,14 @@ async def create( phase: The phase of the ruleset. - rules: The list of rules in the ruleset. - account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. description: An informative description of the ruleset. + rules: The list of rules in the ruleset. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -519,8 +519,8 @@ async def create( "kind": kind, "name": name, "phase": phase, - "rules": rules, "description": description, + "rules": rules, }, ruleset_create_params.RulesetCreateParams, ), @@ -538,13 +538,13 @@ async def update( self, ruleset_id: str, *, - rules: Iterable[ruleset_update_params.Rule], account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, kind: Kind | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, phase: Phase | NotGiven = NOT_GIVEN, + rules: Iterable[ruleset_update_params.Rule] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -558,8 +558,6 @@ async def update( Args: ruleset_id: The unique ID of the ruleset. - rules: The list of rules in the ruleset. - account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. @@ -572,6 +570,8 @@ async def update( phase: The phase of the ruleset. + rules: The list of rules in the ruleset. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -598,11 +598,11 @@ async def update( f"/{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}", body=await async_maybe_transform( { - "rules": rules, "description": description, "kind": kind, "name": name, "phase": phase, + "rules": rules, }, ruleset_update_params.RulesetUpdateParams, ), diff --git a/src/cloudflare/types/rulesets/phase_update_params.py b/src/cloudflare/types/rulesets/phase_update_params.py index a40965b5aae..bd12793e965 100644 --- a/src/cloudflare/types/rulesets/phase_update_params.py +++ b/src/cloudflare/types/rulesets/phase_update_params.py @@ -36,9 +36,6 @@ class PhaseUpdateParams(TypedDict, total=False): - rules: Required[Iterable[Rule]] - """The list of rules in the ruleset.""" - account_id: str """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" @@ -51,6 +48,9 @@ class PhaseUpdateParams(TypedDict, total=False): name: str """The human-readable name of the ruleset.""" + rules: Iterable[Rule] + """The list of rules in the ruleset.""" + class RuleRulesetsChallengeRuleExposedCredentialCheck(TypedDict, total=False): password_expression: Required[str] diff --git a/src/cloudflare/types/rulesets/ruleset_create_params.py b/src/cloudflare/types/rulesets/ruleset_create_params.py index 43543166f7e..c1792db3ba4 100644 --- a/src/cloudflare/types/rulesets/ruleset_create_params.py +++ b/src/cloudflare/types/rulesets/ruleset_create_params.py @@ -47,9 +47,6 @@ class RulesetCreateParams(TypedDict, total=False): phase: Required[Phase] """The phase of the ruleset.""" - rules: Required[Iterable[Rule]] - """The list of rules in the ruleset.""" - account_id: str """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" @@ -59,6 +56,9 @@ class RulesetCreateParams(TypedDict, total=False): description: str """An informative description of the ruleset.""" + rules: Iterable[Rule] + """The list of rules in the ruleset.""" + class RuleRulesetsChallengeRuleExposedCredentialCheck(TypedDict, total=False): password_expression: Required[str] diff --git a/src/cloudflare/types/rulesets/ruleset_update_params.py b/src/cloudflare/types/rulesets/ruleset_update_params.py index 19ef87332f6..46291acc0ec 100644 --- a/src/cloudflare/types/rulesets/ruleset_update_params.py +++ b/src/cloudflare/types/rulesets/ruleset_update_params.py @@ -38,9 +38,6 @@ class RulesetUpdateParams(TypedDict, total=False): - rules: Required[Iterable[Rule]] - """The list of rules in the ruleset.""" - account_id: str """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" @@ -59,6 +56,9 @@ class RulesetUpdateParams(TypedDict, total=False): phase: Phase """The phase of the ruleset.""" + rules: Iterable[Rule] + """The list of rules in the ruleset.""" + class RuleRulesetsChallengeRuleExposedCredentialCheck(TypedDict, total=False): password_expression: Required[str] diff --git a/tests/api_resources/rulesets/test_phases.py b/tests/api_resources/rulesets/test_phases.py index 6aa23e7fcab..cc3f3d4d9a9 100644 --- a/tests/api_resources/rulesets/test_phases.py +++ b/tests/api_resources/rulesets/test_phases.py @@ -22,7 +22,6 @@ class TestPhases: def test_method_update(self, client: Cloudflare) -> None: phase = client.rulesets.phases.update( ruleset_phase="ddos_l4", - rules=[{}], account_id="account_id", ) assert_matches_type(PhaseUpdateResponse, phase, path=["response"]) @@ -32,6 +31,9 @@ def test_method_update(self, client: Cloudflare) -> None: def test_method_update_with_all_params(self, client: Cloudflare) -> None: phase = client.rulesets.phases.update( ruleset_phase="ddos_l4", + account_id="account_id", + description="My ruleset to execute managed rulesets", + name="My ruleset", rules=[ { "id": "3a03d665bac047339bb530ecb439a90d", @@ -64,9 +66,6 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "ref": "my_ref", } ], - account_id="account_id", - description="My ruleset to execute managed rulesets", - name="My ruleset", ) assert_matches_type(PhaseUpdateResponse, phase, path=["response"]) @@ -75,7 +74,6 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_update(self, client: Cloudflare) -> None: response = client.rulesets.phases.with_raw_response.update( ruleset_phase="ddos_l4", - rules=[{}], account_id="account_id", ) @@ -89,7 +87,6 @@ def test_raw_response_update(self, client: Cloudflare) -> None: def test_streaming_response_update(self, client: Cloudflare) -> None: with client.rulesets.phases.with_streaming_response.update( ruleset_phase="ddos_l4", - rules=[{}], account_id="account_id", ) as response: assert not response.is_closed @@ -106,14 +103,12 @@ def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.phases.with_raw_response.update( ruleset_phase="ddos_l4", - rules=[{}], account_id="", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.phases.with_raw_response.update( ruleset_phase="ddos_l4", - rules=[{}], account_id="account_id", ) @@ -187,7 +182,6 @@ class TestAsyncPhases: async def test_method_update(self, async_client: AsyncCloudflare) -> None: phase = await async_client.rulesets.phases.update( ruleset_phase="ddos_l4", - rules=[{}], account_id="account_id", ) assert_matches_type(PhaseUpdateResponse, phase, path=["response"]) @@ -197,6 +191,9 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: phase = await async_client.rulesets.phases.update( ruleset_phase="ddos_l4", + account_id="account_id", + description="My ruleset to execute managed rulesets", + name="My ruleset", rules=[ { "id": "3a03d665bac047339bb530ecb439a90d", @@ -229,9 +226,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "ref": "my_ref", } ], - account_id="account_id", - description="My ruleset to execute managed rulesets", - name="My ruleset", ) assert_matches_type(PhaseUpdateResponse, phase, path=["response"]) @@ -240,7 +234,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.rulesets.phases.with_raw_response.update( ruleset_phase="ddos_l4", - rules=[{}], account_id="account_id", ) @@ -254,7 +247,6 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.rulesets.phases.with_streaming_response.update( ruleset_phase="ddos_l4", - rules=[{}], account_id="account_id", ) as response: assert not response.is_closed @@ -271,14 +263,12 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.phases.with_raw_response.update( ruleset_phase="ddos_l4", - rules=[{}], account_id="", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.phases.with_raw_response.update( ruleset_phase="ddos_l4", - rules=[{}], account_id="account_id", ) diff --git a/tests/api_resources/test_rulesets.py b/tests/api_resources/test_rulesets.py index ab218130c3b..e6d105de5c9 100644 --- a/tests/api_resources/test_rulesets.py +++ b/tests/api_resources/test_rulesets.py @@ -30,7 +30,6 @@ def test_method_create(self, client: Cloudflare) -> None: kind="managed", name="My ruleset", phase="ddos_l4", - rules=[{}], account_id="account_id", ) assert_matches_type(RulesetCreateResponse, ruleset, path=["response"]) @@ -42,6 +41,8 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: kind="managed", name="My ruleset", phase="ddos_l4", + account_id="account_id", + description="My ruleset to execute managed rulesets", rules=[ { "id": "3a03d665bac047339bb530ecb439a90d", @@ -74,8 +75,6 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "ref": "my_ref", } ], - account_id="account_id", - description="My ruleset to execute managed rulesets", ) assert_matches_type(RulesetCreateResponse, ruleset, path=["response"]) @@ -86,7 +85,6 @@ def test_raw_response_create(self, client: Cloudflare) -> None: kind="managed", name="My ruleset", phase="ddos_l4", - rules=[{}], account_id="account_id", ) @@ -102,7 +100,6 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: kind="managed", name="My ruleset", phase="ddos_l4", - rules=[{}], account_id="account_id", ) as response: assert not response.is_closed @@ -121,7 +118,6 @@ def test_path_params_create(self, client: Cloudflare) -> None: kind="managed", name="My ruleset", phase="ddos_l4", - rules=[{}], account_id="", ) @@ -130,7 +126,6 @@ def test_path_params_create(self, client: Cloudflare) -> None: kind="managed", name="My ruleset", phase="ddos_l4", - rules=[{}], account_id="account_id", ) @@ -139,7 +134,6 @@ def test_path_params_create(self, client: Cloudflare) -> None: def test_method_update(self, client: Cloudflare) -> None: ruleset = client.rulesets.update( ruleset_id="2f2feab2026849078ba485f918791bdc", - rules=[{}], account_id="account_id", ) assert_matches_type(RulesetUpdateResponse, ruleset, path=["response"]) @@ -149,6 +143,11 @@ def test_method_update(self, client: Cloudflare) -> None: def test_method_update_with_all_params(self, client: Cloudflare) -> None: ruleset = client.rulesets.update( ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + description="My ruleset to execute managed rulesets", + kind="managed", + name="My ruleset", + phase="ddos_l4", rules=[ { "id": "3a03d665bac047339bb530ecb439a90d", @@ -181,11 +180,6 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "ref": "my_ref", } ], - account_id="account_id", - description="My ruleset to execute managed rulesets", - kind="managed", - name="My ruleset", - phase="ddos_l4", ) assert_matches_type(RulesetUpdateResponse, ruleset, path=["response"]) @@ -194,7 +188,6 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_update(self, client: Cloudflare) -> None: response = client.rulesets.with_raw_response.update( ruleset_id="2f2feab2026849078ba485f918791bdc", - rules=[{}], account_id="account_id", ) @@ -208,7 +201,6 @@ def test_raw_response_update(self, client: Cloudflare) -> None: def test_streaming_response_update(self, client: Cloudflare) -> None: with client.rulesets.with_streaming_response.update( ruleset_id="2f2feab2026849078ba485f918791bdc", - rules=[{}], account_id="account_id", ) as response: assert not response.is_closed @@ -225,21 +217,18 @@ def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.with_raw_response.update( ruleset_id="", - rules=[{}], account_id="account_id", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.with_raw_response.update( ruleset_id="2f2feab2026849078ba485f918791bdc", - rules=[{}], account_id="", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.rulesets.with_raw_response.update( ruleset_id="2f2feab2026849078ba485f918791bdc", - rules=[{}], account_id="account_id", ) @@ -445,7 +434,6 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: kind="managed", name="My ruleset", phase="ddos_l4", - rules=[{}], account_id="account_id", ) assert_matches_type(RulesetCreateResponse, ruleset, path=["response"]) @@ -457,6 +445,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare kind="managed", name="My ruleset", phase="ddos_l4", + account_id="account_id", + description="My ruleset to execute managed rulesets", rules=[ { "id": "3a03d665bac047339bb530ecb439a90d", @@ -489,8 +479,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "ref": "my_ref", } ], - account_id="account_id", - description="My ruleset to execute managed rulesets", ) assert_matches_type(RulesetCreateResponse, ruleset, path=["response"]) @@ -501,7 +489,6 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: kind="managed", name="My ruleset", phase="ddos_l4", - rules=[{}], account_id="account_id", ) @@ -517,7 +504,6 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> kind="managed", name="My ruleset", phase="ddos_l4", - rules=[{}], account_id="account_id", ) as response: assert not response.is_closed @@ -536,7 +522,6 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: kind="managed", name="My ruleset", phase="ddos_l4", - rules=[{}], account_id="", ) @@ -545,7 +530,6 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: kind="managed", name="My ruleset", phase="ddos_l4", - rules=[{}], account_id="account_id", ) @@ -554,7 +538,6 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: async def test_method_update(self, async_client: AsyncCloudflare) -> None: ruleset = await async_client.rulesets.update( ruleset_id="2f2feab2026849078ba485f918791bdc", - rules=[{}], account_id="account_id", ) assert_matches_type(RulesetUpdateResponse, ruleset, path=["response"]) @@ -564,6 +547,11 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: ruleset = await async_client.rulesets.update( ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + description="My ruleset to execute managed rulesets", + kind="managed", + name="My ruleset", + phase="ddos_l4", rules=[ { "id": "3a03d665bac047339bb530ecb439a90d", @@ -596,11 +584,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "ref": "my_ref", } ], - account_id="account_id", - description="My ruleset to execute managed rulesets", - kind="managed", - name="My ruleset", - phase="ddos_l4", ) assert_matches_type(RulesetUpdateResponse, ruleset, path=["response"]) @@ -609,7 +592,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.rulesets.with_raw_response.update( ruleset_id="2f2feab2026849078ba485f918791bdc", - rules=[{}], account_id="account_id", ) @@ -623,7 +605,6 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.rulesets.with_streaming_response.update( ruleset_id="2f2feab2026849078ba485f918791bdc", - rules=[{}], account_id="account_id", ) as response: assert not response.is_closed @@ -640,21 +621,18 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.with_raw_response.update( ruleset_id="", - rules=[{}], account_id="account_id", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.with_raw_response.update( ruleset_id="2f2feab2026849078ba485f918791bdc", - rules=[{}], account_id="", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.rulesets.with_raw_response.update( ruleset_id="2f2feab2026849078ba485f918791bdc", - rules=[{}], account_id="account_id", ) From b0e2e29590166169f2af5899a5e304a5ca65a1e7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2025 16:50:13 +0000 Subject: [PATCH 261/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d96f26c7bcc..feed3f4614c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-810167d438e9db6d2847c28e396935a1f0f7827f3dd93af3ea01d8ebb356f23e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bc2a8b96f53599a6f0f162ea5b6b4cee5c02fd2c1e74fc112fea1ae859281175.yml From c5199633f0668a7fa7bf7c2fa13d4a734278d3ed Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2025 18:28:57 +0000 Subject: [PATCH 262/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index feed3f4614c..982b6a89f1b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bc2a8b96f53599a6f0f162ea5b6b4cee5c02fd2c1e74fc112fea1ae859281175.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9653f4973c6aaffa6c4c1b0639ea1fe74adfc34236f3b12525ae57a0c57bcf74.yml From f730f6fb131e5908cb15c178378c09fa6299446f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2025 19:25:08 +0000 Subject: [PATCH 263/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 982b6a89f1b..25973cb991d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9653f4973c6aaffa6c4c1b0639ea1fe74adfc34236f3b12525ae57a0c57bcf74.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aceb46a6096ef7b92b86e4e66014327b85321a40609902755322071f145c6407.yml From c99c706d0018b34c161f17bb7cc51504594ebd40 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2025 19:55:54 +0000 Subject: [PATCH 264/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 25973cb991d..d0d3eb6d57c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aceb46a6096ef7b92b86e4e66014327b85321a40609902755322071f145c6407.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2e454eebe11a188ff27081bb10470e8a13e018771a4aa38facaaf7036665e85d.yml From c6b9f8f26eb92540512bc92288f28ad76f034fef Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2025 22:25:41 +0000 Subject: [PATCH 265/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d0d3eb6d57c..69fe6ed3467 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2e454eebe11a188ff27081bb10470e8a13e018771a4aa38facaaf7036665e85d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9cbd8285f4ee1edb5fdd9a5290c74510dbc816e5c0071057c8fe34b48d8ecfaa.yml From 7a579ba4d7a650166d72c39246bdc10f38c15937 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2025 22:44:01 +0000 Subject: [PATCH 266/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 69fe6ed3467..777842cb51f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9cbd8285f4ee1edb5fdd9a5290c74510dbc816e5c0071057c8fe34b48d8ecfaa.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5503675d92bd7b1007d7fca636f3d484a239b787f8026c3f96ca718af073d869.yml From 0e99f4aa2c51899d43fdb9b89e78580c74f89c55 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2025 23:03:10 +0000 Subject: [PATCH 267/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 777842cb51f..f07593764a3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5503675d92bd7b1007d7fca636f3d484a239b787f8026c3f96ca718af073d869.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0f28c8f8f8830caf23c8665111d0387273c2b2726116783ea0aba1dabafda9e2.yml From 45dfd6cbbcc7303d4bcbb6fd20ec9dec14223ace Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 22 Feb 2025 00:01:25 +0000 Subject: [PATCH 268/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index f07593764a3..982b6a89f1b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0f28c8f8f8830caf23c8665111d0387273c2b2726116783ea0aba1dabafda9e2.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9653f4973c6aaffa6c4c1b0639ea1fe74adfc34236f3b12525ae57a0c57bcf74.yml From 20bf19b2322e1a2deece1be48d3b63158ad5a486 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 22 Feb 2025 00:46:50 +0000 Subject: [PATCH 269/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 982b6a89f1b..762d20825ff 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9653f4973c6aaffa6c4c1b0639ea1fe74adfc34236f3b12525ae57a0c57bcf74.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-74b81d3729161d4ba657b4cea60793981dd111ba1c42ab69209988145e697b28.yml From a2414a3a1bf5042d945e8234bea7951638652a1e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 22 Feb 2025 06:10:07 +0000 Subject: [PATCH 270/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 762d20825ff..38581fd8da7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-74b81d3729161d4ba657b4cea60793981dd111ba1c42ab69209988145e697b28.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5d8ed040579d58a485f10fd6d220693c6ae5010b4be812a706fae9ba68c1e147.yml From 2ed96dfd29ae1677248fbd3eacc1f8eaa5cb26b6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 22 Feb 2025 06:23:19 +0000 Subject: [PATCH 271/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 38581fd8da7..baaf74e55e7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5d8ed040579d58a485f10fd6d220693c6ae5010b4be812a706fae9ba68c1e147.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-45ea59ca83b17bf4cd844c59620c6a3d6a1ffb17c2102d16a777f60b2d438ffc.yml From c45af1f590dffb94ce48b9b650028a5dd7689f1f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 23 Feb 2025 06:11:14 +0000 Subject: [PATCH 272/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index baaf74e55e7..86c9528f126 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-45ea59ca83b17bf4cd844c59620c6a3d6a1ffb17c2102d16a777f60b2d438ffc.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5e78234f34b079cc909a3be020e8a4c84a341dc48b16bce881a600b5cd10b373.yml From 2101785d7ea19b811093062b724d26369e528ac0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 06:09:43 +0000 Subject: [PATCH 273/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 86c9528f126..7629b62daa1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5e78234f34b079cc909a3be020e8a4c84a341dc48b16bce881a600b5cd10b373.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6a0c7cb4b007c57fb2c61b0534e82091150ad2f7ab3995ce57e387cd05c1d235.yml From f6553042352650a78e014595d2bf159da7175297 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 09:47:35 +0000 Subject: [PATCH 274/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 7629b62daa1..982b6a89f1b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6a0c7cb4b007c57fb2c61b0534e82091150ad2f7ab3995ce57e387cd05c1d235.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9653f4973c6aaffa6c4c1b0639ea1fe74adfc34236f3b12525ae57a0c57bcf74.yml From 3ec2a2554897860299b65e5f5b29945c7d8e3db7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 10:17:53 +0000 Subject: [PATCH 275/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 982b6a89f1b..93fc912197e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9653f4973c6aaffa6c4c1b0639ea1fe74adfc34236f3b12525ae57a0c57bcf74.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-551497de04581e16085d2b1362f6584729d48cd46287649bfec81d273a702c29.yml From f15ee4aa1b2757d5de248cad3176e66ba3b5cffe Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 14:24:59 +0000 Subject: [PATCH 276/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 93fc912197e..d0d3eb6d57c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-551497de04581e16085d2b1362f6584729d48cd46287649bfec81d273a702c29.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2e454eebe11a188ff27081bb10470e8a13e018771a4aa38facaaf7036665e85d.yml From b51122fb4a392a248d15b65c28b6b00e61917016 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 15:58:23 +0000 Subject: [PATCH 277/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d0d3eb6d57c..20a5b07b17d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2e454eebe11a188ff27081bb10470e8a13e018771a4aa38facaaf7036665e85d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bdf0b52e285092f3d235077e3ef26c22345cc0bfe15cbbbb8f67091173f42896.yml From 5cdc70f7db0303777906966716ca86b6f49ada39 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 16:06:50 +0000 Subject: [PATCH 278/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 20a5b07b17d..aa7d213b3d4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bdf0b52e285092f3d235077e3ef26c22345cc0bfe15cbbbb8f67091173f42896.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-558464259ab92dce94ae8985771507941d060fe4c902fc3b399bb27135c2798b.yml From 2187b87133dde81717af17a4b244db3cf4f31cf3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 16:22:06 +0000 Subject: [PATCH 279/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index aa7d213b3d4..e0ca47714bc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-558464259ab92dce94ae8985771507941d060fe4c902fc3b399bb27135c2798b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-dee3d4e9ce0b5bbb9d3c00c4d558426ceca0a6aec52a77d65d87d5e73fe63269.yml From 8251c62dd6954218d177bc63e4e14b25cf2d3fd0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 16:26:13 +0000 Subject: [PATCH 280/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index e0ca47714bc..95ab520c3a5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-dee3d4e9ce0b5bbb9d3c00c4d558426ceca0a6aec52a77d65d87d5e73fe63269.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2fe54c598f85c7d985fe97150d05474d51ad1bcd065437cbcdd4874cf7711bc6.yml From d1cc93b0e40032b93c9daf36fd179e8de3af9edf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 16:33:56 +0000 Subject: [PATCH 281/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 95ab520c3a5..d0d3eb6d57c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2fe54c598f85c7d985fe97150d05474d51ad1bcd065437cbcdd4874cf7711bc6.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2e454eebe11a188ff27081bb10470e8a13e018771a4aa38facaaf7036665e85d.yml From f3a9ec057502134585f7bd201b131e46dc83d101 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 17:26:30 +0000 Subject: [PATCH 282/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d0d3eb6d57c..03e5fd0955c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2e454eebe11a188ff27081bb10470e8a13e018771a4aa38facaaf7036665e85d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6d8c1b79a575c85b41d109cbee8a3009b03125d237dcde89c1ca75aef2775ef8.yml From 6b81c502a95ebe8973614434039e87fbf7c59bcb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 17:29:31 +0000 Subject: [PATCH 283/358] feat(api): api update (#2472) --- .stats.yml | 2 +- .../types/rulesets/log_custom_field_rule.py | 28 +++++++++- .../rulesets/log_custom_field_rule_param.py | 28 +++++++++- .../types/rulesets/rule_create_params.py | 28 +++++++++- .../types/rulesets/rule_edit_params.py | 28 +++++++++- tests/api_resources/rulesets/test_rules.py | 56 +++++++++++++++++-- 6 files changed, 157 insertions(+), 13 deletions(-) diff --git a/.stats.yml b/.stats.yml index 03e5fd0955c..0a6f8fd7954 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6d8c1b79a575c85b41d109cbee8a3009b03125d237dcde89c1ca75aef2775ef8.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1e25f49ec02dfaf03ca92e33ace635add362f99ec8d6a4a598b92b05617bc2e2.yml diff --git a/src/cloudflare/types/rulesets/log_custom_field_rule.py b/src/cloudflare/types/rulesets/log_custom_field_rule.py index b699045e04f..d73b1a856cf 100644 --- a/src/cloudflare/types/rulesets/log_custom_field_rule.py +++ b/src/cloudflare/types/rulesets/log_custom_field_rule.py @@ -11,8 +11,10 @@ "LogCustomFieldRule", "ActionParameters", "ActionParametersCookieField", + "ActionParametersRawResponseField", "ActionParametersRequestField", "ActionParametersResponseField", + "ActionParametersTransformedRequestField", "ExposedCredentialCheck", "Ratelimit", ] @@ -23,6 +25,14 @@ class ActionParametersCookieField(BaseModel): """The name of the field.""" +class ActionParametersRawResponseField(BaseModel): + name: str + """The name of the field.""" + + preserve_duplicates: Optional[bool] = None + """Whether to log duplicate values of the same header.""" + + class ActionParametersRequestField(BaseModel): name: str """The name of the field.""" @@ -32,16 +42,30 @@ class ActionParametersResponseField(BaseModel): name: str """The name of the field.""" + preserve_duplicates: Optional[bool] = None + """Whether to log duplicate values of the same header.""" + + +class ActionParametersTransformedRequestField(BaseModel): + name: str + """The name of the field.""" + class ActionParameters(BaseModel): cookie_fields: Optional[List[ActionParametersCookieField]] = None """The cookie fields to log.""" + raw_response_fields: Optional[List[ActionParametersRawResponseField]] = None + """The raw response fields to log.""" + request_fields: Optional[List[ActionParametersRequestField]] = None - """The request fields to log.""" + """The raw request fields to log.""" response_fields: Optional[List[ActionParametersResponseField]] = None - """The response fields to log.""" + """The transformed response fields to log.""" + + transformed_request_fields: Optional[List[ActionParametersTransformedRequestField]] = None + """The transformed request fields to log.""" class ExposedCredentialCheck(BaseModel): diff --git a/src/cloudflare/types/rulesets/log_custom_field_rule_param.py b/src/cloudflare/types/rulesets/log_custom_field_rule_param.py index e19f68fdbd1..a2103644fee 100644 --- a/src/cloudflare/types/rulesets/log_custom_field_rule_param.py +++ b/src/cloudflare/types/rulesets/log_custom_field_rule_param.py @@ -11,8 +11,10 @@ "LogCustomFieldRuleParam", "ActionParameters", "ActionParametersCookieField", + "ActionParametersRawResponseField", "ActionParametersRequestField", "ActionParametersResponseField", + "ActionParametersTransformedRequestField", "ExposedCredentialCheck", "Ratelimit", ] @@ -23,6 +25,14 @@ class ActionParametersCookieField(TypedDict, total=False): """The name of the field.""" +class ActionParametersRawResponseField(TypedDict, total=False): + name: Required[str] + """The name of the field.""" + + preserve_duplicates: bool + """Whether to log duplicate values of the same header.""" + + class ActionParametersRequestField(TypedDict, total=False): name: Required[str] """The name of the field.""" @@ -32,16 +42,30 @@ class ActionParametersResponseField(TypedDict, total=False): name: Required[str] """The name of the field.""" + preserve_duplicates: bool + """Whether to log duplicate values of the same header.""" + + +class ActionParametersTransformedRequestField(TypedDict, total=False): + name: Required[str] + """The name of the field.""" + class ActionParameters(TypedDict, total=False): cookie_fields: Iterable[ActionParametersCookieField] """The cookie fields to log.""" + raw_response_fields: Iterable[ActionParametersRawResponseField] + """The raw response fields to log.""" + request_fields: Iterable[ActionParametersRequestField] - """The request fields to log.""" + """The raw request fields to log.""" response_fields: Iterable[ActionParametersResponseField] - """The response fields to log.""" + """The transformed response fields to log.""" + + transformed_request_fields: Iterable[ActionParametersTransformedRequestField] + """The transformed request fields to log.""" class ExposedCredentialCheck(TypedDict, total=False): diff --git a/src/cloudflare/types/rulesets/rule_create_params.py b/src/cloudflare/types/rulesets/rule_create_params.py index bb8fb83441d..942013f6902 100644 --- a/src/cloudflare/types/rulesets/rule_create_params.py +++ b/src/cloudflare/types/rulesets/rule_create_params.py @@ -170,8 +170,10 @@ "LogCustomFieldRule", "LogCustomFieldRuleActionParameters", "LogCustomFieldRuleActionParametersCookieField", + "LogCustomFieldRuleActionParametersRawResponseField", "LogCustomFieldRuleActionParametersRequestField", "LogCustomFieldRuleActionParametersResponseField", + "LogCustomFieldRuleActionParametersTransformedRequestField", "LogCustomFieldRuleExposedCredentialCheck", "LogCustomFieldRulePosition", "LogCustomFieldRulePositionBeforePosition", @@ -2653,6 +2655,14 @@ class LogCustomFieldRuleActionParametersCookieField(TypedDict, total=False): """The name of the field.""" +class LogCustomFieldRuleActionParametersRawResponseField(TypedDict, total=False): + name: Required[str] + """The name of the field.""" + + preserve_duplicates: bool + """Whether to log duplicate values of the same header.""" + + class LogCustomFieldRuleActionParametersRequestField(TypedDict, total=False): name: Required[str] """The name of the field.""" @@ -2662,16 +2672,30 @@ class LogCustomFieldRuleActionParametersResponseField(TypedDict, total=False): name: Required[str] """The name of the field.""" + preserve_duplicates: bool + """Whether to log duplicate values of the same header.""" + + +class LogCustomFieldRuleActionParametersTransformedRequestField(TypedDict, total=False): + name: Required[str] + """The name of the field.""" + class LogCustomFieldRuleActionParameters(TypedDict, total=False): cookie_fields: Iterable[LogCustomFieldRuleActionParametersCookieField] """The cookie fields to log.""" + raw_response_fields: Iterable[LogCustomFieldRuleActionParametersRawResponseField] + """The raw response fields to log.""" + request_fields: Iterable[LogCustomFieldRuleActionParametersRequestField] - """The request fields to log.""" + """The raw request fields to log.""" response_fields: Iterable[LogCustomFieldRuleActionParametersResponseField] - """The response fields to log.""" + """The transformed response fields to log.""" + + transformed_request_fields: Iterable[LogCustomFieldRuleActionParametersTransformedRequestField] + """The transformed request fields to log.""" class LogCustomFieldRuleExposedCredentialCheck(TypedDict, total=False): diff --git a/src/cloudflare/types/rulesets/rule_edit_params.py b/src/cloudflare/types/rulesets/rule_edit_params.py index 396a92a4459..beca5b3766e 100644 --- a/src/cloudflare/types/rulesets/rule_edit_params.py +++ b/src/cloudflare/types/rulesets/rule_edit_params.py @@ -170,8 +170,10 @@ "LogCustomFieldRule", "LogCustomFieldRuleActionParameters", "LogCustomFieldRuleActionParametersCookieField", + "LogCustomFieldRuleActionParametersRawResponseField", "LogCustomFieldRuleActionParametersRequestField", "LogCustomFieldRuleActionParametersResponseField", + "LogCustomFieldRuleActionParametersTransformedRequestField", "LogCustomFieldRuleExposedCredentialCheck", "LogCustomFieldRulePosition", "LogCustomFieldRulePositionBeforePosition", @@ -2701,6 +2703,14 @@ class LogCustomFieldRuleActionParametersCookieField(TypedDict, total=False): """The name of the field.""" +class LogCustomFieldRuleActionParametersRawResponseField(TypedDict, total=False): + name: Required[str] + """The name of the field.""" + + preserve_duplicates: bool + """Whether to log duplicate values of the same header.""" + + class LogCustomFieldRuleActionParametersRequestField(TypedDict, total=False): name: Required[str] """The name of the field.""" @@ -2710,16 +2720,30 @@ class LogCustomFieldRuleActionParametersResponseField(TypedDict, total=False): name: Required[str] """The name of the field.""" + preserve_duplicates: bool + """Whether to log duplicate values of the same header.""" + + +class LogCustomFieldRuleActionParametersTransformedRequestField(TypedDict, total=False): + name: Required[str] + """The name of the field.""" + class LogCustomFieldRuleActionParameters(TypedDict, total=False): cookie_fields: Iterable[LogCustomFieldRuleActionParametersCookieField] """The cookie fields to log.""" + raw_response_fields: Iterable[LogCustomFieldRuleActionParametersRawResponseField] + """The raw response fields to log.""" + request_fields: Iterable[LogCustomFieldRuleActionParametersRequestField] - """The request fields to log.""" + """The raw request fields to log.""" response_fields: Iterable[LogCustomFieldRuleActionParametersResponseField] - """The response fields to log.""" + """The transformed response fields to log.""" + + transformed_request_fields: Iterable[LogCustomFieldRuleActionParametersTransformedRequestField] + """The transformed request fields to log.""" class LogCustomFieldRuleExposedCredentialCheck(TypedDict, total=False): diff --git a/tests/api_resources/rulesets/test_rules.py b/tests/api_resources/rulesets/test_rules.py index bbae006d39e..5a1acdb5ea9 100644 --- a/tests/api_resources/rulesets/test_rules.py +++ b/tests/api_resources/rulesets/test_rules.py @@ -1535,8 +1535,20 @@ def test_method_create_with_all_params_overload_16(self, client: Cloudflare) -> action="log_custom_field", action_parameters={ "cookie_fields": [{"name": "cookie_name_1"}], + "raw_response_fields": [ + { + "name": "http_response_header_name_1_in_lower_case", + "preserve_duplicates": True, + } + ], "request_fields": [{"name": "http_request_header_name_1_in_lower_case"}], - "response_fields": [{"name": "http_response_header_name_1_in_lower_case"}], + "response_fields": [ + { + "name": "http_response_header_name_1_in_lower_case", + "preserve_duplicates": True, + } + ], + "transformed_request_fields": [{"name": "http_request_header_name_1_in_lower_case"}], }, description="Log custom field when the IP address is not 1.1.1.1", enabled=True, @@ -3597,8 +3609,20 @@ def test_method_edit_with_all_params_overload_16(self, client: Cloudflare) -> No action="log_custom_field", action_parameters={ "cookie_fields": [{"name": "cookie_name_1"}], + "raw_response_fields": [ + { + "name": "http_response_header_name_1_in_lower_case", + "preserve_duplicates": True, + } + ], "request_fields": [{"name": "http_request_header_name_1_in_lower_case"}], - "response_fields": [{"name": "http_response_header_name_1_in_lower_case"}], + "response_fields": [ + { + "name": "http_response_header_name_1_in_lower_case", + "preserve_duplicates": True, + } + ], + "transformed_request_fields": [{"name": "http_request_header_name_1_in_lower_case"}], }, description="Log custom field when the IP address is not 1.1.1.1", enabled=True, @@ -5410,8 +5434,20 @@ async def test_method_create_with_all_params_overload_16(self, async_client: Asy action="log_custom_field", action_parameters={ "cookie_fields": [{"name": "cookie_name_1"}], + "raw_response_fields": [ + { + "name": "http_response_header_name_1_in_lower_case", + "preserve_duplicates": True, + } + ], "request_fields": [{"name": "http_request_header_name_1_in_lower_case"}], - "response_fields": [{"name": "http_response_header_name_1_in_lower_case"}], + "response_fields": [ + { + "name": "http_response_header_name_1_in_lower_case", + "preserve_duplicates": True, + } + ], + "transformed_request_fields": [{"name": "http_request_header_name_1_in_lower_case"}], }, description="Log custom field when the IP address is not 1.1.1.1", enabled=True, @@ -7472,8 +7508,20 @@ async def test_method_edit_with_all_params_overload_16(self, async_client: Async action="log_custom_field", action_parameters={ "cookie_fields": [{"name": "cookie_name_1"}], + "raw_response_fields": [ + { + "name": "http_response_header_name_1_in_lower_case", + "preserve_duplicates": True, + } + ], "request_fields": [{"name": "http_request_header_name_1_in_lower_case"}], - "response_fields": [{"name": "http_response_header_name_1_in_lower_case"}], + "response_fields": [ + { + "name": "http_response_header_name_1_in_lower_case", + "preserve_duplicates": True, + } + ], + "transformed_request_fields": [{"name": "http_request_header_name_1_in_lower_case"}], }, description="Log custom field when the IP address is not 1.1.1.1", enabled=True, From 7901dff14d33964bd27f06be37e83b686c9e0fd9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 18:09:54 +0000 Subject: [PATCH 284/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 0a6f8fd7954..467216585a8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1e25f49ec02dfaf03ca92e33ace635add362f99ec8d6a4a598b92b05617bc2e2.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-77263420ee84b087764d5803329c411a7e3d75a773485a394fd4076988afb50b.yml From 663706107668c4c0e1fa18eccdb87af1ad162c90 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 19:09:19 +0000 Subject: [PATCH 285/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 467216585a8..326b166657c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-77263420ee84b087764d5803329c411a7e3d75a773485a394fd4076988afb50b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-dec5024467d9054d3712b0022e1b2760b31fc189404d3e6ddbc663dd0fd0d717.yml From 9823b64c86ef72993aa3b7f6e7ee842194f2843e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 20:30:12 +0000 Subject: [PATCH 286/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 326b166657c..eeff5885185 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-dec5024467d9054d3712b0022e1b2760b31fc189404d3e6ddbc663dd0fd0d717.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f564ca6ff9b7da23773fdfbb171c9fa3a9fc4f92119503ceabc55947d193822a.yml From eb8ac49d7eed6aa5c5a6ff45aaa8b582013976ea Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 20:47:15 +0000 Subject: [PATCH 287/358] feat(api): api update (#2473) --- .stats.yml | 2 +- src/cloudflare/resources/ai/ai.py | 8 ++++++++ src/cloudflare/types/ai/ai_run_params.py | 20 +++++++++++++++++++- tests/api_resources/test_ai.py | 16 ++++++++++++++++ 4 files changed, 44 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index eeff5885185..71975aef381 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f564ca6ff9b7da23773fdfbb171c9fa3a9fc4f92119503ceabc55947d193822a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-452e674010858ce0fde7c08feacd8fbc4fccbf4b317f087361cce10e76014d7d.yml diff --git a/src/cloudflare/resources/ai/ai.py b/src/cloudflare/resources/ai/ai.py index 16ce8cbd61a..bbc218bb3ab 100644 --- a/src/cloudflare/resources/ai/ai.py +++ b/src/cloudflare/resources/ai/ai.py @@ -424,6 +424,7 @@ def run( presence_penalty: float | NotGiven = NOT_GIVEN, raw: bool | NotGiven = NOT_GIVEN, repetition_penalty: float | NotGiven = NOT_GIVEN, + response_format: ai_run_params.PromptResponseFormat | NotGiven = NOT_GIVEN, seed: int | NotGiven = NOT_GIVEN, stream: bool | NotGiven = NOT_GIVEN, temperature: float | NotGiven = NOT_GIVEN, @@ -501,6 +502,7 @@ def run( max_tokens: int | NotGiven = NOT_GIVEN, presence_penalty: float | NotGiven = NOT_GIVEN, repetition_penalty: float | NotGiven = NOT_GIVEN, + response_format: ai_run_params.MessagesResponseFormat | NotGiven = NOT_GIVEN, seed: int | NotGiven = NOT_GIVEN, stream: bool | NotGiven = NOT_GIVEN, temperature: float | NotGiven = NOT_GIVEN, @@ -761,6 +763,7 @@ def run( presence_penalty: float | NotGiven = NOT_GIVEN, raw: bool | NotGiven = NOT_GIVEN, repetition_penalty: float | NotGiven = NOT_GIVEN, + response_format: ai_run_params.PromptResponseFormat | NotGiven = NOT_GIVEN, stream: bool | NotGiven = NOT_GIVEN, temperature: float | NotGiven = NOT_GIVEN, top_k: int | float | NotGiven = NOT_GIVEN, @@ -809,6 +812,7 @@ def run( "presence_penalty": presence_penalty, "raw": raw, "repetition_penalty": repetition_penalty, + "response_format": response_format, "stream": stream, "temperature": temperature, "top_k": top_k, @@ -1198,6 +1202,7 @@ async def run( presence_penalty: float | NotGiven = NOT_GIVEN, raw: bool | NotGiven = NOT_GIVEN, repetition_penalty: float | NotGiven = NOT_GIVEN, + response_format: ai_run_params.PromptResponseFormat | NotGiven = NOT_GIVEN, seed: int | NotGiven = NOT_GIVEN, stream: bool | NotGiven = NOT_GIVEN, temperature: float | NotGiven = NOT_GIVEN, @@ -1275,6 +1280,7 @@ async def run( max_tokens: int | NotGiven = NOT_GIVEN, presence_penalty: float | NotGiven = NOT_GIVEN, repetition_penalty: float | NotGiven = NOT_GIVEN, + response_format: ai_run_params.MessagesResponseFormat | NotGiven = NOT_GIVEN, seed: int | NotGiven = NOT_GIVEN, stream: bool | NotGiven = NOT_GIVEN, temperature: float | NotGiven = NOT_GIVEN, @@ -1535,6 +1541,7 @@ async def run( presence_penalty: float | NotGiven = NOT_GIVEN, raw: bool | NotGiven = NOT_GIVEN, repetition_penalty: float | NotGiven = NOT_GIVEN, + response_format: ai_run_params.PromptResponseFormat | NotGiven = NOT_GIVEN, stream: bool | NotGiven = NOT_GIVEN, temperature: float | NotGiven = NOT_GIVEN, top_k: int | float | NotGiven = NOT_GIVEN, @@ -1583,6 +1590,7 @@ async def run( "presence_penalty": presence_penalty, "raw": raw, "repetition_penalty": repetition_penalty, + "response_format": response_format, "stream": stream, "temperature": temperature, "top_k": top_k, diff --git a/src/cloudflare/types/ai/ai_run_params.py b/src/cloudflare/types/ai/ai_run_params.py index 2027ea80b4b..b1d9bacdac0 100644 --- a/src/cloudflare/types/ai/ai_run_params.py +++ b/src/cloudflare/types/ai/ai_run_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Dict, List, Union, Iterable -from typing_extensions import Required, TypeAlias, TypedDict +from typing_extensions import Literal, Required, TypeAlias, TypedDict __all__ = [ "AIRunParams", @@ -15,9 +15,11 @@ "ImageClassification", "ObjectDetection", "Prompt", + "PromptResponseFormat", "Messages", "MessagesMessage", "MessagesFunction", + "MessagesResponseFormat", "MessagesTool", "MessagesToolUnionMember0", "MessagesToolUnionMember0Parameters", @@ -177,6 +179,8 @@ class Prompt(TypedDict, total=False): repetition_penalty: float """Penalty for repeated tokens; higher values discourage repetition.""" + response_format: PromptResponseFormat + seed: int """Random seed for reproducibility of the generation.""" @@ -207,6 +211,12 @@ class Prompt(TypedDict, total=False): """ +class PromptResponseFormat(TypedDict, total=False): + json_schema: object + + type: Literal["json_object", "json_schema"] + + class Messages(TypedDict, total=False): account_id: Required[str] @@ -227,6 +237,8 @@ class Messages(TypedDict, total=False): repetition_penalty: float """Penalty for repeated tokens; higher values discourage repetition.""" + response_format: MessagesResponseFormat + seed: int """Random seed for reproducibility of the generation.""" @@ -271,6 +283,12 @@ class MessagesFunction(TypedDict, total=False): name: Required[str] +class MessagesResponseFormat(TypedDict, total=False): + json_schema: object + + type: Literal["json_object", "json_schema"] + + class MessagesToolUnionMember0ParametersProperties(TypedDict, total=False): description: Required[str] """A description of the expected parameter.""" diff --git a/tests/api_resources/test_ai.py b/tests/api_resources/test_ai.py index f25b3e34f7e..f65ba01032f 100644 --- a/tests/api_resources/test_ai.py +++ b/tests/api_resources/test_ai.py @@ -453,6 +453,10 @@ def test_method_run_with_all_params_overload_8(self, client: Cloudflare) -> None presence_penalty=0, raw=True, repetition_penalty=0, + response_format={ + "json_schema": {}, + "type": "json_object", + }, seed=1, stream=True, temperature=0, @@ -540,6 +544,10 @@ def test_method_run_with_all_params_overload_9(self, client: Cloudflare) -> None max_tokens=0, presence_penalty=0, repetition_penalty=0, + response_format={ + "json_schema": {}, + "type": "json_object", + }, seed=1, stream=True, temperature=0, @@ -1272,6 +1280,10 @@ async def test_method_run_with_all_params_overload_8(self, async_client: AsyncCl presence_penalty=0, raw=True, repetition_penalty=0, + response_format={ + "json_schema": {}, + "type": "json_object", + }, seed=1, stream=True, temperature=0, @@ -1359,6 +1371,10 @@ async def test_method_run_with_all_params_overload_9(self, async_client: AsyncCl max_tokens=0, presence_penalty=0, repetition_penalty=0, + response_format={ + "json_schema": {}, + "type": "json_object", + }, seed=1, stream=True, temperature=0, From 3545e7d8f3e6d04fa5f802e08844a5ee59b5f420 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 22:12:26 +0000 Subject: [PATCH 288/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 71975aef381..2c1d9868996 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-452e674010858ce0fde7c08feacd8fbc4fccbf4b317f087361cce10e76014d7d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-41835bb2ed1611383ad8dbb5f2618590d176a8d7a18322f6d1eed7b54729812a.yml From a12ddc4d41c4cc39a45fef7c482c903f5a77bfea Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 22:39:02 +0000 Subject: [PATCH 289/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 2c1d9868996..8d1a7db009d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-41835bb2ed1611383ad8dbb5f2618590d176a8d7a18322f6d1eed7b54729812a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-eb41229ef56fd74ffd7c06922fb78eb5a78931922df47f57c5d9d6220d3eed06.yml From 608ab1934b1fa2164ca548859ebcdd7ac894f76a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2025 01:55:56 +0000 Subject: [PATCH 290/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 8d1a7db009d..21855485e12 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-eb41229ef56fd74ffd7c06922fb78eb5a78931922df47f57c5d9d6220d3eed06.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aaec7679ba698000b68154d34857e92effe080da07054e793261adc3fb12b262.yml From 46536495ac84156defb2345bd47c439b3abb10cd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2025 01:59:22 +0000 Subject: [PATCH 291/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 21855485e12..8d1a7db009d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aaec7679ba698000b68154d34857e92effe080da07054e793261adc3fb12b262.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-eb41229ef56fd74ffd7c06922fb78eb5a78931922df47f57c5d9d6220d3eed06.yml From 759427e87333378d1edc218861147b4ce55244e8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2025 02:25:28 +0000 Subject: [PATCH 292/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 8d1a7db009d..da33253168c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-eb41229ef56fd74ffd7c06922fb78eb5a78931922df47f57c5d9d6220d3eed06.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-abf553ae07cce7970b3486b4a43df4a33d0069f3e784e745d81ec8375beca600.yml From 93ae6bf509d3749223febbb5b38613fa7900b345 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2025 02:28:25 +0000 Subject: [PATCH 293/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index da33253168c..21855485e12 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-abf553ae07cce7970b3486b4a43df4a33d0069f3e784e745d81ec8375beca600.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aaec7679ba698000b68154d34857e92effe080da07054e793261adc3fb12b262.yml From 79066b0491cbbcc75f19813c57a291f5ab347118 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2025 06:10:20 +0000 Subject: [PATCH 294/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 21855485e12..022c7af3132 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aaec7679ba698000b68154d34857e92effe080da07054e793261adc3fb12b262.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6629c1d68f9ae68e62f5a90e4395b7727fb6d19a116c08a616eed9b9553f7596.yml From d9c0b6cd902a127bd67a626aa34b0f3fe55dad29 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2025 11:32:37 +0000 Subject: [PATCH 295/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 022c7af3132..9c571b5738d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6629c1d68f9ae68e62f5a90e4395b7727fb6d19a116c08a616eed9b9553f7596.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3b21f7cccc18327726c7cb98013d7b72659de848235525cb994f0994dcec0aa6.yml From d009183a9590d585a5e810beeba414567b0f26b9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2025 12:00:27 +0000 Subject: [PATCH 296/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 9c571b5738d..d2d5c65fedc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3b21f7cccc18327726c7cb98013d7b72659de848235525cb994f0994dcec0aa6.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5aea83ce79db5517dd2574739d5050faa52b7c196d38fb429604d3910ba5cf94.yml From ecdbb3eba5b5d6c091c6409c58072af2b87faac3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2025 13:35:37 +0000 Subject: [PATCH 297/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d2d5c65fedc..8f1105d4f2b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5aea83ce79db5517dd2574739d5050faa52b7c196d38fb429604d3910ba5cf94.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-78985bbe101fcb1313466efbae3c604f24521fafb1c4ee58a538a816070d95cb.yml From 2013c51789bb83e007abeedd17ecefcc1e70e396 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2025 14:39:29 +0000 Subject: [PATCH 298/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 8f1105d4f2b..693bea37750 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-78985bbe101fcb1313466efbae3c604f24521fafb1c4ee58a538a816070d95cb.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-62384d87f79fce84af3f611622d32027651b3544d1ad782a1e2c64e74366b183.yml From f4b821be81fde76d5eb65f5bc243ecc8c6e8c0af Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2025 15:17:53 +0000 Subject: [PATCH 299/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 693bea37750..d7dcd4fbe6f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-62384d87f79fce84af3f611622d32027651b3544d1ad782a1e2c64e74366b183.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6864e65d53ea341dfa2da4de8d2bf2237639c20726f0ea4fb8c0f57827863823.yml From 15e19793afb86c061fe1e9c6735316da7cdeeecf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2025 15:27:14 +0000 Subject: [PATCH 300/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d7dcd4fbe6f..98d7b142367 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6864e65d53ea341dfa2da4de8d2bf2237639c20726f0ea4fb8c0f57827863823.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-56b46c6ae1f7517158f29fa980d93f797941a213cce2a5a0812fe5d99ad1822e.yml From 277d4eee9e9aabf6eeab3ab9b8ba3aee06ac2ba1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2025 15:35:27 +0000 Subject: [PATCH 301/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 98d7b142367..7f4f9426c58 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-56b46c6ae1f7517158f29fa980d93f797941a213cce2a5a0812fe5d99ad1822e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2f8a0617b1fa22b1c401d2276be0fd66dd2eee35c9005a9ea2d2deea7ee55637.yml From f7a03e224765a2162b5f74ab8ea36eef76fa7237 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2025 18:34:34 +0000 Subject: [PATCH 302/358] feat(api): api update (#2474) --- .stats.yml | 2 +- .../magic_network_monitoring/rules/rules.py | 37 ++++++---------- .../magic_network_monitoring_rule.py | 32 ++++++++++---- .../rule_create_params.py | 8 ++-- .../rule_edit_params.py | 8 ++-- .../rule_update_params.py | 8 ++-- .../magic_network_monitoring/test_rules.py | 44 +++++++++---------- 7 files changed, 68 insertions(+), 71 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7f4f9426c58..e8483f182fc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2f8a0617b1fa22b1c401d2276be0fd66dd2eee35c9005a9ea2d2deea7ee55637.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1b7e8a8d202a9d07964ed940d0213d0a0b90fbe9580df0f4586579f526c11eca.yml diff --git a/src/cloudflare/resources/magic_network_monitoring/rules/rules.py b/src/cloudflare/resources/magic_network_monitoring/rules/rules.py index 9427a504bc7..c7c9f26cce1 100644 --- a/src/cloudflare/resources/magic_network_monitoring/rules/rules.py +++ b/src/cloudflare/resources/magic_network_monitoring/rules/rules.py @@ -3,6 +3,7 @@ from __future__ import annotations from typing import List, Type, Optional, cast +from typing_extensions import Literal import httpx @@ -64,7 +65,7 @@ def create( self, *, account_id: str, - duration: str, + duration: Literal["1m", "5m", "10m", "15m", "20m", "30m", "45m", "60m"], name: str, automatic_advertisement: Optional[bool] | NotGiven = NOT_GIVEN, bandwidth: float | NotGiven = NOT_GIVEN, @@ -85,9 +86,7 @@ def create( Args: duration: The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 - values ["1m","5m","10m","15m","20m","30m","45m","60m"]. The format is - AhBmCsDmsEusFns where A, B, C, D, E and F durations are optional; however at - least one unit must be provided. + values ["1m","5m","10m","15m","20m","30m","45m","60m"]. name: The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (\\__), dash (-), period (.), and tilde (~). You can’t have a space in @@ -140,7 +139,7 @@ def update( self, *, account_id: str, - duration: str, + duration: Literal["1m", "5m", "10m", "15m", "20m", "30m", "45m", "60m"], name: str, id: str | NotGiven = NOT_GIVEN, automatic_advertisement: Optional[bool] | NotGiven = NOT_GIVEN, @@ -160,9 +159,7 @@ def update( Args: duration: The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 - values ["1m","5m","10m","15m","20m","30m","45m","60m"]. The format is - AhBmCsDmsEusFns where A, B, C, D, E and F durations are optional; however at - least one unit must be provided. + values ["1m","5m","10m","15m","20m","30m","45m","60m"]. name: The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (\\__), dash (-), period (.), and tilde (~). You can’t have a space in @@ -297,7 +294,7 @@ def edit( account_id: str, automatic_advertisement: Optional[bool] | NotGiven = NOT_GIVEN, bandwidth: float | NotGiven = NOT_GIVEN, - duration: str | NotGiven = NOT_GIVEN, + duration: Literal["1m", "5m", "10m", "15m", "20m", "30m", "45m", "60m"] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, packet_threshold: float | NotGiven = NOT_GIVEN, prefixes: List[str] | NotGiven = NOT_GIVEN, @@ -323,9 +320,7 @@ def edit( duration: The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 - values ["1m","5m","10m","15m","20m","30m","45m","60m"]. The format is - AhBmCsDmsEusFns where A, B, C, D, E and F durations are optional; however at - least one unit must be provided. + values ["1m","5m","10m","15m","20m","30m","45m","60m"]. name: The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (\\__), dash (-), period (.), and tilde (~). You can’t have a space in @@ -440,7 +435,7 @@ async def create( self, *, account_id: str, - duration: str, + duration: Literal["1m", "5m", "10m", "15m", "20m", "30m", "45m", "60m"], name: str, automatic_advertisement: Optional[bool] | NotGiven = NOT_GIVEN, bandwidth: float | NotGiven = NOT_GIVEN, @@ -461,9 +456,7 @@ async def create( Args: duration: The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 - values ["1m","5m","10m","15m","20m","30m","45m","60m"]. The format is - AhBmCsDmsEusFns where A, B, C, D, E and F durations are optional; however at - least one unit must be provided. + values ["1m","5m","10m","15m","20m","30m","45m","60m"]. name: The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (\\__), dash (-), period (.), and tilde (~). You can’t have a space in @@ -516,7 +509,7 @@ async def update( self, *, account_id: str, - duration: str, + duration: Literal["1m", "5m", "10m", "15m", "20m", "30m", "45m", "60m"], name: str, id: str | NotGiven = NOT_GIVEN, automatic_advertisement: Optional[bool] | NotGiven = NOT_GIVEN, @@ -536,9 +529,7 @@ async def update( Args: duration: The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 - values ["1m","5m","10m","15m","20m","30m","45m","60m"]. The format is - AhBmCsDmsEusFns where A, B, C, D, E and F durations are optional; however at - least one unit must be provided. + values ["1m","5m","10m","15m","20m","30m","45m","60m"]. name: The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (\\__), dash (-), period (.), and tilde (~). You can’t have a space in @@ -673,7 +664,7 @@ async def edit( account_id: str, automatic_advertisement: Optional[bool] | NotGiven = NOT_GIVEN, bandwidth: float | NotGiven = NOT_GIVEN, - duration: str | NotGiven = NOT_GIVEN, + duration: Literal["1m", "5m", "10m", "15m", "20m", "30m", "45m", "60m"] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, packet_threshold: float | NotGiven = NOT_GIVEN, prefixes: List[str] | NotGiven = NOT_GIVEN, @@ -699,9 +690,7 @@ async def edit( duration: The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 - values ["1m","5m","10m","15m","20m","30m","45m","60m"]. The format is - AhBmCsDmsEusFns where A, B, C, D, E and F durations are optional; however at - least one unit must be provided. + values ["1m","5m","10m","15m","20m","30m","45m","60m"]. name: The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (\\__), dash (-), period (.), and tilde (~). You can’t have a space in diff --git a/src/cloudflare/types/magic_network_monitoring/magic_network_monitoring_rule.py b/src/cloudflare/types/magic_network_monitoring/magic_network_monitoring_rule.py index 3dbb9d85afa..b9e8c6d7023 100644 --- a/src/cloudflare/types/magic_network_monitoring/magic_network_monitoring_rule.py +++ b/src/cloudflare/types/magic_network_monitoring/magic_network_monitoring_rule.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Optional +from typing_extensions import Literal from ..._models import BaseModel @@ -15,15 +16,6 @@ class MagicNetworkMonitoringRule(BaseModel): available for users of Magic Transit. """ - duration: str - """ - The amount of time that the rule threshold must be exceeded to send an alert - notification. The final value must be equivalent to one of the following 8 - values ["1m","5m","10m","15m","20m","30m","45m","60m"]. The format is - AhBmCsDmsEusFns where A, B, C, D, E and F durations are optional; however at - least one unit must be provided. - """ - name: str """The name of the rule. @@ -34,6 +26,9 @@ class MagicNetworkMonitoringRule(BaseModel): prefixes: List[str] + type: Literal["threshold", "zscore", "advanced_ddos"] + """MNM rule type.""" + id: Optional[str] = None """The id of the rule. Must be unique.""" @@ -44,9 +39,28 @@ class MagicNetworkMonitoringRule(BaseModel): Minimum of 1 and no maximum. """ + duration: Optional[Literal["1m", "5m", "10m", "15m", "20m", "30m", "45m", "60m"]] = None + """ + The amount of time that the rule threshold must be exceeded to send an alert + notification. The final value must be equivalent to one of the following 8 + values ["1m","5m","10m","15m","20m","30m","45m","60m"]. + """ + packet_threshold: Optional[float] = None """The number of packets per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum. """ + + prefix_match: Optional[Literal["exact", "subnet", "supernet"]] = None + """ + Prefix match type to be applied for a prefix auto advertisement when using an + advanced_ddos rule. + """ + + zscore_sensitivity: Optional[Literal["low", "medium", "high"]] = None + """Level of sensitivity set for zscore rules.""" + + zscore_target: Optional[Literal["bits", "packets"]] = None + """Target of the zscore rule analysis.""" diff --git a/src/cloudflare/types/magic_network_monitoring/rule_create_params.py b/src/cloudflare/types/magic_network_monitoring/rule_create_params.py index 353c41693f0..b077e3efa43 100644 --- a/src/cloudflare/types/magic_network_monitoring/rule_create_params.py +++ b/src/cloudflare/types/magic_network_monitoring/rule_create_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List, Optional -from typing_extensions import Required, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["RuleCreateParams"] @@ -11,13 +11,11 @@ class RuleCreateParams(TypedDict, total=False): account_id: Required[str] - duration: Required[str] + duration: Required[Literal["1m", "5m", "10m", "15m", "20m", "30m", "45m", "60m"]] """ The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 - values ["1m","5m","10m","15m","20m","30m","45m","60m"]. The format is - AhBmCsDmsEusFns where A, B, C, D, E and F durations are optional; however at - least one unit must be provided. + values ["1m","5m","10m","15m","20m","30m","45m","60m"]. """ name: Required[str] diff --git a/src/cloudflare/types/magic_network_monitoring/rule_edit_params.py b/src/cloudflare/types/magic_network_monitoring/rule_edit_params.py index c11aaa9e787..d5757763a2e 100644 --- a/src/cloudflare/types/magic_network_monitoring/rule_edit_params.py +++ b/src/cloudflare/types/magic_network_monitoring/rule_edit_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List, Optional -from typing_extensions import Required, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["RuleEditParams"] @@ -25,13 +25,11 @@ class RuleEditParams(TypedDict, total=False): Minimum of 1 and no maximum. """ - duration: str + duration: Literal["1m", "5m", "10m", "15m", "20m", "30m", "45m", "60m"] """ The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 - values ["1m","5m","10m","15m","20m","30m","45m","60m"]. The format is - AhBmCsDmsEusFns where A, B, C, D, E and F durations are optional; however at - least one unit must be provided. + values ["1m","5m","10m","15m","20m","30m","45m","60m"]. """ name: str diff --git a/src/cloudflare/types/magic_network_monitoring/rule_update_params.py b/src/cloudflare/types/magic_network_monitoring/rule_update_params.py index 4c5920c7b6c..741b6f78ef5 100644 --- a/src/cloudflare/types/magic_network_monitoring/rule_update_params.py +++ b/src/cloudflare/types/magic_network_monitoring/rule_update_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List, Optional -from typing_extensions import Required, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["RuleUpdateParams"] @@ -11,13 +11,11 @@ class RuleUpdateParams(TypedDict, total=False): account_id: Required[str] - duration: Required[str] + duration: Required[Literal["1m", "5m", "10m", "15m", "20m", "30m", "45m", "60m"]] """ The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 - values ["1m","5m","10m","15m","20m","30m","45m","60m"]. The format is - AhBmCsDmsEusFns where A, B, C, D, E and F durations are optional; however at - least one unit must be provided. + values ["1m","5m","10m","15m","20m","30m","45m","60m"]. """ name: Required[str] diff --git a/tests/api_resources/magic_network_monitoring/test_rules.py b/tests/api_resources/magic_network_monitoring/test_rules.py index 7a95401cd0c..1f5cbdf0ea3 100644 --- a/tests/api_resources/magic_network_monitoring/test_rules.py +++ b/tests/api_resources/magic_network_monitoring/test_rules.py @@ -24,7 +24,7 @@ class TestRules: def test_method_create(self, client: Cloudflare) -> None: rule = client.magic_network_monitoring.rules.create( account_id="6f91088a406011ed95aed352566e8d4c", - duration="300s", + duration="1m", name="my_rule_1", ) assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) @@ -33,7 +33,7 @@ def test_method_create(self, client: Cloudflare) -> None: def test_method_create_with_all_params(self, client: Cloudflare) -> None: rule = client.magic_network_monitoring.rules.create( account_id="6f91088a406011ed95aed352566e8d4c", - duration="300s", + duration="1m", name="my_rule_1", automatic_advertisement=True, bandwidth=1000, @@ -46,7 +46,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_create(self, client: Cloudflare) -> None: response = client.magic_network_monitoring.rules.with_raw_response.create( account_id="6f91088a406011ed95aed352566e8d4c", - duration="300s", + duration="1m", name="my_rule_1", ) @@ -59,7 +59,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: def test_streaming_response_create(self, client: Cloudflare) -> None: with client.magic_network_monitoring.rules.with_streaming_response.create( account_id="6f91088a406011ed95aed352566e8d4c", - duration="300s", + duration="1m", name="my_rule_1", ) as response: assert not response.is_closed @@ -75,7 +75,7 @@ def test_path_params_create(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.magic_network_monitoring.rules.with_raw_response.create( account_id="", - duration="300s", + duration="1m", name="my_rule_1", ) @@ -84,7 +84,7 @@ def test_path_params_create(self, client: Cloudflare) -> None: def test_method_update(self, client: Cloudflare) -> None: rule = client.magic_network_monitoring.rules.update( account_id="6f91088a406011ed95aed352566e8d4c", - duration="300s", + duration="1m", name="my_rule_1", ) assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) @@ -94,7 +94,7 @@ def test_method_update(self, client: Cloudflare) -> None: def test_method_update_with_all_params(self, client: Cloudflare) -> None: rule = client.magic_network_monitoring.rules.update( account_id="6f91088a406011ed95aed352566e8d4c", - duration="300s", + duration="1m", name="my_rule_1", id="2890e6fa406311ed9b5a23f70f6fb8cf", automatic_advertisement=True, @@ -109,7 +109,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_update(self, client: Cloudflare) -> None: response = client.magic_network_monitoring.rules.with_raw_response.update( account_id="6f91088a406011ed95aed352566e8d4c", - duration="300s", + duration="1m", name="my_rule_1", ) @@ -123,7 +123,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: def test_streaming_response_update(self, client: Cloudflare) -> None: with client.magic_network_monitoring.rules.with_streaming_response.update( account_id="6f91088a406011ed95aed352566e8d4c", - duration="300s", + duration="1m", name="my_rule_1", ) as response: assert not response.is_closed @@ -140,7 +140,7 @@ def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.magic_network_monitoring.rules.with_raw_response.update( account_id="", - duration="300s", + duration="1m", name="my_rule_1", ) @@ -245,7 +245,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: account_id="6f91088a406011ed95aed352566e8d4c", automatic_advertisement=True, bandwidth=1000, - duration="300s", + duration="1m", name="my_rule_1", packet_threshold=10000, prefixes=["203.0.113.1/32"], @@ -348,7 +348,7 @@ class TestAsyncRules: async def test_method_create(self, async_client: AsyncCloudflare) -> None: rule = await async_client.magic_network_monitoring.rules.create( account_id="6f91088a406011ed95aed352566e8d4c", - duration="300s", + duration="1m", name="my_rule_1", ) assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) @@ -357,7 +357,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: rule = await async_client.magic_network_monitoring.rules.create( account_id="6f91088a406011ed95aed352566e8d4c", - duration="300s", + duration="1m", name="my_rule_1", automatic_advertisement=True, bandwidth=1000, @@ -370,7 +370,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.magic_network_monitoring.rules.with_raw_response.create( account_id="6f91088a406011ed95aed352566e8d4c", - duration="300s", + duration="1m", name="my_rule_1", ) @@ -383,7 +383,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.magic_network_monitoring.rules.with_streaming_response.create( account_id="6f91088a406011ed95aed352566e8d4c", - duration="300s", + duration="1m", name="my_rule_1", ) as response: assert not response.is_closed @@ -399,7 +399,7 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.magic_network_monitoring.rules.with_raw_response.create( account_id="", - duration="300s", + duration="1m", name="my_rule_1", ) @@ -408,7 +408,7 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: async def test_method_update(self, async_client: AsyncCloudflare) -> None: rule = await async_client.magic_network_monitoring.rules.update( account_id="6f91088a406011ed95aed352566e8d4c", - duration="300s", + duration="1m", name="my_rule_1", ) assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) @@ -418,7 +418,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: rule = await async_client.magic_network_monitoring.rules.update( account_id="6f91088a406011ed95aed352566e8d4c", - duration="300s", + duration="1m", name="my_rule_1", id="2890e6fa406311ed9b5a23f70f6fb8cf", automatic_advertisement=True, @@ -433,7 +433,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.magic_network_monitoring.rules.with_raw_response.update( account_id="6f91088a406011ed95aed352566e8d4c", - duration="300s", + duration="1m", name="my_rule_1", ) @@ -447,7 +447,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.magic_network_monitoring.rules.with_streaming_response.update( account_id="6f91088a406011ed95aed352566e8d4c", - duration="300s", + duration="1m", name="my_rule_1", ) as response: assert not response.is_closed @@ -464,7 +464,7 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.magic_network_monitoring.rules.with_raw_response.update( account_id="", - duration="300s", + duration="1m", name="my_rule_1", ) @@ -569,7 +569,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) account_id="6f91088a406011ed95aed352566e8d4c", automatic_advertisement=True, bandwidth=1000, - duration="300s", + duration="1m", name="my_rule_1", packet_threshold=10000, prefixes=["203.0.113.1/32"], From f21c9faa4772b95cfa8858780a2dc320b99b450d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2025 19:01:39 +0000 Subject: [PATCH 303/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index e8483f182fc..7d1866f14e7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1b7e8a8d202a9d07964ed940d0213d0a0b90fbe9580df0f4586579f526c11eca.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-04a45bd421e28ee706da1feab38ccbaf3f29822e3331d713d9097d7cc855a07b.yml From 329c314d1756618ef5434817f1077173041a0ebc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2025 19:32:51 +0000 Subject: [PATCH 304/358] chore(internal): codegen related update (#2475) --- src/cloudflare/_base_client.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cloudflare/_base_client.py b/src/cloudflare/_base_client.py index aa4cc191883..2cf50416beb 100644 --- a/src/cloudflare/_base_client.py +++ b/src/cloudflare/_base_client.py @@ -63,7 +63,7 @@ ModelBuilderProtocol, ) from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping -from ._compat import model_copy, model_dump +from ._compat import PYDANTIC_V2, model_copy, model_dump from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type from ._response import ( APIResponse, @@ -207,6 +207,9 @@ def _set_private_attributes( model: Type[_T], options: FinalRequestOptions, ) -> None: + if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None: + self.__pydantic_private__ = {} + self._model = model self._client = client self._options = options @@ -292,6 +295,9 @@ def _set_private_attributes( client: AsyncAPIClient, options: FinalRequestOptions, ) -> None: + if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None: + self.__pydantic_private__ = {} + self._model = model self._client = client self._options = options From 48bdd220c6b7ab8ea54853cf6ef7862de9e89e56 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2025 21:00:28 +0000 Subject: [PATCH 305/358] feat(api): api update (#2476) --- .stats.yml | 2 +- .../types/workers/script_update_params.py | 79 ++++++++--------- .../workers/scripts/version_create_params.py | 79 ++++++++--------- .../namespaces/script_update_params.py | 79 ++++++++--------- .../scripts/binding_get_response.py | 84 ++++++++----------- .../namespaces/scripts/setting_edit_params.py | 79 ++++++++--------- .../scripts/setting_edit_response.py | 82 ++++++++---------- .../scripts/setting_get_response.py | 82 ++++++++---------- .../workers/scripts/test_versions.py | 2 - tests/api_resources/workers/test_scripts.py | 2 - .../namespaces/scripts/test_settings.py | 2 - .../dispatch/namespaces/test_scripts.py | 2 - 12 files changed, 233 insertions(+), 341 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7d1866f14e7..e991b9f62b8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-04a45bd421e28ee706da1feab38ccbaf3f29822e3331d713d9097d7cc855a07b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ab77157d91e6056139f11e1b8ff2d7aba23176ae44a15aa49f9c8546b18caf2c.yml diff --git a/src/cloudflare/types/workers/script_update_params.py b/src/cloudflare/types/workers/script_update_params.py index d2477230159..afc052e501e 100644 --- a/src/cloudflare/types/workers/script_update_params.py +++ b/src/cloudflare/types/workers/script_update_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, List, Union, Iterable, Optional +from typing import List, Union, Iterable, Optional from typing_extensions import Literal, Required, TypeAlias, TypedDict from .migration_step_param import MigrationStepParam @@ -15,7 +15,6 @@ "MetadataAssets", "MetadataAssetsConfig", "MetadataBinding", - "MetadataBindingWorkersBindingKindAny", "MetadataBindingWorkersBindingKindAI", "MetadataBindingWorkersBindingKindAnalyticsEngine", "MetadataBindingWorkersBindingKindAssets", @@ -24,15 +23,15 @@ "MetadataBindingWorkersBindingKindDispatchNamespace", "MetadataBindingWorkersBindingKindDispatchNamespaceOutbound", "MetadataBindingWorkersBindingKindDispatchNamespaceOutboundWorker", - "MetadataBindingWorkersBindingKindDo", + "MetadataBindingWorkersBindingKindDurableObjectNamespace", "MetadataBindingWorkersBindingKindHyperdrive", "MetadataBindingWorkersBindingKindJson", "MetadataBindingWorkersBindingKindKVNamespace", - "MetadataBindingWorkersBindingKindMTLSCERT", + "MetadataBindingWorkersBindingKindMTLSCertificate", "MetadataBindingWorkersBindingKindPlainText", "MetadataBindingWorkersBindingKindQueue", - "MetadataBindingWorkersBindingKindR2", - "MetadataBindingWorkersBindingKindSecret", + "MetadataBindingWorkersBindingKindR2Bucket", + "MetadataBindingWorkersBindingKindSecretText", "MetadataBindingWorkersBindingKindService", "MetadataBindingWorkersBindingKindTailConsumer", "MetadataBindingWorkersBindingKindVectorize", @@ -85,33 +84,22 @@ class MetadataAssets(TypedDict, total=False): """Token provided upon successful upload of all files from a registered manifest.""" -class MetadataBindingWorkersBindingKindAnyTyped(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[str] - """The kind of resource that the binding provides.""" - - -MetadataBindingWorkersBindingKindAny: TypeAlias = Union[MetadataBindingWorkersBindingKindAnyTyped, Dict[str, object]] - - class MetadataBindingWorkersBindingKindAI(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["ai"]] + type: Required[str] """The kind of resource that the binding provides.""" class MetadataBindingWorkersBindingKindAnalyticsEngine(TypedDict, total=False): dataset: Required[str] - """The dataset name to bind to.""" + """The name of the dataset to bind to.""" name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["analytics_engine"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -119,7 +107,7 @@ class MetadataBindingWorkersBindingKindAssets(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["assets"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -127,7 +115,7 @@ class MetadataBindingWorkersBindingKindBrowserRendering(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["browser_rendering"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -138,7 +126,7 @@ class MetadataBindingWorkersBindingKindD1(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["d1"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -168,21 +156,21 @@ class MetadataBindingWorkersBindingKindDispatchNamespace(TypedDict, total=False) namespace: Required[str] """Namespace to bind to.""" - type: Required[Literal["dispatch_namespace"]] + type: Required[str] """The kind of resource that the binding provides.""" outbound: MetadataBindingWorkersBindingKindDispatchNamespaceOutbound """Outbound worker.""" -class MetadataBindingWorkersBindingKindDo(TypedDict, total=False): +class MetadataBindingWorkersBindingKindDurableObjectNamespace(TypedDict, total=False): class_name: Required[str] """The exported class name of the Durable Object.""" name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["durable_object_namespace"]] + type: Required[str] """The kind of resource that the binding provides.""" environment: str @@ -205,7 +193,7 @@ class MetadataBindingWorkersBindingKindHyperdrive(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["hyperdrive"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -216,7 +204,7 @@ class MetadataBindingWorkersBindingKindJson(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["json"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -227,18 +215,18 @@ class MetadataBindingWorkersBindingKindKVNamespace(TypedDict, total=False): namespace_id: Required[str] """Namespace identifier tag.""" - type: Required[Literal["kv_namespace"]] + type: Required[str] """The kind of resource that the binding provides.""" -class MetadataBindingWorkersBindingKindMTLSCERT(TypedDict, total=False): +class MetadataBindingWorkersBindingKindMTLSCertificate(TypedDict, total=False): certificate_id: Required[str] """Identifier of the certificate to bind to.""" name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["mtls_certificate"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -249,7 +237,7 @@ class MetadataBindingWorkersBindingKindPlainText(TypedDict, total=False): text: Required[str] """The text value to use.""" - type: Required[Literal["plain_text"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -260,29 +248,29 @@ class MetadataBindingWorkersBindingKindQueue(TypedDict, total=False): queue_name: Required[str] """Name of the Queue to bind to.""" - type: Required[Literal["queue"]] + type: Required[str] """The kind of resource that the binding provides.""" -class MetadataBindingWorkersBindingKindR2(TypedDict, total=False): +class MetadataBindingWorkersBindingKindR2Bucket(TypedDict, total=False): bucket_name: Required[str] """R2 bucket to bind to.""" name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["r2_bucket"]] + type: Required[str] """The kind of resource that the binding provides.""" -class MetadataBindingWorkersBindingKindSecret(TypedDict, total=False): +class MetadataBindingWorkersBindingKindSecretText(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" text: Required[str] """The secret value to use.""" - type: Required[Literal["secret_text"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -296,7 +284,7 @@ class MetadataBindingWorkersBindingKindService(TypedDict, total=False): service: Required[str] """Name of Worker to bind to.""" - type: Required[Literal["service"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -307,7 +295,7 @@ class MetadataBindingWorkersBindingKindTailConsumer(TypedDict, total=False): service: Required[str] """Name of Tail Worker to bind to.""" - type: Required[Literal["tail_consumer"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -318,7 +306,7 @@ class MetadataBindingWorkersBindingKindVectorize(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["vectorize"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -326,27 +314,26 @@ class MetadataBindingWorkersBindingKindVersionMetadata(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["version_metadata"]] + type: Required[str] """The kind of resource that the binding provides.""" MetadataBinding: TypeAlias = Union[ - MetadataBindingWorkersBindingKindAny, MetadataBindingWorkersBindingKindAI, MetadataBindingWorkersBindingKindAnalyticsEngine, MetadataBindingWorkersBindingKindAssets, MetadataBindingWorkersBindingKindBrowserRendering, MetadataBindingWorkersBindingKindD1, MetadataBindingWorkersBindingKindDispatchNamespace, - MetadataBindingWorkersBindingKindDo, + MetadataBindingWorkersBindingKindDurableObjectNamespace, MetadataBindingWorkersBindingKindHyperdrive, MetadataBindingWorkersBindingKindJson, MetadataBindingWorkersBindingKindKVNamespace, - MetadataBindingWorkersBindingKindMTLSCERT, + MetadataBindingWorkersBindingKindMTLSCertificate, MetadataBindingWorkersBindingKindPlainText, MetadataBindingWorkersBindingKindQueue, - MetadataBindingWorkersBindingKindR2, - MetadataBindingWorkersBindingKindSecret, + MetadataBindingWorkersBindingKindR2Bucket, + MetadataBindingWorkersBindingKindSecretText, MetadataBindingWorkersBindingKindService, MetadataBindingWorkersBindingKindTailConsumer, MetadataBindingWorkersBindingKindVectorize, diff --git a/src/cloudflare/types/workers/scripts/version_create_params.py b/src/cloudflare/types/workers/scripts/version_create_params.py index ea793046aa2..9dc40fc04b3 100644 --- a/src/cloudflare/types/workers/scripts/version_create_params.py +++ b/src/cloudflare/types/workers/scripts/version_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, List, Union, Iterable +from typing import List, Union, Iterable from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from ...._utils import PropertyInfo @@ -12,7 +12,6 @@ "Metadata", "MetadataAnnotations", "MetadataBinding", - "MetadataBindingWorkersBindingKindAny", "MetadataBindingWorkersBindingKindAI", "MetadataBindingWorkersBindingKindAnalyticsEngine", "MetadataBindingWorkersBindingKindAssets", @@ -21,15 +20,15 @@ "MetadataBindingWorkersBindingKindDispatchNamespace", "MetadataBindingWorkersBindingKindDispatchNamespaceOutbound", "MetadataBindingWorkersBindingKindDispatchNamespaceOutboundWorker", - "MetadataBindingWorkersBindingKindDo", + "MetadataBindingWorkersBindingKindDurableObjectNamespace", "MetadataBindingWorkersBindingKindHyperdrive", "MetadataBindingWorkersBindingKindJson", "MetadataBindingWorkersBindingKindKVNamespace", - "MetadataBindingWorkersBindingKindMTLSCERT", + "MetadataBindingWorkersBindingKindMTLSCertificate", "MetadataBindingWorkersBindingKindPlainText", "MetadataBindingWorkersBindingKindQueue", - "MetadataBindingWorkersBindingKindR2", - "MetadataBindingWorkersBindingKindSecret", + "MetadataBindingWorkersBindingKindR2Bucket", + "MetadataBindingWorkersBindingKindSecretText", "MetadataBindingWorkersBindingKindService", "MetadataBindingWorkersBindingKindTailConsumer", "MetadataBindingWorkersBindingKindVectorize", @@ -53,33 +52,22 @@ class MetadataAnnotations(TypedDict, total=False): """User-provided identifier for the version.""" -class MetadataBindingWorkersBindingKindAnyTyped(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[str] - """The kind of resource that the binding provides.""" - - -MetadataBindingWorkersBindingKindAny: TypeAlias = Union[MetadataBindingWorkersBindingKindAnyTyped, Dict[str, object]] - - class MetadataBindingWorkersBindingKindAI(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["ai"]] + type: Required[str] """The kind of resource that the binding provides.""" class MetadataBindingWorkersBindingKindAnalyticsEngine(TypedDict, total=False): dataset: Required[str] - """The dataset name to bind to.""" + """The name of the dataset to bind to.""" name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["analytics_engine"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -87,7 +75,7 @@ class MetadataBindingWorkersBindingKindAssets(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["assets"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -95,7 +83,7 @@ class MetadataBindingWorkersBindingKindBrowserRendering(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["browser_rendering"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -106,7 +94,7 @@ class MetadataBindingWorkersBindingKindD1(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["d1"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -136,21 +124,21 @@ class MetadataBindingWorkersBindingKindDispatchNamespace(TypedDict, total=False) namespace: Required[str] """Namespace to bind to.""" - type: Required[Literal["dispatch_namespace"]] + type: Required[str] """The kind of resource that the binding provides.""" outbound: MetadataBindingWorkersBindingKindDispatchNamespaceOutbound """Outbound worker.""" -class MetadataBindingWorkersBindingKindDo(TypedDict, total=False): +class MetadataBindingWorkersBindingKindDurableObjectNamespace(TypedDict, total=False): class_name: Required[str] """The exported class name of the Durable Object.""" name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["durable_object_namespace"]] + type: Required[str] """The kind of resource that the binding provides.""" environment: str @@ -173,7 +161,7 @@ class MetadataBindingWorkersBindingKindHyperdrive(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["hyperdrive"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -184,7 +172,7 @@ class MetadataBindingWorkersBindingKindJson(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["json"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -195,18 +183,18 @@ class MetadataBindingWorkersBindingKindKVNamespace(TypedDict, total=False): namespace_id: Required[str] """Namespace identifier tag.""" - type: Required[Literal["kv_namespace"]] + type: Required[str] """The kind of resource that the binding provides.""" -class MetadataBindingWorkersBindingKindMTLSCERT(TypedDict, total=False): +class MetadataBindingWorkersBindingKindMTLSCertificate(TypedDict, total=False): certificate_id: Required[str] """Identifier of the certificate to bind to.""" name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["mtls_certificate"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -217,7 +205,7 @@ class MetadataBindingWorkersBindingKindPlainText(TypedDict, total=False): text: Required[str] """The text value to use.""" - type: Required[Literal["plain_text"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -228,29 +216,29 @@ class MetadataBindingWorkersBindingKindQueue(TypedDict, total=False): queue_name: Required[str] """Name of the Queue to bind to.""" - type: Required[Literal["queue"]] + type: Required[str] """The kind of resource that the binding provides.""" -class MetadataBindingWorkersBindingKindR2(TypedDict, total=False): +class MetadataBindingWorkersBindingKindR2Bucket(TypedDict, total=False): bucket_name: Required[str] """R2 bucket to bind to.""" name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["r2_bucket"]] + type: Required[str] """The kind of resource that the binding provides.""" -class MetadataBindingWorkersBindingKindSecret(TypedDict, total=False): +class MetadataBindingWorkersBindingKindSecretText(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" text: Required[str] """The secret value to use.""" - type: Required[Literal["secret_text"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -264,7 +252,7 @@ class MetadataBindingWorkersBindingKindService(TypedDict, total=False): service: Required[str] """Name of Worker to bind to.""" - type: Required[Literal["service"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -275,7 +263,7 @@ class MetadataBindingWorkersBindingKindTailConsumer(TypedDict, total=False): service: Required[str] """Name of Tail Worker to bind to.""" - type: Required[Literal["tail_consumer"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -286,7 +274,7 @@ class MetadataBindingWorkersBindingKindVectorize(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["vectorize"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -294,27 +282,26 @@ class MetadataBindingWorkersBindingKindVersionMetadata(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["version_metadata"]] + type: Required[str] """The kind of resource that the binding provides.""" MetadataBinding: TypeAlias = Union[ - MetadataBindingWorkersBindingKindAny, MetadataBindingWorkersBindingKindAI, MetadataBindingWorkersBindingKindAnalyticsEngine, MetadataBindingWorkersBindingKindAssets, MetadataBindingWorkersBindingKindBrowserRendering, MetadataBindingWorkersBindingKindD1, MetadataBindingWorkersBindingKindDispatchNamespace, - MetadataBindingWorkersBindingKindDo, + MetadataBindingWorkersBindingKindDurableObjectNamespace, MetadataBindingWorkersBindingKindHyperdrive, MetadataBindingWorkersBindingKindJson, MetadataBindingWorkersBindingKindKVNamespace, - MetadataBindingWorkersBindingKindMTLSCERT, + MetadataBindingWorkersBindingKindMTLSCertificate, MetadataBindingWorkersBindingKindPlainText, MetadataBindingWorkersBindingKindQueue, - MetadataBindingWorkersBindingKindR2, - MetadataBindingWorkersBindingKindSecret, + MetadataBindingWorkersBindingKindR2Bucket, + MetadataBindingWorkersBindingKindSecretText, MetadataBindingWorkersBindingKindService, MetadataBindingWorkersBindingKindTailConsumer, MetadataBindingWorkersBindingKindVectorize, diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py index 4d531281723..3f109834de9 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, List, Union, Iterable, Optional +from typing import List, Union, Iterable, Optional from typing_extensions import Literal, Required, TypeAlias, TypedDict from ....workers.migration_step_param import MigrationStepParam @@ -15,7 +15,6 @@ "MetadataAssets", "MetadataAssetsConfig", "MetadataBinding", - "MetadataBindingWorkersBindingKindAny", "MetadataBindingWorkersBindingKindAI", "MetadataBindingWorkersBindingKindAnalyticsEngine", "MetadataBindingWorkersBindingKindAssets", @@ -24,15 +23,15 @@ "MetadataBindingWorkersBindingKindDispatchNamespace", "MetadataBindingWorkersBindingKindDispatchNamespaceOutbound", "MetadataBindingWorkersBindingKindDispatchNamespaceOutboundWorker", - "MetadataBindingWorkersBindingKindDo", + "MetadataBindingWorkersBindingKindDurableObjectNamespace", "MetadataBindingWorkersBindingKindHyperdrive", "MetadataBindingWorkersBindingKindJson", "MetadataBindingWorkersBindingKindKVNamespace", - "MetadataBindingWorkersBindingKindMTLSCERT", + "MetadataBindingWorkersBindingKindMTLSCertificate", "MetadataBindingWorkersBindingKindPlainText", "MetadataBindingWorkersBindingKindQueue", - "MetadataBindingWorkersBindingKindR2", - "MetadataBindingWorkersBindingKindSecret", + "MetadataBindingWorkersBindingKindR2Bucket", + "MetadataBindingWorkersBindingKindSecretText", "MetadataBindingWorkersBindingKindService", "MetadataBindingWorkersBindingKindTailConsumer", "MetadataBindingWorkersBindingKindVectorize", @@ -88,33 +87,22 @@ class MetadataAssets(TypedDict, total=False): """Token provided upon successful upload of all files from a registered manifest.""" -class MetadataBindingWorkersBindingKindAnyTyped(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[str] - """The kind of resource that the binding provides.""" - - -MetadataBindingWorkersBindingKindAny: TypeAlias = Union[MetadataBindingWorkersBindingKindAnyTyped, Dict[str, object]] - - class MetadataBindingWorkersBindingKindAI(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["ai"]] + type: Required[str] """The kind of resource that the binding provides.""" class MetadataBindingWorkersBindingKindAnalyticsEngine(TypedDict, total=False): dataset: Required[str] - """The dataset name to bind to.""" + """The name of the dataset to bind to.""" name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["analytics_engine"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -122,7 +110,7 @@ class MetadataBindingWorkersBindingKindAssets(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["assets"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -130,7 +118,7 @@ class MetadataBindingWorkersBindingKindBrowserRendering(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["browser_rendering"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -141,7 +129,7 @@ class MetadataBindingWorkersBindingKindD1(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["d1"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -171,21 +159,21 @@ class MetadataBindingWorkersBindingKindDispatchNamespace(TypedDict, total=False) namespace: Required[str] """Namespace to bind to.""" - type: Required[Literal["dispatch_namespace"]] + type: Required[str] """The kind of resource that the binding provides.""" outbound: MetadataBindingWorkersBindingKindDispatchNamespaceOutbound """Outbound worker.""" -class MetadataBindingWorkersBindingKindDo(TypedDict, total=False): +class MetadataBindingWorkersBindingKindDurableObjectNamespace(TypedDict, total=False): class_name: Required[str] """The exported class name of the Durable Object.""" name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["durable_object_namespace"]] + type: Required[str] """The kind of resource that the binding provides.""" environment: str @@ -208,7 +196,7 @@ class MetadataBindingWorkersBindingKindHyperdrive(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["hyperdrive"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -219,7 +207,7 @@ class MetadataBindingWorkersBindingKindJson(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["json"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -230,18 +218,18 @@ class MetadataBindingWorkersBindingKindKVNamespace(TypedDict, total=False): namespace_id: Required[str] """Namespace identifier tag.""" - type: Required[Literal["kv_namespace"]] + type: Required[str] """The kind of resource that the binding provides.""" -class MetadataBindingWorkersBindingKindMTLSCERT(TypedDict, total=False): +class MetadataBindingWorkersBindingKindMTLSCertificate(TypedDict, total=False): certificate_id: Required[str] """Identifier of the certificate to bind to.""" name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["mtls_certificate"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -252,7 +240,7 @@ class MetadataBindingWorkersBindingKindPlainText(TypedDict, total=False): text: Required[str] """The text value to use.""" - type: Required[Literal["plain_text"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -263,29 +251,29 @@ class MetadataBindingWorkersBindingKindQueue(TypedDict, total=False): queue_name: Required[str] """Name of the Queue to bind to.""" - type: Required[Literal["queue"]] + type: Required[str] """The kind of resource that the binding provides.""" -class MetadataBindingWorkersBindingKindR2(TypedDict, total=False): +class MetadataBindingWorkersBindingKindR2Bucket(TypedDict, total=False): bucket_name: Required[str] """R2 bucket to bind to.""" name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["r2_bucket"]] + type: Required[str] """The kind of resource that the binding provides.""" -class MetadataBindingWorkersBindingKindSecret(TypedDict, total=False): +class MetadataBindingWorkersBindingKindSecretText(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" text: Required[str] """The secret value to use.""" - type: Required[Literal["secret_text"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -299,7 +287,7 @@ class MetadataBindingWorkersBindingKindService(TypedDict, total=False): service: Required[str] """Name of Worker to bind to.""" - type: Required[Literal["service"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -310,7 +298,7 @@ class MetadataBindingWorkersBindingKindTailConsumer(TypedDict, total=False): service: Required[str] """Name of Tail Worker to bind to.""" - type: Required[Literal["tail_consumer"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -321,7 +309,7 @@ class MetadataBindingWorkersBindingKindVectorize(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["vectorize"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -329,27 +317,26 @@ class MetadataBindingWorkersBindingKindVersionMetadata(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["version_metadata"]] + type: Required[str] """The kind of resource that the binding provides.""" MetadataBinding: TypeAlias = Union[ - MetadataBindingWorkersBindingKindAny, MetadataBindingWorkersBindingKindAI, MetadataBindingWorkersBindingKindAnalyticsEngine, MetadataBindingWorkersBindingKindAssets, MetadataBindingWorkersBindingKindBrowserRendering, MetadataBindingWorkersBindingKindD1, MetadataBindingWorkersBindingKindDispatchNamespace, - MetadataBindingWorkersBindingKindDo, + MetadataBindingWorkersBindingKindDurableObjectNamespace, MetadataBindingWorkersBindingKindHyperdrive, MetadataBindingWorkersBindingKindJson, MetadataBindingWorkersBindingKindKVNamespace, - MetadataBindingWorkersBindingKindMTLSCERT, + MetadataBindingWorkersBindingKindMTLSCertificate, MetadataBindingWorkersBindingKindPlainText, MetadataBindingWorkersBindingKindQueue, - MetadataBindingWorkersBindingKindR2, - MetadataBindingWorkersBindingKindSecret, + MetadataBindingWorkersBindingKindR2Bucket, + MetadataBindingWorkersBindingKindSecretText, MetadataBindingWorkersBindingKindService, MetadataBindingWorkersBindingKindTailConsumer, MetadataBindingWorkersBindingKindVectorize, diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py index 07fd2d2b27e..c8a58eb1214 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py @@ -1,7 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import TYPE_CHECKING, List, Union, Optional -from typing_extensions import Literal, TypeAlias +from typing import List, Union, Optional +from typing_extensions import TypeAlias from pydantic import Field as FieldInfo @@ -9,7 +9,6 @@ __all__ = [ "BindingGetResponse", - "WorkersBindingKindAny", "WorkersBindingKindAI", "WorkersBindingKindAnalyticsEngine", "WorkersBindingKindAssets", @@ -18,15 +17,15 @@ "WorkersBindingKindDispatchNamespace", "WorkersBindingKindDispatchNamespaceOutbound", "WorkersBindingKindDispatchNamespaceOutboundWorker", - "WorkersBindingKindDo", + "WorkersBindingKindDurableObjectNamespace", "WorkersBindingKindHyperdrive", "WorkersBindingKindJson", "WorkersBindingKindKVNamespace", - "WorkersBindingKindMTLSCERT", + "WorkersBindingKindMTLSCertificate", "WorkersBindingKindPlainText", "WorkersBindingKindQueue", - "WorkersBindingKindR2", - "WorkersBindingKindSecret", + "WorkersBindingKindR2Bucket", + "WorkersBindingKindSecretText", "WorkersBindingKindService", "WorkersBindingKindTailConsumer", "WorkersBindingKindVectorize", @@ -34,36 +33,22 @@ ] -class WorkersBindingKindAny(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - type: str - """The kind of resource that the binding provides.""" - - if TYPE_CHECKING: - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - - class WorkersBindingKindAI(BaseModel): name: str """A JavaScript variable name for the binding.""" - type: Literal["ai"] + type: str """The kind of resource that the binding provides.""" class WorkersBindingKindAnalyticsEngine(BaseModel): dataset: str - """The dataset name to bind to.""" + """The name of the dataset to bind to.""" name: str """A JavaScript variable name for the binding.""" - type: Literal["analytics_engine"] + type: str """The kind of resource that the binding provides.""" @@ -71,7 +56,7 @@ class WorkersBindingKindAssets(BaseModel): name: str """A JavaScript variable name for the binding.""" - type: Literal["assets"] + type: str """The kind of resource that the binding provides.""" @@ -79,7 +64,7 @@ class WorkersBindingKindBrowserRendering(BaseModel): name: str """A JavaScript variable name for the binding.""" - type: Literal["browser_rendering"] + type: str """The kind of resource that the binding provides.""" @@ -90,7 +75,7 @@ class WorkersBindingKindD1(BaseModel): name: str """A JavaScript variable name for the binding.""" - type: Literal["d1"] + type: str """The kind of resource that the binding provides.""" @@ -120,21 +105,21 @@ class WorkersBindingKindDispatchNamespace(BaseModel): namespace: str """Namespace to bind to.""" - type: Literal["dispatch_namespace"] + type: str """The kind of resource that the binding provides.""" outbound: Optional[WorkersBindingKindDispatchNamespaceOutbound] = None """Outbound worker.""" -class WorkersBindingKindDo(BaseModel): +class WorkersBindingKindDurableObjectNamespace(BaseModel): class_name: str """The exported class name of the Durable Object.""" name: str """A JavaScript variable name for the binding.""" - type: Literal["durable_object_namespace"] + type: str """The kind of resource that the binding provides.""" environment: Optional[str] = None @@ -157,7 +142,7 @@ class WorkersBindingKindHyperdrive(BaseModel): name: str """A JavaScript variable name for the binding.""" - type: Literal["hyperdrive"] + type: str """The kind of resource that the binding provides.""" @@ -168,7 +153,7 @@ class WorkersBindingKindJson(BaseModel): name: str """A JavaScript variable name for the binding.""" - type: Literal["json"] + type: str """The kind of resource that the binding provides.""" @@ -179,18 +164,18 @@ class WorkersBindingKindKVNamespace(BaseModel): namespace_id: str """Namespace identifier tag.""" - type: Literal["kv_namespace"] + type: str """The kind of resource that the binding provides.""" -class WorkersBindingKindMTLSCERT(BaseModel): +class WorkersBindingKindMTLSCertificate(BaseModel): certificate_id: str """Identifier of the certificate to bind to.""" name: str """A JavaScript variable name for the binding.""" - type: Literal["mtls_certificate"] + type: str """The kind of resource that the binding provides.""" @@ -201,7 +186,7 @@ class WorkersBindingKindPlainText(BaseModel): text: str """The text value to use.""" - type: Literal["plain_text"] + type: str """The kind of resource that the binding provides.""" @@ -212,29 +197,29 @@ class WorkersBindingKindQueue(BaseModel): queue_name: str """Name of the Queue to bind to.""" - type: Literal["queue"] + type: str """The kind of resource that the binding provides.""" -class WorkersBindingKindR2(BaseModel): +class WorkersBindingKindR2Bucket(BaseModel): bucket_name: str """R2 bucket to bind to.""" name: str """A JavaScript variable name for the binding.""" - type: Literal["r2_bucket"] + type: str """The kind of resource that the binding provides.""" -class WorkersBindingKindSecret(BaseModel): +class WorkersBindingKindSecretText(BaseModel): name: str """A JavaScript variable name for the binding.""" text: str """The secret value to use.""" - type: Literal["secret_text"] + type: str """The kind of resource that the binding provides.""" @@ -248,7 +233,7 @@ class WorkersBindingKindService(BaseModel): service: str """Name of Worker to bind to.""" - type: Literal["service"] + type: str """The kind of resource that the binding provides.""" @@ -259,7 +244,7 @@ class WorkersBindingKindTailConsumer(BaseModel): service: str """Name of Tail Worker to bind to.""" - type: Literal["tail_consumer"] + type: str """The kind of resource that the binding provides.""" @@ -270,7 +255,7 @@ class WorkersBindingKindVectorize(BaseModel): name: str """A JavaScript variable name for the binding.""" - type: Literal["vectorize"] + type: str """The kind of resource that the binding provides.""" @@ -278,27 +263,26 @@ class WorkersBindingKindVersionMetadata(BaseModel): name: str """A JavaScript variable name for the binding.""" - type: Literal["version_metadata"] + type: str """The kind of resource that the binding provides.""" BindingGetResponse: TypeAlias = Union[ - WorkersBindingKindAny, WorkersBindingKindAI, WorkersBindingKindAnalyticsEngine, WorkersBindingKindAssets, WorkersBindingKindBrowserRendering, WorkersBindingKindD1, WorkersBindingKindDispatchNamespace, - WorkersBindingKindDo, + WorkersBindingKindDurableObjectNamespace, WorkersBindingKindHyperdrive, WorkersBindingKindJson, WorkersBindingKindKVNamespace, - WorkersBindingKindMTLSCERT, + WorkersBindingKindMTLSCertificate, WorkersBindingKindPlainText, WorkersBindingKindQueue, - WorkersBindingKindR2, - WorkersBindingKindSecret, + WorkersBindingKindR2Bucket, + WorkersBindingKindSecretText, WorkersBindingKindService, WorkersBindingKindTailConsumer, WorkersBindingKindVectorize, diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py index cfb478bb1c8..a56221003cc 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, List, Union, Iterable, Optional +from typing import List, Union, Iterable, Optional from typing_extensions import Literal, Required, TypeAlias, TypedDict from .....workers.migration_step_param import MigrationStepParam @@ -13,7 +13,6 @@ "SettingEditParams", "Settings", "SettingsBinding", - "SettingsBindingWorkersBindingKindAny", "SettingsBindingWorkersBindingKindAI", "SettingsBindingWorkersBindingKindAnalyticsEngine", "SettingsBindingWorkersBindingKindAssets", @@ -22,15 +21,15 @@ "SettingsBindingWorkersBindingKindDispatchNamespace", "SettingsBindingWorkersBindingKindDispatchNamespaceOutbound", "SettingsBindingWorkersBindingKindDispatchNamespaceOutboundWorker", - "SettingsBindingWorkersBindingKindDo", + "SettingsBindingWorkersBindingKindDurableObjectNamespace", "SettingsBindingWorkersBindingKindHyperdrive", "SettingsBindingWorkersBindingKindJson", "SettingsBindingWorkersBindingKindKVNamespace", - "SettingsBindingWorkersBindingKindMTLSCERT", + "SettingsBindingWorkersBindingKindMTLSCertificate", "SettingsBindingWorkersBindingKindPlainText", "SettingsBindingWorkersBindingKindQueue", - "SettingsBindingWorkersBindingKindR2", - "SettingsBindingWorkersBindingKindSecret", + "SettingsBindingWorkersBindingKindR2Bucket", + "SettingsBindingWorkersBindingKindSecretText", "SettingsBindingWorkersBindingKindService", "SettingsBindingWorkersBindingKindTailConsumer", "SettingsBindingWorkersBindingKindVectorize", @@ -53,33 +52,22 @@ class SettingEditParams(TypedDict, total=False): settings: Settings -class SettingsBindingWorkersBindingKindAnyTyped(TypedDict, total=False): - name: Required[str] - """A JavaScript variable name for the binding.""" - - type: Required[str] - """The kind of resource that the binding provides.""" - - -SettingsBindingWorkersBindingKindAny: TypeAlias = Union[SettingsBindingWorkersBindingKindAnyTyped, Dict[str, object]] - - class SettingsBindingWorkersBindingKindAI(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["ai"]] + type: Required[str] """The kind of resource that the binding provides.""" class SettingsBindingWorkersBindingKindAnalyticsEngine(TypedDict, total=False): dataset: Required[str] - """The dataset name to bind to.""" + """The name of the dataset to bind to.""" name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["analytics_engine"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -87,7 +75,7 @@ class SettingsBindingWorkersBindingKindAssets(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["assets"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -95,7 +83,7 @@ class SettingsBindingWorkersBindingKindBrowserRendering(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["browser_rendering"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -106,7 +94,7 @@ class SettingsBindingWorkersBindingKindD1(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["d1"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -136,21 +124,21 @@ class SettingsBindingWorkersBindingKindDispatchNamespace(TypedDict, total=False) namespace: Required[str] """Namespace to bind to.""" - type: Required[Literal["dispatch_namespace"]] + type: Required[str] """The kind of resource that the binding provides.""" outbound: SettingsBindingWorkersBindingKindDispatchNamespaceOutbound """Outbound worker.""" -class SettingsBindingWorkersBindingKindDo(TypedDict, total=False): +class SettingsBindingWorkersBindingKindDurableObjectNamespace(TypedDict, total=False): class_name: Required[str] """The exported class name of the Durable Object.""" name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["durable_object_namespace"]] + type: Required[str] """The kind of resource that the binding provides.""" environment: str @@ -173,7 +161,7 @@ class SettingsBindingWorkersBindingKindHyperdrive(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["hyperdrive"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -184,7 +172,7 @@ class SettingsBindingWorkersBindingKindJson(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["json"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -195,18 +183,18 @@ class SettingsBindingWorkersBindingKindKVNamespace(TypedDict, total=False): namespace_id: Required[str] """Namespace identifier tag.""" - type: Required[Literal["kv_namespace"]] + type: Required[str] """The kind of resource that the binding provides.""" -class SettingsBindingWorkersBindingKindMTLSCERT(TypedDict, total=False): +class SettingsBindingWorkersBindingKindMTLSCertificate(TypedDict, total=False): certificate_id: Required[str] """Identifier of the certificate to bind to.""" name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["mtls_certificate"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -217,7 +205,7 @@ class SettingsBindingWorkersBindingKindPlainText(TypedDict, total=False): text: Required[str] """The text value to use.""" - type: Required[Literal["plain_text"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -228,29 +216,29 @@ class SettingsBindingWorkersBindingKindQueue(TypedDict, total=False): queue_name: Required[str] """Name of the Queue to bind to.""" - type: Required[Literal["queue"]] + type: Required[str] """The kind of resource that the binding provides.""" -class SettingsBindingWorkersBindingKindR2(TypedDict, total=False): +class SettingsBindingWorkersBindingKindR2Bucket(TypedDict, total=False): bucket_name: Required[str] """R2 bucket to bind to.""" name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["r2_bucket"]] + type: Required[str] """The kind of resource that the binding provides.""" -class SettingsBindingWorkersBindingKindSecret(TypedDict, total=False): +class SettingsBindingWorkersBindingKindSecretText(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" text: Required[str] """The secret value to use.""" - type: Required[Literal["secret_text"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -264,7 +252,7 @@ class SettingsBindingWorkersBindingKindService(TypedDict, total=False): service: Required[str] """Name of Worker to bind to.""" - type: Required[Literal["service"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -275,7 +263,7 @@ class SettingsBindingWorkersBindingKindTailConsumer(TypedDict, total=False): service: Required[str] """Name of Tail Worker to bind to.""" - type: Required[Literal["tail_consumer"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -286,7 +274,7 @@ class SettingsBindingWorkersBindingKindVectorize(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["vectorize"]] + type: Required[str] """The kind of resource that the binding provides.""" @@ -294,27 +282,26 @@ class SettingsBindingWorkersBindingKindVersionMetadata(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" - type: Required[Literal["version_metadata"]] + type: Required[str] """The kind of resource that the binding provides.""" SettingsBinding: TypeAlias = Union[ - SettingsBindingWorkersBindingKindAny, SettingsBindingWorkersBindingKindAI, SettingsBindingWorkersBindingKindAnalyticsEngine, SettingsBindingWorkersBindingKindAssets, SettingsBindingWorkersBindingKindBrowserRendering, SettingsBindingWorkersBindingKindD1, SettingsBindingWorkersBindingKindDispatchNamespace, - SettingsBindingWorkersBindingKindDo, + SettingsBindingWorkersBindingKindDurableObjectNamespace, SettingsBindingWorkersBindingKindHyperdrive, SettingsBindingWorkersBindingKindJson, SettingsBindingWorkersBindingKindKVNamespace, - SettingsBindingWorkersBindingKindMTLSCERT, + SettingsBindingWorkersBindingKindMTLSCertificate, SettingsBindingWorkersBindingKindPlainText, SettingsBindingWorkersBindingKindQueue, - SettingsBindingWorkersBindingKindR2, - SettingsBindingWorkersBindingKindSecret, + SettingsBindingWorkersBindingKindR2Bucket, + SettingsBindingWorkersBindingKindSecretText, SettingsBindingWorkersBindingKindService, SettingsBindingWorkersBindingKindTailConsumer, SettingsBindingWorkersBindingKindVectorize, diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_response.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_response.py index 799ad01b712..fda777112cd 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_response.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import TYPE_CHECKING, List, Union, Optional +from typing import List, Union, Optional from typing_extensions import Literal, TypeAlias from pydantic import Field as FieldInfo @@ -13,7 +13,6 @@ __all__ = [ "SettingEditResponse", "Binding", - "BindingWorkersBindingKindAny", "BindingWorkersBindingKindAI", "BindingWorkersBindingKindAnalyticsEngine", "BindingWorkersBindingKindAssets", @@ -22,15 +21,15 @@ "BindingWorkersBindingKindDispatchNamespace", "BindingWorkersBindingKindDispatchNamespaceOutbound", "BindingWorkersBindingKindDispatchNamespaceOutboundWorker", - "BindingWorkersBindingKindDo", + "BindingWorkersBindingKindDurableObjectNamespace", "BindingWorkersBindingKindHyperdrive", "BindingWorkersBindingKindJson", "BindingWorkersBindingKindKVNamespace", - "BindingWorkersBindingKindMTLSCERT", + "BindingWorkersBindingKindMTLSCertificate", "BindingWorkersBindingKindPlainText", "BindingWorkersBindingKindQueue", - "BindingWorkersBindingKindR2", - "BindingWorkersBindingKindSecret", + "BindingWorkersBindingKindR2Bucket", + "BindingWorkersBindingKindSecretText", "BindingWorkersBindingKindService", "BindingWorkersBindingKindTailConsumer", "BindingWorkersBindingKindVectorize", @@ -43,36 +42,22 @@ ] -class BindingWorkersBindingKindAny(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - type: str - """The kind of resource that the binding provides.""" - - if TYPE_CHECKING: - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - - class BindingWorkersBindingKindAI(BaseModel): name: str """A JavaScript variable name for the binding.""" - type: Literal["ai"] + type: str """The kind of resource that the binding provides.""" class BindingWorkersBindingKindAnalyticsEngine(BaseModel): dataset: str - """The dataset name to bind to.""" + """The name of the dataset to bind to.""" name: str """A JavaScript variable name for the binding.""" - type: Literal["analytics_engine"] + type: str """The kind of resource that the binding provides.""" @@ -80,7 +65,7 @@ class BindingWorkersBindingKindAssets(BaseModel): name: str """A JavaScript variable name for the binding.""" - type: Literal["assets"] + type: str """The kind of resource that the binding provides.""" @@ -88,7 +73,7 @@ class BindingWorkersBindingKindBrowserRendering(BaseModel): name: str """A JavaScript variable name for the binding.""" - type: Literal["browser_rendering"] + type: str """The kind of resource that the binding provides.""" @@ -99,7 +84,7 @@ class BindingWorkersBindingKindD1(BaseModel): name: str """A JavaScript variable name for the binding.""" - type: Literal["d1"] + type: str """The kind of resource that the binding provides.""" @@ -129,21 +114,21 @@ class BindingWorkersBindingKindDispatchNamespace(BaseModel): namespace: str """Namespace to bind to.""" - type: Literal["dispatch_namespace"] + type: str """The kind of resource that the binding provides.""" outbound: Optional[BindingWorkersBindingKindDispatchNamespaceOutbound] = None """Outbound worker.""" -class BindingWorkersBindingKindDo(BaseModel): +class BindingWorkersBindingKindDurableObjectNamespace(BaseModel): class_name: str """The exported class name of the Durable Object.""" name: str """A JavaScript variable name for the binding.""" - type: Literal["durable_object_namespace"] + type: str """The kind of resource that the binding provides.""" environment: Optional[str] = None @@ -166,7 +151,7 @@ class BindingWorkersBindingKindHyperdrive(BaseModel): name: str """A JavaScript variable name for the binding.""" - type: Literal["hyperdrive"] + type: str """The kind of resource that the binding provides.""" @@ -177,7 +162,7 @@ class BindingWorkersBindingKindJson(BaseModel): name: str """A JavaScript variable name for the binding.""" - type: Literal["json"] + type: str """The kind of resource that the binding provides.""" @@ -188,18 +173,18 @@ class BindingWorkersBindingKindKVNamespace(BaseModel): namespace_id: str """Namespace identifier tag.""" - type: Literal["kv_namespace"] + type: str """The kind of resource that the binding provides.""" -class BindingWorkersBindingKindMTLSCERT(BaseModel): +class BindingWorkersBindingKindMTLSCertificate(BaseModel): certificate_id: str """Identifier of the certificate to bind to.""" name: str """A JavaScript variable name for the binding.""" - type: Literal["mtls_certificate"] + type: str """The kind of resource that the binding provides.""" @@ -210,7 +195,7 @@ class BindingWorkersBindingKindPlainText(BaseModel): text: str """The text value to use.""" - type: Literal["plain_text"] + type: str """The kind of resource that the binding provides.""" @@ -221,29 +206,29 @@ class BindingWorkersBindingKindQueue(BaseModel): queue_name: str """Name of the Queue to bind to.""" - type: Literal["queue"] + type: str """The kind of resource that the binding provides.""" -class BindingWorkersBindingKindR2(BaseModel): +class BindingWorkersBindingKindR2Bucket(BaseModel): bucket_name: str """R2 bucket to bind to.""" name: str """A JavaScript variable name for the binding.""" - type: Literal["r2_bucket"] + type: str """The kind of resource that the binding provides.""" -class BindingWorkersBindingKindSecret(BaseModel): +class BindingWorkersBindingKindSecretText(BaseModel): name: str """A JavaScript variable name for the binding.""" text: str """The secret value to use.""" - type: Literal["secret_text"] + type: str """The kind of resource that the binding provides.""" @@ -257,7 +242,7 @@ class BindingWorkersBindingKindService(BaseModel): service: str """Name of Worker to bind to.""" - type: Literal["service"] + type: str """The kind of resource that the binding provides.""" @@ -268,7 +253,7 @@ class BindingWorkersBindingKindTailConsumer(BaseModel): service: str """Name of Tail Worker to bind to.""" - type: Literal["tail_consumer"] + type: str """The kind of resource that the binding provides.""" @@ -279,7 +264,7 @@ class BindingWorkersBindingKindVectorize(BaseModel): name: str """A JavaScript variable name for the binding.""" - type: Literal["vectorize"] + type: str """The kind of resource that the binding provides.""" @@ -287,27 +272,26 @@ class BindingWorkersBindingKindVersionMetadata(BaseModel): name: str """A JavaScript variable name for the binding.""" - type: Literal["version_metadata"] + type: str """The kind of resource that the binding provides.""" Binding: TypeAlias = Union[ - BindingWorkersBindingKindAny, BindingWorkersBindingKindAI, BindingWorkersBindingKindAnalyticsEngine, BindingWorkersBindingKindAssets, BindingWorkersBindingKindBrowserRendering, BindingWorkersBindingKindD1, BindingWorkersBindingKindDispatchNamespace, - BindingWorkersBindingKindDo, + BindingWorkersBindingKindDurableObjectNamespace, BindingWorkersBindingKindHyperdrive, BindingWorkersBindingKindJson, BindingWorkersBindingKindKVNamespace, - BindingWorkersBindingKindMTLSCERT, + BindingWorkersBindingKindMTLSCertificate, BindingWorkersBindingKindPlainText, BindingWorkersBindingKindQueue, - BindingWorkersBindingKindR2, - BindingWorkersBindingKindSecret, + BindingWorkersBindingKindR2Bucket, + BindingWorkersBindingKindSecretText, BindingWorkersBindingKindService, BindingWorkersBindingKindTailConsumer, BindingWorkersBindingKindVectorize, diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_get_response.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_get_response.py index e6a39d1e9af..3876c2f25b6 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_get_response.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_get_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import TYPE_CHECKING, List, Union, Optional +from typing import List, Union, Optional from typing_extensions import Literal, TypeAlias from pydantic import Field as FieldInfo @@ -13,7 +13,6 @@ __all__ = [ "SettingGetResponse", "Binding", - "BindingWorkersBindingKindAny", "BindingWorkersBindingKindAI", "BindingWorkersBindingKindAnalyticsEngine", "BindingWorkersBindingKindAssets", @@ -22,15 +21,15 @@ "BindingWorkersBindingKindDispatchNamespace", "BindingWorkersBindingKindDispatchNamespaceOutbound", "BindingWorkersBindingKindDispatchNamespaceOutboundWorker", - "BindingWorkersBindingKindDo", + "BindingWorkersBindingKindDurableObjectNamespace", "BindingWorkersBindingKindHyperdrive", "BindingWorkersBindingKindJson", "BindingWorkersBindingKindKVNamespace", - "BindingWorkersBindingKindMTLSCERT", + "BindingWorkersBindingKindMTLSCertificate", "BindingWorkersBindingKindPlainText", "BindingWorkersBindingKindQueue", - "BindingWorkersBindingKindR2", - "BindingWorkersBindingKindSecret", + "BindingWorkersBindingKindR2Bucket", + "BindingWorkersBindingKindSecretText", "BindingWorkersBindingKindService", "BindingWorkersBindingKindTailConsumer", "BindingWorkersBindingKindVectorize", @@ -43,36 +42,22 @@ ] -class BindingWorkersBindingKindAny(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - type: str - """The kind of resource that the binding provides.""" - - if TYPE_CHECKING: - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - - class BindingWorkersBindingKindAI(BaseModel): name: str """A JavaScript variable name for the binding.""" - type: Literal["ai"] + type: str """The kind of resource that the binding provides.""" class BindingWorkersBindingKindAnalyticsEngine(BaseModel): dataset: str - """The dataset name to bind to.""" + """The name of the dataset to bind to.""" name: str """A JavaScript variable name for the binding.""" - type: Literal["analytics_engine"] + type: str """The kind of resource that the binding provides.""" @@ -80,7 +65,7 @@ class BindingWorkersBindingKindAssets(BaseModel): name: str """A JavaScript variable name for the binding.""" - type: Literal["assets"] + type: str """The kind of resource that the binding provides.""" @@ -88,7 +73,7 @@ class BindingWorkersBindingKindBrowserRendering(BaseModel): name: str """A JavaScript variable name for the binding.""" - type: Literal["browser_rendering"] + type: str """The kind of resource that the binding provides.""" @@ -99,7 +84,7 @@ class BindingWorkersBindingKindD1(BaseModel): name: str """A JavaScript variable name for the binding.""" - type: Literal["d1"] + type: str """The kind of resource that the binding provides.""" @@ -129,21 +114,21 @@ class BindingWorkersBindingKindDispatchNamespace(BaseModel): namespace: str """Namespace to bind to.""" - type: Literal["dispatch_namespace"] + type: str """The kind of resource that the binding provides.""" outbound: Optional[BindingWorkersBindingKindDispatchNamespaceOutbound] = None """Outbound worker.""" -class BindingWorkersBindingKindDo(BaseModel): +class BindingWorkersBindingKindDurableObjectNamespace(BaseModel): class_name: str """The exported class name of the Durable Object.""" name: str """A JavaScript variable name for the binding.""" - type: Literal["durable_object_namespace"] + type: str """The kind of resource that the binding provides.""" environment: Optional[str] = None @@ -166,7 +151,7 @@ class BindingWorkersBindingKindHyperdrive(BaseModel): name: str """A JavaScript variable name for the binding.""" - type: Literal["hyperdrive"] + type: str """The kind of resource that the binding provides.""" @@ -177,7 +162,7 @@ class BindingWorkersBindingKindJson(BaseModel): name: str """A JavaScript variable name for the binding.""" - type: Literal["json"] + type: str """The kind of resource that the binding provides.""" @@ -188,18 +173,18 @@ class BindingWorkersBindingKindKVNamespace(BaseModel): namespace_id: str """Namespace identifier tag.""" - type: Literal["kv_namespace"] + type: str """The kind of resource that the binding provides.""" -class BindingWorkersBindingKindMTLSCERT(BaseModel): +class BindingWorkersBindingKindMTLSCertificate(BaseModel): certificate_id: str """Identifier of the certificate to bind to.""" name: str """A JavaScript variable name for the binding.""" - type: Literal["mtls_certificate"] + type: str """The kind of resource that the binding provides.""" @@ -210,7 +195,7 @@ class BindingWorkersBindingKindPlainText(BaseModel): text: str """The text value to use.""" - type: Literal["plain_text"] + type: str """The kind of resource that the binding provides.""" @@ -221,29 +206,29 @@ class BindingWorkersBindingKindQueue(BaseModel): queue_name: str """Name of the Queue to bind to.""" - type: Literal["queue"] + type: str """The kind of resource that the binding provides.""" -class BindingWorkersBindingKindR2(BaseModel): +class BindingWorkersBindingKindR2Bucket(BaseModel): bucket_name: str """R2 bucket to bind to.""" name: str """A JavaScript variable name for the binding.""" - type: Literal["r2_bucket"] + type: str """The kind of resource that the binding provides.""" -class BindingWorkersBindingKindSecret(BaseModel): +class BindingWorkersBindingKindSecretText(BaseModel): name: str """A JavaScript variable name for the binding.""" text: str """The secret value to use.""" - type: Literal["secret_text"] + type: str """The kind of resource that the binding provides.""" @@ -257,7 +242,7 @@ class BindingWorkersBindingKindService(BaseModel): service: str """Name of Worker to bind to.""" - type: Literal["service"] + type: str """The kind of resource that the binding provides.""" @@ -268,7 +253,7 @@ class BindingWorkersBindingKindTailConsumer(BaseModel): service: str """Name of Tail Worker to bind to.""" - type: Literal["tail_consumer"] + type: str """The kind of resource that the binding provides.""" @@ -279,7 +264,7 @@ class BindingWorkersBindingKindVectorize(BaseModel): name: str """A JavaScript variable name for the binding.""" - type: Literal["vectorize"] + type: str """The kind of resource that the binding provides.""" @@ -287,27 +272,26 @@ class BindingWorkersBindingKindVersionMetadata(BaseModel): name: str """A JavaScript variable name for the binding.""" - type: Literal["version_metadata"] + type: str """The kind of resource that the binding provides.""" Binding: TypeAlias = Union[ - BindingWorkersBindingKindAny, BindingWorkersBindingKindAI, BindingWorkersBindingKindAnalyticsEngine, BindingWorkersBindingKindAssets, BindingWorkersBindingKindBrowserRendering, BindingWorkersBindingKindD1, BindingWorkersBindingKindDispatchNamespace, - BindingWorkersBindingKindDo, + BindingWorkersBindingKindDurableObjectNamespace, BindingWorkersBindingKindHyperdrive, BindingWorkersBindingKindJson, BindingWorkersBindingKindKVNamespace, - BindingWorkersBindingKindMTLSCERT, + BindingWorkersBindingKindMTLSCertificate, BindingWorkersBindingKindPlainText, BindingWorkersBindingKindQueue, - BindingWorkersBindingKindR2, - BindingWorkersBindingKindSecret, + BindingWorkersBindingKindR2Bucket, + BindingWorkersBindingKindSecretText, BindingWorkersBindingKindService, BindingWorkersBindingKindTailConsumer, BindingWorkersBindingKindVectorize, diff --git a/tests/api_resources/workers/scripts/test_versions.py b/tests/api_resources/workers/scripts/test_versions.py index e27ca173031..5fbc0e71d33 100644 --- a/tests/api_resources/workers/scripts/test_versions.py +++ b/tests/api_resources/workers/scripts/test_versions.py @@ -47,7 +47,6 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "bindings": [ { "name": "MY_ENV_VAR", - "text": "my_data", "type": "plain_text", } ], @@ -254,7 +253,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "bindings": [ { "name": "MY_ENV_VAR", - "text": "my_data", "type": "plain_text", } ], diff --git a/tests/api_resources/workers/test_scripts.py b/tests/api_resources/workers/test_scripts.py index 0c4b3980605..00f0d53b953 100644 --- a/tests/api_resources/workers/test_scripts.py +++ b/tests/api_resources/workers/test_scripts.py @@ -50,7 +50,6 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "bindings": [ { "name": "MY_ENV_VAR", - "text": "my_data", "type": "plain_text", } ], @@ -322,7 +321,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "bindings": [ { "name": "MY_ENV_VAR", - "text": "my_data", "type": "plain_text", } ], diff --git a/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_settings.py b/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_settings.py index 8fece3883d7..b3a2e96a5d1 100644 --- a/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_settings.py +++ b/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_settings.py @@ -41,7 +41,6 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: "bindings": [ { "name": "MY_ENV_VAR", - "text": "my_data", "type": "plain_text", } ], @@ -226,7 +225,6 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) "bindings": [ { "name": "MY_ENV_VAR", - "text": "my_data", "type": "plain_text", } ], diff --git a/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py b/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py index 5877f5318b9..feb536104b4 100644 --- a/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py +++ b/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py @@ -51,7 +51,6 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "bindings": [ { "name": "MY_ENV_VAR", - "text": "my_data", "type": "plain_text", } ], @@ -324,7 +323,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "bindings": [ { "name": "MY_ENV_VAR", - "text": "my_data", "type": "plain_text", } ], From 9698a7e8bf98b9f26443bc8cde43159de566f1eb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2025 21:19:52 +0000 Subject: [PATCH 306/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index e991b9f62b8..c6f6ecd587f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ab77157d91e6056139f11e1b8ff2d7aba23176ae44a15aa49f9c8546b18caf2c.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5b9164c23aaffb6511ac33ed878339a35fcce6cb932e0116a4eef02b90e3ca62.yml From c94145168271ed1a9bb371ba89958393abf2be75 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2025 21:39:47 +0000 Subject: [PATCH 307/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index c6f6ecd587f..a5df41031ef 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5b9164c23aaffb6511ac33ed878339a35fcce6cb932e0116a4eef02b90e3ca62.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4274f2f37435c6047318e91066b8f71db903e9ef21b14f3d5b1e54c670693cdd.yml From 4c7507445f6eb5a27e3b158cb5870a3bc4eb8860 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2025 22:58:49 +0000 Subject: [PATCH 308/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index a5df41031ef..197ffbe6e0a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4274f2f37435c6047318e91066b8f71db903e9ef21b14f3d5b1e54c670693cdd.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b509af5c2e1b4fb3e01afb48bb4f3aa5cdde7b1ecc9f90f58087e52cc0a29dff.yml From cc5c8f22891174d05d7ad5f2d5ec6566a486399e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 00:50:17 +0000 Subject: [PATCH 309/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 197ffbe6e0a..85eed1ee43e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b509af5c2e1b4fb3e01afb48bb4f3aa5cdde7b1ecc9f90f58087e52cc0a29dff.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e4d3221aa6fcc2e48ae9bdd25edf1a84a32eeb16e74c4f02cb6e63e3ca7f94a7.yml From b96d8551bbf1359f514abe7e9f64c164de956862 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 06:10:37 +0000 Subject: [PATCH 310/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 85eed1ee43e..c6f6ecd587f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e4d3221aa6fcc2e48ae9bdd25edf1a84a32eeb16e74c4f02cb6e63e3ca7f94a7.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5b9164c23aaffb6511ac33ed878339a35fcce6cb932e0116a4eef02b90e3ca62.yml From 7a2cb16cfcf071424cd2735d7f1160e724ba6131 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 06:18:32 +0000 Subject: [PATCH 311/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index c6f6ecd587f..f02047ccd93 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5b9164c23aaffb6511ac33ed878339a35fcce6cb932e0116a4eef02b90e3ca62.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-dceca37a4ebf72d2fdc6250d767f9449ff35f80394f3aa205f7c74cfac4fed91.yml From 6ac26de67096a7573be9621940064e0ef1b72d48 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 09:38:50 +0000 Subject: [PATCH 312/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index f02047ccd93..5cfcb3dc30e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-dceca37a4ebf72d2fdc6250d767f9449ff35f80394f3aa205f7c74cfac4fed91.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9f06b01e639675ebacce46179647b8899595cf53ec9a68edd3ff140aead8205a.yml From 902af53ce1c3bf6dd217e1be18dee0f2b708386a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 12:32:05 +0000 Subject: [PATCH 313/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 5cfcb3dc30e..b5fd5a0012e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9f06b01e639675ebacce46179647b8899595cf53ec9a68edd3ff140aead8205a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-40ba3991e45d3a39c196819d594c43bf1130d65bbfbcfb936e8c6f02336eddf9.yml From 0556f5bfd55997e92eb17215e02e241e99f8c2a0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 12:40:01 +0000 Subject: [PATCH 314/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index b5fd5a0012e..1a7b5c17821 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-40ba3991e45d3a39c196819d594c43bf1130d65bbfbcfb936e8c6f02336eddf9.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1c974721fcd7b4e5626d779e86d1b5a6bfa06ffcb2b463fc578270824b5c1ac7.yml From f1edb506aa980682a78ab5eb26982bf6d9fd4207 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 13:06:12 +0000 Subject: [PATCH 315/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 1a7b5c17821..68a73750fd8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1c974721fcd7b4e5626d779e86d1b5a6bfa06ffcb2b463fc578270824b5c1ac7.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-35df6e7d26349ae9cc6a6d91dc3a57845483d1dc56548dfb4218f75908efdee8.yml From e1da61de146c5f986e3de6ef16a273c2e97ec4a1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 13:38:24 +0000 Subject: [PATCH 316/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 68a73750fd8..d5d5a1f71e0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-35df6e7d26349ae9cc6a6d91dc3a57845483d1dc56548dfb4218f75908efdee8.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5268a486d8517decdeb3b5858fd99d937511b9cefedce1f85246437eb79911a9.yml From a633f279ea71588f6437f65426a41451c86232d7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 14:46:15 +0000 Subject: [PATCH 317/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d5d5a1f71e0..23031024313 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5268a486d8517decdeb3b5858fd99d937511b9cefedce1f85246437eb79911a9.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d04439bee4e483de84ef38286eb255e87ece7f124c33d00f6ef0eb16f2c089bb.yml From 6d435c7abd48dfac7ed34e1e7e238e341eb7a735 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 15:37:58 +0000 Subject: [PATCH 318/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 23031024313..fda2e4ba9e4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d04439bee4e483de84ef38286eb255e87ece7f124c33d00f6ef0eb16f2c089bb.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-be63dc99cd0bc3f8ac5f6626d38a7d6c2c683167f7440f9936733cf8e22cc9ba.yml From f4496c0d108c33154ffb66cffc77e894d157b478 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 16:27:32 +0000 Subject: [PATCH 319/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index fda2e4ba9e4..97a2d9aecb8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-be63dc99cd0bc3f8ac5f6626d38a7d6c2c683167f7440f9936733cf8e22cc9ba.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-948db90b67e56eee030c84195a5836541eb93a4bc6b46571f1b00d4cf069eb10.yml From da2ce0dcaf3806da245f6a9b040d8b5d17d992d3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 17:38:01 +0000 Subject: [PATCH 320/358] feat(api): api update (#2477) --- .stats.yml | 2 +- .../resources/radar/ai/bots/summary.py | 82 +- .../resources/radar/ai/inference/summary.py | 88 +- .../ai/inference/timeseries_groups/summary.py | 88 +- .../resources/radar/ai/timeseries_groups.py | 80 +- .../radar/annotations/annotations.py | 24 +- .../resources/radar/annotations/outages.py | 36 +- src/cloudflare/resources/radar/as112/as112.py | 64 +- .../resources/radar/as112/summary.py | 420 ++++---- .../radar/as112/timeseries_groups.py | 426 ++++---- src/cloudflare/resources/radar/as112/top.py | 296 +++--- .../resources/radar/attacks/layer3/layer3.py | 68 +- .../resources/radar/attacks/layer3/summary.py | 292 +++--- .../radar/attacks/layer3/timeseries_groups.py | 436 ++++---- .../radar/attacks/layer3/top/locations.py | 120 +-- .../resources/radar/attacks/layer3/top/top.py | 210 ++-- .../resources/radar/attacks/layer7/layer7.py | 84 +- .../resources/radar/attacks/layer7/summary.py | 416 ++++---- .../radar/attacks/layer7/timeseries_groups.py | 600 +++++------ .../radar/attacks/layer7/top/ases.py | 76 +- .../radar/attacks/layer7/top/locations.py | 148 +-- .../resources/radar/attacks/layer7/top/top.py | 252 ++--- src/cloudflare/resources/radar/bgp/bgp.py | 50 +- .../resources/radar/bgp/hijacks/events.py | 58 +- src/cloudflare/resources/radar/bgp/ips.py | 56 +- .../resources/radar/bgp/leaks/events.py | 40 +- src/cloudflare/resources/radar/bgp/routes.py | 76 +- .../resources/radar/bgp/top/ases.py | 66 +- src/cloudflare/resources/radar/bgp/top/top.py | 52 +- src/cloudflare/resources/radar/datasets.py | 48 +- src/cloudflare/resources/radar/dns/top.py | 136 +-- .../resources/radar/email/routing/summary.py | 308 +++--- .../radar/email/routing/timeseries_groups.py | 308 +++--- .../resources/radar/email/security/summary.py | 444 ++++---- .../radar/email/security/timeseries_groups.py | 446 ++++---- .../email/security/top/tlds/malicious.py | 62 +- .../radar/email/security/top/tlds/spam.py | 62 +- .../radar/email/security/top/tlds/spoof.py | 62 +- .../radar/email/security/top/tlds/tlds.py | 66 +- .../resources/radar/entities/asns.py | 92 +- .../resources/radar/entities/entities.py | 8 +- .../resources/radar/entities/locations.py | 44 +- .../resources/radar/http/ases/ases.py | 108 +- .../resources/radar/http/ases/bot_class.py | 112 +-- .../radar/http/ases/browser_family.py | 100 +- .../resources/radar/http/ases/device_type.py | 100 +- .../resources/radar/http/ases/http_method.py | 100 +- .../radar/http/ases/http_protocol.py | 108 +- .../resources/radar/http/ases/ip_version.py | 100 +- .../resources/radar/http/ases/os.py | 100 +- .../resources/radar/http/ases/tls_version.py | 100 +- src/cloudflare/resources/radar/http/http.py | 92 +- .../radar/http/locations/bot_class.py | 114 +-- .../radar/http/locations/browser_family.py | 104 +- .../radar/http/locations/device_type.py | 104 +- .../radar/http/locations/http_method.py | 104 +- .../radar/http/locations/http_protocol.py | 112 ++- .../radar/http/locations/ip_version.py | 104 +- .../radar/http/locations/locations.py | 108 +- .../resources/radar/http/locations/os.py | 100 +- .../radar/http/locations/tls_version.py | 100 +- .../resources/radar/http/summary.py | 732 +++++++------- .../resources/radar/http/timeseries_groups.py | 952 +++++++++--------- src/cloudflare/resources/radar/http/top.py | 212 ++-- .../resources/radar/netflows/netflows.py | 144 ++- .../resources/radar/netflows/top.py | 140 ++- src/cloudflare/resources/radar/quality/iqi.py | 148 +-- .../resources/radar/quality/speed/speed.py | 108 +- .../resources/radar/quality/speed/top.py | 120 +-- .../resources/radar/ranking/domain.py | 36 +- .../radar/ranking/internet_services.py | 62 +- .../resources/radar/ranking/ranking.py | 98 +- .../resources/radar/robots_txt/top/top.py | 20 +- .../radar/robots_txt/top/user_agents.py | 28 +- src/cloudflare/resources/radar/search.py | 16 +- .../resources/radar/tcp_resets_timeouts.py | 136 +-- .../radar/traffic_anomalies/locations.py | 20 +- .../traffic_anomalies/traffic_anomalies.py | 38 +- .../resources/radar/verified_bots/top.py | 140 +-- .../ai/bots/summary_user_agent_params.py | 37 +- .../ai/inference/summary_model_params.py | 19 +- .../radar/ai/inference/summary_task_params.py | 19 +- .../timeseries_groups/summary_model_params.py | 19 +- .../timeseries_groups/summary_task_params.py | 19 +- .../ai/timeseries_group_user_agent_params.py | 37 +- .../types/radar/annotation_list_params.py | 10 +- .../radar/annotations/outage_get_params.py | 10 +- .../annotations/outage_locations_params.py | 4 +- .../radar/as112/summary_dnssec_params.py | 29 +- .../types/radar/as112/summary_edns_params.py | 29 +- .../radar/as112/summary_ip_version_params.py | 29 +- .../radar/as112/summary_protocol_params.py | 29 +- .../radar/as112/summary_query_type_params.py | 37 +- .../as112/summary_response_codes_params.py | 37 +- .../as112/timeseries_group_dnssec_params.py | 29 +- .../as112/timeseries_group_edns_params.py | 29 +- .../timeseries_group_ip_version_params.py | 29 +- .../as112/timeseries_group_protocol_params.py | 29 +- .../timeseries_group_query_type_params.py | 37 +- .../timeseries_group_response_codes_params.py | 37 +- .../types/radar/as112/top_dnssec_params.py | 31 +- .../types/radar/as112/top_edns_params.py | 31 +- .../radar/as112/top_ip_version_params.py | 31 +- .../types/radar/as112/top_locations_params.py | 31 +- .../types/radar/as112_timeseries_params.py | 29 +- .../attacks/layer3/summary_bitrate_params.py | 25 +- .../attacks/layer3/summary_duration_params.py | 25 +- .../layer3/summary_ip_version_params.py | 23 +- .../attacks/layer3/summary_protocol_params.py | 25 +- .../attacks/layer3/summary_vector_params.py | 33 +- .../layer3/timeseries_group_bitrate_params.py | 25 +- .../timeseries_group_duration_params.py | 25 +- .../timeseries_group_industry_params.py | 33 +- .../timeseries_group_ip_version_params.py | 23 +- .../timeseries_group_protocol_params.py | 25 +- .../layer3/timeseries_group_vector_params.py | 33 +- .../timeseries_group_vertical_params.py | 33 +- .../layer3/top/location_origin_params.py | 27 +- .../layer3/top/location_target_params.py | 27 +- .../attacks/layer3/top_attacks_params.py | 35 +- .../attacks/layer3/top_industry_params.py | 27 +- .../attacks/layer3/top_vertical_params.py | 27 +- .../radar/attacks/layer3_timeseries_params.py | 31 +- .../layer7/summary_http_method_params.py | 41 +- .../layer7/summary_http_version_params.py | 33 +- .../layer7/summary_ip_version_params.py | 33 +- .../layer7/summary_managed_rules_params.py | 43 +- .../summary_mitigation_product_params.py | 43 +- .../timeseries_group_http_method_params.py | 41 +- .../timeseries_group_http_version_params.py | 33 +- .../timeseries_group_industry_params.py | 43 +- .../timeseries_group_ip_version_params.py | 33 +- .../timeseries_group_managed_rules_params.py | 43 +- ...eseries_group_mitigation_product_params.py | 43 +- .../timeseries_group_vertical_params.py | 43 +- .../attacks/layer7/top/ase_origin_params.py | 31 +- .../layer7/top/location_origin_params.py | 31 +- .../layer7/top/location_target_params.py | 25 +- .../attacks/layer7/top_attacks_params.py | 39 +- .../attacks/layer7/top_industry_params.py | 37 +- .../attacks/layer7/top_vertical_params.py | 37 +- .../radar/attacks/layer7_timeseries_params.py | 35 +- .../radar/bgp/hijacks/event_list_params.py | 24 +- .../types/radar/bgp/ip_timeseries_params.py | 23 +- .../radar/bgp/leaks/event_list_params.py | 18 +- .../types/radar/bgp/route_ases_params.py | 12 +- .../types/radar/bgp/route_moas_params.py | 6 +- .../types/radar/bgp/route_pfx2as_params.py | 6 +- .../types/radar/bgp/route_stats_params.py | 6 +- .../types/radar/bgp/top/ase_get_params.py | 19 +- .../radar/bgp/top/ase_prefixes_params.py | 4 +- .../types/radar/bgp/top_prefixes_params.py | 19 +- .../types/radar/bgp_timeseries_params.py | 17 +- .../types/radar/dataset_download_params.py | 2 +- .../types/radar/dataset_list_params.py | 8 +- .../types/radar/dns/top_ases_params.py | 31 +- .../types/radar/dns/top_locations_params.py | 31 +- .../radar/email/routing/summary_arc_params.py | 24 +- .../email/routing/summary_dkim_params.py | 24 +- .../email/routing/summary_dmarc_params.py | 21 +- .../email/routing/summary_encrypted_params.py | 24 +- .../routing/summary_ip_version_params.py | 24 +- .../radar/email/routing/summary_spf_params.py | 24 +- .../routing/timeseries_group_arc_params.py | 24 +- .../routing/timeseries_group_dkim_params.py | 24 +- .../routing/timeseries_group_dmarc_params.py | 21 +- .../timeseries_group_encrypted_params.py | 24 +- .../timeseries_group_ip_version_params.py | 24 +- .../routing/timeseries_group_spf_params.py | 24 +- .../email/security/summary_arc_params.py | 22 +- .../email/security/summary_dkim_params.py | 22 +- .../email/security/summary_dmarc_params.py | 19 +- .../security/summary_malicious_params.py | 24 +- .../email/security/summary_spam_params.py | 24 +- .../email/security/summary_spf_params.py | 22 +- .../email/security/summary_spoof_params.py | 24 +- .../summary_threat_category_params.py | 24 +- .../security/summary_tls_version_params.py | 22 +- .../security/timeseries_group_arc_params.py | 22 +- .../security/timeseries_group_dkim_params.py | 22 +- .../security/timeseries_group_dmarc_params.py | 19 +- .../timeseries_group_malicious_params.py | 24 +- .../security/timeseries_group_spam_params.py | 24 +- .../security/timeseries_group_spf_params.py | 22 +- .../security/timeseries_group_spoof_params.py | 24 +- ...timeseries_group_threat_category_params.py | 24 +- .../timeseries_group_tls_version_params.py | 22 +- .../email/security/top/tld_get_params.py | 28 +- .../security/top/tlds/malicious_get_params.py | 28 +- .../security/top/tlds/spam_get_params.py | 28 +- .../security/top/tlds/spoof_get_params.py | 28 +- .../types/radar/entities/asn_get_params.py | 2 +- .../types/radar/entities/asn_ip_params.py | 2 +- .../types/radar/entities/asn_list_params.py | 12 +- .../types/radar/entities/asn_rel_params.py | 4 +- .../radar/entities/location_get_params.py | 2 +- .../radar/entities/location_list_params.py | 8 +- .../types/radar/entity_get_params.py | 2 +- .../types/radar/http/ase_get_params.py | 47 +- .../radar/http/ases/bot_class_get_params.py | 45 +- .../http/ases/browser_family_get_params.py | 45 +- .../radar/http/ases/device_type_get_params.py | 45 +- .../radar/http/ases/http_method_get_params.py | 45 +- .../http/ases/http_protocol_get_params.py | 46 +- .../radar/http/ases/ip_version_get_params.py | 45 +- .../types/radar/http/ases/os_get_params.py | 45 +- .../radar/http/ases/tls_version_get_params.py | 45 +- .../types/radar/http/location_get_params.py | 47 +- .../http/locations/bot_class_get_params.py | 45 +- .../locations/browser_family_get_params.py | 45 +- .../http/locations/device_type_get_params.py | 45 +- .../http/locations/http_method_get_params.py | 45 +- .../locations/http_protocol_get_params.py | 46 +- .../http/locations/ip_version_get_params.py | 45 +- .../radar/http/locations/os_get_params.py | 45 +- .../http/locations/tls_version_get_params.py | 45 +- .../radar/http/summary_bot_class_params.py | 41 +- .../radar/http/summary_device_type_params.py | 41 +- .../http/summary_http_protocol_params.py | 41 +- .../radar/http/summary_http_version_params.py | 41 +- .../radar/http/summary_ip_version_params.py | 41 +- .../types/radar/http/summary_os_params.py | 41 +- .../radar/http/summary_post_quantum_params.py | 43 +- .../radar/http/summary_tls_version_params.py | 41 +- .../http/timeseries_group_bot_class_params.py | 41 +- .../timeseries_group_browser_family_params.py | 51 +- .../http/timeseries_group_browser_params.py | 51 +- .../timeseries_group_device_type_params.py | 41 +- .../timeseries_group_http_protocol_params.py | 41 +- .../timeseries_group_http_version_params.py | 41 +- .../timeseries_group_ip_version_params.py | 41 +- .../radar/http/timeseries_group_os_params.py | 41 +- .../timeseries_group_post_quantum_params.py | 43 +- .../timeseries_group_tls_version_params.py | 41 +- .../radar/http/top_browser_family_params.py | 45 +- .../types/radar/http/top_browser_params.py | 47 +- .../types/radar/http_timeseries_params.py | 43 +- .../types/radar/netflow_summary_params.py | 29 +- .../types/radar/netflow_timeseries_params.py | 31 +- .../types/radar/netflows/top_ases_params.py | 31 +- .../radar/netflows/top_locations_params.py | 31 +- .../types/radar/quality/iqi_summary_params.py | 31 +- .../quality/iqi_timeseries_groups_params.py | 33 +- .../radar/quality/speed/top_ases_params.py | 26 +- .../quality/speed/top_locations_params.py | 26 +- .../radar/quality/speed_histogram_params.py | 24 +- .../radar/quality/speed_summary_params.py | 22 +- .../types/radar/ranking/domain_get_params.py | 10 +- .../radar/ranking/domain_get_response.py | 17 +- ...ternet_service_timeseries_groups_params.py | 15 +- .../ranking/internet_service_top_params.py | 8 +- .../radar/ranking_timeseries_groups_params.py | 21 +- .../types/radar/ranking_top_params.py | 12 +- .../top/user_agent_directive_params.py | 12 +- .../top_domain_categories_params.py | 8 +- .../types/radar/search_global_params.py | 6 +- .../tcp_resets_timeout_summary_params.py | 29 +- ...resets_timeout_timeseries_groups_params.py | 29 +- .../traffic_anomalies/location_get_params.py | 4 +- .../types/radar/traffic_anomaly_get_params.py | 10 +- .../radar/verified_bots/top_bots_params.py | 31 +- .../verified_bots/top_categories_params.py | 31 +- .../radar/ai/bots/test_summary.py | 4 +- .../radar/ai/inference/test_summary.py | 8 +- .../timeseries_groups/test_summary.py | 8 +- .../radar/ai/test_timeseries_groups.py | 4 +- .../api_resources/radar/as112/test_summary.py | 24 +- .../radar/as112/test_timeseries_groups.py | 24 +- tests/api_resources/radar/as112/test_top.py | 16 +- .../radar/attacks/layer3/test_summary.py | 20 +- .../attacks/layer3/test_timeseries_groups.py | 28 +- .../radar/attacks/layer3/test_top.py | 14 +- .../attacks/layer3/top/test_locations.py | 8 +- .../radar/attacks/layer7/test_summary.py | 20 +- .../attacks/layer7/test_timeseries_groups.py | 28 +- .../radar/attacks/layer7/test_top.py | 12 +- .../radar/attacks/layer7/top/test_ases.py | 4 +- .../attacks/layer7/top/test_locations.py | 8 +- .../radar/attacks/test_layer3.py | 4 +- .../radar/attacks/test_layer7.py | 4 +- tests/api_resources/radar/bgp/test_ips.py | 4 +- tests/api_resources/radar/bgp/test_routes.py | 4 +- tests/api_resources/radar/bgp/test_top.py | 4 +- .../api_resources/radar/bgp/top/test_ases.py | 4 +- tests/api_resources/radar/dns/test_top.py | 8 +- .../radar/email/routing/test_summary.py | 24 +- .../email/routing/test_timeseries_groups.py | 24 +- .../radar/email/security/test_summary.py | 36 +- .../email/security/test_timeseries_groups.py | 36 +- .../radar/email/security/top/test_tlds.py | 4 +- .../email/security/top/tlds/test_malicious.py | 4 +- .../email/security/top/tlds/test_spam.py | 4 +- .../email/security/top/tlds/test_spoof.py | 4 +- .../api_resources/radar/entities/test_asns.py | 16 +- .../radar/http/ases/test_bot_class.py | 4 +- .../radar/http/ases/test_browser_family.py | 4 +- .../radar/http/ases/test_device_type.py | 4 +- .../radar/http/ases/test_http_method.py | 4 +- .../radar/http/ases/test_http_protocol.py | 6 +- .../radar/http/ases/test_ip_version.py | 4 +- .../api_resources/radar/http/ases/test_os.py | 4 +- .../radar/http/ases/test_tls_version.py | 4 +- .../radar/http/locations/test_bot_class.py | 4 +- .../http/locations/test_browser_family.py | 4 +- .../radar/http/locations/test_device_type.py | 4 +- .../radar/http/locations/test_http_method.py | 4 +- .../http/locations/test_http_protocol.py | 6 +- .../radar/http/locations/test_ip_version.py | 4 +- .../radar/http/locations/test_os.py | 4 +- .../radar/http/locations/test_tls_version.py | 4 +- tests/api_resources/radar/http/test_ases.py | 4 +- .../radar/http/test_locations.py | 4 +- .../api_resources/radar/http/test_summary.py | 32 +- .../radar/http/test_timeseries_groups.py | 40 +- tests/api_resources/radar/http/test_top.py | 8 +- .../api_resources/radar/netflows/test_top.py | 8 +- .../radar/quality/speed/test_top.py | 8 +- tests/api_resources/radar/quality/test_iqi.py | 8 +- .../api_resources/radar/quality/test_speed.py | 8 +- .../radar/ranking/test_domain.py | 4 +- .../radar/ranking/test_internet_services.py | 8 +- .../radar/robots_txt/test_top.py | 4 +- .../radar/robots_txt/top/test_user_agents.py | 4 +- tests/api_resources/radar/test_as112.py | 4 +- tests/api_resources/radar/test_bgp.py | 4 +- tests/api_resources/radar/test_http.py | 4 +- tests/api_resources/radar/test_netflows.py | 8 +- tests/api_resources/radar/test_ranking.py | 8 +- .../radar/test_tcp_resets_timeouts.py | 8 +- .../radar/verified_bots/test_top.py | 8 +- 330 files changed, 9060 insertions(+), 8732 deletions(-) diff --git a/.stats.yml b/.stats.yml index 97a2d9aecb8..a65e40c11eb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-948db90b67e56eee030c84195a5836541eb93a4bc6b46571f1b00d4cf069eb10.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fc5b966b698b287edea83ecae20186c967fd805bfd665e0b1d0aec760ee85636.yml diff --git a/src/cloudflare/resources/radar/ai/bots/summary.py b/src/cloudflare/resources/radar/ai/bots/summary.py index 1076459c8c1..9547fb5c7e3 100644 --- a/src/cloudflare/resources/radar/ai/bots/summary.py +++ b/src/cloudflare/resources/radar/ai/bots/summary.py @@ -69,38 +69,37 @@ def user_agent( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryUserAgentResponse: """ - Percentage of Internet traffic generated by AI user agents, over a given time - period. + Retrieves the distribution of traffic by AI user agent. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -177,38 +176,37 @@ async def user_agent( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryUserAgentResponse: """ - Percentage of Internet traffic generated by AI user agents, over a given time - period. + Retrieves the distribution of traffic by AI user agent. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/ai/inference/summary.py b/src/cloudflare/resources/radar/ai/inference/summary.py index 35c328e190b..0c4077bb433 100644 --- a/src/cloudflare/resources/radar/ai/inference/summary.py +++ b/src/cloudflare/resources/radar/ai/inference/summary.py @@ -67,25 +67,25 @@ def model( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryModelResponse: """ - Percentage distribution of unique accounts by model. + Retrieves the distribution of unique accounts by model. Args: date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -135,25 +135,25 @@ def task( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryTaskResponse: """ - Percentage distribution of unique accounts by task. + Retrieves the distribution of unique accounts by task. Args: date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -224,25 +224,25 @@ async def model( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryModelResponse: """ - Percentage distribution of unique accounts by model. + Retrieves the distribution of unique accounts by model. Args: date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -292,25 +292,25 @@ async def task( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryTaskResponse: """ - Percentage distribution of unique accounts by task. + Retrieves the distribution of unique accounts by task. Args: date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/ai/inference/timeseries_groups/summary.py b/src/cloudflare/resources/radar/ai/inference/timeseries_groups/summary.py index 07207a2072a..97cb3719965 100644 --- a/src/cloudflare/resources/radar/ai/inference/timeseries_groups/summary.py +++ b/src/cloudflare/resources/radar/ai/inference/timeseries_groups/summary.py @@ -68,7 +68,7 @@ def model( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryModelResponse: """ - Percentage distribution of unique accounts by model over time. + Retrieves the distribution of unique accounts by model over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes @@ -77,20 +77,20 @@ def model( date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -142,7 +142,7 @@ def task( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryTaskResponse: """ - Percentage distribution of unique accounts by task over time. + Retrieves the distribution of unique accounts by task over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes @@ -151,20 +151,20 @@ def task( date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -237,7 +237,7 @@ async def model( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryModelResponse: """ - Percentage distribution of unique accounts by model over time. + Retrieves the distribution of unique accounts by model over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes @@ -246,20 +246,20 @@ async def model( date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -311,7 +311,7 @@ async def task( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryTaskResponse: """ - Percentage distribution of unique accounts by task over time. + Retrieves the distribution of unique accounts by task over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes @@ -320,20 +320,20 @@ async def task( date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/ai/timeseries_groups.py b/src/cloudflare/resources/radar/ai/timeseries_groups.py index ccd3113a42a..13ff03031e0 100644 --- a/src/cloudflare/resources/radar/ai/timeseries_groups.py +++ b/src/cloudflare/resources/radar/ai/timeseries_groups.py @@ -70,41 +70,41 @@ def user_agent( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupUserAgentResponse: """ - Percentage distribution of traffic per AI user agent over time. + Retrieves the distribution of traffic by AI user agent over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -183,41 +183,41 @@ async def user_agent( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupUserAgentResponse: """ - Percentage distribution of traffic per AI user agent over time. + Retrieves the distribution of traffic by AI user agent over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/annotations/annotations.py b/src/cloudflare/resources/radar/annotations/annotations.py index 256eeb936d2..344c1d84fa5 100644 --- a/src/cloudflare/resources/radar/annotations/annotations.py +++ b/src/cloudflare/resources/radar/annotations/annotations.py @@ -80,10 +80,10 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AnnotationListResponse: """ - Get the latest annotations. + Retrieves the latest annotations. Args: - asn: Single ASN as integer. + asn: Single Autonomous System Number (ASN) as integer. date_end: End of the date range (inclusive). @@ -92,13 +92,13 @@ def list( date_start: Start of the date range (inclusive). - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Location Alpha2 code. + location: Location alpha-2 code. - offset: Number of objects to skip before grabbing results. + offset: Skips the specified number of objects before fetching the results. extra_headers: Send extra headers @@ -177,10 +177,10 @@ async def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AnnotationListResponse: """ - Get the latest annotations. + Retrieves the latest annotations. Args: - asn: Single ASN as integer. + asn: Single Autonomous System Number (ASN) as integer. date_end: End of the date range (inclusive). @@ -189,13 +189,13 @@ async def list( date_start: Start of the date range (inclusive). - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Location Alpha2 code. + location: Location alpha-2 code. - offset: Number of objects to skip before grabbing results. + offset: Skips the specified number of objects before fetching the results. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/annotations/outages.py b/src/cloudflare/resources/radar/annotations/outages.py index 9c920789a3c..9e2e19b0e6b 100644 --- a/src/cloudflare/resources/radar/annotations/outages.py +++ b/src/cloudflare/resources/radar/annotations/outages.py @@ -69,10 +69,10 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> OutageGetResponse: """ - Get latest Internet outages and anomalies. + Retrieves the latest Internet outages and anomalies. Args: - asn: Single ASN as integer. + asn: Single Autonomous System Number (ASN) as integer. date_end: End of the date range (inclusive). @@ -81,13 +81,13 @@ def get( date_start: Start of the date range (inclusive). - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Location Alpha2 code. + location: Location alpha-2 code. - offset: Number of objects to skip before grabbing results. + offset: Skips the specified number of objects before fetching the results. extra_headers: Send extra headers @@ -138,7 +138,7 @@ def locations( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> OutageLocationsResponse: """ - Get the number of outages by location. + Retrieves the number of outages by location. Args: date_end: End of the date range (inclusive). @@ -148,9 +148,9 @@ def locations( date_start: Start of the date range (inclusive). - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. extra_headers: Send extra headers @@ -222,10 +222,10 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> OutageGetResponse: """ - Get latest Internet outages and anomalies. + Retrieves the latest Internet outages and anomalies. Args: - asn: Single ASN as integer. + asn: Single Autonomous System Number (ASN) as integer. date_end: End of the date range (inclusive). @@ -234,13 +234,13 @@ async def get( date_start: Start of the date range (inclusive). - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Location Alpha2 code. + location: Location alpha-2 code. - offset: Number of objects to skip before grabbing results. + offset: Skips the specified number of objects before fetching the results. extra_headers: Send extra headers @@ -291,7 +291,7 @@ async def locations( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> OutageLocationsResponse: """ - Get the number of outages by location. + Retrieves the number of outages by location. Args: date_end: End of the date range (inclusive). @@ -301,9 +301,9 @@ async def locations( date_start: Start of the date range (inclusive). - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/as112/as112.py b/src/cloudflare/resources/radar/as112/as112.py index 094b93b8aad..1880df373c6 100644 --- a/src/cloudflare/resources/radar/as112/as112.py +++ b/src/cloudflare/resources/radar/as112/as112.py @@ -105,36 +105,36 @@ def timeseries( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AS112TimeseriesResponse: """ - Get AS112 queries change over time. + Retrieves the AS112 DNS queries over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -223,36 +223,36 @@ async def timeseries( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AS112TimeseriesResponse: """ - Get AS112 queries change over time. + Retrieves the AS112 DNS queries over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/as112/summary.py b/src/cloudflare/resources/radar/as112/summary.py index a13d6d2bd54..5a6215294c7 100644 --- a/src/cloudflare/resources/radar/as112/summary.py +++ b/src/cloudflare/resources/radar/as112/summary.py @@ -80,32 +80,33 @@ def dnssec( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryDNSSECResponse: """ - Percentage distribution of DNS queries to AS112 by DNSSEC support. + Retrieves the distribution of DNS queries to AS112 by DNSSEC (DNS Security + Extensions) support. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -159,32 +160,33 @@ def edns( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryEdnsResponse: """ - Percentage distribution of DNS queries to AS112 by EDNS support. + Retrieves the distribution of DNS queries to AS112 by EDNS (Extension Mechanisms + for DNS) support. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -238,32 +240,32 @@ def ip_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryIPVersionResponse: """ - Percentage distribution of DNS queries to AS112 per IP Version. + Retrieves the distribution of DNS queries to AS112 by IP version. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -317,32 +319,32 @@ def protocol( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryProtocolResponse: """ - Percentage distribution of DNS queries to AS112 per protocol. + Retrieves the distribution of DNS queries to AS112 by protocol. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -397,37 +399,37 @@ def query_type( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryQueryTypeResponse: """ - Percentage distribution of DNS queries to AS112 by query type. + Retrieves the distribution of DNS queries to AS112 by type. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -483,37 +485,37 @@ def response_codes( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryResponseCodesResponse: """ - Percentage distribution of AS112 DNS requests classified by response code. + Retrieves the distribution of AS112 DNS requests classified by response code. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -589,32 +591,33 @@ async def dnssec( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryDNSSECResponse: """ - Percentage distribution of DNS queries to AS112 by DNSSEC support. + Retrieves the distribution of DNS queries to AS112 by DNSSEC (DNS Security + Extensions) support. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -668,32 +671,33 @@ async def edns( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryEdnsResponse: """ - Percentage distribution of DNS queries to AS112 by EDNS support. + Retrieves the distribution of DNS queries to AS112 by EDNS (Extension Mechanisms + for DNS) support. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -747,32 +751,32 @@ async def ip_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryIPVersionResponse: """ - Percentage distribution of DNS queries to AS112 per IP Version. + Retrieves the distribution of DNS queries to AS112 by IP version. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -826,32 +830,32 @@ async def protocol( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryProtocolResponse: """ - Percentage distribution of DNS queries to AS112 per protocol. + Retrieves the distribution of DNS queries to AS112 by protocol. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -906,37 +910,37 @@ async def query_type( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryQueryTypeResponse: """ - Percentage distribution of DNS queries to AS112 by query type. + Retrieves the distribution of DNS queries to AS112 by type. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -992,37 +996,37 @@ async def response_codes( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryResponseCodesResponse: """ - Percentage distribution of AS112 DNS requests classified by response code. + Retrieves the distribution of AS112 DNS requests classified by response code. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/as112/timeseries_groups.py b/src/cloudflare/resources/radar/as112/timeseries_groups.py index db37c9b8831..d2500734ae2 100644 --- a/src/cloudflare/resources/radar/as112/timeseries_groups.py +++ b/src/cloudflare/resources/radar/as112/timeseries_groups.py @@ -81,36 +81,37 @@ def dnssec( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupDNSSECResponse: """ - Percentage distribution of AS112 DNS queries by DNSSEC support over time. + Retrieves the distribution of AS112 DNS queries by DNSSEC (DNS Security + Extensions) support over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -166,36 +167,37 @@ def edns( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupEdnsResponse: """ - Percentage distribution of AS112 DNS queries by EDNS support over time. + Retrieves the distribution of AS112 DNS queries by EDNS (Extension Mechanisms + for DNS) support over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -251,36 +253,36 @@ def ip_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupIPVersionResponse: """ - Percentage distribution of AS112 DNS queries by IP version over time. + Retrieves the distribution of AS112 DNS queries by IP version over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -336,36 +338,37 @@ def protocol( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupProtocolResponse: """ - Percentage distribution of AS112 DNS requests classified by protocol over time. + Retrieves the distribution of AS112 DNS requests classified by protocol over + time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -422,41 +425,41 @@ def query_type( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupQueryTypeResponse: """ - Percentage distribution of AS112 DNS queries by query type over time. + Retrieves the distribution of AS112 DNS queries by type over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -514,42 +517,42 @@ def response_codes( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupResponseCodesResponse: """ - Percentage distribution of AS112 DNS requests classified by response code over - time. + Retrieves the distribution of AS112 DNS requests classified by response code + over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -629,36 +632,37 @@ async def dnssec( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupDNSSECResponse: """ - Percentage distribution of AS112 DNS queries by DNSSEC support over time. + Retrieves the distribution of AS112 DNS queries by DNSSEC (DNS Security + Extensions) support over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -714,36 +718,37 @@ async def edns( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupEdnsResponse: """ - Percentage distribution of AS112 DNS queries by EDNS support over time. + Retrieves the distribution of AS112 DNS queries by EDNS (Extension Mechanisms + for DNS) support over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -799,36 +804,36 @@ async def ip_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupIPVersionResponse: """ - Percentage distribution of AS112 DNS queries by IP version over time. + Retrieves the distribution of AS112 DNS queries by IP version over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -884,36 +889,37 @@ async def protocol( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupProtocolResponse: """ - Percentage distribution of AS112 DNS requests classified by protocol over time. + Retrieves the distribution of AS112 DNS requests classified by protocol over + time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -970,41 +976,41 @@ async def query_type( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupQueryTypeResponse: """ - Percentage distribution of AS112 DNS queries by query type over time. + Retrieves the distribution of AS112 DNS queries by type over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -1062,42 +1068,42 @@ async def response_codes( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupResponseCodesResponse: """ - Percentage distribution of AS112 DNS requests classified by response code over - time. + Retrieves the distribution of AS112 DNS requests classified by response code + over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/as112/top.py b/src/cloudflare/resources/radar/as112/top.py index 9bb43032129..449f5aaf19c 100644 --- a/src/cloudflare/resources/radar/as112/top.py +++ b/src/cloudflare/resources/radar/as112/top.py @@ -73,36 +73,37 @@ def dnssec( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopDNSSECResponse: """ - Get the top locations of DNS queries to AS112 with DNSSEC. + Retrieves the top locations of DNS queries to AS112 with DNSSEC (DNS Security + Extensions) support. Args: - dnssec: DNSSEC. + dnssec: DNSSEC (DNS Security Extensions) status. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -161,36 +162,37 @@ def edns( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopEdnsResponse: """ - Get the top locations of DNS queries to AS112 with EDNS support. + Retrieves the top locations of DNS queries to AS112 with EDNS (Extension + Mechanisms for DNS) support. Args: - edns: EDNS. + edns: EDNS (Extension Mechanisms for DNS) status. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -249,36 +251,36 @@ def ip_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopIPVersionResponse: """ - Get the top locations of DNS queries to AS112 by IP version. + Retrieves the top locations of DNS queries to AS112 for an IP version. Args: - ip_version: IP Version. + ip_version: IP version. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -335,37 +337,35 @@ def locations( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopLocationsResponse: - """Get the top locations by AS112 DNS queries. - - Values are a percentage out of the - total queries. + """ + Retrieves the top locations by AS112 DNS queries. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -443,36 +443,37 @@ async def dnssec( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopDNSSECResponse: """ - Get the top locations of DNS queries to AS112 with DNSSEC. + Retrieves the top locations of DNS queries to AS112 with DNSSEC (DNS Security + Extensions) support. Args: - dnssec: DNSSEC. + dnssec: DNSSEC (DNS Security Extensions) status. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -531,36 +532,37 @@ async def edns( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopEdnsResponse: """ - Get the top locations of DNS queries to AS112 with EDNS support. + Retrieves the top locations of DNS queries to AS112 with EDNS (Extension + Mechanisms for DNS) support. Args: - edns: EDNS. + edns: EDNS (Extension Mechanisms for DNS) status. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -619,36 +621,36 @@ async def ip_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopIPVersionResponse: """ - Get the top locations of DNS queries to AS112 by IP version. + Retrieves the top locations of DNS queries to AS112 for an IP version. Args: - ip_version: IP Version. + ip_version: IP version. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -705,37 +707,35 @@ async def locations( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopLocationsResponse: - """Get the top locations by AS112 DNS queries. - - Values are a percentage out of the - total queries. + """ + Retrieves the top locations by AS112 DNS queries. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/attacks/layer3/layer3.py b/src/cloudflare/resources/radar/attacks/layer3/layer3.py index 6bca4393fac..dd43093b010 100644 --- a/src/cloudflare/resources/radar/attacks/layer3/layer3.py +++ b/src/cloudflare/resources/radar/attacks/layer3/layer3.py @@ -110,43 +110,43 @@ def timeseries( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Layer3TimeseriesResponse: """ - Get attacks change over time by bytes. + Retrieves layer 3 attacks over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. direction: Together with the `location` parameter, will apply the filter to origin or target location. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. metric: Measurement units, eg. bytes. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). @@ -250,43 +250,43 @@ async def timeseries( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Layer3TimeseriesResponse: """ - Get attacks change over time by bytes. + Retrieves layer 3 attacks over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. direction: Together with the `location` parameter, will apply the filter to origin or target location. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. metric: Measurement units, eg. bytes. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). diff --git a/src/cloudflare/resources/radar/attacks/layer3/summary.py b/src/cloudflare/resources/radar/attacks/layer3/summary.py index aca17e78a54..3b3b37605d1 100644 --- a/src/cloudflare/resources/radar/attacks/layer3/summary.py +++ b/src/cloudflare/resources/radar/attacks/layer3/summary.py @@ -80,33 +80,33 @@ def bitrate( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryBitrateResponse: """ - Percentage distribution of attacks by bitrate. + Retrieves the distribution of layer 3 attacks by bitrate. Args: - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. direction: Together with the `location` parameter, will apply the filter to origin or target location. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. protocol: Array of L3/4 attack types. @@ -166,33 +166,33 @@ def duration( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryDurationResponse: """ - Percentage distribution of attacks by duration. + Retrieves the distribution of layer 3 attacks by duration. Args: - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. direction: Together with the `location` parameter, will apply the filter to origin or target location. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. protocol: Array of L3/4 attack types. @@ -251,31 +251,31 @@ def ip_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryIPVersionResponse: """ - Percentage distribution of attacks by ip version used. + Retrieves the distribution of layer 3 attacks by IP version. Args: - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. direction: Together with the `location` parameter, will apply the filter to origin or target location. - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. protocol: Array of L3/4 attack types. @@ -333,33 +333,33 @@ def protocol( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryProtocolResponse: """ - Percentage distribution of attacks by protocol used. + Retrieves the distribution of layer 3 attacks by protocol. Args: - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. direction: Together with the `location` parameter, will apply the filter to origin or target location. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -417,38 +417,38 @@ def vector( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryVectorResponse: """ - Percentage distribution of attacks by vector. + Retrieves the distribution of layer 3 attacks by vector. Args: - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. direction: Together with the `location` parameter, will apply the filter to origin or target location. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. protocol: Array of L3/4 attack types. @@ -530,33 +530,33 @@ async def bitrate( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryBitrateResponse: """ - Percentage distribution of attacks by bitrate. + Retrieves the distribution of layer 3 attacks by bitrate. Args: - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. direction: Together with the `location` parameter, will apply the filter to origin or target location. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. protocol: Array of L3/4 attack types. @@ -616,33 +616,33 @@ async def duration( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryDurationResponse: """ - Percentage distribution of attacks by duration. + Retrieves the distribution of layer 3 attacks by duration. Args: - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. direction: Together with the `location` parameter, will apply the filter to origin or target location. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. protocol: Array of L3/4 attack types. @@ -701,31 +701,31 @@ async def ip_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryIPVersionResponse: """ - Percentage distribution of attacks by ip version used. + Retrieves the distribution of layer 3 attacks by IP version. Args: - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. direction: Together with the `location` parameter, will apply the filter to origin or target location. - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. protocol: Array of L3/4 attack types. @@ -783,33 +783,33 @@ async def protocol( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryProtocolResponse: """ - Percentage distribution of attacks by protocol used. + Retrieves the distribution of layer 3 attacks by protocol. Args: - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. direction: Together with the `location` parameter, will apply the filter to origin or target location. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -867,38 +867,38 @@ async def vector( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryVectorResponse: """ - Percentage distribution of attacks by vector. + Retrieves the distribution of layer 3 attacks by vector. Args: - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. direction: Together with the `location` parameter, will apply the filter to origin or target location. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. protocol: Array of L3/4 attack types. diff --git a/src/cloudflare/resources/radar/attacks/layer3/timeseries_groups.py b/src/cloudflare/resources/radar/attacks/layer3/timeseries_groups.py index 87d14552a5b..856fa90f19f 100644 --- a/src/cloudflare/resources/radar/attacks/layer3/timeseries_groups.py +++ b/src/cloudflare/resources/radar/attacks/layer3/timeseries_groups.py @@ -86,37 +86,37 @@ def bitrate( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupBitrateResponse: """ - Percentage distribution of attacks by bitrate over time. + Retrieves the distribution of layer 3 attacks by bitrate over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. direction: Together with the `location` parameter, will apply the filter to origin or target location. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). @@ -183,37 +183,37 @@ def duration( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupDurationResponse: """ - Percentage distribution of attacks by duration over time. + Retrieves the distribution of layer 3 attacks by duration over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. direction: Together with the `location` parameter, will apply the filter to origin or target location. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). @@ -281,42 +281,42 @@ def industry( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupIndustryResponse: """ - Percentage distribution of attacks by industry targeted over time. + Retrieves the distribution of layer 3 attacks by targeted industry over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. direction: Together with the `location` parameter, will apply the filter to origin or target location. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). @@ -383,35 +383,35 @@ def ip_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupIPVersionResponse: """ - Percentage distribution of attacks by ip version used over time. + Retrieves the distribution of layer 3 attacks by IP version over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. direction: Together with the `location` parameter, will apply the filter to origin or target location. - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). @@ -476,37 +476,37 @@ def protocol( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupProtocolResponse: """ - Percentage distribution of attacks by protocol used over time. + Retrieves the distribution of layer 3 attacks by protocol over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. direction: Together with the `location` parameter, will apply the filter to origin or target location. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). @@ -571,42 +571,42 @@ def vector( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupVectorResponse: """ - Percentage distribution of attacks by vector used over time. + Retrieves the distribution of layer 3 attacks by vector over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. direction: Together with the `location` parameter, will apply the filter to origin or target location. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). @@ -675,42 +675,42 @@ def vertical( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupVerticalResponse: """ - Percentage distribution of attacks by vertical targeted over time. + Retrieves the distribution of layer 3 attacks by targeted vertical over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. direction: Together with the `location` parameter, will apply the filter to origin or target location. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). @@ -799,37 +799,37 @@ async def bitrate( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupBitrateResponse: """ - Percentage distribution of attacks by bitrate over time. + Retrieves the distribution of layer 3 attacks by bitrate over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. direction: Together with the `location` parameter, will apply the filter to origin or target location. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). @@ -896,37 +896,37 @@ async def duration( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupDurationResponse: """ - Percentage distribution of attacks by duration over time. + Retrieves the distribution of layer 3 attacks by duration over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. direction: Together with the `location` parameter, will apply the filter to origin or target location. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). @@ -994,42 +994,42 @@ async def industry( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupIndustryResponse: """ - Percentage distribution of attacks by industry targeted over time. + Retrieves the distribution of layer 3 attacks by targeted industry over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. direction: Together with the `location` parameter, will apply the filter to origin or target location. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). @@ -1096,35 +1096,35 @@ async def ip_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupIPVersionResponse: """ - Percentage distribution of attacks by ip version used over time. + Retrieves the distribution of layer 3 attacks by IP version over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. direction: Together with the `location` parameter, will apply the filter to origin or target location. - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). @@ -1189,37 +1189,37 @@ async def protocol( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupProtocolResponse: """ - Percentage distribution of attacks by protocol used over time. + Retrieves the distribution of layer 3 attacks by protocol over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. direction: Together with the `location` parameter, will apply the filter to origin or target location. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). @@ -1284,42 +1284,42 @@ async def vector( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupVectorResponse: """ - Percentage distribution of attacks by vector used over time. + Retrieves the distribution of layer 3 attacks by vector over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. direction: Together with the `location` parameter, will apply the filter to origin or target location. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). @@ -1388,42 +1388,42 @@ async def vertical( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupVerticalResponse: """ - Percentage distribution of attacks by vertical targeted over time. + Retrieves the distribution of layer 3 attacks by targeted vertical over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. direction: Together with the `location` parameter, will apply the filter to origin or target location. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). diff --git a/src/cloudflare/resources/radar/attacks/layer3/top/locations.py b/src/cloudflare/resources/radar/attacks/layer3/top/locations.py index b2900433339..e36577d1114 100644 --- a/src/cloudflare/resources/radar/attacks/layer3/top/locations.py +++ b/src/cloudflare/resources/radar/attacks/layer3/top/locations.py @@ -71,32 +71,32 @@ def origin( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> LocationOriginResponse: """ - Get the origin locations of attacks. + Retrieves the origin locations of layer 3 attacks. Args: - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. protocol: Array of L3/4 attack types. @@ -156,32 +156,32 @@ def target( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> LocationTargetResponse: """ - Get the target locations of attacks. + Retrieves the target locations of layer 3 attacks. Args: - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. protocol: Array of L3/4 attack types. @@ -262,32 +262,32 @@ async def origin( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> LocationOriginResponse: """ - Get the origin locations of attacks. + Retrieves the origin locations of layer 3 attacks. Args: - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. protocol: Array of L3/4 attack types. @@ -347,32 +347,32 @@ async def target( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> LocationTargetResponse: """ - Get the target locations of attacks. + Retrieves the target locations of layer 3 attacks. Args: - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. protocol: Array of L3/4 attack types. diff --git a/src/cloudflare/resources/radar/attacks/layer3/top/top.py b/src/cloudflare/resources/radar/attacks/layer3/top/top.py index 14ef69d4b41..efb040bc725 100644 --- a/src/cloudflare/resources/radar/attacks/layer3/top/top.py +++ b/src/cloudflare/resources/radar/attacks/layer3/top/top.py @@ -76,6 +76,7 @@ def attacks( limit_direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, limit_per_location: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, + magnitude: Literal["MITIGATED_BYTES", "MITIGATED_ATTACKS"] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, normalization: Literal["PERCENTAGE", "MIN_MAX"] | NotGiven = NOT_GIVEN, protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, @@ -86,44 +87,47 @@ def attacks( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopAttacksResponse: - """Get the top attacks from origin to target location. + """Retrieves the top layer 3 attacks from origin to target location. - Values are a percentage out - of the total layer 3 attacks (with billing country). You can optionally limit - the number of attacks per origin/target location (useful if all the top attacks - are from or to the same location). + Values are a + percentage out of the total layer 3 attacks (with billing country). You can + optionally limit the number of attacks by origin/target location (useful if all + the top attacks are from or to the same location). Args: - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. limit_direction: Array of attack origin/target location attack limits. Together with `limitPerLocation`, limits how many objects will be fetched per origin/target location. - limit_per_location: Limit the number of attacks per origin/target (refer to `limitDirection` + limit_per_location: Limits the number of attacks per origin/target (refer to `limitDirection` parameter) location. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + magnitude: Attack magnitude can be defined by total mitigated bytes or by total mitigated + attacks. + + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). @@ -157,6 +161,7 @@ def attacks( "limit_direction": limit_direction, "limit_per_location": limit_per_location, "location": location, + "magnitude": magnitude, "name": name, "normalization": normalization, "protocol": protocol, @@ -189,32 +194,32 @@ def industry( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopIndustryResponse: """ - Get the industries targeted by attacks. + Retrieves the top industries targeted by layer 3 attacks. Args: - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. protocol: Array of L3/4 attack types. @@ -274,32 +279,32 @@ def vertical( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopVerticalResponse: """ - Get the verticals targeted by attacks. + Retrieves the top verticals targeted by layer 3 attacks. Args: - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. protocol: Array of L3/4 attack types. @@ -376,6 +381,7 @@ async def attacks( limit_direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, limit_per_location: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, + magnitude: Literal["MITIGATED_BYTES", "MITIGATED_ATTACKS"] | NotGiven = NOT_GIVEN, name: List[str] | NotGiven = NOT_GIVEN, normalization: Literal["PERCENTAGE", "MIN_MAX"] | NotGiven = NOT_GIVEN, protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, @@ -386,44 +392,47 @@ async def attacks( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopAttacksResponse: - """Get the top attacks from origin to target location. + """Retrieves the top layer 3 attacks from origin to target location. - Values are a percentage out - of the total layer 3 attacks (with billing country). You can optionally limit - the number of attacks per origin/target location (useful if all the top attacks - are from or to the same location). + Values are a + percentage out of the total layer 3 attacks (with billing country). You can + optionally limit the number of attacks by origin/target location (useful if all + the top attacks are from or to the same location). Args: - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. limit_direction: Array of attack origin/target location attack limits. Together with `limitPerLocation`, limits how many objects will be fetched per origin/target location. - limit_per_location: Limit the number of attacks per origin/target (refer to `limitDirection` + limit_per_location: Limits the number of attacks per origin/target (refer to `limitDirection` parameter) location. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. + + magnitude: Attack magnitude can be defined by total mitigated bytes or by total mitigated + attacks. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). @@ -457,6 +466,7 @@ async def attacks( "limit_direction": limit_direction, "limit_per_location": limit_per_location, "location": location, + "magnitude": magnitude, "name": name, "normalization": normalization, "protocol": protocol, @@ -489,32 +499,32 @@ async def industry( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopIndustryResponse: """ - Get the industries targeted by attacks. + Retrieves the top industries targeted by layer 3 attacks. Args: - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. protocol: Array of L3/4 attack types. @@ -574,32 +584,32 @@ async def vertical( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopVerticalResponse: """ - Get the verticals targeted by attacks. + Retrieves the top verticals targeted by layer 3 attacks. Args: - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. protocol: Array of L3/4 attack types. diff --git a/src/cloudflare/resources/radar/attacks/layer7/layer7.py b/src/cloudflare/resources/radar/attacks/layer7/layer7.py index 61a40334d00..1c7baf6c044 100644 --- a/src/cloudflare/resources/radar/attacks/layer7/layer7.py +++ b/src/cloudflare/resources/radar/attacks/layer7/layer7.py @@ -170,49 +170,47 @@ def timeseries( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Layer7TimeseriesResponse: - """Get a timeseries of Layer 7 attacks. - - Values represent HTTP requests and are - normalized using min-max by default. + """ + Retrieves layer 7 attacks over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. attack: This field is deprecated, please use the new `mitigationProduct`. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). @@ -375,49 +373,47 @@ async def timeseries( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Layer7TimeseriesResponse: - """Get a timeseries of Layer 7 attacks. - - Values represent HTTP requests and are - normalized using min-max by default. + """ + Retrieves layer 7 attacks over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. attack: This field is deprecated, please use the new `mitigationProduct`. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). diff --git a/src/cloudflare/resources/radar/attacks/layer7/summary.py b/src/cloudflare/resources/radar/attacks/layer7/summary.py index a5c52c855e7..328caa824cb 100644 --- a/src/cloudflare/resources/radar/attacks/layer7/summary.py +++ b/src/cloudflare/resources/radar/attacks/layer7/summary.py @@ -87,43 +87,43 @@ def http_method( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryHTTPMethodResponse: """ - Percentage distribution of attacks by http method used. + Retrieves the distribution of layer 7 attacks by HTTP method. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -239,38 +239,38 @@ def http_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryHTTPVersionResponse: """ - Percentage distribution of attacks by http version used. + Retrieves the distribution of layer 7 attacks by HTTP version. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -385,38 +385,38 @@ def ip_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryIPVersionResponse: """ - Percentage distribution of attacks by ip version used. + Retrieves the distribution of layer 7 attacks by IP version. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -533,45 +533,45 @@ def managed_rules( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryManagedRulesResponse: """ - Percentage distribution of attacks by managed rules used. + Retrieves the distribution of layer 7 attacks by managed rules. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -684,43 +684,43 @@ def mitigation_product( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryMitigationProductResponse: """ - Percentage distribution of attacks by mitigation product used. + Retrieves the distribution of layer 7 attacks by mitigation product. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -808,43 +808,43 @@ async def http_method( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryHTTPMethodResponse: """ - Percentage distribution of attacks by http method used. + Retrieves the distribution of layer 7 attacks by HTTP method. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -960,38 +960,38 @@ async def http_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryHTTPVersionResponse: """ - Percentage distribution of attacks by http version used. + Retrieves the distribution of layer 7 attacks by HTTP version. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -1106,38 +1106,38 @@ async def ip_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryIPVersionResponse: """ - Percentage distribution of attacks by ip version used. + Retrieves the distribution of layer 7 attacks by IP version. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -1254,45 +1254,45 @@ async def managed_rules( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryManagedRulesResponse: """ - Percentage distribution of attacks by managed rules used. + Retrieves the distribution of layer 7 attacks by managed rules. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -1405,43 +1405,43 @@ async def mitigation_product( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryMitigationProductResponse: """ - Percentage distribution of attacks by mitigation product used. + Retrieves the distribution of layer 7 attacks by mitigation product. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/attacks/layer7/timeseries_groups.py b/src/cloudflare/resources/radar/attacks/layer7/timeseries_groups.py index 56029b47f92..906e022ac1d 100644 --- a/src/cloudflare/resources/radar/attacks/layer7/timeseries_groups.py +++ b/src/cloudflare/resources/radar/attacks/layer7/timeseries_groups.py @@ -95,47 +95,47 @@ def http_method( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupHTTPMethodResponse: """ - Percentage distribution of attacks by http method used over time. + Retrieves the distribution of layer 7 attacks by HTTP method over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). @@ -258,42 +258,42 @@ def http_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupHTTPVersionResponse: """ - Percentage distribution of attacks by http version used over time. + Retrieves the distribution of layer 7 attacks by HTTP version over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). @@ -417,49 +417,49 @@ def industry( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupIndustryResponse: """ - Percentage distribution of attacks by targeted industry over time. + Retrieves the distribution of layer 7 attacks by targeted industry over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). @@ -583,42 +583,42 @@ def ip_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupIPVersionResponse: """ - Percentage distribution of attacks by ip version used over time. + Retrieves the distribution of layer 7 attacks by IP version used over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). @@ -742,49 +742,49 @@ def managed_rules( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupManagedRulesResponse: """ - Percentage distribution of attacks by managed rules used over time. + Retrieves the distribution of layer 7 attacks by managed rules over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). @@ -904,47 +904,47 @@ def mitigation_product( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupMitigationProductResponse: """ - Percentage distribution of attacks by mitigation product used over time. + Retrieves the distribution of layer 7 attacks by mitigation product over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). @@ -1071,49 +1071,49 @@ def vertical( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupVerticalResponse: """ - Percentage distribution of attacks by targeted vertical over time. + Retrieves the distribution of layer 7 attacks by targeted vertical over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). @@ -1209,47 +1209,47 @@ async def http_method( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupHTTPMethodResponse: """ - Percentage distribution of attacks by http method used over time. + Retrieves the distribution of layer 7 attacks by HTTP method over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). @@ -1372,42 +1372,42 @@ async def http_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupHTTPVersionResponse: """ - Percentage distribution of attacks by http version used over time. + Retrieves the distribution of layer 7 attacks by HTTP version over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). @@ -1531,49 +1531,49 @@ async def industry( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupIndustryResponse: """ - Percentage distribution of attacks by targeted industry over time. + Retrieves the distribution of layer 7 attacks by targeted industry over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). @@ -1697,42 +1697,42 @@ async def ip_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupIPVersionResponse: """ - Percentage distribution of attacks by ip version used over time. + Retrieves the distribution of layer 7 attacks by IP version used over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). @@ -1856,49 +1856,49 @@ async def managed_rules( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupManagedRulesResponse: """ - Percentage distribution of attacks by managed rules used over time. + Retrieves the distribution of layer 7 attacks by managed rules over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). @@ -2018,47 +2018,47 @@ async def mitigation_product( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupMitigationProductResponse: """ - Percentage distribution of attacks by mitigation product used over time. + Retrieves the distribution of layer 7 attacks by mitigation product over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). @@ -2185,49 +2185,49 @@ async def vertical( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupVerticalResponse: """ - Percentage distribution of attacks by targeted vertical over time. + Retrieves the distribution of layer 7 attacks by targeted vertical over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). diff --git a/src/cloudflare/resources/radar/attacks/layer7/top/ases.py b/src/cloudflare/resources/radar/attacks/layer7/top/ases.py index 86b39630759..8bd44c9277d 100644 --- a/src/cloudflare/resources/radar/attacks/layer7/top/ases.py +++ b/src/cloudflare/resources/radar/attacks/layer7/top/ases.py @@ -126,42 +126,42 @@ def origin( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AseOriginResponse: - """Get the top origin Autonomous Systems of and by Layer 7 attacks. + """Retrieves the top origin autonomous systems of layer 7 attacks. - Values are a - percentage out of the total Layer 7 attacks. The origin Autonomous Systems is + Values are + percentages of the total layer 7 attacks, with the origin autonomous systems determined by the client IP address. Args: - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -298,42 +298,42 @@ async def origin( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AseOriginResponse: - """Get the top origin Autonomous Systems of and by Layer 7 attacks. + """Retrieves the top origin autonomous systems of layer 7 attacks. - Values are a - percentage out of the total Layer 7 attacks. The origin Autonomous Systems is + Values are + percentages of the total layer 7 attacks, with the origin autonomous systems determined by the client IP address. Args: - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/attacks/layer7/top/locations.py b/src/cloudflare/resources/radar/attacks/layer7/top/locations.py index 18ba7f902d7..021c164d462 100644 --- a/src/cloudflare/resources/radar/attacks/layer7/top/locations.py +++ b/src/cloudflare/resources/radar/attacks/layer7/top/locations.py @@ -127,42 +127,42 @@ def origin( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> LocationOriginResponse: - """Get the top origin locations of and by Layer 7 attacks. + """Retrieves the top origin locations of layer 7 attacks. - Values are a percentage - out of the total Layer 7 attacks. The origin location is determined by the - client IP address. + Values are percentages of + the total layer 7 attacks, with the origin location determined by the client IP + address. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -277,38 +277,38 @@ def target( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> LocationTargetResponse: - """Get the top target locations of and by layer 7 attacks. + """Retrieves the top target locations of and by layer 7 attacks. - Values are a percentage - out of the total layer 7 attacks. The target location is determined by the - attacked zone's billing country, when available. + Values are a + percentage out of the total layer 7 attacks. The target location is determined + by the attacked zone's billing country, when available. Args: - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -444,42 +444,42 @@ async def origin( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> LocationOriginResponse: - """Get the top origin locations of and by Layer 7 attacks. + """Retrieves the top origin locations of layer 7 attacks. - Values are a percentage - out of the total Layer 7 attacks. The origin location is determined by the - client IP address. + Values are percentages of + the total layer 7 attacks, with the origin location determined by the client IP + address. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -594,38 +594,38 @@ async def target( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> LocationTargetResponse: - """Get the top target locations of and by layer 7 attacks. + """Retrieves the top target locations of and by layer 7 attacks. - Values are a percentage - out of the total layer 7 attacks. The target location is determined by the - attacked zone's billing country, when available. + Values are a + percentage out of the total layer 7 attacks. The target location is determined + by the attacked zone's billing country, when available. Args: - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/attacks/layer7/top/top.py b/src/cloudflare/resources/radar/attacks/layer7/top/top.py index fde5eefb380..2db47e91bcb 100644 --- a/src/cloudflare/resources/radar/attacks/layer7/top/top.py +++ b/src/cloudflare/resources/radar/attacks/layer7/top/top.py @@ -157,58 +157,58 @@ def attacks( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopAttacksResponse: - """Get the top attacks from origin to target location. + """Retrieves the top attacks from origin to target location. - Values are a percentage out - of the total Layer 7 attacks (with billing country). The attack magnitude can be + Values are percentages + of the total layer 7 attacks (with billing country). The attack magnitude can be defined by the number of mitigated requests or by the number of zones affected. You can optionally limit the number of attacks by origin/target location (useful if all the top attacks are from or to the same location). Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. limit_direction: Array of attack origin/target location attack limits. Together with `limitPerLocation`, limits how many objects will be fetched per origin/target location. - limit_per_location: Limit the number of attacks per origin/target (refer to `limitDirection` + limit_per_location: Limits the number of attacks per origin/target (refer to `limitDirection` parameter) location. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. magnitude: Attack magnitude can be defined by total requests mitigated or by total zones attacked. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). @@ -334,42 +334,42 @@ def industry( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopIndustryResponse: """ - Get the industries targeted by attacks. + Retrieves the industries targeted by layer 7 attacks. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -488,42 +488,42 @@ def vertical( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopVerticalResponse: """ - Get the verticals targeted by attacks. + Retrieves the verticals targeted by layer 7 attacks. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -674,58 +674,58 @@ async def attacks( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopAttacksResponse: - """Get the top attacks from origin to target location. + """Retrieves the top attacks from origin to target location. - Values are a percentage out - of the total Layer 7 attacks (with billing country). The attack magnitude can be + Values are percentages + of the total layer 7 attacks (with billing country). The attack magnitude can be defined by the number of mitigated requests or by the number of zones affected. You can optionally limit the number of attacks by origin/target location (useful if all the top attacks are from or to the same location). Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. limit_direction: Array of attack origin/target location attack limits. Together with `limitPerLocation`, limits how many objects will be fetched per origin/target location. - limit_per_location: Limit the number of attacks per origin/target (refer to `limitDirection` + limit_per_location: Limits the number of attacks per origin/target (refer to `limitDirection` parameter) location. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. magnitude: Attack magnitude can be defined by total requests mitigated or by total zones attacked. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). @@ -851,42 +851,42 @@ async def industry( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopIndustryResponse: """ - Get the industries targeted by attacks. + Retrieves the industries targeted by layer 7 attacks. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -1005,42 +1005,42 @@ async def vertical( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopVerticalResponse: """ - Get the verticals targeted by attacks. + Retrieves the verticals targeted by layer 7 attacks. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_method: Filter for http method. + http_method: Filters results by HTTP method. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. mitigation_product: Array of L7 mitigation products. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/bgp/bgp.py b/src/cloudflare/resources/radar/bgp/bgp.py index f6f22267deb..fbbb25bc31a 100644 --- a/src/cloudflare/resources/radar/bgp/bgp.py +++ b/src/cloudflare/resources/radar/bgp/bgp.py @@ -128,32 +128,31 @@ def timeseries( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> BGPTimeseriesResponse: - """Get BGP updates change over time. + """Retrieves BGP updates over time. - Raw values are returned. When requesting - updates for an autonomous system (AS), only BGP updates of type announcement are - returned. + When requesting updates for an autonomous + system, only BGP updates of type announcement are returned. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. prefix: Array of BGP network prefixes. @@ -253,32 +252,31 @@ async def timeseries( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> BGPTimeseriesResponse: - """Get BGP updates change over time. + """Retrieves BGP updates over time. - Raw values are returned. When requesting - updates for an autonomous system (AS), only BGP updates of type announcement are - returned. + When requesting updates for an autonomous + system, only BGP updates of type announcement are returned. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. prefix: Array of BGP network prefixes. diff --git a/src/cloudflare/resources/radar/bgp/hijacks/events.py b/src/cloudflare/resources/radar/bgp/hijacks/events.py index 4d64f84b609..083e3e10c5f 100644 --- a/src/cloudflare/resources/radar/bgp/hijacks/events.py +++ b/src/cloudflare/resources/radar/bgp/hijacks/events.py @@ -72,9 +72,8 @@ def list( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncV4PagePagination[EventListResponse]: - """Get the BGP hijack events. - - (Beta) + """ + Retrieves the BGP hijack events. Args: date_end: End of the date range (inclusive). @@ -84,31 +83,31 @@ def list( date_start: Start of the date range (inclusive). - event_id: The unique identifier of a event + event_id: The unique identifier of a event. - format: Format results are returned in. + format: Format in which results will be returned. - hijacker_asn: The potential hijacker AS of a BGP hijack event + hijacker_asn: The potential hijacker AS of a BGP hijack event. - involved_asn: The potential hijacker or victim AS of a BGP hijack event + involved_asn: The potential hijacker or victim AS of a BGP hijack event. - involved_country: The country code of the potential hijacker or victim AS of a BGP hijack event + involved_country: The country code of the potential hijacker or victim AS of a BGP hijack event. - max_confidence: The maximum confidence score to filter events (1-4 low, 5-7 mid, 8+ high) + max_confidence: The maximum confidence score to filter events (1-4 low, 5-7 mid, 8+ high). - min_confidence: The minimum confidence score to filter events (1-4 low, 5-7 mid, 8+ high) + min_confidence: The minimum confidence score to filter events (1-4 low, 5-7 mid, 8+ high). - page: Current page number, starting from 1 + page: Current page number, starting from 1. - per_page: Number of entries per page + per_page: Number of entries per page. prefix: Network prefix, IPv4 or IPv6. - sort_by: Sort events by field + sort_by: Sorts results by the specified field. - sort_order: Sort order + sort_order: Sort order. - victim_asn: The potential victim AS of a BGP hijack event + victim_asn: The potential victim AS of a BGP hijack event. extra_headers: Send extra headers @@ -198,9 +197,8 @@ def list( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[EventListResponse, AsyncV4PagePagination[EventListResponse]]: - """Get the BGP hijack events. - - (Beta) + """ + Retrieves the BGP hijack events. Args: date_end: End of the date range (inclusive). @@ -210,31 +208,31 @@ def list( date_start: Start of the date range (inclusive). - event_id: The unique identifier of a event + event_id: The unique identifier of a event. - format: Format results are returned in. + format: Format in which results will be returned. - hijacker_asn: The potential hijacker AS of a BGP hijack event + hijacker_asn: The potential hijacker AS of a BGP hijack event. - involved_asn: The potential hijacker or victim AS of a BGP hijack event + involved_asn: The potential hijacker or victim AS of a BGP hijack event. - involved_country: The country code of the potential hijacker or victim AS of a BGP hijack event + involved_country: The country code of the potential hijacker or victim AS of a BGP hijack event. - max_confidence: The maximum confidence score to filter events (1-4 low, 5-7 mid, 8+ high) + max_confidence: The maximum confidence score to filter events (1-4 low, 5-7 mid, 8+ high). - min_confidence: The minimum confidence score to filter events (1-4 low, 5-7 mid, 8+ high) + min_confidence: The minimum confidence score to filter events (1-4 low, 5-7 mid, 8+ high). - page: Current page number, starting from 1 + page: Current page number, starting from 1. - per_page: Number of entries per page + per_page: Number of entries per page. prefix: Network prefix, IPv4 or IPv6. - sort_by: Sort events by field + sort_by: Sorts results by the specified field. - sort_order: Sort order + sort_order: Sort order. - victim_asn: The potential victim AS of a BGP hijack event + victim_asn: The potential victim AS of a BGP hijack event. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/bgp/ips.py b/src/cloudflare/resources/radar/bgp/ips.py index 81834c20455..0cc8214169f 100644 --- a/src/cloudflare/resources/radar/bgp/ips.py +++ b/src/cloudflare/resources/radar/bgp/ips.py @@ -69,31 +69,31 @@ def timeseries( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> IPTimeseriesResponse: """ - Get time series data for the announced IP space count, represented as the number - of IPv4 /24s and IPv6 /48s, for a given ASN. + Retrieves time series data for the announced IP space count, represented as the + number of IPv4 /24s and IPv6 /48s, for a given ASN. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - include_delay: Include data delay meta information + include_delay: Include data delay meta information. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of locations (alpha-2 country codes). + location: Comma-separated list of locations (alpha-2 codes). - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -170,31 +170,31 @@ async def timeseries( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> IPTimeseriesResponse: """ - Get time series data for the announced IP space count, represented as the number - of IPv4 /24s and IPv6 /48s, for a given ASN. + Retrieves time series data for the announced IP space count, represented as the + number of IPv4 /24s and IPv6 /48s, for a given ASN. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - include_delay: Include data delay meta information + include_delay: Include data delay meta information. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of locations (alpha-2 country codes). + location: Comma-separated list of locations (alpha-2 codes). - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/bgp/leaks/events.py b/src/cloudflare/resources/radar/bgp/leaks/events.py index 0803b94e860..18eb2258be0 100644 --- a/src/cloudflare/resources/radar/bgp/leaks/events.py +++ b/src/cloudflare/resources/radar/bgp/leaks/events.py @@ -69,7 +69,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncV4PagePagination[EventListResponse]: """ - Get the BGP route leak events (Beta). + Retrieves the BGP route leak events. Args: date_end: End of the date range (inclusive). @@ -79,23 +79,23 @@ def list( date_start: Start of the date range (inclusive). - event_id: The unique identifier of a event + event_id: The unique identifier of a event. - format: Format results are returned in. + format: Format in which results will be returned. - involved_asn: ASN that is causing or affected by a route leak event + involved_asn: ASN that is causing or affected by a route leak event. - involved_country: Country code of a involved ASN in a route leak event + involved_country: Country code of a involved ASN in a route leak event. - leak_asn: The leaking AS of a route leak event + leak_asn: The leaking AS of a route leak event. - page: Current page number, starting from 1 + page: Current page number, starting from 1. - per_page: Number of entries per page + per_page: Number of entries per page. - sort_by: Sort events by field + sort_by: Sorts results by the specified field. - sort_order: Sort order + sort_order: Sort order. extra_headers: Send extra headers @@ -178,7 +178,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[EventListResponse, AsyncV4PagePagination[EventListResponse]]: """ - Get the BGP route leak events (Beta). + Retrieves the BGP route leak events. Args: date_end: End of the date range (inclusive). @@ -188,23 +188,23 @@ def list( date_start: Start of the date range (inclusive). - event_id: The unique identifier of a event + event_id: The unique identifier of a event. - format: Format results are returned in. + format: Format in which results will be returned. - involved_asn: ASN that is causing or affected by a route leak event + involved_asn: ASN that is causing or affected by a route leak event. - involved_country: Country code of a involved ASN in a route leak event + involved_country: Country code of a involved ASN in a route leak event. - leak_asn: The leaking AS of a route leak event + leak_asn: The leaking AS of a route leak event. - page: Current page number, starting from 1 + page: Current page number, starting from 1. - per_page: Number of entries per page + per_page: Number of entries per page. - sort_by: Sort events by field + sort_by: Sorts results by the specified field. - sort_order: Sort order + sort_order: Sort order. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/bgp/routes.py b/src/cloudflare/resources/radar/bgp/routes.py index 479efb55eb2..7af5788eabc 100644 --- a/src/cloudflare/resources/radar/bgp/routes.py +++ b/src/cloudflare/resources/radar/bgp/routes.py @@ -59,7 +59,7 @@ def ases( location: str | NotGiven = NOT_GIVEN, sort_by: Literal["cone", "pfxs", "ipv4", "ipv6", "rpki_valid", "rpki_invalid", "rpki_unknown"] | NotGiven = NOT_GIVEN, - sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, + sort_order: Literal["ASC", "DESC"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -68,18 +68,18 @@ def ases( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RouteAsesResponse: """ - List all ASes in current global routing tables with routing statistics + Retrieves all ASes in the current global routing tables with routing statistics. Args: - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Location Alpha2 code. + location: Location alpha-2 code. - sort_by: Return order results by given type + sort_by: Sorts results by the specified field. - sort_order: Sort by value ascending or descending + sort_order: Sort order. extra_headers: Send extra headers @@ -126,14 +126,14 @@ def moas( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RouteMoasResponse: """ - List all Multi-Origin AS (MOAS) prefixes on the global routing tables. + Retrieves all Multi-Origin AS (MOAS) prefixes in the global routing tables. Args: - format: Format results are returned in. + format: Format in which results will be returned. - invalid_only: Lookup only RPKI invalid MOASes + invalid_only: Lookup only RPKI invalid MOASes. - origin: Lookup MOASes originated by the given ASN + origin: Lookup MOASes originated by the given ASN. prefix: Network prefix, IPv4 or IPv6. @@ -182,19 +182,19 @@ def pfx2as( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RoutePfx2asResponse: """ - Lookup prefix-to-ASN mapping on global routing tables. + Retrieves the prefix-to-ASN mapping from global routing tables. Args: - format: Format results are returned in. + format: Format in which results will be returned. longest_prefix_match: Return only results with the longest prefix match for the given prefix. For example, specify a /32 prefix to lookup the origin ASN for an IPv4 address. - origin: Lookup prefixes originated by the given ASN + origin: Lookup prefixes originated by the given ASN. prefix: Network prefix, IPv4 or IPv6. - rpki_status: Return only results with matching rpki status: valid, invalid or unknown + rpki_status: Return only results with matching rpki status: valid, invalid or unknown. extra_headers: Send extra headers @@ -240,14 +240,14 @@ def stats( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RouteStatsResponse: """ - Get the BGP routing table stats (Beta). + Retrieves the BGP routing table stats. Args: - asn: Single ASN as integer. + asn: Single Autonomous System Number (ASN) as integer. - format: Format results are returned in. + format: Format in which results will be returned. - location: Location Alpha2 code. + location: Location alpha-2 code. extra_headers: Send extra headers @@ -306,7 +306,7 @@ async def ases( location: str | NotGiven = NOT_GIVEN, sort_by: Literal["cone", "pfxs", "ipv4", "ipv6", "rpki_valid", "rpki_invalid", "rpki_unknown"] | NotGiven = NOT_GIVEN, - sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, + sort_order: Literal["ASC", "DESC"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -315,18 +315,18 @@ async def ases( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RouteAsesResponse: """ - List all ASes in current global routing tables with routing statistics + Retrieves all ASes in the current global routing tables with routing statistics. Args: - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Location Alpha2 code. + location: Location alpha-2 code. - sort_by: Return order results by given type + sort_by: Sorts results by the specified field. - sort_order: Sort by value ascending or descending + sort_order: Sort order. extra_headers: Send extra headers @@ -373,14 +373,14 @@ async def moas( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RouteMoasResponse: """ - List all Multi-Origin AS (MOAS) prefixes on the global routing tables. + Retrieves all Multi-Origin AS (MOAS) prefixes in the global routing tables. Args: - format: Format results are returned in. + format: Format in which results will be returned. - invalid_only: Lookup only RPKI invalid MOASes + invalid_only: Lookup only RPKI invalid MOASes. - origin: Lookup MOASes originated by the given ASN + origin: Lookup MOASes originated by the given ASN. prefix: Network prefix, IPv4 or IPv6. @@ -429,19 +429,19 @@ async def pfx2as( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RoutePfx2asResponse: """ - Lookup prefix-to-ASN mapping on global routing tables. + Retrieves the prefix-to-ASN mapping from global routing tables. Args: - format: Format results are returned in. + format: Format in which results will be returned. longest_prefix_match: Return only results with the longest prefix match for the given prefix. For example, specify a /32 prefix to lookup the origin ASN for an IPv4 address. - origin: Lookup prefixes originated by the given ASN + origin: Lookup prefixes originated by the given ASN. prefix: Network prefix, IPv4 or IPv6. - rpki_status: Return only results with matching rpki status: valid, invalid or unknown + rpki_status: Return only results with matching rpki status: valid, invalid or unknown. extra_headers: Send extra headers @@ -487,14 +487,14 @@ async def stats( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RouteStatsResponse: """ - Get the BGP routing table stats (Beta). + Retrieves the BGP routing table stats. Args: - asn: Single ASN as integer. + asn: Single Autonomous System Number (ASN) as integer. - format: Format results are returned in. + format: Format in which results will be returned. - location: Location Alpha2 code. + location: Location alpha-2 code. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/bgp/top/ases.py b/src/cloudflare/resources/radar/bgp/top/ases.py index d727ffafcfb..bb7bd633d22 100644 --- a/src/cloudflare/resources/radar/bgp/top/ases.py +++ b/src/cloudflare/resources/radar/bgp/top/ases.py @@ -70,27 +70,26 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AseGetResponse: """ - Get the top autonomous systems (ASes) by BGP updates (announcements only). - Values are a percentage out of the total updates. + Retrieves the top autonomous systems by BGP updates (announcements only). Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. prefix: Array of BGP network prefixes. @@ -144,16 +143,16 @@ def prefixes( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsePrefixesResponse: """ - Get the full list of autonomous systems on the global routing table ordered by - announced prefixes count. The data comes from public BGP MRT data archives and - updates every 2 hours. + Retrieves the full list of autonomous systems on the global routing table + ordered by announced prefixes count. The data comes from public BGP MRT data + archives and updates every 2 hours. Args: country: Alpha-2 country code. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Maximum number of ASes to return + limit: Maximum number of ASes to return. extra_headers: Send extra headers @@ -224,27 +223,26 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AseGetResponse: """ - Get the top autonomous systems (ASes) by BGP updates (announcements only). - Values are a percentage out of the total updates. + Retrieves the top autonomous systems by BGP updates (announcements only). Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. prefix: Array of BGP network prefixes. @@ -298,16 +296,16 @@ async def prefixes( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsePrefixesResponse: """ - Get the full list of autonomous systems on the global routing table ordered by - announced prefixes count. The data comes from public BGP MRT data archives and - updates every 2 hours. + Retrieves the full list of autonomous systems on the global routing table + ordered by announced prefixes count. The data comes from public BGP MRT data + archives and updates every 2 hours. Args: country: Alpha-2 country code. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Maximum number of ASes to return + limit: Maximum number of ASes to return. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/bgp/top/top.py b/src/cloudflare/resources/radar/bgp/top/top.py index b7b5e4b2da6..4efd8dfcb92 100644 --- a/src/cloudflare/resources/radar/bgp/top/top.py +++ b/src/cloudflare/resources/radar/bgp/top/top.py @@ -79,29 +79,27 @@ def prefixes( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopPrefixesResponse: - """Get the top network prefixes by BGP updates. - - Values are a percentage out of the - total BGP updates. + """ + Retrieves the top network prefixes by BGP updates. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. update_type: Array of BGP update types. @@ -181,29 +179,27 @@ async def prefixes( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopPrefixesResponse: - """Get the top network prefixes by BGP updates. - - Values are a percentage out of the - total BGP updates. + """ + Retrieves the top network prefixes by BGP updates. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. update_type: Array of BGP update types. diff --git a/src/cloudflare/resources/radar/datasets.py b/src/cloudflare/resources/radar/datasets.py index 21c040a20a7..29c64c23f58 100644 --- a/src/cloudflare/resources/radar/datasets.py +++ b/src/cloudflare/resources/radar/datasets.py @@ -64,16 +64,16 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> DatasetListResponse: """ - Get a list of datasets. + Retrieves a list of datasets. Args: - dataset_type: Dataset type. + dataset_type: Filters results by dataset type. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - offset: Number of objects to skip before grabbing results. + offset: Skips the specified number of objects before fetching the results. extra_headers: Send extra headers @@ -117,10 +117,10 @@ def download( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> DatasetDownloadResponse: """ - Get a URL to download a single dataset. + Retrieves an URL to download a single dataset. Args: - format: Format results are returned in. + format: Format in which results will be returned. extra_headers: Send extra headers @@ -155,14 +155,14 @@ def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> str: - """Get the CSV content of a given dataset by alias or ID. + """Retrieves the CSV content of a given dataset by alias or ID. - When getting the content - by alias the latest dataset is returned, optionally filtered by the latest - available at a given date. + When getting the + content by alias the latest dataset is returned, optionally filtered by the + latest available at a given date. Args: - alias: Dataset alias or id + alias: Dataset alias or ID. extra_headers: Send extra headers @@ -219,16 +219,16 @@ async def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> DatasetListResponse: """ - Get a list of datasets. + Retrieves a list of datasets. Args: - dataset_type: Dataset type. + dataset_type: Filters results by dataset type. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - offset: Number of objects to skip before grabbing results. + offset: Skips the specified number of objects before fetching the results. extra_headers: Send extra headers @@ -272,10 +272,10 @@ async def download( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> DatasetDownloadResponse: """ - Get a URL to download a single dataset. + Retrieves an URL to download a single dataset. Args: - format: Format results are returned in. + format: Format in which results will be returned. extra_headers: Send extra headers @@ -310,14 +310,14 @@ async def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> str: - """Get the CSV content of a given dataset by alias or ID. + """Retrieves the CSV content of a given dataset by alias or ID. - When getting the content - by alias the latest dataset is returned, optionally filtered by the latest - available at a given date. + When getting the + content by alias the latest dataset is returned, optionally filtered by the + latest available at a given date. Args: - alias: Dataset alias or id + alias: Dataset alias or ID. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/dns/top.py b/src/cloudflare/resources/radar/dns/top.py index fb7a902c77e..03e74c0c2fa 100644 --- a/src/cloudflare/resources/radar/dns/top.py +++ b/src/cloudflare/resources/radar/dns/top.py @@ -71,37 +71,37 @@ def ases( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopAsesResponse: """ - Get top autonomous systems by DNS queries made to Cloudflare's public DNS + Retrieves the top autonomous systems by DNS queries made to 1.1.1.1 DNS resolver. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. domain: Array of domain names. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -159,36 +159,36 @@ def locations( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopLocationsResponse: """ - Get top locations by DNS queries made to Cloudflare's public DNS resolver. + Retrieves the top locations by DNS queries made to 1.1.1.1 DNS resolver. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. domain: Array of domain names. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -267,37 +267,37 @@ async def ases( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopAsesResponse: """ - Get top autonomous systems by DNS queries made to Cloudflare's public DNS + Retrieves the top autonomous systems by DNS queries made to 1.1.1.1 DNS resolver. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. domain: Array of domain names. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -355,36 +355,36 @@ async def locations( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopLocationsResponse: """ - Get top locations by DNS queries made to Cloudflare's public DNS resolver. + Retrieves the top locations by DNS queries made to 1.1.1.1 DNS resolver. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. domain: Array of domain names. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/email/routing/summary.py b/src/cloudflare/resources/radar/email/routing/summary.py index a049898dce4..194e9a849bf 100644 --- a/src/cloudflare/resources/radar/email/routing/summary.py +++ b/src/cloudflare/resources/radar/email/routing/summary.py @@ -82,30 +82,32 @@ def arc( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryARCResponse: """ - Percentage distribution of emails classified by ARC validation. + Retrieves the distribution of emails by ARC (Authenticated Received Chain) + validation. Args: date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - encrypted: Filter for encrypted emails. + encrypted: Filters results by encryption status (encrypted vs. not-encrypted). - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. extra_headers: Send extra headers @@ -163,30 +165,32 @@ def dkim( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryDKIMResponse: """ - Percentage distribution of emails classified by DKIM validation. + Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) + validation. Args: - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - encrypted: Filter for encrypted emails. + encrypted: Filters results by encryption status (encrypted vs. not-encrypted). - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. extra_headers: Send extra headers @@ -244,30 +248,31 @@ def dmarc( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryDMARCResponse: """ - Percentage distribution of emails classified by DMARC validation. + Retrieves the distribution of emails by DMARC (Domain-based Message + Authentication, Reporting and Conformance) validation. Args: - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - encrypted: Filter for encrypted emails. + encrypted: Filters results by encryption status (encrypted vs. not-encrypted). - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. extra_headers: Send extra headers @@ -325,30 +330,32 @@ def encrypted( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryEncryptedResponse: """ - Percentage distribution of emails by encryption status. + Retrieves the distribution of emails by encryption status (encrypted vs. + not-encrypted). Args: - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. extra_headers: Send extra headers @@ -406,30 +413,31 @@ def ip_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryIPVersionResponse: """ - Percentage distribution of emails by IP version. + Retrieves the distribution of emails by IP version. Args: - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - encrypted: Filter for encrypted emails. + encrypted: Filters results by encryption status (encrypted vs. not-encrypted). - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. extra_headers: Send extra headers @@ -487,30 +495,32 @@ def spf( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummarySPFResponse: """ - Percentage distribution of emails classified by SPF validation. + Retrieves the distribution of emails by SPF (Sender Policy Framework) + validation. Args: - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - encrypted: Filter for encrypted emails. + encrypted: Filters results by encryption status (encrypted vs. not-encrypted). - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -589,30 +599,32 @@ async def arc( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryARCResponse: """ - Percentage distribution of emails classified by ARC validation. + Retrieves the distribution of emails by ARC (Authenticated Received Chain) + validation. Args: date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - encrypted: Filter for encrypted emails. + encrypted: Filters results by encryption status (encrypted vs. not-encrypted). - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. extra_headers: Send extra headers @@ -670,30 +682,32 @@ async def dkim( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryDKIMResponse: """ - Percentage distribution of emails classified by DKIM validation. + Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) + validation. Args: - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - encrypted: Filter for encrypted emails. + encrypted: Filters results by encryption status (encrypted vs. not-encrypted). - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. extra_headers: Send extra headers @@ -751,30 +765,31 @@ async def dmarc( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryDMARCResponse: """ - Percentage distribution of emails classified by DMARC validation. + Retrieves the distribution of emails by DMARC (Domain-based Message + Authentication, Reporting and Conformance) validation. Args: - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - encrypted: Filter for encrypted emails. + encrypted: Filters results by encryption status (encrypted vs. not-encrypted). - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. extra_headers: Send extra headers @@ -832,30 +847,32 @@ async def encrypted( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryEncryptedResponse: """ - Percentage distribution of emails by encryption status. + Retrieves the distribution of emails by encryption status (encrypted vs. + not-encrypted). Args: - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. extra_headers: Send extra headers @@ -913,30 +930,31 @@ async def ip_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryIPVersionResponse: """ - Percentage distribution of emails by IP version. + Retrieves the distribution of emails by IP version. Args: - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - encrypted: Filter for encrypted emails. + encrypted: Filters results by encryption status (encrypted vs. not-encrypted). - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. extra_headers: Send extra headers @@ -994,30 +1012,32 @@ async def spf( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummarySPFResponse: """ - Percentage distribution of emails classified by SPF validation. + Retrieves the distribution of emails by SPF (Sender Policy Framework) + validation. Args: - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - encrypted: Filter for encrypted emails. + encrypted: Filters results by encryption status (encrypted vs. not-encrypted). - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/email/routing/timeseries_groups.py b/src/cloudflare/resources/radar/email/routing/timeseries_groups.py index 61c4de5e245..6e278e336c6 100644 --- a/src/cloudflare/resources/radar/email/routing/timeseries_groups.py +++ b/src/cloudflare/resources/radar/email/routing/timeseries_groups.py @@ -83,7 +83,8 @@ def arc( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupARCResponse: """ - Percentage distribution of emails classified by ARC validation over time. + Retrieves the distribution of emails by ARC (Authenticated Received Chain) + validation over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes @@ -92,25 +93,26 @@ def arc( date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - encrypted: Filter for encrypted emails. + encrypted: Filters results by encryption status (encrypted vs. not-encrypted). - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. extra_headers: Send extra headers @@ -170,34 +172,36 @@ def dkim( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupDKIMResponse: """ - Percentage distribution of emails classified by DKIM validation over time. + Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) + validation over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - encrypted: Filter for encrypted emails. + encrypted: Filters results by encryption status (encrypted vs. not-encrypted). - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. extra_headers: Send extra headers @@ -257,34 +261,35 @@ def dmarc( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupDMARCResponse: """ - Percentage distribution of emails classified by DMARC validation over time. + Retrieves the distribution of emails by DMARC (Domain-based Message + Authentication, Reporting and Conformance) validation over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - encrypted: Filter for encrypted emails. + encrypted: Filters results by encryption status (encrypted vs. not-encrypted). - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. extra_headers: Send extra headers @@ -344,34 +349,36 @@ def encrypted( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupEncryptedResponse: """ - Percentage distribution of emails by encryption status over time. + Retrieves the distribution of emails by encryption status (encrypted vs. + not-encrypted) over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. extra_headers: Send extra headers @@ -431,34 +438,35 @@ def ip_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupIPVersionResponse: """ - Percentage distribution of emails by IP version over time. + Retrieves the distribution of emails by IP version over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - encrypted: Filter for encrypted emails. + encrypted: Filters results by encryption status (encrypted vs. not-encrypted). - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. extra_headers: Send extra headers @@ -518,34 +526,36 @@ def spf( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupSPFResponse: """ - Percentage distribution of emails classified by SPF validation over time. + Retrieves the distribution of emails by SPF (Sender Policy Framework) validation + over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - encrypted: Filter for encrypted emails. + encrypted: Filters results by encryption status (encrypted vs. not-encrypted). - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -626,7 +636,8 @@ async def arc( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupARCResponse: """ - Percentage distribution of emails classified by ARC validation over time. + Retrieves the distribution of emails by ARC (Authenticated Received Chain) + validation over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes @@ -635,25 +646,26 @@ async def arc( date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - encrypted: Filter for encrypted emails. + encrypted: Filters results by encryption status (encrypted vs. not-encrypted). - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. extra_headers: Send extra headers @@ -713,34 +725,36 @@ async def dkim( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupDKIMResponse: """ - Percentage distribution of emails classified by DKIM validation over time. + Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) + validation over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - encrypted: Filter for encrypted emails. + encrypted: Filters results by encryption status (encrypted vs. not-encrypted). - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. extra_headers: Send extra headers @@ -800,34 +814,35 @@ async def dmarc( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupDMARCResponse: """ - Percentage distribution of emails classified by DMARC validation over time. + Retrieves the distribution of emails by DMARC (Domain-based Message + Authentication, Reporting and Conformance) validation over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - encrypted: Filter for encrypted emails. + encrypted: Filters results by encryption status (encrypted vs. not-encrypted). - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. extra_headers: Send extra headers @@ -887,34 +902,36 @@ async def encrypted( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupEncryptedResponse: """ - Percentage distribution of emails by encryption status over time. + Retrieves the distribution of emails by encryption status (encrypted vs. + not-encrypted) over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. extra_headers: Send extra headers @@ -974,34 +991,35 @@ async def ip_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupIPVersionResponse: """ - Percentage distribution of emails by IP version over time. + Retrieves the distribution of emails by IP version over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - encrypted: Filter for encrypted emails. + encrypted: Filters results by encryption status (encrypted vs. not-encrypted). - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. extra_headers: Send extra headers @@ -1061,34 +1079,36 @@ async def spf( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupSPFResponse: """ - Percentage distribution of emails classified by SPF validation over time. + Retrieves the distribution of emails by SPF (Sender Policy Framework) validation + over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - encrypted: Filter for encrypted emails. + encrypted: Filters results by encryption status (encrypted vs. not-encrypted). - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/email/security/summary.py b/src/cloudflare/resources/radar/email/security/summary.py index c2df082e757..a042307c97f 100644 --- a/src/cloudflare/resources/radar/email/security/summary.py +++ b/src/cloudflare/resources/radar/email/security/summary.py @@ -87,28 +87,30 @@ def arc( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryARCResponse: """ - Percentage distribution of emails classified by ARC validation. + Retrieves the distribution of emails by ARC (Authenticated Received Chain) + validation. Args: date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -164,28 +166,30 @@ def dkim( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryDKIMResponse: """ - Percentage distribution of emails classified by DKIM validation. + Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) + validation. Args: - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -241,28 +245,29 @@ def dmarc( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryDMARCResponse: """ - Percentage distribution of emails classified by DMARC validation. + Retrieves the distribution of emails by DMARC (Domain-based Message + Authentication, Reporting and Conformance) validation. Args: - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -319,30 +324,31 @@ def malicious( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryMaliciousResponse: """ - Percentage distribution of emails classified as MALICIOUS. + Retrieves the distribution of emails by malicious classification. Args: - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -399,31 +405,33 @@ def spam( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummarySpamResponse: - """ - Proportion of emails categorized as either spam or legitimate (non-spam). + """Retrieves the proportion of emails by spam classification (spam vs. + + non-spam). Args: - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -480,28 +488,30 @@ def spf( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummarySPFResponse: """ - Percentage distribution of emails classified by SPF validation. + Retrieves the distribution of emails by SPF (Sender Policy Framework) + validation. Args: - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -558,30 +568,32 @@ def spoof( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummarySpoofResponse: """ - Proportion of emails categorized as either spoof or legitimate (non-spoof). + Retrieves the proportion of emails by spoof classification (spoof vs. + non-spoof). Args: - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -639,30 +651,31 @@ def threat_category( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryThreatCategoryResponse: """ - Percentage distribution of emails classified in Threat Categories. + Retrieves the distribution of emails by threat categories. Args: - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -719,28 +732,29 @@ def tls_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryTLSVersionResponse: """ - Percentage distribution of emails classified by TLS version. + Retrieves the distribution of emails by TLS version. Args: - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. extra_headers: Send extra headers @@ -817,28 +831,30 @@ async def arc( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryARCResponse: """ - Percentage distribution of emails classified by ARC validation. + Retrieves the distribution of emails by ARC (Authenticated Received Chain) + validation. Args: date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -894,28 +910,30 @@ async def dkim( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryDKIMResponse: """ - Percentage distribution of emails classified by DKIM validation. + Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) + validation. Args: - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -971,28 +989,29 @@ async def dmarc( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryDMARCResponse: """ - Percentage distribution of emails classified by DMARC validation. + Retrieves the distribution of emails by DMARC (Domain-based Message + Authentication, Reporting and Conformance) validation. Args: - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -1049,30 +1068,31 @@ async def malicious( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryMaliciousResponse: """ - Percentage distribution of emails classified as MALICIOUS. + Retrieves the distribution of emails by malicious classification. Args: - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -1129,31 +1149,33 @@ async def spam( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummarySpamResponse: - """ - Proportion of emails categorized as either spam or legitimate (non-spam). + """Retrieves the proportion of emails by spam classification (spam vs. + + non-spam). Args: - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -1210,28 +1232,30 @@ async def spf( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummarySPFResponse: """ - Percentage distribution of emails classified by SPF validation. + Retrieves the distribution of emails by SPF (Sender Policy Framework) + validation. Args: - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -1288,30 +1312,32 @@ async def spoof( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummarySpoofResponse: """ - Proportion of emails categorized as either spoof or legitimate (non-spoof). + Retrieves the proportion of emails by spoof classification (spoof vs. + non-spoof). Args: - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -1369,30 +1395,31 @@ async def threat_category( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryThreatCategoryResponse: """ - Percentage distribution of emails classified in Threat Categories. + Retrieves the distribution of emails by threat categories. Args: - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -1449,28 +1476,29 @@ async def tls_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryTLSVersionResponse: """ - Percentage distribution of emails classified by TLS version. + Retrieves the distribution of emails by TLS version. Args: - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/email/security/timeseries_groups.py b/src/cloudflare/resources/radar/email/security/timeseries_groups.py index 9d1ee856d46..547044bbeee 100644 --- a/src/cloudflare/resources/radar/email/security/timeseries_groups.py +++ b/src/cloudflare/resources/radar/email/security/timeseries_groups.py @@ -90,7 +90,8 @@ def arc( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupARCResponse: """ - Percentage distribution of emails classified by ARC validation over time. + Retrieves the distribution of emails by ARC (Authenticated Received Chain) + validation over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes @@ -99,23 +100,24 @@ def arc( date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -173,32 +175,34 @@ def dkim( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupDKIMResponse: """ - Percentage distribution of emails classified by DKIM validation over time. + Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) + validation over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -256,32 +260,33 @@ def dmarc( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupDMARCResponse: """ - Percentage distribution of emails classified by DMARC validation over time. + Retrieves the distribution of emails by DMARC (Domain-based Message + Authentication, Reporting and Conformance) validation over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -340,34 +345,35 @@ def malicious( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupMaliciousResponse: """ - Percentage distribution of emails classified as MALICIOUS over time. + Retrieves the distribution of emails by malicious classification over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -426,35 +432,38 @@ def spam( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupSpamResponse: - """ - Percentage distribution of emails classified as SPAM over time. + """Retrieves the distribution of emails by spam classification (spam vs. + + non-spam) + over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -513,32 +522,34 @@ def spf( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupSPFResponse: """ - Percentage distribution of emails classified by SPF validation over time. + Retrieves the distribution of emails by SPF (Sender Policy Framework) validation + over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -597,34 +608,36 @@ def spoof( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupSpoofResponse: """ - Percentage distribution of emails classified as SPOOF over time. + Retrieves the distribution of emails by spoof classification (spoof vs. + non-spoof) over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -684,34 +697,35 @@ def threat_category( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupThreatCategoryResponse: """ - Percentage distribution of emails classified by threat category over time. + Retrieves the distribution of emails by threat category over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -772,32 +786,33 @@ def tls_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupTLSVersionResponse: """ - Percentage distribution of emails classified by TLS version over time. + Retrieves the distribution of emails by TLS version over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. extra_headers: Send extra headers @@ -876,7 +891,8 @@ async def arc( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupARCResponse: """ - Percentage distribution of emails classified by ARC validation over time. + Retrieves the distribution of emails by ARC (Authenticated Received Chain) + validation over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes @@ -885,23 +901,24 @@ async def arc( date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -959,32 +976,34 @@ async def dkim( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupDKIMResponse: """ - Percentage distribution of emails classified by DKIM validation over time. + Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) + validation over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -1042,32 +1061,33 @@ async def dmarc( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupDMARCResponse: """ - Percentage distribution of emails classified by DMARC validation over time. + Retrieves the distribution of emails by DMARC (Domain-based Message + Authentication, Reporting and Conformance) validation over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -1126,34 +1146,35 @@ async def malicious( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupMaliciousResponse: """ - Percentage distribution of emails classified as MALICIOUS over time. + Retrieves the distribution of emails by malicious classification over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -1212,35 +1233,38 @@ async def spam( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupSpamResponse: - """ - Percentage distribution of emails classified as SPAM over time. + """Retrieves the distribution of emails by spam classification (spam vs. + + non-spam) + over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -1299,32 +1323,34 @@ async def spf( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupSPFResponse: """ - Percentage distribution of emails classified by SPF validation over time. + Retrieves the distribution of emails by SPF (Sender Policy Framework) validation + over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -1383,34 +1409,36 @@ async def spoof( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupSpoofResponse: """ - Percentage distribution of emails classified as SPOOF over time. + Retrieves the distribution of emails by spoof classification (spoof vs. + non-spoof) over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -1470,34 +1498,35 @@ async def threat_category( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupThreatCategoryResponse: """ - Percentage distribution of emails classified by threat category over time. + Retrieves the distribution of emails by threat category over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -1558,32 +1587,33 @@ async def tls_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupTLSVersionResponse: """ - Percentage distribution of emails classified by TLS version over time. + Retrieves the distribution of emails by TLS version over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/email/security/top/tlds/malicious.py b/src/cloudflare/resources/radar/email/security/top/tlds/malicious.py index cd9ed653bd0..21b1e2c86e5 100644 --- a/src/cloudflare/resources/radar/email/security/top/tlds/malicious.py +++ b/src/cloudflare/resources/radar/email/security/top/tlds/malicious.py @@ -73,36 +73,37 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> MaliciousGetResponse: """ - Get the TLDs by emails classified as malicious or not. + Retrieves the top TLDs by emails classified as malicious or not. Args: - malicious: Malicious. + malicious: Malicious classification. - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tld_category: Filter for TLDs by category. + tld_category: Filters results by TLD category. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -188,36 +189,37 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> MaliciousGetResponse: """ - Get the TLDs by emails classified as malicious or not. + Retrieves the top TLDs by emails classified as malicious or not. Args: - malicious: Malicious. + malicious: Malicious classification. - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tld_category: Filter for TLDs by category. + tld_category: Filters results by TLD category. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/email/security/top/tlds/spam.py b/src/cloudflare/resources/radar/email/security/top/tlds/spam.py index 4a1c04f15a0..ca14d4a3af7 100644 --- a/src/cloudflare/resources/radar/email/security/top/tlds/spam.py +++ b/src/cloudflare/resources/radar/email/security/top/tlds/spam.py @@ -73,36 +73,37 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SpamGetResponse: """ - Get the top TLDs by emails classified as spam or not. + Retrieves the top TLDs by emails classified as spam or not. Args: - spam: Spam. + spam: Spam classification. - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tld_category: Filter for TLDs by category. + tld_category: Filters results by TLD category. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -188,36 +189,37 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SpamGetResponse: """ - Get the top TLDs by emails classified as spam or not. + Retrieves the top TLDs by emails classified as spam or not. Args: - spam: Spam. + spam: Spam classification. - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tld_category: Filter for TLDs by category. + tld_category: Filters results by TLD category. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/email/security/top/tlds/spoof.py b/src/cloudflare/resources/radar/email/security/top/tlds/spoof.py index 60c42d0c1a9..2e007ce64ca 100644 --- a/src/cloudflare/resources/radar/email/security/top/tlds/spoof.py +++ b/src/cloudflare/resources/radar/email/security/top/tlds/spoof.py @@ -73,36 +73,37 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SpoofGetResponse: """ - Get the TLDs by emails classified as spoof or not. + Retrieves the top TLDs by emails classified as spoof or not. Args: - spoof: Spoof. + spoof: Spoof classification. - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tld_category: Filter for TLDs by category. + tld_category: Filters results by TLD category. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -188,36 +189,37 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SpoofGetResponse: """ - Get the TLDs by emails classified as spoof or not. + Retrieves the top TLDs by emails classified as spoof or not. Args: - spoof: Spoof. + spoof: Spoof classification. - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tld_category: Filter for TLDs by category. + tld_category: Filters results by TLD category. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/email/security/top/tlds/tlds.py b/src/cloudflare/resources/radar/email/security/top/tlds/tlds.py index d45089f3adc..0b69f5dd811 100644 --- a/src/cloudflare/resources/radar/email/security/top/tlds/tlds.py +++ b/src/cloudflare/resources/radar/email/security/top/tlds/tlds.py @@ -107,37 +107,36 @@ def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TldGetResponse: - """Get the top TLDs by email messages. - - Values are a percentage out of total email - volume. + """ + Retrieves the top TLDs by number of email messages. Args: - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tld_category: Filter for TLDs by category. + tld_category: Filters results by TLD category. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -231,37 +230,36 @@ async def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TldGetResponse: - """Get the top TLDs by email messages. - - Values are a percentage out of total email - volume. + """ + Retrieves the top TLDs by number of email messages. Args: - arc: Filter for arc (Authenticated Received Chain). + arc: Filters results by ARC (Authenticated Received Chain) validation. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - dkim: Filter for dkim. + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. - dmarc: Filter for dmarc. + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - spf: Filter for spf. + spf: Filters results by SPF (Sender Policy Framework) validation status. - tld_category: Filter for TLDs by category. + tld_category: Filters results by TLD category. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/entities/asns.py b/src/cloudflare/resources/radar/entities/asns.py index c8ff8ed8e22..3ff7de2fbf2 100644 --- a/src/cloudflare/resources/radar/entities/asns.py +++ b/src/cloudflare/resources/radar/entities/asns.py @@ -68,20 +68,20 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ASNListResponse: """ - Get a list of autonomous systems (ASes). + Retrieves a list of autonomous systems. Args: - asn: Comma separated list of ASNs. + asn: Comma-separated list of Autonomous System Numbers (ASNs). - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Location Alpha2 to filter results. + location: Location alpha-2 code. - offset: Number of objects to skip before grabbing results. + offset: Skips the specified number of objects before fetching the results. - order_by: Order asn list. + order_by: Metric to order the ASNs by. extra_headers: Send extra headers @@ -126,17 +126,17 @@ def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ASNGetResponse: - """Get the requested autonomous system information. + """Retrieves the requested autonomous system information. - (A confidence level below `5` - indicates a low level of confidence in the traffic data - normally this happens - because Cloudflare has a small amount of traffic from/to this AS). Population - estimates come from APNIC (refer to https://labs.apnic.net/?p=526). + (A confidence level below + `5` indicates a low level of confidence in the traffic data - normally this + happens because Cloudflare has a small amount of traffic from/to this AS). + Population estimates come from APNIC (refer to https://labs.apnic.net/?p=526). Args: - asn: Autonomous System Number (ASN). + asn: Single Autonomous System Number (ASN) as integer. - format: Format results are returned in. + format: Format in which results will be returned. extra_headers: Send extra headers @@ -171,15 +171,14 @@ def ip( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ASNIPResponse: - """Get the requested autonomous system information based on IP address. - - Population - estimates come from APNIC (refer to https://labs.apnic.net/?p=526). + """ + Retrieves the requested autonomous system information based on IP address. + Population estimates come from APNIC (refer to https://labs.apnic.net/?p=526). Args: ip: IP address. - format: Format results are returned in. + format: Format in which results will be returned. extra_headers: Send extra headers @@ -222,14 +221,15 @@ def rel( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ASNRelResponse: """ - Get AS-level relationship for given networks. + Retrieves AS-level relationship for given networks. Args: - asn: Get all ASNs with provider-customer or peering relationships with the given ASN + asn: Retrieves all ASNs with provider-customer or peering relationships with the + given ASN. - asn2: Get the AS relationship of ASN2 with respect to the given ASN + asn2: Retrieves the AS relationship of ASN2 with respect to the given ASN. - format: Format results are returned in. + format: Format in which results will be returned. extra_headers: Send extra headers @@ -296,20 +296,20 @@ async def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ASNListResponse: """ - Get a list of autonomous systems (ASes). + Retrieves a list of autonomous systems. Args: - asn: Comma separated list of ASNs. + asn: Comma-separated list of Autonomous System Numbers (ASNs). - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Location Alpha2 to filter results. + location: Location alpha-2 code. - offset: Number of objects to skip before grabbing results. + offset: Skips the specified number of objects before fetching the results. - order_by: Order asn list. + order_by: Metric to order the ASNs by. extra_headers: Send extra headers @@ -354,17 +354,17 @@ async def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ASNGetResponse: - """Get the requested autonomous system information. + """Retrieves the requested autonomous system information. - (A confidence level below `5` - indicates a low level of confidence in the traffic data - normally this happens - because Cloudflare has a small amount of traffic from/to this AS). Population - estimates come from APNIC (refer to https://labs.apnic.net/?p=526). + (A confidence level below + `5` indicates a low level of confidence in the traffic data - normally this + happens because Cloudflare has a small amount of traffic from/to this AS). + Population estimates come from APNIC (refer to https://labs.apnic.net/?p=526). Args: - asn: Autonomous System Number (ASN). + asn: Single Autonomous System Number (ASN) as integer. - format: Format results are returned in. + format: Format in which results will be returned. extra_headers: Send extra headers @@ -399,15 +399,14 @@ async def ip( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ASNIPResponse: - """Get the requested autonomous system information based on IP address. - - Population - estimates come from APNIC (refer to https://labs.apnic.net/?p=526). + """ + Retrieves the requested autonomous system information based on IP address. + Population estimates come from APNIC (refer to https://labs.apnic.net/?p=526). Args: ip: IP address. - format: Format results are returned in. + format: Format in which results will be returned. extra_headers: Send extra headers @@ -450,14 +449,15 @@ async def rel( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ASNRelResponse: """ - Get AS-level relationship for given networks. + Retrieves AS-level relationship for given networks. Args: - asn: Get all ASNs with provider-customer or peering relationships with the given ASN + asn: Retrieves all ASNs with provider-customer or peering relationships with the + given ASN. - asn2: Get the AS relationship of ASN2 with respect to the given ASN + asn2: Retrieves the AS relationship of ASN2 with respect to the given ASN. - format: Format results are returned in. + format: Format in which results will be returned. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/entities/entities.py b/src/cloudflare/resources/radar/entities/entities.py index 695496eb3af..901d2881104 100644 --- a/src/cloudflare/resources/radar/entities/entities.py +++ b/src/cloudflare/resources/radar/entities/entities.py @@ -85,12 +85,12 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> EntityGetResponse: """ - Get IP address information. + Retrieves IP address information. Args: ip: IP address. - format: Format results are returned in. + format: Format in which results will be returned. extra_headers: Send extra headers @@ -161,12 +161,12 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> EntityGetResponse: """ - Get IP address information. + Retrieves IP address information. Args: ip: IP address. - format: Format results are returned in. + format: Format in which results will be returned. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/entities/locations.py b/src/cloudflare/resources/radar/entities/locations.py index a64b242ac69..ef11561af8e 100644 --- a/src/cloudflare/resources/radar/entities/locations.py +++ b/src/cloudflare/resources/radar/entities/locations.py @@ -64,16 +64,16 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> LocationListResponse: """ - Get a list of locations. + Retrieves a list of locations. Args: - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Comma separated list of locations. + location: Comma-separated list of locations (alpha-2 location codes). - offset: Number of objects to skip before grabbing results. + offset: Skips the specified number of objects before fetching the results. extra_headers: Send extra headers @@ -116,16 +116,16 @@ def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> LocationGetResponse: - """Get the requested location information. + """Retrieves the requested location information. - (A confidence level below `5` indicates - a low level of confidence in the traffic data - normally this happens because - Cloudflare has a small amount of traffic from/to this location). + (A confidence level below `5` + indicates a low level of confidence in the traffic data - normally this happens + because Cloudflare has a small amount of traffic from/to this location). Args: - location: Alpha-2 country code. + location: Location alpha-2 code. - format: Format results are returned in. + format: Format in which results will be returned. extra_headers: Send extra headers @@ -186,16 +186,16 @@ async def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> LocationListResponse: """ - Get a list of locations. + Retrieves a list of locations. Args: - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Comma separated list of locations. + location: Comma-separated list of locations (alpha-2 location codes). - offset: Number of objects to skip before grabbing results. + offset: Skips the specified number of objects before fetching the results. extra_headers: Send extra headers @@ -238,16 +238,16 @@ async def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> LocationGetResponse: - """Get the requested location information. + """Retrieves the requested location information. - (A confidence level below `5` indicates - a low level of confidence in the traffic data - normally this happens because - Cloudflare has a small amount of traffic from/to this location). + (A confidence level below `5` + indicates a low level of confidence in the traffic data - normally this happens + because Cloudflare has a small amount of traffic from/to this location). Args: - location: Alpha-2 country code. + location: Location alpha-2 code. - format: Format results are returned in. + format: Format in which results will be returned. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/http/ases/ases.py b/src/cloudflare/resources/radar/http/ases/ases.py index 73e828d07a7..74f2dbcc9ef 100644 --- a/src/cloudflare/resources/radar/http/ases/ases.py +++ b/src/cloudflare/resources/radar/http/ases/ases.py @@ -173,54 +173,52 @@ def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AseGetResponse: - """Get the top autonomous systems by HTTP traffic. - - Values are a percentage out of - the total traffic. + """ + Retrieves the top autonomous systems by HTTP requests. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -345,54 +343,52 @@ async def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AseGetResponse: - """Get the top autonomous systems by HTTP traffic. - - Values are a percentage out of - the total traffic. + """ + Retrieves the top autonomous systems by HTTP requests. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/http/ases/bot_class.py b/src/cloudflare/resources/radar/http/ases/bot_class.py index 6850fdf96cf..056f9162760 100644 --- a/src/cloudflare/resources/radar/http/ases/bot_class.py +++ b/src/cloudflare/resources/radar/http/ases/bot_class.py @@ -77,55 +77,53 @@ def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> BotClassGetResponse: - """Get the top autonomous systems (AS), by HTTP traffic, of the requested bot + """ + Retrieves the top autonomous systems, by HTTP requests, of the requested bot class. - These two categories use Cloudflare's bot score - refer to - [Bot Scores](https://developers.cloudflare.com/bots/concepts/bot-score) for more - information. Values are a percentage out of the total traffic. - Args: - bot_class: Bot class. + bot_class: Bot class. Refer to + [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -219,55 +217,53 @@ async def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> BotClassGetResponse: - """Get the top autonomous systems (AS), by HTTP traffic, of the requested bot + """ + Retrieves the top autonomous systems, by HTTP requests, of the requested bot class. - These two categories use Cloudflare's bot score - refer to - [Bot Scores](https://developers.cloudflare.com/bots/concepts/bot-score) for more - information. Values are a percentage out of the total traffic. - Args: - bot_class: Bot class. + bot_class: Bot class. Refer to + [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/http/ases/browser_family.py b/src/cloudflare/resources/radar/http/ases/browser_family.py index 8c0d842f074..23918e76f2d 100644 --- a/src/cloudflare/resources/radar/http/ases/browser_family.py +++ b/src/cloudflare/resources/radar/http/ases/browser_family.py @@ -78,52 +78,52 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> BrowserFamilyGetResponse: """ - Get the top autonomous systems (AS), by HTTP traffic, of the requested browser - family. Values are a percentage out of the total traffic. + Retrieves the top autonomous systems, by HTTP requests, of the requested browser + family. Args: browser_family: Browser family. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -218,52 +218,52 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> BrowserFamilyGetResponse: """ - Get the top autonomous systems (AS), by HTTP traffic, of the requested browser - family. Values are a percentage out of the total traffic. + Retrieves the top autonomous systems, by HTTP requests, of the requested browser + family. Args: browser_family: Browser family. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/http/ases/device_type.py b/src/cloudflare/resources/radar/http/ases/device_type.py index 36f269961c0..a2cd8b763cf 100644 --- a/src/cloudflare/resources/radar/http/ases/device_type.py +++ b/src/cloudflare/resources/radar/http/ases/device_type.py @@ -78,52 +78,52 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> DeviceTypeGetResponse: """ - Get the top autonomous systems (AS), by HTTP traffic, of the requested device - type. Values are a percentage out of the total traffic. + Retrieves the top autonomous systems, by HTTP requests, of the requested device + type. Args: device_type: Device type. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -218,52 +218,52 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> DeviceTypeGetResponse: """ - Get the top autonomous systems (AS), by HTTP traffic, of the requested device - type. Values are a percentage out of the total traffic. + Retrieves the top autonomous systems, by HTTP requests, of the requested device + type. Args: device_type: Device type. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/http/ases/http_method.py b/src/cloudflare/resources/radar/http/ases/http_method.py index afae27fb638..524aa0112fd 100644 --- a/src/cloudflare/resources/radar/http/ases/http_method.py +++ b/src/cloudflare/resources/radar/http/ases/http_method.py @@ -78,52 +78,52 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> HTTPMethodGetResponse: """ - Get the top autonomous systems (AS), by HTTP traffic, of the requested HTTP - version. Values are a percentage out of the total traffic. + Retrieves the top autonomous systems, by HTTP requests, of the requested HTTP + version. Args: http_version: HTTP version. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -218,52 +218,52 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> HTTPMethodGetResponse: """ - Get the top autonomous systems (AS), by HTTP traffic, of the requested HTTP - version. Values are a percentage out of the total traffic. + Retrieves the top autonomous systems, by HTTP requests, of the requested HTTP + version. Args: http_version: HTTP version. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/http/ases/http_protocol.py b/src/cloudflare/resources/radar/http/ases/http_protocol.py index 613777f074f..36250f4f2d5 100644 --- a/src/cloudflare/resources/radar/http/ases/http_protocol.py +++ b/src/cloudflare/resources/radar/http/ases/http_protocol.py @@ -62,6 +62,7 @@ def get( date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, @@ -77,50 +78,52 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> HTTPProtocolGetResponse: """ - Get the top autonomous systems (AS), by HTTP traffic, of the requested HTTP - protocol. Values are a percentage out of the total traffic. + Retrieves the top autonomous systems, by HTTP requests, of the requested HTTP + protocol. Args: - http_protocol: HTTP Protocol. + http_protocol: HTTP protocol (HTTP vs. HTTPS). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - ip_version: Filter for ip version. + http_version: Filters results by HTTP version. - limit: Limit the number of objects in the response. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + limit: Limits the number of objects returned in the response. - name: Array of names that will be used to name the series in responses. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - os: Filter for os name. + name: Array of names used to label the series in the response. - tls_version: Filter for tls version. + os: Filters results by operating system. + + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -150,6 +153,7 @@ def get( "date_start": date_start, "device_type": device_type, "format": format, + "http_version": http_version, "ip_version": ip_version, "limit": limit, "location": location, @@ -198,6 +202,7 @@ async def get( date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, @@ -213,50 +218,52 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> HTTPProtocolGetResponse: """ - Get the top autonomous systems (AS), by HTTP traffic, of the requested HTTP - protocol. Values are a percentage out of the total traffic. + Retrieves the top autonomous systems, by HTTP requests, of the requested HTTP + protocol. Args: - http_protocol: HTTP Protocol. + http_protocol: HTTP protocol (HTTP vs. HTTPS). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. - date_start: Array of datetimes to filter the start of a series. + device_type: Filters results by device type. - device_type: Filter for device type. + format: Format in which results will be returned. - format: Format results are returned in. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -286,6 +293,7 @@ async def get( "date_start": date_start, "device_type": device_type, "format": format, + "http_version": http_version, "ip_version": ip_version, "limit": limit, "location": location, diff --git a/src/cloudflare/resources/radar/http/ases/ip_version.py b/src/cloudflare/resources/radar/http/ases/ip_version.py index aee722d0eaa..380e6204527 100644 --- a/src/cloudflare/resources/radar/http/ases/ip_version.py +++ b/src/cloudflare/resources/radar/http/ases/ip_version.py @@ -78,52 +78,52 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> IPVersionGetResponse: """ - Get the top autonomous systems, by HTTP traffic, of the requested IP version. - Values are a percentage out of the total traffic. + Retrieves the top autonomous systems, by HTTP requests, of the requested IP + version. Args: ip_version: IP version. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -218,52 +218,52 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> IPVersionGetResponse: """ - Get the top autonomous systems, by HTTP traffic, of the requested IP version. - Values are a percentage out of the total traffic. + Retrieves the top autonomous systems, by HTTP requests, of the requested IP + version. Args: ip_version: IP version. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/http/ases/os.py b/src/cloudflare/resources/radar/http/ases/os.py index ef59110ac0b..bf846c04615 100644 --- a/src/cloudflare/resources/radar/http/ases/os.py +++ b/src/cloudflare/resources/radar/http/ases/os.py @@ -77,52 +77,52 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> OSGetResponse: """ - Get the top autonomous systems, by HTTP traffic, of the requested operating - systems. Values are a percentage out of the total traffic. + Retrieves the top autonomous systems, by HTTP requests, of the requested + operating system. Args: os: Operating system. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -216,52 +216,52 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> OSGetResponse: """ - Get the top autonomous systems, by HTTP traffic, of the requested operating - systems. Values are a percentage out of the total traffic. + Retrieves the top autonomous systems, by HTTP requests, of the requested + operating system. Args: os: Operating system. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/http/ases/tls_version.py b/src/cloudflare/resources/radar/http/ases/tls_version.py index 3603964e669..7699af8b1c3 100644 --- a/src/cloudflare/resources/radar/http/ases/tls_version.py +++ b/src/cloudflare/resources/radar/http/ases/tls_version.py @@ -78,52 +78,52 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TLSVersionGetResponse: """ - Get the top autonomous systems (AS), by HTTP traffic, of the requested TLS - protocol version. Values are a percentage out of the total traffic. + Retrieves the top autonomous systems, by HTTP requests, of the requested TLS + protocol version. Args: tls_version: TLS version. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. extra_headers: Send extra headers @@ -218,52 +218,52 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TLSVersionGetResponse: """ - Get the top autonomous systems (AS), by HTTP traffic, of the requested TLS - protocol version. Values are a percentage out of the total traffic. + Retrieves the top autonomous systems, by HTTP requests, of the requested TLS + protocol version. Args: tls_version: TLS version. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/http/http.py b/src/cloudflare/resources/radar/http/http.py index 256d212419b..598cf160a51 100644 --- a/src/cloudflare/resources/radar/http/http.py +++ b/src/cloudflare/resources/radar/http/http.py @@ -138,54 +138,54 @@ def timeseries( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> HTTPTimeseriesResponse: """ - Get HTTP requests over time. + Retrieves the HTTP requests over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -299,54 +299,54 @@ async def timeseries( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> HTTPTimeseriesResponse: """ - Get HTTP requests over time. + Retrieves the HTTP requests over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/http/locations/bot_class.py b/src/cloudflare/resources/radar/http/locations/bot_class.py index 8d33f970f8e..414746db158 100644 --- a/src/cloudflare/resources/radar/http/locations/bot_class.py +++ b/src/cloudflare/resources/radar/http/locations/bot_class.py @@ -77,55 +77,52 @@ def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> BotClassGetResponse: - """Get the top locations, by HTTP traffic, of the requested bot class. - - These two - categories use Cloudflare's bot score - refer to [Bot - scores])https://developers.cloudflare.com/bots/concepts/bot-score). Values are a - percentage out of the total traffic. + """ + Retrieves the top locations, by HTTP requests, of the requested bot class. Args: - bot_class: Bot class. + bot_class: Bot class. Refer to + [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -219,55 +216,52 @@ async def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> BotClassGetResponse: - """Get the top locations, by HTTP traffic, of the requested bot class. - - These two - categories use Cloudflare's bot score - refer to [Bot - scores])https://developers.cloudflare.com/bots/concepts/bot-score). Values are a - percentage out of the total traffic. + """ + Retrieves the top locations, by HTTP requests, of the requested bot class. Args: - bot_class: Bot class. + bot_class: Bot class. Refer to + [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/http/locations/browser_family.py b/src/cloudflare/resources/radar/http/locations/browser_family.py index bee94d89c75..cfa4d8b954d 100644 --- a/src/cloudflare/resources/radar/http/locations/browser_family.py +++ b/src/cloudflare/resources/radar/http/locations/browser_family.py @@ -77,54 +77,52 @@ def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> BrowserFamilyGetResponse: - """Get the top locations, by HTTP traffic, of the requested browser family. - - Values - are a percentage out of the total traffic. + """ + Retrieves the top locations, by HTTP requests, of the requested browser family. Args: browser_family: Browser family. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -218,54 +216,52 @@ async def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> BrowserFamilyGetResponse: - """Get the top locations, by HTTP traffic, of the requested browser family. - - Values - are a percentage out of the total traffic. + """ + Retrieves the top locations, by HTTP requests, of the requested browser family. Args: browser_family: Browser family. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/http/locations/device_type.py b/src/cloudflare/resources/radar/http/locations/device_type.py index 44234522dae..39d476edd2c 100644 --- a/src/cloudflare/resources/radar/http/locations/device_type.py +++ b/src/cloudflare/resources/radar/http/locations/device_type.py @@ -77,54 +77,52 @@ def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> DeviceTypeGetResponse: - """Get the top locations, by HTTP traffic, of the requested device type. - - Values are - a percentage out of the total traffic. + """ + Retrieves the top locations, by HTTP requests, of the requested device type. Args: device_type: Device type. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -218,54 +216,52 @@ async def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> DeviceTypeGetResponse: - """Get the top locations, by HTTP traffic, of the requested device type. - - Values are - a percentage out of the total traffic. + """ + Retrieves the top locations, by HTTP requests, of the requested device type. Args: device_type: Device type. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/http/locations/http_method.py b/src/cloudflare/resources/radar/http/locations/http_method.py index d2f9b464437..ee9489bc27c 100644 --- a/src/cloudflare/resources/radar/http/locations/http_method.py +++ b/src/cloudflare/resources/radar/http/locations/http_method.py @@ -77,54 +77,52 @@ def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> HTTPMethodGetResponse: - """Get the top locations, by HTTP traffic, of the requested HTTP version. - - Values - are a percentage out of the total traffic. + """ + Retrieves the top locations, by HTTP requests, of the requested HTTP version. Args: http_version: HTTP version. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -218,54 +216,52 @@ async def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> HTTPMethodGetResponse: - """Get the top locations, by HTTP traffic, of the requested HTTP version. - - Values - are a percentage out of the total traffic. + """ + Retrieves the top locations, by HTTP requests, of the requested HTTP version. Args: http_version: HTTP version. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/http/locations/http_protocol.py b/src/cloudflare/resources/radar/http/locations/http_protocol.py index 7c5c8f4f644..779831fff30 100644 --- a/src/cloudflare/resources/radar/http/locations/http_protocol.py +++ b/src/cloudflare/resources/radar/http/locations/http_protocol.py @@ -62,6 +62,7 @@ def get( date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, @@ -76,52 +77,52 @@ def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> HTTPProtocolGetResponse: - """Get the top locations, by HTTP traffic, of the requested HTTP protocol. - - Values - are a percentage out of the total traffic. + """ + Retrieves the top locations, by HTTP requests, of the requested HTTP protocol. Args: - http_protocol: HTTP Protocol. + http_protocol: HTTP protocol (HTTP vs. HTTPS). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. - date_start: Array of datetimes to filter the start of a series. + device_type: Filters results by device type. - device_type: Filter for device type. + format: Format in which results will be returned. - format: Format results are returned in. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -151,6 +152,7 @@ def get( "date_start": date_start, "device_type": device_type, "format": format, + "http_version": http_version, "ip_version": ip_version, "limit": limit, "location": location, @@ -199,6 +201,7 @@ async def get( date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, location: List[str] | NotGiven = NOT_GIVEN, @@ -213,52 +216,52 @@ async def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> HTTPProtocolGetResponse: - """Get the top locations, by HTTP traffic, of the requested HTTP protocol. - - Values - are a percentage out of the total traffic. + """ + Retrieves the top locations, by HTTP requests, of the requested HTTP protocol. Args: - http_protocol: HTTP Protocol. + http_protocol: HTTP protocol (HTTP vs. HTTPS). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. - date_start: Array of datetimes to filter the start of a series. + device_type: Filters results by device type. - device_type: Filter for device type. + format: Format in which results will be returned. - format: Format results are returned in. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -288,6 +291,7 @@ async def get( "date_start": date_start, "device_type": device_type, "format": format, + "http_version": http_version, "ip_version": ip_version, "limit": limit, "location": location, diff --git a/src/cloudflare/resources/radar/http/locations/ip_version.py b/src/cloudflare/resources/radar/http/locations/ip_version.py index 84d25e8135d..54c76e1620c 100644 --- a/src/cloudflare/resources/radar/http/locations/ip_version.py +++ b/src/cloudflare/resources/radar/http/locations/ip_version.py @@ -77,54 +77,52 @@ def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> IPVersionGetResponse: - """Get the top locations, by HTTP traffic, of the requested IP version. - - Values are - a percentage out of the total traffic. + """ + Retrieves the top locations, by HTTP requests, of the requested IP version. Args: ip_version: IP version. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -218,54 +216,52 @@ async def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> IPVersionGetResponse: - """Get the top locations, by HTTP traffic, of the requested IP version. - - Values are - a percentage out of the total traffic. + """ + Retrieves the top locations, by HTTP requests, of the requested IP version. Args: ip_version: IP version. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/http/locations/locations.py b/src/cloudflare/resources/radar/http/locations/locations.py index 2e47beade9e..75c4c62f00a 100644 --- a/src/cloudflare/resources/radar/http/locations/locations.py +++ b/src/cloudflare/resources/radar/http/locations/locations.py @@ -173,54 +173,52 @@ def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> LocationGetResponse: - """Get the top locations by HTTP traffic. - - Values are a percentage out of the total - traffic. + """ + Retrieves the top locations by HTTP requests. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -345,54 +343,52 @@ async def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> LocationGetResponse: - """Get the top locations by HTTP traffic. - - Values are a percentage out of the total - traffic. + """ + Retrieves the top locations by HTTP requests. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/http/locations/os.py b/src/cloudflare/resources/radar/http/locations/os.py index f1e8ad2da45..dd5f0d0dffe 100644 --- a/src/cloudflare/resources/radar/http/locations/os.py +++ b/src/cloudflare/resources/radar/http/locations/os.py @@ -77,52 +77,52 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> OSGetResponse: """ - Get the top locations, by HTTP traffic, of the requested operating systems. - Values are a percentage out of the total traffic. + Retrieves the top locations, by HTTP requests, of the requested operating + system. Args: os: Operating system. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -216,52 +216,52 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> OSGetResponse: """ - Get the top locations, by HTTP traffic, of the requested operating systems. - Values are a percentage out of the total traffic. + Retrieves the top locations, by HTTP requests, of the requested operating + system. Args: os: Operating system. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/http/locations/tls_version.py b/src/cloudflare/resources/radar/http/locations/tls_version.py index b916c68c4e8..adc15d784c9 100644 --- a/src/cloudflare/resources/radar/http/locations/tls_version.py +++ b/src/cloudflare/resources/radar/http/locations/tls_version.py @@ -78,52 +78,52 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TLSVersionGetResponse: """ - Get the top locations, by HTTP traffic, of the requested TLS protocol version. - Values are a percentage out of the total traffic. + Retrieves the top locations, by HTTP requests, of the requested TLS protocol + version. Args: tls_version: TLS version. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. extra_headers: Send extra headers @@ -218,52 +218,52 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TLSVersionGetResponse: """ - Get the top locations, by HTTP traffic, of the requested TLS protocol version. - Values are a percentage out of the total traffic. + Retrieves the top locations, by HTTP requests, of the requested TLS protocol + version. Args: tls_version: TLS version. - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/http/summary.py b/src/cloudflare/resources/radar/http/summary.py index 6af78371015..395d0808e5f 100644 --- a/src/cloudflare/resources/radar/http/summary.py +++ b/src/cloudflare/resources/radar/http/summary.py @@ -91,47 +91,47 @@ def bot_class( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryBotClassResponse: """ - Percentage distribution of bot-generated traffic to genuine human traffic, as - classified by Cloudflare. Visit + Retrieves the distribution of bot-generated HTTP requests to genuine human + traffic, as classified by Cloudflare. Visit https://developers.cloudflare.com/radar/concepts/bot-classes/ for more information. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -198,46 +198,46 @@ def device_type( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryDeviceTypeResponse: """ - Percentage of Internet traffic generated by mobile, desktop, and other types of - devices over a given time period. + Retrieves the distribution of HTTP requests generated by mobile, desktop, and + other types of devices. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -303,46 +303,47 @@ def http_protocol( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryHTTPProtocolResponse: - """ - Percentage distribution of traffic by HTTP protocol over a given time period. + """Retrieves the distribution of HTTP requests by HTTP protocol (HTTP vs. + + HTTPS). Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -409,45 +410,45 @@ def http_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryHTTPVersionResponse: """ - Percentage distribution of traffic by HTTP version over a given time period. + Retrieves the distribution of HTTP requests by HTTP version. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -514,46 +515,45 @@ def ip_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryIPVersionResponse: """ - Percentage distribution of Internet traffic based on IP versions (IPv4 and IPv6) - over a given time period. + Retrieves the distribution of HTTP requests by IP version. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -619,46 +619,46 @@ def os( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryOSResponse: """ - Percentage distribution of Internet traffic generated by different operating - systems like Windows, macOS, Android, iOS, and others, over a given time period. + Retrieves the distribution of HTTP requests by operating system (Windows, macOS, + Android, iOS, and others). Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -726,48 +726,47 @@ def post_quantum( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryPostQuantumResponse: """ - Percentage distribution of traffic by post-quantum support over a given time - period. + Retrieves the distribution of HTTP requests by post-quantum support. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -835,46 +834,45 @@ def tls_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryTLSVersionResponse: """ - Percentage distribution of traffic by TLS protocol version, over a given time - period. + Retrieves the distribution of HTTP requests by TLS version. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. extra_headers: Send extra headers @@ -962,47 +960,47 @@ async def bot_class( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryBotClassResponse: """ - Percentage distribution of bot-generated traffic to genuine human traffic, as - classified by Cloudflare. Visit + Retrieves the distribution of bot-generated HTTP requests to genuine human + traffic, as classified by Cloudflare. Visit https://developers.cloudflare.com/radar/concepts/bot-classes/ for more information. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -1069,46 +1067,46 @@ async def device_type( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryDeviceTypeResponse: """ - Percentage of Internet traffic generated by mobile, desktop, and other types of - devices over a given time period. + Retrieves the distribution of HTTP requests generated by mobile, desktop, and + other types of devices. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -1174,46 +1172,47 @@ async def http_protocol( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryHTTPProtocolResponse: - """ - Percentage distribution of traffic by HTTP protocol over a given time period. + """Retrieves the distribution of HTTP requests by HTTP protocol (HTTP vs. + + HTTPS). Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -1280,45 +1279,45 @@ async def http_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryHTTPVersionResponse: """ - Percentage distribution of traffic by HTTP version over a given time period. + Retrieves the distribution of HTTP requests by HTTP version. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -1385,46 +1384,45 @@ async def ip_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryIPVersionResponse: """ - Percentage distribution of Internet traffic based on IP versions (IPv4 and IPv6) - over a given time period. + Retrieves the distribution of HTTP requests by IP version. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -1490,46 +1488,46 @@ async def os( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryOSResponse: """ - Percentage distribution of Internet traffic generated by different operating - systems like Windows, macOS, Android, iOS, and others, over a given time period. + Retrieves the distribution of HTTP requests by operating system (Windows, macOS, + Android, iOS, and others). Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -1597,48 +1595,47 @@ async def post_quantum( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryPostQuantumResponse: """ - Percentage distribution of traffic by post-quantum support over a given time - period. + Retrieves the distribution of HTTP requests by post-quantum support. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -1706,46 +1703,45 @@ async def tls_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SummaryTLSVersionResponse: """ - Percentage distribution of traffic by TLS protocol version, over a given time - period. + Retrieves the distribution of HTTP requests by TLS version. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/http/timeseries_groups.py b/src/cloudflare/resources/radar/http/timeseries_groups.py index f81fb20fd7f..72a67be4c13 100644 --- a/src/cloudflare/resources/radar/http/timeseries_groups.py +++ b/src/cloudflare/resources/radar/http/timeseries_groups.py @@ -96,51 +96,50 @@ def bot_class( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupBotClassResponse: """ - Get a time series of the percentage distribution of traffic classified as - automated or human. Visit - https://developers.cloudflare.com/radar/concepts/bot-classes/ for more - information. + Retrieves the distribution of HTTP requests classified as automated or human + over time. Visit https://developers.cloudflare.com/radar/concepts/bot-classes/ + for more information. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -211,57 +210,56 @@ def browser( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupBrowserResponse: """ - Get a time series of the percentage distribution of traffic of the top user - agents. + Retrieves the distribution of HTTP requests by user agent over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -334,57 +332,56 @@ def browser_family( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupBrowserFamilyResponse: """ - Get a time series of the percentage distribution of traffic of the top user - agents aggregated in families. + Retrieves the distribution of HTTP requests by user agent family over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -457,49 +454,49 @@ def device_type( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupDeviceTypeResponse: """ - Get a time series of the percentage distribution of traffic by device type. + Retrieves the distribution of HTTP requests by device type over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -567,50 +564,52 @@ def http_protocol( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupHTTPProtocolResponse: - """ - Get a time series of the percentage distribution of traffic by HTTP protocol. + """Retrieves the distribution of HTTP requests by HTTP protocol (HTTP vs. + + HTTPS) + over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -679,49 +678,49 @@ def http_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupHTTPVersionResponse: """ - Get a time series of the percentage distribution of traffic by HTTP version. + Retrieves the distribution of HTTP requests by HTTP version over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -790,49 +789,49 @@ def ip_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupIPVersionResponse: """ - Get a time series of the percentage distribution of traffic by IP version. + Retrieves the distribution of HTTP requests by IP version over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -900,50 +899,49 @@ def os( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupOSResponse: """ - Get a time series of the percentage distribution of traffic of the top operating - systems. + Retrieves the distribution of HTTP requests by operating system over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -1013,52 +1011,51 @@ def post_quantum( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupPostQuantumResponse: """ - Get a time series of the percentage distribution of traffic by post-quantum - suport. + Retrieves the distribution of HTTP requests by post-quantum support over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -1128,50 +1125,49 @@ def tls_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupTLSVersionResponse: """ - Get a time series of the percentage distribution of traffic by TLS protocol - version. + Retrieves the distribution of HTTP requests by TLS version over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. extra_headers: Send extra headers @@ -1261,51 +1257,50 @@ async def bot_class( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupBotClassResponse: """ - Get a time series of the percentage distribution of traffic classified as - automated or human. Visit - https://developers.cloudflare.com/radar/concepts/bot-classes/ for more - information. + Retrieves the distribution of HTTP requests classified as automated or human + over time. Visit https://developers.cloudflare.com/radar/concepts/bot-classes/ + for more information. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -1376,57 +1371,56 @@ async def browser( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupBrowserResponse: """ - Get a time series of the percentage distribution of traffic of the top user - agents. + Retrieves the distribution of HTTP requests by user agent over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -1499,57 +1493,56 @@ async def browser_family( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupBrowserFamilyResponse: """ - Get a time series of the percentage distribution of traffic of the top user - agents aggregated in families. + Retrieves the distribution of HTTP requests by user agent family over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit_per_group: Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -1622,49 +1615,49 @@ async def device_type( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupDeviceTypeResponse: """ - Get a time series of the percentage distribution of traffic by device type. + Retrieves the distribution of HTTP requests by device type over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -1732,50 +1725,52 @@ async def http_protocol( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupHTTPProtocolResponse: - """ - Get a time series of the percentage distribution of traffic by HTTP protocol. + """Retrieves the distribution of HTTP requests by HTTP protocol (HTTP vs. + + HTTPS) + over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -1844,49 +1839,49 @@ async def http_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupHTTPVersionResponse: """ - Get a time series of the percentage distribution of traffic by HTTP version. + Retrieves the distribution of HTTP requests by HTTP version over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -1955,49 +1950,49 @@ async def ip_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupIPVersionResponse: """ - Get a time series of the percentage distribution of traffic by IP version. + Retrieves the distribution of HTTP requests by IP version over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -2065,50 +2060,49 @@ async def os( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupOSResponse: """ - Get a time series of the percentage distribution of traffic of the top operating - systems. + Retrieves the distribution of HTTP requests by operating system over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -2178,52 +2172,51 @@ async def post_quantum( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupPostQuantumResponse: """ - Get a time series of the percentage distribution of traffic by post-quantum - suport. + Retrieves the distribution of HTTP requests by post-quantum support over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -2293,50 +2286,49 @@ async def tls_version( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TimeseriesGroupTLSVersionResponse: """ - Get a time series of the percentage distribution of traffic by TLS protocol - version. + Retrieves the distribution of HTTP requests by TLS version over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/http/top.py b/src/cloudflare/resources/radar/http/top.py index bee2512dedb..4a0cb61af0e 100644 --- a/src/cloudflare/resources/radar/http/top.py +++ b/src/cloudflare/resources/radar/http/top.py @@ -78,54 +78,52 @@ def browser( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopBrowserResponse: - """Get the top user agents by HTTP traffic. - - Values are a percentage out of the - total traffic. + """ + Retrieves the top user agents by HTTP requests. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -196,52 +194,50 @@ def browser_family( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopBrowserFamilyResponse: - """Get the top user agents aggregated in families by HTTP traffic. - - Values are a - percentage out of the total traffic. + """ + Retrieves the top user agents, aggregated in families, by HTTP requests. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -333,54 +329,52 @@ async def browser( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopBrowserResponse: - """Get the top user agents by HTTP traffic. - - Values are a percentage out of the - total traffic. + """ + Retrieves the top user agents by HTTP requests. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - browser_family: Filter for browser family. + browser_family: Filters results by browser family. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers @@ -451,52 +445,50 @@ async def browser_family( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopBrowserFamilyResponse: - """Get the top user agents aggregated in families by HTTP traffic. - - Values are a - percentage out of the total traffic. + """ + Retrieves the top user agents, aggregated in families, by HTTP requests. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bot_class: Filter for bot class. Refer to + bot_class: Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - device_type: Filter for device type. + device_type: Filters results by device type. - format: Format results are returned in. + format: Format in which results will be returned. - http_protocol: Filter for http protocol. + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). - http_version: Filter for http version. + http_version: Filters results by HTTP version. - ip_version: Filter for ip version. + ip_version: Filters results by IP version (Ipv4 vs. IPv6). - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - os: Filter for os name. + os: Filters results by operating system. - tls_version: Filter for tls version. + tls_version: Filters results by TLS version. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/netflows/netflows.py b/src/cloudflare/resources/radar/netflows/netflows.py index 0384af11246..976c671ccb0 100644 --- a/src/cloudflare/resources/radar/netflows/netflows.py +++ b/src/cloudflare/resources/radar/netflows/netflows.py @@ -81,33 +81,33 @@ def summary( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> NetflowSummaryResponse: """ - Percentage distribution of HTTP vs other protocols traffic over a given time - period. + Retrieves the distribution of network traffic (NetFlows) by HTTP vs other + protocols. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -163,44 +163,42 @@ def timeseries( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> NetflowTimeseriesResponse: - """Get network traffic change over time. - - Visit - https://en.wikipedia.org/wiki/NetFlow for more information on NetFlows. + """ + Retrieves network traffic (NetFlows) over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - product: Array of network traffic product types. + product: Array of network traffic product types to filters results by. extra_headers: Send extra headers @@ -282,33 +280,33 @@ async def summary( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> NetflowSummaryResponse: """ - Percentage distribution of HTTP vs other protocols traffic over a given time - period. + Retrieves the distribution of network traffic (NetFlows) by HTTP vs other + protocols. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -364,44 +362,42 @@ async def timeseries( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> NetflowTimeseriesResponse: - """Get network traffic change over time. - - Visit - https://en.wikipedia.org/wiki/NetFlow for more information on NetFlows. + """ + Retrieves network traffic (NetFlows) over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. normalization: Normalization method applied. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - product: Array of network traffic product types. + product: Array of network traffic product types to filters results by. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/netflows/top.py b/src/cloudflare/resources/radar/netflows/top.py index 368f350ac13..0dde34111ae 100644 --- a/src/cloudflare/resources/radar/netflows/top.py +++ b/src/cloudflare/resources/radar/netflows/top.py @@ -70,35 +70,34 @@ def ases( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopAsesResponse: """ - Get the top autonomous systems (AS) by network traffic (NetFlows) over a given - time period. Visit https://en.wikipedia.org/wiki/NetFlow for more information. + Retrieves the top autonomous systems by network traffic (NetFlows). Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -154,35 +153,34 @@ def locations( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopLocationsResponse: """ - Get the top locations by network traffic (NetFlows) over a given time period. - Visit https://en.wikipedia.org/wiki/NetFlow for more information. + Retrieves the top locations by network traffic (NetFlows). Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -259,35 +257,34 @@ async def ases( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopAsesResponse: """ - Get the top autonomous systems (AS) by network traffic (NetFlows) over a given - time period. Visit https://en.wikipedia.org/wiki/NetFlow for more information. + Retrieves the top autonomous systems by network traffic (NetFlows). Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -343,35 +340,34 @@ async def locations( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopLocationsResponse: """ - Get the top locations by network traffic (NetFlows) over a given time period. - Visit https://en.wikipedia.org/wiki/NetFlow for more information. + Retrieves the top locations by network traffic (NetFlows). Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/quality/iqi.py b/src/cloudflare/resources/radar/quality/iqi.py index bcdeb909f41..fa87c8c30ba 100644 --- a/src/cloudflare/resources/radar/quality/iqi.py +++ b/src/cloudflare/resources/radar/quality/iqi.py @@ -70,35 +70,35 @@ def summary( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> IQISummaryResponse: """ - Get a summary (percentiles) of bandwidth, latency or DNS response time from the - Radar Internet Quality Index (IQI). + Retrieves a summary (percentiles) of bandwidth, latency, or DNS response time + from the Radar Internet Quality Index (IQI). Args: - metric: Which metric to return: bandwidth, latency or DNS response time. + metric: Defines which metric to return (bandwidth, latency, or DNS response time). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -156,41 +156,41 @@ def timeseries_groups( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> IQITimeseriesGroupsResponse: """ - Get a time series (percentiles) of bandwidth, latency or DNS response time from - the Radar Internet Quality Index (IQI). + Retrieves a time series (percentiles) of bandwidth, latency, or DNS response + time from the Radar Internet Quality Index (IQI). Args: - metric: Which metric to return: bandwidth, latency or DNS response time. + metric: Defines which metric to return (bandwidth, latency, or DNS response time). agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - interpolation: Enable interpolation for all series (using the average). + interpolation: Enables interpolation for all series (using the average). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -269,35 +269,35 @@ async def summary( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> IQISummaryResponse: """ - Get a summary (percentiles) of bandwidth, latency or DNS response time from the - Radar Internet Quality Index (IQI). + Retrieves a summary (percentiles) of bandwidth, latency, or DNS response time + from the Radar Internet Quality Index (IQI). Args: - metric: Which metric to return: bandwidth, latency or DNS response time. + metric: Defines which metric to return (bandwidth, latency, or DNS response time). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -355,41 +355,41 @@ async def timeseries_groups( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> IQITimeseriesGroupsResponse: """ - Get a time series (percentiles) of bandwidth, latency or DNS response time from - the Radar Internet Quality Index (IQI). + Retrieves a time series (percentiles) of bandwidth, latency, or DNS response + time from the Radar Internet Quality Index (IQI). Args: - metric: Which metric to return: bandwidth, latency or DNS response time. + metric: Defines which metric to return (bandwidth, latency, or DNS response time). agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - interpolation: Enable interpolation for all series (using the average). + interpolation: Enables interpolation for all series (using the average). - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/quality/speed/speed.py b/src/cloudflare/resources/radar/quality/speed/speed.py index 496dfa907c7..1ac55917b42 100644 --- a/src/cloudflare/resources/radar/quality/speed/speed.py +++ b/src/cloudflare/resources/radar/quality/speed/speed.py @@ -81,31 +81,31 @@ def histogram( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SpeedHistogramResponse: """ - Get an histogram from the previous 90 days of Cloudflare Speed Test data, split - into fixed bandwidth (Mbps), latency (ms) or jitter (ms) buckets. + Retrieves a histogram from the previous 90 days of Cloudflare Speed Test data, + split into fixed bandwidth (Mbps), latency (ms), or jitter (ms) buckets. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bucket_size: The width for every bucket in the histogram. + bucket_size: Width for every bucket in the histogram. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. metric_group: Metrics to be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -157,27 +157,27 @@ def summary( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SpeedSummaryResponse: """ - Get a summary of bandwidth, latency, jitter and packet loss, from the previous - 90 days of Cloudflare Speed Test data. + Retrieves a summary of bandwidth, latency, jitter, and packet loss, from the + previous 90 days of Cloudflare Speed Test data. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -254,31 +254,31 @@ async def histogram( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SpeedHistogramResponse: """ - Get an histogram from the previous 90 days of Cloudflare Speed Test data, split - into fixed bandwidth (Mbps), latency (ms) or jitter (ms) buckets. + Retrieves a histogram from the previous 90 days of Cloudflare Speed Test data, + split into fixed bandwidth (Mbps), latency (ms), or jitter (ms) buckets. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - bucket_size: The width for every bucket in the histogram. + bucket_size: Width for every bucket in the histogram. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. metric_group: Metrics to be returned. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -330,27 +330,27 @@ async def summary( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SpeedSummaryResponse: """ - Get a summary of bandwidth, latency, jitter and packet loss, from the previous - 90 days of Cloudflare Speed Test data. + Retrieves a summary of bandwidth, latency, jitter, and packet loss, from the + previous 90 days of Cloudflare Speed Test data. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/quality/speed/top.py b/src/cloudflare/resources/radar/quality/speed/top.py index 827ad096ef9..471927135f1 100644 --- a/src/cloudflare/resources/radar/quality/speed/top.py +++ b/src/cloudflare/resources/radar/quality/speed/top.py @@ -73,33 +73,33 @@ def ases( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopAsesResponse: """ - Get the top autonomous systems by bandwidth, latency, jitter or packet loss, - from the previous 90 days of Cloudflare Speed Test data. + Retrieves the top autonomous systems by bandwidth, latency, jitter, or packet + loss, from the previous 90 days of Cloudflare Speed Test data. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. order_by: Metric to order the results by. - reverse: Reverse the order of results. + reverse: Reverses the order of results. extra_headers: Send extra headers @@ -158,33 +158,33 @@ def locations( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopLocationsResponse: """ - Get the top locations by bandwidth, latency, jitter or packet loss, from the - previous 90 days of Cloudflare Speed Test data. + Retrieves the top locations by bandwidth, latency, jitter, or packet loss, from + the previous 90 days of Cloudflare Speed Test data. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. order_by: Metric to order the results by. - reverse: Reverse the order of results. + reverse: Reverses the order of results. extra_headers: Send extra headers @@ -264,33 +264,33 @@ async def ases( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopAsesResponse: """ - Get the top autonomous systems by bandwidth, latency, jitter or packet loss, - from the previous 90 days of Cloudflare Speed Test data. + Retrieves the top autonomous systems by bandwidth, latency, jitter, or packet + loss, from the previous 90 days of Cloudflare Speed Test data. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. order_by: Metric to order the results by. - reverse: Reverse the order of results. + reverse: Reverses the order of results. extra_headers: Send extra headers @@ -349,33 +349,33 @@ async def locations( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopLocationsResponse: """ - Get the top locations by bandwidth, latency, jitter or packet loss, from the - previous 90 days of Cloudflare Speed Test data. + Retrieves the top locations by bandwidth, latency, jitter, or packet loss, from + the previous 90 days of Cloudflare Speed Test data. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. order_by: Metric to order the results by. - reverse: Reverse the order of results. + reverse: Reverses the order of results. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/ranking/domain.py b/src/cloudflare/resources/radar/ranking/domain.py index 2f6b40cd8ef..ad1627be374 100644 --- a/src/cloudflare/resources/radar/ranking/domain.py +++ b/src/cloudflare/resources/radar/ranking/domain.py @@ -66,25 +66,27 @@ def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> DomainGetResponse: - """Gets Domains Rank details. + """Retrieves domain rank details. - Cloudflare provides an ordered rank for the top 100 - domains, but for the remainder it only provides ranking buckets like top 200 + Cloudflare provides an ordered rank for the top + 100 domains, but for the remainder it only provides ranking buckets like top 200 thousand, top one million, etc.. These are available through Radar datasets endpoints. Args: + domain: Domain name. + date: Array of dates to filter the ranking. - format: Format results are returned in. + format: Format in which results will be returned. - include_top_locations: Include top locations in the response. + include_top_locations: Includes top locations in the response. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - ranking_type: The ranking type. + ranking_type: Ranking type. extra_headers: Send extra headers @@ -157,25 +159,27 @@ async def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> DomainGetResponse: - """Gets Domains Rank details. + """Retrieves domain rank details. - Cloudflare provides an ordered rank for the top 100 - domains, but for the remainder it only provides ranking buckets like top 200 + Cloudflare provides an ordered rank for the top + 100 domains, but for the remainder it only provides ranking buckets like top 200 thousand, top one million, etc.. These are available through Radar datasets endpoints. Args: + domain: Domain name. + date: Array of dates to filter the ranking. - format: Format results are returned in. + format: Format in which results will be returned. - include_top_locations: Include top locations in the response. + include_top_locations: Includes top locations in the response. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - ranking_type: The ranking type. + ranking_type: Ranking type. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/ranking/internet_services.py b/src/cloudflare/resources/radar/ranking/internet_services.py index abfa97aa3f2..f604a2daf48 100644 --- a/src/cloudflare/resources/radar/ranking/internet_services.py +++ b/src/cloudflare/resources/radar/ranking/internet_services.py @@ -67,26 +67,25 @@ def timeseries_groups( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> InternetServiceTimeseriesGroupsResponse: - """Gets Internet Services rank update changes over time. - - Raw values are returned. + """ + Retrieves Internet Services rank update changes over time. Args: date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - service_category: Filter for services category. + service_category: Filters results by Internet service category. extra_headers: Send extra headers @@ -138,18 +137,18 @@ def top( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> InternetServiceTopResponse: """ - Get top Internet services based on their rank. + Retrieves top Internet services based on their rank. Args: date: Array of dates to filter the ranking. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - service_category: Filter for services category. + service_category: Filters results by Internet service category. extra_headers: Send extra headers @@ -219,26 +218,25 @@ async def timeseries_groups( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> InternetServiceTimeseriesGroupsResponse: - """Gets Internet Services rank update changes over time. - - Raw values are returned. + """ + Retrieves Internet Services rank update changes over time. Args: date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - service_category: Filter for services category. + service_category: Filters results by Internet service category. extra_headers: Send extra headers @@ -290,18 +288,18 @@ async def top( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> InternetServiceTopResponse: """ - Get top Internet services based on their rank. + Retrieves top Internet services based on their rank. Args: date: Array of dates to filter the ranking. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - service_category: Filter for services category. + service_category: Filters results by Internet service category. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/ranking/ranking.py b/src/cloudflare/resources/radar/ranking/ranking.py index 5880b49037c..5e46497e023 100644 --- a/src/cloudflare/resources/radar/ranking/ranking.py +++ b/src/cloudflare/resources/radar/ranking/ranking.py @@ -94,32 +94,31 @@ def timeseries_groups( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RankingTimeseriesGroupsResponse: - """Gets Domains Rank updates change over time. - - Raw values are returned. + """ + Retrieves domains rank over time. Args: date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - domain_category: Filter by domain category. + domain_category: Filters results by domain category. - domains: Array of comma separated list of domains names. + domains: Comma-separated list of domain names. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of locations (alpha-2 country codes). + location: Comma-separated list of locations (alpha-2 codes). - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - ranking_type: The ranking type. + ranking_type: Ranking type. extra_headers: Send extra headers @@ -173,27 +172,27 @@ def top( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RankingTopResponse: - """Get top or trending domains based on their rank. + """Retrieves the top or trending domains based on their rank. - Popular domains are domains of - broad appeal based on how people use the Internet. Trending domains are domains - that are generating a surge in interest. For more information on top domains, - see https://blog.cloudflare.com/radar-domain-rankings/. + Popular domains are + domains of broad appeal based on how people use the Internet. Trending domains + are domains that are generating a surge in interest. For more information on top + domains, see https://blog.cloudflare.com/radar-domain-rankings/. Args: date: Array of dates to filter the ranking. - domain_category: Filter by domain category. + domain_category: Filters results by domain category. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of locations (alpha-2 country codes). + location: Comma-separated list of locations (alpha-2 codes). - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - ranking_type: The ranking type. + ranking_type: Ranking type. extra_headers: Send extra headers @@ -276,32 +275,31 @@ async def timeseries_groups( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RankingTimeseriesGroupsResponse: - """Gets Domains Rank updates change over time. - - Raw values are returned. + """ + Retrieves domains rank over time. Args: date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - domain_category: Filter by domain category. + domain_category: Filters results by domain category. - domains: Array of comma separated list of domains names. + domains: Comma-separated list of domain names. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of locations (alpha-2 country codes). + location: Comma-separated list of locations (alpha-2 codes). - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - ranking_type: The ranking type. + ranking_type: Ranking type. extra_headers: Send extra headers @@ -355,27 +353,27 @@ async def top( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RankingTopResponse: - """Get top or trending domains based on their rank. + """Retrieves the top or trending domains based on their rank. - Popular domains are domains of - broad appeal based on how people use the Internet. Trending domains are domains - that are generating a surge in interest. For more information on top domains, - see https://blog.cloudflare.com/radar-domain-rankings/. + Popular domains are + domains of broad appeal based on how people use the Internet. Trending domains + are domains that are generating a surge in interest. For more information on top + domains, see https://blog.cloudflare.com/radar-domain-rankings/. Args: date: Array of dates to filter the ranking. - domain_category: Filter by domain category. + domain_category: Filters results by domain category. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of locations (alpha-2 country codes). + location: Comma-separated list of locations (alpha-2 codes). - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - ranking_type: The ranking type. + ranking_type: Ranking type. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/robots_txt/top/top.py b/src/cloudflare/resources/radar/robots_txt/top/top.py index a49a078fc72..e30d7cea4ea 100644 --- a/src/cloudflare/resources/radar/robots_txt/top/top.py +++ b/src/cloudflare/resources/radar/robots_txt/top/top.py @@ -77,18 +77,18 @@ def domain_categories( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopDomainCategoriesResponse: """ - Get the top domain categories by the number of robots.txt files parsed. + Retrieves the top domain categories by the number of robots.txt files parsed. Args: date: Array of dates to filter the ranking. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - user_agent_category: Filter by user agent category. + user_agent_category: Filters results by user agent category. extra_headers: Send extra headers @@ -161,18 +161,18 @@ async def domain_categories( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopDomainCategoriesResponse: """ - Get the top domain categories by the number of robots.txt files parsed. + Retrieves the top domain categories by the number of robots.txt files parsed. Args: date: Array of dates to filter the ranking. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - user_agent_category: Filter by user agent category. + user_agent_category: Filters results by user agent category. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/robots_txt/top/user_agents.py b/src/cloudflare/resources/radar/robots_txt/top/user_agents.py index 774f29ecaf5..603d7bbb868 100644 --- a/src/cloudflare/resources/radar/robots_txt/top/user_agents.py +++ b/src/cloudflare/resources/radar/robots_txt/top/user_agents.py @@ -67,22 +67,22 @@ def directive( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> UserAgentDirectiveResponse: """ - Get the top user agents on robots.txt files by directive. + Retrieves the top user agents on robots.txt files. Args: date: Array of dates to filter the ranking. - directive: Filter by directive. + directive: Filters results by robots.txt directive. - domain_category: Filter by domain category. + domain_category: Filters results by domain category. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - user_agent_category: Filter by user agent category. + user_agent_category: Filters results by user agent category. extra_headers: Send extra headers @@ -155,22 +155,22 @@ async def directive( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> UserAgentDirectiveResponse: """ - Get the top user agents on robots.txt files by directive. + Retrieves the top user agents on robots.txt files. Args: date: Array of dates to filter the ranking. - directive: Filter by directive. + directive: Filters results by robots.txt directive. - domain_category: Filter by domain category. + domain_category: Filters results by domain category. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. - user_agent_category: Filter by user agent category. + user_agent_category: Filters results by user agent category. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/search.py b/src/cloudflare/resources/radar/search.py index 52751f99375..c070a76f316 100644 --- a/src/cloudflare/resources/radar/search.py +++ b/src/cloudflare/resources/radar/search.py @@ -65,18 +65,18 @@ def global_( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SearchGlobalResponse: """ - Lets you search for locations, autonomous systems (ASes), and reports. + Searches for locations, autonomous systems, and reports. Args: - query: Search for locations, AS and reports. + query: Search for locations, autonomous systems and reports. exclude: Search types to be excluded from results. - format: Format results are returned in. + format: Format in which results will be returned. include: Search types to be included in results. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. limit_per_group: Limit the number of objects per search category. @@ -149,18 +149,18 @@ async def global_( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SearchGlobalResponse: """ - Lets you search for locations, autonomous systems (ASes), and reports. + Searches for locations, autonomous systems, and reports. Args: - query: Search for locations, AS and reports. + query: Search for locations, autonomous systems and reports. exclude: Search types to be excluded from results. - format: Format results are returned in. + format: Format in which results will be returned. include: Search types to be included in results. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. limit_per_group: Limit the number of objects per search category. diff --git a/src/cloudflare/resources/radar/tcp_resets_timeouts.py b/src/cloudflare/resources/radar/tcp_resets_timeouts.py index 74c034cc349..3922164ea80 100644 --- a/src/cloudflare/resources/radar/tcp_resets_timeouts.py +++ b/src/cloudflare/resources/radar/tcp_resets_timeouts.py @@ -69,33 +69,33 @@ def summary( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TCPResetsTimeoutSummaryResponse: """ - Percentage distribution by connection stage of TCP connections terminated within - the first 10 packets by a reset or timeout, for a given time period. + Retrieves the distribution of connection stage by TCP connections terminated + within the first 10 packets by a reset or timeout. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -150,37 +150,37 @@ def timeseries_groups( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TCPResetsTimeoutTimeseriesGroupsResponse: """ - Percentage distribution by connection stage of TCP connections terminated within - the first 10 packets by a reset or timeout, over time. + Retrieves the distribution of connection stage by TCP connections terminated + within the first 10 packets by a reset or timeout over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -258,33 +258,33 @@ async def summary( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TCPResetsTimeoutSummaryResponse: """ - Percentage distribution by connection stage of TCP connections terminated within - the first 10 packets by a reset or timeout, for a given time period. + Retrieves the distribution of connection stage by TCP connections terminated + within the first 10 packets by a reset or timeout. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -339,37 +339,37 @@ async def timeseries_groups( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TCPResetsTimeoutTimeseriesGroupsResponse: """ - Percentage distribution by connection stage of TCP connections terminated within - the first 10 packets by a reset or timeout, over time. + Retrieves the distribution of connection stage by TCP connections terminated + within the first 10 packets by a reset or timeout over time. Args: agg_interval: Aggregation interval results should be returned in (for example, in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/traffic_anomalies/locations.py b/src/cloudflare/resources/radar/traffic_anomalies/locations.py index fb20b5df6f7..cccbceff4c5 100644 --- a/src/cloudflare/resources/radar/traffic_anomalies/locations.py +++ b/src/cloudflare/resources/radar/traffic_anomalies/locations.py @@ -65,11 +65,11 @@ def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> LocationGetResponse: - """Internet traffic anomalies are signals that might point to an outage. + """Retrieves the sum of Internet traffic anomalies, grouped by location. These - alerts are automatically detected by Radar and then manually verified by our - team. This endpoint returns the sum of alerts grouped by location. + anomalies are signals that might indicate an outage, automatically detected by + Radar and manually verified by our team. Args: date_end: End of the date range (inclusive). @@ -79,9 +79,9 @@ def get( date_start: Start of the date range (inclusive). - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. extra_headers: Send extra headers @@ -151,11 +151,11 @@ async def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> LocationGetResponse: - """Internet traffic anomalies are signals that might point to an outage. + """Retrieves the sum of Internet traffic anomalies, grouped by location. These - alerts are automatically detected by Radar and then manually verified by our - team. This endpoint returns the sum of alerts grouped by location. + anomalies are signals that might indicate an outage, automatically detected by + Radar and manually verified by our team. Args: date_end: End of the date range (inclusive). @@ -165,9 +165,9 @@ async def get( date_start: Start of the date range (inclusive). - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/traffic_anomalies/traffic_anomalies.py b/src/cloudflare/resources/radar/traffic_anomalies/traffic_anomalies.py index eba1dee52cd..2bb5146b08c 100644 --- a/src/cloudflare/resources/radar/traffic_anomalies/traffic_anomalies.py +++ b/src/cloudflare/resources/radar/traffic_anomalies/traffic_anomalies.py @@ -80,14 +80,13 @@ def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TrafficAnomalyGetResponse: - """Internet traffic anomalies are signals that might point to an outage. - - These - alerts are automatically detected by Radar and then manually verified by our - team. This endpoint returns the latest alerts. + """ + Retrieves the latest Internet traffic anomalies, which are signals that might + indicate an outage. These alerts are automatically detected by Radar and + manually verified by our team. Args: - asn: Single ASN as integer. + asn: Single Autonomous System Number (ASN) as integer. date_end: End of the date range (inclusive). @@ -96,13 +95,13 @@ def get( date_start: Start of the date range (inclusive). - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Location Alpha2 code. + location: Location alpha-2 code. - offset: Number of objects to skip before grabbing results. + offset: Skips the specified number of objects before fetching the results. extra_headers: Send extra headers @@ -182,14 +181,13 @@ async def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TrafficAnomalyGetResponse: - """Internet traffic anomalies are signals that might point to an outage. - - These - alerts are automatically detected by Radar and then manually verified by our - team. This endpoint returns the latest alerts. + """ + Retrieves the latest Internet traffic anomalies, which are signals that might + indicate an outage. These alerts are automatically detected by Radar and + manually verified by our team. Args: - asn: Single ASN as integer. + asn: Single Autonomous System Number (ASN) as integer. date_end: End of the date range (inclusive). @@ -198,13 +196,13 @@ async def get( date_start: Start of the date range (inclusive). - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Location Alpha2 code. + location: Location alpha-2 code. - offset: Number of objects to skip before grabbing results. + offset: Skips the specified number of objects before fetching the results. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/verified_bots/top.py b/src/cloudflare/resources/radar/verified_bots/top.py index 4400b19e6fe..bb40d31672b 100644 --- a/src/cloudflare/resources/radar/verified_bots/top.py +++ b/src/cloudflare/resources/radar/verified_bots/top.py @@ -70,34 +70,34 @@ def bots( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopBotsResponse: """ - Get top verified bots by HTTP requests, with owner and category. + Retrieves the top verified bots by HTTP requests, with owner and category. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -153,35 +153,35 @@ def categories( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopCategoriesResponse: """ - Get top verified bot categories by HTTP requests, along with their corresponding - percentage, over the total verified bot HTTP requests. + Retrieves the top verified bot categories by HTTP requests, along with their + corresponding percentage, over the total verified bot HTTP requests. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -258,34 +258,34 @@ async def bots( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopBotsResponse: """ - Get top verified bots by HTTP requests, with owner and category. + Retrieves the top verified bots by HTTP requests, with owner and category. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers @@ -341,35 +341,35 @@ async def categories( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TopCategoriesResponse: """ - Get top verified bot categories by HTTP requests, along with their corresponding - percentage, over the total verified bot HTTP requests. + Retrieves the top verified bot categories by HTTP requests, along with their + corresponding percentage, over the total verified bot HTTP requests. Args: - asn: Array of comma separated list of ASNs, start with `-` to exclude from results. - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + asn: Comma-separated list of Autonomous System Numbers (ASNs). Prefix with `-` to + exclude ASNs from results. For example, `-174, 3356` excludes results from + AS174, but includes results from AS3356. - continent: Array of comma separated list of continents (alpha-2 continent codes). Start - with `-` to exclude from results. For example, `-EU,NA` excludes results from - Europe, but includes results from North America. + continent: Comma-separated list of continents (alpha-2 continent codes). Prefix with `-` to + exclude continents from results. For example, `-EU,NA` excludes results from EU, + but includes results from NA. date_end: End of the date range (inclusive). - date_range: For example, use `7d` and `7dControl` to compare this week with the previous - week. Use this parameter or set specific start and end dates (`dateStart` and - `dateEnd` parameters). + date_range: Filters results by the specified date range. For example, use `7d` and + `7dcontrol` to compare this week with the previous week. Use this parameter or + set specific start and end dates (`dateStart` and `dateEnd` parameters). - date_start: Array of datetimes to filter the start of a series. + date_start: Start of the date range. - format: Format results are returned in. + format: Format in which results will be returned. - limit: Limit the number of objects in the response. + limit: Limits the number of objects returned in the response. - location: Array of comma separated list of locations (alpha-2 country codes). Start with - `-` to exclude from results. For example, `-US,PT` excludes results from the US, - but includes results from PT. + location: Comma-separated list of locations (alpha-2 codes). Prefix with `-` to exclude + locations from results. For example, `-US,PT` excludes results from the US, but + includes results from PT. - name: Array of names that will be used to name the series in responses. + name: Array of names used to label the series in the response. extra_headers: Send extra headers diff --git a/src/cloudflare/types/radar/ai/bots/summary_user_agent_params.py b/src/cloudflare/types/radar/ai/bots/summary_user_agent_params.py index c9c5d2a8a7d..c3b19ac96e6 100644 --- a/src/cloudflare/types/radar/ai/bots/summary_user_agent_params.py +++ b/src/cloudflare/types/radar/ai/bots/summary_user_agent_params.py @@ -13,49 +13,50 @@ class SummaryUserAgentParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. """ location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/ai/inference/summary_model_params.py b/src/cloudflare/types/radar/ai/inference/summary_model_params.py index 4c64260d54e..5ba87e45e11 100644 --- a/src/cloudflare/types/radar/ai/inference/summary_model_params.py +++ b/src/cloudflare/types/radar/ai/inference/summary_model_params.py @@ -16,25 +16,26 @@ class SummaryModelParams(TypedDict, total=False): """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/ai/inference/summary_task_params.py b/src/cloudflare/types/radar/ai/inference/summary_task_params.py index 95c3d7c5001..bb1b07e5cb2 100644 --- a/src/cloudflare/types/radar/ai/inference/summary_task_params.py +++ b/src/cloudflare/types/radar/ai/inference/summary_task_params.py @@ -16,25 +16,26 @@ class SummaryTaskParams(TypedDict, total=False): """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_model_params.py b/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_model_params.py index 15e67216fa4..0e1abaf0eb4 100644 --- a/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_model_params.py +++ b/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_model_params.py @@ -23,25 +23,26 @@ class SummaryModelParams(TypedDict, total=False): """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_task_params.py b/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_task_params.py index 454700028ef..64d01e558d1 100644 --- a/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_task_params.py +++ b/src/cloudflare/types/radar/ai/inference/timeseries_groups/summary_task_params.py @@ -23,25 +23,26 @@ class SummaryTaskParams(TypedDict, total=False): """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/ai/timeseries_group_user_agent_params.py b/src/cloudflare/types/radar/ai/timeseries_group_user_agent_params.py index 2872b380571..d3ff896bb48 100644 --- a/src/cloudflare/types/radar/ai/timeseries_group_user_agent_params.py +++ b/src/cloudflare/types/radar/ai/timeseries_group_user_agent_params.py @@ -20,49 +20,50 @@ class TimeseriesGroupUserAgentParams(TypedDict, total=False): """ asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. """ location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/annotation_list_params.py b/src/cloudflare/types/radar/annotation_list_params.py index 884c4c007d0..cce0763a000 100644 --- a/src/cloudflare/types/radar/annotation_list_params.py +++ b/src/cloudflare/types/radar/annotation_list_params.py @@ -13,7 +13,7 @@ class AnnotationListParams(TypedDict, total=False): asn: int - """Single ASN as integer.""" + """Single Autonomous System Number (ASN) as integer.""" date_end: Annotated[Union[str, datetime], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" @@ -28,13 +28,13 @@ class AnnotationListParams(TypedDict, total=False): """Start of the date range (inclusive).""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: str - """Location Alpha2 code.""" + """Location alpha-2 code.""" offset: int - """Number of objects to skip before grabbing results.""" + """Skips the specified number of objects before fetching the results.""" diff --git a/src/cloudflare/types/radar/annotations/outage_get_params.py b/src/cloudflare/types/radar/annotations/outage_get_params.py index 23df4113305..4b233de61dc 100644 --- a/src/cloudflare/types/radar/annotations/outage_get_params.py +++ b/src/cloudflare/types/radar/annotations/outage_get_params.py @@ -13,7 +13,7 @@ class OutageGetParams(TypedDict, total=False): asn: int - """Single ASN as integer.""" + """Single Autonomous System Number (ASN) as integer.""" date_end: Annotated[Union[str, datetime], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" @@ -28,13 +28,13 @@ class OutageGetParams(TypedDict, total=False): """Start of the date range (inclusive).""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: str - """Location Alpha2 code.""" + """Location alpha-2 code.""" offset: int - """Number of objects to skip before grabbing results.""" + """Skips the specified number of objects before fetching the results.""" diff --git a/src/cloudflare/types/radar/annotations/outage_locations_params.py b/src/cloudflare/types/radar/annotations/outage_locations_params.py index 51ae0778681..ae2cb30dab3 100644 --- a/src/cloudflare/types/radar/annotations/outage_locations_params.py +++ b/src/cloudflare/types/radar/annotations/outage_locations_params.py @@ -25,7 +25,7 @@ class OutageLocationsParams(TypedDict, total=False): """Start of the date range (inclusive).""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" diff --git a/src/cloudflare/types/radar/as112/summary_dnssec_params.py b/src/cloudflare/types/radar/as112/summary_dnssec_params.py index df69e836284..e85c9620edc 100644 --- a/src/cloudflare/types/radar/as112/summary_dnssec_params.py +++ b/src/cloudflare/types/radar/as112/summary_dnssec_params.py @@ -13,41 +13,42 @@ class SummaryDNSSECParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/as112/summary_edns_params.py b/src/cloudflare/types/radar/as112/summary_edns_params.py index aa8cb759564..beea6363f97 100644 --- a/src/cloudflare/types/radar/as112/summary_edns_params.py +++ b/src/cloudflare/types/radar/as112/summary_edns_params.py @@ -13,41 +13,42 @@ class SummaryEdnsParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/as112/summary_ip_version_params.py b/src/cloudflare/types/radar/as112/summary_ip_version_params.py index edf5caac4ef..7181e6a9542 100644 --- a/src/cloudflare/types/radar/as112/summary_ip_version_params.py +++ b/src/cloudflare/types/radar/as112/summary_ip_version_params.py @@ -13,41 +13,42 @@ class SummaryIPVersionParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/as112/summary_protocol_params.py b/src/cloudflare/types/radar/as112/summary_protocol_params.py index bfe7e77315b..1ca3107bcad 100644 --- a/src/cloudflare/types/radar/as112/summary_protocol_params.py +++ b/src/cloudflare/types/radar/as112/summary_protocol_params.py @@ -13,41 +13,42 @@ class SummaryProtocolParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/as112/summary_query_type_params.py b/src/cloudflare/types/radar/as112/summary_query_type_params.py index cf165b13dc5..61b5dbbf095 100644 --- a/src/cloudflare/types/radar/as112/summary_query_type_params.py +++ b/src/cloudflare/types/radar/as112/summary_query_type_params.py @@ -13,49 +13,50 @@ class SummaryQueryTypeParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. """ location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/as112/summary_response_codes_params.py b/src/cloudflare/types/radar/as112/summary_response_codes_params.py index 8408087e475..4e0ebd3d0b4 100644 --- a/src/cloudflare/types/radar/as112/summary_response_codes_params.py +++ b/src/cloudflare/types/radar/as112/summary_response_codes_params.py @@ -13,49 +13,50 @@ class SummaryResponseCodesParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. """ location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/as112/timeseries_group_dnssec_params.py b/src/cloudflare/types/radar/as112/timeseries_group_dnssec_params.py index d818ce2ddf2..e15ffb2bf11 100644 --- a/src/cloudflare/types/radar/as112/timeseries_group_dnssec_params.py +++ b/src/cloudflare/types/radar/as112/timeseries_group_dnssec_params.py @@ -20,41 +20,42 @@ class TimeseriesGroupDNSSECParams(TypedDict, total=False): """ asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/as112/timeseries_group_edns_params.py b/src/cloudflare/types/radar/as112/timeseries_group_edns_params.py index cde360d1e43..5aa1ec39e40 100644 --- a/src/cloudflare/types/radar/as112/timeseries_group_edns_params.py +++ b/src/cloudflare/types/radar/as112/timeseries_group_edns_params.py @@ -20,41 +20,42 @@ class TimeseriesGroupEdnsParams(TypedDict, total=False): """ asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/as112/timeseries_group_ip_version_params.py b/src/cloudflare/types/radar/as112/timeseries_group_ip_version_params.py index 54f655692fb..355582109a6 100644 --- a/src/cloudflare/types/radar/as112/timeseries_group_ip_version_params.py +++ b/src/cloudflare/types/radar/as112/timeseries_group_ip_version_params.py @@ -20,41 +20,42 @@ class TimeseriesGroupIPVersionParams(TypedDict, total=False): """ asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/as112/timeseries_group_protocol_params.py b/src/cloudflare/types/radar/as112/timeseries_group_protocol_params.py index deb737e61b1..fb7b9eb574c 100644 --- a/src/cloudflare/types/radar/as112/timeseries_group_protocol_params.py +++ b/src/cloudflare/types/radar/as112/timeseries_group_protocol_params.py @@ -20,41 +20,42 @@ class TimeseriesGroupProtocolParams(TypedDict, total=False): """ asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/as112/timeseries_group_query_type_params.py b/src/cloudflare/types/radar/as112/timeseries_group_query_type_params.py index e8223ad7587..0562fa3785e 100644 --- a/src/cloudflare/types/radar/as112/timeseries_group_query_type_params.py +++ b/src/cloudflare/types/radar/as112/timeseries_group_query_type_params.py @@ -20,49 +20,50 @@ class TimeseriesGroupQueryTypeParams(TypedDict, total=False): """ asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. """ location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/as112/timeseries_group_response_codes_params.py b/src/cloudflare/types/radar/as112/timeseries_group_response_codes_params.py index f1377b2ca94..7d78e79b65a 100644 --- a/src/cloudflare/types/radar/as112/timeseries_group_response_codes_params.py +++ b/src/cloudflare/types/radar/as112/timeseries_group_response_codes_params.py @@ -20,49 +20,50 @@ class TimeseriesGroupResponseCodesParams(TypedDict, total=False): """ asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. """ location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/as112/top_dnssec_params.py b/src/cloudflare/types/radar/as112/top_dnssec_params.py index 9f46b8ec011..e3c10d7a312 100644 --- a/src/cloudflare/types/radar/as112/top_dnssec_params.py +++ b/src/cloudflare/types/radar/as112/top_dnssec_params.py @@ -13,44 +13,45 @@ class TopDNSSECParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/as112/top_edns_params.py b/src/cloudflare/types/radar/as112/top_edns_params.py index 046c0d251b6..4505e90325e 100644 --- a/src/cloudflare/types/radar/as112/top_edns_params.py +++ b/src/cloudflare/types/radar/as112/top_edns_params.py @@ -13,44 +13,45 @@ class TopEdnsParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/as112/top_ip_version_params.py b/src/cloudflare/types/radar/as112/top_ip_version_params.py index 18ff8eb6a9b..eae79b17012 100644 --- a/src/cloudflare/types/radar/as112/top_ip_version_params.py +++ b/src/cloudflare/types/radar/as112/top_ip_version_params.py @@ -13,44 +13,45 @@ class TopIPVersionParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/as112/top_locations_params.py b/src/cloudflare/types/radar/as112/top_locations_params.py index 74b6631d0b9..8bcca93a00b 100644 --- a/src/cloudflare/types/radar/as112/top_locations_params.py +++ b/src/cloudflare/types/radar/as112/top_locations_params.py @@ -13,44 +13,45 @@ class TopLocationsParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/as112_timeseries_params.py b/src/cloudflare/types/radar/as112_timeseries_params.py index c2e37c6ce35..74cd6477b4e 100644 --- a/src/cloudflare/types/radar/as112_timeseries_params.py +++ b/src/cloudflare/types/radar/as112_timeseries_params.py @@ -20,41 +20,42 @@ class AS112TimeseriesParams(TypedDict, total=False): """ asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/attacks/layer3/summary_bitrate_params.py b/src/cloudflare/types/radar/attacks/layer3/summary_bitrate_params.py index b4d0b88d8fb..5870dc85ffa 100644 --- a/src/cloudflare/types/radar/attacks/layer3/summary_bitrate_params.py +++ b/src/cloudflare/types/radar/attacks/layer3/summary_bitrate_params.py @@ -13,24 +13,25 @@ class SummaryBitrateParams(TypedDict, total=False): continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" direction: Literal["ORIGIN", "TARGET"] """ @@ -39,20 +40,20 @@ class SummaryBitrateParams(TypedDict, total=False): """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] """Array of L3/4 attack types.""" diff --git a/src/cloudflare/types/radar/attacks/layer3/summary_duration_params.py b/src/cloudflare/types/radar/attacks/layer3/summary_duration_params.py index 615fe97285f..a7b9924330d 100644 --- a/src/cloudflare/types/radar/attacks/layer3/summary_duration_params.py +++ b/src/cloudflare/types/radar/attacks/layer3/summary_duration_params.py @@ -13,24 +13,25 @@ class SummaryDurationParams(TypedDict, total=False): continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" direction: Literal["ORIGIN", "TARGET"] """ @@ -39,20 +40,20 @@ class SummaryDurationParams(TypedDict, total=False): """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] """Array of L3/4 attack types.""" diff --git a/src/cloudflare/types/radar/attacks/layer3/summary_ip_version_params.py b/src/cloudflare/types/radar/attacks/layer3/summary_ip_version_params.py index b1ab3c41730..672a96d01a6 100644 --- a/src/cloudflare/types/radar/attacks/layer3/summary_ip_version_params.py +++ b/src/cloudflare/types/radar/attacks/layer3/summary_ip_version_params.py @@ -13,24 +13,25 @@ class SummaryIPVersionParams(TypedDict, total=False): continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" direction: Literal["ORIGIN", "TARGET"] """ @@ -39,17 +40,17 @@ class SummaryIPVersionParams(TypedDict, total=False): """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] """Array of L3/4 attack types.""" diff --git a/src/cloudflare/types/radar/attacks/layer3/summary_protocol_params.py b/src/cloudflare/types/radar/attacks/layer3/summary_protocol_params.py index f3c6e1f2d4e..55df6c13b3c 100644 --- a/src/cloudflare/types/radar/attacks/layer3/summary_protocol_params.py +++ b/src/cloudflare/types/radar/attacks/layer3/summary_protocol_params.py @@ -13,24 +13,25 @@ class SummaryProtocolParams(TypedDict, total=False): continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" direction: Literal["ORIGIN", "TARGET"] """ @@ -39,17 +40,17 @@ class SummaryProtocolParams(TypedDict, total=False): """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/attacks/layer3/summary_vector_params.py b/src/cloudflare/types/radar/attacks/layer3/summary_vector_params.py index 6b5744619ee..0b26e85f3e4 100644 --- a/src/cloudflare/types/radar/attacks/layer3/summary_vector_params.py +++ b/src/cloudflare/types/radar/attacks/layer3/summary_vector_params.py @@ -13,24 +13,25 @@ class SummaryVectorParams(TypedDict, total=False): continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" direction: Literal["ORIGIN", "TARGET"] """ @@ -39,28 +40,28 @@ class SummaryVectorParams(TypedDict, total=False): """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. """ location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] """Array of L3/4 attack types.""" diff --git a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_bitrate_params.py b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_bitrate_params.py index 9ef70e178ad..606fd938b33 100644 --- a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_bitrate_params.py +++ b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_bitrate_params.py @@ -20,24 +20,25 @@ class TimeseriesGroupBitrateParams(TypedDict, total=False): """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" direction: Literal["ORIGIN", "TARGET"] """ @@ -46,20 +47,20 @@ class TimeseriesGroupBitrateParams(TypedDict, total=False): """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" normalization: Literal["PERCENTAGE", "MIN0_MAX"] """Normalization method applied. diff --git a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_duration_params.py b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_duration_params.py index 0ac1f04ea12..92584ab488a 100644 --- a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_duration_params.py +++ b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_duration_params.py @@ -20,24 +20,25 @@ class TimeseriesGroupDurationParams(TypedDict, total=False): """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" direction: Literal["ORIGIN", "TARGET"] """ @@ -46,20 +47,20 @@ class TimeseriesGroupDurationParams(TypedDict, total=False): """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" normalization: Literal["PERCENTAGE", "MIN0_MAX"] """Normalization method applied. diff --git a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_industry_params.py b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_industry_params.py index 515faeaacb9..a6784a97974 100644 --- a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_industry_params.py +++ b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_industry_params.py @@ -20,24 +20,25 @@ class TimeseriesGroupIndustryParams(TypedDict, total=False): """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" direction: Literal["ORIGIN", "TARGET"] """ @@ -46,28 +47,28 @@ class TimeseriesGroupIndustryParams(TypedDict, total=False): """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. """ location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" normalization: Literal["PERCENTAGE", "MIN0_MAX"] """Normalization method applied. diff --git a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_ip_version_params.py b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_ip_version_params.py index 5f8b50a1f23..ec100f21090 100644 --- a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_ip_version_params.py +++ b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_ip_version_params.py @@ -20,24 +20,25 @@ class TimeseriesGroupIPVersionParams(TypedDict, total=False): """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" direction: Literal["ORIGIN", "TARGET"] """ @@ -46,17 +47,17 @@ class TimeseriesGroupIPVersionParams(TypedDict, total=False): """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" normalization: Literal["PERCENTAGE", "MIN0_MAX"] """Normalization method applied. diff --git a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_protocol_params.py b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_protocol_params.py index c96f496eb67..95b2acf43de 100644 --- a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_protocol_params.py +++ b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_protocol_params.py @@ -20,24 +20,25 @@ class TimeseriesGroupProtocolParams(TypedDict, total=False): """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" direction: Literal["ORIGIN", "TARGET"] """ @@ -46,20 +47,20 @@ class TimeseriesGroupProtocolParams(TypedDict, total=False): """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" normalization: Literal["PERCENTAGE", "MIN0_MAX"] """Normalization method applied. diff --git a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_vector_params.py b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_vector_params.py index fbaa2b94630..80e79d2bf05 100644 --- a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_vector_params.py +++ b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_vector_params.py @@ -20,24 +20,25 @@ class TimeseriesGroupVectorParams(TypedDict, total=False): """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" direction: Literal["ORIGIN", "TARGET"] """ @@ -46,28 +47,28 @@ class TimeseriesGroupVectorParams(TypedDict, total=False): """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. """ location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" normalization: Literal["PERCENTAGE", "MIN0_MAX"] """Normalization method applied. diff --git a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_vertical_params.py b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_vertical_params.py index d743ba599a2..4e03a094b5f 100644 --- a/src/cloudflare/types/radar/attacks/layer3/timeseries_group_vertical_params.py +++ b/src/cloudflare/types/radar/attacks/layer3/timeseries_group_vertical_params.py @@ -20,24 +20,25 @@ class TimeseriesGroupVerticalParams(TypedDict, total=False): """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" direction: Literal["ORIGIN", "TARGET"] """ @@ -46,28 +47,28 @@ class TimeseriesGroupVerticalParams(TypedDict, total=False): """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. """ location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" normalization: Literal["PERCENTAGE", "MIN0_MAX"] """Normalization method applied. diff --git a/src/cloudflare/types/radar/attacks/layer3/top/location_origin_params.py b/src/cloudflare/types/radar/attacks/layer3/top/location_origin_params.py index 06ae05b878d..0617eb0b497 100644 --- a/src/cloudflare/types/radar/attacks/layer3/top/location_origin_params.py +++ b/src/cloudflare/types/radar/attacks/layer3/top/location_origin_params.py @@ -13,43 +13,44 @@ class LocationOriginParams(TypedDict, total=False): continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] """Array of L3/4 attack types.""" diff --git a/src/cloudflare/types/radar/attacks/layer3/top/location_target_params.py b/src/cloudflare/types/radar/attacks/layer3/top/location_target_params.py index 4b1f0a0e41d..08bceffaacd 100644 --- a/src/cloudflare/types/radar/attacks/layer3/top/location_target_params.py +++ b/src/cloudflare/types/radar/attacks/layer3/top/location_target_params.py @@ -13,43 +13,44 @@ class LocationTargetParams(TypedDict, total=False): continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] """Array of L3/4 attack types.""" diff --git a/src/cloudflare/types/radar/attacks/layer3/top_attacks_params.py b/src/cloudflare/types/radar/attacks/layer3/top_attacks_params.py index a93d37a6324..e9a3ac145dc 100644 --- a/src/cloudflare/types/radar/attacks/layer3/top_attacks_params.py +++ b/src/cloudflare/types/radar/attacks/layer3/top_attacks_params.py @@ -13,33 +13,34 @@ class TopAttacksParams(TypedDict, total=False): continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" limit_direction: Annotated[Literal["ORIGIN", "TARGET"], PropertyInfo(alias="limitDirection")] """Array of attack origin/target location attack limits. @@ -50,19 +51,25 @@ class TopAttacksParams(TypedDict, total=False): limit_per_location: Annotated[int, PropertyInfo(alias="limitPerLocation")] """ - Limit the number of attacks per origin/target (refer to `limitDirection` + Limits the number of attacks per origin/target (refer to `limitDirection` parameter) location. """ location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + """ + + magnitude: Literal["MITIGATED_BYTES", "MITIGATED_ATTACKS"] + """ + Attack magnitude can be defined by total mitigated bytes or by total mitigated + attacks. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" normalization: Literal["PERCENTAGE", "MIN_MAX"] """Normalization method applied. diff --git a/src/cloudflare/types/radar/attacks/layer3/top_industry_params.py b/src/cloudflare/types/radar/attacks/layer3/top_industry_params.py index 41360260afa..986cc889b8b 100644 --- a/src/cloudflare/types/radar/attacks/layer3/top_industry_params.py +++ b/src/cloudflare/types/radar/attacks/layer3/top_industry_params.py @@ -13,43 +13,44 @@ class TopIndustryParams(TypedDict, total=False): continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] """Array of L3/4 attack types.""" diff --git a/src/cloudflare/types/radar/attacks/layer3/top_vertical_params.py b/src/cloudflare/types/radar/attacks/layer3/top_vertical_params.py index d04759c7af9..19576209aa8 100644 --- a/src/cloudflare/types/radar/attacks/layer3/top_vertical_params.py +++ b/src/cloudflare/types/radar/attacks/layer3/top_vertical_params.py @@ -13,43 +13,44 @@ class TopVerticalParams(TypedDict, total=False): continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] """Array of L3/4 attack types.""" diff --git a/src/cloudflare/types/radar/attacks/layer3_timeseries_params.py b/src/cloudflare/types/radar/attacks/layer3_timeseries_params.py index 61c6eb22613..f934c657d3d 100644 --- a/src/cloudflare/types/radar/attacks/layer3_timeseries_params.py +++ b/src/cloudflare/types/radar/attacks/layer3_timeseries_params.py @@ -20,31 +20,32 @@ class Layer3TimeseriesParams(TypedDict, total=False): """ asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" direction: Literal["ORIGIN", "TARGET"] """ @@ -53,23 +54,23 @@ class Layer3TimeseriesParams(TypedDict, total=False): """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ metric: Literal["BYTES", "BYTES_OLD"] """Measurement units, eg. bytes.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] """Normalization method applied. diff --git a/src/cloudflare/types/radar/attacks/layer7/summary_http_method_params.py b/src/cloudflare/types/radar/attacks/layer7/summary_http_method_params.py index bbdab4eeeb2..1b4d91ca4ac 100644 --- a/src/cloudflare/types/radar/attacks/layer7/summary_http_method_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/summary_http_method_params.py @@ -13,54 +13,55 @@ class SummaryHTTPMethodParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. """ location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ mitigation_product: Annotated[ @@ -74,4 +75,4 @@ class SummaryHTTPMethodParams(TypedDict, total=False): """Array of L7 mitigation products.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/attacks/layer7/summary_http_version_params.py b/src/cloudflare/types/radar/attacks/layer7/summary_http_version_params.py index 7a900629d0f..b350058d8d1 100644 --- a/src/cloudflare/types/radar/attacks/layer7/summary_http_version_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/summary_http_version_params.py @@ -13,34 +13,35 @@ class SummaryHTTPVersionParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_method: Annotated[ List[ @@ -95,16 +96,16 @@ class SummaryHTTPVersionParams(TypedDict, total=False): ], PropertyInfo(alias="httpMethod"), ] - """Filter for http method.""" + """Filters results by HTTP method.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ mitigation_product: Annotated[ @@ -118,4 +119,4 @@ class SummaryHTTPVersionParams(TypedDict, total=False): """Array of L7 mitigation products.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/attacks/layer7/summary_ip_version_params.py b/src/cloudflare/types/radar/attacks/layer7/summary_ip_version_params.py index 9a7e6f3ccff..ccf528d9a2e 100644 --- a/src/cloudflare/types/radar/attacks/layer7/summary_ip_version_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/summary_ip_version_params.py @@ -13,34 +13,35 @@ class SummaryIPVersionParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_method: Annotated[ List[ @@ -95,16 +96,16 @@ class SummaryIPVersionParams(TypedDict, total=False): ], PropertyInfo(alias="httpMethod"), ] - """Filter for http method.""" + """Filters results by HTTP method.""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ mitigation_product: Annotated[ @@ -118,4 +119,4 @@ class SummaryIPVersionParams(TypedDict, total=False): """Array of L7 mitigation products.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/attacks/layer7/summary_managed_rules_params.py b/src/cloudflare/types/radar/attacks/layer7/summary_managed_rules_params.py index 7806a0a359f..43f7614a2a8 100644 --- a/src/cloudflare/types/radar/attacks/layer7/summary_managed_rules_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/summary_managed_rules_params.py @@ -13,34 +13,35 @@ class SummaryManagedRulesParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_method: Annotated[ List[ @@ -95,27 +96,27 @@ class SummaryManagedRulesParams(TypedDict, total=False): ], PropertyInfo(alias="httpMethod"), ] - """Filter for http method.""" + """Filters results by HTTP method.""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. """ location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ mitigation_product: Annotated[ @@ -129,4 +130,4 @@ class SummaryManagedRulesParams(TypedDict, total=False): """Array of L7 mitigation products.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/attacks/layer7/summary_mitigation_product_params.py b/src/cloudflare/types/radar/attacks/layer7/summary_mitigation_product_params.py index 4b27aa2249a..7c82f1cd77a 100644 --- a/src/cloudflare/types/radar/attacks/layer7/summary_mitigation_product_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/summary_mitigation_product_params.py @@ -13,34 +13,35 @@ class SummaryMitigationProductParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_method: Annotated[ List[ @@ -95,28 +96,28 @@ class SummaryMitigationProductParams(TypedDict, total=False): ], PropertyInfo(alias="httpMethod"), ] - """Filter for http method.""" + """Filters results by HTTP method.""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. """ location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_method_params.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_method_params.py index debc2ef8f21..6a096fe5052 100644 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_method_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_method_params.py @@ -20,54 +20,55 @@ class TimeseriesGroupHTTPMethodParams(TypedDict, total=False): """ asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. """ location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ mitigation_product: Annotated[ @@ -81,7 +82,7 @@ class TimeseriesGroupHTTPMethodParams(TypedDict, total=False): """Array of L7 mitigation products.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" normalization: Literal["PERCENTAGE", "MIN0_MAX"] """Normalization method applied. diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_version_params.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_version_params.py index f2c435b5132..26cba2ba13a 100644 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_version_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_http_version_params.py @@ -20,34 +20,35 @@ class TimeseriesGroupHTTPVersionParams(TypedDict, total=False): """ asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_method: Annotated[ List[ @@ -102,16 +103,16 @@ class TimeseriesGroupHTTPVersionParams(TypedDict, total=False): ], PropertyInfo(alias="httpMethod"), ] - """Filter for http method.""" + """Filters results by HTTP method.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ mitigation_product: Annotated[ @@ -125,7 +126,7 @@ class TimeseriesGroupHTTPVersionParams(TypedDict, total=False): """Array of L7 mitigation products.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" normalization: Literal["PERCENTAGE", "MIN0_MAX"] """Normalization method applied. diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_industry_params.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_industry_params.py index aa5b1132116..5918096479c 100644 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_industry_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_industry_params.py @@ -20,34 +20,35 @@ class TimeseriesGroupIndustryParams(TypedDict, total=False): """ asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_method: Annotated[ List[ @@ -102,27 +103,27 @@ class TimeseriesGroupIndustryParams(TypedDict, total=False): ], PropertyInfo(alias="httpMethod"), ] - """Filter for http method.""" + """Filters results by HTTP method.""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. """ location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ mitigation_product: Annotated[ @@ -136,7 +137,7 @@ class TimeseriesGroupIndustryParams(TypedDict, total=False): """Array of L7 mitigation products.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" normalization: Literal["PERCENTAGE", "MIN0_MAX"] """Normalization method applied. diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_ip_version_params.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_ip_version_params.py index dfeee4f83b4..5ff212f3550 100644 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_ip_version_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_ip_version_params.py @@ -20,34 +20,35 @@ class TimeseriesGroupIPVersionParams(TypedDict, total=False): """ asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_method: Annotated[ List[ @@ -102,16 +103,16 @@ class TimeseriesGroupIPVersionParams(TypedDict, total=False): ], PropertyInfo(alias="httpMethod"), ] - """Filter for http method.""" + """Filters results by HTTP method.""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ mitigation_product: Annotated[ @@ -125,7 +126,7 @@ class TimeseriesGroupIPVersionParams(TypedDict, total=False): """Array of L7 mitigation products.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" normalization: Literal["PERCENTAGE", "MIN0_MAX"] """Normalization method applied. diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_managed_rules_params.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_managed_rules_params.py index 1a5f1348cf7..477120ee018 100644 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_managed_rules_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_managed_rules_params.py @@ -20,34 +20,35 @@ class TimeseriesGroupManagedRulesParams(TypedDict, total=False): """ asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_method: Annotated[ List[ @@ -102,27 +103,27 @@ class TimeseriesGroupManagedRulesParams(TypedDict, total=False): ], PropertyInfo(alias="httpMethod"), ] - """Filter for http method.""" + """Filters results by HTTP method.""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. """ location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ mitigation_product: Annotated[ @@ -136,7 +137,7 @@ class TimeseriesGroupManagedRulesParams(TypedDict, total=False): """Array of L7 mitigation products.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" normalization: Literal["PERCENTAGE", "MIN0_MAX"] """Normalization method applied. diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_mitigation_product_params.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_mitigation_product_params.py index f3b8c35235e..68b64a0b58b 100644 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_mitigation_product_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_mitigation_product_params.py @@ -20,34 +20,35 @@ class TimeseriesGroupMitigationProductParams(TypedDict, total=False): """ asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_method: Annotated[ List[ @@ -102,31 +103,31 @@ class TimeseriesGroupMitigationProductParams(TypedDict, total=False): ], PropertyInfo(alias="httpMethod"), ] - """Filter for http method.""" + """Filters results by HTTP method.""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. """ location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" normalization: Literal["PERCENTAGE", "MIN0_MAX"] """Normalization method applied. diff --git a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_vertical_params.py b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_vertical_params.py index 6d44b7cfad4..624241930e9 100644 --- a/src/cloudflare/types/radar/attacks/layer7/timeseries_group_vertical_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/timeseries_group_vertical_params.py @@ -20,34 +20,35 @@ class TimeseriesGroupVerticalParams(TypedDict, total=False): """ asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_method: Annotated[ List[ @@ -102,27 +103,27 @@ class TimeseriesGroupVerticalParams(TypedDict, total=False): ], PropertyInfo(alias="httpMethod"), ] - """Filter for http method.""" + """Filters results by HTTP method.""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. """ location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ mitigation_product: Annotated[ @@ -136,7 +137,7 @@ class TimeseriesGroupVerticalParams(TypedDict, total=False): """Array of L7 mitigation products.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" normalization: Literal["PERCENTAGE", "MIN0_MAX"] """Normalization method applied. diff --git a/src/cloudflare/types/radar/attacks/layer7/top/ase_origin_params.py b/src/cloudflare/types/radar/attacks/layer7/top/ase_origin_params.py index 17099f3e08c..80a2ec7ed6d 100644 --- a/src/cloudflare/types/radar/attacks/layer7/top/ase_origin_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/top/ase_origin_params.py @@ -13,27 +13,28 @@ class AseOriginParams(TypedDict, total=False): continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_method: Annotated[ List[ @@ -88,22 +89,22 @@ class AseOriginParams(TypedDict, total=False): ], PropertyInfo(alias="httpMethod"), ] - """Filter for http method.""" + """Filters results by HTTP method.""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ mitigation_product: Annotated[ @@ -117,4 +118,4 @@ class AseOriginParams(TypedDict, total=False): """Array of L7 mitigation products.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/attacks/layer7/top/location_origin_params.py b/src/cloudflare/types/radar/attacks/layer7/top/location_origin_params.py index 58aa33984ac..259fe3fe817 100644 --- a/src/cloudflare/types/radar/attacks/layer7/top/location_origin_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/top/location_origin_params.py @@ -13,34 +13,35 @@ class LocationOriginParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_method: Annotated[ List[ @@ -95,16 +96,16 @@ class LocationOriginParams(TypedDict, total=False): ], PropertyInfo(alias="httpMethod"), ] - """Filter for http method.""" + """Filters results by HTTP method.""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" mitigation_product: Annotated[ List[ @@ -117,4 +118,4 @@ class LocationOriginParams(TypedDict, total=False): """Array of L7 mitigation products.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/attacks/layer7/top/location_target_params.py b/src/cloudflare/types/radar/attacks/layer7/top/location_target_params.py index 50a57bfe056..ba9cf22e5d2 100644 --- a/src/cloudflare/types/radar/attacks/layer7/top/location_target_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/top/location_target_params.py @@ -13,27 +13,28 @@ class LocationTargetParams(TypedDict, total=False): continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_method: Annotated[ List[ @@ -88,16 +89,16 @@ class LocationTargetParams(TypedDict, total=False): ], PropertyInfo(alias="httpMethod"), ] - """Filter for http method.""" + """Filters results by HTTP method.""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" mitigation_product: Annotated[ List[ @@ -110,4 +111,4 @@ class LocationTargetParams(TypedDict, total=False): """Array of L7 mitigation products.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/attacks/layer7/top_attacks_params.py b/src/cloudflare/types/radar/attacks/layer7/top_attacks_params.py index d735b60cb91..0b37953159b 100644 --- a/src/cloudflare/types/radar/attacks/layer7/top_attacks_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/top_attacks_params.py @@ -13,34 +13,35 @@ class TopAttacksParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_method: Annotated[ List[ @@ -95,16 +96,16 @@ class TopAttacksParams(TypedDict, total=False): ], PropertyInfo(alias="httpMethod"), ] - """Filter for http method.""" + """Filters results by HTTP method.""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" limit_direction: Annotated[Literal["ORIGIN", "TARGET"], PropertyInfo(alias="limitDirection")] """Array of attack origin/target location attack limits. @@ -115,15 +116,15 @@ class TopAttacksParams(TypedDict, total=False): limit_per_location: Annotated[int, PropertyInfo(alias="limitPerLocation")] """ - Limit the number of attacks per origin/target (refer to `limitDirection` + Limits the number of attacks per origin/target (refer to `limitDirection` parameter) location. """ location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ magnitude: Literal["AFFECTED_ZONES", "MITIGATED_REQUESTS"] @@ -143,7 +144,7 @@ class TopAttacksParams(TypedDict, total=False): """Array of L7 mitigation products.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" normalization: Literal["PERCENTAGE", "MIN_MAX"] """Normalization method applied. diff --git a/src/cloudflare/types/radar/attacks/layer7/top_industry_params.py b/src/cloudflare/types/radar/attacks/layer7/top_industry_params.py index 54c26d71680..8b00bdca991 100644 --- a/src/cloudflare/types/radar/attacks/layer7/top_industry_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/top_industry_params.py @@ -13,34 +13,35 @@ class TopIndustryParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_method: Annotated[ List[ @@ -95,22 +96,22 @@ class TopIndustryParams(TypedDict, total=False): ], PropertyInfo(alias="httpMethod"), ] - """Filter for http method.""" + """Filters results by HTTP method.""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ mitigation_product: Annotated[ @@ -124,4 +125,4 @@ class TopIndustryParams(TypedDict, total=False): """Array of L7 mitigation products.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/attacks/layer7/top_vertical_params.py b/src/cloudflare/types/radar/attacks/layer7/top_vertical_params.py index cb941de5c43..920afad3298 100644 --- a/src/cloudflare/types/radar/attacks/layer7/top_vertical_params.py +++ b/src/cloudflare/types/radar/attacks/layer7/top_vertical_params.py @@ -13,34 +13,35 @@ class TopVerticalParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_method: Annotated[ List[ @@ -95,22 +96,22 @@ class TopVerticalParams(TypedDict, total=False): ], PropertyInfo(alias="httpMethod"), ] - """Filter for http method.""" + """Filters results by HTTP method.""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ mitigation_product: Annotated[ @@ -124,4 +125,4 @@ class TopVerticalParams(TypedDict, total=False): """Array of L7 mitigation products.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/attacks/layer7_timeseries_params.py b/src/cloudflare/types/radar/attacks/layer7_timeseries_params.py index 1808607d48b..4d3af21b5cd 100644 --- a/src/cloudflare/types/radar/attacks/layer7_timeseries_params.py +++ b/src/cloudflare/types/radar/attacks/layer7_timeseries_params.py @@ -20,10 +20,10 @@ class Layer7TimeseriesParams(TypedDict, total=False): """ asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ attack: List[ @@ -32,27 +32,28 @@ class Layer7TimeseriesParams(TypedDict, total=False): """This field is deprecated, please use the new `mitigationProduct`.""" continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_method: Annotated[ List[ @@ -107,19 +108,19 @@ class Layer7TimeseriesParams(TypedDict, total=False): ], PropertyInfo(alias="httpMethod"), ] - """Filter for http method.""" + """Filters results by HTTP method.""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ mitigation_product: Annotated[ @@ -133,7 +134,7 @@ class Layer7TimeseriesParams(TypedDict, total=False): """Array of L7 mitigation products.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] """Normalization method applied. diff --git a/src/cloudflare/types/radar/bgp/hijacks/event_list_params.py b/src/cloudflare/types/radar/bgp/hijacks/event_list_params.py index 7433cf1aae5..aad07d56b79 100644 --- a/src/cloudflare/types/radar/bgp/hijacks/event_list_params.py +++ b/src/cloudflare/types/radar/bgp/hijacks/event_list_params.py @@ -25,40 +25,40 @@ class EventListParams(TypedDict, total=False): """Start of the date range (inclusive).""" event_id: Annotated[int, PropertyInfo(alias="eventId")] - """The unique identifier of a event""" + """The unique identifier of a event.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" hijacker_asn: Annotated[int, PropertyInfo(alias="hijackerAsn")] - """The potential hijacker AS of a BGP hijack event""" + """The potential hijacker AS of a BGP hijack event.""" involved_asn: Annotated[int, PropertyInfo(alias="involvedAsn")] - """The potential hijacker or victim AS of a BGP hijack event""" + """The potential hijacker or victim AS of a BGP hijack event.""" involved_country: Annotated[str, PropertyInfo(alias="involvedCountry")] - """The country code of the potential hijacker or victim AS of a BGP hijack event""" + """The country code of the potential hijacker or victim AS of a BGP hijack event.""" max_confidence: Annotated[int, PropertyInfo(alias="maxConfidence")] - """The maximum confidence score to filter events (1-4 low, 5-7 mid, 8+ high)""" + """The maximum confidence score to filter events (1-4 low, 5-7 mid, 8+ high).""" min_confidence: Annotated[int, PropertyInfo(alias="minConfidence")] - """The minimum confidence score to filter events (1-4 low, 5-7 mid, 8+ high)""" + """The minimum confidence score to filter events (1-4 low, 5-7 mid, 8+ high).""" page: int - """Current page number, starting from 1""" + """Current page number, starting from 1.""" per_page: int - """Number of entries per page""" + """Number of entries per page.""" prefix: str """Network prefix, IPv4 or IPv6.""" sort_by: Annotated[Literal["ID", "TIME", "CONFIDENCE"], PropertyInfo(alias="sortBy")] - """Sort events by field""" + """Sorts results by the specified field.""" sort_order: Annotated[Literal["ASC", "DESC"], PropertyInfo(alias="sortOrder")] - """Sort order""" + """Sort order.""" victim_asn: Annotated[int, PropertyInfo(alias="victimAsn")] - """The potential victim AS of a BGP hijack event""" + """The potential victim AS of a BGP hijack event.""" diff --git a/src/cloudflare/types/radar/bgp/ip_timeseries_params.py b/src/cloudflare/types/radar/bgp/ip_timeseries_params.py index 4eead42aca9..c383845aabb 100644 --- a/src/cloudflare/types/radar/bgp/ip_timeseries_params.py +++ b/src/cloudflare/types/radar/bgp/ip_timeseries_params.py @@ -13,36 +13,37 @@ class IPTimeseriesParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" include_delay: Annotated[bool, PropertyInfo(alias="includeDelay")] - """Include data delay meta information""" + """Include data delay meta information.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" location: List[str] - """Array of locations (alpha-2 country codes).""" + """Comma-separated list of locations (alpha-2 codes).""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/bgp/leaks/event_list_params.py b/src/cloudflare/types/radar/bgp/leaks/event_list_params.py index a9773f39dfa..66f7abde0b9 100644 --- a/src/cloudflare/types/radar/bgp/leaks/event_list_params.py +++ b/src/cloudflare/types/radar/bgp/leaks/event_list_params.py @@ -25,28 +25,28 @@ class EventListParams(TypedDict, total=False): """Start of the date range (inclusive).""" event_id: Annotated[int, PropertyInfo(alias="eventId")] - """The unique identifier of a event""" + """The unique identifier of a event.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" involved_asn: Annotated[int, PropertyInfo(alias="involvedAsn")] - """ASN that is causing or affected by a route leak event""" + """ASN that is causing or affected by a route leak event.""" involved_country: Annotated[str, PropertyInfo(alias="involvedCountry")] - """Country code of a involved ASN in a route leak event""" + """Country code of a involved ASN in a route leak event.""" leak_asn: Annotated[int, PropertyInfo(alias="leakAsn")] - """The leaking AS of a route leak event""" + """The leaking AS of a route leak event.""" page: int - """Current page number, starting from 1""" + """Current page number, starting from 1.""" per_page: int - """Number of entries per page""" + """Number of entries per page.""" sort_by: Annotated[Literal["ID", "LEAKS", "PEERS", "PREFIXES", "ORIGINS", "TIME"], PropertyInfo(alias="sortBy")] - """Sort events by field""" + """Sorts results by the specified field.""" sort_order: Annotated[Literal["ASC", "DESC"], PropertyInfo(alias="sortOrder")] - """Sort order""" + """Sort order.""" diff --git a/src/cloudflare/types/radar/bgp/route_ases_params.py b/src/cloudflare/types/radar/bgp/route_ases_params.py index 734a74168f0..5b7f3a62624 100644 --- a/src/cloudflare/types/radar/bgp/route_ases_params.py +++ b/src/cloudflare/types/radar/bgp/route_ases_params.py @@ -11,19 +11,19 @@ class RouteAsesParams(TypedDict, total=False): format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: str - """Location Alpha2 code.""" + """Location alpha-2 code.""" sort_by: Annotated[ Literal["cone", "pfxs", "ipv4", "ipv6", "rpki_valid", "rpki_invalid", "rpki_unknown"], PropertyInfo(alias="sortBy"), ] - """Return order results by given type""" + """Sorts results by the specified field.""" - sort_order: Annotated[Literal["asc", "desc"], PropertyInfo(alias="sortOrder")] - """Sort by value ascending or descending""" + sort_order: Annotated[Literal["ASC", "DESC"], PropertyInfo(alias="sortOrder")] + """Sort order.""" diff --git a/src/cloudflare/types/radar/bgp/route_moas_params.py b/src/cloudflare/types/radar/bgp/route_moas_params.py index 8bf9d86d6c6..eb1675105b4 100644 --- a/src/cloudflare/types/radar/bgp/route_moas_params.py +++ b/src/cloudflare/types/radar/bgp/route_moas_params.py @@ -9,13 +9,13 @@ class RouteMoasParams(TypedDict, total=False): format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" invalid_only: bool - """Lookup only RPKI invalid MOASes""" + """Lookup only RPKI invalid MOASes.""" origin: int - """Lookup MOASes originated by the given ASN""" + """Lookup MOASes originated by the given ASN.""" prefix: str """Network prefix, IPv4 or IPv6.""" diff --git a/src/cloudflare/types/radar/bgp/route_pfx2as_params.py b/src/cloudflare/types/radar/bgp/route_pfx2as_params.py index caa3a87e8b0..1e996832360 100644 --- a/src/cloudflare/types/radar/bgp/route_pfx2as_params.py +++ b/src/cloudflare/types/radar/bgp/route_pfx2as_params.py @@ -11,7 +11,7 @@ class RoutePfx2asParams(TypedDict, total=False): format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" longest_prefix_match: Annotated[bool, PropertyInfo(alias="longestPrefixMatch")] """Return only results with the longest prefix match for the given prefix. @@ -20,10 +20,10 @@ class RoutePfx2asParams(TypedDict, total=False): """ origin: int - """Lookup prefixes originated by the given ASN""" + """Lookup prefixes originated by the given ASN.""" prefix: str """Network prefix, IPv4 or IPv6.""" rpki_status: Annotated[Literal["VALID", "INVALID", "UNKNOWN"], PropertyInfo(alias="rpkiStatus")] - """Return only results with matching rpki status: valid, invalid or unknown""" + """Return only results with matching rpki status: valid, invalid or unknown.""" diff --git a/src/cloudflare/types/radar/bgp/route_stats_params.py b/src/cloudflare/types/radar/bgp/route_stats_params.py index 0cd7211c5b4..dc42ead7c26 100644 --- a/src/cloudflare/types/radar/bgp/route_stats_params.py +++ b/src/cloudflare/types/radar/bgp/route_stats_params.py @@ -9,10 +9,10 @@ class RouteStatsParams(TypedDict, total=False): asn: int - """Single ASN as integer.""" + """Single Autonomous System Number (ASN) as integer.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" location: str - """Location Alpha2 code.""" + """Location alpha-2 code.""" diff --git a/src/cloudflare/types/radar/bgp/top/ase_get_params.py b/src/cloudflare/types/radar/bgp/top/ase_get_params.py index 4073484c048..a388e94b804 100644 --- a/src/cloudflare/types/radar/bgp/top/ase_get_params.py +++ b/src/cloudflare/types/radar/bgp/top/ase_get_params.py @@ -13,33 +13,34 @@ class AseGetParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" prefix: List[str] """Array of BGP network prefixes.""" diff --git a/src/cloudflare/types/radar/bgp/top/ase_prefixes_params.py b/src/cloudflare/types/radar/bgp/top/ase_prefixes_params.py index c9c9492ee5c..b54a76cf9bb 100644 --- a/src/cloudflare/types/radar/bgp/top/ase_prefixes_params.py +++ b/src/cloudflare/types/radar/bgp/top/ase_prefixes_params.py @@ -12,7 +12,7 @@ class AsePrefixesParams(TypedDict, total=False): """Alpha-2 country code.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Maximum number of ASes to return""" + """Maximum number of ASes to return.""" diff --git a/src/cloudflare/types/radar/bgp/top_prefixes_params.py b/src/cloudflare/types/radar/bgp/top_prefixes_params.py index a73c20fb3c6..dd2e36b8629 100644 --- a/src/cloudflare/types/radar/bgp/top_prefixes_params.py +++ b/src/cloudflare/types/radar/bgp/top_prefixes_params.py @@ -13,33 +13,34 @@ class TopPrefixesParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" update_type: Annotated[List[Literal["ANNOUNCEMENT", "WITHDRAWAL"]], PropertyInfo(alias="updateType")] """Array of BGP update types.""" diff --git a/src/cloudflare/types/radar/bgp_timeseries_params.py b/src/cloudflare/types/radar/bgp_timeseries_params.py index df2ef13b543..b53c7a6acea 100644 --- a/src/cloudflare/types/radar/bgp_timeseries_params.py +++ b/src/cloudflare/types/radar/bgp_timeseries_params.py @@ -20,30 +20,31 @@ class BGPTimeseriesParams(TypedDict, total=False): """ asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" prefix: List[str] """Array of BGP network prefixes.""" diff --git a/src/cloudflare/types/radar/dataset_download_params.py b/src/cloudflare/types/radar/dataset_download_params.py index 6921739ca44..40aaab98d01 100644 --- a/src/cloudflare/types/radar/dataset_download_params.py +++ b/src/cloudflare/types/radar/dataset_download_params.py @@ -13,4 +13,4 @@ class DatasetDownloadParams(TypedDict, total=False): dataset_id: Required[Annotated[int, PropertyInfo(alias="datasetId")]] format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" diff --git a/src/cloudflare/types/radar/dataset_list_params.py b/src/cloudflare/types/radar/dataset_list_params.py index 9e2a161f36f..d1c779cec44 100644 --- a/src/cloudflare/types/radar/dataset_list_params.py +++ b/src/cloudflare/types/radar/dataset_list_params.py @@ -11,13 +11,13 @@ class DatasetListParams(TypedDict, total=False): dataset_type: Annotated[Literal["RANKING_BUCKET", "REPORT"], PropertyInfo(alias="datasetType")] - """Dataset type.""" + """Filters results by dataset type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" offset: int - """Number of objects to skip before grabbing results.""" + """Skips the specified number of objects before fetching the results.""" diff --git a/src/cloudflare/types/radar/dns/top_ases_params.py b/src/cloudflare/types/radar/dns/top_ases_params.py index 7cf911c139b..e35a22098d0 100644 --- a/src/cloudflare/types/radar/dns/top_ases_params.py +++ b/src/cloudflare/types/radar/dns/top_ases_params.py @@ -13,47 +13,48 @@ class TopAsesParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" domain: List[str] """Array of domain names.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/dns/top_locations_params.py b/src/cloudflare/types/radar/dns/top_locations_params.py index f6e3c2327d1..07260d9803a 100644 --- a/src/cloudflare/types/radar/dns/top_locations_params.py +++ b/src/cloudflare/types/radar/dns/top_locations_params.py @@ -13,47 +13,48 @@ class TopLocationsParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" domain: List[str] """Array of domain names.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/email/routing/summary_arc_params.py b/src/cloudflare/types/radar/email/routing/summary_arc_params.py index 58c3c121836..01121bb4d22 100644 --- a/src/cloudflare/types/radar/email/routing/summary_arc_params.py +++ b/src/cloudflare/types/radar/email/routing/summary_arc_params.py @@ -16,32 +16,36 @@ class SummaryARCParams(TypedDict, total=False): """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dkim: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dkim.""" + """Filters results by DKIM (DomainKeys Identified Mail) validation status.""" dmarc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dmarc.""" + """ + Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + """ encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] - """Filter for encrypted emails.""" + """Filters results by encryption status (encrypted vs. not-encrypted).""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" spf: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for spf.""" + """Filters results by SPF (Sender Policy Framework) validation status.""" diff --git a/src/cloudflare/types/radar/email/routing/summary_dkim_params.py b/src/cloudflare/types/radar/email/routing/summary_dkim_params.py index 19be324942f..fba82080156 100644 --- a/src/cloudflare/types/radar/email/routing/summary_dkim_params.py +++ b/src/cloudflare/types/radar/email/routing/summary_dkim_params.py @@ -13,35 +13,39 @@ class SummaryDKIMParams(TypedDict, total=False): arc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for arc (Authenticated Received Chain).""" + """Filters results by ARC (Authenticated Received Chain) validation.""" date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dmarc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dmarc.""" + """ + Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + """ encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] - """Filter for encrypted emails.""" + """Filters results by encryption status (encrypted vs. not-encrypted).""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" spf: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for spf.""" + """Filters results by SPF (Sender Policy Framework) validation status.""" diff --git a/src/cloudflare/types/radar/email/routing/summary_dmarc_params.py b/src/cloudflare/types/radar/email/routing/summary_dmarc_params.py index f356077e043..547ab98019d 100644 --- a/src/cloudflare/types/radar/email/routing/summary_dmarc_params.py +++ b/src/cloudflare/types/radar/email/routing/summary_dmarc_params.py @@ -13,35 +13,36 @@ class SummaryDMARCParams(TypedDict, total=False): arc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for arc (Authenticated Received Chain).""" + """Filters results by ARC (Authenticated Received Chain) validation.""" date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dkim: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dkim.""" + """Filters results by DKIM (DomainKeys Identified Mail) validation status.""" encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] - """Filter for encrypted emails.""" + """Filters results by encryption status (encrypted vs. not-encrypted).""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" spf: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for spf.""" + """Filters results by SPF (Sender Policy Framework) validation status.""" diff --git a/src/cloudflare/types/radar/email/routing/summary_encrypted_params.py b/src/cloudflare/types/radar/email/routing/summary_encrypted_params.py index b6553448171..b2c24903336 100644 --- a/src/cloudflare/types/radar/email/routing/summary_encrypted_params.py +++ b/src/cloudflare/types/radar/email/routing/summary_encrypted_params.py @@ -13,35 +13,39 @@ class SummaryEncryptedParams(TypedDict, total=False): arc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for arc (Authenticated Received Chain).""" + """Filters results by ARC (Authenticated Received Chain) validation.""" date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dkim: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dkim.""" + """Filters results by DKIM (DomainKeys Identified Mail) validation status.""" dmarc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dmarc.""" + """ + Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" spf: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for spf.""" + """Filters results by SPF (Sender Policy Framework) validation status.""" diff --git a/src/cloudflare/types/radar/email/routing/summary_ip_version_params.py b/src/cloudflare/types/radar/email/routing/summary_ip_version_params.py index a1e7d6396f4..cc76020acee 100644 --- a/src/cloudflare/types/radar/email/routing/summary_ip_version_params.py +++ b/src/cloudflare/types/radar/email/routing/summary_ip_version_params.py @@ -13,35 +13,39 @@ class SummaryIPVersionParams(TypedDict, total=False): arc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for arc (Authenticated Received Chain).""" + """Filters results by ARC (Authenticated Received Chain) validation.""" date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dkim: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dkim.""" + """Filters results by DKIM (DomainKeys Identified Mail) validation status.""" dmarc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dmarc.""" + """ + Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + """ encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] - """Filter for encrypted emails.""" + """Filters results by encryption status (encrypted vs. not-encrypted).""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" spf: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for spf.""" + """Filters results by SPF (Sender Policy Framework) validation status.""" diff --git a/src/cloudflare/types/radar/email/routing/summary_spf_params.py b/src/cloudflare/types/radar/email/routing/summary_spf_params.py index f594b1931b7..9cbfddceeb8 100644 --- a/src/cloudflare/types/radar/email/routing/summary_spf_params.py +++ b/src/cloudflare/types/radar/email/routing/summary_spf_params.py @@ -13,35 +13,39 @@ class SummarySPFParams(TypedDict, total=False): arc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for arc (Authenticated Received Chain).""" + """Filters results by ARC (Authenticated Received Chain) validation.""" date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dkim: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dkim.""" + """Filters results by DKIM (DomainKeys Identified Mail) validation status.""" dmarc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dmarc.""" + """ + Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + """ encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] - """Filter for encrypted emails.""" + """Filters results by encryption status (encrypted vs. not-encrypted).""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/email/routing/timeseries_group_arc_params.py b/src/cloudflare/types/radar/email/routing/timeseries_group_arc_params.py index 2c950448fe6..6acda04e889 100644 --- a/src/cloudflare/types/radar/email/routing/timeseries_group_arc_params.py +++ b/src/cloudflare/types/radar/email/routing/timeseries_group_arc_params.py @@ -23,32 +23,36 @@ class TimeseriesGroupARCParams(TypedDict, total=False): """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dkim: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dkim.""" + """Filters results by DKIM (DomainKeys Identified Mail) validation status.""" dmarc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dmarc.""" + """ + Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + """ encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] - """Filter for encrypted emails.""" + """Filters results by encryption status (encrypted vs. not-encrypted).""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" spf: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for spf.""" + """Filters results by SPF (Sender Policy Framework) validation status.""" diff --git a/src/cloudflare/types/radar/email/routing/timeseries_group_dkim_params.py b/src/cloudflare/types/radar/email/routing/timeseries_group_dkim_params.py index 28c98ab3c92..8a4f0c9c3ed 100644 --- a/src/cloudflare/types/radar/email/routing/timeseries_group_dkim_params.py +++ b/src/cloudflare/types/radar/email/routing/timeseries_group_dkim_params.py @@ -20,35 +20,39 @@ class TimeseriesGroupDKIMParams(TypedDict, total=False): """ arc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for arc (Authenticated Received Chain).""" + """Filters results by ARC (Authenticated Received Chain) validation.""" date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dmarc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dmarc.""" + """ + Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + """ encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] - """Filter for encrypted emails.""" + """Filters results by encryption status (encrypted vs. not-encrypted).""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" spf: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for spf.""" + """Filters results by SPF (Sender Policy Framework) validation status.""" diff --git a/src/cloudflare/types/radar/email/routing/timeseries_group_dmarc_params.py b/src/cloudflare/types/radar/email/routing/timeseries_group_dmarc_params.py index 71271e551db..7ca61476360 100644 --- a/src/cloudflare/types/radar/email/routing/timeseries_group_dmarc_params.py +++ b/src/cloudflare/types/radar/email/routing/timeseries_group_dmarc_params.py @@ -20,35 +20,36 @@ class TimeseriesGroupDMARCParams(TypedDict, total=False): """ arc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for arc (Authenticated Received Chain).""" + """Filters results by ARC (Authenticated Received Chain) validation.""" date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dkim: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dkim.""" + """Filters results by DKIM (DomainKeys Identified Mail) validation status.""" encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] - """Filter for encrypted emails.""" + """Filters results by encryption status (encrypted vs. not-encrypted).""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" spf: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for spf.""" + """Filters results by SPF (Sender Policy Framework) validation status.""" diff --git a/src/cloudflare/types/radar/email/routing/timeseries_group_encrypted_params.py b/src/cloudflare/types/radar/email/routing/timeseries_group_encrypted_params.py index 093524f3bbd..9070f8612b2 100644 --- a/src/cloudflare/types/radar/email/routing/timeseries_group_encrypted_params.py +++ b/src/cloudflare/types/radar/email/routing/timeseries_group_encrypted_params.py @@ -20,35 +20,39 @@ class TimeseriesGroupEncryptedParams(TypedDict, total=False): """ arc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for arc (Authenticated Received Chain).""" + """Filters results by ARC (Authenticated Received Chain) validation.""" date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dkim: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dkim.""" + """Filters results by DKIM (DomainKeys Identified Mail) validation status.""" dmarc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dmarc.""" + """ + Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" spf: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for spf.""" + """Filters results by SPF (Sender Policy Framework) validation status.""" diff --git a/src/cloudflare/types/radar/email/routing/timeseries_group_ip_version_params.py b/src/cloudflare/types/radar/email/routing/timeseries_group_ip_version_params.py index f264feafdc3..60ac1e092d2 100644 --- a/src/cloudflare/types/radar/email/routing/timeseries_group_ip_version_params.py +++ b/src/cloudflare/types/radar/email/routing/timeseries_group_ip_version_params.py @@ -20,35 +20,39 @@ class TimeseriesGroupIPVersionParams(TypedDict, total=False): """ arc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for arc (Authenticated Received Chain).""" + """Filters results by ARC (Authenticated Received Chain) validation.""" date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dkim: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dkim.""" + """Filters results by DKIM (DomainKeys Identified Mail) validation status.""" dmarc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dmarc.""" + """ + Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + """ encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] - """Filter for encrypted emails.""" + """Filters results by encryption status (encrypted vs. not-encrypted).""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" spf: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for spf.""" + """Filters results by SPF (Sender Policy Framework) validation status.""" diff --git a/src/cloudflare/types/radar/email/routing/timeseries_group_spf_params.py b/src/cloudflare/types/radar/email/routing/timeseries_group_spf_params.py index 22168b70e9f..d810dc31351 100644 --- a/src/cloudflare/types/radar/email/routing/timeseries_group_spf_params.py +++ b/src/cloudflare/types/radar/email/routing/timeseries_group_spf_params.py @@ -20,35 +20,39 @@ class TimeseriesGroupSPFParams(TypedDict, total=False): """ arc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for arc (Authenticated Received Chain).""" + """Filters results by ARC (Authenticated Received Chain) validation.""" date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dkim: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dkim.""" + """Filters results by DKIM (DomainKeys Identified Mail) validation status.""" dmarc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dmarc.""" + """ + Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + """ encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] - """Filter for encrypted emails.""" + """Filters results by encryption status (encrypted vs. not-encrypted).""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/email/security/summary_arc_params.py b/src/cloudflare/types/radar/email/security/summary_arc_params.py index b141a65af14..fc72001c27f 100644 --- a/src/cloudflare/types/radar/email/security/summary_arc_params.py +++ b/src/cloudflare/types/radar/email/security/summary_arc_params.py @@ -16,29 +16,33 @@ class SummaryARCParams(TypedDict, total=False): """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dkim: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dkim.""" + """Filters results by DKIM (DomainKeys Identified Mail) validation status.""" dmarc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dmarc.""" + """ + Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" spf: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for spf.""" + """Filters results by SPF (Sender Policy Framework) validation status.""" tls_version: Annotated[List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]], PropertyInfo(alias="tlsVersion")] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/email/security/summary_dkim_params.py b/src/cloudflare/types/radar/email/security/summary_dkim_params.py index f92d7545793..b701f8461ec 100644 --- a/src/cloudflare/types/radar/email/security/summary_dkim_params.py +++ b/src/cloudflare/types/radar/email/security/summary_dkim_params.py @@ -13,32 +13,36 @@ class SummaryDKIMParams(TypedDict, total=False): arc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for arc (Authenticated Received Chain).""" + """Filters results by ARC (Authenticated Received Chain) validation.""" date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dmarc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dmarc.""" + """ + Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" spf: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for spf.""" + """Filters results by SPF (Sender Policy Framework) validation status.""" tls_version: Annotated[List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]], PropertyInfo(alias="tlsVersion")] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/email/security/summary_dmarc_params.py b/src/cloudflare/types/radar/email/security/summary_dmarc_params.py index f31a3218ce0..ef0122462cd 100644 --- a/src/cloudflare/types/radar/email/security/summary_dmarc_params.py +++ b/src/cloudflare/types/radar/email/security/summary_dmarc_params.py @@ -13,32 +13,33 @@ class SummaryDMARCParams(TypedDict, total=False): arc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for arc (Authenticated Received Chain).""" + """Filters results by ARC (Authenticated Received Chain) validation.""" date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dkim: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dkim.""" + """Filters results by DKIM (DomainKeys Identified Mail) validation status.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" spf: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for spf.""" + """Filters results by SPF (Sender Policy Framework) validation status.""" tls_version: Annotated[List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]], PropertyInfo(alias="tlsVersion")] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/email/security/summary_malicious_params.py b/src/cloudflare/types/radar/email/security/summary_malicious_params.py index 432685036f3..06f1be09208 100644 --- a/src/cloudflare/types/radar/email/security/summary_malicious_params.py +++ b/src/cloudflare/types/radar/email/security/summary_malicious_params.py @@ -13,35 +13,39 @@ class SummaryMaliciousParams(TypedDict, total=False): arc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for arc (Authenticated Received Chain).""" + """Filters results by ARC (Authenticated Received Chain) validation.""" date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dkim: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dkim.""" + """Filters results by DKIM (DomainKeys Identified Mail) validation status.""" dmarc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dmarc.""" + """ + Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" spf: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for spf.""" + """Filters results by SPF (Sender Policy Framework) validation status.""" tls_version: Annotated[List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]], PropertyInfo(alias="tlsVersion")] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/email/security/summary_spam_params.py b/src/cloudflare/types/radar/email/security/summary_spam_params.py index bc535bf3aae..1a376419ccf 100644 --- a/src/cloudflare/types/radar/email/security/summary_spam_params.py +++ b/src/cloudflare/types/radar/email/security/summary_spam_params.py @@ -13,35 +13,39 @@ class SummarySpamParams(TypedDict, total=False): arc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for arc (Authenticated Received Chain).""" + """Filters results by ARC (Authenticated Received Chain) validation.""" date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dkim: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dkim.""" + """Filters results by DKIM (DomainKeys Identified Mail) validation status.""" dmarc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dmarc.""" + """ + Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" spf: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for spf.""" + """Filters results by SPF (Sender Policy Framework) validation status.""" tls_version: Annotated[List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]], PropertyInfo(alias="tlsVersion")] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/email/security/summary_spf_params.py b/src/cloudflare/types/radar/email/security/summary_spf_params.py index 43e4ba10cc7..7cb2e31bda2 100644 --- a/src/cloudflare/types/radar/email/security/summary_spf_params.py +++ b/src/cloudflare/types/radar/email/security/summary_spf_params.py @@ -13,32 +13,36 @@ class SummarySPFParams(TypedDict, total=False): arc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for arc (Authenticated Received Chain).""" + """Filters results by ARC (Authenticated Received Chain) validation.""" date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dkim: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dkim.""" + """Filters results by DKIM (DomainKeys Identified Mail) validation status.""" dmarc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dmarc.""" + """ + Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" tls_version: Annotated[List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]], PropertyInfo(alias="tlsVersion")] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/email/security/summary_spoof_params.py b/src/cloudflare/types/radar/email/security/summary_spoof_params.py index f82a3b58522..55ee62ba56b 100644 --- a/src/cloudflare/types/radar/email/security/summary_spoof_params.py +++ b/src/cloudflare/types/radar/email/security/summary_spoof_params.py @@ -13,35 +13,39 @@ class SummarySpoofParams(TypedDict, total=False): arc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for arc (Authenticated Received Chain).""" + """Filters results by ARC (Authenticated Received Chain) validation.""" date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dkim: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dkim.""" + """Filters results by DKIM (DomainKeys Identified Mail) validation status.""" dmarc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dmarc.""" + """ + Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" spf: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for spf.""" + """Filters results by SPF (Sender Policy Framework) validation status.""" tls_version: Annotated[List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]], PropertyInfo(alias="tlsVersion")] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/email/security/summary_threat_category_params.py b/src/cloudflare/types/radar/email/security/summary_threat_category_params.py index c38e50ac6b3..2a4f7cbc3b6 100644 --- a/src/cloudflare/types/radar/email/security/summary_threat_category_params.py +++ b/src/cloudflare/types/radar/email/security/summary_threat_category_params.py @@ -13,35 +13,39 @@ class SummaryThreatCategoryParams(TypedDict, total=False): arc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for arc (Authenticated Received Chain).""" + """Filters results by ARC (Authenticated Received Chain) validation.""" date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dkim: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dkim.""" + """Filters results by DKIM (DomainKeys Identified Mail) validation status.""" dmarc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dmarc.""" + """ + Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" spf: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for spf.""" + """Filters results by SPF (Sender Policy Framework) validation status.""" tls_version: Annotated[List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]], PropertyInfo(alias="tlsVersion")] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/email/security/summary_tls_version_params.py b/src/cloudflare/types/radar/email/security/summary_tls_version_params.py index 4d7362e138e..73303819e98 100644 --- a/src/cloudflare/types/radar/email/security/summary_tls_version_params.py +++ b/src/cloudflare/types/radar/email/security/summary_tls_version_params.py @@ -13,32 +13,36 @@ class SummaryTLSVersionParams(TypedDict, total=False): arc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for arc (Authenticated Received Chain).""" + """Filters results by ARC (Authenticated Received Chain) validation.""" date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dkim: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dkim.""" + """Filters results by DKIM (DomainKeys Identified Mail) validation status.""" dmarc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dmarc.""" + """ + Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" spf: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for spf.""" + """Filters results by SPF (Sender Policy Framework) validation status.""" diff --git a/src/cloudflare/types/radar/email/security/timeseries_group_arc_params.py b/src/cloudflare/types/radar/email/security/timeseries_group_arc_params.py index abc50a0d1c2..eba81a331e7 100644 --- a/src/cloudflare/types/radar/email/security/timeseries_group_arc_params.py +++ b/src/cloudflare/types/radar/email/security/timeseries_group_arc_params.py @@ -23,29 +23,33 @@ class TimeseriesGroupARCParams(TypedDict, total=False): """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dkim: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dkim.""" + """Filters results by DKIM (DomainKeys Identified Mail) validation status.""" dmarc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dmarc.""" + """ + Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" spf: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for spf.""" + """Filters results by SPF (Sender Policy Framework) validation status.""" tls_version: Annotated[List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]], PropertyInfo(alias="tlsVersion")] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/email/security/timeseries_group_dkim_params.py b/src/cloudflare/types/radar/email/security/timeseries_group_dkim_params.py index 25f67103fbc..0738ba57903 100644 --- a/src/cloudflare/types/radar/email/security/timeseries_group_dkim_params.py +++ b/src/cloudflare/types/radar/email/security/timeseries_group_dkim_params.py @@ -20,32 +20,36 @@ class TimeseriesGroupDKIMParams(TypedDict, total=False): """ arc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for arc (Authenticated Received Chain).""" + """Filters results by ARC (Authenticated Received Chain) validation.""" date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dmarc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dmarc.""" + """ + Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" spf: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for spf.""" + """Filters results by SPF (Sender Policy Framework) validation status.""" tls_version: Annotated[List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]], PropertyInfo(alias="tlsVersion")] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/email/security/timeseries_group_dmarc_params.py b/src/cloudflare/types/radar/email/security/timeseries_group_dmarc_params.py index b6c44355beb..47445066fe1 100644 --- a/src/cloudflare/types/radar/email/security/timeseries_group_dmarc_params.py +++ b/src/cloudflare/types/radar/email/security/timeseries_group_dmarc_params.py @@ -20,32 +20,33 @@ class TimeseriesGroupDMARCParams(TypedDict, total=False): """ arc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for arc (Authenticated Received Chain).""" + """Filters results by ARC (Authenticated Received Chain) validation.""" date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dkim: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dkim.""" + """Filters results by DKIM (DomainKeys Identified Mail) validation status.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" spf: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for spf.""" + """Filters results by SPF (Sender Policy Framework) validation status.""" tls_version: Annotated[List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]], PropertyInfo(alias="tlsVersion")] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/email/security/timeseries_group_malicious_params.py b/src/cloudflare/types/radar/email/security/timeseries_group_malicious_params.py index 4fadea1473b..80425c7b7ff 100644 --- a/src/cloudflare/types/radar/email/security/timeseries_group_malicious_params.py +++ b/src/cloudflare/types/radar/email/security/timeseries_group_malicious_params.py @@ -20,35 +20,39 @@ class TimeseriesGroupMaliciousParams(TypedDict, total=False): """ arc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for arc (Authenticated Received Chain).""" + """Filters results by ARC (Authenticated Received Chain) validation.""" date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dkim: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dkim.""" + """Filters results by DKIM (DomainKeys Identified Mail) validation status.""" dmarc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dmarc.""" + """ + Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" spf: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for spf.""" + """Filters results by SPF (Sender Policy Framework) validation status.""" tls_version: Annotated[List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]], PropertyInfo(alias="tlsVersion")] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/email/security/timeseries_group_spam_params.py b/src/cloudflare/types/radar/email/security/timeseries_group_spam_params.py index cf290efb92d..3d28942799e 100644 --- a/src/cloudflare/types/radar/email/security/timeseries_group_spam_params.py +++ b/src/cloudflare/types/radar/email/security/timeseries_group_spam_params.py @@ -20,35 +20,39 @@ class TimeseriesGroupSpamParams(TypedDict, total=False): """ arc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for arc (Authenticated Received Chain).""" + """Filters results by ARC (Authenticated Received Chain) validation.""" date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dkim: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dkim.""" + """Filters results by DKIM (DomainKeys Identified Mail) validation status.""" dmarc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dmarc.""" + """ + Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" spf: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for spf.""" + """Filters results by SPF (Sender Policy Framework) validation status.""" tls_version: Annotated[List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]], PropertyInfo(alias="tlsVersion")] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/email/security/timeseries_group_spf_params.py b/src/cloudflare/types/radar/email/security/timeseries_group_spf_params.py index 02c8899e043..0961c1591f2 100644 --- a/src/cloudflare/types/radar/email/security/timeseries_group_spf_params.py +++ b/src/cloudflare/types/radar/email/security/timeseries_group_spf_params.py @@ -20,32 +20,36 @@ class TimeseriesGroupSPFParams(TypedDict, total=False): """ arc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for arc (Authenticated Received Chain).""" + """Filters results by ARC (Authenticated Received Chain) validation.""" date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dkim: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dkim.""" + """Filters results by DKIM (DomainKeys Identified Mail) validation status.""" dmarc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dmarc.""" + """ + Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" tls_version: Annotated[List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]], PropertyInfo(alias="tlsVersion")] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/email/security/timeseries_group_spoof_params.py b/src/cloudflare/types/radar/email/security/timeseries_group_spoof_params.py index 7192baec686..c7fbb651a90 100644 --- a/src/cloudflare/types/radar/email/security/timeseries_group_spoof_params.py +++ b/src/cloudflare/types/radar/email/security/timeseries_group_spoof_params.py @@ -20,35 +20,39 @@ class TimeseriesGroupSpoofParams(TypedDict, total=False): """ arc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for arc (Authenticated Received Chain).""" + """Filters results by ARC (Authenticated Received Chain) validation.""" date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dkim: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dkim.""" + """Filters results by DKIM (DomainKeys Identified Mail) validation status.""" dmarc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dmarc.""" + """ + Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" spf: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for spf.""" + """Filters results by SPF (Sender Policy Framework) validation status.""" tls_version: Annotated[List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]], PropertyInfo(alias="tlsVersion")] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/email/security/timeseries_group_threat_category_params.py b/src/cloudflare/types/radar/email/security/timeseries_group_threat_category_params.py index 2db3534a333..4cd60f87af6 100644 --- a/src/cloudflare/types/radar/email/security/timeseries_group_threat_category_params.py +++ b/src/cloudflare/types/radar/email/security/timeseries_group_threat_category_params.py @@ -20,35 +20,39 @@ class TimeseriesGroupThreatCategoryParams(TypedDict, total=False): """ arc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for arc (Authenticated Received Chain).""" + """Filters results by ARC (Authenticated Received Chain) validation.""" date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dkim: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dkim.""" + """Filters results by DKIM (DomainKeys Identified Mail) validation status.""" dmarc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dmarc.""" + """ + Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" spf: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for spf.""" + """Filters results by SPF (Sender Policy Framework) validation status.""" tls_version: Annotated[List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]], PropertyInfo(alias="tlsVersion")] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/email/security/timeseries_group_tls_version_params.py b/src/cloudflare/types/radar/email/security/timeseries_group_tls_version_params.py index 84a9ada0097..88f1f60e094 100644 --- a/src/cloudflare/types/radar/email/security/timeseries_group_tls_version_params.py +++ b/src/cloudflare/types/radar/email/security/timeseries_group_tls_version_params.py @@ -20,32 +20,36 @@ class TimeseriesGroupTLSVersionParams(TypedDict, total=False): """ arc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for arc (Authenticated Received Chain).""" + """Filters results by ARC (Authenticated Received Chain) validation.""" date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dkim: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dkim.""" + """Filters results by DKIM (DomainKeys Identified Mail) validation status.""" dmarc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dmarc.""" + """ + Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" spf: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for spf.""" + """Filters results by SPF (Sender Policy Framework) validation status.""" diff --git a/src/cloudflare/types/radar/email/security/top/tld_get_params.py b/src/cloudflare/types/radar/email/security/top/tld_get_params.py index 3921a4e597d..1b687eea07a 100644 --- a/src/cloudflare/types/radar/email/security/top/tld_get_params.py +++ b/src/cloudflare/types/radar/email/security/top/tld_get_params.py @@ -13,41 +13,45 @@ class TldGetParams(TypedDict, total=False): arc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for arc (Authenticated Received Chain).""" + """Filters results by ARC (Authenticated Received Chain) validation.""" date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dkim: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dkim.""" + """Filters results by DKIM (DomainKeys Identified Mail) validation status.""" dmarc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dmarc.""" + """ + Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" spf: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for spf.""" + """Filters results by SPF (Sender Policy Framework) validation status.""" tld_category: Annotated[Literal["CLASSIC", "COUNTRY"], PropertyInfo(alias="tldCategory")] - """Filter for TLDs by category.""" + """Filters results by TLD category.""" tls_version: Annotated[List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]], PropertyInfo(alias="tlsVersion")] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/email/security/top/tlds/malicious_get_params.py b/src/cloudflare/types/radar/email/security/top/tlds/malicious_get_params.py index e1cc9a0218f..e8943e4faf9 100644 --- a/src/cloudflare/types/radar/email/security/top/tlds/malicious_get_params.py +++ b/src/cloudflare/types/radar/email/security/top/tlds/malicious_get_params.py @@ -13,41 +13,45 @@ class MaliciousGetParams(TypedDict, total=False): arc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for arc (Authenticated Received Chain).""" + """Filters results by ARC (Authenticated Received Chain) validation.""" date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dkim: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dkim.""" + """Filters results by DKIM (DomainKeys Identified Mail) validation status.""" dmarc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dmarc.""" + """ + Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" spf: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for spf.""" + """Filters results by SPF (Sender Policy Framework) validation status.""" tld_category: Annotated[Literal["CLASSIC", "COUNTRY"], PropertyInfo(alias="tldCategory")] - """Filter for TLDs by category.""" + """Filters results by TLD category.""" tls_version: Annotated[List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]], PropertyInfo(alias="tlsVersion")] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/email/security/top/tlds/spam_get_params.py b/src/cloudflare/types/radar/email/security/top/tlds/spam_get_params.py index 69fbfba03d0..255241962d4 100644 --- a/src/cloudflare/types/radar/email/security/top/tlds/spam_get_params.py +++ b/src/cloudflare/types/radar/email/security/top/tlds/spam_get_params.py @@ -13,41 +13,45 @@ class SpamGetParams(TypedDict, total=False): arc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for arc (Authenticated Received Chain).""" + """Filters results by ARC (Authenticated Received Chain) validation.""" date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dkim: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dkim.""" + """Filters results by DKIM (DomainKeys Identified Mail) validation status.""" dmarc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dmarc.""" + """ + Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" spf: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for spf.""" + """Filters results by SPF (Sender Policy Framework) validation status.""" tld_category: Annotated[Literal["CLASSIC", "COUNTRY"], PropertyInfo(alias="tldCategory")] - """Filter for TLDs by category.""" + """Filters results by TLD category.""" tls_version: Annotated[List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]], PropertyInfo(alias="tlsVersion")] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/email/security/top/tlds/spoof_get_params.py b/src/cloudflare/types/radar/email/security/top/tlds/spoof_get_params.py index 5750c343985..b09086f72a0 100644 --- a/src/cloudflare/types/radar/email/security/top/tlds/spoof_get_params.py +++ b/src/cloudflare/types/radar/email/security/top/tlds/spoof_get_params.py @@ -13,41 +13,45 @@ class SpoofGetParams(TypedDict, total=False): arc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for arc (Authenticated Received Chain).""" + """Filters results by ARC (Authenticated Received Chain) validation.""" date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" dkim: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dkim.""" + """Filters results by DKIM (DomainKeys Identified Mail) validation status.""" dmarc: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for dmarc.""" + """ + Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + """ format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" spf: List[Literal["PASS", "NONE", "FAIL"]] - """Filter for spf.""" + """Filters results by SPF (Sender Policy Framework) validation status.""" tld_category: Annotated[Literal["CLASSIC", "COUNTRY"], PropertyInfo(alias="tldCategory")] - """Filter for TLDs by category.""" + """Filters results by TLD category.""" tls_version: Annotated[List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]], PropertyInfo(alias="tlsVersion")] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/entities/asn_get_params.py b/src/cloudflare/types/radar/entities/asn_get_params.py index c74a42d2517..9d039842992 100644 --- a/src/cloudflare/types/radar/entities/asn_get_params.py +++ b/src/cloudflare/types/radar/entities/asn_get_params.py @@ -9,4 +9,4 @@ class ASNGetParams(TypedDict, total=False): format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" diff --git a/src/cloudflare/types/radar/entities/asn_ip_params.py b/src/cloudflare/types/radar/entities/asn_ip_params.py index 11d8bfa9dd0..ff2e2207073 100644 --- a/src/cloudflare/types/radar/entities/asn_ip_params.py +++ b/src/cloudflare/types/radar/entities/asn_ip_params.py @@ -12,4 +12,4 @@ class ASNIPParams(TypedDict, total=False): """IP address.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" diff --git a/src/cloudflare/types/radar/entities/asn_list_params.py b/src/cloudflare/types/radar/entities/asn_list_params.py index 7c327f0ff78..fe3c05257c0 100644 --- a/src/cloudflare/types/radar/entities/asn_list_params.py +++ b/src/cloudflare/types/radar/entities/asn_list_params.py @@ -11,19 +11,19 @@ class ASNListParams(TypedDict, total=False): asn: str - """Comma separated list of ASNs.""" + """Comma-separated list of Autonomous System Numbers (ASNs).""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: str - """Location Alpha2 to filter results.""" + """Location alpha-2 code.""" offset: int - """Number of objects to skip before grabbing results.""" + """Skips the specified number of objects before fetching the results.""" order_by: Annotated[Literal["ASN", "POPULATION"], PropertyInfo(alias="orderBy")] - """Order asn list.""" + """Metric to order the ASNs by.""" diff --git a/src/cloudflare/types/radar/entities/asn_rel_params.py b/src/cloudflare/types/radar/entities/asn_rel_params.py index 500ad9c46a1..d4c89b89f13 100644 --- a/src/cloudflare/types/radar/entities/asn_rel_params.py +++ b/src/cloudflare/types/radar/entities/asn_rel_params.py @@ -9,7 +9,7 @@ class ASNRelParams(TypedDict, total=False): asn2: int - """Get the AS relationship of ASN2 with respect to the given ASN""" + """Retrieves the AS relationship of ASN2 with respect to the given ASN.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" diff --git a/src/cloudflare/types/radar/entities/location_get_params.py b/src/cloudflare/types/radar/entities/location_get_params.py index 7b90d15cbe3..f8b945c2fda 100644 --- a/src/cloudflare/types/radar/entities/location_get_params.py +++ b/src/cloudflare/types/radar/entities/location_get_params.py @@ -9,4 +9,4 @@ class LocationGetParams(TypedDict, total=False): format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" diff --git a/src/cloudflare/types/radar/entities/location_list_params.py b/src/cloudflare/types/radar/entities/location_list_params.py index 89e77d5625a..32d72642bdf 100644 --- a/src/cloudflare/types/radar/entities/location_list_params.py +++ b/src/cloudflare/types/radar/entities/location_list_params.py @@ -9,13 +9,13 @@ class LocationListParams(TypedDict, total=False): format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: str - """Comma separated list of locations.""" + """Comma-separated list of locations (alpha-2 location codes).""" offset: int - """Number of objects to skip before grabbing results.""" + """Skips the specified number of objects before fetching the results.""" diff --git a/src/cloudflare/types/radar/entity_get_params.py b/src/cloudflare/types/radar/entity_get_params.py index 1bd5c38fabe..cea577975c4 100644 --- a/src/cloudflare/types/radar/entity_get_params.py +++ b/src/cloudflare/types/radar/entity_get_params.py @@ -12,4 +12,4 @@ class EntityGetParams(TypedDict, total=False): """IP address.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" diff --git a/src/cloudflare/types/radar/http/ase_get_params.py b/src/cloudflare/types/radar/http/ase_get_params.py index 811464b10b0..42cd5f2a3a6 100644 --- a/src/cloudflare/types/radar/http/ase_get_params.py +++ b/src/cloudflare/types/radar/http/ase_get_params.py @@ -13,74 +13,75 @@ class AseGetParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ browser_family: Annotated[List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]], PropertyInfo(alias="browserFamily")] - """Filter for browser family.""" + """Filters results by browser family.""" continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/ases/bot_class_get_params.py b/src/cloudflare/types/radar/http/ases/bot_class_get_params.py index 59a823a180a..ee7fd0c6d5c 100644 --- a/src/cloudflare/types/radar/http/ases/bot_class_get_params.py +++ b/src/cloudflare/types/radar/http/ases/bot_class_get_params.py @@ -13,67 +13,68 @@ class BotClassGetParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ browser_family: Annotated[List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]], PropertyInfo(alias="browserFamily")] - """Filter for browser family.""" + """Filters results by browser family.""" continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/ases/browser_family_get_params.py b/src/cloudflare/types/radar/http/ases/browser_family_get_params.py index ed19fdee421..82d29344f6c 100644 --- a/src/cloudflare/types/radar/http/ases/browser_family_get_params.py +++ b/src/cloudflare/types/radar/http/ases/browser_family_get_params.py @@ -13,71 +13,72 @@ class BrowserFamilyGetParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/ases/device_type_get_params.py b/src/cloudflare/types/radar/http/ases/device_type_get_params.py index 43e1b06c821..0fa49773473 100644 --- a/src/cloudflare/types/radar/http/ases/device_type_get_params.py +++ b/src/cloudflare/types/radar/http/ases/device_type_get_params.py @@ -13,71 +13,72 @@ class DeviceTypeGetParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ browser_family: Annotated[List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]], PropertyInfo(alias="browserFamily")] - """Filter for browser family.""" + """Filters results by browser family.""" continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/ases/http_method_get_params.py b/src/cloudflare/types/radar/http/ases/http_method_get_params.py index fb227592965..5a35c809ac1 100644 --- a/src/cloudflare/types/radar/http/ases/http_method_get_params.py +++ b/src/cloudflare/types/radar/http/ases/http_method_get_params.py @@ -13,71 +13,72 @@ class HTTPMethodGetParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ browser_family: Annotated[List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]], PropertyInfo(alias="browserFamily")] - """Filter for browser family.""" + """Filters results by browser family.""" continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/ases/http_protocol_get_params.py b/src/cloudflare/types/radar/http/ases/http_protocol_get_params.py index 629a3b8d8c0..23095abe1db 100644 --- a/src/cloudflare/types/radar/http/ases/http_protocol_get_params.py +++ b/src/cloudflare/types/radar/http/ases/http_protocol_get_params.py @@ -13,68 +13,72 @@ class HTTPProtocolGetParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ browser_family: Annotated[List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]], PropertyInfo(alias="browserFamily")] - """Filter for browser family.""" + """Filters results by browser family.""" continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" + + http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/ases/ip_version_get_params.py b/src/cloudflare/types/radar/http/ases/ip_version_get_params.py index 86ababaa79a..7ebd38c5f84 100644 --- a/src/cloudflare/types/radar/http/ases/ip_version_get_params.py +++ b/src/cloudflare/types/radar/http/ases/ip_version_get_params.py @@ -13,71 +13,72 @@ class IPVersionGetParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ browser_family: Annotated[List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]], PropertyInfo(alias="browserFamily")] - """Filter for browser family.""" + """Filters results by browser family.""" continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/ases/os_get_params.py b/src/cloudflare/types/radar/http/ases/os_get_params.py index 12ac2d093b7..51802fbcb2c 100644 --- a/src/cloudflare/types/radar/http/ases/os_get_params.py +++ b/src/cloudflare/types/radar/http/ases/os_get_params.py @@ -13,71 +13,72 @@ class OSGetParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ browser_family: Annotated[List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]], PropertyInfo(alias="browserFamily")] - """Filter for browser family.""" + """Filters results by browser family.""" continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/ases/tls_version_get_params.py b/src/cloudflare/types/radar/http/ases/tls_version_get_params.py index 050045d800f..e69eadf0c26 100644 --- a/src/cloudflare/types/radar/http/ases/tls_version_get_params.py +++ b/src/cloudflare/types/radar/http/ases/tls_version_get_params.py @@ -13,69 +13,70 @@ class TLSVersionGetParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ browser_family: Annotated[List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]], PropertyInfo(alias="browserFamily")] - """Filter for browser family.""" + """Filters results by browser family.""" continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" diff --git a/src/cloudflare/types/radar/http/location_get_params.py b/src/cloudflare/types/radar/http/location_get_params.py index 1459dbe0e58..c7c6b500e22 100644 --- a/src/cloudflare/types/radar/http/location_get_params.py +++ b/src/cloudflare/types/radar/http/location_get_params.py @@ -13,74 +13,75 @@ class LocationGetParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ browser_family: Annotated[List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]], PropertyInfo(alias="browserFamily")] - """Filter for browser family.""" + """Filters results by browser family.""" continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/locations/bot_class_get_params.py b/src/cloudflare/types/radar/http/locations/bot_class_get_params.py index 59a823a180a..ee7fd0c6d5c 100644 --- a/src/cloudflare/types/radar/http/locations/bot_class_get_params.py +++ b/src/cloudflare/types/radar/http/locations/bot_class_get_params.py @@ -13,67 +13,68 @@ class BotClassGetParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ browser_family: Annotated[List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]], PropertyInfo(alias="browserFamily")] - """Filter for browser family.""" + """Filters results by browser family.""" continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/locations/browser_family_get_params.py b/src/cloudflare/types/radar/http/locations/browser_family_get_params.py index ed19fdee421..82d29344f6c 100644 --- a/src/cloudflare/types/radar/http/locations/browser_family_get_params.py +++ b/src/cloudflare/types/radar/http/locations/browser_family_get_params.py @@ -13,71 +13,72 @@ class BrowserFamilyGetParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/locations/device_type_get_params.py b/src/cloudflare/types/radar/http/locations/device_type_get_params.py index 43e1b06c821..0fa49773473 100644 --- a/src/cloudflare/types/radar/http/locations/device_type_get_params.py +++ b/src/cloudflare/types/radar/http/locations/device_type_get_params.py @@ -13,71 +13,72 @@ class DeviceTypeGetParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ browser_family: Annotated[List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]], PropertyInfo(alias="browserFamily")] - """Filter for browser family.""" + """Filters results by browser family.""" continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/locations/http_method_get_params.py b/src/cloudflare/types/radar/http/locations/http_method_get_params.py index fb227592965..5a35c809ac1 100644 --- a/src/cloudflare/types/radar/http/locations/http_method_get_params.py +++ b/src/cloudflare/types/radar/http/locations/http_method_get_params.py @@ -13,71 +13,72 @@ class HTTPMethodGetParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ browser_family: Annotated[List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]], PropertyInfo(alias="browserFamily")] - """Filter for browser family.""" + """Filters results by browser family.""" continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/locations/http_protocol_get_params.py b/src/cloudflare/types/radar/http/locations/http_protocol_get_params.py index 629a3b8d8c0..23095abe1db 100644 --- a/src/cloudflare/types/radar/http/locations/http_protocol_get_params.py +++ b/src/cloudflare/types/radar/http/locations/http_protocol_get_params.py @@ -13,68 +13,72 @@ class HTTPProtocolGetParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ browser_family: Annotated[List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]], PropertyInfo(alias="browserFamily")] - """Filter for browser family.""" + """Filters results by browser family.""" continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" + + http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/locations/ip_version_get_params.py b/src/cloudflare/types/radar/http/locations/ip_version_get_params.py index 86ababaa79a..7ebd38c5f84 100644 --- a/src/cloudflare/types/radar/http/locations/ip_version_get_params.py +++ b/src/cloudflare/types/radar/http/locations/ip_version_get_params.py @@ -13,71 +13,72 @@ class IPVersionGetParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ browser_family: Annotated[List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]], PropertyInfo(alias="browserFamily")] - """Filter for browser family.""" + """Filters results by browser family.""" continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/locations/os_get_params.py b/src/cloudflare/types/radar/http/locations/os_get_params.py index 12ac2d093b7..51802fbcb2c 100644 --- a/src/cloudflare/types/radar/http/locations/os_get_params.py +++ b/src/cloudflare/types/radar/http/locations/os_get_params.py @@ -13,71 +13,72 @@ class OSGetParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ browser_family: Annotated[List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]], PropertyInfo(alias="browserFamily")] - """Filter for browser family.""" + """Filters results by browser family.""" continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/locations/tls_version_get_params.py b/src/cloudflare/types/radar/http/locations/tls_version_get_params.py index 050045d800f..e69eadf0c26 100644 --- a/src/cloudflare/types/radar/http/locations/tls_version_get_params.py +++ b/src/cloudflare/types/radar/http/locations/tls_version_get_params.py @@ -13,69 +13,70 @@ class TLSVersionGetParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ browser_family: Annotated[List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]], PropertyInfo(alias="browserFamily")] - """Filter for browser family.""" + """Filters results by browser family.""" continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" diff --git a/src/cloudflare/types/radar/http/summary_bot_class_params.py b/src/cloudflare/types/radar/http/summary_bot_class_params.py index fcd244197a8..bcdb53eebf5 100644 --- a/src/cloudflare/types/radar/http/summary_bot_class_params.py +++ b/src/cloudflare/types/radar/http/summary_bot_class_params.py @@ -13,61 +13,62 @@ class SummaryBotClassParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/summary_device_type_params.py b/src/cloudflare/types/radar/http/summary_device_type_params.py index c0a7a7664f2..1073a6d89bc 100644 --- a/src/cloudflare/types/radar/http/summary_device_type_params.py +++ b/src/cloudflare/types/radar/http/summary_device_type_params.py @@ -13,65 +13,66 @@ class SummaryDeviceTypeParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/summary_http_protocol_params.py b/src/cloudflare/types/radar/http/summary_http_protocol_params.py index ca05adc80b4..dd9c1197955 100644 --- a/src/cloudflare/types/radar/http/summary_http_protocol_params.py +++ b/src/cloudflare/types/radar/http/summary_http_protocol_params.py @@ -13,65 +13,66 @@ class SummaryHTTPProtocolParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/summary_http_version_params.py b/src/cloudflare/types/radar/http/summary_http_version_params.py index f103dfb0592..39140304f22 100644 --- a/src/cloudflare/types/radar/http/summary_http_version_params.py +++ b/src/cloudflare/types/radar/http/summary_http_version_params.py @@ -13,65 +13,66 @@ class SummaryHTTPVersionParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/summary_ip_version_params.py b/src/cloudflare/types/radar/http/summary_ip_version_params.py index 5d135a39310..e1db184475e 100644 --- a/src/cloudflare/types/radar/http/summary_ip_version_params.py +++ b/src/cloudflare/types/radar/http/summary_ip_version_params.py @@ -13,65 +13,66 @@ class SummaryIPVersionParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/summary_os_params.py b/src/cloudflare/types/radar/http/summary_os_params.py index f475ca9335f..8f42f54b134 100644 --- a/src/cloudflare/types/radar/http/summary_os_params.py +++ b/src/cloudflare/types/radar/http/summary_os_params.py @@ -13,65 +13,66 @@ class SummaryOSParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/summary_post_quantum_params.py b/src/cloudflare/types/radar/http/summary_post_quantum_params.py index e9c7b6195d3..1139394d649 100644 --- a/src/cloudflare/types/radar/http/summary_post_quantum_params.py +++ b/src/cloudflare/types/radar/http/summary_post_quantum_params.py @@ -13,68 +13,69 @@ class SummaryPostQuantumParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/summary_tls_version_params.py b/src/cloudflare/types/radar/http/summary_tls_version_params.py index d158f1f43a6..443d5f2fe13 100644 --- a/src/cloudflare/types/radar/http/summary_tls_version_params.py +++ b/src/cloudflare/types/radar/http/summary_tls_version_params.py @@ -13,63 +13,64 @@ class SummaryTLSVersionParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" diff --git a/src/cloudflare/types/radar/http/timeseries_group_bot_class_params.py b/src/cloudflare/types/radar/http/timeseries_group_bot_class_params.py index c356954fbc4..6b79f440d4d 100644 --- a/src/cloudflare/types/radar/http/timeseries_group_bot_class_params.py +++ b/src/cloudflare/types/radar/http/timeseries_group_bot_class_params.py @@ -20,61 +20,62 @@ class TimeseriesGroupBotClassParams(TypedDict, total=False): """ asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/timeseries_group_browser_family_params.py b/src/cloudflare/types/radar/http/timeseries_group_browser_family_params.py index a54c769250c..1701bb66cc0 100644 --- a/src/cloudflare/types/radar/http/timeseries_group_browser_family_params.py +++ b/src/cloudflare/types/radar/http/timeseries_group_browser_family_params.py @@ -20,76 +20,77 @@ class TimeseriesGroupBrowserFamilyParams(TypedDict, total=False): """ asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. """ location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/timeseries_group_browser_params.py b/src/cloudflare/types/radar/http/timeseries_group_browser_params.py index 2b0aab2a5eb..abe2cc51b5b 100644 --- a/src/cloudflare/types/radar/http/timeseries_group_browser_params.py +++ b/src/cloudflare/types/radar/http/timeseries_group_browser_params.py @@ -20,76 +20,77 @@ class TimeseriesGroupBrowserParams(TypedDict, total=False): """ asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit_per_group: Annotated[int, PropertyInfo(alias="limitPerGroup")] """ - Limit the number of objects (e.g., browsers, verticals, etc.) to the top items - within the specified time range. If the limitPerGroup is set, the response will - include that number of items, with the remaining items grouped together under an - "other" category. + Limits the number of objects per group to the top items within the specified + time range. If there are more items than the limit, the response will include + the count of items, with any remaining items grouped together under an "other" + category. """ location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/timeseries_group_device_type_params.py b/src/cloudflare/types/radar/http/timeseries_group_device_type_params.py index 4e44b25d6cb..e9f270e9841 100644 --- a/src/cloudflare/types/radar/http/timeseries_group_device_type_params.py +++ b/src/cloudflare/types/radar/http/timeseries_group_device_type_params.py @@ -20,65 +20,66 @@ class TimeseriesGroupDeviceTypeParams(TypedDict, total=False): """ asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/timeseries_group_http_protocol_params.py b/src/cloudflare/types/radar/http/timeseries_group_http_protocol_params.py index ba7ee2c31aa..d5a71b26448 100644 --- a/src/cloudflare/types/radar/http/timeseries_group_http_protocol_params.py +++ b/src/cloudflare/types/radar/http/timeseries_group_http_protocol_params.py @@ -20,65 +20,66 @@ class TimeseriesGroupHTTPProtocolParams(TypedDict, total=False): """ asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/timeseries_group_http_version_params.py b/src/cloudflare/types/radar/http/timeseries_group_http_version_params.py index 97e2dbca21e..c9a73048627 100644 --- a/src/cloudflare/types/radar/http/timeseries_group_http_version_params.py +++ b/src/cloudflare/types/radar/http/timeseries_group_http_version_params.py @@ -20,65 +20,66 @@ class TimeseriesGroupHTTPVersionParams(TypedDict, total=False): """ asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/timeseries_group_ip_version_params.py b/src/cloudflare/types/radar/http/timeseries_group_ip_version_params.py index 6c5aa48d095..7ea9592c435 100644 --- a/src/cloudflare/types/radar/http/timeseries_group_ip_version_params.py +++ b/src/cloudflare/types/radar/http/timeseries_group_ip_version_params.py @@ -20,65 +20,66 @@ class TimeseriesGroupIPVersionParams(TypedDict, total=False): """ asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/timeseries_group_os_params.py b/src/cloudflare/types/radar/http/timeseries_group_os_params.py index 229e0d9ff31..ccb3a19caa9 100644 --- a/src/cloudflare/types/radar/http/timeseries_group_os_params.py +++ b/src/cloudflare/types/radar/http/timeseries_group_os_params.py @@ -20,65 +20,66 @@ class TimeseriesGroupOSParams(TypedDict, total=False): """ asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/timeseries_group_post_quantum_params.py b/src/cloudflare/types/radar/http/timeseries_group_post_quantum_params.py index 486a7428ed3..f9adb227aa0 100644 --- a/src/cloudflare/types/radar/http/timeseries_group_post_quantum_params.py +++ b/src/cloudflare/types/radar/http/timeseries_group_post_quantum_params.py @@ -20,68 +20,69 @@ class TimeseriesGroupPostQuantumParams(TypedDict, total=False): """ asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/timeseries_group_tls_version_params.py b/src/cloudflare/types/radar/http/timeseries_group_tls_version_params.py index 8fef3fd1627..21326f7cbee 100644 --- a/src/cloudflare/types/radar/http/timeseries_group_tls_version_params.py +++ b/src/cloudflare/types/radar/http/timeseries_group_tls_version_params.py @@ -20,63 +20,64 @@ class TimeseriesGroupTLSVersionParams(TypedDict, total=False): """ asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" diff --git a/src/cloudflare/types/radar/http/top_browser_family_params.py b/src/cloudflare/types/radar/http/top_browser_family_params.py index 2373d275b84..bd6d1a0ca9a 100644 --- a/src/cloudflare/types/radar/http/top_browser_family_params.py +++ b/src/cloudflare/types/radar/http/top_browser_family_params.py @@ -13,71 +13,72 @@ class TopBrowserFamilyParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http/top_browser_params.py b/src/cloudflare/types/radar/http/top_browser_params.py index a5ff89514de..02d070cc524 100644 --- a/src/cloudflare/types/radar/http/top_browser_params.py +++ b/src/cloudflare/types/radar/http/top_browser_params.py @@ -13,74 +13,75 @@ class TopBrowserParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ browser_family: Annotated[List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]], PropertyInfo(alias="browserFamily")] - """Filter for browser family.""" + """Filters results by browser family.""" continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/http_timeseries_params.py b/src/cloudflare/types/radar/http_timeseries_params.py index 2723de57522..e4b3f8e6b4b 100644 --- a/src/cloudflare/types/radar/http_timeseries_params.py +++ b/src/cloudflare/types/radar/http_timeseries_params.py @@ -20,63 +20,64 @@ class HTTPTimeseriesParams(TypedDict, total=False): """ asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")] - """Filter for bot class. + """Filters results by bot class. Refer to [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")] - """Filter for device type.""" + """Filters results by device type.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")] - """Filter for http protocol.""" + """Filters results by HTTP protocol (HTTP vs. HTTPS).""" http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")] - """Filter for http version.""" + """Filters results by HTTP version.""" ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")] - """Filter for ip version.""" + """Filters results by IP version (Ipv4 vs. IPv6).""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] """Normalization method applied. @@ -86,9 +87,9 @@ class HTTPTimeseriesParams(TypedDict, total=False): """ os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - """Filter for os name.""" + """Filters results by operating system.""" tls_version: Annotated[ List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion") ] - """Filter for tls version.""" + """Filters results by TLS version.""" diff --git a/src/cloudflare/types/radar/netflow_summary_params.py b/src/cloudflare/types/radar/netflow_summary_params.py index eaae72b84e7..5c4c3798546 100644 --- a/src/cloudflare/types/radar/netflow_summary_params.py +++ b/src/cloudflare/types/radar/netflow_summary_params.py @@ -13,41 +13,42 @@ class NetflowSummaryParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/netflow_timeseries_params.py b/src/cloudflare/types/radar/netflow_timeseries_params.py index 4b0bc3ba324..2db987b7ece 100644 --- a/src/cloudflare/types/radar/netflow_timeseries_params.py +++ b/src/cloudflare/types/radar/netflow_timeseries_params.py @@ -20,44 +20,45 @@ class NetflowTimeseriesParams(TypedDict, total=False): """ asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] """Normalization method applied. @@ -67,4 +68,4 @@ class NetflowTimeseriesParams(TypedDict, total=False): """ product: List[Literal["HTTP", "ALL"]] - """Array of network traffic product types.""" + """Array of network traffic product types to filters results by.""" diff --git a/src/cloudflare/types/radar/netflows/top_ases_params.py b/src/cloudflare/types/radar/netflows/top_ases_params.py index 951cd0fb34e..525b077f274 100644 --- a/src/cloudflare/types/radar/netflows/top_ases_params.py +++ b/src/cloudflare/types/radar/netflows/top_ases_params.py @@ -13,44 +13,45 @@ class TopAsesParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/netflows/top_locations_params.py b/src/cloudflare/types/radar/netflows/top_locations_params.py index 74b6631d0b9..8bcca93a00b 100644 --- a/src/cloudflare/types/radar/netflows/top_locations_params.py +++ b/src/cloudflare/types/radar/netflows/top_locations_params.py @@ -13,44 +13,45 @@ class TopLocationsParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/quality/iqi_summary_params.py b/src/cloudflare/types/radar/quality/iqi_summary_params.py index 1de09c36ab0..7ac3e5acad9 100644 --- a/src/cloudflare/types/radar/quality/iqi_summary_params.py +++ b/src/cloudflare/types/radar/quality/iqi_summary_params.py @@ -13,44 +13,45 @@ class IQISummaryParams(TypedDict, total=False): metric: Required[Literal["BANDWIDTH", "DNS", "LATENCY"]] - """Which metric to return: bandwidth, latency or DNS response time.""" + """Defines which metric to return (bandwidth, latency, or DNS response time).""" asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/quality/iqi_timeseries_groups_params.py b/src/cloudflare/types/radar/quality/iqi_timeseries_groups_params.py index 6923ba58c7c..1ed21f67ec4 100644 --- a/src/cloudflare/types/radar/quality/iqi_timeseries_groups_params.py +++ b/src/cloudflare/types/radar/quality/iqi_timeseries_groups_params.py @@ -13,7 +13,7 @@ class IQITimeseriesGroupsParams(TypedDict, total=False): metric: Required[Literal["BANDWIDTH", "DNS", "LATENCY"]] - """Which metric to return: bandwidth, latency or DNS response time.""" + """Defines which metric to return (bandwidth, latency, or DNS response time).""" agg_interval: Annotated[Literal["15m", "1h", "1d", "1w"], PropertyInfo(alias="aggInterval")] """ @@ -23,44 +23,45 @@ class IQITimeseriesGroupsParams(TypedDict, total=False): """ asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" interpolation: bool - """Enable interpolation for all series (using the average).""" + """Enables interpolation for all series (using the average).""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/quality/speed/top_ases_params.py b/src/cloudflare/types/radar/quality/speed/top_ases_params.py index d6d3e12b718..600fe41bf20 100644 --- a/src/cloudflare/types/radar/quality/speed/top_ases_params.py +++ b/src/cloudflare/types/radar/quality/speed/top_ases_params.py @@ -13,37 +13,37 @@ class TopAsesParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" order_by: Annotated[ Literal[ @@ -54,4 +54,4 @@ class TopAsesParams(TypedDict, total=False): """Metric to order the results by.""" reverse: bool - """Reverse the order of results.""" + """Reverses the order of results.""" diff --git a/src/cloudflare/types/radar/quality/speed/top_locations_params.py b/src/cloudflare/types/radar/quality/speed/top_locations_params.py index 89adc5a9988..cab56f22f9d 100644 --- a/src/cloudflare/types/radar/quality/speed/top_locations_params.py +++ b/src/cloudflare/types/radar/quality/speed/top_locations_params.py @@ -13,37 +13,37 @@ class TopLocationsParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" order_by: Annotated[ Literal[ @@ -54,4 +54,4 @@ class TopLocationsParams(TypedDict, total=False): """Metric to order the results by.""" reverse: bool - """Reverse the order of results.""" + """Reverses the order of results.""" diff --git a/src/cloudflare/types/radar/quality/speed_histogram_params.py b/src/cloudflare/types/radar/quality/speed_histogram_params.py index 489717a60e2..050ac38017a 100644 --- a/src/cloudflare/types/radar/quality/speed_histogram_params.py +++ b/src/cloudflare/types/radar/quality/speed_histogram_params.py @@ -13,37 +13,37 @@ class SpeedHistogramParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ bucket_size: Annotated[int, PropertyInfo(alias="bucketSize")] - """The width for every bucket in the histogram.""" + """Width for every bucket in the histogram.""" continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ metric_group: Annotated[Literal["BANDWIDTH", "LATENCY", "JITTER"], PropertyInfo(alias="metricGroup")] """Metrics to be returned.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/quality/speed_summary_params.py b/src/cloudflare/types/radar/quality/speed_summary_params.py index 8cf97078bf9..9610be34f9a 100644 --- a/src/cloudflare/types/radar/quality/speed_summary_params.py +++ b/src/cloudflare/types/radar/quality/speed_summary_params.py @@ -13,31 +13,31 @@ class SpeedSummaryParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/ranking/domain_get_params.py b/src/cloudflare/types/radar/ranking/domain_get_params.py index 95eb1587c83..4f8b6c4b71f 100644 --- a/src/cloudflare/types/radar/ranking/domain_get_params.py +++ b/src/cloudflare/types/radar/ranking/domain_get_params.py @@ -16,16 +16,16 @@ class DomainGetParams(TypedDict, total=False): """Array of dates to filter the ranking.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" include_top_locations: Annotated[bool, PropertyInfo(alias="includeTopLocations")] - """Include top locations in the response.""" + """Includes top locations in the response.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" ranking_type: Annotated[Literal["POPULAR", "TRENDING_RISE", "TRENDING_STEADY"], PropertyInfo(alias="rankingType")] - """The ranking type.""" + """Ranking type.""" diff --git a/src/cloudflare/types/radar/ranking/domain_get_response.py b/src/cloudflare/types/radar/ranking/domain_get_response.py index 64792b86087..c577ec3c1d3 100644 --- a/src/cloudflare/types/radar/ranking/domain_get_response.py +++ b/src/cloudflare/types/radar/ranking/domain_get_response.py @@ -1,12 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Optional +from datetime import datetime from pydantic import Field as FieldInfo from ...._models import BaseModel -__all__ = ["DomainGetResponse", "Details0", "Details0Category", "Details0TopLocation"] +__all__ = ["DomainGetResponse", "Details0", "Details0Category", "Details0TopLocation", "Meta", "MetaDateRange"] class Details0Category(BaseModel): @@ -36,5 +37,19 @@ class Details0(BaseModel): top_locations: Optional[List[Details0TopLocation]] = None +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class Meta(BaseModel): + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + class DomainGetResponse(BaseModel): details_0: Details0 + + meta: Meta diff --git a/src/cloudflare/types/radar/ranking/internet_service_timeseries_groups_params.py b/src/cloudflare/types/radar/ranking/internet_service_timeseries_groups_params.py index fe6a82d3f79..70db4ea3858 100644 --- a/src/cloudflare/types/radar/ranking/internet_service_timeseries_groups_params.py +++ b/src/cloudflare/types/radar/ranking/internet_service_timeseries_groups_params.py @@ -16,23 +16,24 @@ class InternetServiceTimeseriesGroupsParams(TypedDict, total=False): """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" service_category: Annotated[List[str], PropertyInfo(alias="serviceCategory")] - """Filter for services category.""" + """Filters results by Internet service category.""" diff --git a/src/cloudflare/types/radar/ranking/internet_service_top_params.py b/src/cloudflare/types/radar/ranking/internet_service_top_params.py index d2809e2b3b0..11e594959d0 100644 --- a/src/cloudflare/types/radar/ranking/internet_service_top_params.py +++ b/src/cloudflare/types/radar/ranking/internet_service_top_params.py @@ -16,13 +16,13 @@ class InternetServiceTopParams(TypedDict, total=False): """Array of dates to filter the ranking.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" service_category: Annotated[List[str], PropertyInfo(alias="serviceCategory")] - """Filter for services category.""" + """Filters results by Internet service category.""" diff --git a/src/cloudflare/types/radar/ranking_timeseries_groups_params.py b/src/cloudflare/types/radar/ranking_timeseries_groups_params.py index e942258f0f9..a872fd43b66 100644 --- a/src/cloudflare/types/radar/ranking_timeseries_groups_params.py +++ b/src/cloudflare/types/radar/ranking_timeseries_groups_params.py @@ -16,32 +16,33 @@ class RankingTimeseriesGroupsParams(TypedDict, total=False): """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" domain_category: Annotated[List[str], PropertyInfo(alias="domainCategory")] - """Filter by domain category.""" + """Filters results by domain category.""" domains: List[str] - """Array of comma separated list of domains names.""" + """Comma-separated list of domain names.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of locations (alpha-2 country codes).""" + """Comma-separated list of locations (alpha-2 codes).""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" ranking_type: Annotated[Literal["POPULAR", "TRENDING_RISE", "TRENDING_STEADY"], PropertyInfo(alias="rankingType")] - """The ranking type.""" + """Ranking type.""" diff --git a/src/cloudflare/types/radar/ranking_top_params.py b/src/cloudflare/types/radar/ranking_top_params.py index 8508b5159b5..06ab761773a 100644 --- a/src/cloudflare/types/radar/ranking_top_params.py +++ b/src/cloudflare/types/radar/ranking_top_params.py @@ -16,19 +16,19 @@ class RankingTopParams(TypedDict, total=False): """Array of dates to filter the ranking.""" domain_category: Annotated[List[str], PropertyInfo(alias="domainCategory")] - """Filter by domain category.""" + """Filters results by domain category.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of locations (alpha-2 country codes).""" + """Comma-separated list of locations (alpha-2 codes).""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" ranking_type: Annotated[Literal["POPULAR", "TRENDING_RISE", "TRENDING_STEADY"], PropertyInfo(alias="rankingType")] - """The ranking type.""" + """Ranking type.""" diff --git a/src/cloudflare/types/radar/robots_txt/top/user_agent_directive_params.py b/src/cloudflare/types/radar/robots_txt/top/user_agent_directive_params.py index 5b45e1e7913..3b345e6eba4 100644 --- a/src/cloudflare/types/radar/robots_txt/top/user_agent_directive_params.py +++ b/src/cloudflare/types/radar/robots_txt/top/user_agent_directive_params.py @@ -16,19 +16,19 @@ class UserAgentDirectiveParams(TypedDict, total=False): """Array of dates to filter the ranking.""" directive: Literal["ALLOW", "DISALLOW"] - """Filter by directive.""" + """Filters results by robots.txt directive.""" domain_category: Annotated[List[str], PropertyInfo(alias="domainCategory")] - """Filter by domain category.""" + """Filters results by domain category.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" user_agent_category: Annotated[Literal["AI"], PropertyInfo(alias="userAgentCategory")] - """Filter by user agent category.""" + """Filters results by user agent category.""" diff --git a/src/cloudflare/types/radar/robots_txt/top_domain_categories_params.py b/src/cloudflare/types/radar/robots_txt/top_domain_categories_params.py index b36b8ee64f9..cb62f868b87 100644 --- a/src/cloudflare/types/radar/robots_txt/top_domain_categories_params.py +++ b/src/cloudflare/types/radar/robots_txt/top_domain_categories_params.py @@ -16,13 +16,13 @@ class TopDomainCategoriesParams(TypedDict, total=False): """Array of dates to filter the ranking.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" user_agent_category: Annotated[Literal["AI"], PropertyInfo(alias="userAgentCategory")] - """Filter by user agent category.""" + """Filters results by user agent category.""" diff --git a/src/cloudflare/types/radar/search_global_params.py b/src/cloudflare/types/radar/search_global_params.py index a819d17e12f..425ee6851a1 100644 --- a/src/cloudflare/types/radar/search_global_params.py +++ b/src/cloudflare/types/radar/search_global_params.py @@ -12,19 +12,19 @@ class SearchGlobalParams(TypedDict, total=False): query: Required[str] - """Search for locations, AS and reports.""" + """Search for locations, autonomous systems and reports.""" exclude: List[Literal["SPECIAL_EVENTS", "NOTEBOOKS", "LOCATIONS", "ASNS"]] """Search types to be excluded from results.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" include: List[Literal["SPECIAL_EVENTS", "NOTEBOOKS", "LOCATIONS", "ASNS"]] """Search types to be included in results.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" limit_per_group: Annotated[float, PropertyInfo(alias="limitPerGroup")] """Limit the number of objects per search category.""" diff --git a/src/cloudflare/types/radar/tcp_resets_timeout_summary_params.py b/src/cloudflare/types/radar/tcp_resets_timeout_summary_params.py index a278b500c38..d3ce0dc3f62 100644 --- a/src/cloudflare/types/radar/tcp_resets_timeout_summary_params.py +++ b/src/cloudflare/types/radar/tcp_resets_timeout_summary_params.py @@ -13,41 +13,42 @@ class TCPResetsTimeoutSummaryParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/tcp_resets_timeout_timeseries_groups_params.py b/src/cloudflare/types/radar/tcp_resets_timeout_timeseries_groups_params.py index 81d83b0cdc2..798d771997b 100644 --- a/src/cloudflare/types/radar/tcp_resets_timeout_timeseries_groups_params.py +++ b/src/cloudflare/types/radar/tcp_resets_timeout_timeseries_groups_params.py @@ -20,41 +20,42 @@ class TCPResetsTimeoutTimeseriesGroupsParams(TypedDict, total=False): """ asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/traffic_anomalies/location_get_params.py b/src/cloudflare/types/radar/traffic_anomalies/location_get_params.py index bd0ebc748dd..fc67fa7e32e 100644 --- a/src/cloudflare/types/radar/traffic_anomalies/location_get_params.py +++ b/src/cloudflare/types/radar/traffic_anomalies/location_get_params.py @@ -25,9 +25,9 @@ class LocationGetParams(TypedDict, total=False): """Start of the date range (inclusive).""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" status: Literal["VERIFIED", "UNVERIFIED"] diff --git a/src/cloudflare/types/radar/traffic_anomaly_get_params.py b/src/cloudflare/types/radar/traffic_anomaly_get_params.py index 0fae350c54c..93ffefde206 100644 --- a/src/cloudflare/types/radar/traffic_anomaly_get_params.py +++ b/src/cloudflare/types/radar/traffic_anomaly_get_params.py @@ -13,7 +13,7 @@ class TrafficAnomalyGetParams(TypedDict, total=False): asn: int - """Single ASN as integer.""" + """Single Autonomous System Number (ASN) as integer.""" date_end: Annotated[Union[str, datetime], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" @@ -28,15 +28,15 @@ class TrafficAnomalyGetParams(TypedDict, total=False): """Start of the date range (inclusive).""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: str - """Location Alpha2 code.""" + """Location alpha-2 code.""" offset: int - """Number of objects to skip before grabbing results.""" + """Skips the specified number of objects before fetching the results.""" status: Literal["VERIFIED", "UNVERIFIED"] diff --git a/src/cloudflare/types/radar/verified_bots/top_bots_params.py b/src/cloudflare/types/radar/verified_bots/top_bots_params.py index 5eb7fcda9cc..0186950a322 100644 --- a/src/cloudflare/types/radar/verified_bots/top_bots_params.py +++ b/src/cloudflare/types/radar/verified_bots/top_bots_params.py @@ -13,44 +13,45 @@ class TopBotsParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/verified_bots/top_categories_params.py b/src/cloudflare/types/radar/verified_bots/top_categories_params.py index 70f3ced1ddc..3382942381b 100644 --- a/src/cloudflare/types/radar/verified_bots/top_categories_params.py +++ b/src/cloudflare/types/radar/verified_bots/top_categories_params.py @@ -13,44 +13,45 @@ class TopCategoriesParams(TypedDict, total=False): asn: List[str] - """Array of comma separated list of ASNs, start with `-` to exclude from results. + """Comma-separated list of Autonomous System Numbers (ASNs). - For example, `-174, 3356` excludes results from AS174, but includes results from - AS3356. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. """ continent: List[str] - """Array of comma separated list of continents (alpha-2 continent codes). + """Comma-separated list of continents (alpha-2 continent codes). - Start with `-` to exclude from results. For example, `-EU,NA` excludes results - from Europe, but includes results from North America. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. """ date_end: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] """End of the date range (inclusive).""" date_range: Annotated[List[str], PropertyInfo(alias="dateRange")] - """ - For example, use `7d` and `7dControl` to compare this week with the previous + """Filters results by the specified date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous week. Use this parameter or set specific start and end dates (`dateStart` and `dateEnd` parameters). """ date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] - """Array of datetimes to filter the start of a series.""" + """Start of the date range.""" format: Literal["JSON", "CSV"] - """Format results are returned in.""" + """Format in which results will be returned.""" limit: int - """Limit the number of objects in the response.""" + """Limits the number of objects returned in the response.""" location: List[str] - """Array of comma separated list of locations (alpha-2 country codes). + """Comma-separated list of locations (alpha-2 codes). - Start with `-` to exclude from results. For example, `-US,PT` excludes results - from the US, but includes results from PT. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. """ name: List[str] - """Array of names that will be used to name the series in responses.""" + """Array of names used to label the series in the response.""" diff --git a/tests/api_resources/radar/ai/bots/test_summary.py b/tests/api_resources/radar/ai/bots/test_summary.py index ca5d4e987c0..90e08cd591d 100644 --- a/tests/api_resources/radar/ai/bots/test_summary.py +++ b/tests/api_resources/radar/ai/bots/test_summary.py @@ -34,7 +34,7 @@ def test_method_user_agent_with_all_params(self, client: Cloudflare) -> None: format="JSON", limit_per_group=10, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryUserAgentResponse, summary, path=["response"]) @@ -78,7 +78,7 @@ async def test_method_user_agent_with_all_params(self, async_client: AsyncCloudf format="JSON", limit_per_group=10, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryUserAgentResponse, summary, path=["response"]) diff --git a/tests/api_resources/radar/ai/inference/test_summary.py b/tests/api_resources/radar/ai/inference/test_summary.py index 26083d232ef..353a568f366 100644 --- a/tests/api_resources/radar/ai/inference/test_summary.py +++ b/tests/api_resources/radar/ai/inference/test_summary.py @@ -34,7 +34,7 @@ def test_method_model_with_all_params(self, client: Cloudflare) -> None: date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", limit_per_group=10, - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryModelResponse, summary, path=["response"]) @@ -71,7 +71,7 @@ def test_method_task_with_all_params(self, client: Cloudflare) -> None: date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", limit_per_group=10, - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryTaskResponse, summary, path=["response"]) @@ -112,7 +112,7 @@ async def test_method_model_with_all_params(self, async_client: AsyncCloudflare) date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", limit_per_group=10, - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryModelResponse, summary, path=["response"]) @@ -149,7 +149,7 @@ async def test_method_task_with_all_params(self, async_client: AsyncCloudflare) date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", limit_per_group=10, - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryTaskResponse, summary, path=["response"]) diff --git a/tests/api_resources/radar/ai/inference/timeseries_groups/test_summary.py b/tests/api_resources/radar/ai/inference/timeseries_groups/test_summary.py index 243d0f83b6c..59cef513ed6 100644 --- a/tests/api_resources/radar/ai/inference/timeseries_groups/test_summary.py +++ b/tests/api_resources/radar/ai/inference/timeseries_groups/test_summary.py @@ -35,7 +35,7 @@ def test_method_model_with_all_params(self, client: Cloudflare) -> None: date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", limit_per_group=10, - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryModelResponse, summary, path=["response"]) @@ -73,7 +73,7 @@ def test_method_task_with_all_params(self, client: Cloudflare) -> None: date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", limit_per_group=10, - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryTaskResponse, summary, path=["response"]) @@ -115,7 +115,7 @@ async def test_method_model_with_all_params(self, async_client: AsyncCloudflare) date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", limit_per_group=10, - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryModelResponse, summary, path=["response"]) @@ -155,7 +155,7 @@ async def test_method_task_with_all_params(self, async_client: AsyncCloudflare) date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", limit_per_group=10, - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryTaskResponse, summary, path=["response"]) diff --git a/tests/api_resources/radar/ai/test_timeseries_groups.py b/tests/api_resources/radar/ai/test_timeseries_groups.py index 94ccc123297..3d145476cd8 100644 --- a/tests/api_resources/radar/ai/test_timeseries_groups.py +++ b/tests/api_resources/radar/ai/test_timeseries_groups.py @@ -35,7 +35,7 @@ def test_method_user_agent_with_all_params(self, client: Cloudflare) -> None: format="JSON", limit_per_group=10, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TimeseriesGroupUserAgentResponse, timeseries_group, path=["response"]) @@ -80,7 +80,7 @@ async def test_method_user_agent_with_all_params(self, async_client: AsyncCloudf format="JSON", limit_per_group=10, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TimeseriesGroupUserAgentResponse, timeseries_group, path=["response"]) diff --git a/tests/api_resources/radar/as112/test_summary.py b/tests/api_resources/radar/as112/test_summary.py index d5956baed72..92f332097d4 100644 --- a/tests/api_resources/radar/as112/test_summary.py +++ b/tests/api_resources/radar/as112/test_summary.py @@ -40,7 +40,7 @@ def test_method_dnssec_with_all_params(self, client: Cloudflare) -> None: date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryDNSSECResponse, summary, path=["response"]) @@ -79,7 +79,7 @@ def test_method_edns_with_all_params(self, client: Cloudflare) -> None: date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryEdnsResponse, summary, path=["response"]) @@ -118,7 +118,7 @@ def test_method_ip_version_with_all_params(self, client: Cloudflare) -> None: date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryIPVersionResponse, summary, path=["response"]) @@ -157,7 +157,7 @@ def test_method_protocol_with_all_params(self, client: Cloudflare) -> None: date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryProtocolResponse, summary, path=["response"]) @@ -197,7 +197,7 @@ def test_method_query_type_with_all_params(self, client: Cloudflare) -> None: format="JSON", limit_per_group=10, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryQueryTypeResponse, summary, path=["response"]) @@ -237,7 +237,7 @@ def test_method_response_codes_with_all_params(self, client: Cloudflare) -> None format="JSON", limit_per_group=10, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryResponseCodesResponse, summary, path=["response"]) @@ -280,7 +280,7 @@ async def test_method_dnssec_with_all_params(self, async_client: AsyncCloudflare date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryDNSSECResponse, summary, path=["response"]) @@ -319,7 +319,7 @@ async def test_method_edns_with_all_params(self, async_client: AsyncCloudflare) date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryEdnsResponse, summary, path=["response"]) @@ -358,7 +358,7 @@ async def test_method_ip_version_with_all_params(self, async_client: AsyncCloudf date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryIPVersionResponse, summary, path=["response"]) @@ -397,7 +397,7 @@ async def test_method_protocol_with_all_params(self, async_client: AsyncCloudfla date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryProtocolResponse, summary, path=["response"]) @@ -437,7 +437,7 @@ async def test_method_query_type_with_all_params(self, async_client: AsyncCloudf format="JSON", limit_per_group=10, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryQueryTypeResponse, summary, path=["response"]) @@ -477,7 +477,7 @@ async def test_method_response_codes_with_all_params(self, async_client: AsyncCl format="JSON", limit_per_group=10, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryResponseCodesResponse, summary, path=["response"]) diff --git a/tests/api_resources/radar/as112/test_timeseries_groups.py b/tests/api_resources/radar/as112/test_timeseries_groups.py index 26adfcf7eab..0ba776d7d90 100644 --- a/tests/api_resources/radar/as112/test_timeseries_groups.py +++ b/tests/api_resources/radar/as112/test_timeseries_groups.py @@ -41,7 +41,7 @@ def test_method_dnssec_with_all_params(self, client: Cloudflare) -> None: date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TimeseriesGroupDNSSECResponse, timeseries_group, path=["response"]) @@ -81,7 +81,7 @@ def test_method_edns_with_all_params(self, client: Cloudflare) -> None: date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TimeseriesGroupEdnsResponse, timeseries_group, path=["response"]) @@ -121,7 +121,7 @@ def test_method_ip_version_with_all_params(self, client: Cloudflare) -> None: date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TimeseriesGroupIPVersionResponse, timeseries_group, path=["response"]) @@ -161,7 +161,7 @@ def test_method_protocol_with_all_params(self, client: Cloudflare) -> None: date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TimeseriesGroupProtocolResponse, timeseries_group, path=["response"]) @@ -202,7 +202,7 @@ def test_method_query_type_with_all_params(self, client: Cloudflare) -> None: format="JSON", limit_per_group=10, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TimeseriesGroupQueryTypeResponse, timeseries_group, path=["response"]) @@ -243,7 +243,7 @@ def test_method_response_codes_with_all_params(self, client: Cloudflare) -> None format="JSON", limit_per_group=10, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TimeseriesGroupResponseCodesResponse, timeseries_group, path=["response"]) @@ -287,7 +287,7 @@ async def test_method_dnssec_with_all_params(self, async_client: AsyncCloudflare date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TimeseriesGroupDNSSECResponse, timeseries_group, path=["response"]) @@ -327,7 +327,7 @@ async def test_method_edns_with_all_params(self, async_client: AsyncCloudflare) date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TimeseriesGroupEdnsResponse, timeseries_group, path=["response"]) @@ -367,7 +367,7 @@ async def test_method_ip_version_with_all_params(self, async_client: AsyncCloudf date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TimeseriesGroupIPVersionResponse, timeseries_group, path=["response"]) @@ -407,7 +407,7 @@ async def test_method_protocol_with_all_params(self, async_client: AsyncCloudfla date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TimeseriesGroupProtocolResponse, timeseries_group, path=["response"]) @@ -448,7 +448,7 @@ async def test_method_query_type_with_all_params(self, async_client: AsyncCloudf format="JSON", limit_per_group=10, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TimeseriesGroupQueryTypeResponse, timeseries_group, path=["response"]) @@ -489,7 +489,7 @@ async def test_method_response_codes_with_all_params(self, async_client: AsyncCl format="JSON", limit_per_group=10, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TimeseriesGroupResponseCodesResponse, timeseries_group, path=["response"]) diff --git a/tests/api_resources/radar/as112/test_top.py b/tests/api_resources/radar/as112/test_top.py index 27ffc7e5b59..5ee313e582e 100644 --- a/tests/api_resources/radar/as112/test_top.py +++ b/tests/api_resources/radar/as112/test_top.py @@ -42,7 +42,7 @@ def test_method_dnssec_with_all_params(self, client: Cloudflare) -> None: format="JSON", limit=5, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TopDNSSECResponse, top, path=["response"]) @@ -89,7 +89,7 @@ def test_method_edns_with_all_params(self, client: Cloudflare) -> None: format="JSON", limit=5, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TopEdnsResponse, top, path=["response"]) @@ -136,7 +136,7 @@ def test_method_ip_version_with_all_params(self, client: Cloudflare) -> None: format="JSON", limit=5, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TopIPVersionResponse, top, path=["response"]) @@ -180,7 +180,7 @@ def test_method_locations_with_all_params(self, client: Cloudflare) -> None: format="JSON", limit=5, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TopLocationsResponse, top, path=["response"]) @@ -227,7 +227,7 @@ async def test_method_dnssec_with_all_params(self, async_client: AsyncCloudflare format="JSON", limit=5, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TopDNSSECResponse, top, path=["response"]) @@ -274,7 +274,7 @@ async def test_method_edns_with_all_params(self, async_client: AsyncCloudflare) format="JSON", limit=5, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TopEdnsResponse, top, path=["response"]) @@ -321,7 +321,7 @@ async def test_method_ip_version_with_all_params(self, async_client: AsyncCloudf format="JSON", limit=5, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TopIPVersionResponse, top, path=["response"]) @@ -365,7 +365,7 @@ async def test_method_locations_with_all_params(self, async_client: AsyncCloudfl format="JSON", limit=5, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TopLocationsResponse, top, path=["response"]) diff --git a/tests/api_resources/radar/attacks/layer3/test_summary.py b/tests/api_resources/radar/attacks/layer3/test_summary.py index 8bee0ce91a1..fdcc5ae9d60 100644 --- a/tests/api_resources/radar/attacks/layer3/test_summary.py +++ b/tests/api_resources/radar/attacks/layer3/test_summary.py @@ -40,7 +40,7 @@ def test_method_bitrate_with_all_params(self, client: Cloudflare) -> None: format="JSON", ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], protocol=["UDP"], ) assert_matches_type(SummaryBitrateResponse, summary, path=["response"]) @@ -81,7 +81,7 @@ def test_method_duration_with_all_params(self, client: Cloudflare) -> None: format="JSON", ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], protocol=["UDP"], ) assert_matches_type(SummaryDurationResponse, summary, path=["response"]) @@ -121,7 +121,7 @@ def test_method_ip_version_with_all_params(self, client: Cloudflare) -> None: direction="ORIGIN", format="JSON", location=["string"], - name=["string"], + name=["main_series"], protocol=["UDP"], ) assert_matches_type(SummaryIPVersionResponse, summary, path=["response"]) @@ -162,7 +162,7 @@ def test_method_protocol_with_all_params(self, client: Cloudflare) -> None: format="JSON", ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryProtocolResponse, summary, path=["response"]) @@ -203,7 +203,7 @@ def test_method_vector_with_all_params(self, client: Cloudflare) -> None: ip_version=["IPv4"], limit_per_group=10, location=["string"], - name=["string"], + name=["main_series"], protocol=["UDP"], ) assert_matches_type(SummaryVectorResponse, summary, path=["response"]) @@ -248,7 +248,7 @@ async def test_method_bitrate_with_all_params(self, async_client: AsyncCloudflar format="JSON", ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], protocol=["UDP"], ) assert_matches_type(SummaryBitrateResponse, summary, path=["response"]) @@ -289,7 +289,7 @@ async def test_method_duration_with_all_params(self, async_client: AsyncCloudfla format="JSON", ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], protocol=["UDP"], ) assert_matches_type(SummaryDurationResponse, summary, path=["response"]) @@ -329,7 +329,7 @@ async def test_method_ip_version_with_all_params(self, async_client: AsyncCloudf direction="ORIGIN", format="JSON", location=["string"], - name=["string"], + name=["main_series"], protocol=["UDP"], ) assert_matches_type(SummaryIPVersionResponse, summary, path=["response"]) @@ -370,7 +370,7 @@ async def test_method_protocol_with_all_params(self, async_client: AsyncCloudfla format="JSON", ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryProtocolResponse, summary, path=["response"]) @@ -411,7 +411,7 @@ async def test_method_vector_with_all_params(self, async_client: AsyncCloudflare ip_version=["IPv4"], limit_per_group=10, location=["string"], - name=["string"], + name=["main_series"], protocol=["UDP"], ) assert_matches_type(SummaryVectorResponse, summary, path=["response"]) diff --git a/tests/api_resources/radar/attacks/layer3/test_timeseries_groups.py b/tests/api_resources/radar/attacks/layer3/test_timeseries_groups.py index b248a2bc01e..6234245b8f2 100644 --- a/tests/api_resources/radar/attacks/layer3/test_timeseries_groups.py +++ b/tests/api_resources/radar/attacks/layer3/test_timeseries_groups.py @@ -43,7 +43,7 @@ def test_method_bitrate_with_all_params(self, client: Cloudflare) -> None: format="JSON", ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE", protocol=["UDP"], ) @@ -86,7 +86,7 @@ def test_method_duration_with_all_params(self, client: Cloudflare) -> None: format="JSON", ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE", protocol=["UDP"], ) @@ -130,7 +130,7 @@ def test_method_industry_with_all_params(self, client: Cloudflare) -> None: ip_version=["IPv4"], limit_per_group=10, location=["string"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE", protocol=["UDP"], ) @@ -172,7 +172,7 @@ def test_method_ip_version_with_all_params(self, client: Cloudflare) -> None: direction="ORIGIN", format="JSON", location=["string"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE", protocol=["UDP"], ) @@ -215,7 +215,7 @@ def test_method_protocol_with_all_params(self, client: Cloudflare) -> None: format="JSON", ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE", ) assert_matches_type(TimeseriesGroupProtocolResponse, timeseries_group, path=["response"]) @@ -258,7 +258,7 @@ def test_method_vector_with_all_params(self, client: Cloudflare) -> None: ip_version=["IPv4"], limit_per_group=10, location=["string"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE", protocol=["UDP"], ) @@ -302,7 +302,7 @@ def test_method_vertical_with_all_params(self, client: Cloudflare) -> None: ip_version=["IPv4"], limit_per_group=10, location=["string"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE", protocol=["UDP"], ) @@ -349,7 +349,7 @@ async def test_method_bitrate_with_all_params(self, async_client: AsyncCloudflar format="JSON", ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE", protocol=["UDP"], ) @@ -392,7 +392,7 @@ async def test_method_duration_with_all_params(self, async_client: AsyncCloudfla format="JSON", ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE", protocol=["UDP"], ) @@ -436,7 +436,7 @@ async def test_method_industry_with_all_params(self, async_client: AsyncCloudfla ip_version=["IPv4"], limit_per_group=10, location=["string"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE", protocol=["UDP"], ) @@ -478,7 +478,7 @@ async def test_method_ip_version_with_all_params(self, async_client: AsyncCloudf direction="ORIGIN", format="JSON", location=["string"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE", protocol=["UDP"], ) @@ -521,7 +521,7 @@ async def test_method_protocol_with_all_params(self, async_client: AsyncCloudfla format="JSON", ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE", ) assert_matches_type(TimeseriesGroupProtocolResponse, timeseries_group, path=["response"]) @@ -564,7 +564,7 @@ async def test_method_vector_with_all_params(self, async_client: AsyncCloudflare ip_version=["IPv4"], limit_per_group=10, location=["string"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE", protocol=["UDP"], ) @@ -608,7 +608,7 @@ async def test_method_vertical_with_all_params(self, async_client: AsyncCloudfla ip_version=["IPv4"], limit_per_group=10, location=["string"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE", protocol=["UDP"], ) diff --git a/tests/api_resources/radar/attacks/layer3/test_top.py b/tests/api_resources/radar/attacks/layer3/test_top.py index 22989fa3d9d..2a2362c4450 100644 --- a/tests/api_resources/radar/attacks/layer3/test_top.py +++ b/tests/api_resources/radar/attacks/layer3/test_top.py @@ -40,7 +40,8 @@ def test_method_attacks_with_all_params(self, client: Cloudflare) -> None: limit_direction="ORIGIN", limit_per_location=10, location=["string"], - name=["string"], + magnitude="MITIGATED_BYTES", + name=["main_series"], normalization="PERCENTAGE", protocol=["UDP"], ) @@ -82,7 +83,7 @@ def test_method_industry_with_all_params(self, client: Cloudflare) -> None: ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], protocol=["UDP"], ) assert_matches_type(TopIndustryResponse, top, path=["response"]) @@ -123,7 +124,7 @@ def test_method_vertical_with_all_params(self, client: Cloudflare) -> None: ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], protocol=["UDP"], ) assert_matches_type(TopVerticalResponse, top, path=["response"]) @@ -170,7 +171,8 @@ async def test_method_attacks_with_all_params(self, async_client: AsyncCloudflar limit_direction="ORIGIN", limit_per_location=10, location=["string"], - name=["string"], + magnitude="MITIGATED_BYTES", + name=["main_series"], normalization="PERCENTAGE", protocol=["UDP"], ) @@ -212,7 +214,7 @@ async def test_method_industry_with_all_params(self, async_client: AsyncCloudfla ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], protocol=["UDP"], ) assert_matches_type(TopIndustryResponse, top, path=["response"]) @@ -253,7 +255,7 @@ async def test_method_vertical_with_all_params(self, async_client: AsyncCloudfla ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], protocol=["UDP"], ) assert_matches_type(TopVerticalResponse, top, path=["response"]) diff --git a/tests/api_resources/radar/attacks/layer3/top/test_locations.py b/tests/api_resources/radar/attacks/layer3/top/test_locations.py index eceaabee20d..fc0424a2a6b 100644 --- a/tests/api_resources/radar/attacks/layer3/top/test_locations.py +++ b/tests/api_resources/radar/attacks/layer3/top/test_locations.py @@ -37,7 +37,7 @@ def test_method_origin_with_all_params(self, client: Cloudflare) -> None: ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], protocol=["UDP"], ) assert_matches_type(LocationOriginResponse, location, path=["response"]) @@ -78,7 +78,7 @@ def test_method_target_with_all_params(self, client: Cloudflare) -> None: ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], protocol=["UDP"], ) assert_matches_type(LocationTargetResponse, location, path=["response"]) @@ -123,7 +123,7 @@ async def test_method_origin_with_all_params(self, async_client: AsyncCloudflare ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], protocol=["UDP"], ) assert_matches_type(LocationOriginResponse, location, path=["response"]) @@ -164,7 +164,7 @@ async def test_method_target_with_all_params(self, async_client: AsyncCloudflare ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], protocol=["UDP"], ) assert_matches_type(LocationTargetResponse, location, path=["response"]) diff --git a/tests/api_resources/radar/attacks/layer7/test_summary.py b/tests/api_resources/radar/attacks/layer7/test_summary.py index a457ff963bc..e7264d066ec 100644 --- a/tests/api_resources/radar/attacks/layer7/test_summary.py +++ b/tests/api_resources/radar/attacks/layer7/test_summary.py @@ -43,7 +43,7 @@ def test_method_http_method_with_all_params(self, client: Cloudflare) -> None: limit_per_group=10, location=["string"], mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryHTTPMethodResponse, summary, path=["response"]) @@ -85,7 +85,7 @@ def test_method_http_version_with_all_params(self, client: Cloudflare) -> None: ip_version=["IPv4"], location=["string"], mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryHTTPVersionResponse, summary, path=["response"]) @@ -127,7 +127,7 @@ def test_method_ip_version_with_all_params(self, client: Cloudflare) -> None: http_version=["HTTPv1"], location=["string"], mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryIPVersionResponse, summary, path=["response"]) @@ -171,7 +171,7 @@ def test_method_managed_rules_with_all_params(self, client: Cloudflare) -> None: limit_per_group=10, location=["string"], mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryManagedRulesResponse, summary, path=["response"]) @@ -214,7 +214,7 @@ def test_method_mitigation_product_with_all_params(self, client: Cloudflare) -> ip_version=["IPv4"], limit_per_group=10, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryMitigationProductResponse, summary, path=["response"]) @@ -261,7 +261,7 @@ async def test_method_http_method_with_all_params(self, async_client: AsyncCloud limit_per_group=10, location=["string"], mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryHTTPMethodResponse, summary, path=["response"]) @@ -303,7 +303,7 @@ async def test_method_http_version_with_all_params(self, async_client: AsyncClou ip_version=["IPv4"], location=["string"], mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryHTTPVersionResponse, summary, path=["response"]) @@ -345,7 +345,7 @@ async def test_method_ip_version_with_all_params(self, async_client: AsyncCloudf http_version=["HTTPv1"], location=["string"], mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryIPVersionResponse, summary, path=["response"]) @@ -389,7 +389,7 @@ async def test_method_managed_rules_with_all_params(self, async_client: AsyncClo limit_per_group=10, location=["string"], mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryManagedRulesResponse, summary, path=["response"]) @@ -432,7 +432,7 @@ async def test_method_mitigation_product_with_all_params(self, async_client: Asy ip_version=["IPv4"], limit_per_group=10, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(SummaryMitigationProductResponse, summary, path=["response"]) diff --git a/tests/api_resources/radar/attacks/layer7/test_timeseries_groups.py b/tests/api_resources/radar/attacks/layer7/test_timeseries_groups.py index d45d9e3dee9..7e25c5ca585 100644 --- a/tests/api_resources/radar/attacks/layer7/test_timeseries_groups.py +++ b/tests/api_resources/radar/attacks/layer7/test_timeseries_groups.py @@ -46,7 +46,7 @@ def test_method_http_method_with_all_params(self, client: Cloudflare) -> None: limit_per_group=10, location=["string"], mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE", ) assert_matches_type(TimeseriesGroupHTTPMethodResponse, timeseries_group, path=["response"]) @@ -90,7 +90,7 @@ def test_method_http_version_with_all_params(self, client: Cloudflare) -> None: ip_version=["IPv4"], location=["string"], mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE", ) assert_matches_type(TimeseriesGroupHTTPVersionResponse, timeseries_group, path=["response"]) @@ -136,7 +136,7 @@ def test_method_industry_with_all_params(self, client: Cloudflare) -> None: limit_per_group=10, location=["string"], mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE", ) assert_matches_type(TimeseriesGroupIndustryResponse, timeseries_group, path=["response"]) @@ -180,7 +180,7 @@ def test_method_ip_version_with_all_params(self, client: Cloudflare) -> None: http_version=["HTTPv1"], location=["string"], mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE", ) assert_matches_type(TimeseriesGroupIPVersionResponse, timeseries_group, path=["response"]) @@ -226,7 +226,7 @@ def test_method_managed_rules_with_all_params(self, client: Cloudflare) -> None: limit_per_group=10, location=["string"], mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE", ) assert_matches_type(TimeseriesGroupManagedRulesResponse, timeseries_group, path=["response"]) @@ -271,7 +271,7 @@ def test_method_mitigation_product_with_all_params(self, client: Cloudflare) -> ip_version=["IPv4"], limit_per_group=10, location=["string"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE", ) assert_matches_type(TimeseriesGroupMitigationProductResponse, timeseries_group, path=["response"]) @@ -317,7 +317,7 @@ def test_method_vertical_with_all_params(self, client: Cloudflare) -> None: limit_per_group=10, location=["string"], mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE", ) assert_matches_type(TimeseriesGroupVerticalResponse, timeseries_group, path=["response"]) @@ -366,7 +366,7 @@ async def test_method_http_method_with_all_params(self, async_client: AsyncCloud limit_per_group=10, location=["string"], mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE", ) assert_matches_type(TimeseriesGroupHTTPMethodResponse, timeseries_group, path=["response"]) @@ -412,7 +412,7 @@ async def test_method_http_version_with_all_params(self, async_client: AsyncClou ip_version=["IPv4"], location=["string"], mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE", ) assert_matches_type(TimeseriesGroupHTTPVersionResponse, timeseries_group, path=["response"]) @@ -460,7 +460,7 @@ async def test_method_industry_with_all_params(self, async_client: AsyncCloudfla limit_per_group=10, location=["string"], mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE", ) assert_matches_type(TimeseriesGroupIndustryResponse, timeseries_group, path=["response"]) @@ -504,7 +504,7 @@ async def test_method_ip_version_with_all_params(self, async_client: AsyncCloudf http_version=["HTTPv1"], location=["string"], mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE", ) assert_matches_type(TimeseriesGroupIPVersionResponse, timeseries_group, path=["response"]) @@ -550,7 +550,7 @@ async def test_method_managed_rules_with_all_params(self, async_client: AsyncClo limit_per_group=10, location=["string"], mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE", ) assert_matches_type(TimeseriesGroupManagedRulesResponse, timeseries_group, path=["response"]) @@ -597,7 +597,7 @@ async def test_method_mitigation_product_with_all_params(self, async_client: Asy ip_version=["IPv4"], limit_per_group=10, location=["string"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE", ) assert_matches_type(TimeseriesGroupMitigationProductResponse, timeseries_group, path=["response"]) @@ -645,7 +645,7 @@ async def test_method_vertical_with_all_params(self, async_client: AsyncCloudfla limit_per_group=10, location=["string"], mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE", ) assert_matches_type(TimeseriesGroupVerticalResponse, timeseries_group, path=["response"]) diff --git a/tests/api_resources/radar/attacks/layer7/test_top.py b/tests/api_resources/radar/attacks/layer7/test_top.py index eebffc3e959..585e30ae8ea 100644 --- a/tests/api_resources/radar/attacks/layer7/test_top.py +++ b/tests/api_resources/radar/attacks/layer7/test_top.py @@ -45,7 +45,7 @@ def test_method_attacks_with_all_params(self, client: Cloudflare) -> None: location=["string"], magnitude="AFFECTED_ZONES", mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE", ) assert_matches_type(TopAttacksResponse, top, path=["response"]) @@ -90,7 +90,7 @@ def test_method_industry_with_all_params(self, client: Cloudflare) -> None: limit=5, location=["string"], mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], ) assert_matches_type(TopIndustryResponse, top, path=["response"]) @@ -134,7 +134,7 @@ def test_method_vertical_with_all_params(self, client: Cloudflare) -> None: limit=5, location=["string"], mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], ) assert_matches_type(TopVerticalResponse, top, path=["response"]) @@ -185,7 +185,7 @@ async def test_method_attacks_with_all_params(self, async_client: AsyncCloudflar location=["string"], magnitude="AFFECTED_ZONES", mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE", ) assert_matches_type(TopAttacksResponse, top, path=["response"]) @@ -230,7 +230,7 @@ async def test_method_industry_with_all_params(self, async_client: AsyncCloudfla limit=5, location=["string"], mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], ) assert_matches_type(TopIndustryResponse, top, path=["response"]) @@ -274,7 +274,7 @@ async def test_method_vertical_with_all_params(self, async_client: AsyncCloudfla limit=5, location=["string"], mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], ) assert_matches_type(TopVerticalResponse, top, path=["response"]) diff --git a/tests/api_resources/radar/attacks/layer7/top/test_ases.py b/tests/api_resources/radar/attacks/layer7/top/test_ases.py index a5418a14455..355e8d958f3 100644 --- a/tests/api_resources/radar/attacks/layer7/top/test_ases.py +++ b/tests/api_resources/radar/attacks/layer7/top/test_ases.py @@ -37,7 +37,7 @@ def test_method_origin_with_all_params(self, client: Cloudflare) -> None: limit=5, location=["string"], mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], ) assert_matches_type(AseOriginResponse, ase, path=["response"]) @@ -84,7 +84,7 @@ async def test_method_origin_with_all_params(self, async_client: AsyncCloudflare limit=5, location=["string"], mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], ) assert_matches_type(AseOriginResponse, ase, path=["response"]) diff --git a/tests/api_resources/radar/attacks/layer7/top/test_locations.py b/tests/api_resources/radar/attacks/layer7/top/test_locations.py index 5c0efdabfe6..912d7f31098 100644 --- a/tests/api_resources/radar/attacks/layer7/top/test_locations.py +++ b/tests/api_resources/radar/attacks/layer7/top/test_locations.py @@ -40,7 +40,7 @@ def test_method_origin_with_all_params(self, client: Cloudflare) -> None: ip_version=["IPv4"], limit=5, mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], ) assert_matches_type(LocationOriginResponse, location, path=["response"]) @@ -82,7 +82,7 @@ def test_method_target_with_all_params(self, client: Cloudflare) -> None: ip_version=["IPv4"], limit=5, mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], ) assert_matches_type(LocationTargetResponse, location, path=["response"]) @@ -129,7 +129,7 @@ async def test_method_origin_with_all_params(self, async_client: AsyncCloudflare ip_version=["IPv4"], limit=5, mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], ) assert_matches_type(LocationOriginResponse, location, path=["response"]) @@ -171,7 +171,7 @@ async def test_method_target_with_all_params(self, async_client: AsyncCloudflare ip_version=["IPv4"], limit=5, mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], ) assert_matches_type(LocationTargetResponse, location, path=["response"]) diff --git a/tests/api_resources/radar/attacks/test_layer3.py b/tests/api_resources/radar/attacks/test_layer3.py index 65d6d7bcb35..0157bde3dcc 100644 --- a/tests/api_resources/radar/attacks/test_layer3.py +++ b/tests/api_resources/radar/attacks/test_layer3.py @@ -37,7 +37,7 @@ def test_method_timeseries_with_all_params(self, client: Cloudflare) -> None: ip_version=["IPv4"], location=["string"], metric="BYTES", - name=["string"], + name=["main_series"], normalization="PERCENTAGE_CHANGE", protocol=["UDP"], ) @@ -86,7 +86,7 @@ async def test_method_timeseries_with_all_params(self, async_client: AsyncCloudf ip_version=["IPv4"], location=["string"], metric="BYTES", - name=["string"], + name=["main_series"], normalization="PERCENTAGE_CHANGE", protocol=["UDP"], ) diff --git a/tests/api_resources/radar/attacks/test_layer7.py b/tests/api_resources/radar/attacks/test_layer7.py index ac1bc86575c..67df94d5aa0 100644 --- a/tests/api_resources/radar/attacks/test_layer7.py +++ b/tests/api_resources/radar/attacks/test_layer7.py @@ -39,7 +39,7 @@ def test_method_timeseries_with_all_params(self, client: Cloudflare) -> None: ip_version=["IPv4"], location=["string"], mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE_CHANGE", ) assert_matches_type(Layer7TimeseriesResponse, layer7, path=["response"]) @@ -89,7 +89,7 @@ async def test_method_timeseries_with_all_params(self, async_client: AsyncCloudf ip_version=["IPv4"], location=["string"], mitigation_product=["DDOS"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE_CHANGE", ) assert_matches_type(Layer7TimeseriesResponse, layer7, path=["response"]) diff --git a/tests/api_resources/radar/bgp/test_ips.py b/tests/api_resources/radar/bgp/test_ips.py index cff76af41ff..27272ae08e2 100644 --- a/tests/api_resources/radar/bgp/test_ips.py +++ b/tests/api_resources/radar/bgp/test_ips.py @@ -34,7 +34,7 @@ def test_method_timeseries_with_all_params(self, client: Cloudflare) -> None: include_delay=True, ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(IPTimeseriesResponse, ip, path=["response"]) @@ -78,7 +78,7 @@ async def test_method_timeseries_with_all_params(self, async_client: AsyncCloudf include_delay=True, ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(IPTimeseriesResponse, ip, path=["response"]) diff --git a/tests/api_resources/radar/bgp/test_routes.py b/tests/api_resources/radar/bgp/test_routes.py index 2352e1e1852..6e1de8fdc16 100644 --- a/tests/api_resources/radar/bgp/test_routes.py +++ b/tests/api_resources/radar/bgp/test_routes.py @@ -34,7 +34,7 @@ def test_method_ases_with_all_params(self, client: Cloudflare) -> None: limit=5, location="US", sort_by="cone", - sort_order="asc", + sort_order="ASC", ) assert_matches_type(RouteAsesResponse, route, path=["response"]) @@ -179,7 +179,7 @@ async def test_method_ases_with_all_params(self, async_client: AsyncCloudflare) limit=5, location="US", sort_by="cone", - sort_order="asc", + sort_order="ASC", ) assert_matches_type(RouteAsesResponse, route, path=["response"]) diff --git a/tests/api_resources/radar/bgp/test_top.py b/tests/api_resources/radar/bgp/test_top.py index 7a0fa5044e4..afd90a9fc0d 100644 --- a/tests/api_resources/radar/bgp/test_top.py +++ b/tests/api_resources/radar/bgp/test_top.py @@ -32,7 +32,7 @@ def test_method_prefixes_with_all_params(self, client: Cloudflare) -> None: date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", limit=5, - name=["string"], + name=["main_series"], update_type=["ANNOUNCEMENT"], ) assert_matches_type(TopPrefixesResponse, top, path=["response"]) @@ -75,7 +75,7 @@ async def test_method_prefixes_with_all_params(self, async_client: AsyncCloudfla date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", limit=5, - name=["string"], + name=["main_series"], update_type=["ANNOUNCEMENT"], ) assert_matches_type(TopPrefixesResponse, top, path=["response"]) diff --git a/tests/api_resources/radar/bgp/top/test_ases.py b/tests/api_resources/radar/bgp/top/test_ases.py index dfa6dca32e3..261cfd82941 100644 --- a/tests/api_resources/radar/bgp/top/test_ases.py +++ b/tests/api_resources/radar/bgp/top/test_ases.py @@ -32,7 +32,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", limit=5, - name=["string"], + name=["main_series"], prefix=["1.1.1.0/24"], update_type=["ANNOUNCEMENT"], ) @@ -110,7 +110,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", limit=5, - name=["string"], + name=["main_series"], prefix=["1.1.1.0/24"], update_type=["ANNOUNCEMENT"], ) diff --git a/tests/api_resources/radar/dns/test_top.py b/tests/api_resources/radar/dns/test_top.py index 4d9bb94fefc..6d6eb3b42b4 100644 --- a/tests/api_resources/radar/dns/test_top.py +++ b/tests/api_resources/radar/dns/test_top.py @@ -35,7 +35,7 @@ def test_method_ases_with_all_params(self, client: Cloudflare) -> None: format="JSON", limit=5, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TopAsesResponse, top, path=["response"]) @@ -76,7 +76,7 @@ def test_method_locations_with_all_params(self, client: Cloudflare) -> None: format="JSON", limit=5, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TopLocationsResponse, top, path=["response"]) @@ -121,7 +121,7 @@ async def test_method_ases_with_all_params(self, async_client: AsyncCloudflare) format="JSON", limit=5, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TopAsesResponse, top, path=["response"]) @@ -162,7 +162,7 @@ async def test_method_locations_with_all_params(self, async_client: AsyncCloudfl format="JSON", limit=5, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TopLocationsResponse, top, path=["response"]) diff --git a/tests/api_resources/radar/email/routing/test_summary.py b/tests/api_resources/radar/email/routing/test_summary.py index 71050cd8eb3..64bbf2de1d2 100644 --- a/tests/api_resources/radar/email/routing/test_summary.py +++ b/tests/api_resources/radar/email/routing/test_summary.py @@ -41,7 +41,7 @@ def test_method_arc_with_all_params(self, client: Cloudflare) -> None: encrypted=["ENCRYPTED"], format="JSON", ip_version=["IPv4"], - name=["string"], + name=["main_series"], spf=["PASS"], ) assert_matches_type(SummaryARCResponse, summary, path=["response"]) @@ -82,7 +82,7 @@ def test_method_dkim_with_all_params(self, client: Cloudflare) -> None: encrypted=["ENCRYPTED"], format="JSON", ip_version=["IPv4"], - name=["string"], + name=["main_series"], spf=["PASS"], ) assert_matches_type(SummaryDKIMResponse, summary, path=["response"]) @@ -123,7 +123,7 @@ def test_method_dmarc_with_all_params(self, client: Cloudflare) -> None: encrypted=["ENCRYPTED"], format="JSON", ip_version=["IPv4"], - name=["string"], + name=["main_series"], spf=["PASS"], ) assert_matches_type(SummaryDMARCResponse, summary, path=["response"]) @@ -164,7 +164,7 @@ def test_method_encrypted_with_all_params(self, client: Cloudflare) -> None: dmarc=["PASS"], format="JSON", ip_version=["IPv4"], - name=["string"], + name=["main_series"], spf=["PASS"], ) assert_matches_type(SummaryEncryptedResponse, summary, path=["response"]) @@ -205,7 +205,7 @@ def test_method_ip_version_with_all_params(self, client: Cloudflare) -> None: dmarc=["PASS"], encrypted=["ENCRYPTED"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], ) assert_matches_type(SummaryIPVersionResponse, summary, path=["response"]) @@ -247,7 +247,7 @@ def test_method_spf_with_all_params(self, client: Cloudflare) -> None: encrypted=["ENCRYPTED"], format="JSON", ip_version=["IPv4"], - name=["string"], + name=["main_series"], ) assert_matches_type(SummarySPFResponse, summary, path=["response"]) @@ -291,7 +291,7 @@ async def test_method_arc_with_all_params(self, async_client: AsyncCloudflare) - encrypted=["ENCRYPTED"], format="JSON", ip_version=["IPv4"], - name=["string"], + name=["main_series"], spf=["PASS"], ) assert_matches_type(SummaryARCResponse, summary, path=["response"]) @@ -332,7 +332,7 @@ async def test_method_dkim_with_all_params(self, async_client: AsyncCloudflare) encrypted=["ENCRYPTED"], format="JSON", ip_version=["IPv4"], - name=["string"], + name=["main_series"], spf=["PASS"], ) assert_matches_type(SummaryDKIMResponse, summary, path=["response"]) @@ -373,7 +373,7 @@ async def test_method_dmarc_with_all_params(self, async_client: AsyncCloudflare) encrypted=["ENCRYPTED"], format="JSON", ip_version=["IPv4"], - name=["string"], + name=["main_series"], spf=["PASS"], ) assert_matches_type(SummaryDMARCResponse, summary, path=["response"]) @@ -414,7 +414,7 @@ async def test_method_encrypted_with_all_params(self, async_client: AsyncCloudfl dmarc=["PASS"], format="JSON", ip_version=["IPv4"], - name=["string"], + name=["main_series"], spf=["PASS"], ) assert_matches_type(SummaryEncryptedResponse, summary, path=["response"]) @@ -455,7 +455,7 @@ async def test_method_ip_version_with_all_params(self, async_client: AsyncCloudf dmarc=["PASS"], encrypted=["ENCRYPTED"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], ) assert_matches_type(SummaryIPVersionResponse, summary, path=["response"]) @@ -497,7 +497,7 @@ async def test_method_spf_with_all_params(self, async_client: AsyncCloudflare) - encrypted=["ENCRYPTED"], format="JSON", ip_version=["IPv4"], - name=["string"], + name=["main_series"], ) assert_matches_type(SummarySPFResponse, summary, path=["response"]) diff --git a/tests/api_resources/radar/email/routing/test_timeseries_groups.py b/tests/api_resources/radar/email/routing/test_timeseries_groups.py index ebffbbcdc12..ebf7b0bfcde 100644 --- a/tests/api_resources/radar/email/routing/test_timeseries_groups.py +++ b/tests/api_resources/radar/email/routing/test_timeseries_groups.py @@ -42,7 +42,7 @@ def test_method_arc_with_all_params(self, client: Cloudflare) -> None: encrypted=["ENCRYPTED"], format="JSON", ip_version=["IPv4"], - name=["string"], + name=["main_series"], spf=["PASS"], ) assert_matches_type(TimeseriesGroupARCResponse, timeseries_group, path=["response"]) @@ -84,7 +84,7 @@ def test_method_dkim_with_all_params(self, client: Cloudflare) -> None: encrypted=["ENCRYPTED"], format="JSON", ip_version=["IPv4"], - name=["string"], + name=["main_series"], spf=["PASS"], ) assert_matches_type(TimeseriesGroupDKIMResponse, timeseries_group, path=["response"]) @@ -126,7 +126,7 @@ def test_method_dmarc_with_all_params(self, client: Cloudflare) -> None: encrypted=["ENCRYPTED"], format="JSON", ip_version=["IPv4"], - name=["string"], + name=["main_series"], spf=["PASS"], ) assert_matches_type(TimeseriesGroupDMARCResponse, timeseries_group, path=["response"]) @@ -168,7 +168,7 @@ def test_method_encrypted_with_all_params(self, client: Cloudflare) -> None: dmarc=["PASS"], format="JSON", ip_version=["IPv4"], - name=["string"], + name=["main_series"], spf=["PASS"], ) assert_matches_type(TimeseriesGroupEncryptedResponse, timeseries_group, path=["response"]) @@ -210,7 +210,7 @@ def test_method_ip_version_with_all_params(self, client: Cloudflare) -> None: dmarc=["PASS"], encrypted=["ENCRYPTED"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], ) assert_matches_type(TimeseriesGroupIPVersionResponse, timeseries_group, path=["response"]) @@ -253,7 +253,7 @@ def test_method_spf_with_all_params(self, client: Cloudflare) -> None: encrypted=["ENCRYPTED"], format="JSON", ip_version=["IPv4"], - name=["string"], + name=["main_series"], ) assert_matches_type(TimeseriesGroupSPFResponse, timeseries_group, path=["response"]) @@ -298,7 +298,7 @@ async def test_method_arc_with_all_params(self, async_client: AsyncCloudflare) - encrypted=["ENCRYPTED"], format="JSON", ip_version=["IPv4"], - name=["string"], + name=["main_series"], spf=["PASS"], ) assert_matches_type(TimeseriesGroupARCResponse, timeseries_group, path=["response"]) @@ -340,7 +340,7 @@ async def test_method_dkim_with_all_params(self, async_client: AsyncCloudflare) encrypted=["ENCRYPTED"], format="JSON", ip_version=["IPv4"], - name=["string"], + name=["main_series"], spf=["PASS"], ) assert_matches_type(TimeseriesGroupDKIMResponse, timeseries_group, path=["response"]) @@ -382,7 +382,7 @@ async def test_method_dmarc_with_all_params(self, async_client: AsyncCloudflare) encrypted=["ENCRYPTED"], format="JSON", ip_version=["IPv4"], - name=["string"], + name=["main_series"], spf=["PASS"], ) assert_matches_type(TimeseriesGroupDMARCResponse, timeseries_group, path=["response"]) @@ -424,7 +424,7 @@ async def test_method_encrypted_with_all_params(self, async_client: AsyncCloudfl dmarc=["PASS"], format="JSON", ip_version=["IPv4"], - name=["string"], + name=["main_series"], spf=["PASS"], ) assert_matches_type(TimeseriesGroupEncryptedResponse, timeseries_group, path=["response"]) @@ -466,7 +466,7 @@ async def test_method_ip_version_with_all_params(self, async_client: AsyncCloudf dmarc=["PASS"], encrypted=["ENCRYPTED"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], ) assert_matches_type(TimeseriesGroupIPVersionResponse, timeseries_group, path=["response"]) @@ -509,7 +509,7 @@ async def test_method_spf_with_all_params(self, async_client: AsyncCloudflare) - encrypted=["ENCRYPTED"], format="JSON", ip_version=["IPv4"], - name=["string"], + name=["main_series"], ) assert_matches_type(TimeseriesGroupSPFResponse, timeseries_group, path=["response"]) diff --git a/tests/api_resources/radar/email/security/test_summary.py b/tests/api_resources/radar/email/security/test_summary.py index 21d2dbf2aae..51820e1bd4e 100644 --- a/tests/api_resources/radar/email/security/test_summary.py +++ b/tests/api_resources/radar/email/security/test_summary.py @@ -42,7 +42,7 @@ def test_method_arc_with_all_params(self, client: Cloudflare) -> None: dkim=["PASS"], dmarc=["PASS"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], tls_version=["TLSv1_0"], ) @@ -82,7 +82,7 @@ def test_method_dkim_with_all_params(self, client: Cloudflare) -> None: date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], dmarc=["PASS"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], tls_version=["TLSv1_0"], ) @@ -122,7 +122,7 @@ def test_method_dmarc_with_all_params(self, client: Cloudflare) -> None: date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], dkim=["PASS"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], tls_version=["TLSv1_0"], ) @@ -163,7 +163,7 @@ def test_method_malicious_with_all_params(self, client: Cloudflare) -> None: dkim=["PASS"], dmarc=["PASS"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], tls_version=["TLSv1_0"], ) @@ -204,7 +204,7 @@ def test_method_spam_with_all_params(self, client: Cloudflare) -> None: dkim=["PASS"], dmarc=["PASS"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], tls_version=["TLSv1_0"], ) @@ -245,7 +245,7 @@ def test_method_spf_with_all_params(self, client: Cloudflare) -> None: dkim=["PASS"], dmarc=["PASS"], format="JSON", - name=["string"], + name=["main_series"], tls_version=["TLSv1_0"], ) assert_matches_type(SummarySPFResponse, summary, path=["response"]) @@ -285,7 +285,7 @@ def test_method_spoof_with_all_params(self, client: Cloudflare) -> None: dkim=["PASS"], dmarc=["PASS"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], tls_version=["TLSv1_0"], ) @@ -326,7 +326,7 @@ def test_method_threat_category_with_all_params(self, client: Cloudflare) -> Non dkim=["PASS"], dmarc=["PASS"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], tls_version=["TLSv1_0"], ) @@ -367,7 +367,7 @@ def test_method_tls_version_with_all_params(self, client: Cloudflare) -> None: dkim=["PASS"], dmarc=["PASS"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], ) assert_matches_type(SummaryTLSVersionResponse, summary, path=["response"]) @@ -410,7 +410,7 @@ async def test_method_arc_with_all_params(self, async_client: AsyncCloudflare) - dkim=["PASS"], dmarc=["PASS"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], tls_version=["TLSv1_0"], ) @@ -450,7 +450,7 @@ async def test_method_dkim_with_all_params(self, async_client: AsyncCloudflare) date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], dmarc=["PASS"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], tls_version=["TLSv1_0"], ) @@ -490,7 +490,7 @@ async def test_method_dmarc_with_all_params(self, async_client: AsyncCloudflare) date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], dkim=["PASS"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], tls_version=["TLSv1_0"], ) @@ -531,7 +531,7 @@ async def test_method_malicious_with_all_params(self, async_client: AsyncCloudfl dkim=["PASS"], dmarc=["PASS"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], tls_version=["TLSv1_0"], ) @@ -572,7 +572,7 @@ async def test_method_spam_with_all_params(self, async_client: AsyncCloudflare) dkim=["PASS"], dmarc=["PASS"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], tls_version=["TLSv1_0"], ) @@ -613,7 +613,7 @@ async def test_method_spf_with_all_params(self, async_client: AsyncCloudflare) - dkim=["PASS"], dmarc=["PASS"], format="JSON", - name=["string"], + name=["main_series"], tls_version=["TLSv1_0"], ) assert_matches_type(SummarySPFResponse, summary, path=["response"]) @@ -653,7 +653,7 @@ async def test_method_spoof_with_all_params(self, async_client: AsyncCloudflare) dkim=["PASS"], dmarc=["PASS"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], tls_version=["TLSv1_0"], ) @@ -694,7 +694,7 @@ async def test_method_threat_category_with_all_params(self, async_client: AsyncC dkim=["PASS"], dmarc=["PASS"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], tls_version=["TLSv1_0"], ) @@ -735,7 +735,7 @@ async def test_method_tls_version_with_all_params(self, async_client: AsyncCloud dkim=["PASS"], dmarc=["PASS"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], ) assert_matches_type(SummaryTLSVersionResponse, summary, path=["response"]) diff --git a/tests/api_resources/radar/email/security/test_timeseries_groups.py b/tests/api_resources/radar/email/security/test_timeseries_groups.py index 3b306bd7c33..eba63818ff7 100644 --- a/tests/api_resources/radar/email/security/test_timeseries_groups.py +++ b/tests/api_resources/radar/email/security/test_timeseries_groups.py @@ -43,7 +43,7 @@ def test_method_arc_with_all_params(self, client: Cloudflare) -> None: dkim=["PASS"], dmarc=["PASS"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], tls_version=["TLSv1_0"], ) @@ -84,7 +84,7 @@ def test_method_dkim_with_all_params(self, client: Cloudflare) -> None: date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], dmarc=["PASS"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], tls_version=["TLSv1_0"], ) @@ -125,7 +125,7 @@ def test_method_dmarc_with_all_params(self, client: Cloudflare) -> None: date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], dkim=["PASS"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], tls_version=["TLSv1_0"], ) @@ -167,7 +167,7 @@ def test_method_malicious_with_all_params(self, client: Cloudflare) -> None: dkim=["PASS"], dmarc=["PASS"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], tls_version=["TLSv1_0"], ) @@ -209,7 +209,7 @@ def test_method_spam_with_all_params(self, client: Cloudflare) -> None: dkim=["PASS"], dmarc=["PASS"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], tls_version=["TLSv1_0"], ) @@ -251,7 +251,7 @@ def test_method_spf_with_all_params(self, client: Cloudflare) -> None: dkim=["PASS"], dmarc=["PASS"], format="JSON", - name=["string"], + name=["main_series"], tls_version=["TLSv1_0"], ) assert_matches_type(TimeseriesGroupSPFResponse, timeseries_group, path=["response"]) @@ -292,7 +292,7 @@ def test_method_spoof_with_all_params(self, client: Cloudflare) -> None: dkim=["PASS"], dmarc=["PASS"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], tls_version=["TLSv1_0"], ) @@ -334,7 +334,7 @@ def test_method_threat_category_with_all_params(self, client: Cloudflare) -> Non dkim=["PASS"], dmarc=["PASS"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], tls_version=["TLSv1_0"], ) @@ -376,7 +376,7 @@ def test_method_tls_version_with_all_params(self, client: Cloudflare) -> None: dkim=["PASS"], dmarc=["PASS"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], ) assert_matches_type(TimeseriesGroupTLSVersionResponse, timeseries_group, path=["response"]) @@ -420,7 +420,7 @@ async def test_method_arc_with_all_params(self, async_client: AsyncCloudflare) - dkim=["PASS"], dmarc=["PASS"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], tls_version=["TLSv1_0"], ) @@ -461,7 +461,7 @@ async def test_method_dkim_with_all_params(self, async_client: AsyncCloudflare) date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], dmarc=["PASS"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], tls_version=["TLSv1_0"], ) @@ -502,7 +502,7 @@ async def test_method_dmarc_with_all_params(self, async_client: AsyncCloudflare) date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], dkim=["PASS"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], tls_version=["TLSv1_0"], ) @@ -544,7 +544,7 @@ async def test_method_malicious_with_all_params(self, async_client: AsyncCloudfl dkim=["PASS"], dmarc=["PASS"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], tls_version=["TLSv1_0"], ) @@ -586,7 +586,7 @@ async def test_method_spam_with_all_params(self, async_client: AsyncCloudflare) dkim=["PASS"], dmarc=["PASS"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], tls_version=["TLSv1_0"], ) @@ -628,7 +628,7 @@ async def test_method_spf_with_all_params(self, async_client: AsyncCloudflare) - dkim=["PASS"], dmarc=["PASS"], format="JSON", - name=["string"], + name=["main_series"], tls_version=["TLSv1_0"], ) assert_matches_type(TimeseriesGroupSPFResponse, timeseries_group, path=["response"]) @@ -669,7 +669,7 @@ async def test_method_spoof_with_all_params(self, async_client: AsyncCloudflare) dkim=["PASS"], dmarc=["PASS"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], tls_version=["TLSv1_0"], ) @@ -711,7 +711,7 @@ async def test_method_threat_category_with_all_params(self, async_client: AsyncC dkim=["PASS"], dmarc=["PASS"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], tls_version=["TLSv1_0"], ) @@ -755,7 +755,7 @@ async def test_method_tls_version_with_all_params(self, async_client: AsyncCloud dkim=["PASS"], dmarc=["PASS"], format="JSON", - name=["string"], + name=["main_series"], spf=["PASS"], ) assert_matches_type(TimeseriesGroupTLSVersionResponse, timeseries_group, path=["response"]) diff --git a/tests/api_resources/radar/email/security/top/test_tlds.py b/tests/api_resources/radar/email/security/top/test_tlds.py index 6bca8ef255e..0633c38550e 100644 --- a/tests/api_resources/radar/email/security/top/test_tlds.py +++ b/tests/api_resources/radar/email/security/top/test_tlds.py @@ -34,7 +34,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: dmarc=["PASS"], format="JSON", limit=5, - name=["string"], + name=["main_series"], spf=["PASS"], tld_category="CLASSIC", tls_version=["TLSv1_0"], @@ -81,7 +81,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - dmarc=["PASS"], format="JSON", limit=5, - name=["string"], + name=["main_series"], spf=["PASS"], tld_category="CLASSIC", tls_version=["TLSv1_0"], diff --git a/tests/api_resources/radar/email/security/top/tlds/test_malicious.py b/tests/api_resources/radar/email/security/top/tlds/test_malicious.py index 45fb924aa1e..79ca8b49bbe 100644 --- a/tests/api_resources/radar/email/security/top/tlds/test_malicious.py +++ b/tests/api_resources/radar/email/security/top/tlds/test_malicious.py @@ -37,7 +37,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: dmarc=["PASS"], format="JSON", limit=5, - name=["string"], + name=["main_series"], spf=["PASS"], tld_category="CLASSIC", tls_version=["TLSv1_0"], @@ -91,7 +91,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - dmarc=["PASS"], format="JSON", limit=5, - name=["string"], + name=["main_series"], spf=["PASS"], tld_category="CLASSIC", tls_version=["TLSv1_0"], diff --git a/tests/api_resources/radar/email/security/top/tlds/test_spam.py b/tests/api_resources/radar/email/security/top/tlds/test_spam.py index cba4fce1a25..2e561af84f9 100644 --- a/tests/api_resources/radar/email/security/top/tlds/test_spam.py +++ b/tests/api_resources/radar/email/security/top/tlds/test_spam.py @@ -37,7 +37,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: dmarc=["PASS"], format="JSON", limit=5, - name=["string"], + name=["main_series"], spf=["PASS"], tld_category="CLASSIC", tls_version=["TLSv1_0"], @@ -91,7 +91,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - dmarc=["PASS"], format="JSON", limit=5, - name=["string"], + name=["main_series"], spf=["PASS"], tld_category="CLASSIC", tls_version=["TLSv1_0"], diff --git a/tests/api_resources/radar/email/security/top/tlds/test_spoof.py b/tests/api_resources/radar/email/security/top/tlds/test_spoof.py index 26bbd0bd9f1..c06d638af23 100644 --- a/tests/api_resources/radar/email/security/top/tlds/test_spoof.py +++ b/tests/api_resources/radar/email/security/top/tlds/test_spoof.py @@ -37,7 +37,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: dmarc=["PASS"], format="JSON", limit=5, - name=["string"], + name=["main_series"], spf=["PASS"], tld_category="CLASSIC", tls_version=["TLSv1_0"], @@ -91,7 +91,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - dmarc=["PASS"], format="JSON", limit=5, - name=["string"], + name=["main_series"], spf=["PASS"], tld_category="CLASSIC", tls_version=["TLSv1_0"], diff --git a/tests/api_resources/radar/entities/test_asns.py b/tests/api_resources/radar/entities/test_asns.py index 78555b0de2d..25c5d7f322b 100644 --- a/tests/api_resources/radar/entities/test_asns.py +++ b/tests/api_resources/radar/entities/test_asns.py @@ -62,14 +62,14 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: @parametrize def test_method_get(self, client: Cloudflare) -> None: asn = client.radar.entities.asns.get( - asn=3, + asn=174, ) assert_matches_type(ASNGetResponse, asn, path=["response"]) @parametrize def test_method_get_with_all_params(self, client: Cloudflare) -> None: asn = client.radar.entities.asns.get( - asn=3, + asn=174, format="JSON", ) assert_matches_type(ASNGetResponse, asn, path=["response"]) @@ -77,7 +77,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: response = client.radar.entities.asns.with_raw_response.get( - asn=3, + asn=174, ) assert response.is_closed is True @@ -88,7 +88,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: with client.radar.entities.asns.with_streaming_response.get( - asn=3, + asn=174, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -221,14 +221,14 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: asn = await async_client.radar.entities.asns.get( - asn=3, + asn=174, ) assert_matches_type(ASNGetResponse, asn, path=["response"]) @parametrize async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: asn = await async_client.radar.entities.asns.get( - asn=3, + asn=174, format="JSON", ) assert_matches_type(ASNGetResponse, asn, path=["response"]) @@ -236,7 +236,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.radar.entities.asns.with_raw_response.get( - asn=3, + asn=174, ) assert response.is_closed is True @@ -247,7 +247,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.radar.entities.asns.with_streaming_response.get( - asn=3, + asn=174, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/radar/http/ases/test_bot_class.py b/tests/api_resources/radar/http/ases/test_bot_class.py index 8d566b8b679..98df2ef1124 100644 --- a/tests/api_resources/radar/http/ases/test_bot_class.py +++ b/tests/api_resources/radar/http/ases/test_bot_class.py @@ -42,7 +42,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -100,7 +100,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) diff --git a/tests/api_resources/radar/http/ases/test_browser_family.py b/tests/api_resources/radar/http/ases/test_browser_family.py index d06f05ca1d8..ec95ad11eb3 100644 --- a/tests/api_resources/radar/http/ases/test_browser_family.py +++ b/tests/api_resources/radar/http/ases/test_browser_family.py @@ -42,7 +42,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -100,7 +100,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) diff --git a/tests/api_resources/radar/http/ases/test_device_type.py b/tests/api_resources/radar/http/ases/test_device_type.py index e9189b19b69..16f5159f28e 100644 --- a/tests/api_resources/radar/http/ases/test_device_type.py +++ b/tests/api_resources/radar/http/ases/test_device_type.py @@ -42,7 +42,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -100,7 +100,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) diff --git a/tests/api_resources/radar/http/ases/test_http_method.py b/tests/api_resources/radar/http/ases/test_http_method.py index 11c2ca3f1bd..e78240f48d0 100644 --- a/tests/api_resources/radar/http/ases/test_http_method.py +++ b/tests/api_resources/radar/http/ases/test_http_method.py @@ -42,7 +42,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -100,7 +100,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) diff --git a/tests/api_resources/radar/http/ases/test_http_protocol.py b/tests/api_resources/radar/http/ases/test_http_protocol.py index 9f16038522a..ed93997533f 100644 --- a/tests/api_resources/radar/http/ases/test_http_protocol.py +++ b/tests/api_resources/radar/http/ases/test_http_protocol.py @@ -38,10 +38,11 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], device_type=["DESKTOP"], format="JSON", + http_version=["HTTPv1"], ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -95,10 +96,11 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], device_type=["DESKTOP"], format="JSON", + http_version=["HTTPv1"], ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) diff --git a/tests/api_resources/radar/http/ases/test_ip_version.py b/tests/api_resources/radar/http/ases/test_ip_version.py index 598493b047d..6852e542ea2 100644 --- a/tests/api_resources/radar/http/ases/test_ip_version.py +++ b/tests/api_resources/radar/http/ases/test_ip_version.py @@ -42,7 +42,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: http_version=["HTTPv1"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -100,7 +100,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - http_version=["HTTPv1"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) diff --git a/tests/api_resources/radar/http/ases/test_os.py b/tests/api_resources/radar/http/ases/test_os.py index 96a70f74afe..6504480d77e 100644 --- a/tests/api_resources/radar/http/ases/test_os.py +++ b/tests/api_resources/radar/http/ases/test_os.py @@ -43,7 +43,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], tls_version=["TLSv1_0"], ) assert_matches_type(OSGetResponse, os, path=["response"]) @@ -101,7 +101,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], tls_version=["TLSv1_0"], ) assert_matches_type(OSGetResponse, os, path=["response"]) diff --git a/tests/api_resources/radar/http/ases/test_tls_version.py b/tests/api_resources/radar/http/ases/test_tls_version.py index d11dec49fd6..bbd6d24f88d 100644 --- a/tests/api_resources/radar/http/ases/test_tls_version.py +++ b/tests/api_resources/radar/http/ases/test_tls_version.py @@ -43,7 +43,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], ) assert_matches_type(TLSVersionGetResponse, tls_version, path=["response"]) @@ -101,7 +101,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], ) assert_matches_type(TLSVersionGetResponse, tls_version, path=["response"]) diff --git a/tests/api_resources/radar/http/locations/test_bot_class.py b/tests/api_resources/radar/http/locations/test_bot_class.py index 6690ffd465a..6dc83153fd2 100644 --- a/tests/api_resources/radar/http/locations/test_bot_class.py +++ b/tests/api_resources/radar/http/locations/test_bot_class.py @@ -42,7 +42,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -100,7 +100,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) diff --git a/tests/api_resources/radar/http/locations/test_browser_family.py b/tests/api_resources/radar/http/locations/test_browser_family.py index 5f283bceedd..4f1d0335857 100644 --- a/tests/api_resources/radar/http/locations/test_browser_family.py +++ b/tests/api_resources/radar/http/locations/test_browser_family.py @@ -42,7 +42,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -100,7 +100,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) diff --git a/tests/api_resources/radar/http/locations/test_device_type.py b/tests/api_resources/radar/http/locations/test_device_type.py index cb5782f3914..7d5e60d4bb5 100644 --- a/tests/api_resources/radar/http/locations/test_device_type.py +++ b/tests/api_resources/radar/http/locations/test_device_type.py @@ -42,7 +42,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -100,7 +100,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) diff --git a/tests/api_resources/radar/http/locations/test_http_method.py b/tests/api_resources/radar/http/locations/test_http_method.py index e3b1ce1379e..f38a1e462c2 100644 --- a/tests/api_resources/radar/http/locations/test_http_method.py +++ b/tests/api_resources/radar/http/locations/test_http_method.py @@ -42,7 +42,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -100,7 +100,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) diff --git a/tests/api_resources/radar/http/locations/test_http_protocol.py b/tests/api_resources/radar/http/locations/test_http_protocol.py index e23e9254cca..b72c48d133f 100644 --- a/tests/api_resources/radar/http/locations/test_http_protocol.py +++ b/tests/api_resources/radar/http/locations/test_http_protocol.py @@ -38,10 +38,11 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], device_type=["DESKTOP"], format="JSON", + http_version=["HTTPv1"], ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -95,10 +96,11 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], device_type=["DESKTOP"], format="JSON", + http_version=["HTTPv1"], ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) diff --git a/tests/api_resources/radar/http/locations/test_ip_version.py b/tests/api_resources/radar/http/locations/test_ip_version.py index a6885e7512c..cccb9672906 100644 --- a/tests/api_resources/radar/http/locations/test_ip_version.py +++ b/tests/api_resources/radar/http/locations/test_ip_version.py @@ -42,7 +42,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: http_version=["HTTPv1"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -100,7 +100,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - http_version=["HTTPv1"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) diff --git a/tests/api_resources/radar/http/locations/test_os.py b/tests/api_resources/radar/http/locations/test_os.py index 532c1040d94..adda371838c 100644 --- a/tests/api_resources/radar/http/locations/test_os.py +++ b/tests/api_resources/radar/http/locations/test_os.py @@ -43,7 +43,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], tls_version=["TLSv1_0"], ) assert_matches_type(OSGetResponse, os, path=["response"]) @@ -101,7 +101,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], tls_version=["TLSv1_0"], ) assert_matches_type(OSGetResponse, os, path=["response"]) diff --git a/tests/api_resources/radar/http/locations/test_tls_version.py b/tests/api_resources/radar/http/locations/test_tls_version.py index f73cadd1ec6..d44cf7872ee 100644 --- a/tests/api_resources/radar/http/locations/test_tls_version.py +++ b/tests/api_resources/radar/http/locations/test_tls_version.py @@ -43,7 +43,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], ) assert_matches_type(TLSVersionGetResponse, tls_version, path=["response"]) @@ -101,7 +101,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], ) assert_matches_type(TLSVersionGetResponse, tls_version, path=["response"]) diff --git a/tests/api_resources/radar/http/test_ases.py b/tests/api_resources/radar/http/test_ases.py index 6a0b4b29ae8..9413713558b 100644 --- a/tests/api_resources/radar/http/test_ases.py +++ b/tests/api_resources/radar/http/test_ases.py @@ -40,7 +40,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -92,7 +92,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) diff --git a/tests/api_resources/radar/http/test_locations.py b/tests/api_resources/radar/http/test_locations.py index 0b276ddf3cf..a4bd04bb8cd 100644 --- a/tests/api_resources/radar/http/test_locations.py +++ b/tests/api_resources/radar/http/test_locations.py @@ -40,7 +40,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -92,7 +92,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) diff --git a/tests/api_resources/radar/http/test_summary.py b/tests/api_resources/radar/http/test_summary.py index f6c0cbfe3e9..94d5f33f7ac 100644 --- a/tests/api_resources/radar/http/test_summary.py +++ b/tests/api_resources/radar/http/test_summary.py @@ -46,7 +46,7 @@ def test_method_bot_class_with_all_params(self, client: Cloudflare) -> None: http_version=["HTTPv1"], ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -91,7 +91,7 @@ def test_method_device_type_with_all_params(self, client: Cloudflare) -> None: http_version=["HTTPv1"], ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -136,7 +136,7 @@ def test_method_http_protocol_with_all_params(self, client: Cloudflare) -> None: http_version=["HTTPv1"], ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -181,7 +181,7 @@ def test_method_http_version_with_all_params(self, client: Cloudflare) -> None: http_protocol=["HTTP"], ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -226,7 +226,7 @@ def test_method_ip_version_with_all_params(self, client: Cloudflare) -> None: http_protocol=["HTTP"], http_version=["HTTPv1"], location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -272,7 +272,7 @@ def test_method_os_with_all_params(self, client: Cloudflare) -> None: http_version=["HTTPv1"], ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], tls_version=["TLSv1_0"], ) assert_matches_type(SummaryOSResponse, summary, path=["response"]) @@ -317,7 +317,7 @@ def test_method_post_quantum_with_all_params(self, client: Cloudflare) -> None: http_version=["HTTPv1"], ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -363,7 +363,7 @@ def test_method_tls_version_with_all_params(self, client: Cloudflare) -> None: http_version=["HTTPv1"], ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], ) assert_matches_type(SummaryTLSVersionResponse, summary, path=["response"]) @@ -411,7 +411,7 @@ async def test_method_bot_class_with_all_params(self, async_client: AsyncCloudfl http_version=["HTTPv1"], ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -456,7 +456,7 @@ async def test_method_device_type_with_all_params(self, async_client: AsyncCloud http_version=["HTTPv1"], ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -501,7 +501,7 @@ async def test_method_http_protocol_with_all_params(self, async_client: AsyncClo http_version=["HTTPv1"], ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -546,7 +546,7 @@ async def test_method_http_version_with_all_params(self, async_client: AsyncClou http_protocol=["HTTP"], ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -591,7 +591,7 @@ async def test_method_ip_version_with_all_params(self, async_client: AsyncCloudf http_protocol=["HTTP"], http_version=["HTTPv1"], location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -637,7 +637,7 @@ async def test_method_os_with_all_params(self, async_client: AsyncCloudflare) -> http_version=["HTTPv1"], ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], tls_version=["TLSv1_0"], ) assert_matches_type(SummaryOSResponse, summary, path=["response"]) @@ -682,7 +682,7 @@ async def test_method_post_quantum_with_all_params(self, async_client: AsyncClou http_version=["HTTPv1"], ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -728,7 +728,7 @@ async def test_method_tls_version_with_all_params(self, async_client: AsyncCloud http_version=["HTTPv1"], ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], ) assert_matches_type(SummaryTLSVersionResponse, summary, path=["response"]) diff --git a/tests/api_resources/radar/http/test_timeseries_groups.py b/tests/api_resources/radar/http/test_timeseries_groups.py index 8789e6c61ed..753bf24162b 100644 --- a/tests/api_resources/radar/http/test_timeseries_groups.py +++ b/tests/api_resources/radar/http/test_timeseries_groups.py @@ -49,7 +49,7 @@ def test_method_bot_class_with_all_params(self, client: Cloudflare) -> None: http_version=["HTTPv1"], ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -97,7 +97,7 @@ def test_method_browser_with_all_params(self, client: Cloudflare) -> None: ip_version=["IPv4"], limit_per_group=10, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -145,7 +145,7 @@ def test_method_browser_family_with_all_params(self, client: Cloudflare) -> None ip_version=["IPv4"], limit_per_group=10, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -191,7 +191,7 @@ def test_method_device_type_with_all_params(self, client: Cloudflare) -> None: http_version=["HTTPv1"], ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -237,7 +237,7 @@ def test_method_http_protocol_with_all_params(self, client: Cloudflare) -> None: http_version=["HTTPv1"], ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -283,7 +283,7 @@ def test_method_http_version_with_all_params(self, client: Cloudflare) -> None: http_protocol=["HTTP"], ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -329,7 +329,7 @@ def test_method_ip_version_with_all_params(self, client: Cloudflare) -> None: http_protocol=["HTTP"], http_version=["HTTPv1"], location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -376,7 +376,7 @@ def test_method_os_with_all_params(self, client: Cloudflare) -> None: http_version=["HTTPv1"], ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], tls_version=["TLSv1_0"], ) assert_matches_type(TimeseriesGroupOSResponse, timeseries_group, path=["response"]) @@ -422,7 +422,7 @@ def test_method_post_quantum_with_all_params(self, client: Cloudflare) -> None: http_version=["HTTPv1"], ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -469,7 +469,7 @@ def test_method_tls_version_with_all_params(self, client: Cloudflare) -> None: http_version=["HTTPv1"], ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], ) assert_matches_type(TimeseriesGroupTLSVersionResponse, timeseries_group, path=["response"]) @@ -518,7 +518,7 @@ async def test_method_bot_class_with_all_params(self, async_client: AsyncCloudfl http_version=["HTTPv1"], ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -566,7 +566,7 @@ async def test_method_browser_with_all_params(self, async_client: AsyncCloudflar ip_version=["IPv4"], limit_per_group=10, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -614,7 +614,7 @@ async def test_method_browser_family_with_all_params(self, async_client: AsyncCl ip_version=["IPv4"], limit_per_group=10, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -660,7 +660,7 @@ async def test_method_device_type_with_all_params(self, async_client: AsyncCloud http_version=["HTTPv1"], ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -706,7 +706,7 @@ async def test_method_http_protocol_with_all_params(self, async_client: AsyncClo http_version=["HTTPv1"], ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -752,7 +752,7 @@ async def test_method_http_version_with_all_params(self, async_client: AsyncClou http_protocol=["HTTP"], ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -798,7 +798,7 @@ async def test_method_ip_version_with_all_params(self, async_client: AsyncCloudf http_protocol=["HTTP"], http_version=["HTTPv1"], location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -845,7 +845,7 @@ async def test_method_os_with_all_params(self, async_client: AsyncCloudflare) -> http_version=["HTTPv1"], ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], tls_version=["TLSv1_0"], ) assert_matches_type(TimeseriesGroupOSResponse, timeseries_group, path=["response"]) @@ -891,7 +891,7 @@ async def test_method_post_quantum_with_all_params(self, async_client: AsyncClou http_version=["HTTPv1"], ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -938,7 +938,7 @@ async def test_method_tls_version_with_all_params(self, async_client: AsyncCloud http_version=["HTTPv1"], ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], ) assert_matches_type(TimeseriesGroupTLSVersionResponse, timeseries_group, path=["response"]) diff --git a/tests/api_resources/radar/http/test_top.py b/tests/api_resources/radar/http/test_top.py index a940b158847..ebfce964cf3 100644 --- a/tests/api_resources/radar/http/test_top.py +++ b/tests/api_resources/radar/http/test_top.py @@ -43,7 +43,7 @@ def test_method_browser_with_all_params(self, client: Cloudflare) -> None: ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -90,7 +90,7 @@ def test_method_browser_family_with_all_params(self, client: Cloudflare) -> None ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -142,7 +142,7 @@ async def test_method_browser_with_all_params(self, async_client: AsyncCloudflar ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) @@ -189,7 +189,7 @@ async def test_method_browser_family_with_all_params(self, async_client: AsyncCl ip_version=["IPv4"], limit=5, location=["string"], - name=["string"], + name=["main_series"], os=["WINDOWS"], tls_version=["TLSv1_0"], ) diff --git a/tests/api_resources/radar/netflows/test_top.py b/tests/api_resources/radar/netflows/test_top.py index ce6cb7cf7ab..9dc8315bdcb 100644 --- a/tests/api_resources/radar/netflows/test_top.py +++ b/tests/api_resources/radar/netflows/test_top.py @@ -34,7 +34,7 @@ def test_method_ases_with_all_params(self, client: Cloudflare) -> None: format="JSON", limit=5, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TopAsesResponse, top, path=["response"]) @@ -74,7 +74,7 @@ def test_method_locations_with_all_params(self, client: Cloudflare) -> None: format="JSON", limit=5, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TopLocationsResponse, top, path=["response"]) @@ -118,7 +118,7 @@ async def test_method_ases_with_all_params(self, async_client: AsyncCloudflare) format="JSON", limit=5, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TopAsesResponse, top, path=["response"]) @@ -158,7 +158,7 @@ async def test_method_locations_with_all_params(self, async_client: AsyncCloudfl format="JSON", limit=5, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TopLocationsResponse, top, path=["response"]) diff --git a/tests/api_resources/radar/quality/speed/test_top.py b/tests/api_resources/radar/quality/speed/test_top.py index 595c3f3814e..5e8c6d353f7 100644 --- a/tests/api_resources/radar/quality/speed/test_top.py +++ b/tests/api_resources/radar/quality/speed/test_top.py @@ -35,7 +35,7 @@ def test_method_ases_with_all_params(self, client: Cloudflare) -> None: format="JSON", limit=5, location=["string"], - name=["string"], + name=["main_series"], order_by="BANDWIDTH_DOWNLOAD", reverse=True, ) @@ -75,7 +75,7 @@ def test_method_locations_with_all_params(self, client: Cloudflare) -> None: format="JSON", limit=5, location=["string"], - name=["string"], + name=["main_series"], order_by="BANDWIDTH_DOWNLOAD", reverse=True, ) @@ -119,7 +119,7 @@ async def test_method_ases_with_all_params(self, async_client: AsyncCloudflare) format="JSON", limit=5, location=["string"], - name=["string"], + name=["main_series"], order_by="BANDWIDTH_DOWNLOAD", reverse=True, ) @@ -159,7 +159,7 @@ async def test_method_locations_with_all_params(self, async_client: AsyncCloudfl format="JSON", limit=5, location=["string"], - name=["string"], + name=["main_series"], order_by="BANDWIDTH_DOWNLOAD", reverse=True, ) diff --git a/tests/api_resources/radar/quality/test_iqi.py b/tests/api_resources/radar/quality/test_iqi.py index ff562866312..0e0187f9479 100644 --- a/tests/api_resources/radar/quality/test_iqi.py +++ b/tests/api_resources/radar/quality/test_iqi.py @@ -39,7 +39,7 @@ def test_method_summary_with_all_params(self, client: Cloudflare) -> None: date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(IQISummaryResponse, iqi, path=["response"]) @@ -87,7 +87,7 @@ def test_method_timeseries_groups_with_all_params(self, client: Cloudflare) -> N format="JSON", interpolation=True, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(IQITimeseriesGroupsResponse, iqi, path=["response"]) @@ -137,7 +137,7 @@ async def test_method_summary_with_all_params(self, async_client: AsyncCloudflar date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(IQISummaryResponse, iqi, path=["response"]) @@ -185,7 +185,7 @@ async def test_method_timeseries_groups_with_all_params(self, async_client: Asyn format="JSON", interpolation=True, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(IQITimeseriesGroupsResponse, iqi, path=["response"]) diff --git a/tests/api_resources/radar/quality/test_speed.py b/tests/api_resources/radar/quality/test_speed.py index 7eaee21c74e..235910fd4e7 100644 --- a/tests/api_resources/radar/quality/test_speed.py +++ b/tests/api_resources/radar/quality/test_speed.py @@ -36,7 +36,7 @@ def test_method_histogram_with_all_params(self, client: Cloudflare) -> None: format="JSON", location=["string"], metric_group="BANDWIDTH", - name=["string"], + name=["main_series"], ) assert_matches_type(SpeedHistogramResponse, speed, path=["response"]) @@ -73,7 +73,7 @@ def test_method_summary_with_all_params(self, client: Cloudflare) -> None: date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(SpeedSummaryResponse, speed, path=["response"]) @@ -116,7 +116,7 @@ async def test_method_histogram_with_all_params(self, async_client: AsyncCloudfl format="JSON", location=["string"], metric_group="BANDWIDTH", - name=["string"], + name=["main_series"], ) assert_matches_type(SpeedHistogramResponse, speed, path=["response"]) @@ -153,7 +153,7 @@ async def test_method_summary_with_all_params(self, async_client: AsyncCloudflar date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(SpeedSummaryResponse, speed, path=["response"]) diff --git a/tests/api_resources/radar/ranking/test_domain.py b/tests/api_resources/radar/ranking/test_domain.py index 26021593dd9..553229c8e89 100644 --- a/tests/api_resources/radar/ranking/test_domain.py +++ b/tests/api_resources/radar/ranking/test_domain.py @@ -33,7 +33,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: format="JSON", include_top_locations=True, limit=5, - name=["string"], + name=["main_series"], ranking_type="POPULAR", ) assert_matches_type(DomainGetResponse, domain, path=["response"]) @@ -88,7 +88,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - format="JSON", include_top_locations=True, limit=5, - name=["string"], + name=["main_series"], ranking_type="POPULAR", ) assert_matches_type(DomainGetResponse, domain, path=["response"]) diff --git a/tests/api_resources/radar/ranking/test_internet_services.py b/tests/api_resources/radar/ranking/test_internet_services.py index f6b97175f9a..c39961e86e9 100644 --- a/tests/api_resources/radar/ranking/test_internet_services.py +++ b/tests/api_resources/radar/ranking/test_internet_services.py @@ -34,7 +34,7 @@ def test_method_timeseries_groups_with_all_params(self, client: Cloudflare) -> N date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", limit=5, - name=["string"], + name=["main_series"], service_category=["string"], ) assert_matches_type(InternetServiceTimeseriesGroupsResponse, internet_service, path=["response"]) @@ -70,7 +70,7 @@ def test_method_top_with_all_params(self, client: Cloudflare) -> None: date=[parse_date("2019-12-27")], format="JSON", limit=5, - name=["string"], + name=["main_series"], service_category=["string"], ) assert_matches_type(InternetServiceTopResponse, internet_service, path=["response"]) @@ -112,7 +112,7 @@ async def test_method_timeseries_groups_with_all_params(self, async_client: Asyn date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", limit=5, - name=["string"], + name=["main_series"], service_category=["string"], ) assert_matches_type(InternetServiceTimeseriesGroupsResponse, internet_service, path=["response"]) @@ -148,7 +148,7 @@ async def test_method_top_with_all_params(self, async_client: AsyncCloudflare) - date=[parse_date("2019-12-27")], format="JSON", limit=5, - name=["string"], + name=["main_series"], service_category=["string"], ) assert_matches_type(InternetServiceTopResponse, internet_service, path=["response"]) diff --git a/tests/api_resources/radar/robots_txt/test_top.py b/tests/api_resources/radar/robots_txt/test_top.py index 8206f5be9d5..e0cc7628659 100644 --- a/tests/api_resources/radar/robots_txt/test_top.py +++ b/tests/api_resources/radar/robots_txt/test_top.py @@ -29,7 +29,7 @@ def test_method_domain_categories_with_all_params(self, client: Cloudflare) -> N date=[parse_date("2019-12-27")], format="JSON", limit=5, - name=["string"], + name=["main_series"], user_agent_category="AI", ) assert_matches_type(TopDomainCategoriesResponse, top, path=["response"]) @@ -69,7 +69,7 @@ async def test_method_domain_categories_with_all_params(self, async_client: Asyn date=[parse_date("2019-12-27")], format="JSON", limit=5, - name=["string"], + name=["main_series"], user_agent_category="AI", ) assert_matches_type(TopDomainCategoriesResponse, top, path=["response"]) diff --git a/tests/api_resources/radar/robots_txt/top/test_user_agents.py b/tests/api_resources/radar/robots_txt/top/test_user_agents.py index 471e63bbeeb..ac2435dba6d 100644 --- a/tests/api_resources/radar/robots_txt/top/test_user_agents.py +++ b/tests/api_resources/radar/robots_txt/top/test_user_agents.py @@ -31,7 +31,7 @@ def test_method_directive_with_all_params(self, client: Cloudflare) -> None: domain_category=["string"], format="JSON", limit=5, - name=["string"], + name=["main_series"], user_agent_category="AI", ) assert_matches_type(UserAgentDirectiveResponse, user_agent, path=["response"]) @@ -73,7 +73,7 @@ async def test_method_directive_with_all_params(self, async_client: AsyncCloudfl domain_category=["string"], format="JSON", limit=5, - name=["string"], + name=["main_series"], user_agent_category="AI", ) assert_matches_type(UserAgentDirectiveResponse, user_agent, path=["response"]) diff --git a/tests/api_resources/radar/test_as112.py b/tests/api_resources/radar/test_as112.py index dc91117f06a..e0dd677a213 100644 --- a/tests/api_resources/radar/test_as112.py +++ b/tests/api_resources/radar/test_as112.py @@ -34,7 +34,7 @@ def test_method_timeseries_with_all_params(self, client: Cloudflare) -> None: date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(AS112TimeseriesResponse, as112, path=["response"]) @@ -78,7 +78,7 @@ async def test_method_timeseries_with_all_params(self, async_client: AsyncCloudf date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(AS112TimeseriesResponse, as112, path=["response"]) diff --git a/tests/api_resources/radar/test_bgp.py b/tests/api_resources/radar/test_bgp.py index 375ef3eaeab..e4676a91818 100644 --- a/tests/api_resources/radar/test_bgp.py +++ b/tests/api_resources/radar/test_bgp.py @@ -32,7 +32,7 @@ def test_method_timeseries_with_all_params(self, client: Cloudflare) -> None: date_range=["7d"], date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", - name=["string"], + name=["main_series"], prefix=["1.1.1.0/24"], update_type=["ANNOUNCEMENT"], ) @@ -76,7 +76,7 @@ async def test_method_timeseries_with_all_params(self, async_client: AsyncCloudf date_range=["7d"], date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", - name=["string"], + name=["main_series"], prefix=["1.1.1.0/24"], update_type=["ANNOUNCEMENT"], ) diff --git a/tests/api_resources/radar/test_http.py b/tests/api_resources/radar/test_http.py index c1ec1aef328..aab9b6f596d 100644 --- a/tests/api_resources/radar/test_http.py +++ b/tests/api_resources/radar/test_http.py @@ -39,7 +39,7 @@ def test_method_timeseries_with_all_params(self, client: Cloudflare) -> None: http_version=["HTTPv1"], ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE_CHANGE", os=["WINDOWS"], tls_version=["TLSv1_0"], @@ -91,7 +91,7 @@ async def test_method_timeseries_with_all_params(self, async_client: AsyncCloudf http_version=["HTTPv1"], ip_version=["IPv4"], location=["string"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE_CHANGE", os=["WINDOWS"], tls_version=["TLSv1_0"], diff --git a/tests/api_resources/radar/test_netflows.py b/tests/api_resources/radar/test_netflows.py index 170b3ca5696..1e7080d313a 100644 --- a/tests/api_resources/radar/test_netflows.py +++ b/tests/api_resources/radar/test_netflows.py @@ -36,7 +36,7 @@ def test_method_summary_with_all_params(self, client: Cloudflare) -> None: date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(NetflowSummaryResponse, netflow, path=["response"]) @@ -76,7 +76,7 @@ def test_method_timeseries_with_all_params(self, client: Cloudflare) -> None: date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", location=["string"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE_CHANGE", product=["HTTP"], ) @@ -121,7 +121,7 @@ async def test_method_summary_with_all_params(self, async_client: AsyncCloudflar date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(NetflowSummaryResponse, netflow, path=["response"]) @@ -161,7 +161,7 @@ async def test_method_timeseries_with_all_params(self, async_client: AsyncCloudf date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", location=["string"], - name=["string"], + name=["main_series"], normalization="PERCENTAGE_CHANGE", product=["HTTP"], ) diff --git a/tests/api_resources/radar/test_ranking.py b/tests/api_resources/radar/test_ranking.py index 56dc29a330d..9ea16b2ce33 100644 --- a/tests/api_resources/radar/test_ranking.py +++ b/tests/api_resources/radar/test_ranking.py @@ -37,7 +37,7 @@ def test_method_timeseries_groups_with_all_params(self, client: Cloudflare) -> N format="JSON", limit=5, location=["string"], - name=["string"], + name=["main_series"], ranking_type="POPULAR", ) assert_matches_type(RankingTimeseriesGroupsResponse, ranking, path=["response"]) @@ -75,7 +75,7 @@ def test_method_top_with_all_params(self, client: Cloudflare) -> None: format="JSON", limit=5, location=["string"], - name=["string"], + name=["main_series"], ranking_type="POPULAR", ) assert_matches_type(RankingTopResponse, ranking, path=["response"]) @@ -120,7 +120,7 @@ async def test_method_timeseries_groups_with_all_params(self, async_client: Asyn format="JSON", limit=5, location=["string"], - name=["string"], + name=["main_series"], ranking_type="POPULAR", ) assert_matches_type(RankingTimeseriesGroupsResponse, ranking, path=["response"]) @@ -158,7 +158,7 @@ async def test_method_top_with_all_params(self, async_client: AsyncCloudflare) - format="JSON", limit=5, location=["string"], - name=["string"], + name=["main_series"], ranking_type="POPULAR", ) assert_matches_type(RankingTopResponse, ranking, path=["response"]) diff --git a/tests/api_resources/radar/test_tcp_resets_timeouts.py b/tests/api_resources/radar/test_tcp_resets_timeouts.py index 57669977513..b7ed69156cd 100644 --- a/tests/api_resources/radar/test_tcp_resets_timeouts.py +++ b/tests/api_resources/radar/test_tcp_resets_timeouts.py @@ -36,7 +36,7 @@ def test_method_summary_with_all_params(self, client: Cloudflare) -> None: date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TCPResetsTimeoutSummaryResponse, tcp_resets_timeout, path=["response"]) @@ -76,7 +76,7 @@ def test_method_timeseries_groups_with_all_params(self, client: Cloudflare) -> N date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TCPResetsTimeoutTimeseriesGroupsResponse, tcp_resets_timeout, path=["response"]) @@ -119,7 +119,7 @@ async def test_method_summary_with_all_params(self, async_client: AsyncCloudflar date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TCPResetsTimeoutSummaryResponse, tcp_resets_timeout, path=["response"]) @@ -159,7 +159,7 @@ async def test_method_timeseries_groups_with_all_params(self, async_client: Asyn date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], format="JSON", location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TCPResetsTimeoutTimeseriesGroupsResponse, tcp_resets_timeout, path=["response"]) diff --git a/tests/api_resources/radar/verified_bots/test_top.py b/tests/api_resources/radar/verified_bots/test_top.py index 55547b5d908..888fe79936c 100644 --- a/tests/api_resources/radar/verified_bots/test_top.py +++ b/tests/api_resources/radar/verified_bots/test_top.py @@ -37,7 +37,7 @@ def test_method_bots_with_all_params(self, client: Cloudflare) -> None: format="JSON", limit=5, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TopBotsResponse, top, path=["response"]) @@ -77,7 +77,7 @@ def test_method_categories_with_all_params(self, client: Cloudflare) -> None: format="JSON", limit=5, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TopCategoriesResponse, top, path=["response"]) @@ -121,7 +121,7 @@ async def test_method_bots_with_all_params(self, async_client: AsyncCloudflare) format="JSON", limit=5, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TopBotsResponse, top, path=["response"]) @@ -161,7 +161,7 @@ async def test_method_categories_with_all_params(self, async_client: AsyncCloudf format="JSON", limit=5, location=["string"], - name=["string"], + name=["main_series"], ) assert_matches_type(TopCategoriesResponse, top, path=["response"]) From 96bdc121d9195e61cc7a098770ecf06d8b6b2746 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 18:39:28 +0000 Subject: [PATCH 321/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index a65e40c11eb..05652b988a9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fc5b966b698b287edea83ecae20186c967fd805bfd665e0b1d0aec760ee85636.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b4205800ac6bf21f6a8a1768a4551ea760874463727ad4ff450b782bc472d0f4.yml From b097e45c44e9ac46b61a19336bf6f0f10652209b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 19:48:52 +0000 Subject: [PATCH 322/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 05652b988a9..5307341f979 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b4205800ac6bf21f6a8a1768a4551ea760874463727ad4ff450b782bc472d0f4.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e6838f3b95ec0fedd51e5ce50ab33e94f4dccd7eef70514ce0c9559bc4d69d93.yml From 083d115a115a8265cae698d81bd0a1279372287b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 20:53:59 +0000 Subject: [PATCH 323/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 5307341f979..f1c71243e32 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e6838f3b95ec0fedd51e5ce50ab33e94f4dccd7eef70514ce0c9559bc4d69d93.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a80f4311bc6fd36640a80989804f6223d7dc2e224d0fc0aea46c13bb85a147df.yml From 94e997ac4f6ccf4eeb97726f67139790b6477a95 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 22:06:41 +0000 Subject: [PATCH 324/358] feat(api): api update (#2478) --- .stats.yml | 2 +- src/cloudflare/resources/rum/site_info.py | 20 +++++++++++++++++++ .../types/rum/site_info_update_params.py | 12 +++++++++++ tests/api_resources/rum/test_site_info.py | 4 ++++ 4 files changed, 37 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index f1c71243e32..029d9f1b4be 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a80f4311bc6fd36640a80989804f6223d7dc2e224d0fc0aea46c13bb85a147df.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bd2b482a83809b029aec6ad87f8bec570c067383f102c15fb9e8483110398194.yml diff --git a/src/cloudflare/resources/rum/site_info.py b/src/cloudflare/resources/rum/site_info.py index 4a5c72b4088..ae8e679e7cc 100644 --- a/src/cloudflare/resources/rum/site_info.py +++ b/src/cloudflare/resources/rum/site_info.py @@ -113,7 +113,9 @@ def update( *, account_id: str, auto_install: bool | NotGiven = NOT_GIVEN, + enabled: bool | NotGiven = NOT_GIVEN, host: str | NotGiven = NOT_GIVEN, + lite: bool | NotGiven = NOT_GIVEN, zone_tag: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -133,8 +135,14 @@ def update( auto_install: If enabled, the JavaScript snippet is automatically injected for orange-clouded sites. + enabled: Enables or disables RUM. This option can be used only when auto_install is set + to true. + host: The hostname to use for gray-clouded sites. + lite: If enabled, the JavaScript snippet will not be injected for visitors from the + EU. + zone_tag: The zone identifier. extra_headers: Send extra headers @@ -154,7 +162,9 @@ def update( body=maybe_transform( { "auto_install": auto_install, + "enabled": enabled, "host": host, + "lite": lite, "zone_tag": zone_tag, }, site_info_update_params.SiteInfoUpdateParams, @@ -397,7 +407,9 @@ async def update( *, account_id: str, auto_install: bool | NotGiven = NOT_GIVEN, + enabled: bool | NotGiven = NOT_GIVEN, host: str | NotGiven = NOT_GIVEN, + lite: bool | NotGiven = NOT_GIVEN, zone_tag: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -417,8 +429,14 @@ async def update( auto_install: If enabled, the JavaScript snippet is automatically injected for orange-clouded sites. + enabled: Enables or disables RUM. This option can be used only when auto_install is set + to true. + host: The hostname to use for gray-clouded sites. + lite: If enabled, the JavaScript snippet will not be injected for visitors from the + EU. + zone_tag: The zone identifier. extra_headers: Send extra headers @@ -438,7 +456,9 @@ async def update( body=await async_maybe_transform( { "auto_install": auto_install, + "enabled": enabled, "host": host, + "lite": lite, "zone_tag": zone_tag, }, site_info_update_params.SiteInfoUpdateParams, diff --git a/src/cloudflare/types/rum/site_info_update_params.py b/src/cloudflare/types/rum/site_info_update_params.py index c829ad47b3b..8292e3461de 100644 --- a/src/cloudflare/types/rum/site_info_update_params.py +++ b/src/cloudflare/types/rum/site_info_update_params.py @@ -17,8 +17,20 @@ class SiteInfoUpdateParams(TypedDict, total=False): sites. """ + enabled: bool + """Enables or disables RUM. + + This option can be used only when auto_install is set to true. + """ + host: str """The hostname to use for gray-clouded sites.""" + lite: bool + """ + If enabled, the JavaScript snippet will not be injected for visitors from the + EU. + """ + zone_tag: str """The zone identifier.""" diff --git a/tests/api_resources/rum/test_site_info.py b/tests/api_resources/rum/test_site_info.py index dbd592cad22..0762f7dfd57 100644 --- a/tests/api_resources/rum/test_site_info.py +++ b/tests/api_resources/rum/test_site_info.py @@ -83,7 +83,9 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: site_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", auto_install=True, + enabled=True, host="example.com", + lite=True, zone_tag="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[Site], site_info, path=["response"]) @@ -338,7 +340,9 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare site_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", auto_install=True, + enabled=True, host="example.com", + lite=True, zone_tag="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[Site], site_info, path=["response"]) From 5aa1abbbeae3e87f50b440d29508d05b596d3fec Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 23:09:10 +0000 Subject: [PATCH 325/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 029d9f1b4be..8e1ebe584f5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bd2b482a83809b029aec6ad87f8bec570c067383f102c15fb9e8483110398194.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-30cf3888b864c480cc36f79e591c5d2701bcd702ace857aa69760cc0636cd3fd.yml From 3d0496f9db50909340918810e1b2675774bc1862 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 23:59:10 +0000 Subject: [PATCH 326/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 8e1ebe584f5..2c8e56e6960 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-30cf3888b864c480cc36f79e591c5d2701bcd702ace857aa69760cc0636cd3fd.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c2ec9676f557d3739648f813a057556d5bb96096f3b62934c33fbe941e311ec9.yml From edb66a9f5c00b667d784186da05fbda9f632cef5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Feb 2025 06:10:54 +0000 Subject: [PATCH 327/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 2c8e56e6960..681d2ccc363 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c2ec9676f557d3739648f813a057556d5bb96096f3b62934c33fbe941e311ec9.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-76f8871e199acb9623688ecf63c994c5e087b912f1023d8eadb129e72412b3d9.yml From 0ddf9ee66644c80afc98b4fe207877803d66181c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Feb 2025 07:41:24 +0000 Subject: [PATCH 328/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 681d2ccc363..1c9766f0b30 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-76f8871e199acb9623688ecf63c994c5e087b912f1023d8eadb129e72412b3d9.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-69e81e7afc06605f31cd89bf39798d4524e6ba8c51298c422beca08cae5500bf.yml From eda9490b0f6a6b2651cdd7700103e63215177432 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Feb 2025 08:35:58 +0000 Subject: [PATCH 329/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 1c9766f0b30..bc49745a9fd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-69e81e7afc06605f31cd89bf39798d4524e6ba8c51298c422beca08cae5500bf.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-39cbe535581f9b84bb4dba5f3cb2e186e60d24d71701d3498bc3cd0cf388449f.yml From 06feaa9f3354a3173dcba9ff504351d42dcb64ff Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Feb 2025 08:42:48 +0000 Subject: [PATCH 330/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index bc49745a9fd..029d9f1b4be 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-39cbe535581f9b84bb4dba5f3cb2e186e60d24d71701d3498bc3cd0cf388449f.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bd2b482a83809b029aec6ad87f8bec570c067383f102c15fb9e8483110398194.yml From 9acefc1501de8a235dd410e65afb630b55a87ba2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Feb 2025 14:41:54 +0000 Subject: [PATCH 331/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 029d9f1b4be..14617b11e9e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bd2b482a83809b029aec6ad87f8bec570c067383f102c15fb9e8483110398194.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bee51f92126a5e401e708d73d3f7875a534f2c303cce3a2a881d38fbb87b6841.yml From b42c7ed3a83207e4e4fee9cda83705afa50eff0e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Feb 2025 14:45:06 +0000 Subject: [PATCH 332/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 14617b11e9e..112ce1bb447 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bee51f92126a5e401e708d73d3f7875a534f2c303cce3a2a881d38fbb87b6841.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fa2e6e3147317bad62235936e5497fd6a35fe39d76ca2077bc0f5d2cf5a56c91.yml From 4b6c1609239741934b31bc79228a3d6c9e0d65d2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Feb 2025 17:51:05 +0000 Subject: [PATCH 333/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 112ce1bb447..81231a94867 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fa2e6e3147317bad62235936e5497fd6a35fe39d76ca2077bc0f5d2cf5a56c91.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ff77b01a8aa4bc99c36a35e11d503c26273a07f9290349abac2c718c93edb537.yml From b49f05d2186c4166171570236b639f7e77aabd2e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Feb 2025 18:22:56 +0000 Subject: [PATCH 334/358] feat(api): api update (#2479) --- .stats.yml | 2 +- api.md | 19 ++--- .../resources/hyperdrive/configs.py | 66 +++++++-------- src/cloudflare/types/hyperdrive/__init__.py | 5 -- .../hyperdrive/config_create_response.py | 16 ---- .../types/hyperdrive/config_edit_params.py | 12 ++- .../types/hyperdrive/config_edit_response.py | 16 ---- .../types/hyperdrive/config_get_response.py | 16 ---- .../types/hyperdrive/config_list_response.py | 16 ---- .../hyperdrive/config_update_response.py | 16 ---- src/cloudflare/types/hyperdrive/hyperdrive.py | 7 ++ .../api_resources/hyperdrive/test_configs.py | 80 +++++++++---------- 12 files changed, 87 insertions(+), 184 deletions(-) delete mode 100644 src/cloudflare/types/hyperdrive/config_create_response.py delete mode 100644 src/cloudflare/types/hyperdrive/config_edit_response.py delete mode 100644 src/cloudflare/types/hyperdrive/config_get_response.py delete mode 100644 src/cloudflare/types/hyperdrive/config_list_response.py delete mode 100644 src/cloudflare/types/hyperdrive/config_update_response.py diff --git a/.stats.yml b/.stats.yml index 81231a94867..bfdf765ffda 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ff77b01a8aa4bc99c36a35e11d503c26273a07f9290349abac2c718c93edb537.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bb6df922da650979c566ff066e024180b52a44c367f9b6a2dfc4e007a71b6809.yml diff --git a/api.md b/api.md index 2b5489be823..152c0300d8e 100644 --- a/api.md +++ b/api.md @@ -6604,24 +6604,17 @@ from cloudflare.types.hyperdrive import Configuration, Hyperdrive Types: ```python -from cloudflare.types.hyperdrive import ( - ConfigCreateResponse, - ConfigUpdateResponse, - ConfigListResponse, - ConfigDeleteResponse, - ConfigEditResponse, - ConfigGetResponse, -) +from cloudflare.types.hyperdrive import ConfigDeleteResponse ``` Methods: -- client.hyperdrive.configs.create(\*, account_id, \*\*params) -> ConfigCreateResponse -- client.hyperdrive.configs.update(hyperdrive_id, \*, account_id, \*\*params) -> ConfigUpdateResponse -- client.hyperdrive.configs.list(\*, account_id) -> SyncSinglePage[ConfigListResponse] +- client.hyperdrive.configs.create(\*, account_id, \*\*params) -> Hyperdrive +- client.hyperdrive.configs.update(hyperdrive_id, \*, account_id, \*\*params) -> Hyperdrive +- client.hyperdrive.configs.list(\*, account_id) -> SyncSinglePage[Hyperdrive] - client.hyperdrive.configs.delete(hyperdrive_id, \*, account_id) -> object -- client.hyperdrive.configs.edit(hyperdrive_id, \*, account_id, \*\*params) -> ConfigEditResponse -- client.hyperdrive.configs.get(hyperdrive_id, \*, account_id) -> ConfigGetResponse +- client.hyperdrive.configs.edit(hyperdrive_id, \*, account_id, \*\*params) -> Hyperdrive +- client.hyperdrive.configs.get(hyperdrive_id, \*, account_id) -> Hyperdrive # RUM diff --git a/src/cloudflare/resources/hyperdrive/configs.py b/src/cloudflare/resources/hyperdrive/configs.py index cf6097cb044..757289c4b7a 100644 --- a/src/cloudflare/resources/hyperdrive/configs.py +++ b/src/cloudflare/resources/hyperdrive/configs.py @@ -23,11 +23,7 @@ from ...pagination import SyncSinglePage, AsyncSinglePage from ..._base_client import AsyncPaginator, make_request_options from ...types.hyperdrive import config_edit_params, config_create_params, config_update_params -from ...types.hyperdrive.config_get_response import ConfigGetResponse -from ...types.hyperdrive.config_edit_response import ConfigEditResponse -from ...types.hyperdrive.config_list_response import ConfigListResponse -from ...types.hyperdrive.config_create_response import ConfigCreateResponse -from ...types.hyperdrive.config_update_response import ConfigUpdateResponse +from ...types.hyperdrive.hyperdrive import Hyperdrive __all__ = ["ConfigsResource", "AsyncConfigsResource"] @@ -65,7 +61,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigCreateResponse: + ) -> Hyperdrive: """ Creates and returns a new Hyperdrive configuration. @@ -97,9 +93,9 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[ConfigCreateResponse]._unwrapper, + post_parser=ResultWrapper[Hyperdrive]._unwrapper, ), - cast_to=cast(Type[ConfigCreateResponse], ResultWrapper[ConfigCreateResponse]), + cast_to=cast(Type[Hyperdrive], ResultWrapper[Hyperdrive]), ) def update( @@ -116,7 +112,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigUpdateResponse: + ) -> Hyperdrive: """ Updates and returns the specified Hyperdrive configuration. @@ -152,9 +148,9 @@ def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[ConfigUpdateResponse]._unwrapper, + post_parser=ResultWrapper[Hyperdrive]._unwrapper, ), - cast_to=cast(Type[ConfigUpdateResponse], ResultWrapper[ConfigUpdateResponse]), + cast_to=cast(Type[Hyperdrive], ResultWrapper[Hyperdrive]), ) def list( @@ -167,7 +163,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[ConfigListResponse]: + ) -> SyncSinglePage[Hyperdrive]: """ Returns a list of Hyperdrives @@ -186,11 +182,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/hyperdrive/configs", - page=SyncSinglePage[ConfigListResponse], + page=SyncSinglePage[Hyperdrive], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=ConfigListResponse, + model=Hyperdrive, ) def delete( @@ -251,7 +247,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigEditResponse: + ) -> Hyperdrive: """Patches and returns the specified Hyperdrive configuration. Custom caching @@ -289,9 +285,9 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[ConfigEditResponse]._unwrapper, + post_parser=ResultWrapper[Hyperdrive]._unwrapper, ), - cast_to=cast(Type[ConfigEditResponse], ResultWrapper[ConfigEditResponse]), + cast_to=cast(Type[Hyperdrive], ResultWrapper[Hyperdrive]), ) def get( @@ -305,7 +301,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigGetResponse: + ) -> Hyperdrive: """ Returns the specified Hyperdrive configuration. @@ -333,9 +329,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[ConfigGetResponse]._unwrapper, + post_parser=ResultWrapper[Hyperdrive]._unwrapper, ), - cast_to=cast(Type[ConfigGetResponse], ResultWrapper[ConfigGetResponse]), + cast_to=cast(Type[Hyperdrive], ResultWrapper[Hyperdrive]), ) @@ -372,7 +368,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigCreateResponse: + ) -> Hyperdrive: """ Creates and returns a new Hyperdrive configuration. @@ -404,9 +400,9 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[ConfigCreateResponse]._unwrapper, + post_parser=ResultWrapper[Hyperdrive]._unwrapper, ), - cast_to=cast(Type[ConfigCreateResponse], ResultWrapper[ConfigCreateResponse]), + cast_to=cast(Type[Hyperdrive], ResultWrapper[Hyperdrive]), ) async def update( @@ -423,7 +419,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigUpdateResponse: + ) -> Hyperdrive: """ Updates and returns the specified Hyperdrive configuration. @@ -459,9 +455,9 @@ async def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[ConfigUpdateResponse]._unwrapper, + post_parser=ResultWrapper[Hyperdrive]._unwrapper, ), - cast_to=cast(Type[ConfigUpdateResponse], ResultWrapper[ConfigUpdateResponse]), + cast_to=cast(Type[Hyperdrive], ResultWrapper[Hyperdrive]), ) def list( @@ -474,7 +470,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ConfigListResponse, AsyncSinglePage[ConfigListResponse]]: + ) -> AsyncPaginator[Hyperdrive, AsyncSinglePage[Hyperdrive]]: """ Returns a list of Hyperdrives @@ -493,11 +489,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/hyperdrive/configs", - page=AsyncSinglePage[ConfigListResponse], + page=AsyncSinglePage[Hyperdrive], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=ConfigListResponse, + model=Hyperdrive, ) async def delete( @@ -558,7 +554,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigEditResponse: + ) -> Hyperdrive: """Patches and returns the specified Hyperdrive configuration. Custom caching @@ -596,9 +592,9 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[ConfigEditResponse]._unwrapper, + post_parser=ResultWrapper[Hyperdrive]._unwrapper, ), - cast_to=cast(Type[ConfigEditResponse], ResultWrapper[ConfigEditResponse]), + cast_to=cast(Type[Hyperdrive], ResultWrapper[Hyperdrive]), ) async def get( @@ -612,7 +608,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigGetResponse: + ) -> Hyperdrive: """ Returns the specified Hyperdrive configuration. @@ -640,9 +636,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[ConfigGetResponse]._unwrapper, + post_parser=ResultWrapper[Hyperdrive]._unwrapper, ), - cast_to=cast(Type[ConfigGetResponse], ResultWrapper[ConfigGetResponse]), + cast_to=cast(Type[Hyperdrive], ResultWrapper[Hyperdrive]), ) diff --git a/src/cloudflare/types/hyperdrive/__init__.py b/src/cloudflare/types/hyperdrive/__init__.py index 91e983052a0..dea31023f50 100644 --- a/src/cloudflare/types/hyperdrive/__init__.py +++ b/src/cloudflare/types/hyperdrive/__init__.py @@ -4,10 +4,5 @@ from .hyperdrive import Hyperdrive as Hyperdrive from .config_edit_params import ConfigEditParams as ConfigEditParams -from .config_get_response import ConfigGetResponse as ConfigGetResponse from .config_create_params import ConfigCreateParams as ConfigCreateParams -from .config_edit_response import ConfigEditResponse as ConfigEditResponse -from .config_list_response import ConfigListResponse as ConfigListResponse from .config_update_params import ConfigUpdateParams as ConfigUpdateParams -from .config_create_response import ConfigCreateResponse as ConfigCreateResponse -from .config_update_response import ConfigUpdateResponse as ConfigUpdateResponse diff --git a/src/cloudflare/types/hyperdrive/config_create_response.py b/src/cloudflare/types/hyperdrive/config_create_response.py deleted file mode 100644 index 62eb72fa4a4..00000000000 --- a/src/cloudflare/types/hyperdrive/config_create_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime - -from .hyperdrive import Hyperdrive - -__all__ = ["ConfigCreateResponse"] - - -class ConfigCreateResponse(Hyperdrive): - created_on: Optional[datetime] = None - """When the Hyperdrive configuration was created.""" - - modified_on: Optional[datetime] = None - """When the Hyperdrive configuration was last modified.""" diff --git a/src/cloudflare/types/hyperdrive/config_edit_params.py b/src/cloudflare/types/hyperdrive/config_edit_params.py index a84932552af..c95ddc7b3ab 100644 --- a/src/cloudflare/types/hyperdrive/config_edit_params.py +++ b/src/cloudflare/types/hyperdrive/config_edit_params.py @@ -12,8 +12,8 @@ "CachingHyperdriveHyperdriveCachingEnabled", "Origin", "OriginHyperdriveHyperdriveDatabase", - "OriginHyperdriveHyperdriveInternetOrigin", - "OriginHyperdriveHyperdriveOverAccessOrigin", + "OriginHyperdriveInternetOrigin", + "OriginHyperdriveOverAccessOrigin", ] @@ -71,7 +71,7 @@ class OriginHyperdriveHyperdriveDatabase(TypedDict, total=False): """The user of your origin database.""" -class OriginHyperdriveHyperdriveInternetOrigin(TypedDict, total=False): +class OriginHyperdriveInternetOrigin(TypedDict, total=False): host: Required[str] """The host (hostname or IP) of your origin database.""" @@ -79,7 +79,7 @@ class OriginHyperdriveHyperdriveInternetOrigin(TypedDict, total=False): """The port (default: 5432 for Postgres) of your origin database.""" -class OriginHyperdriveHyperdriveOverAccessOrigin(TypedDict, total=False): +class OriginHyperdriveOverAccessOrigin(TypedDict, total=False): access_client_id: Required[str] """ The Client ID of the Access token to use when connecting to the origin database. @@ -96,7 +96,5 @@ class OriginHyperdriveHyperdriveOverAccessOrigin(TypedDict, total=False): Origin: TypeAlias = Union[ - OriginHyperdriveHyperdriveDatabase, - OriginHyperdriveHyperdriveInternetOrigin, - OriginHyperdriveHyperdriveOverAccessOrigin, + OriginHyperdriveHyperdriveDatabase, OriginHyperdriveInternetOrigin, OriginHyperdriveOverAccessOrigin ] diff --git a/src/cloudflare/types/hyperdrive/config_edit_response.py b/src/cloudflare/types/hyperdrive/config_edit_response.py deleted file mode 100644 index 606afbb9217..00000000000 --- a/src/cloudflare/types/hyperdrive/config_edit_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime - -from .hyperdrive import Hyperdrive - -__all__ = ["ConfigEditResponse"] - - -class ConfigEditResponse(Hyperdrive): - created_on: Optional[datetime] = None - """When the Hyperdrive configuration was created.""" - - modified_on: Optional[datetime] = None - """When the Hyperdrive configuration was last modified.""" diff --git a/src/cloudflare/types/hyperdrive/config_get_response.py b/src/cloudflare/types/hyperdrive/config_get_response.py deleted file mode 100644 index 41d7ed270ba..00000000000 --- a/src/cloudflare/types/hyperdrive/config_get_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime - -from .hyperdrive import Hyperdrive - -__all__ = ["ConfigGetResponse"] - - -class ConfigGetResponse(Hyperdrive): - created_on: Optional[datetime] = None - """When the Hyperdrive configuration was created.""" - - modified_on: Optional[datetime] = None - """When the Hyperdrive configuration was last modified.""" diff --git a/src/cloudflare/types/hyperdrive/config_list_response.py b/src/cloudflare/types/hyperdrive/config_list_response.py deleted file mode 100644 index b3230cc4820..00000000000 --- a/src/cloudflare/types/hyperdrive/config_list_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime - -from .hyperdrive import Hyperdrive - -__all__ = ["ConfigListResponse"] - - -class ConfigListResponse(Hyperdrive): - created_on: Optional[datetime] = None - """When the Hyperdrive configuration was created.""" - - modified_on: Optional[datetime] = None - """When the Hyperdrive configuration was last modified.""" diff --git a/src/cloudflare/types/hyperdrive/config_update_response.py b/src/cloudflare/types/hyperdrive/config_update_response.py deleted file mode 100644 index 484f886e2ed..00000000000 --- a/src/cloudflare/types/hyperdrive/config_update_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime - -from .hyperdrive import Hyperdrive - -__all__ = ["ConfigUpdateResponse"] - - -class ConfigUpdateResponse(Hyperdrive): - created_on: Optional[datetime] = None - """When the Hyperdrive configuration was created.""" - - modified_on: Optional[datetime] = None - """When the Hyperdrive configuration was last modified.""" diff --git a/src/cloudflare/types/hyperdrive/hyperdrive.py b/src/cloudflare/types/hyperdrive/hyperdrive.py index 7e86822c1ee..60f7ce5e11e 100644 --- a/src/cloudflare/types/hyperdrive/hyperdrive.py +++ b/src/cloudflare/types/hyperdrive/hyperdrive.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Union, Optional +from datetime import datetime from typing_extensions import Literal, TypeAlias from ..._models import BaseModel @@ -90,3 +91,9 @@ class Hyperdrive(BaseModel): origin: Origin caching: Optional[Caching] = None + + created_on: Optional[datetime] = None + """When the Hyperdrive configuration was created.""" + + modified_on: Optional[datetime] = None + """When the Hyperdrive configuration was last modified.""" diff --git a/tests/api_resources/hyperdrive/test_configs.py b/tests/api_resources/hyperdrive/test_configs.py index 1eca48b91d3..e59fca7008c 100644 --- a/tests/api_resources/hyperdrive/test_configs.py +++ b/tests/api_resources/hyperdrive/test_configs.py @@ -10,13 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.hyperdrive import ( - ConfigGetResponse, - ConfigEditResponse, - ConfigListResponse, - ConfigCreateResponse, - ConfigUpdateResponse, -) +from cloudflare.types.hyperdrive import Hyperdrive base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -39,7 +33,7 @@ def test_method_create(self, client: Cloudflare) -> None: "user": "postgres", }, ) - assert_matches_type(ConfigCreateResponse, config, path=["response"]) + assert_matches_type(Hyperdrive, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -57,7 +51,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: }, caching={"disabled": True}, ) - assert_matches_type(ConfigCreateResponse, config, path=["response"]) + assert_matches_type(Hyperdrive, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -78,7 +72,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(ConfigCreateResponse, config, path=["response"]) + assert_matches_type(Hyperdrive, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -99,7 +93,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(ConfigCreateResponse, config, path=["response"]) + assert_matches_type(Hyperdrive, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -136,7 +130,7 @@ def test_method_update(self, client: Cloudflare) -> None: "user": "postgres", }, ) - assert_matches_type(ConfigUpdateResponse, config, path=["response"]) + assert_matches_type(Hyperdrive, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -155,7 +149,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: }, caching={"disabled": True}, ) - assert_matches_type(ConfigUpdateResponse, config, path=["response"]) + assert_matches_type(Hyperdrive, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -177,7 +171,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(ConfigUpdateResponse, config, path=["response"]) + assert_matches_type(Hyperdrive, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -199,7 +193,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(ConfigUpdateResponse, config, path=["response"]) + assert_matches_type(Hyperdrive, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -241,7 +235,7 @@ def test_method_list(self, client: Cloudflare) -> None: config = client.hyperdrive.configs.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[ConfigListResponse], config, path=["response"]) + assert_matches_type(SyncSinglePage[Hyperdrive], config, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: @@ -252,7 +246,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(SyncSinglePage[ConfigListResponse], config, path=["response"]) + assert_matches_type(SyncSinglePage[Hyperdrive], config, path=["response"]) @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: @@ -263,7 +257,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(SyncSinglePage[ConfigListResponse], config, path=["response"]) + assert_matches_type(SyncSinglePage[Hyperdrive], config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -329,7 +323,7 @@ def test_method_edit(self, client: Cloudflare) -> None: hyperdrive_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ConfigEditResponse, config, path=["response"]) + assert_matches_type(Hyperdrive, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -345,7 +339,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: "user": "postgres", }, ) - assert_matches_type(ConfigEditResponse, config, path=["response"]) + assert_matches_type(Hyperdrive, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -358,7 +352,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(ConfigEditResponse, config, path=["response"]) + assert_matches_type(Hyperdrive, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -371,7 +365,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(ConfigEditResponse, config, path=["response"]) + assert_matches_type(Hyperdrive, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -396,7 +390,7 @@ def test_method_get(self, client: Cloudflare) -> None: hyperdrive_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ConfigGetResponse, config, path=["response"]) + assert_matches_type(Hyperdrive, config, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -408,7 +402,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(ConfigGetResponse, config, path=["response"]) + assert_matches_type(Hyperdrive, config, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -420,7 +414,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(ConfigGetResponse, config, path=["response"]) + assert_matches_type(Hyperdrive, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -457,7 +451,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: "user": "postgres", }, ) - assert_matches_type(ConfigCreateResponse, config, path=["response"]) + assert_matches_type(Hyperdrive, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -475,7 +469,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare }, caching={"disabled": True}, ) - assert_matches_type(ConfigCreateResponse, config, path=["response"]) + assert_matches_type(Hyperdrive, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -496,7 +490,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(ConfigCreateResponse, config, path=["response"]) + assert_matches_type(Hyperdrive, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -517,7 +511,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(ConfigCreateResponse, config, path=["response"]) + assert_matches_type(Hyperdrive, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -554,7 +548,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: "user": "postgres", }, ) - assert_matches_type(ConfigUpdateResponse, config, path=["response"]) + assert_matches_type(Hyperdrive, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -573,7 +567,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare }, caching={"disabled": True}, ) - assert_matches_type(ConfigUpdateResponse, config, path=["response"]) + assert_matches_type(Hyperdrive, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -595,7 +589,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(ConfigUpdateResponse, config, path=["response"]) + assert_matches_type(Hyperdrive, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -617,7 +611,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(ConfigUpdateResponse, config, path=["response"]) + assert_matches_type(Hyperdrive, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -659,7 +653,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: config = await async_client.hyperdrive.configs.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[ConfigListResponse], config, path=["response"]) + assert_matches_type(AsyncSinglePage[Hyperdrive], config, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @@ -670,7 +664,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(AsyncSinglePage[ConfigListResponse], config, path=["response"]) + assert_matches_type(AsyncSinglePage[Hyperdrive], config, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: @@ -681,7 +675,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(AsyncSinglePage[ConfigListResponse], config, path=["response"]) + assert_matches_type(AsyncSinglePage[Hyperdrive], config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -747,7 +741,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: hyperdrive_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ConfigEditResponse, config, path=["response"]) + assert_matches_type(Hyperdrive, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -763,7 +757,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) "user": "postgres", }, ) - assert_matches_type(ConfigEditResponse, config, path=["response"]) + assert_matches_type(Hyperdrive, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -776,7 +770,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(ConfigEditResponse, config, path=["response"]) + assert_matches_type(Hyperdrive, config, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -789,7 +783,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(ConfigEditResponse, config, path=["response"]) + assert_matches_type(Hyperdrive, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -814,7 +808,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: hyperdrive_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ConfigGetResponse, config, path=["response"]) + assert_matches_type(Hyperdrive, config, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -826,7 +820,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(ConfigGetResponse, config, path=["response"]) + assert_matches_type(Hyperdrive, config, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -838,7 +832,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(ConfigGetResponse, config, path=["response"]) + assert_matches_type(Hyperdrive, config, path=["response"]) assert cast(Any, response.is_closed) is True From fa43cb7e7448ea42c91f9a782b1c32b19114a0dc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Feb 2025 19:08:07 +0000 Subject: [PATCH 335/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index bfdf765ffda..15b96c0fcdc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bb6df922da650979c566ff066e024180b52a44c367f9b6a2dfc4e007a71b6809.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0fb0ebdcd529d404e630477ad0683e834e913be2c08856dd225e08e8872dbfc7.yml From b77d84fa5e8f0029d1ad7a60e8df2aa591507cd4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Feb 2025 19:21:07 +0000 Subject: [PATCH 336/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 15b96c0fcdc..c8f8b2568f7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0fb0ebdcd529d404e630477ad0683e834e913be2c08856dd225e08e8872dbfc7.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2ea02e50d8914d37380cabfef50fd5e7b375be2452c2548ad4b426a02b7749df.yml From b27f1bbc27264c0fe8ee683052e0b698deb91a58 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Feb 2025 20:29:37 +0000 Subject: [PATCH 337/358] feat(api): api update (#2480) --- .stats.yml | 2 +- .../zero_trust/networks/routes/networks.py | 6 ++++-- .../resources/zero_trust/networks/routes/routes.py | 13 ++++++++----- .../resources/zero_trust/tunnels/tunnels.py | 12 +++++++----- src/cloudflare/types/shared/cloudflare_tunnel.py | 2 +- .../types/zero_trust/networks/route_list_params.py | 7 ++++--- .../networks/routes/network_delete_params.py | 2 +- src/cloudflare/types/zero_trust/networks/teamnet.py | 2 +- .../types/zero_trust/tunnel_list_params.py | 6 +++--- .../types/zero_trust/tunnel_list_response.py | 2 +- .../tunnels/cloudflared_create_response.py | 2 +- .../tunnels/cloudflared_delete_response.py | 2 +- .../zero_trust/tunnels/cloudflared_edit_response.py | 2 +- .../zero_trust/tunnels/cloudflared_get_response.py | 2 +- .../zero_trust/tunnels/cloudflared_list_response.py | 2 +- .../tunnels/warp_connector_create_response.py | 2 +- .../tunnels/warp_connector_delete_response.py | 2 +- .../tunnels/warp_connector_edit_response.py | 2 +- .../tunnels/warp_connector_get_response.py | 2 +- .../tunnels/warp_connector_list_response.py | 2 +- .../zero_trust/networks/test_routes.py | 4 ++-- tests/api_resources/zero_trust/test_tunnels.py | 4 ++-- 22 files changed, 45 insertions(+), 37 deletions(-) diff --git a/.stats.yml b/.stats.yml index c8f8b2568f7..4eaf766d199 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2ea02e50d8914d37380cabfef50fd5e7b375be2452c2548ad4b426a02b7749df.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c6a7d4749b5afe2b38af239106bfdca95d64dcea76c74eb9347a77c47753f922.yml diff --git a/src/cloudflare/resources/zero_trust/networks/routes/networks.py b/src/cloudflare/resources/zero_trust/networks/routes/networks.py index 26bd6ae9c4e..6055afb7cb2 100644 --- a/src/cloudflare/resources/zero_trust/networks/routes/networks.py +++ b/src/cloudflare/resources/zero_trust/networks/routes/networks.py @@ -116,7 +116,8 @@ def delete( ip_network_encoded: str, *, account_id: str, - tun_type: Literal["cfd_tunnel", "warp_connector", "ip_sec", "gre", "cni"] | NotGiven = NOT_GIVEN, + tun_type: Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"] + | NotGiven = NOT_GIVEN, tunnel_id: str | NotGiven = NOT_GIVEN, virtual_network_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -314,7 +315,8 @@ async def delete( ip_network_encoded: str, *, account_id: str, - tun_type: Literal["cfd_tunnel", "warp_connector", "ip_sec", "gre", "cni"] | NotGiven = NOT_GIVEN, + tun_type: Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"] + | NotGiven = NOT_GIVEN, tunnel_id: str | NotGiven = NOT_GIVEN, virtual_network_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. diff --git a/src/cloudflare/resources/zero_trust/networks/routes/routes.py b/src/cloudflare/resources/zero_trust/networks/routes/routes.py index c6f2771301f..4971629035d 100644 --- a/src/cloudflare/resources/zero_trust/networks/routes/routes.py +++ b/src/cloudflare/resources/zero_trust/networks/routes/routes.py @@ -2,7 +2,8 @@ from __future__ import annotations -from typing import Type, cast +from typing import List, Type, cast +from typing_extensions import Literal import httpx @@ -145,7 +146,8 @@ def list( page: float | NotGiven = NOT_GIVEN, per_page: float | NotGiven = NOT_GIVEN, route_id: str | NotGiven = NOT_GIVEN, - tun_types: str | NotGiven = NOT_GIVEN, + tun_types: List[Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"]] + | NotGiven = NOT_GIVEN, tunnel_id: str | NotGiven = NOT_GIVEN, virtual_network_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -179,7 +181,7 @@ def list( route_id: UUID of the route. - tun_types: The types of tunnels to filter separated by a comma. + tun_types: The types of tunnels to filter by, separated by commas. tunnel_id: UUID of the tunnel. @@ -479,7 +481,8 @@ def list( page: float | NotGiven = NOT_GIVEN, per_page: float | NotGiven = NOT_GIVEN, route_id: str | NotGiven = NOT_GIVEN, - tun_types: str | NotGiven = NOT_GIVEN, + tun_types: List[Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"]] + | NotGiven = NOT_GIVEN, tunnel_id: str | NotGiven = NOT_GIVEN, virtual_network_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -513,7 +516,7 @@ def list( route_id: UUID of the route. - tun_types: The types of tunnels to filter separated by a comma. + tun_types: The types of tunnels to filter by, separated by commas. tunnel_id: UUID of the tunnel. diff --git a/src/cloudflare/resources/zero_trust/tunnels/tunnels.py b/src/cloudflare/resources/zero_trust/tunnels/tunnels.py index 643d366411c..072d8a41208 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/tunnels.py +++ b/src/cloudflare/resources/zero_trust/tunnels/tunnels.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, Union, cast +from typing import Any, List, Union, cast from datetime import datetime from typing_extensions import Literal @@ -82,7 +82,8 @@ def list( page: float | NotGiven = NOT_GIVEN, per_page: float | NotGiven = NOT_GIVEN, status: Literal["inactive", "degraded", "healthy", "down"] | NotGiven = NOT_GIVEN, - tun_types: str | NotGiven = NOT_GIVEN, + tun_types: List[Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"]] + | NotGiven = NOT_GIVEN, uuid: str | NotGiven = NOT_GIVEN, was_active_at: Union[str, datetime] | NotGiven = NOT_GIVEN, was_inactive_at: Union[str, datetime] | NotGiven = NOT_GIVEN, @@ -116,7 +117,7 @@ def list( state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - tun_types: The types of tunnels to filter separated by a comma. + tun_types: The types of tunnels to filter by, separated by commas. uuid: UUID of the tunnel. @@ -200,7 +201,8 @@ def list( page: float | NotGiven = NOT_GIVEN, per_page: float | NotGiven = NOT_GIVEN, status: Literal["inactive", "degraded", "healthy", "down"] | NotGiven = NOT_GIVEN, - tun_types: str | NotGiven = NOT_GIVEN, + tun_types: List[Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"]] + | NotGiven = NOT_GIVEN, uuid: str | NotGiven = NOT_GIVEN, was_active_at: Union[str, datetime] | NotGiven = NOT_GIVEN, was_inactive_at: Union[str, datetime] | NotGiven = NOT_GIVEN, @@ -234,7 +236,7 @@ def list( state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - tun_types: The types of tunnels to filter separated by a comma. + tun_types: The types of tunnels to filter by, separated by commas. uuid: UUID of the tunnel. diff --git a/src/cloudflare/types/shared/cloudflare_tunnel.py b/src/cloudflare/types/shared/cloudflare_tunnel.py index 9fbc6e6c16a..72ab7605722 100644 --- a/src/cloudflare/types/shared/cloudflare_tunnel.py +++ b/src/cloudflare/types/shared/cloudflare_tunnel.py @@ -92,5 +92,5 @@ class CloudflareTunnel(BaseModel): it has no connections to the Cloudflare Edge). """ - tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "ip_sec", "gre", "cni"]] = None + tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"]] = None """The type of tunnel.""" diff --git a/src/cloudflare/types/zero_trust/networks/route_list_params.py b/src/cloudflare/types/zero_trust/networks/route_list_params.py index fd2c8fabac3..3d1b86f0b2c 100644 --- a/src/cloudflare/types/zero_trust/networks/route_list_params.py +++ b/src/cloudflare/types/zero_trust/networks/route_list_params.py @@ -2,7 +2,8 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing import List +from typing_extensions import Literal, Required, TypedDict __all__ = ["RouteListParams"] @@ -41,8 +42,8 @@ class RouteListParams(TypedDict, total=False): route_id: str """UUID of the route.""" - tun_types: str - """The types of tunnels to filter separated by a comma.""" + tun_types: List[Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"]] + """The types of tunnels to filter by, separated by commas.""" tunnel_id: str """UUID of the tunnel.""" diff --git a/src/cloudflare/types/zero_trust/networks/routes/network_delete_params.py b/src/cloudflare/types/zero_trust/networks/routes/network_delete_params.py index 73d466c6529..c99764abdd3 100644 --- a/src/cloudflare/types/zero_trust/networks/routes/network_delete_params.py +++ b/src/cloudflare/types/zero_trust/networks/routes/network_delete_params.py @@ -11,7 +11,7 @@ class NetworkDeleteParams(TypedDict, total=False): account_id: Required[str] """Cloudflare account ID""" - tun_type: Literal["cfd_tunnel", "warp_connector", "ip_sec", "gre", "cni"] + tun_type: Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"] """The type of tunnel.""" tunnel_id: str diff --git a/src/cloudflare/types/zero_trust/networks/teamnet.py b/src/cloudflare/types/zero_trust/networks/teamnet.py index 768b4564a71..014fdd1a522 100644 --- a/src/cloudflare/types/zero_trust/networks/teamnet.py +++ b/src/cloudflare/types/zero_trust/networks/teamnet.py @@ -28,7 +28,7 @@ class Teamnet(BaseModel): network: Optional[str] = None """The private IPv4 or IPv6 range connected by the route, in CIDR notation.""" - tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "ip_sec", "gre", "cni"]] = None + tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"]] = None """The type of tunnel.""" tunnel_id: Optional[str] = None diff --git a/src/cloudflare/types/zero_trust/tunnel_list_params.py b/src/cloudflare/types/zero_trust/tunnel_list_params.py index b13b2cfe8a0..cd805857059 100644 --- a/src/cloudflare/types/zero_trust/tunnel_list_params.py +++ b/src/cloudflare/types/zero_trust/tunnel_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Union +from typing import List, Union from datetime import datetime from typing_extensions import Literal, Required, Annotated, TypedDict @@ -49,8 +49,8 @@ class TunnelListParams(TypedDict, total=False): it has no connections to the Cloudflare Edge). """ - tun_types: str - """The types of tunnels to filter separated by a comma.""" + tun_types: List[Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"]] + """The types of tunnels to filter by, separated by commas.""" uuid: str """UUID of the tunnel.""" diff --git a/src/cloudflare/types/zero_trust/tunnel_list_response.py b/src/cloudflare/types/zero_trust/tunnel_list_response.py index 63faf45009e..b65b6e08c81 100644 --- a/src/cloudflare/types/zero_trust/tunnel_list_response.py +++ b/src/cloudflare/types/zero_trust/tunnel_list_response.py @@ -87,7 +87,7 @@ class TunnelWARPConnectorTunnel(BaseModel): it has no connections to the Cloudflare Edge). """ - tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "ip_sec", "gre", "cni"]] = None + tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"]] = None """The type of tunnel.""" diff --git a/src/cloudflare/types/zero_trust/tunnels/cloudflared_create_response.py b/src/cloudflare/types/zero_trust/tunnels/cloudflared_create_response.py index 752e3006709..13de5355d35 100644 --- a/src/cloudflare/types/zero_trust/tunnels/cloudflared_create_response.py +++ b/src/cloudflare/types/zero_trust/tunnels/cloudflared_create_response.py @@ -87,7 +87,7 @@ class TunnelWARPConnectorTunnel(BaseModel): it has no connections to the Cloudflare Edge). """ - tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "ip_sec", "gre", "cni"]] = None + tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"]] = None """The type of tunnel.""" diff --git a/src/cloudflare/types/zero_trust/tunnels/cloudflared_delete_response.py b/src/cloudflare/types/zero_trust/tunnels/cloudflared_delete_response.py index 3c1aeb12d4a..25417e8160c 100644 --- a/src/cloudflare/types/zero_trust/tunnels/cloudflared_delete_response.py +++ b/src/cloudflare/types/zero_trust/tunnels/cloudflared_delete_response.py @@ -87,7 +87,7 @@ class TunnelWARPConnectorTunnel(BaseModel): it has no connections to the Cloudflare Edge). """ - tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "ip_sec", "gre", "cni"]] = None + tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"]] = None """The type of tunnel.""" diff --git a/src/cloudflare/types/zero_trust/tunnels/cloudflared_edit_response.py b/src/cloudflare/types/zero_trust/tunnels/cloudflared_edit_response.py index 5ff0745d83b..4140727e9dc 100644 --- a/src/cloudflare/types/zero_trust/tunnels/cloudflared_edit_response.py +++ b/src/cloudflare/types/zero_trust/tunnels/cloudflared_edit_response.py @@ -87,7 +87,7 @@ class TunnelWARPConnectorTunnel(BaseModel): it has no connections to the Cloudflare Edge). """ - tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "ip_sec", "gre", "cni"]] = None + tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"]] = None """The type of tunnel.""" diff --git a/src/cloudflare/types/zero_trust/tunnels/cloudflared_get_response.py b/src/cloudflare/types/zero_trust/tunnels/cloudflared_get_response.py index c0f64bf678d..8922821757a 100644 --- a/src/cloudflare/types/zero_trust/tunnels/cloudflared_get_response.py +++ b/src/cloudflare/types/zero_trust/tunnels/cloudflared_get_response.py @@ -87,7 +87,7 @@ class TunnelWARPConnectorTunnel(BaseModel): it has no connections to the Cloudflare Edge). """ - tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "ip_sec", "gre", "cni"]] = None + tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"]] = None """The type of tunnel.""" diff --git a/src/cloudflare/types/zero_trust/tunnels/cloudflared_list_response.py b/src/cloudflare/types/zero_trust/tunnels/cloudflared_list_response.py index a916eb409a0..afd55d8a105 100644 --- a/src/cloudflare/types/zero_trust/tunnels/cloudflared_list_response.py +++ b/src/cloudflare/types/zero_trust/tunnels/cloudflared_list_response.py @@ -87,7 +87,7 @@ class TunnelWARPConnectorTunnel(BaseModel): it has no connections to the Cloudflare Edge). """ - tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "ip_sec", "gre", "cni"]] = None + tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"]] = None """The type of tunnel.""" diff --git a/src/cloudflare/types/zero_trust/tunnels/warp_connector_create_response.py b/src/cloudflare/types/zero_trust/tunnels/warp_connector_create_response.py index 7be06b46d60..bc2cd27d871 100644 --- a/src/cloudflare/types/zero_trust/tunnels/warp_connector_create_response.py +++ b/src/cloudflare/types/zero_trust/tunnels/warp_connector_create_response.py @@ -87,7 +87,7 @@ class TunnelWARPConnectorTunnel(BaseModel): it has no connections to the Cloudflare Edge). """ - tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "ip_sec", "gre", "cni"]] = None + tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"]] = None """The type of tunnel.""" diff --git a/src/cloudflare/types/zero_trust/tunnels/warp_connector_delete_response.py b/src/cloudflare/types/zero_trust/tunnels/warp_connector_delete_response.py index 6a583a0b78f..b4725944f18 100644 --- a/src/cloudflare/types/zero_trust/tunnels/warp_connector_delete_response.py +++ b/src/cloudflare/types/zero_trust/tunnels/warp_connector_delete_response.py @@ -87,7 +87,7 @@ class TunnelWARPConnectorTunnel(BaseModel): it has no connections to the Cloudflare Edge). """ - tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "ip_sec", "gre", "cni"]] = None + tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"]] = None """The type of tunnel.""" diff --git a/src/cloudflare/types/zero_trust/tunnels/warp_connector_edit_response.py b/src/cloudflare/types/zero_trust/tunnels/warp_connector_edit_response.py index 1d18431b519..835354bfe77 100644 --- a/src/cloudflare/types/zero_trust/tunnels/warp_connector_edit_response.py +++ b/src/cloudflare/types/zero_trust/tunnels/warp_connector_edit_response.py @@ -87,7 +87,7 @@ class TunnelWARPConnectorTunnel(BaseModel): it has no connections to the Cloudflare Edge). """ - tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "ip_sec", "gre", "cni"]] = None + tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"]] = None """The type of tunnel.""" diff --git a/src/cloudflare/types/zero_trust/tunnels/warp_connector_get_response.py b/src/cloudflare/types/zero_trust/tunnels/warp_connector_get_response.py index 4cae0478951..4c70a22c57e 100644 --- a/src/cloudflare/types/zero_trust/tunnels/warp_connector_get_response.py +++ b/src/cloudflare/types/zero_trust/tunnels/warp_connector_get_response.py @@ -87,7 +87,7 @@ class TunnelWARPConnectorTunnel(BaseModel): it has no connections to the Cloudflare Edge). """ - tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "ip_sec", "gre", "cni"]] = None + tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"]] = None """The type of tunnel.""" diff --git a/src/cloudflare/types/zero_trust/tunnels/warp_connector_list_response.py b/src/cloudflare/types/zero_trust/tunnels/warp_connector_list_response.py index 8b16326f813..d87ab182899 100644 --- a/src/cloudflare/types/zero_trust/tunnels/warp_connector_list_response.py +++ b/src/cloudflare/types/zero_trust/tunnels/warp_connector_list_response.py @@ -87,7 +87,7 @@ class TunnelWARPConnectorTunnel(BaseModel): it has no connections to the Cloudflare Edge). """ - tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "ip_sec", "gre", "cni"]] = None + tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"]] = None """The type of tunnel.""" diff --git a/tests/api_resources/zero_trust/networks/test_routes.py b/tests/api_resources/zero_trust/networks/test_routes.py index d4d11fee0df..88876d04d01 100644 --- a/tests/api_resources/zero_trust/networks/test_routes.py +++ b/tests/api_resources/zero_trust/networks/test_routes.py @@ -97,7 +97,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: page=1, per_page=1, route_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - tun_types="cfd_tunnel,warp_connector", + tun_types=["cfd_tunnel"], tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", virtual_network_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", ) @@ -370,7 +370,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) page=1, per_page=1, route_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", - tun_types="cfd_tunnel,warp_connector", + tun_types=["cfd_tunnel"], tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", virtual_network_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", ) diff --git a/tests/api_resources/zero_trust/test_tunnels.py b/tests/api_resources/zero_trust/test_tunnels.py index bb0f5803d31..7d7c38b15d5 100644 --- a/tests/api_resources/zero_trust/test_tunnels.py +++ b/tests/api_resources/zero_trust/test_tunnels.py @@ -38,7 +38,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: page=1, per_page=1, status="inactive", - tun_types="cfd_tunnel,warp_connector", + tun_types=["cfd_tunnel"], uuid="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", was_active_at=parse_datetime("2009-11-10T23:00:00Z"), was_inactive_at=parse_datetime("2009-11-10T23:00:00Z"), @@ -99,7 +99,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) page=1, per_page=1, status="inactive", - tun_types="cfd_tunnel,warp_connector", + tun_types=["cfd_tunnel"], uuid="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", was_active_at=parse_datetime("2009-11-10T23:00:00Z"), was_inactive_at=parse_datetime("2009-11-10T23:00:00Z"), From aa9ffe9593c26756fe7605b0618183a1211b69bc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Feb 2025 20:32:26 +0000 Subject: [PATCH 338/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 4eaf766d199..81317ebc7cb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c6a7d4749b5afe2b38af239106bfdca95d64dcea76c74eb9347a77c47753f922.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6e3afe01ab1ae1f8bad119a51ad56e6a980c41601b086f286fc9e7f51a876181.yml From 3994c22f305c6a0611dfb646f90e23ca0a65b90d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Feb 2025 21:21:49 +0000 Subject: [PATCH 339/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 81317ebc7cb..0692511038a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6e3afe01ab1ae1f8bad119a51ad56e6a980c41601b086f286fc9e7f51a876181.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d76e010425c6648c4de9f3b1ac5e2fc44f366fd1cd7104b9aa15d2dbdcc41311.yml From fe98b1da5bed21d62ff14cb1c84f8f89da4a03ac Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Feb 2025 23:40:38 +0000 Subject: [PATCH 340/358] docs: update URLs from stainlessapi.com to stainless.com (#2481) More details at https://www.stainless.com/changelog/stainless-com --- SECURITY.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SECURITY.md b/SECURITY.md index f04da23d126..0735c892994 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,3 +1,3 @@ # Reporting Security Vulnerabilities -Please see [this page](https://www.cloudflare.com/.well-known/security.txt) for information on how to report a vulnerability to Cloudflare. Thanks! \ No newline at end of file +Please see [this page](https://www.cloudflare.com/.well-known/security.txt) for information on how to report a vulnerability to Cloudflare. Thanks! From 015fd49ae475c61824d5eab08193a92eea6657e1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Feb 2025 22:02:03 +0000 Subject: [PATCH 341/358] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 0692511038a..e2bd3b00c0d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1542 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d76e010425c6648c4de9f3b1ac5e2fc44f366fd1cd7104b9aa15d2dbdcc41311.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e012b9b204109b8d5c55ea91e745d2abe7d21e614105d56662c7c01b45ccc813.yml From e98bd2880f1f33083e0ce1e585bcaa635eda4176 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Feb 2025 22:50:46 +0000 Subject: [PATCH 342/358] chore(docs): update client docstring (#2483) --- src/cloudflare/_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cloudflare/_client.py b/src/cloudflare/_client.py index fe72ce537f8..751377aa1a7 100644 --- a/src/cloudflare/_client.py +++ b/src/cloudflare/_client.py @@ -285,7 +285,7 @@ def __init__( # part of our public interface in the future. _strict_response_validation: bool = False, ) -> None: - """Construct a new synchronous cloudflare client instance. + """Construct a new synchronous Cloudflare client instance. This automatically infers the following arguments from their corresponding environment variables if they are not provided: - `api_token` from `CLOUDFLARE_API_TOKEN` @@ -1074,7 +1074,7 @@ def __init__( # part of our public interface in the future. _strict_response_validation: bool = False, ) -> None: - """Construct a new async cloudflare client instance. + """Construct a new async AsyncCloudflare client instance. This automatically infers the following arguments from their corresponding environment variables if they are not provided: - `api_token` from `CLOUDFLARE_API_TOKEN` From 6739a4123bcf82fe58143ac51e69f590be8c1822 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Feb 2025 23:26:24 +0000 Subject: [PATCH 343/358] feat(browsing_rendering): add support for subresources (#2484) --- .stats.yml | 2 +- api.md | 56 +++ src/cloudflare/_client.py | 41 ++ .../resources/browsing_rendering/__init__.py | 89 ++++ .../browsing_rendering/browsing_rendering.py | 230 +++++++++ .../resources/browsing_rendering/content.py | 442 +++++++++++++++++ .../resources/browsing_rendering/pdf.py | 448 +++++++++++++++++ .../resources/browsing_rendering/scrape.py | 442 +++++++++++++++++ .../browsing_rendering/screenshot.py | 459 ++++++++++++++++++ .../resources/browsing_rendering/snapshot.py | 446 +++++++++++++++++ .../types/browsing_rendering/__init__.py | 13 + .../content_create_params.py | 235 +++++++++ .../content_create_response.py | 7 + .../browsing_rendering/pdf_create_params.py | 235 +++++++++ .../scrape_create_params.py | 242 +++++++++ .../scrape_create_response.py | 53 ++ .../screenshot_create_params.py | 276 +++++++++++ .../screenshot_create_response.py | 22 + .../snapshot_create_params.py | 235 +++++++++ .../snapshot_create_response.py | 14 + .../browsing_rendering/__init__.py | 1 + .../browsing_rendering/test_content.py | 249 ++++++++++ .../browsing_rendering/test_pdf.py | 306 ++++++++++++ .../browsing_rendering/test_scrape.py | 260 ++++++++++ .../browsing_rendering/test_screenshot.py | 288 +++++++++++ .../browsing_rendering/test_snapshot.py | 250 ++++++++++ 26 files changed, 5340 insertions(+), 1 deletion(-) create mode 100644 src/cloudflare/resources/browsing_rendering/__init__.py create mode 100644 src/cloudflare/resources/browsing_rendering/browsing_rendering.py create mode 100644 src/cloudflare/resources/browsing_rendering/content.py create mode 100644 src/cloudflare/resources/browsing_rendering/pdf.py create mode 100644 src/cloudflare/resources/browsing_rendering/scrape.py create mode 100644 src/cloudflare/resources/browsing_rendering/screenshot.py create mode 100644 src/cloudflare/resources/browsing_rendering/snapshot.py create mode 100644 src/cloudflare/types/browsing_rendering/__init__.py create mode 100644 src/cloudflare/types/browsing_rendering/content_create_params.py create mode 100644 src/cloudflare/types/browsing_rendering/content_create_response.py create mode 100644 src/cloudflare/types/browsing_rendering/pdf_create_params.py create mode 100644 src/cloudflare/types/browsing_rendering/scrape_create_params.py create mode 100644 src/cloudflare/types/browsing_rendering/scrape_create_response.py create mode 100644 src/cloudflare/types/browsing_rendering/screenshot_create_params.py create mode 100644 src/cloudflare/types/browsing_rendering/screenshot_create_response.py create mode 100644 src/cloudflare/types/browsing_rendering/snapshot_create_params.py create mode 100644 src/cloudflare/types/browsing_rendering/snapshot_create_response.py create mode 100644 tests/api_resources/browsing_rendering/__init__.py create mode 100644 tests/api_resources/browsing_rendering/test_content.py create mode 100644 tests/api_resources/browsing_rendering/test_pdf.py create mode 100644 tests/api_resources/browsing_rendering/test_scrape.py create mode 100644 tests/api_resources/browsing_rendering/test_screenshot.py create mode 100644 tests/api_resources/browsing_rendering/test_snapshot.py diff --git a/.stats.yml b/.stats.yml index e2bd3b00c0d..82881b3069d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 1542 +configured_endpoints: 1547 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e012b9b204109b8d5c55ea91e745d2abe7d21e614105d56662c7c01b45ccc813.yml diff --git a/api.md b/api.md index 152c0300d8e..e6a0e09a3bb 100644 --- a/api.md +++ b/api.md @@ -8913,3 +8913,59 @@ from cloudflare.types.security_center.insights import TypeGetResponse Methods: - client.security_center.insights.type.get(\*, account_id, zone_id, \*\*params) -> Optional[TypeGetResponse] + +# BrowsingRendering + +## Content + +Types: + +```python +from cloudflare.types.browsing_rendering import ContentCreateResponse +``` + +Methods: + +- client.browsing_rendering.content.create(account_id, \*\*params) -> str + +## Pdf + +Methods: + +- client.browsing_rendering.pdf.create(account_id, \*\*params) -> BinaryAPIResponse + +## Scrape + +Types: + +```python +from cloudflare.types.browsing_rendering import ScrapeCreateResponse +``` + +Methods: + +- client.browsing_rendering.scrape.create(account_id, \*\*params) -> ScrapeCreateResponse + +## Screenshot + +Types: + +```python +from cloudflare.types.browsing_rendering import ScreenshotCreateResponse +``` + +Methods: + +- client.browsing_rendering.screenshot.create(account_id, \*\*params) -> ScreenshotCreateResponse + +## Snapshot + +Types: + +```python +from cloudflare.types.browsing_rendering import SnapshotCreateResponse +``` + +Methods: + +- client.browsing_rendering.snapshot.create(account_id, \*\*params) -> Optional[SnapshotCreateResponse] diff --git a/src/cloudflare/_client.py b/src/cloudflare/_client.py index 751377aa1a7..a6a8fea6b89 100644 --- a/src/cloudflare/_client.py +++ b/src/cloudflare/_client.py @@ -112,6 +112,7 @@ resource_sharing, mtls_certificates, url_normalization, + browsing_rendering, custom_nameservers, managed_transforms, client_certificates, @@ -211,6 +212,10 @@ from .resources.custom_hostnames.custom_hostnames import CustomHostnamesResource, AsyncCustomHostnamesResource from .resources.resource_sharing.resource_sharing import ResourceSharingResource, AsyncResourceSharingResource from .resources.mtls_certificates.mtls_certificates import MTLSCertificatesResource, AsyncMTLSCertificatesResource + from .resources.browsing_rendering.browsing_rendering import ( + BrowsingRenderingResource, + AsyncBrowsingRenderingResource, + ) from .resources.custom_certificates.custom_certificates import ( CustomCertificatesResource, AsyncCustomCertificatesResource, @@ -859,6 +864,12 @@ def security_center(self) -> SecurityCenterResource: return SecurityCenterResource(self) + @cached_property + def browsing_rendering(self) -> BrowsingRenderingResource: + from .resources.browsing_rendering import BrowsingRenderingResource + + return BrowsingRenderingResource(self) + @cached_property def with_raw_response(self) -> CloudflareWithRawResponse: return CloudflareWithRawResponse(self) @@ -1648,6 +1659,12 @@ def security_center(self) -> AsyncSecurityCenterResource: return AsyncSecurityCenterResource(self) + @cached_property + def browsing_rendering(self) -> AsyncBrowsingRenderingResource: + from .resources.browsing_rendering import AsyncBrowsingRenderingResource + + return AsyncBrowsingRenderingResource(self) + @cached_property def with_raw_response(self) -> AsyncCloudflareWithRawResponse: return AsyncCloudflareWithRawResponse(self) @@ -2372,6 +2389,12 @@ def security_center(self) -> security_center.SecurityCenterResourceWithRawRespon return SecurityCenterResourceWithRawResponse(self._client.security_center) + @cached_property + def browsing_rendering(self) -> browsing_rendering.BrowsingRenderingResourceWithRawResponse: + from .resources.browsing_rendering import BrowsingRenderingResourceWithRawResponse + + return BrowsingRenderingResourceWithRawResponse(self._client.browsing_rendering) + class AsyncCloudflareWithRawResponse: _client: AsyncCloudflare @@ -2915,6 +2938,12 @@ def security_center(self) -> security_center.AsyncSecurityCenterResourceWithRawR return AsyncSecurityCenterResourceWithRawResponse(self._client.security_center) + @cached_property + def browsing_rendering(self) -> browsing_rendering.AsyncBrowsingRenderingResourceWithRawResponse: + from .resources.browsing_rendering import AsyncBrowsingRenderingResourceWithRawResponse + + return AsyncBrowsingRenderingResourceWithRawResponse(self._client.browsing_rendering) + class CloudflareWithStreamedResponse: _client: Cloudflare @@ -3458,6 +3487,12 @@ def security_center(self) -> security_center.SecurityCenterResourceWithStreaming return SecurityCenterResourceWithStreamingResponse(self._client.security_center) + @cached_property + def browsing_rendering(self) -> browsing_rendering.BrowsingRenderingResourceWithStreamingResponse: + from .resources.browsing_rendering import BrowsingRenderingResourceWithStreamingResponse + + return BrowsingRenderingResourceWithStreamingResponse(self._client.browsing_rendering) + class AsyncCloudflareWithStreamedResponse: _client: AsyncCloudflare @@ -4011,6 +4046,12 @@ def security_center(self) -> security_center.AsyncSecurityCenterResourceWithStre return AsyncSecurityCenterResourceWithStreamingResponse(self._client.security_center) + @cached_property + def browsing_rendering(self) -> browsing_rendering.AsyncBrowsingRenderingResourceWithStreamingResponse: + from .resources.browsing_rendering import AsyncBrowsingRenderingResourceWithStreamingResponse + + return AsyncBrowsingRenderingResourceWithStreamingResponse(self._client.browsing_rendering) + Client = Cloudflare diff --git a/src/cloudflare/resources/browsing_rendering/__init__.py b/src/cloudflare/resources/browsing_rendering/__init__.py new file mode 100644 index 00000000000..535de83381a --- /dev/null +++ b/src/cloudflare/resources/browsing_rendering/__init__.py @@ -0,0 +1,89 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .pdf import ( + PdfResource, + AsyncPdfResource, + PdfResourceWithRawResponse, + AsyncPdfResourceWithRawResponse, + PdfResourceWithStreamingResponse, + AsyncPdfResourceWithStreamingResponse, +) +from .scrape import ( + ScrapeResource, + AsyncScrapeResource, + ScrapeResourceWithRawResponse, + AsyncScrapeResourceWithRawResponse, + ScrapeResourceWithStreamingResponse, + AsyncScrapeResourceWithStreamingResponse, +) +from .content import ( + ContentResource, + AsyncContentResource, + ContentResourceWithRawResponse, + AsyncContentResourceWithRawResponse, + ContentResourceWithStreamingResponse, + AsyncContentResourceWithStreamingResponse, +) +from .snapshot import ( + SnapshotResource, + AsyncSnapshotResource, + SnapshotResourceWithRawResponse, + AsyncSnapshotResourceWithRawResponse, + SnapshotResourceWithStreamingResponse, + AsyncSnapshotResourceWithStreamingResponse, +) +from .screenshot import ( + ScreenshotResource, + AsyncScreenshotResource, + ScreenshotResourceWithRawResponse, + AsyncScreenshotResourceWithRawResponse, + ScreenshotResourceWithStreamingResponse, + AsyncScreenshotResourceWithStreamingResponse, +) +from .browsing_rendering import ( + BrowsingRenderingResource, + AsyncBrowsingRenderingResource, + BrowsingRenderingResourceWithRawResponse, + AsyncBrowsingRenderingResourceWithRawResponse, + BrowsingRenderingResourceWithStreamingResponse, + AsyncBrowsingRenderingResourceWithStreamingResponse, +) + +__all__ = [ + "ContentResource", + "AsyncContentResource", + "ContentResourceWithRawResponse", + "AsyncContentResourceWithRawResponse", + "ContentResourceWithStreamingResponse", + "AsyncContentResourceWithStreamingResponse", + "PdfResource", + "AsyncPdfResource", + "PdfResourceWithRawResponse", + "AsyncPdfResourceWithRawResponse", + "PdfResourceWithStreamingResponse", + "AsyncPdfResourceWithStreamingResponse", + "ScrapeResource", + "AsyncScrapeResource", + "ScrapeResourceWithRawResponse", + "AsyncScrapeResourceWithRawResponse", + "ScrapeResourceWithStreamingResponse", + "AsyncScrapeResourceWithStreamingResponse", + "ScreenshotResource", + "AsyncScreenshotResource", + "ScreenshotResourceWithRawResponse", + "AsyncScreenshotResourceWithRawResponse", + "ScreenshotResourceWithStreamingResponse", + "AsyncScreenshotResourceWithStreamingResponse", + "SnapshotResource", + "AsyncSnapshotResource", + "SnapshotResourceWithRawResponse", + "AsyncSnapshotResourceWithRawResponse", + "SnapshotResourceWithStreamingResponse", + "AsyncSnapshotResourceWithStreamingResponse", + "BrowsingRenderingResource", + "AsyncBrowsingRenderingResource", + "BrowsingRenderingResourceWithRawResponse", + "AsyncBrowsingRenderingResourceWithRawResponse", + "BrowsingRenderingResourceWithStreamingResponse", + "AsyncBrowsingRenderingResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/browsing_rendering/browsing_rendering.py b/src/cloudflare/resources/browsing_rendering/browsing_rendering.py new file mode 100644 index 00000000000..3291d3a8ed5 --- /dev/null +++ b/src/cloudflare/resources/browsing_rendering/browsing_rendering.py @@ -0,0 +1,230 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .pdf import ( + PdfResource, + AsyncPdfResource, + PdfResourceWithRawResponse, + AsyncPdfResourceWithRawResponse, + PdfResourceWithStreamingResponse, + AsyncPdfResourceWithStreamingResponse, +) +from .scrape import ( + ScrapeResource, + AsyncScrapeResource, + ScrapeResourceWithRawResponse, + AsyncScrapeResourceWithRawResponse, + ScrapeResourceWithStreamingResponse, + AsyncScrapeResourceWithStreamingResponse, +) +from .content import ( + ContentResource, + AsyncContentResource, + ContentResourceWithRawResponse, + AsyncContentResourceWithRawResponse, + ContentResourceWithStreamingResponse, + AsyncContentResourceWithStreamingResponse, +) +from .snapshot import ( + SnapshotResource, + AsyncSnapshotResource, + SnapshotResourceWithRawResponse, + AsyncSnapshotResourceWithRawResponse, + SnapshotResourceWithStreamingResponse, + AsyncSnapshotResourceWithStreamingResponse, +) +from ..._compat import cached_property +from .screenshot import ( + ScreenshotResource, + AsyncScreenshotResource, + ScreenshotResourceWithRawResponse, + AsyncScreenshotResourceWithRawResponse, + ScreenshotResourceWithStreamingResponse, + AsyncScreenshotResourceWithStreamingResponse, +) +from ..._resource import SyncAPIResource, AsyncAPIResource + +__all__ = ["BrowsingRenderingResource", "AsyncBrowsingRenderingResource"] + + +class BrowsingRenderingResource(SyncAPIResource): + @cached_property + def content(self) -> ContentResource: + return ContentResource(self._client) + + @cached_property + def pdf(self) -> PdfResource: + return PdfResource(self._client) + + @cached_property + def scrape(self) -> ScrapeResource: + return ScrapeResource(self._client) + + @cached_property + def screenshot(self) -> ScreenshotResource: + return ScreenshotResource(self._client) + + @cached_property + def snapshot(self) -> SnapshotResource: + return SnapshotResource(self._client) + + @cached_property + def with_raw_response(self) -> BrowsingRenderingResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return BrowsingRenderingResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> BrowsingRenderingResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return BrowsingRenderingResourceWithStreamingResponse(self) + + +class AsyncBrowsingRenderingResource(AsyncAPIResource): + @cached_property + def content(self) -> AsyncContentResource: + return AsyncContentResource(self._client) + + @cached_property + def pdf(self) -> AsyncPdfResource: + return AsyncPdfResource(self._client) + + @cached_property + def scrape(self) -> AsyncScrapeResource: + return AsyncScrapeResource(self._client) + + @cached_property + def screenshot(self) -> AsyncScreenshotResource: + return AsyncScreenshotResource(self._client) + + @cached_property + def snapshot(self) -> AsyncSnapshotResource: + return AsyncSnapshotResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncBrowsingRenderingResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncBrowsingRenderingResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncBrowsingRenderingResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncBrowsingRenderingResourceWithStreamingResponse(self) + + +class BrowsingRenderingResourceWithRawResponse: + def __init__(self, browsing_rendering: BrowsingRenderingResource) -> None: + self._browsing_rendering = browsing_rendering + + @cached_property + def content(self) -> ContentResourceWithRawResponse: + return ContentResourceWithRawResponse(self._browsing_rendering.content) + + @cached_property + def pdf(self) -> PdfResourceWithRawResponse: + return PdfResourceWithRawResponse(self._browsing_rendering.pdf) + + @cached_property + def scrape(self) -> ScrapeResourceWithRawResponse: + return ScrapeResourceWithRawResponse(self._browsing_rendering.scrape) + + @cached_property + def screenshot(self) -> ScreenshotResourceWithRawResponse: + return ScreenshotResourceWithRawResponse(self._browsing_rendering.screenshot) + + @cached_property + def snapshot(self) -> SnapshotResourceWithRawResponse: + return SnapshotResourceWithRawResponse(self._browsing_rendering.snapshot) + + +class AsyncBrowsingRenderingResourceWithRawResponse: + def __init__(self, browsing_rendering: AsyncBrowsingRenderingResource) -> None: + self._browsing_rendering = browsing_rendering + + @cached_property + def content(self) -> AsyncContentResourceWithRawResponse: + return AsyncContentResourceWithRawResponse(self._browsing_rendering.content) + + @cached_property + def pdf(self) -> AsyncPdfResourceWithRawResponse: + return AsyncPdfResourceWithRawResponse(self._browsing_rendering.pdf) + + @cached_property + def scrape(self) -> AsyncScrapeResourceWithRawResponse: + return AsyncScrapeResourceWithRawResponse(self._browsing_rendering.scrape) + + @cached_property + def screenshot(self) -> AsyncScreenshotResourceWithRawResponse: + return AsyncScreenshotResourceWithRawResponse(self._browsing_rendering.screenshot) + + @cached_property + def snapshot(self) -> AsyncSnapshotResourceWithRawResponse: + return AsyncSnapshotResourceWithRawResponse(self._browsing_rendering.snapshot) + + +class BrowsingRenderingResourceWithStreamingResponse: + def __init__(self, browsing_rendering: BrowsingRenderingResource) -> None: + self._browsing_rendering = browsing_rendering + + @cached_property + def content(self) -> ContentResourceWithStreamingResponse: + return ContentResourceWithStreamingResponse(self._browsing_rendering.content) + + @cached_property + def pdf(self) -> PdfResourceWithStreamingResponse: + return PdfResourceWithStreamingResponse(self._browsing_rendering.pdf) + + @cached_property + def scrape(self) -> ScrapeResourceWithStreamingResponse: + return ScrapeResourceWithStreamingResponse(self._browsing_rendering.scrape) + + @cached_property + def screenshot(self) -> ScreenshotResourceWithStreamingResponse: + return ScreenshotResourceWithStreamingResponse(self._browsing_rendering.screenshot) + + @cached_property + def snapshot(self) -> SnapshotResourceWithStreamingResponse: + return SnapshotResourceWithStreamingResponse(self._browsing_rendering.snapshot) + + +class AsyncBrowsingRenderingResourceWithStreamingResponse: + def __init__(self, browsing_rendering: AsyncBrowsingRenderingResource) -> None: + self._browsing_rendering = browsing_rendering + + @cached_property + def content(self) -> AsyncContentResourceWithStreamingResponse: + return AsyncContentResourceWithStreamingResponse(self._browsing_rendering.content) + + @cached_property + def pdf(self) -> AsyncPdfResourceWithStreamingResponse: + return AsyncPdfResourceWithStreamingResponse(self._browsing_rendering.pdf) + + @cached_property + def scrape(self) -> AsyncScrapeResourceWithStreamingResponse: + return AsyncScrapeResourceWithStreamingResponse(self._browsing_rendering.scrape) + + @cached_property + def screenshot(self) -> AsyncScreenshotResourceWithStreamingResponse: + return AsyncScreenshotResourceWithStreamingResponse(self._browsing_rendering.screenshot) + + @cached_property + def snapshot(self) -> AsyncSnapshotResourceWithStreamingResponse: + return AsyncSnapshotResourceWithStreamingResponse(self._browsing_rendering.snapshot) diff --git a/src/cloudflare/resources/browsing_rendering/content.py b/src/cloudflare/resources/browsing_rendering/content.py new file mode 100644 index 00000000000..1052a303661 --- /dev/null +++ b/src/cloudflare/resources/browsing_rendering/content.py @@ -0,0 +1,442 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, List, Type, Iterable, Optional, cast +from typing_extensions import Literal + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._wrappers import ResultWrapper +from ..._base_client import make_request_options +from ...types.browsing_rendering import content_create_params +from ...types.browsing_rendering.content_create_response import ContentCreateResponse + +__all__ = ["ContentResource", "AsyncContentResource"] + + +class ContentResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> ContentResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return ContentResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ContentResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return ContentResourceWithStreamingResponse(self) + + def create( + self, + account_id: str, + *, + cache_ttl: float | NotGiven = NOT_GIVEN, + add_script_tag: Iterable[content_create_params.AddScriptTag] | NotGiven = NOT_GIVEN, + add_style_tag: Iterable[content_create_params.AddStyleTag] | NotGiven = NOT_GIVEN, + allow_request_pattern: List[str] | NotGiven = NOT_GIVEN, + allow_resource_types: List[ + Literal[ + "document", + "stylesheet", + "image", + "media", + "font", + "script", + "texttrack", + "xhr", + "fetch", + "prefetch", + "eventsource", + "websocket", + "manifest", + "signedexchange", + "ping", + "cspviolationreport", + "preflight", + "other", + ] + ] + | NotGiven = NOT_GIVEN, + authenticate: content_create_params.Authenticate | NotGiven = NOT_GIVEN, + best_attempt: bool | NotGiven = NOT_GIVEN, + cookies: Iterable[content_create_params.Cookie] | NotGiven = NOT_GIVEN, + emulate_media_type: str | NotGiven = NOT_GIVEN, + goto_options: content_create_params.GotoOptions | NotGiven = NOT_GIVEN, + html: str | NotGiven = NOT_GIVEN, + reject_request_pattern: List[str] | NotGiven = NOT_GIVEN, + reject_resource_types: List[ + Literal[ + "document", + "stylesheet", + "image", + "media", + "font", + "script", + "texttrack", + "xhr", + "fetch", + "prefetch", + "eventsource", + "websocket", + "manifest", + "signedexchange", + "ping", + "cspviolationreport", + "preflight", + "other", + ] + ] + | NotGiven = NOT_GIVEN, + set_extra_http_headers: Dict[str, str] | NotGiven = NOT_GIVEN, + set_java_script_enabled: bool | NotGiven = NOT_GIVEN, + url: str | NotGiven = NOT_GIVEN, + user_agent: str | NotGiven = NOT_GIVEN, + viewport: content_create_params.Viewport | NotGiven = NOT_GIVEN, + wait_for_selector: content_create_params.WaitForSelector | NotGiven = NOT_GIVEN, + wait_for_timeout: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """Fetches rendered HTML content from provided URL or HTML. + + Check available options + like `goToOptions` and `waitFor*` to control page load behaviour. + + Args: + account_id: Account ID. + + cache_ttl: Cache TTL default is 5s. Set to 0 to disable. + + add_script_tag: Adds a `